:root {
  --navy: #17243e;
  --blue: #225ad7;
  --blue-dark: #1745b0;
  --blue-soft: #eef4ff;
  --bg: #f5f7fb;
  --card: #fff;
  --line: #e5eaf2;
  --muted: #758198;
  --green: #1ca77d;
  --orange: #e89b31;
  --red: #dc5962;
  --shadow: 0 15px 45px rgba(25, 55, 105, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--navy);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background:
    radial-gradient(circle at 15% 20%, rgba(71, 124, 245, .22), transparent 28rem),
    #f6f8fd;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vw;
  color: white;
  background: linear-gradient(145deg, #172f6c, #225ad7);
}
.brand-line { display: flex; gap: 12px; align-items: center; font-size: 22px; font-weight: 750; }
.brand-icon { display: grid; width: 44px; height: 44px; place-items: center; background: white; color: var(--blue); border-radius: 14px; }
.auth-brand h1 { max-width: 580px; margin: 56px 0 18px; font-size: clamp(40px, 5vw, 70px); line-height: 1.08; letter-spacing: -.06em; }
.auth-brand p { max-width: 500px; margin: 0; color: rgba(255,255,255,.76); font-size: 16px; line-height: 1.9; }
.auth-points { display: flex; gap: 20px; margin-top: 50px; font-size: 13px; color: rgba(255,255,255,.82); }
.auth-panel { display: grid; place-items: center; padding: 40px; }
.auth-card { width: min(420px, 100%); padding: 38px; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 9px; font-size: 28px; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin-bottom: 25px; background: #f2f5fa; border-radius: 11px; }
.tabs button { padding: 10px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; }
.tabs button.active { color: var(--blue); background: white; box-shadow: 0 3px 12px rgba(30,55,100,.08); font-weight: 700; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px; color: var(--navy); background: white;
  border: 1px solid #dbe1eb; border-radius: 9px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(34,90,215,.09); }
.primary-btn { width: 100%; padding: 13px 18px; color: white; background: var(--blue); border: 0; border-radius: 10px; font-weight: 700; }
.primary-btn:hover { background: var(--blue-dark); }
.form-message { min-height: 20px; margin-top: 14px; color: var(--red); font-size: 12px; text-align: center; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; color: #dce5f8; background: #14213c; }
.sidebar .brand-line { padding: 0 10px 27px; color: white; font-size: 18px; }
.sidebar .brand-icon { width: 36px; height: 36px; border-radius: 11px; }
.nav-label { padding: 18px 12px 8px; color: #71809e; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.nav-item { width: 100%; display: flex; gap: 10px; align-items: center; padding: 11px 12px; margin: 3px 0; color: #aebbd3; background: transparent; border: 0; border-radius: 9px; font-size: 13px; text-align: left; }
.nav-item.active, .nav-item:hover { color: white; background: rgba(76,125,237,.2); }
.nav-dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; opacity: .8; }
.sidebar-bottom { position: absolute; right: 16px; bottom: 20px; left: 16px; }
.main-area { min-width: 0; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 18px; }
.user-chip { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.avatar { display: grid; width: 34px; height: 34px; color: white; background: var(--blue); border-radius: 50%; place-items: center; font-weight: 700; }
.content { padding: 28px 30px 50px; }
.section-view { display: none; }
.section-view.active { display: block; }
.page-title { margin: 0 0 5px; font-size: 24px; letter-spacing: -.03em; }
.page-subtitle { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.stat-card, .panel { background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(30,55,100,.04); }
.stat-card { padding: 20px; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin: 12px 0 3px; font-size: 26px; }
.stat-card small { color: var(--green); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; margin-top: 16px; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head a, .link-btn { color: var(--blue); background: none; border: 0; font-size: 11px; }
.quick-detect { display: grid; min-height: 235px; padding: 28px; text-align: center; border: 1.5px dashed #cbd5e6; border-radius: 12px; place-items: center; }
.quick-detect strong { display: block; margin: 13px 0 5px; }
.quick-detect p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.small-btn { padding: 9px 14px; color: white; background: var(--blue); border: 0; border-radius: 8px; font-size: 11px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan-card { position: relative; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.plan-card.featured { border-color: #8eafff; box-shadow: 0 12px 35px rgba(34,90,215,.12); }
.plan-tag { position: absolute; top: 13px; right: 13px; padding: 4px 7px; color: var(--blue); background: var(--blue-soft); border-radius: 6px; font-size: 9px; }
.plan-card h3 { margin: 0 0 14px; font-size: 16px; }
.plan-price { font-size: 30px; font-weight: 800; }
.plan-price small { color: var(--muted); font-size: 11px; font-weight: 500; }
.plan-card p { min-height: 38px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 10px; color: var(--muted); background: #f7f9fc; font-weight: 600; text-align: left; white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 700; }
.badge.green { color: var(--green); background: #ecfaf5; }
.badge.orange { color: var(--orange); background: #fff7e9; }
.badge.red { color: var(--red); background: #fff0f1; }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.action-btn { padding: 5px 8px; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 5px; font-size: 9px; }
.modal { position: fixed; z-index: 30; inset: 0; display: grid; padding: 20px; background: rgba(10,20,40,.48); place-items: center; }
.modal-card { width: min(440px, 100%); padding: 24px; background: white; border-radius: 16px; box-shadow: var(--shadow); }
.modal-card h3 { margin: 0 0 20px; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.ghost-btn { padding: 9px 14px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 8px; }
.chart { height: 230px; display: flex; gap: 10px; align-items: flex-end; padding-top: 20px; }
.chart-col { flex: 1; display: grid; gap: 5px; justify-items: center; height: 100%; align-content: end; }
.chart-bar { width: 60%; min-height: 3px; background: linear-gradient(#5d8df4, #225ad7); border-radius: 6px 6px 2px 2px; }
.chart-col span { color: var(--muted); font-size: 9px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.toggle-row input { width: 17px; height: 17px; }
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .layout { grid-template-columns: 76px 1fr; }
  .sidebar { padding: 20px 10px; }
  .sidebar .brand-line span:last-child, .nav-item span:last-child, .nav-label { display: none; }
  .nav-item { justify-content: center; }
  .sidebar-bottom { right: 10px; left: 10px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .auth-panel { padding: 16px; }
  .auth-card { padding: 25px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; top: auto; width: auto; height: 62px; display: flex; padding: 7px; overflow-x: auto; }
  .sidebar .brand-line, .sidebar .nav-label, .sidebar-bottom { display: none; }
  .nav-item { min-width: 50px; margin: 0; }
  .content { padding: 20px 14px 85px; }
  .topbar { padding: 0 15px; }
  .stats-grid, .settings-grid { grid-template-columns: 1fr; }
}
