:root {
  --brand: #fe2c55;
  --brand-dark: #d81b40;
  --ink: #1b1f27;
  --muted: #6b7280;
  --line: #e8eaef;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #0f9d58;
  --warn: #b7791f;
  --bad: #d93025;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-size: 14px; line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
input, select, textarea, button { font: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: .2px; }

.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- 登录 ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr;
  background: radial-gradient(1200px 600px at 10% 0%, #ffe6ec 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 100%, #e8f0ff 0%, transparent 60%), #fff;
}
.auth-hero { padding: 64px 72px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-hero .logo { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 750; }
.auth-hero .dot { width: 38px; height: 38px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.auth-hero h1 { font-size: 34px; line-height: 1.25; max-width: 520px; }
.auth-hero p { color: var(--muted); max-width: 520px; }
.auth-points { display: grid; gap: 10px; margin-top: 6px; }
.auth-point { display: flex; gap: 10px; align-items: flex-start; color: #38404f; }
.auth-point b { color: var(--ink); }
.tick { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #e6f4ec; color: var(--ok); display: grid; place-items: center; font-size: 12px; margin-top: 3px; }
.auth-side { display: grid; place-items: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 24px 60px rgba(27, 31, 39, .08); }
.auth-card h2 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; }
.seg { display: flex; background: #f1f3f8; border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: #4b5563; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(254,44,85,.12); }
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: transform .06s, background .15s, border-color .15s;
}
.btn:hover { border-color: #d3d7e0; background: #fafbff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: #f3c7c3; background: #fff7f6; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: #10131a; color: #cbd2e0; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; color: #fff; padding: 4px 8px; }
.sidebar .brand .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-size: 13px; }
.sidebar .tenant { font-size: 12px; color: #8b95a7; padding: 0 8px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 9px; color: #cbd2e0; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; }
.nav a:hover { background: #1a1f2b; color: #fff; }
.nav a.active { background: #232936; color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.nav-divider { height: 1px; background: #232936; margin: 8px 10px; }
.mini-select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; background: #fff; }
.hot-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px dashed #c9ced9; }
.hot-link:hover { color: var(--brand); border-bottom-color: var(--brand); }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; display: inline-block; vertical-align: middle; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-preview { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.site-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid #232936; color: #8b93a5; font-size: 11.5px; line-height: 1.7; }
.site-foot a { color: #aab2c2; text-decoration: none; }
.site-foot a:hover { color: #fff; }
.site-links { display: block; margin-top: 2px; }
.site-links a { margin-right: 10px; }
.public-wrap { max-width: 900px; margin: 0 auto; padding: 32px 20px 60px; }
.public-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.public-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--ink); text-decoration: none; }
.public-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; box-shadow: 0 10px 30px rgba(18, 24, 38, .05); }
.public-card h1 { font-size: 24px; margin: 0 0 6px; }
.public-meta { color: #8b93a5; font-size: 12.5px; margin-bottom: 18px; }
.public-article { white-space: pre-wrap; line-height: 1.9; font-size: 14px; color: #2a3140; word-break: break-word; }
.public-wrap .site-foot { border-top-color: var(--line); color: #8b93a5; }
.public-wrap .site-foot a { color: #5b6473; }
.exp-video { width: 100%; max-height: 420px; border-radius: 12px; background: #0b0e14; margin-top: 8px; }
.exp-bar { margin: 8px 0 4px; font-size: 13px; color: #4b5563; }
.quiz-q { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fafbfd; }
.quiz-q .q { font-weight: 600; margin-bottom: 6px; }
.quiz-q label { display: block; padding: 4px 0; font-size: 13.5px; cursor: pointer; }
.task .title a { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.task .title a:hover { color: var(--brand); border-bottom-color: var(--brand); }
.sidebar .foot { margin-top: auto; display: grid; gap: 8px; font-size: 12px; color: #8b95a7; }
.sidebar .foot .who { color: #e6eaf3; font-weight: 600; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-size: 17px; }
.topbar .spacer { flex: 1; }
.topbar .chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; background: #fff; }
.content { padding: 24px 26px 60px; display: grid; gap: 18px; max-width: 1180px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 15px; margin-bottom: 4px; }
.card .desc { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 24px; font-weight: 750; margin-top: 4px; letter-spacing: -.5px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.accent { border-color: #ffd6df; background: linear-gradient(180deg, #fff 0%, #fff6f8 100%); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid #f0f2f7; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #f1f3f8; color: #4b5563; white-space: nowrap; }
.badge.ok { background: #e8f6ee; color: var(--ok); }
.badge.warn { background: #fdf4e3; color: var(--warn); }
.badge.bad { background: #fdecea; color: var(--bad); }
.badge.brand { background: #ffe9ee; color: var(--brand); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { border: 0; background: transparent; padding: 9px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }

.task { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.task:hover { border-color: #d9dde7; }
.task .head { display: flex; gap: 10px; align-items: flex-start; }
.task .title { font-weight: 650; font-size: 14.5px; }
.task .meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.task .foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.task .price { font-size: 18px; font-weight: 750; color: var(--brand); letter-spacing: -.4px; }
.list { display: grid; gap: 12px; }

.empty { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; }

.toast { position: fixed; bottom: 24px; right: 20px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast .item { background: #10131a; color: #fff; padding: 8px 13px; border-radius: 9px; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 12.8px; max-width: 340px; width: fit-content; }
.toast .item.err { background: #b3261e; }
.toast .item.ok { background: #14713f; }

.modal-mask { position: fixed; inset: 0; background: rgba(16,19,26,.45); z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal .m-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal .m-head h3 { flex: 1; font-size: 15px; }
.modal .m-body { padding: 18px 20px; }
.modal .m-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.pre { background: #fbfbfd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.75; }
.copy-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.flag { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f0f2f7; }
.flag:last-child { border-bottom: 0; }
.flag .f-main { flex: 1; }
.flag .f-name { font-weight: 600; }
.flag .f-desc { color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #d6dae3; border-radius: 999px; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:disabled + .track { opacity: .5; }

.note { background: #fff8e6; border: 1px solid #ffe2a8; color: #7a5300; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.note.info { background: #eff5ff; border-color: #cfe0ff; color: #24467f; }

.loading { color: var(--muted); padding: 20px; }
.spinner { width: 16px; height: 16px; border: 2px solid #e3e6ee; border-top-color: var(--brand); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1024px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { grid-auto-flow: column; }
  .sidebar .foot { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
