/* ============================================================
   青柠校园 · 统一设计系统
   ============================================================ */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bg: #f3f6fc;
  --bg-soft: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f9;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e4eaf3;
  --line-strong: #d5ddea;
  --brand: #4f46e5;
  --brand-2: #0ea5e9;
  --brand-soft: #eef0ff;
  --ok: #0ea472;
  --ok-soft: #e7f8f1;
  --warn: #d97706;
  --warn-soft: #fef4e6;
  --danger: #e2483d;
  --danger-soft: #fdeeec;
  --info: #2563eb;
  --info-soft: #eaf1fe;
  --nav: #0b1220;
  --nav-2: #111c33;
  --nav-ink: #cbd5e1;
  --nav-muted: #7c8aa5;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .04);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, .18);
  --sidebar-w: 250px;
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg: #0a0f1c;
  --bg-soft: #0e1526;
  --surface: #111a2c;
  --surface-2: #0d1524;
  --surface-3: #182238;
  --ink: #e9eefb;
  --ink-2: #c3cddf;
  --muted: #8d9bb3;
  --muted-2: #64748b;
  --line: #1f2b43;
  --line-strong: #2a3752;
  --brand: #7c7cf5;
  --brand-2: #38bdf8;
  --brand-soft: #1b2140;
  --ok: #34d399;
  --ok-soft: #10291f;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --danger: #f87171;
  --danger-soft: #2b1518;
  --info: #60a5fa;
  --info-soft: #12213c;
  --nav: #070c16;
  --nav-2: #0d1628;
  --nav-ink: #c7d2e5;
  --nav-muted: #64748b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --shadow-lg: 0 26px 80px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(79, 70, 229, .10), transparent 60%),
    radial-gradient(800px 460px at 100% 0%, rgba(14, 165, 233, .08), transparent 55%);
  z-index: 0;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(800px 460px at 100% 0%, rgba(14, 165, 233, .10), transparent 55%);
}
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .85; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }
::selection { background: rgba(79, 70, 229, .2); }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  color: var(--nav-ink);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  transition: transform .25s ease;
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 20px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 22px rgba(79, 70, 229, .45);
  flex: 0 0 38px;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--nav-muted); letter-spacing: .5px; }
.nav-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-group-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--nav-muted); padding: 14px 12px 7px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px; color: var(--nav-ink);
  font-weight: 500; font-size: 13.5px; margin-bottom: 3px;
  border: 1px solid transparent; transition: background .18s, color .18s, border-color .18s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; opacity: .8; flex: 0 0 18px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; opacity: 1; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.26), rgba(14,165,233,.10));
  color: #fff;
  border-color: rgba(129,140,248,.28);
}
.nav-item.active svg { opacity: 1; color: #a5b4fc; }
.nav-item .nav-badge { margin-left: auto; background: rgba(255,255,255,.12); color: #e2e8f0; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; }
.sidebar-footer { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); margin-top: 10px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.side-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #0ea5e9); color: #fff; font-weight: 700; font-size: 13px; flex: 0 0 34px; }
.side-user-info { min-width: 0; }
.side-user-name { color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role { color: var(--nav-muted); font-size: 11px; }
.side-logout { margin-left: auto; background: transparent; border: 0; color: var(--nav-muted); padding: 6px; border-radius: 8px; }
.side-logout:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-logout svg { width: 17px; height: 17px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 30px;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; color: var(--ink); }
.menu-toggle svg { width: 19px; height: 19px; display: block; }
.page-heading { min-width: 0; }
.page-heading h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.page-heading p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.quota-pill {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-weight: 600; font-size: 12.5px;
}
.quota-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.quota-pill.member .dot { background: #f59e0b; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: .18s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.content { padding: 26px 30px 50px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------- page header ---------- */
.page-intro { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-intro h2 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.page-intro p { color: var(--muted); margin-top: 4px; }
.page-intro .intro-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-head .head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.card-head .head-actions > * { flex: 0 0 auto; }
.card-head .head-actions .search-box .input { width: 200px; }
.card-head .head-actions .select { width: auto; min-width: 120px; }
.card-body { padding: 20px 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 17px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,.12), transparent 70%);
}
.stat-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.info { background: var(--info-soft); color: var(--info); }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.03em; margin-top: 12px; line-height: 1.1; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.trend { font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; }
.trend.up { color: var(--ok); background: var(--ok-soft); }
.trend.down { color: var(--danger); background: var(--danger-soft); }

/* ---------- grid ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); gap: 18px; }
.grid-main > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13px;
  transition: .18s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--muted-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #6d5ef0 55%, var(--brand-2));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .28);
}
.btn-primary:hover { box-shadow: 0 11px 26px rgba(79, 70, 229, .36); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(226,72,61,.2); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { padding: 12px 22px; font-size: 14.5px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-group { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 11px; gap: 2px; }
.btn-group button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 12px; }
.btn-group button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- forms ---------- */
.field { margin-bottom: 15px; }
.field > label:not(.switch) { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.field > label.switch { margin-bottom: 0; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field .hint.text-warn { color: var(--warn); font-weight: 650; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.slider-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--brand); height: 22px; cursor: pointer; }
.slider-val { min-width: 76px; text-align: right; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: .2s; flex: 0 0 38px; }
.switch .track::after { content: ""; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch .switch-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.badge.ok, .badge.success { background: var(--ok-soft); color: var(--ok); }
.badge.failed, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn, .badge.running, .badge.captcha { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.gray { background: var(--surface-3); color: var(--muted); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
.table th {
  text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 11px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 12.8px; vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-main { font-weight: 650; color: var(--ink); }
.table .cell-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table.compact td { padding: 10px 12px; }
.code-chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px; background: var(--surface-3); padding: 4px 8px; border-radius: 7px; letter-spacing: .02em;
}
.code-chip button { border: 0; background: transparent; color: var(--muted); padding: 0; display: grid; place-items: center; }
.code-chip button:hover { color: var(--brand); }
.code-chip svg { width: 13px; height: 13px; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 20px; border-top: 1px solid var(--line); }
.pagination .info { font-size: 12px; color: var(--muted); margin-right: auto; }
.page-btn { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 15px; border: 0; background: transparent; color: var(--muted);
  font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.pill-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 12px; }
.pill-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.pill-tab.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(420px, .95fr); position: relative; z-index: 1; }
.auth-art {
  position: relative; overflow: hidden; padding: 54px 58px; color: #eef2ff;
  background: linear-gradient(150deg, #0b1220 0%, #151b3d 44%, #0b2a3f 100%);
  display: flex; flex-direction: column;
}
.auth-art::before {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.55), transparent 65%);
  top: -160px; right: -140px; filter: blur(10px);
}
.auth-art::after {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(14,165,233,.36), transparent 65%);
  bottom: -200px; left: -120px;
}
.auth-art .brand { position: relative; z-index: 2; padding-left: 0; }
.auth-art .brand-name { font-size: 18px; }
.auth-art .brand-sub { color: #94a3b8; }
.auth-hero { position: relative; z-index: 2; margin-top: auto; margin-bottom: auto; padding: 40px 0; }
.auth-hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: #93c5fd; font-weight: 700; }
.auth-hero h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.12; letter-spacing: -.035em; margin: 16px 0 18px; font-weight: 750; }
.auth-hero h1 span { background: linear-gradient(100deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #aebbd4; font-size: 15px; max-width: 460px; line-height: 1.75; }
.auth-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 34px; max-width: 500px; }
.auth-feature { display: flex; gap: 11px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.auth-feature svg { width: 20px; height: 20px; color: #67e8f9; flex: 0 0 20px; margin-top: 1px; }
.auth-feature b { display: block; font-size: 12.5px; color: #e2e8f0; }
.auth-feature span { font-size: 11.5px; color: #8fa0bb; }
.auth-foot { position: relative; z-index: 2; color: #64748b; font-size: 11.5px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 34px; background: var(--bg); }
.auth-card { width: min(430px, 100%); }
.auth-card .auth-title { font-size: 26px; font-weight: 750; letter-spacing: -.03em; }
.auth-card .auth-desc { color: var(--muted); margin: 7px 0 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.auth-switch a { font-weight: 700; cursor: pointer; }
.auth-legal { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 26px; line-height: 1.7; }
.auth-legal a { color: var(--muted); }

/* ---------- announcement / alerts ---------- */
.announcement {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 13px;
  background: linear-gradient(120deg, var(--brand-soft), var(--info-soft));
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  font-size: 12.8px; color: var(--ink-2); line-height: 1.65;
}
.announcement svg { width: 17px; height: 17px; color: var(--brand); flex: 0 0 17px; margin-top: 2px; }
.announcement .an-red { color: var(--danger); font-weight: 700; }
.alert-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: 0 0 9px; background: var(--info); }
.alert-dot.warning { background: var(--warn); }
.alert-dot.danger { background: var(--danger); }
.alert-item b { font-size: 13px; }
.alert-item p { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- student / task cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.entity-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px;
  transition: .18s; position: relative;
}
.entity-card:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.entity-top { display: flex; align-items: flex-start; gap: 12px; }
.entity-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-soft), var(--info-soft)); color: var(--brand); flex: 0 0 42px; }
.entity-avatar svg { width: 21px; height: 21px; }
.entity-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.entity-sub { font-size: 11.8px; color: var(--muted); margin-top: 2px; }
.entity-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.entity-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 11px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.entity-stat b { display: block; font-size: 12.5px; }
.entity-stat span { font-size: 10.5px; color: var(--muted); }
.entity-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.entity-actions .btn { flex: 1; }

.task-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.task-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.task-card.signed { opacity: .72; }
.task-title { font-weight: 700; font-size: 13.8px; }
.task-meta { font-size: 11.8px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta svg { width: 13px; height: 13px; }
.task-flags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty .empty-icon { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 14px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted-2); }
.empty .empty-icon svg { width: 25px; height: 25px; }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.loading { display: inline-flex; gap: 5px; align-items: center; }
.loading i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: bounce 1s infinite; }
.loading i:nth-child(2) { animation-delay: .12s; }
.loading i:nth-child(3) { animation-delay: .24s; }
@keyframes bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 650; text-align: right; word-break: break-all; }
.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { width: 100%; height: 260px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.avatar-letter { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; flex: 0 0 34px; }
.avatar-letter.orange { background: var(--warn-soft); color: var(--warn); }
.avatar-letter.green { background: var(--ok-soft); color: var(--ok); }
.copy-inline { display: inline-flex; align-items: center; gap: 4px; }
.hidden { display: none !important; }
.text-ok { color: var(--ok); } .text-danger { color: var(--danger); } .text-warn { color: var(--warn); } .text-brand { color: var(--brand); }
.bg-soft { background: var(--surface-2); }
.rounded { border-radius: var(--radius); }
.select-sm { padding: 6px 28px 6px 10px; border-radius: 8px; font-size: 12px; }
.input-sm { padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.search-box { position: relative; min-width: 190px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.search-box .input { padding-left: 34px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 13, 24, .55); backdrop-filter: blur(5px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s ease; }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; animation: popIn .2s cubic-bezier(.2,.8,.3,1.1); }
.modal-card.wide { width: min(900px, 100%); }
.modal-card.xwide { width: min(1100px, 100%); }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-close { margin-left: auto; border: 0; background: var(--surface-3); color: var(--muted); width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 31px; }
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 8px 22px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 9px; justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-foot .btn { min-width: 92px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 9px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: 12.8px; color: var(--ink-2); animation: toastIn .25s cubic-bezier(.2,.8,.3,1.1);
}
.toast svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.toast.success svg { color: var(--ok); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--info); }
.toast.warn svg { color: var(--warn); }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- qr / images ---------- */
.qr-box { background: #fff; border-radius: 14px; padding: 12px; display: inline-flex; border: 1px solid var(--line); }
.qr-box img { width: 210px; height: 210px; display: block; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo-slot { aspect-ratio: 1; border: 1.5px dashed var(--line-strong); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11px; cursor: pointer; overflow: hidden; position: relative; background: var(--surface-2); }
.photo-slot:hover { border-color: var(--brand); color: var(--brand); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .photo-del { position: absolute; top: 5px; right: 5px; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 6px; padding: 3px; display: grid; place-items: center; }
.photo-slot .photo-del svg { width: 12px; height: 12px; }
.captcha-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.captcha-cell { border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; position: relative; background: var(--surface-3); aspect-ratio: 1; }
.captcha-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.captcha-cell.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.captcha-cell.selected::after { content: "✓"; position: absolute; top: 3px; right: 5px; color: #fff; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.code-result { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px; max-height: 230px; overflow: auto; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; line-height: 1.9; letter-spacing: .03em; }

/* ---------- agent tree ---------- */
.tree-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tree-row:last-child { border-bottom: 0; }
.tree-indent { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; }
.tree-line { width: 12px; height: 12px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 4px; margin-right: 2px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-main { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 256px; }
  .content { overflow-x: hidden; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; place-items: center; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-intro h2 { font-size: 20px; }
  .stat-value { font-size: 24px; }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .modal-card { max-height: 94vh; }
}
@media (max-width: 560px) {
  .page-intro .intro-actions { margin-left: 0; width: 100%; }
  .page-intro .intro-actions .btn { flex: 1; }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 15px 16px; }
  .topbar-right .quota-pill span.label { display: none; }
  .auth-panel { padding: 22px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .captcha-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- settings ---------- */
.settings-hero {
  display: flex; align-items: center; gap: 22px; padding: 26px 28px;
  border-radius: var(--radius-lg); background: linear-gradient(135deg, #111c33, #1b2a4a 55%, #123a4a);
  color: #fff; margin-bottom: 20px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.settings-hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(14,165,233,.22), transparent 65%);
}
.settings-avatar {
  width: 66px; height: 66px; border-radius: 20px; flex: 0 0 66px;
  background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff;
  display: grid; place-items: center; font-size: 26px; font-weight: 800;
  box-shadow: 0 10px 24px rgba(79,70,229,.35); position: relative; z-index: 1;
}
.settings-hero-main { min-width: 0; position: relative; z-index: 1; }
.settings-hero-main h2 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; color: #fff; }
.settings-email { color: #aebbd4; font-size: 13px; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.settings-copy { border: 0; background: rgba(255,255,255,.1); color: #cbd5e1; border-radius: 7px; padding: 3px; display: grid; place-items: center; }
.settings-copy:hover { color: #fff; background: rgba(255,255,255,.18); }
.settings-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.settings-tags .badge { background: rgba(255,255,255,.1); color: #cbd5e1; }
.settings-tags .badge.brand { background: rgba(99,102,241,.3); color: #c7d2fe; }
.settings-hero-stats { margin-left: auto; display: flex; gap: 28px; position: relative; z-index: 1; }
.settings-stat b { display: block; font-size: 20px; font-weight: 750; color: #fff; line-height: 1.2; }
.settings-stat span { font-size: 11px; color: #8fa0bb; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-card .card-head { align-items: center; }
.settings-head-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: 0 0 36px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; }
.setting-row-info b { display: block; font-size: 13px; }
.setting-row-info span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 44px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 7px; border-radius: 8px; display: grid; place-items: center; }
.password-toggle:hover { background: var(--surface-3); color: var(--brand); }
.settings-qr { display: flex; align-items: center; gap: 16px; }
.settings-qr img { width: 132px; height: 132px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; object-fit: contain; }
.about-brand { display: flex; align-items: center; gap: 12px; }
.about-brand b { font-size: 15px; }
.settings-note { font-size: 12px; color: var(--muted); line-height: 1.9; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
@media (max-width: 860px) {
  .settings-hero { flex-direction: column; align-items: flex-start; }
  .settings-hero-stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---------- mobile polish ---------- */
@media (max-width: 560px) {
  .quota-pill { padding: 6px 10px; }
  .quota-pill, .quota-pill b { white-space: nowrap; }
  .card-head { flex-wrap: wrap; gap: 8px 12px; }
  .card-head h3 { white-space: nowrap; }
  .card-head .head-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .card-head .head-actions .search-box { flex: 1 1 100%; min-width: 0; }
  .card-head .head-actions .search-box .input { width: 100%; }
  .card-head .head-actions .select { flex: 1 1 auto; min-width: 0; }
  .kv { gap: 10px; }
  .kv span { white-space: nowrap; flex: 0 0 auto; }
  .kv b { text-align: right; overflow-wrap: anywhere; }
  .page-heading { min-width: 0; }
  .page-heading h1, .page-heading p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table .cell-main, .table .cell-sub { white-space: nowrap; }
  .entity-actions .btn { flex: 1 1 calc(50% - 4px); }
  .stat-grid .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .table { min-width: 700px; }
  .table .code-chip { white-space: nowrap; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; min-width: 0; }
  .btn-sm { padding: 8px 12px; }
  .icon-btn { width: 40px; height: 40px; }
}

.auth-mobile-brand { display: none; }
@media (max-width: 1180px) {
  .auth-mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
  .auth-mobile-brand .brand-name { color: var(--ink); font-size: 19px; font-weight: 750; }
  .auth-mobile-brand .brand-sub { color: var(--muted); }
}
@media (max-width: 560px) {
  .table th:first-child, .table td:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
  .table th:first-child { background: var(--surface-2); }
  .table tbody tr:hover td:first-child { background: var(--surface-2); }
  .table-wrap { scrollbar-width: thin; }
}

/* ---------- mobile fixed app shell + compact overview ---------- */
.mobile-log-list { display: none; }
.mobile-log-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.mobile-log-item:last-of-type { border-bottom: 0; }
.mobile-log-main { flex: 1; min-width: 0; }
.mobile-log-main b { display: block; font-size: 12.8px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-log-main span { display: block; font-size: 10.8px; color: var(--muted); margin-top: 2px; }
.mobile-log-list .btn { margin: 8px 16px 12px; width: calc(100% - 32px); }
@media (max-width: 860px) {
  .app-shell { height: 100vh; height: 100dvh; min-height: 0; }
  .main { height: 100vh; height: 100dvh; overflow: hidden; }
  .content { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .overview-side, .overview-logs-desktop { display: none; }
  .overview-logs-card .head-actions { display: none; }
  .overview-logs-card .card-head { padding: 14px 16px 10px; }
  .mobile-log-list { display: flex; flex-direction: column; }
}
@media (max-width: 560px) {
  .overview-stats { gap: 10px; margin-bottom: 14px; }
  .overview-stats .stat-card { padding: 14px; }
  .overview-stats .stat-top { font-size: 11.5px; }
  .overview-stats .stat-value { font-size: 22px; margin-top: 8px; }
  .overview-stats .stat-sub { display: none; }
  .announcement { padding: 10px 12px; font-size: 12px; line-height: 1.55; }
  .announcement > div { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .page-intro { margin-bottom: 14px; }
}

/* 公告正文插图（图文混排） */
.an-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin: 10px 0;
  border-radius: 10px;
  object-fit: contain;
}


/* 人机验证：题目提示条 */
.captcha-tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff8e6;
  border: 1px solid #f2d08a;
  color: #8a5a00;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.captcha-tip.muted {
  background: #f5f7fb;
  border-color: #e3e9f4;
  color: #5a6b85;
  font-weight: 500;
}
.captcha-tip b { color: #c2410c; }
.captcha-empty {
  grid-column: 1 / -1;
  padding: 22px;
  text-align: center;
  color: #5a6b85;
}
.captcha-cell.empty { background: #f5f7fb; }
