/* 通用变量 */
:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }

/* 导航 */
.navbar { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 22px; font-weight: 700; color: var(--text); }
.logo span { color: var(--brand); }
.logo-center { display: block; text-align: center; margin-bottom: 20px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 15px; }
.nav-links a:hover { color: var(--brand); }

/* 按钮 */
.btn { display: inline-block; padding: 10px 22px; border-radius: 8px; font-size: 15px; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-block { width: 100%; }

/* Hero */
.hero { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: #fff; padding: 80px 24px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 56px; margin-bottom: 16px; letter-spacing: -1px; }
.hero .subtitle { font-size: 20px; opacity: 0.92; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }
.hero .btn-primary { background: #fff; color: var(--brand); }
.hero .btn-primary:hover { background: #f3f4f6; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-version { margin-top: 20px; font-size: 14px; opacity: 0.8; }

/* 区块 */
.section { max-width: 1100px; margin: 0 auto; padding: 72px 24px; }
.section-alt { background: var(--bg-alt); max-width: none; }
.section-alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-title { font-size: 32px; text-align: center; margin-bottom: 12px; }
.section-desc { text-align: center; color: var(--text-muted); margin-bottom: 32px; }

/* 功能卡片 */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 40px; }
.feature-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: transform 0.2s, box-shadow 0.2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 14px; }

/* 平台标签 */
.platform-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 28px; }
.platform-tag { background: #fff; border: 1px solid var(--border); padding: 8px 18px; border-radius: 20px; font-size: 14px; font-weight: 500; }
.sku-points { max-width: 600px; margin: 0 auto; color: var(--text-muted); font-size: 15px; line-height: 2; }

/* 下载卡片 */
.download-card { max-width: 560px; margin: 0 auto; background: var(--bg-alt); border-radius: var(--radius); padding: 36px; text-align: center; border: 1px solid var(--border); }
.download-card .loading { color: var(--text-muted); }
.download-card .ver { font-size: 28px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.download-card .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.download-card .dl-btn { font-size: 17px; padding: 14px 36px; }
.download-card .file-list { margin-top: 24px; text-align: left; }
.download-card .file-list a { display: block; padding: 8px 0; border-bottom: 1px dashed var(--border); color: var(--brand); font-size: 14px; }

/* 登录注册 */
.auth-body { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: #fff; border-radius: var(--radius); padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.auth-card h2 { text-align: center; margin-bottom: 24px; }
.auth-card label { display: block; font-size: 14px; color: var(--text-muted); margin: 14px 0 6px; }
.auth-card input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.auth-card input:focus { outline: none; border-color: var(--brand); }
.auth-card .btn { margin-top: 20px; }
.auth-msg { color: #dc2626; font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

/* 页脚 */
.footer { background: var(--bg-alt); text-align: center; padding: 32px 24px; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border); }

@media (max-width: 600px) {
  .hero h1 { font-size: 40px; }
  .nav-links { gap: 14px; }
}

/* ============ 租户品牌 ============ */
.auth-body { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); }
.logo.has-img { display: inline-flex; align-items: center; }
.logo.has-img img { height: 26px; display: block; }
.logo-center.has-img { display: flex; justify-content: center; margin-bottom: 20px; }
.logo-center.has-img img { height: 36px; }
.brand-slogan { text-align: center; color: var(--text-muted); font-size: 13px; margin: -8px 0 18px; min-height: 18px; }

/* ============ 租户控制台 ============ */
.admin-body { background: var(--bg-alt); min-height: 100vh; }
.admin-header { background: #fff; border-bottom: 1px solid var(--border); }
.admin-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 16px; }
.admin-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-muted); }
.admin-user a { color: var(--text-muted); cursor: pointer; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 22px 24px 48px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tabs button { padding: 8px 16px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.admin-tabs button.active { border-color: var(--brand); color: var(--brand); background: rgba(79, 70, 229, 0.06); font-weight: 600; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.panel h3 { font-size: 16px; margin-bottom: 4px; }
.panel .desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-grid input, .form-grid select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; }
.form-grid input[type="color"] { padding: 3px; height: 38px; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 7px; }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text-muted); }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); }
.tbl tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill-on { background: #dcfce7; color: #15803d; }
.pill-off { background: #f1f5f9; color: #64748b; }
.pill-warn { background: #fef3c7; color: #b45309; }
.brand-preview { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 10px; background: linear-gradient(120deg, #0f172a, #1e293b); color: #fff; margin-bottom: 18px; }
.brand-preview img { height: 34px; display: block; }
.brand-preview .mark { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--brand); }
.brand-preview .t { font-weight: 600; font-size: 15px; }
.brand-preview .s { font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: none; }
.switch-row .t { font-size: 14px; }
.switch-row .d { font-size: 12px; color: var(--text-muted); }
.switch2 { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch2 input { display: none; }
.switch2 i { position: absolute; inset: 0; background: #cfd8e4; border-radius: 999px; transition: 0.2s; cursor: pointer; }
.switch2 i::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: 0.2s; }
.switch2 input:checked + i { background: var(--brand); }
.switch2 input:checked + i::after { transform: translateX(20px); }
.switch2 input:disabled + i { opacity: 0.55; cursor: not-allowed; }
.empty-tip { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.toast-tip { position: fixed; right: 24px; bottom: 24px; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; transform: translateY(8px); transition: 0.2s; pointer-events: none; }
.toast-tip.show { opacity: 1; transform: translateY(0); }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
