/* ============================================================
   智造学涯 · 智能制造工程学习工作流平台 — 样式系统
   ============================================================ */

/* ---------- 字体 ---------- */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../_shared/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../_shared/fonts/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* ---------- 设计变量 ---------- */
:root {
  --bg: #F3F5FB;
  --bg2: #FFFFFF;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --ink: #202542;
  --muted: #6E7391;
  --rule: rgba(32, 37, 66, 0.10);
  --accent: #5B5FE9;
  --accent2: #00B8D9;
  --accent-soft: rgba(91, 95, 233, 0.10);
  --accent2-soft: rgba(0, 184, 217, 0.10);
  --grad: linear-gradient(135deg, #5B5FE9 0%, #00B8D9 100%);
  --grad-soft: linear-gradient(135deg, rgba(91,95,233,.14), rgba(0,184,217,.14));
  --ok: #10B981;
  --warn: #F59E0B;
  --danger: #EF4444;
  --shadow: 0 10px 30px rgba(91, 95, 233, 0.10);
  --shadow-lg: 0 18px 50px rgba(91, 95, 233, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Micro Hei", "Source Han Sans SC", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0E1120;
  --bg2: #181D33;
  --surface: rgba(32, 38, 66, 0.62);
  --surface-strong: rgba(24, 29, 51, 0.94);
  --ink: #E8EBF8;
  --muted: #9AA1C4;
  --rule: rgba(232, 235, 248, 0.10);
  --accent: #7B7FF3;
  --accent2: #22C8E8;
  --accent-soft: rgba(123, 127, 243, 0.16);
  --accent2-soft: rgba(34, 200, 232, 0.14);
  --grad-soft: linear-gradient(135deg, rgba(123,127,243,.22), rgba(34,200,232,.18));
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
/* 清新渐变：低饱和度环境光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48rem 32rem at 12% -6%, rgba(91, 95, 233, 0.09), transparent 60%),
    radial-gradient(42rem 30rem at 96% 12%, rgba(0, 184, 217, 0.08), transparent 60%),
    radial-gradient(40rem 34rem at 55% 108%, rgba(91, 95, 233, 0.07), transparent 60%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(48rem 32rem at 12% -6%, rgba(123, 127, 243, 0.14), transparent 60%),
    radial-gradient(42rem 30rem at 96% 12%, rgba(34, 200, 232, 0.10), transparent 60%),
    radial-gradient(40rem 34rem at 55% 108%, rgba(123, 127, 243, 0.10), transparent 60%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
::selection { background: var(--accent-soft); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-soft); }

/* ============================================================
   认证（密码门禁）
   ============================================================ */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(60rem 40rem at 20% 0%, rgba(91, 95, 233, 0.16), transparent 55%),
    radial-gradient(50rem 36rem at 90% 100%, rgba(0, 184, 217, 0.14), transparent 55%),
    var(--bg);
  transition: opacity .45s ease, visibility .45s;
}
.auth-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--rule);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 38px 36px 30px;
  text-align: center;
  animation: rise .5s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-logo {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: var(--grad);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 10px 26px rgba(91, 95, 233, 0.35);
}
.auth-card h1 { font-size: 22px; letter-spacing: 2px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.auth-card .sub b { color: var(--accent); font-weight: 600; }
.auth-field { text-align: left; margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.auth-error {
  color: var(--danger); font-size: 13px; min-height: 20px; margin: 4px 0 8px;
  transition: .2s;
}
.auth-error.shake { animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); } 75% { transform: translateX(6px); }
}
.auth-links { margin-top: 14px; font-size: 13px; }
.auth-links button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.auth-links button:hover { color: var(--danger); }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); }

/* ============================================================
   应用框架
   ============================================================ */
.app { display: none; min-height: 100vh; }
.app.unlocked { display: flex; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--rule);
  padding: 20px 14px;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(91, 95, 233, 0.30);
  flex-shrink: 0;
}
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.brand-name small { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.nav-group-label { font-size: 11px; color: var(--muted); padding: 12px 12px 5px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  border: none; background: none;
  color: var(--muted);
  font-size: 14px;
  font-family: var(--font);
  cursor: pointer;
  transition: .18s;
  position: relative;
  text-align: left;
  width: 100%;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--ink); background: var(--accent-soft); }
.nav-item.active {
  color: var(--ink);
  background: var(--grad-soft);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 22%;
  width: 4px; height: 56%;
  border-radius: 0 4px 4px 0;
  background: var(--grad);
}
.nav-badge {
  margin-left: auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-family: var(--mono);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-foot {
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13px; }
.side-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.side-user small { display: block; color: var(--muted); font-size: 11px; }
.btn-lock {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: none; color: var(--muted);
  font-size: 13px; font-family: var(--font);
  cursor: pointer; transition: .18s;
}
.btn-lock:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- 主区域 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.topbar h2 { font-size: 18px; font-weight: 700; margin-right: auto; }
.top-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 12.5px;
  white-space: nowrap;
}
.top-chip.accent { background: var(--grad-soft); font-weight: 600; }
.top-chip .mono { color: var(--accent); font-weight: 700; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--bg2);
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .18s; flex-shrink: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
#menuToggle { display: none; }

/* ---------- 页面 ---------- */
.pages { flex: 1; padding: 24px 26px 60px; }
.page { display: none; animation: fadeIn .3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h3 { font-size: 20px; font-weight: 700; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- 卡片与网格 ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.card-title svg { width: 17px; height: 17px; color: var(--accent); }
.card-title .right { margin-left: auto; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.mt { margin-top: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border-radius: 11px;
  border: none;
  background: var(--grad);
  color: #fff;
  font-size: 14px; font-family: var(--font); font-weight: 600;
  cursor: pointer; transition: .18s;
  box-shadow: 0 6px 16px rgba(91, 95, 233, 0.28);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(91, 95, 233, 0.34); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost {
  background: var(--bg2); color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #F05252, #EF4444); box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25); }
.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- 表单 ---------- */
label.fl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea, .auth-field input {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--bg2);
  color: var(--ink);
  font-size: 14px; font-family: var(--font);
  outline: none; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus, .auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 76px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field { margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="date"] { color-scheme: light; }
[data-theme="dark"] input[type="date"] { color-scheme: dark; }
.hint { font-size: 12px; color: var(--muted); }

/* ---------- 徽章 / 筛选片 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--bg2);
  color: var(--muted);
  font-size: 13px; font-family: var(--font);
  cursor: pointer; transition: .18s;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.active { background: var(--grad-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}
.badge.cat { background: var(--accent-soft); color: var(--accent); }
.badge.pri-hi { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.badge.pri-mid { background: rgba(245, 158, 11, 0.13); color: var(--warn); }
.badge.pri-lo { background: var(--accent-soft); color: var(--muted); }
.badge.ok { background: rgba(16, 185, 129, 0.12); color: var(--ok); }
.badge.warn { background: rgba(245, 158, 11, 0.13); color: var(--warn); }
.badge.over { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

/* ---------- 仪表盘 ---------- */
.hero {
  position: relative;
  border-radius: 20px;
  background: var(--grad);
  color: #fff;
  padding: 28px 30px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: "";
  position: absolute; right: -60px; top: -70px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}
.hero::before {
  content: "";
  position: absolute; right: 60px; bottom: -90px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
}
.hero h3 { font-size: 23px; margin-bottom: 4px; position: relative; z-index: 1; }
.hero .sub { font-size: 13px; opacity: .92; position: relative; z-index: 1; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .btn { background: rgba(255, 255, 255, 0.18); box-shadow: none; backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255, 255, 255, 0.30); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-block {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-block .num { font-size: 26px; font-weight: 700; font-family: var(--mono); color: var(--accent); line-height: 1.2; }
.stat-block .num small { font-size: 13px; color: var(--muted); font-family: var(--font); font-weight: 400; }
.stat-block .lbl { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dash-list { list-style: none; }
.dash-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--rule);
  font-size: 13.5px;
}
.dash-list li:last-child { border-bottom: none; }
.dash-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list .t.done { text-decoration: line-through; color: var(--muted); }
.dash-list .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.empty {
  text-align: center; color: var(--muted);
  padding: 26px 10px; font-size: 13px;
}
.empty svg { width: 34px; height: 34px; opacity: .4; margin-bottom: 8px; }
.countdown-big { text-align: center; padding: 8px 0; }
.countdown-big .num { font-size: 44px; font-weight: 700; font-family: var(--mono); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1.15; }
.countdown-big .lbl { color: var(--muted); font-size: 12.5px; }
.tip-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--grad-soft);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  margin-top: 16px;
}
.tip-bar svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* ---------- 任务列表 ---------- */
.task-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.task-toolbar .spacer { flex: 1; }
.progress-wrap { margin-bottom: 16px; }
.progress-bar {
  height: 8px; border-radius: 999px;
  background: var(--rule); overflow: hidden;
}
.progress-bar > i {
  display: block; height: 100%;
  background: var(--grad);
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--bg2);
  margin-bottom: 10px;
  transition: .18s;
}
.task-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.task-item.done { opacity: .62; }
.task-item.done .task-title { text-decoration: line-through; }
.task-check {
  width: 20px; height: 20px;
  border-radius: 7px;
  border: 2px solid var(--rule);
  background: none;
  cursor: pointer; transition: .18s;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 12px;
  padding: 0; line-height: 1;
  font-family: var(--font);
  -webkit-appearance: none; appearance: none;
}
.task-check:hover { border-color: var(--accent); }
.task-item.done .task-check { background: var(--grad); border-color: transparent; color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; overflow-wrap: break-word; }
.task-note { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: break-word; }
.task-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.task-due { font-size: 12px; color: var(--muted); white-space: nowrap; font-family: var(--mono); }
.task-due.over { color: var(--danger); font-weight: 700; }
.task-ops { display: flex; gap: 4px; opacity: 0; transition: .18s; }
.task-item:hover .task-ops { opacity: 1; }
.mini-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: none; background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mini-btn:hover { background: var(--accent-soft); color: var(--accent); }
.mini-btn.del:hover { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.mini-btn svg { width: 15px; height: 15px; }

/* ---------- 番茄钟 ---------- */
.focus-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.timer-card { text-align: center; padding: 28px 20px; }
.ftabs { display: inline-flex; gap: 4px; background: var(--rule); padding: 4px; border-radius: 11px; margin-bottom: 20px; }
.ftab {
  border: none; background: none;
  padding: 6px 13px; border-radius: 8px;
  font-size: 12.5px; font-family: var(--font);
  color: var(--muted); cursor: pointer; transition: .18s;
}
.ftab.active { background: var(--bg2); color: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ring-wrap { position: relative; width: 240px; height: 240px; margin: 0 auto 14px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--rule); stroke-width: 9; }
.ring-fg { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .6s linear; }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#focusTime { font-size: 44px; font-weight: 700; font-family: var(--mono); letter-spacing: 1px; }
#focusModeLabel { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.focus-ctrl { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cycle-dots { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.cycle-dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--rule);
}
.cycle-dots i.on { background: var(--grad); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.mini-stats .cell { background: var(--accent-soft); border-radius: 12px; padding: 10px 6px; }
.mini-stats .v { font-size: 20px; font-weight: 700; font-family: var(--mono); color: var(--accent); }
.mini-stats .k { font-size: 11.5px; color: var(--muted); }
.guide-list { list-style: none; }
.guide-list li { display: flex; gap: 9px; font-size: 13px; color: var(--muted); padding: 6px 0; }
.guide-list li::before { content: "•"; color: var(--accent); font-weight: 700; }

/* ---------- 课程表 ---------- */
.sched-grid { display: grid; grid-template-columns: 76px repeat(7, 1fr); gap: 5px; min-width: 860px; }
.sched-scroll { overflow-x: auto; padding-bottom: 6px; }
.sched-head {
  text-align: center; font-size: 12.5px; font-weight: 600;
  padding: 9px 4px; border-radius: 9px;
  background: var(--bg2); border: 1px solid var(--rule);
  color: var(--muted);
}
.sched-head.today { background: var(--grad-soft); color: var(--accent); border-color: transparent; }
.sched-time {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11.5px; color: var(--muted);
  background: var(--bg2); border: 1px solid var(--rule);
  border-radius: 9px; padding: 4px;
  text-align: center;
}
.sched-time b { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.sched-cell {
  min-height: 62px;
  border: 1px dashed var(--rule);
  border-radius: 9px;
  padding: 4px;
  cursor: pointer; transition: .18s;
  display: flex; flex-direction: column; gap: 4px;
}
.sched-cell:hover { border-color: var(--accent); background: var(--accent-soft); }
.sched-cell.today-col { background: var(--accent2-soft); }
.course-chip {
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 11.5px;
  line-height: 1.35;
  cursor: pointer;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.course-chip b { display: block; font-size: 12px; }
.course-chip small { opacity: .88; font-size: 10.5px; }
.course-chip .x {
  position: absolute; top: 2px; right: 4px;
  opacity: 0; cursor: pointer; font-size: 12px; line-height: 1;
}
.course-chip:hover .x { opacity: 1; }

/* ---------- 文献资源 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 220px; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.link-card {
  display: block;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 13px;
  padding: 14px 15px;
  transition: .18s;
  color: var(--ink);
}
.link-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.link-card .lc-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  margin-bottom: 9px;
}
.link-card b { font-size: 13.5px; display: block; }
.link-card small { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.paper-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg2);
  margin-bottom: 9px;
}
.paper-item .body { flex: 1; min-width: 0; }
.paper-item b { font-size: 13.5px; }
.paper-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: break-word; }
.paper-note { font-size: 12px; color: var(--muted); margin-top: 4px; background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; overflow-wrap: break-word; }
.status-pill { border: none; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-family: var(--font); cursor: pointer; font-weight: 600; }
.st-want { background: var(--accent-soft); color: var(--muted); }
.st-reading { background: rgba(0, 184, 217, 0.13); color: var(--accent2); }
.st-done { background: rgba(16, 185, 129, 0.13); color: var(--ok); }

/* ---------- 考研规划 ---------- */
.grad-hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: var(--grad);
  border-radius: var(--radius);
  color: #fff;
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 18px;
}
.grad-hero .days { font-size: 46px; font-weight: 700; font-family: var(--mono); line-height: 1.1; }
.grad-hero .lbl { font-size: 12.5px; opacity: .92; }
.grad-hero .date-edit { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.grad-hero input[type="date"] {
  border: none; border-radius: 9px; padding: 8px 11px; font-family: var(--font); font-size: 13px;
  background: rgba(255, 255, 255, 0.2); color: #fff; outline: none;
}
.grad-hero input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
.target-card {
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--bg2);
  padding: 14px 16px;
}
.target-card .tc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.target-card b { font-size: 14.5px; }
.target-card .major { font-size: 12.5px; color: var(--muted); }
.target-card .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.subject-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--rule);
  flex-wrap: wrap;
}
.subject-row:last-child { border-bottom: none; }
.subject-row .sname { width: 120px; font-size: 13.5px; font-weight: 600; flex-shrink: 0; }
.subject-row .sbar { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 12px; }
.subject-row .pct { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--accent); width: 52px; text-align: right; }
.subject-row .snote { width: 100%; font-size: 12px; color: var(--muted); }
.checkin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.checkin-item {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--rule); border-radius: 11px;
  padding: 10px 12px; cursor: pointer; transition: .18s;
  background: var(--bg2); font-size: 13px;
  user-select: none;
}
.checkin-item:hover { border-color: var(--accent); }
.checkin-item.on { background: var(--grad-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.checkin-item .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; }
.checkin-item.on .dot { background: var(--grad); border-color: transparent; color: #fff; }
.phase-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.phase-card {
  border: 1px solid var(--rule);
  border-radius: 13px;
  padding: 15px 16px;
  background: var(--bg2);
}
.phase-card h5 { font-size: 13.5px; color: var(--accent); margin-bottom: 3px; }
.phase-card .p-time { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.phase-card ul { list-style: none; }
.phase-card li {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12.5px; color: var(--muted);
  padding: 5px 0; cursor: pointer; line-height: 1.45;
}
.phase-card li .cb { width: 15px; height: 15px; border-radius: 5px; border: 2px solid var(--rule); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; }
.phase-card li.on { color: var(--ink); }
.phase-card li.on .cb { background: var(--grad); border-color: transparent; color: #fff; }
.phase-card li.on span { text-decoration: line-through; opacity: .65; }

/* ---------- 生涯规划 ---------- */
.roadmap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stage-card {
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg2);
  padding: 17px 18px;
  position: relative;
  overflow: hidden;
}
.stage-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad);
}
.stage-card h5 { font-size: 15px; display: flex; align-items: center; gap: 9px; }
.stage-card .stage-tag { font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; }
.stage-card .stage-sub { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.stage-card ul { list-style: none; }
.stage-card li {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 13px; padding: 6px 0; cursor: pointer;
  color: var(--muted); line-height: 1.5;
}
.stage-card li .cb { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--rule); flex-shrink: 0; margin-top: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; transition: .15s; }
.stage-card li:hover { color: var(--ink); }
.stage-card li.on { color: var(--ink); }
.stage-card li.on .cb { background: var(--grad); border-color: transparent; color: #fff; }
.stage-card li.on span { text-decoration: line-through; opacity: .6; }
.stage-card .stage-count { position: absolute; top: 15px; right: 17px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 11px; }
.skill-item {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg2);
  padding: 12px 14px;
}
.skill-item .sk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.skill-item b { font-size: 13px; }
.skill-item .sk-cat { font-size: 10.5px; color: var(--muted); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.skill-item .sk-cat.c2 { background: var(--accent2-soft); color: var(--accent2); }
.levels { display: flex; gap: 6px; }
.level-dot {
  flex: 1; border: none; cursor: pointer;
  border-radius: 8px; padding: 6px 2px;
  font-size: 11px; font-family: var(--font);
  background: var(--rule); color: var(--muted);
  transition: .15s;
}
.level-dot:hover { transform: translateY(-1px); }
.level-dot.on { background: var(--grad); color: #fff; font-weight: 600; }
.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swot-cell { border: 1px solid var(--rule); border-radius: 13px; background: var(--bg2); padding: 14px 15px; }
.swot-cell h5 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.swot-cell .letter { width: 24px; height: 24px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 700; color: #fff; }
.swot-cell .letter.s { background: var(--ok); }
.swot-cell .letter.w { background: var(--warn); }
.swot-cell .letter.o { background: var(--accent2); }
.swot-cell .letter.t { background: var(--danger); }
.swot-cell textarea { min-height: 96px; }
.path-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--rule); }
.path-item:last-child { border-bottom: none; }
.path-item .pi-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--grad-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; font-size: 14px; }
.path-item b { font-size: 13.5px; display: block; }
.path-item p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 数据统计 ---------- */
.chart-figure { margin: 0; }
.chart-figure figcaption { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.chart-figure .chart-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-box { width: 100%; min-height: 300px; }
.chart-box.short { min-height: 260px; }

/* ---------- 设置 ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--rule); }
.switch-row:last-child { border-bottom: none; }
.switch-row .sw-l b { font-size: 13.5px; display: block; }
.switch-row .sw-l small { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--rule); cursor: pointer; transition: .2s;
}
.switch .track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: .2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ============================================================
   悬浮计时球（FAB Ball）
   ============================================================ */
.fab-ball {
  position: fixed;
  z-index: 900;
  width: 66px;
  height: 66px;
  /* 默认位置：屏幕右侧中部（拖动后由 JS 记忆坐标覆盖） */
  top: 45%;
  right: 26px;
  user-select: none;
  touch-action: none;
}
.fab-ball.hidden-widget { display: none; }

/* —— 球体本体 —— */
.ball {
  position: relative;
  width: 66px; height: 66px;
  border-radius: 50%;
  cursor: grab;
  transition: transform .18s ease, box-shadow .2s ease;
  box-shadow: 0 8px 24px rgba(91, 95, 233, .38);
}
.ball:hover { transform: scale(1.08); }
.ball:active { cursor: grabbing; }
.fab-ball.dragging .ball { box-shadow: 0 20px 44px rgba(91, 95, 233, .5); transform: scale(1.12); }
/* 进度环（conic-gradient 由 JS 控制） */
.ball-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--grad);
  transition: opacity .3s;
}
.fab-ball.paused .ball-ring { opacity: .45; }
/* 球芯 */
.ball-core {
  position: absolute; inset: 5px;
  border-radius: 50%;
  background: var(--surface-strong);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
}
.ball-emoji { font-size: 20px; line-height: 1; }
.ball-time { display: none; font-family: var(--mono); font-size: 13.5px; font-weight: 700; color: var(--accent); line-height: 1; }
.fab-ball.running .ball-emoji { display: none; }
.fab-ball.running .ball-time { display: block; font-size: 15px; }
/* 计时呼吸动画 */
@keyframes ballPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(91, 95, 233, .38); }
  50% { box-shadow: 0 8px 30px rgba(91, 95, 233, .62); }
}
.fab-ball.running .ball { animation: ballPulse 2.2s ease-in-out infinite; }

/* —— 快捷菜单（未计时时） —— */
.fab-menu {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 218px;
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 7px;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.fab-ball.menu-open .fab-menu { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fab-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  border: none; background: none; cursor: pointer;
  padding: 9px 10px; border-radius: 10px;
  font-family: var(--font); color: var(--ink); text-align: left;
}
.fab-item:hover { background: var(--accent-soft); }
.fab-item .fi-ico { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.fab-item b { display: block; font-size: 13px; line-height: 1.25; }
.fab-item small { display: block; font-size: 11px; color: var(--muted); }

/* —— 迷你面板（计时中） —— */
.fab-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 224px;
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 12px 14px 13px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.fab-ball.panel-open .fab-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fp-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.fp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); flex-shrink: 0; }
.fp-head span { flex: 1; text-align: left; }
.fp-head button {
  border: none; background: none; color: var(--muted); cursor: pointer;
  width: 22px; height: 22px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.fp-head button:hover { background: var(--accent-soft); color: var(--accent); }
.fp-time { font-size: 31px; font-weight: 700; font-family: var(--mono); line-height: 1.15; }
.fp-mode { font-size: 11.5px; color: var(--muted); margin: 2px 0 10px; }
.fp-bar { height: 5px; border-radius: 999px; background: var(--rule); overflow: hidden; margin-bottom: 11px; }
.fp-bar > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .5s linear; }
.fp-ctrl { display: flex; gap: 8px; justify-content: center; }
.fw-btn {
  border: none; cursor: pointer;
  padding: 7px 16px; border-radius: 9px;
  font-size: 12.5px; font-family: var(--font); font-weight: 600;
  background: var(--grad); color: #fff;
}
.fw-btn.ghost { background: var(--bg2); color: var(--muted); border: 1px solid var(--rule); }

/* ============================================================
   模态框 / 提示
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(14, 17, 32, 0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: .25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-card {
  width: 100%; max-width: 500px;
  max-height: 88vh; overflow-y: auto;
  background: var(--surface-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: translateY(14px) scale(.98);
  transition: .25s;
}
.modal-overlay.open .modal-card { transform: none; }
.modal-card h4 { font-size: 16.5px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.modal-card h4 svg { width: 18px; height: 18px; color: var(--accent); }
.confirm-text { font-size: 14px; color: var(--muted); line-height: 1.7; }
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1800; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--surface-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  color: var(--ink);
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   联网更新中心（仪表盘）
   ============================================================ */
.net-card { margin-bottom: 18px; }
.net-sync-info { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.net-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
  transition: background .3s;
}
.net-dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(16, 185, 129, .6); }
.net-dot.off { background: var(--danger); }
.net-dot.checking { background: var(--warn); animation: ballPulse 1.2s infinite; }
#netState { font-weight: 600; color: var(--ink); font-size: 12px; }
#netSyncTime { font-size: 11px; }
.net-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr .7fr;
  gap: 14px;
  align-items: stretch;
}
.net-cell {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 86px;
}
.nc-label { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; margin-bottom: 7px; }
.nc-quote { font-size: 14px; line-height: 1.55; font-weight: 500; }
.nc-from { font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: right; }
.nc-word { font-size: 22px; font-weight: 700; font-family: var(--mono); color: var(--accent); line-height: 1.2; }
.nc-phon { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }
.nc-mean { font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.net-cell-actions {
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  align-items: stretch;
}
.nc-log { font-size: 11px; color: var(--muted); line-height: 1.6; }

/* ============================================================
   刷题中心
   ============================================================ */
.quiz-banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 13px; }
.bank-card {
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 13px;
  padding: 15px 16px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.bank-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.bank-head { display: flex; align-items: center; gap: 10px; }
.bank-icon { font-size: 22px; width: 40px; height: 40px; border-radius: 11px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bank-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.bank-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bank-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.bank-meta .bm { background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.bank-meta .bm.ok { background: rgba(16,185,129,.12); color: var(--ok); }
.bank-progress { height: 5px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.bank-progress > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s ease; }
.bank-start {
  border: none; cursor: pointer; width: 100%;
  padding: 8px 0; border-radius: 9px;
  font-family: var(--font); font-weight: 600; font-size: 12.5px;
  background: var(--grad); color: #fff; margin-top: 2px;
}
.bank-start:hover { filter: brightness(1.08); }

/* 练习区 */
.qz-meta { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.qz-point { background: var(--accent2-soft); color: var(--accent2); font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.qz-diff { color: var(--warn); font-size: 12px; letter-spacing: 2px; }
.qz-progress { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.qz-question { font-size: 15.5px; font-weight: 600; line-height: 1.65; margin-bottom: 15px; white-space: pre-wrap; }
.qz-options { display: grid; gap: 9px; }
.qz-opt {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--rule); border-radius: 11px;
  background: var(--bg2); padding: 11px 14px;
  font-family: var(--font); font-size: 14px; color: var(--ink);
  cursor: pointer; text-align: left; width: 100%;
  transition: border-color .12s ease, background .12s ease;
}
.qz-opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.qz-opt .opt-key {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; font-family: var(--mono);
}
.qz-opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.qz-opt.right { border-color: var(--ok); background: rgba(16, 185, 129, .10); }
.qz-opt.right .opt-key { background: var(--ok); color: #fff; }
.qz-opt.wrong { border-color: var(--danger); background: rgba(239, 68, 68, .08); }
.qz-opt.wrong .opt-key { background: var(--danger); color: #fff; }
.qz-opt:disabled { cursor: default; opacity: .88; }
.qz-fill input {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  border: 1.5px solid var(--rule); background: var(--bg2);
  color: var(--ink); font-family: var(--mono); font-size: 14px; outline: none;
}
.qz-fill input:focus { border-color: var(--accent); }
.qz-fill input.right { border-color: var(--ok); background: rgba(16, 185, 129, .08); }
.qz-fill input.wrong { border-color: var(--danger); background: rgba(239, 68, 68, .08); }
.qz-feedback {
  border-radius: 11px; padding: 12px 14px; margin-top: 13px;
  font-size: 13.5px; line-height: 1.65;
  border: 1px solid var(--rule);
}
.qz-feedback.ok { background: rgba(16, 185, 129, .09); border-color: rgba(16, 185, 129, .35); }
.qz-feedback.err { background: rgba(239, 68, 68, .07); border-color: rgba(239, 68, 68, .30); }
.qz-feedback b { display: block; margin-bottom: 3px; }
.qz-feedback.ok b { color: var(--ok); }
.qz-feedback.err b { color: var(--danger); }
.qz-actions { display: flex; gap: 9px; margin-top: 14px; align-items: center; }
.qz-streak-line { margin-top: 13px; font-size: 12.5px; color: var(--muted); text-align: right; }
.qz-streak-line b { color: var(--warn); font-family: var(--mono); font-size: 14px; }

/* 错题本 */
.qz-wrong-list { max-height: 320px; overflow-y: auto; }
.qz-wrong-item {
  border: 1px solid var(--rule); border-left: 3px solid var(--danger);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 9px;
  background: var(--bg2);
}
.qz-wrong-item .qw-bank { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.qz-wrong-item .qw-q { font-size: 13px; line-height: 1.5; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qz-wrong-item .qw-ans { font-size: 12px; color: var(--ok); margin-bottom: 7px; }
.qz-wrong-item .qw-ans b { font-family: var(--mono); }
.qz-wrong-item .qw-actions { display: flex; gap: 7px; }
.qz-wrong-item .qw-actions button {
  border: 1px solid var(--rule); background: var(--bg); color: var(--muted);
  border-radius: 7px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; font-family: var(--font);
}
.qz-wrong-item .qw-actions button:hover { color: var(--accent); border-color: var(--accent); }
.qz-mode-chips { display: flex; gap: 6px; }
.chip.sm { padding: 4px 12px; font-size: 12px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .focus-layout { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .phase-grid { grid-template-columns: 1fr; }
  .roadmap-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app.unlocked { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-105%);
    transition: transform .28s ease;
    box-shadow: var(--shadow-lg);
    width: 250px;
    z-index: 300;
  }
  .sidebar.open { transform: none; }
  #menuToggle { display: inline-flex; }
  .pages { padding: 16px 14px 70px; }
  .topbar { padding: 12px 14px; }
  .topbar .hide-m { display: none; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .swot-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .grad-hero .date-edit { margin-left: 0; }
}
@media (max-width: 520px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
  .ring-wrap { width: 210px; height: 210px; }
  .fab-menu, .fab-panel { width: 196px; }
  .net-grid { grid-template-columns: 1fr; }
  .quiz-banks { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .fab-ball, #toasts { display: none !important; }
}

/* ---------------- 云端同步面板 ---------------- */
.sync-code-row { display: flex; gap: 8px; align-items: center; margin: 2px 0 4px; flex-wrap: wrap; }
.sync-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, 'JetBrains Mono', monospace;
  font-size: 13.5px; font-weight: 700; letter-spacing: .4px;
  color: var(--accent); background: rgba(91, 95, 233, .08);
  border: 1px dashed var(--accent); padding: 8px 12px; border-radius: 9px;
  user-select: all; cursor: pointer; word-break: break-all;
}
.sync-code:hover { background: rgba(91, 95, 233, .16); }
[data-theme="dark"] .sync-code { background: rgba(91, 95, 233, .16); }
#cloudSyncCard summary { outline: none; }
#cloudSyncCard summary:hover { color: var(--accent); }

/* ================================================================
   v1.2 新增：白噪音 / 背单词 / 课程学习助手 / 作息守护
   ================================================================ */

/* ---------------- 白噪音面板 ---------------- */
.noise-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.noise-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px; border-radius: 12px; border: 1.5px solid var(--rule);
  background: var(--card, #fff); font-size: 12px; cursor: pointer;
  transition: all .18s; color: var(--text);
}
.noise-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.noise-item.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 4px 12px rgba(99, 102, 241, .15); }
.noise-ic { font-size: 20px; line-height: 1; }
.noise-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.noise-vol { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px; }
.noise-vol input[type="range"] { flex: 1; accent-color: var(--accent); }
.noise-auto { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.noise-auto input { accent-color: var(--accent); }

/* ---------------- 背单词 ---------------- */
.vocab-books { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vocab-book {
  flex: 1; min-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 10px; border-radius: 14px; border: 1.5px solid var(--rule);
  background: transparent; cursor: pointer; transition: all .18s; color: var(--text);
}
.vocab-book small { color: var(--muted); font-size: 11.5px; }
.vocab-book.on { border-color: var(--accent); background: var(--accent-soft); }
.vocab-book.on b { color: var(--accent); }
.vocab-progress { margin-top: 10px; }
.vocab-progress .bar { height: 8px; border-radius: 6px; background: var(--rule); overflow: hidden; }
.vocab-progress .bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 6px; transition: width .3s; }
.vocab-forecast { display: flex; align-items: flex-end; gap: 8px; padding: 8px 4px 0; }
.fc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fc-col small { color: var(--muted); font-size: 10.5px; }
.fc-bar { position: relative; width: 100%; max-width: 42px; min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), var(--accent2)); display: flex; align-items: flex-start; justify-content: center; }
.fc-bar span { font-size: 10.5px; color: #fff; transform: translateY(-2px); }
.vocab-card { max-width: 640px; margin: 0 auto; }
.vocab-head { display: flex; align-items: center; gap: 10px; }
.vocab-count { font-size: 13px; color: var(--muted); margin-left: auto; }
.vocab-word { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 26px 0 4px; }
.vocab-word .w { font-size: 44px; font-weight: 700; letter-spacing: .5px; }
.vocab-speak { border: none; background: var(--accent-soft); color: var(--accent); width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; transition: transform .15s; }
.vocab-speak:hover { transform: scale(1.12); }
.vocab-phone { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.vocab-new, .vocab-rev, .vocab-wrong-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
.vocab-new { background: rgba(16, 185, 129, .14); color: var(--ok); }
.vocab-rev { background: var(--accent-soft); color: var(--accent); }
.vocab-wrong-tag { background: rgba(239, 68, 68, .13); color: var(--danger); }
.vocab-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vocab-opt {
  display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid var(--rule); background: transparent; cursor: pointer;
  font-size: 14px; color: var(--text); text-align: left; transition: all .15s; line-height: 1.4;
}
.vocab-opt i { font-style: normal; flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; background: var(--rule); color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.vocab-opt:hover:not(:disabled) { border-color: var(--accent); }
.vocab-opt:disabled { cursor: default; opacity: .85; }
.vocab-opt.right { border-color: var(--ok); background: rgba(16, 185, 129, .1); }
.vocab-opt.right i { background: var(--ok); color: #fff; }
.vocab-opt.wrong { border-color: var(--danger); background: rgba(239, 68, 68, .08); }
.vocab-opt.wrong i { background: var(--danger); color: #fff; }
.vocab-detail { margin-top: 18px; padding: 16px; border-radius: 14px; background: var(--accent-soft); animation: fadeUp .25s; }
.vocab-detail .d-word { font-size: 20px; font-weight: 700; }
.vocab-detail .d-word small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.vocab-detail .d-tr { margin-top: 6px; font-size: 14.5px; line-height: 1.6; }
.vocab-detail .d-sent { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--card, rgba(255,255,255,.6)); font-size: 13.5px; line-height: 1.6; }
.vocab-detail .d-sent small { color: var(--muted); }
.vocab-detail .d-ok { margin: 12px 0 10px; color: var(--ok); font-size: 13.5px; }
.vocab-detail .d-no { margin: 12px 0 10px; color: var(--danger); font-size: 13.5px; }
.vocab-detail .btn { margin-top: 4px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- 课程学习助手 ---------------- */
.study-add { display: flex; gap: 10px; }
.study-add input { flex: 1; }
.mini-chip { border: 1px solid var(--rule); background: transparent; color: var(--accent); border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer; margin: 0 3px; }
.mini-chip:hover { background: var(--accent-soft); }
.study-course-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.study-course-name { font-size: 17px; margin-right: 8px; }
.study-sec { margin-top: 10px; border: 1px solid var(--rule); border-radius: 12px; }
.study-sec summary { cursor: pointer; padding: 10px 12px; font-size: 13.5px; font-weight: 600; color: var(--text); list-style: none; user-select: none; }
.study-sec summary::-webkit-details-marker { display: none; }
.study-sec summary::before { content: '▸ '; color: var(--accent); }
.study-sec[open] summary::before { content: '▾ '; }
.study-sec > *:not(summary) { margin: 0 12px 12px; }
.study-chapters { display: flex; flex-direction: column; gap: 4px; }
.study-ch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.study-ch:hover { background: var(--accent-soft); }
.study-ch input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.study-ch .t { font-size: 13.5px; font-weight: 500; }
.study-ch.done .t { color: var(--muted); text-decoration: line-through; }
.study-ch .pts { flex-basis: 100%; font-size: 12px; color: var(--muted); margin-left: 24px; line-height: 1.5; }
.study-ch.done .pts { text-decoration: line-through; }

/* ---------------- 作息守护 ---------------- */
.rest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.rest-field { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; }
.rest-field label b { font-size: 13px; display: block; }
.rest-field label small { font-size: 11.5px; color: var(--muted); }
.rest-field select { margin-top: 2px; }

/* ---------------- 移动端适配 ---------------- */
@media (max-width: 760px) {
  .noise-grid { grid-template-columns: repeat(3, 1fr); }
  .vocab-word .w { font-size: 34px; }
  .vocab-options { grid-template-columns: 1fr; }
  .vocab-opt { padding: 12px; }
  .vocab-books { flex-direction: column; }
  .study-add { flex-direction: column; }
  .rest-grid { grid-template-columns: 1fr 1fr; }
  .vocab-count { font-size: 12px; }
}

/* ================================================================
   v1.3 新增：陪伴小宠物
   ================================================================ */

/* ---------------- 悬浮宠物本体 ---------------- */
.pet-fab {
  position: fixed; left: 18px; bottom: 18px; z-index: 950;
  width: 94px; height: 104px; cursor: pointer;
  -webkit-user-select: none; user-select: none; touch-action: none;
}
.pet-fab.hidden-pet { display: none; }
.pet-fab .pet-svg {
  width: 100%; height: 100%; display: block; overflow: visible;
  filter: drop-shadow(0 8px 16px rgba(32, 37, 66, .18));
  transition: transform .2s;
}
.pet-fab:hover .pet-svg { transform: scale(1.06); }
.pet-fab.dragging .pet-svg { transform: scale(1.12) rotate(-3deg); filter: drop-shadow(0 16px 24px rgba(32, 37, 66, .28)); }

/* 身体漂浮呼吸 */
.pet-fab .pet-body {
  animation: petBob 3.4s ease-in-out infinite;
  transform-box: fill-box; transform-origin: 50% 92%;
}
/* 说话时欢快摇摆 + 眯眯眼 */
.pet-fab.talking .pet-body { animation: petBobTalk .6s ease-in-out infinite; }
.pet-fab .pe-open { transform-box: fill-box; transform-origin: center; animation: petBlink 4.8s infinite; }
.pet-fab .pe-happy { opacity: 0; }
.pet-fab.talking .pe-open { opacity: 0; animation: none; }
.pet-fab.talking .pe-happy { opacity: 1; }
/* 开心跳跃 */
.pet-fab.excited .pet-body { animation: petJump .55s ease-in-out 3; }

@keyframes petBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes petBobTalk { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.035); } }
@keyframes petJump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-17px); } 60% { transform: translateY(-14px); } }
@keyframes petBlink { 0%, 91%, 97%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.06); } }

/* ---------------- 说话气泡 ---------------- */
.pet-bubble {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  min-width: 130px; max-width: 252px; padding: 9px 13px 10px;
  border-radius: 14px; background: var(--bg2, #fff);
  border: 1.5px solid var(--rule); box-shadow: 0 12px 32px rgba(32, 37, 66, .16);
  font-size: 13px; line-height: 1.6; color: var(--ink);
  opacity: 0; transform: translateY(8px) scale(.88);
  transform-origin: 24px 105%;
  transition: opacity .22s, transform .26s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none; z-index: 2;
}
.pet-fab.bubble-open .pet-bubble { opacity: 1; transform: translateY(0) scale(1); }
.pet-bubble::after {
  content: ''; position: absolute; bottom: -6.5px; left: 22px;
  width: 12px; height: 12px; background: var(--bg2, #fff);
  border-right: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule);
  transform: rotate(45deg); border-radius: 0 0 4px 0;
}
.pet-bubble .pb-name {
  display: block; font-size: 10.5px; font-weight: 700; color: var(--accent);
  margin-bottom: 2px; letter-spacing: .4px;
}
.pet-bubble .pb-text { display: block; word-break: break-word; }
/* 贴边时气泡对齐方向 */
.pet-bubble.pb-left { left: 0; transform-origin: 24px 105%; }
.pet-bubble.pb-right { left: auto; right: 0; transform-origin: calc(100% - 24px) 105%; }
.pet-bubble.pb-right::after { left: auto; right: 22px; }

/* ---------------- 设置页：宠物画廊 ---------------- */
.pet-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 12px; }
.pet-opt {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 8px; border-radius: 14px; border: 2px solid var(--rule);
  background: transparent; cursor: pointer; transition: all .18s; color: var(--text);
  font-family: inherit;
}
.pet-opt svg { width: 52px; height: 52px; overflow: visible; }
.pet-opt b { font-size: 12.5px; }
.pet-opt small { font-size: 10.5px; color: var(--muted); }
.pet-opt:hover { border-color: var(--accent); transform: translateY(-3px); }
.pet-opt.active {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .18);
}
.pet-opt.active b { color: var(--accent); }

/* 移动端适配 */
@media (max-width: 760px) {
  .pet-fab { width: 74px; height: 84px; }
  .pet-bubble { max-width: 208px; font-size: 12px; }
  .pet-gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) and (min-width: 761px) {
  .pet-gallery { grid-template-columns: repeat(3, 1fr); }
}
