:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2733;
  --ink-soft: #5b6676;
  --line: #e7ecf3;
  --brand: #2f6bff;
  --brand-soft: #eaf1ff;
  --teal: #12b5a5;
  --purple: #7c5cff;
  --amber: #f5a623;
  --red: #e5484d;
  --green: #3aa675;
  --shadow: 0 6px 24px rgba(31, 39, 51, 0.07);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
.app { max-width: 1120px; margin: 0 auto; padding: 0 20px 60px; }

/* 顶部 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(120deg, #2f6bff, #5b8cff);
  color: #fff; padding: 14px 0; box-shadow: var(--shadow);
}
.topbar .row { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 19px; font-weight: 800; letter-spacing: 1px; display: flex; align-items: center; gap: 9px; }
.logo .dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.3); }
.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.userbox .avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.btn-logout { background: rgba(255,255,255,.18); color: #fff; border: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 12px; }
.btn-logout:hover { background: rgba(255,255,255,.3); }

/* 导航 */
.nav { display: flex; gap: 8px; margin: 22px 0 18px; flex-wrap: wrap; }
.nav a { padding: 9px 16px; border-radius: 999px; background: #fff; color: var(--ink-soft); text-decoration: none; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; border: 1px solid var(--line); }
.nav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.nav a:hover { color: var(--brand); }
.nav a.active:hover { color: #fff; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card h3 .tag { font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.stat .num { font-size: 28px; font-weight: 800; color: var(--brand); }
.stat .lbl { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }
.stat.alt .num { color: var(--teal); }
.stat.warn .num { color: var(--amber); }
.stat.bad .num { color: var(--red); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
label { font-size: 12.5px; color: var(--ink-soft); display: block; margin-bottom: 5px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 64px; }

.btn { background: var(--brand); color: #fff; border: none; padding: 11px 18px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.teal { background: var(--teal); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 表格/列表 */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.item .meta { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }
.item .title { font-weight: 700; font-size: 14.5px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.done { background: #e6f7ef; color: var(--green); }
.badge.doing { background: #eaf1ff; color: var(--brand); }
.badge.pending { background: #fff4e0; color: var(--amber); }
.badge.overdue { background: #fdecec; color: var(--red); }
.badge.weak { background: #fdecec; color: var(--red); }
.badge.review { background: #fff4e0; color: var(--amber); }
.badge.good { background: #e6f7ef; color: var(--green); }
.badge.excellent { background: #eaf1ff; color: var(--brand); }

/* 图谱 */
.graph-subject { margin-bottom: 16px; }
.graph-subject .s-name { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.chapter { margin: 6px 0 10px 0; padding-left: 12px; border-left: 3px solid var(--brand-soft); }
.chapter .c-name { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; margin: 6px 0; }
.points { display: flex; flex-wrap: wrap; gap: 8px; }
.pchip { padding: 6px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: #fff; cursor: default; display: flex; gap: 6px; align-items: center; }
.pchip small { font-weight: 600; opacity: .9; }

/* 推荐/路径 */
.rec-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.rec-card .rh { font-weight: 800; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.res { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.res .r { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; background: #fafbfe; flex: 1 1 200px; }
.res .r .rt { font-weight: 700; }
.res .r .rm { color: var(--ink-soft); font-size: 11.5px; margin-top: 3px; }
.path-step { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; align-items: flex-start; }
.path-step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.path-step .tip { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }

/* 登录 */
.login-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; }
.login-card { width: 380px; max-width: 92vw; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 34px 30px; border: 1px solid var(--line); }
.login-card .brand { text-align: center; margin-bottom: 22px; }
.login-card .brand .t { font-size: 24px; font-weight: 900; color: var(--brand); letter-spacing: 1px; }
.login-card .brand .s { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.role-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.role-tabs button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; color: var(--ink-soft); }
.role-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.hint { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 14px; background: var(--brand-soft); padding: 8px; border-radius: 8px; }
.err { color: var(--red); font-size: 12.5px; text-align: center; margin-bottom: 10px; min-height: 16px; }

/* 布局 */
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.muted { color: var(--ink-soft); }
.section-title { font-size: 15px; font-weight: 800; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-box { display: flex; justify-content: center; }
.empty { text-align: center; color: var(--ink-soft); padding: 24px; }
.svg-tip { font-size: 11.5px; color: var(--ink-soft); text-align: center; margin-top: 6px; }

/* 角色切换 */
.role-switch { display: flex; gap: 8px; }
.role-switch button { padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.18); color: #fff; font-weight: 700; cursor: pointer; font-size: 13px; }
.role-switch button.active { background: #fff; color: var(--brand); border-color: #fff; }

/* 同步状态条 */
.syncbar { max-width: 1120px; margin: 0 auto; padding: 6px 20px; font-size: 12px; font-weight: 600; }
.syncbar.on { color: #e6f7ef; }
.syncbar.off { color: #fff4e0; background: rgba(245,166,35,.25); }

/* 4 位密码锁 */
.pin-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#2f6bff,#5b8cff); }
.pin-card { width: 340px; max-width: 92vw; background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 30px 26px 34px; }
.pin-card .brand { text-align: center; margin-bottom: 18px; }
.pin-card .brand .t { font-size: 26px; font-weight: 900; color: var(--brand); letter-spacing: 2px; }
.pin-card .brand .s { color: var(--ink-soft); font-size: 13px; margin-top: 6px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 6px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand-soft); background: #fff; transition: .15s; }
.pin-dots span.on { background: var(--brand); border-color: var(--brand); }
.pin-err { color: var(--red); font-size: 12.5px; text-align: center; min-height: 16px; }
.pin-tip { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin-top: 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.kp { padding: 16px 0; border-radius: 14px; border: 1px solid var(--line); background: #fafbfe; font-size: 22px; font-weight: 800; color: var(--ink); cursor: pointer; }
.kp:hover { background: var(--brand-soft); }
.kp:active { transform: scale(.96); }
.kp-fn { background: #fff; color: var(--brand); font-size: 16px; font-weight: 700; }

/* 积分奖励 */
.points-banner { background: linear-gradient(135deg,#ffb347,#ff8a3d); color: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); text-align: center; margin-bottom: 18px; }
.points-banner .pb-num { font-size: 44px; font-weight: 900; line-height: 1; }
.points-banner .pb-lbl { font-size: 13px; opacity: .95; margin-top: 6px; }
.points-banner .pb-rules { font-size: 11.5px; opacity: .9; margin-top: 8px; }
.reward-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.reward-card.used { opacity: .55; }
.reward-card .rt { font-weight: 700; font-size: 14.5px; }
.reward-card .rm { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }
