/* ===== 全站基础样式 + 双主题 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== Classic 主题（默认：蓝白简洁） ===== */
body.theme-classic { --primary: #2563eb; --primary-light: #dbeafe; --bg: #f8fafc; --card-bg: #fff; --text: #1e293b; --text-muted: #64748b; --border: #e2e8f0; --header-bg: #fff; --accent: #f59e0b; background: var(--bg); color: var(--text); }
body.theme-classic .header { background: var(--header-bg); border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,.05); }

/* ===== Modern 主题（深色渐变） ===== */
body.theme-modern { --primary: #8b5cf6; --primary-light: #ede9fe; --bg: #0f0f1a; --card-bg: #1a1a2e; --text: #e4e4ef; --text-muted: #8888a0; --border: #2a2a4a; --header-bg: #16162a; --accent: #ec4899; background: var(--bg); color: var(--text); }
body.theme-modern .header { background: var(--header-bg); border-bottom: 1px solid var(--border); }
body.theme-modern .card { background: var(--card-bg); border: 1px solid var(--border); }
body.theme-modern .product-card { background: var(--card-bg); border: 1px solid var(--border); }
body.theme-modern .nav a { color: var(--text); }
body.theme-modern input, body.theme-modern select, body.theme-modern textarea { background: var(--card-bg); color: var(--text); border-color: var(--border); }

/* ===== 通用组件 ===== */
.header { position: sticky; top: 0; z-index: 100; background: var(--header-bg); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.nav .logo { font-size: 20px; font-weight: 700; color: var(--primary); }
.nav .menu { display: flex; gap: 24px; align-items: center; }
.nav .menu a { color: var(--text); font-size: 14px; transition: color .2s; }
.nav .menu a:hover, .nav .menu a.active { color: var(--primary); }
.btn { display: inline-block; padding: 8px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; transition: all .2s; background: var(--primary); color: #fff; }
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-danger { background: #ef4444; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.hero { padding: 60px 0; text-align: center; }
.hero h1 { font-size: 36px; margin-bottom: 12px; }
.hero p { color: var(--text-muted); font-size: 16px; }
.section { padding: 40px 0; }
.section-title { font-size: 22px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.product-card { background: var(--card-bg); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); transition: transform .2s, box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.product-card .cover { width: 100%; height: 160px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 48px; }
.product-card .body { padding: 16px; }
.product-card .title { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.product-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.price { color: #ef4444; font-weight: 700; font-size: 18px; }
.price .origin { color: var(--text-muted); font-size: 12px; text-decoration: line-through; font-weight: 400; margin-left: 4px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; background: var(--primary-light); color: var(--primary); }
.tag-vip { background: #fef3c7; color: #b45309; }
.category-bar { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.category-chip { padding: 8px 18px; border-radius: 20px; background: var(--card-bg); border: 1px solid var(--border); cursor: pointer; font-size: 14px; transition: all .2s; }
.category-chip.active, .category-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.footer { margin-top: auto; padding: 30px 0; text-align: center; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card-bg); color: var(--text); }
.auth-box { max-width: 400px; margin: 60px auto; padding: 32px; background: var(--card-bg); border-radius: 16px; border: 1px solid var(--border); }
.auth-box h2 { text-align: center; margin-bottom: 24px; }

/* 会员卡 */
.vip-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
.vip-card { background: var(--card-bg); border: 2px solid var(--border); border-radius: 16px; padding: 30px; text-align: center; position: relative; transition: all .2s; }
.vip-card:hover, .vip-card.featured { border-color: var(--accent); transform: scale(1.03); }
.vip-card .badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 2px 12px; border-radius: 10px; font-size: 12px; }
.vip-card .price { font-size: 36px; margin: 12px 0; }
.vip-card .period { color: var(--text-muted); font-size: 14px; }

/* 表格 */
.table-wrap { overflow-x: auto; background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--primary-light); font-weight: 600; }

/* 提示 */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 8px; color: #fff; z-index: 999; display: none; }
.toast.show { display: block; }
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }

/* 后台布局 */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--header-bg); border-right: 1px solid var(--border); padding: 20px 0; }
.admin-sidebar a { display: block; padding: 10px 20px; color: var(--text); font-size: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--primary-light); color: var(--primary); }
.admin-main { flex: 1; padding: 24px; }
.admin-main h1 { font-size: 20px; margin-bottom: 20px; }

@media (max-width: 768px) {
  .vip-cards { grid-template-columns: 1fr; }
  .nav .menu { gap: 12px; }
  .hero h1 { font-size: 24px; }
}
