/* ============================================================================
   学业规划 PWA · 设计系统
   视觉沿用同仓库班级站（class_info_site）的「清爽学院风」：
     靛蓝主色 + 渐变、#f5f7fd 页底、白卡片 + #e8ecf5 细边框、14px 圆角、
     模糊白导航、胶囊 chip、渐变头像。
   布局：手机 → 底部 5 Tab + 悬浮按钮；桌面 → 顶部导航 + 居中内容列。
   ========================================================================== */

:root {
  /* ---- 品牌色板（与班级站一致）---- */
  --brand: #4a6cf7;
  --brand-dark: #3a56d4;
  --brand-light: #eef2ff;
  --brand-gradient: linear-gradient(135deg, #4a6cf7 0%, #7c8ff8 100%);
  --accent: #ffb020;
  --accent-light: #fff6e0;
  --danger: #e5484d;
  --success: #2fb27d;
  --info: #3a9ee0;

  --ink: #2b3245;
  --ink-soft: #5f6b7f;
  --ink-mute: #8d97a8;
  --bg-page: #f5f7fd;
  --bg-card: #ffffff;
  --bg-soft: #f3f5fc;
  --border-soft: #e8ecf5;
  --border-strong: #dfe5f1;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(43, 50, 69, .06);
  --shadow-md: 0 6px 20px rgba(43, 50, 69, .08);
  --shadow-lg: 0 14px 40px rgba(43, 50, 69, .12);

  --gap: 12px;
  --pad: 16px;
  --topnav-h: 60px;
  --tabbar-h: 58px;
  --shell-max: 780px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
          -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --ink: #e9edf7;
  --ink-soft: #a9b4c8;
  --ink-mute: #7b879c;
  --bg-page: #10131c;
  --bg-card: #181c28;
  --bg-soft: #1f2433;
  --border-soft: #262c3d;
  --border-strong: #303850;
  --brand-light: rgba(74, 108, 247, .16);
  --accent-light: rgba(255, 176, 32, .14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .45);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }  /* 16px 防 iOS 聚焦缩放 */
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.2px; }

/* ---------------------------------------------------------------- 布局骨架 */

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部导航：桌面显示，手机隐藏 */
.topnav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .topnav { background: rgba(24, 28, 40, .86); }

.topnav .inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  height: var(--topnav-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topnav .brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex: none;
}
.topnav .brand span { white-space: nowrap; }
/* 注意：不要给品牌用 .dot —— 那个类名是列表圆点（9px 圆形），
   撞名会把「规划」两个字塞进圆圈里挤成两行（踩过这个坑） */
.topnav .brand .brand-accent { color: var(--brand); }

.topnav nav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: nowrap; min-width: 0; }
.topnav nav a { white-space: nowrap; }
.topnav nav a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .94rem;
  border-radius: 10px;
  padding: .42rem .78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s ease;
}
.topnav nav a:hover { color: var(--brand); background: var(--brand-light); }
.topnav nav a[aria-current="page"] { color: var(--brand); background: var(--brand-light); font-weight: 600; }
.topnav nav a svg { width: 17px; height: 17px; }

.user-pill {
  display: flex;
  align-items: center;
  gap: .55rem;
  background: var(--brand-light);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: .24rem .35rem .24rem .85rem;
  color: var(--ink);
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}
.user-pill:hover { color: var(--brand); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; flex: none;
}

.shell { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: var(--shell-max); margin: 0 auto; }

.view {
  flex: 1;
  padding: var(--gap) var(--pad) calc(var(--tabbar-h) + var(--safe-bottom) + 96px);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* 手机头部 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 35;
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
[data-theme="dark"] .app-header { background: rgba(24, 28, 40, .88); }
.app-header .bar { height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 var(--pad); }
.app-header h1 { font-size: 18px; font-weight: 750; margin: 0; }
.app-header .sub { font-size: 11.5px; color: var(--ink-mute); font-weight: 500; }

/* 底部 Tab 栏：手机显示 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border-soft);
  padding-bottom: var(--safe-bottom);
}
[data-theme="dark"] .tabbar { background: rgba(24, 28, 40, .95); }
.tabbar a {
  height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--ink-mute); font-size: 11px; font-weight: 600;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--brand); }

/* 悬浮按钮：尺寸恒定 56，绝不参与任何宽度覆盖 */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  z-index: 38;
  width: 56px; height: 56px; min-width: 56px; max-width: 56px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff; border: none;
  box-shadow: 0 10px 24px rgba(74, 108, 247, .42);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fab:hover { box-shadow: 0 14px 30px rgba(74, 108, 247, .5); }
.fab:active { transform: scale(.94); }
.fab.hidden { display: none; }

/* ---------------------------------------------------------------- 通用组件 */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card.pad { padding: 16px; }
.card.flat { box-shadow: none; }
.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 8px;
}
.card-head h2 { font-size: 14.5px; font-weight: 700; margin: 0; flex: 1; }
.card-head .hint { font-size: 12px; color: var(--ink-mute); font-weight: 500; }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  margin: 8px 2px -2px;
  letter-spacing: .2px;
}
.section-title > :last-child:not(:first-child) { margin-left: auto; }
.section-title .hint { font-weight: 500; color: var(--ink-mute); font-size: 11.5px; }

/* 渐变页面头（对应班级站的 .page-head） */
.hero {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.hero .k { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.hero .v { font-size: 22px; font-weight: 800; margin: 4px 0 3px; letter-spacing: -.4px; color: #fff; }
.hero .m { font-size: 13px; color: rgba(255, 255, 255, .88); }
.hero .actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero .actions .btn {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  height: 38px;
  font-size: 13.5px;
}
.hero .actions .btn:hover { background: rgba(255, 255, 255, .28); color: #fff; }

.row {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--border-soft);
  min-height: 54px;
}
.row:first-child { border-top: none; }
.row .grow { flex: 1; min-width: 0; }
.row.tappable { transition: background .15s ease; cursor: pointer; }
.row.tappable:hover { background: var(--bg-soft); }
.row .chev { color: var(--ink-mute); flex: none; }

/* .title / .meta 是通用文本模式：列表行、任务行、看板卡片都用它，
   所以不要写成 `.row .title`，否则任务行会丢掉样式（踩过一次） */
.title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta {
  font-size: 12.5px; color: var(--ink-mute);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.meta > span { white-space: nowrap; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--brand); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.badge.brand { background: var(--brand-light); color: var(--brand-dark); border-color: transparent; }
.badge.ok { background: rgba(47, 178, 125, .13); color: #1f8f62; border-color: transparent; }
.badge.warn { background: var(--accent-light); color: #b97a00; border-color: transparent; }
.badge.danger { background: rgba(229, 72, 77, .12); color: #c9363b; border-color: transparent; }
.badge.info { background: rgba(58, 158, 224, .13); color: #2277b4; border-color: transparent; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--bg-card); color: var(--ink-soft); border: 1px solid var(--border-soft);
  white-space: nowrap; transition: all .15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.chip[aria-pressed="true"], .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--ink);
  border: 1px solid var(--border-soft); font-weight: 500; font-size: 14.5px;
  transition: all .16s ease;
}
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.btn:active { transform: scale(.985); }
.btn.primary {
  background: var(--brand-gradient); color: #fff; border: none;
  box-shadow: 0 6px 16px rgba(74, 108, 247, .3);
}
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.soft { background: var(--brand-light); color: var(--brand); border-color: transparent; }
.btn.soft:hover { background: #dde5ff; color: var(--brand-dark); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-light); }
.btn.danger { color: var(--danger); border-color: #f6c8ca; background: #fff; }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { flex: none; }

.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg-card); color: var(--ink);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  outline: none; appearance: none; transition: all .15s ease;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(74, 108, 247, .14);
}
.textarea { min-height: 88px; resize: vertical; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 11.5px; color: var(--ink-mute); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.switch { position: relative; width: 48px; height: 29px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #d8dfeb; transition: background .18s; }
[data-theme="dark"] .switch .track { background: #39415a; }
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s;
}
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(19px); }

.segmented {
  display: flex; padding: 3px; gap: 3px;
  background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 11px;
}
.segmented button {
  flex: 1; height: 34px; border: none; background: transparent; color: var(--ink-soft);
  font-weight: 600; font-size: 13.5px; border-radius: 9px; transition: all .15s ease;
}
.segmented button:hover { color: var(--brand); }
.segmented button[aria-pressed="true"] {
  background: var(--bg-card); color: var(--brand); box-shadow: var(--shadow-sm);
}

.progress { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand-gradient); border-radius: 999px; transition: width .3s; }

.empty { text-align: center; padding: 34px 20px; color: var(--ink-soft); }
.empty .big { font-size: 15px; font-weight: 650; color: var(--ink); margin: 10px 0 4px; }
.empty svg { width: 38px; height: 38px; opacity: .45; color: var(--brand); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--brand); }
.stat .lbl { font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; }

/* ---------------------------------------------------------------- 今天 */

.timeline { position: relative; padding: 6px 4px; }
.timeline .item { display: flex; gap: 12px; padding: 9px 0; }
.timeline .time { width: 46px; flex: none; font-size: 12px; color: var(--ink-mute); font-weight: 650; padding-top: 3px; }
.timeline .body {
  flex: 1; border-left: 3px solid var(--brand); border-radius: 6px;
  padding: 8px 12px; background: var(--bg-soft);
}
.timeline .body .n { font-weight: 650; font-size: 14.5px; }
.timeline .body .p { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }

/* ---------------------------------------------------------------- 课表 */

.week-bar { display: flex; align-items: center; gap: 8px; width: 100%; }
.week-bar .label { flex: 1; text-align: center; font-weight: 700; font-size: 14.5px; }

.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid { display: grid; grid-template-columns: 36px repeat(7, minmax(44px, 1fr)); gap: 3px; min-width: 100%; }
.grid .h { font-size: 10.5px; text-align: center; color: var(--ink-mute); font-weight: 700; padding: 5px 0; }
.grid .h.today { color: var(--brand); }
.grid .pn { font-size: 10px; color: var(--ink-mute); text-align: center; padding-top: 5px; line-height: 1.2; }
.grid .cell { min-height: 50px; border-radius: 8px; background: var(--bg-soft); }
.grid .cell.filled { padding: 3px; }
.course-block {
  height: 100%; border-radius: 8px; padding: 5px 6px; color: #fff;
  font-size: 10.5px; font-weight: 650; line-height: 1.3; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
  cursor: pointer; transition: filter .15s ease;
}
.course-block:hover { filter: brightness(1.08); }
.course-block .loc { font-size: 9.5px; font-weight: 500; opacity: .92; }

.agenda-day { border-top: 1px solid var(--border-soft); padding: 11px 16px; }
.agenda-day:first-child { border-top: none; }
.agenda-day .dh { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 7px; }
.agenda-day .dh.today { color: var(--brand); }
.agenda-item { display: flex; gap: 9px; align-items: baseline; padding: 6px 0; cursor: pointer; }
.agenda-item:hover .grow { color: var(--brand); }
.agenda-item .t { font-size: 12px; color: var(--ink-mute); width: 84px; flex: none; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 任务 */

.task-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px;
  border-top: 1px solid var(--border-soft); transition: background .15s ease;
}
.task-row:first-child { border-top: none; }
.task-row:hover { background: var(--bg-soft); }
.task-row .check {
  width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px;
  border: 2px solid var(--border-strong); background: transparent;
  display: flex; align-items: center; justify-content: center; color: transparent;
  transition: all .15s ease;
}
.task-row .check:hover { border-color: var(--success); }
.task-row .check.done { background: var(--success); border-color: var(--success); color: #fff; }
.task-row .check svg { width: 13px; height: 13px; }
.task-row.done .title { text-decoration: line-through; color: var(--ink-mute); }
.task-row .prio { width: 4px; align-self: stretch; border-radius: 3px; flex: none; }
.prio-3 { background: var(--danger); } .prio-2 { background: var(--accent); }
.prio-1 { background: var(--brand); } .prio-0 { background: var(--border-strong); }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban .col { min-width: 74%; display: flex; flex-direction: column; gap: 9px; }
.kanban .col h3 { font-size: 12.5px; margin: 0; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.kanban .kcard {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: all .15s ease;
}
.kanban .kcard:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.kanban .kcard.dragging { opacity: .5; }

.subtask { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px dashed var(--border-soft); }
.subtask:first-child { border-top: none; }

/* ---------------------------------------------------------------- 考试 / 复习 */

.exam-card { display: flex; gap: 13px; align-items: center; }
.cd {
  width: 62px; flex: none; text-align: center; border-radius: var(--radius-sm);
  background: var(--brand-light); color: var(--brand); padding: 9px 4px;
}
.cd .d { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.cd .u { font-size: 10px; font-weight: 700; }
.cd.soon { background: rgba(229, 72, 77, .1); color: var(--danger); }

.plan-day { border-top: 1px solid var(--border-soft); padding: 11px 16px; }
.plan-day:first-child { border-top: none; }
.plan-day .dh { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.plan-block {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-top: 7px;
  border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px dashed var(--border-strong);
  cursor: pointer; transition: all .15s ease;
}
.plan-block:hover { border-color: var(--brand); background: var(--brand-light); }
.plan-block.done { opacity: .6; }
.plan-block.done .grow { text-decoration: line-through; }
.plan-block .t { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-mute); width: 92px; flex: none; }
.plan-block.dragging { opacity: .45; }

.prio-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.prio-table th, .prio-table td { padding: 8px 5px; text-align: right; border-bottom: 1px solid var(--border-soft); }
.prio-table th:first-child, .prio-table td:first-child { text-align: left; }
.prio-table thead th {
  background: var(--bg-soft); color: var(--ink-soft); font-weight: 600; font-size: 11.5px;
}
.prio-table tbody tr:hover { background: var(--bg-soft); }

/* ---------------------------------------------------------------- 成绩 / 专注 */

.score-hero { text-align: center; padding: 22px 16px; }
.score-hero .val { font-size: 46px; font-weight: 800; letter-spacing: -2px; line-height: 1; color: var(--brand); }
.score-hero .val.small { font-size: 30px; }
.score-hero .lbl { font-size: 12.5px; color: var(--ink-mute); margin-top: 8px; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding: 0 2px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.bars .b > i {
  width: 100%; background: var(--brand-gradient); border-radius: 5px 5px 3px 3px;
  min-height: 3px; display: block;
}
.bars .b .l { font-size: 9.5px; color: var(--ink-mute); }

.timer-ring { position: relative; width: 208px; height: 208px; margin: 0 auto; }
.timer-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.timer-ring .inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-ring .inner .t { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -2px; }
.timer-ring .inner .s { font-size: 12px; color: var(--ink-mute); }

/* ---------------------------------------------------------------- 抽屉 / 弹层 / Toast */

.backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(43, 50, 69, .45);
  opacity: 0; transition: opacity .2s;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.backdrop.show { opacity: 1; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 92vh; display: flex; flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(102%);
  transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: var(--safe-bottom);
}
.sheet.show { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 9px auto 2px; flex: none; }
.sheet .hd { display: flex; align-items: center; gap: 8px; padding: 8px 16px 11px; border-bottom: 1px solid var(--border-soft); }
.sheet .hd h2 { font-size: 16px; font-weight: 700; margin: 0; flex: 1; }
.sheet .bd { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .ft { padding: 11px 16px 16px; border-top: 1px solid var(--border-soft); display: flex; gap: 9px; }
.sheet .ft .btn { flex: 1; }
.sheet.flush .bd { padding: 0; }

.toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: 90vw;
}
.toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  animation: pop .2s ease;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

.action-list { display: flex; flex-direction: column; }
.action-list button {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  background: transparent; border: none; border-top: 1px solid var(--border-soft);
  color: var(--ink); font-size: 15px; text-align: left; width: 100%; transition: background .15s ease;
}
.action-list button:first-child { border-top: none; }
.action-list button:hover { background: var(--bg-soft); }
.action-list button svg { width: 19px; height: 19px; color: var(--brand); }

/* ---------------------------------------------------------------- 状态与提示 */

.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-mute); flex: none; }
.sync-dot.ok { background: var(--success); }
.sync-dot.warn { background: var(--accent); }
.sync-dot.off { background: var(--danger); }
.sync-dot.busy { background: var(--brand); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--brand-light); color: var(--ink); font-size: 12.5px; line-height: 1.55;
}
.banner.warn { background: var(--accent-light); }
.banner.danger { background: rgba(229, 72, 77, .1); }
.banner svg { flex: none; width: 17px; height: 17px; margin-top: 1px; color: var(--brand); }
.banner.warn svg { color: #b97a00; }
.banner.danger svg { color: var(--danger); }

.list-plain { margin: 0; padding: 0; list-style: none; }
.muted { color: var(--ink-mute); }
.small { font-size: 12px; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 600; padding: 0; }
.link-btn:hover { color: var(--brand-dark); text-decoration: underline; }
.checkbox-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; }
.checkbox-line input { width: 18px; height: 18px; accent-color: var(--brand); }

.period-editor .prow { display: grid; grid-template-columns: 32px 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 9px; }
.period-editor .pno { font-size: 12px; color: var(--ink-mute); text-align: center; font-weight: 700; }

.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--ink-mute); gap: 9px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-soft); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   响应式：桌面（≥ 820px）切换为「顶部导航 + 居中内容列」
   注意：这里**不再**给 .tabbar/.fab 设置 width，之前那版把固定定位元素
   改成 720px 宽，导致悬浮按钮变成巨大椭圆、Tab 栏横穿整屏。
   ========================================================================== */
@media (min-width: 820px) {
  .topnav { display: block; }
  .app-header { display: none; }
  .tabbar { display: none; }

  .view {
    padding: 20px 0 60px;
    gap: 14px;
  }
  .shell { padding: 0 20px; }

  .fab {
    right: max(24px, calc(50vw - var(--shell-max) / 2 - 72px));
    bottom: 28px;
  }

  .toast-wrap { bottom: 28px; }

  .hero { padding: 24px 26px; }
  .hero .v { font-size: 25px; }
  .kanban .col { min-width: 31%; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }

  /* 抽屉在桌面上居中显示，像对话框而不是贴底 */
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(560px, calc(100vw - 48px));
    max-height: 86vh;
    border-radius: var(--radius-lg);
    transform: translate(-50%, -46%) scale(.98);
    opacity: 0;
    transition: transform .22s cubic-bezier(.32, .72, 0, 1), opacity .22s;
  }
  .sheet.show { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet .hd { padding: 16px 20px 12px; }
  .sheet .bd { padding: 20px; }
  .sheet .ft { padding: 14px 20px 18px; }
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: 40px repeat(7, minmax(60px, 1fr)); }
  .grid .cell { min-height: 56px; }
}
