/* 事齐 SHIQI 视觉定调 v2 —— 拟物「象牙纸 + 深靛蓝 + 淡金」主方案
 * 规格来源：docs/design/handoff-20260805/README.md「Design Tokens」。
 * 本次只做象牙纸单主题（交接包没给暗色规格），旧的 prefers-color-scheme 暗色分支已移除。
 * 字体本地 woff2（GFW + PWA 要求禁外链）。
 */

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #faf7f1;
  --surface: #fffefb;
  --surface-grad: linear-gradient(180deg, #fffefb 0%, #f8f5ee 100%);
  --sunken: #f2eee5;
  --line: #e6e1d6;
  --hair: #ece7dd;
  --ink: #22201d;
  --mist: #5c574f;
  --faint: #726c62;

  --blue: #1f3a5f;
  --blue-lit: #2e5a8a;
  --blue-soft: #e3eaf2;

  --berry: #b02b24;
  --berry-lit: #bd3229;
  --berry-soft: #f7e2df;

  --brush: #a8511f;
  --brush-lit: #b45c22;
  --brush-soft: #f7e5d6;

  --tan: #c8ab6d;
  --tan-lit: #e8d9ae;
  --tan-soft: #f9f2e0;

  --matcha: #2f6b58;
  --matcha-lit: #47907a;
  --matcha-soft: #e0ebe5;

  /* 小字可读性修正：同色相但更深，专给文字/11px 以下用（4.5:1 对比度） */
  --matcha-text: #2b6151;
  --tan-text: #8a6f2c;
  --brush-text: var(--brush);
  --berry-text: var(--berry);

  --sidebar-gradient: linear-gradient(178deg, #22344a 0%, #1a2939 52%, #14202d 100%);
  --gold-gradient: linear-gradient(160deg, #f2e6c4 0%, #e0cd9c 30%, #c8ab6d 52%, #d9c48f 68%, #ac8f52 100%);

  --r-card: 12px;
  --r-chip: 7px;
  --gap: 12px;
  --pad: 16px;

  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* 拟物材质片段（README「材质片段」逐值照抄） */
  --sh-raised: inset 0 1px 0 rgba(255,255,255,0.72), 0 1px 1px rgba(43,38,36,0.1), 0 8px 18px -10px rgba(43,38,36,0.28);
  --sh-raised-hi: inset 0 1px 0 rgba(255,255,255,0.72), 0 2px 3px rgba(43,38,36,0.12), 0 16px 28px -12px rgba(43,38,36,0.38);
  --sh-carved: inset 0 2px 4px rgba(60,58,52,0.18), 0 1px 0 rgba(255,255,255,0.85);
  --carved-grad: linear-gradient(180deg, #f2efe6 0%, #fffefb 22%);
  --sh-btn-primary: inset 0 1px 0 rgba(255,255,255,0.32), 0 2px 0 #16293f, 0 6px 14px rgba(20,32,45,0.28);
  --text-emboss: 0 1px 0 rgba(255,255,255,0.65);
  --text-emboss-dark: 0 -1px 0 rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

time, .num, .cal-daynum, .count {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

a { color: var(--blue-lit); }

h1, h2, h3 { font-family: var(--sans); }

/* ---------- 严重度阶梯（signature 元素）：data-sev 0-4，见 README「严重度阶梯」 ---------- */

[data-sev="0"] { --sev: var(--faint); --sev-text: var(--faint); --sev-soft: var(--sunken); --sev-fill: 0%; }
[data-sev="1"] { --sev: var(--matcha); --sev-text: var(--matcha-text); --sev-soft: var(--matcha-soft); --sev-fill: 20%; }
[data-sev="2"] { --sev: var(--tan); --sev-text: var(--tan-text); --sev-soft: var(--tan-soft); --sev-fill: 50%; }
[data-sev="3"] { --sev: var(--brush); --sev-text: var(--brush-text); --sev-soft: var(--brush-soft); --sev-fill: 78%; }
[data-sev="4"] { --sev: var(--berry); --sev-text: var(--berry-text); --sev-soft: var(--berry-soft); --sev-fill: 100%; }

/* ---------- 基础控件：按钮 / 输入框（拟物材质，login/register 也复用这套） ---------- */

button { font: inherit; }

button.primary {
  padding: 11px 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: var(--text-emboss-dark);
  background: linear-gradient(180deg, var(--blue-lit), var(--blue));
  border: none;
  border-radius: var(--r-chip);
  box-shadow: var(--sh-btn-primary);
  cursor: pointer;
  transition: transform 0.1s ease;
}
button.primary:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.32);
}
button.primary:disabled { opacity: 0.55; cursor: default; }

button.ghost {
  padding: 8px 13px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface-grad);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  box-shadow: var(--sh-raised);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
button.ghost:hover { box-shadow: var(--sh-raised-hi); transform: translateY(-1px); }
button.ghost[aria-pressed="true"] {
  color: var(--blue);
  border-color: var(--blue-soft);
  background: var(--blue-soft);
  box-shadow: var(--sh-carved);
}

input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--carved-grad);
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  box-shadow: var(--sh-carved);
}

.capture input:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue-lit);
  outline-offset: 1px;
}

/* ---------- 骨架：三栏 252 / 弹性 / 356，设置视图收起为 252 / 1fr ---------- */

.app {
  min-height: 100vh;
  padding-bottom: 76px;
  /* 原型的外壳定的是 14px/1.5——所有没显式写字号的地方都从这里继承。
     根字号差 1px 会让整份版面逐行累积位移，是像素比对里最贵的一处差。 */
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

main {
  padding: var(--pad);
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- 侧栏：皮面渐变 + 烫金 logo + 导航 + 负荷图 + 清单 + 连接状态 ----------
 * 桌面段所有数值逐条照抄原型 <aside> 及其子节点的内联样式；移动端段是任务3 的
 * 底部 tab bar（另一套设计），两段用媒体查询彻底隔开。 */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-texture, .nav-edge, .nav-links, .nav-spacer, .lists-box { display: none; }

@media (min-width: 900px) {
  .app {
    display: grid;
    grid-template-columns: 252px minmax(430px, 1fr) 356px;
    padding-bottom: 0;
    height: 100vh;
    overflow: hidden;
    box-shadow: inset 0 0 90px rgba(122, 96, 70, 0.13);
  }
  .app.settings-mode { grid-template-columns: 252px minmax(430px, 1fr); }
  .nav {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    flex-direction: column;
    gap: 18px;
    padding: 20px 14px 16px;
    background: linear-gradient(178deg, #22344a 0%, #1a2939 52%, #14202d 100%);
    border-top: none;
    border-right: none;
    box-shadow: inset -9px 0 14px -10px rgba(0,0,0,0.55), 2px 0 0 rgba(0,0,0,0.18);
  }
  /* 皮面细纹理：两层斜向重复渐变叠加，原型逐值 */
  .nav-texture {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.5;
    background:
      repeating-linear-gradient(96deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 3px),
      repeating-linear-gradient(4deg, rgba(0,0,0,0.05) 0 1px, transparent 1px 4px);
  }
  /* 右缘虚线分隔 */
  .nav-edge {
    display: block;
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 7px;
    width: 1px;
    border-right: 1px dashed rgba(247,242,231,0.2);
  }
  .nav-links {
    display: flex;
    position: relative;
    flex-direction: column;
    gap: 6px;
  }
  .nav-spacer { display: block; flex: 1; }

  main {
    grid-column: 2;
    grid-row: 1 / -1;
    max-width: none;
    margin: 0;
    padding: 0;
    align-self: stretch;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--paper);
    position: relative;
  }
  /* 主区纸张细横纹 + 左缘内阴影（原型 main 的两个绝对定位覆盖层） */
  main::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
    background: repeating-linear-gradient(0deg, rgba(60,58,52,0.035) 0 1px, transparent 1px 5px);
  }
  main::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 14px;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(90deg, rgba(60,58,52,0.09), transparent);
  }
  main > * { position: relative; z-index: 1; }
  .detail {
    grid-column: 3;
    grid-row: 1 / -1;
    min-height: 0;
  }
}

.nav .brand {
  display: none;
}
@media (min-width: 900px) {
  .nav .brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 4px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.35);
    box-shadow: 0 1px 0 rgba(255,255,255,0.07);
  }
  .nav .brand .logo {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: var(--gold-gradient);
    color: #14202d;
    font-size: 14px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), inset 0 -1px 0 rgba(0,0,0,0.22), 0 2px 5px rgba(0,0,0,0.32);
    text-shadow: 0 1px 0 rgba(255,255,255,0.45);
  }
}

.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 9px;
  text-align: center;
  font-size: 10.5px;
  color: var(--mist);
  text-decoration: none;
}

.nav a .glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  background: var(--sunken);
  color: var(--mist);
}
/* dot/count 是桌面侧栏专属的行内指示；移动端 tab bar 用图标+文字标签（README 移动版实测） */
.nav a .dot, .nav a .n { display: none; }
.nav a .label { display: block; }
/* 移动端 tab bar 只留 4 项：今日/四象限/日历/设置，「全部」走今日页顶部分段控件 */
.nav a[href*="scope=all"] { display: none; }

.nav a[aria-current="page"] {
  color: var(--blue-lit);
  font-weight: 600;
}
.nav a[aria-current="page"] .glyph { background: var(--blue-soft); color: var(--blue); }

@media (min-width: 900px) {
  /* 桌面导航项的全部视觉由 theme.js navStyle()/navDot()/sideNum() 内联给出
     （像素级还原：值只有一份，在原型源码里）；这里只负责把移动端的
     display:none 复位掉，别的一概不碰。 */
  .nav a { flex: none; }
  .nav a .glyph { display: none; }
  .nav a .dot, .nav a .n { display: block; }
  .nav a[href*="scope=all"] { display: flex; }
}

/* 未完成负荷卡片：5 级堆叠条形图 + 图例（原型逐值） */
.load-card { display: none; }
@media (min-width: 900px) {
  .load-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 13px 13px 14px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.26) 0%, rgba(0,0,0,0.15) 100%);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.07);
  }
  .load-card .load-head {
    display: flex;
    align-items: baseline;
    gap: 7px;
  }
  .load-bar {
    display: flex;
    gap: 2px;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.08);
  }
  .load-legend { display: flex; flex-direction: column; gap: 6px; }
  .load-legend .row { display: flex; align-items: center; gap: 8px; }
}

/* 清单区块 */
@media (min-width: 900px) {
  .lists-box {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .lists-head {
    display: flex;
    align-items: baseline;
    padding: 0 5px 7px;
  }
  .lists-add {
    font-size: 16px;
    line-height: 1;
    color: #8a97a6;
    cursor: pointer;
    transition: color 130ms ease;
  }
  .lists-add:hover { color: var(--tan-lit); }
  .list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: none;
    font: inherit;
    color: #d6dbe2;
    cursor: pointer;
    text-align: left;
    transition: background 130ms ease;
  }
  .list-row:hover { background: rgba(255,255,255,0.07); }
}

/* 案齐连接状态条 */
.conn-status { display: none; }
@media (min-width: 900px) {
  .conn-status {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(0,0,0,0.14));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 1px 3px rgba(0,0,0,0.32);
  }
  .conn-status img {
    display: block;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.4);
  }
}

/* ---------- 主区 header：大标题 + 副标题 + 分段控件 + 统计卡 + 完成度 ----------
 * 桌面数值逐条照抄原型 <header> 及 stats/donePct 块的内联样式。 */

/* 移动端兜底在前，桌面媒体查询在后——同特异度下后写的赢，顺序写反了
   桌面就会被移动端的 padding 盖掉（本轮已经踩过两次同款）。 */
.view-header { padding: var(--pad); }
.view-body { padding: 0 var(--pad) var(--pad); }

@media (min-width: 900px) {
  .view-header {
    position: relative;
    flex: 0 0 auto;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255,255,255,0.8);
  }
  /* 滚动体：header 与快捷键条之间那段 */
  .view-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 26px 40px;
  }
  /* 设置页的 720px 上限是「含内边距」的整块宽度（原型把 max-width 写在这层
     padding 盒上，不是写在里面的卡片列表上），差 52px 就是这么来的 */
  .settings-mode .view-body { max-width: 720px; padding: 22px 26px 40px; }
}

.view-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.view-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}
@media (min-width: 900px) {
  .view-head h1 { font-size: 27px; text-shadow: 0 1px 0 rgba(255,255,255,0.9); }
  .view-head .spacer { flex: 1; }
}

.view-head .sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--mist);
  padding-bottom: 3px;
}

.scope-toggle {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: linear-gradient(180deg, #eeeae1, #f5f2e9);
  box-shadow: inset 0 2px 4px rgba(60,58,52,0.32), 0 1px 0 rgba(255,255,255,0.85);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 17px;
}
@media (min-width: 900px) {
  .stat-row {
    display: flex;
    gap: 11px;
    margin-top: 17px;
  }
}

/* 三张统计卡与今日完成度块的具体数值全部由 shell.js 内联给出（原型逐值），
   这里只留移动端的兜底排版。 */
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 90px;
  padding: 12px 14px 13px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(180deg, #fffefb 0%, #faf7f1 100%);
  overflow: hidden;
  box-shadow: var(--sh-raised);
}

.today-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  padding: 0 2px 4px 8px;
}
.today-progress .pct-row { display: flex; align-items: baseline; gap: 7px; }
.today-progress .track {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(180deg, #eae6dc, #f2eee5);
  box-shadow: inset 0 2px 4px rgba(60,58,52,0.36), 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
}

/* ---------- 快录条（原型逐值） ---------- */

.capture {
  display: flex;
  gap: 9px;
}

.capture input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f5ed 0%, #fffefb 22%);
  border: 1px solid #dcd6c9;
  border-radius: 10px;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(60,58,52,0.26), 0 1px 0 rgba(255,255,255,0.9);
  transition: box-shadow 140ms ease, border-color 140ms ease;
}
.capture input:focus,
.capture input:focus-visible {
  border-color: var(--blue);
  outline: none;
  box-shadow: inset 0 2px 5px rgba(60,58,52,0.2), 0 0 0 3px rgba(31,58,95,0.24);
}

/* 「记下」主按钮：navy 渐变 + 2px 实体裙边，按下时裙边塌陷 */
.capture button.primary {
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  color: #fbfaf6;
  background: linear-gradient(180deg, #2e5a8a 0%, #1f3a5f 100%);
  border: 1px solid #17304f;
  border-radius: 10px;
  cursor: pointer;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 0 #16293f, 0 5px 12px rgba(43,38,36,0.24);
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.capture button.primary:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.32), 0 0 0 #16293f;
}

.capture-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 11px 0 22px;
  min-height: 26px;
  flex-wrap: wrap;
}
.capture-chips button {
  padding: 6px 12px;
  border: 1px solid #d3cdc0;
  border-radius: 9px;
  background: linear-gradient(180deg, #fffefb, #f0ece2);
  font: inherit;
  font-size: 11.5px;
  color: var(--mist);
  cursor: pointer;
  text-shadow: var(--text-emboss);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 1px 0 #d3cdc0, 0 2px 4px rgba(43,38,36,0.14);
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.capture-chips button:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px rgba(60,58,52,0.3);
}
.capture-chips .spacer { flex: 1; }
.capture-chips .hint-text {
  font-size: 11.5px;
  color: var(--faint);
  text-shadow: var(--text-emboss);
}

/* ---------- 分组：逾期/今天/明天/接下来/以后/无期限（原型逐值） ---------- */

.group { margin-bottom: 24px; }

.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
.group-head .line {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(60,58,52,0.16), rgba(255,255,255,0.9));
}

.empty {
  padding: 26px 14px;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
  text-shadow: var(--text-emboss);
}

/* ---------- 任务行：双信号 = 左侧严重度色条 + 底部填充下划线 ----------
 * 行本体、色条、下划线、勾选框、标题、徽标、时间、星标、hover 快捷钮的全部视觉
 * 都由 theme.js 的 rowStyle()/barStyle()/... 内联给出（原型 row() 逐值）。
 * 这里只留列表容器与不进内联的少数装饰。 */

.tasklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.src-icon { width: 15px; height: 15px; border-radius: 4px; vertical-align: -3px; }

.tag {
  display: inline-block;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.tag.ro { color: var(--faint); }

/* 四象限格内的紧凑任务列表间距（原型 grp.items 容器 gap: 6px） */
.quad-cell .tasklist { gap: 6px; }
.quad-cell .empty { border: none; background: none; }

/* ---------- 四象限（格子本体/表头/编号徽章的视觉由 quadrant.js 内联给出，原型逐值） ---------- */

/* 四象限视图在原型里是「撑满主区剩余高度的 2×2」，不是随内容长高的普通网格：
   两行等分，格内各自滚动。所以这一层要吃掉 view-body 的全部高度。 */
.quad-wrap { display: flex; flex-direction: column; min-height: 0; }
.quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .quad-wrap { flex: 1; }
  .quad {
    grid-template-rows: 1fr 1fr;
    gap: 18px;
    height: 100%;
  }
  /* 四象限页的滚动交给每个格子内部，view-body 本身不滚 */
  .quad-page .view-body { overflow: hidden; display: flex; flex-direction: column; padding: 22px 26px 16px; }
}

.quad-cell { min-height: 0; }
.quad-body { flex: 1; min-height: 0; padding: 8px; overflow-y: auto; }

.case-group { margin-bottom: 6px; }
.case-group:last-child { margin-bottom: 0; }
.case-group-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 7px;
}
.case-group-head img {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(43,38,36,0.28);
}
.case-group-head .case-name {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--mist);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 四象限底部那行拖拽提示 */
.quad-hint {
  display: none;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--faint);
}
@media (min-width: 900px) {
  .quad-hint { display: flex; padding: 0 26px 14px; position: relative; flex: 0 0 auto; }
  .quad-hint .rule {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(180deg, rgba(60,58,52,0.2), rgba(255,255,255,0.9));
  }
}

/* 移动端：2×2 缩略贴片选择器，桌面不用（桌面直接四格并排） */
.quad-tiles { display: none; }
@media (max-width: 899px) {
  .quad-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .quad-tile {
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--r-chip);
    background: var(--surface-grad);
    box-shadow: var(--sh-raised);
    border: 2px solid transparent;
    cursor: pointer;
    min-height: 52px;
  }
  .quad-tile.selected { border-color: var(--blue-lit); box-shadow: var(--sh-carved); }
  .quad-tile[data-q="q1"] .tile-n { color: var(--berry); }
  .tile-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
  .tile-title { font-size: 12.5px; font-weight: 700; }
  .tile-n { font-size: 17px; font-weight: 700; }
  .tile-hint { font-size: 10.5px; color: var(--mist); margin-top: 1px; }
}

/* ---------- 日历（格子/芯片/表头的视觉由 calendar.js 内联给出，原型逐值） ---------- */

.cal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cal-bar .now { font-weight: 700; font-size: 15px; }
.cal-bar .spacer { display: none; }
.cal-steps { display: flex; gap: 5px; }
.cal-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 11px;
  color: var(--mist);
}
.cal-legend > span { display: flex; align-items: center; gap: 6px; }

/* 移动端兜底排版（桌面段在下面的媒体查询里整体覆盖） */
.cal-scroll {
  max-height: 74vh;
  overflow-y: auto;
  border-radius: var(--r-card);
  box-shadow: var(--sh-raised);
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(88px, auto);
  background: var(--line);
  gap: 1px;
}

.dow-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow-row .dow, .grid .dow {
  background: var(--sidebar-gradient);
  padding: 8px 2px;
  text-align: center;
  font-size: 11px;
  color: #b7c3d3;
}

.cell {
  background: var(--surface);
  min-height: 88px;
  padding: 5px 5px 6px;
  font-size: 11px;
}
.cell.out { background: var(--sunken); color: var(--faint); box-shadow: inset 0 1px 3px rgba(60,58,52,0.1); }
.cell.today { box-shadow: inset 0 0 0 2px var(--blue-lit); }
.cell.selected { background: var(--blue-soft); }
.cell.today.selected { box-shadow: inset 0 0 0 2px var(--blue-lit); }

.cal-daynum { display: block; font-size: 12px; color: var(--mist); margin-bottom: 2px; }
.cell.today .cal-daynum { color: var(--blue); font-weight: 700; }

@media (min-width: 900px) {
  .cal-bar { gap: 12px; margin-bottom: 15px; flex-wrap: nowrap; }
  .cal-bar .spacer { display: block; flex: 1; }
  .cal-legend { margin-left: 0; margin-right: 6px; gap: 13px; font-size: 11.5px; }
  /* 日历页：网格吃满剩余高度，滚动发生在网格内部 */
  .cal-page .view-body { display: flex; flex-direction: column; overflow: hidden; padding: 22px 26px 24px; }
  /* 整块日历是一个「凹陷托盘」，格子浮在里面 */
  .cal-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(180deg, #e2ddd0, #ece8dc);
    box-shadow: inset 0 2px 6px rgba(60,58,52,0.4), 0 1px 0 rgba(255,255,255,0.9);
  }
  .dow-row {
    background: linear-gradient(180deg, #2b4159 0%, #22344a 48%, #182634 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), inset 0 -1px 0 rgba(0,0,0,0.4);
  }
  .dow-row .dow {
    padding: 8px 0 7px;
    font-weight: 600;
    color: #d6dbe2;
    background: none;
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    box-shadow: inset -1px 0 0 rgba(0,0,0,0.22), inset 1px 0 0 rgba(255,255,255,0.05);
  }
  .cal-scroll .grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: none;
    gap: 2px;
    padding: 2px;
    align-content: stretch;
  }
  .cal-scroll.week .grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }
  /* 格子自己不定字号（原型是从外壳继承 14px），格内芯片/日期各自显式定 */
  .cal-scroll .cell { background: none; min-height: 0; box-shadow: none; font-size: inherit; }
}

/* 移动端：色点代替文字芯片（390px 下 7 列文字芯片会溢出） */
.day-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.day-dots .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sev); flex: 0 0 6px; }
.day-dots .dot.mark { background: none; border: 1.4px solid var(--berry); box-sizing: border-box; }
.day-dots .dot.mark.hearing { border-color: var(--blue-lit); }
.day-dots .more { font-size: 9px; color: var(--faint); line-height: 6px; }

.day-detail { display: none; }
@media (max-width: 899px) {
  .day-detail { display: block; margin-top: 16px; }
  /* 这几行是移动端日历「选中日期清单」的只读行，不走 taskRow()（里面还混了
     期限/开庭镜像条目），所以自带一套最小排版。 */
  .day-detail .task {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: linear-gradient(180deg, #fffefb 0%, #fdfaf4 100%);
    overflow: hidden;
    box-shadow: var(--sh-raised);
  }
  .day-detail .task.done { opacity: 0.6; }
  .day-detail .task.done .task-title { text-decoration: line-through; }
  .day-detail .task-body { flex: 1; min-width: 0; }
  .day-detail .task-title { font-size: 14px; line-height: 1.45; color: var(--ink); }
  .day-detail .task-meta { display: flex; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--mist); }
  .day-detail .task-time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .day-detail .check {
    background: var(--carved-grad);
    box-shadow: var(--sh-carved);
    border: 1px solid #dcd6c9;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-block;
  }
  .cell { cursor: pointer; }
}

/* 芯片的配色/圆角/字号全部由 calendar.js 的 taskChipEl()/markChipEl() 内联给出
   （原型逐值）；这里只留一个兜底的块级排版。 */
.chip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 周视图：单列，每行左侧日期 + 右侧芯片横排 */
.week .grid { grid-template-columns: 1fr; grid-auto-rows: auto; background: var(--surface); }
.week .cell { min-height: 54px; display: flex; gap: 10px; align-items: flex-start; padding: 9px; border-bottom: 1px solid var(--hair); }
.week .cell:last-child { border-bottom: none; }
.week .cell .cal-daynum { flex: 0 0 78px; margin: 0; font-family: var(--mono); }
.week .cell.today .cal-daynum { color: var(--blue); font-weight: 700; }
.week .cell .items { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }
.week .cell .items .chip { width: auto; margin-bottom: 0; }
@media (min-width: 900px) {
  .cal-scroll.week .cell { border-bottom: none; padding: 11px 13px; }
  .cal-scroll.week .cell .cal-daynum { flex-basis: 86px; }
}

/* ---------- 设置（卡片外壳/按钮由 settings.js 内联给出，原型逐值） ---------- */

.settings-wrap { display: flex; flex-direction: column; gap: 16px; }

.settings-card h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.settings-card p.desc { margin: 0 0 14px; font-size: 12.5px; color: var(--mist); line-height: 1.7; }
.settings-card .spacer { flex: 1; }

/* 账号卡 */
.account-row { display: flex; align-items: center; gap: 12px; }
.avatar-tile {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gold-gradient);
  color: #14202d;
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 5px rgba(34,32,29,0.22);
}
.account-info { flex: 1; min-width: 0; }
.account-info .name { font-size: 15px; font-weight: 600; color: var(--ink); }
.account-info .account { font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* 连接器卡 */
.connector-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.connector-head img {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(34,32,29,0.22);
}
.connector-head .status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, #e0ebe5, #d3e3da);
  font-size: 11px;
  font-weight: 600;
  color: var(--matcha-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.connector-head .status-pill .light {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #5fae94, #2f6b58);
}
.connector-head .status-pill.down { background: linear-gradient(180deg, #f7e2df, #f2d3cf); color: var(--berry-text); }
.connector-head .status-pill.down .light { background: radial-gradient(circle at 34% 28%, #cf6a60, #b02b24); }
.connector-head .synced { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

/* 地址/token 两行：88px 标签列 + 弹性字段列 */
.conn-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 12px;
  align-items: center;
}
.conn-grid .k { font-size: 12px; color: var(--faint); }
/* 选择器要压过上面那条 input[type="text"]（属性选择器特异度 0-1-1），
   所以写成 input.conn-field 而不是光 .conn-field —— 否则 font:inherit 会把
   等宽字体和 12.5px 字号一起冲掉。 */
input.conn-field, .conn-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcd6c9;
  border-radius: 9px;
  background: linear-gradient(180deg, #f2efe6 0%, #fffefb 22%);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--mist);
  box-shadow: var(--sh-carved);
  outline: none;
}
input.conn-field:focus { border-color: var(--blue); }

.conn-actions { display: flex; gap: 9px; margin-top: 16px; align-items: center; }
.conn-msg { align-self: center; font-size: 12px; color: var(--matcha-text); }
.conn-msg.bad { color: var(--berry-text); }

/* 邀请码卡 */
.invites-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }

.codes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.codes li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #fffefb, #f8f5ee);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 1px rgba(34,32,29,0.07);
}
.codes li .spacer { flex: 1; }
.codes li .code-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.codes li.used {
  background: linear-gradient(180deg, #f2eee5, #f6f2ea);
  box-shadow: inset 0 1px 2px rgba(60,58,52,0.14);
}
.codes li.used .code-value { color: #6a645a; text-decoration: line-through; }
.codes .status-pill {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: linear-gradient(180deg, #f9f2e0, #f2e8cf);
  color: #7a6224;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.codes li.used .status-pill { background: #f2eee5; color: #6a645a; box-shadow: none; }

/* ---------- 右侧详情面板（桌面数值逐条照抄原型 <aside> panelShellStyle 及其内部） ---------- */

.detail {
  display: none;
  overflow-y: auto;
}
@media (min-width: 900px) {
  .detail {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #f6f2ea 0%, #faf7f1 30%);
    box-shadow: inset 9px 0 14px -10px rgba(60,58,52,0.5);
  }
}
.app.settings-mode .detail { display: none; }

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 100%;
  padding: 40px 32px;
  text-align: center;
}
.detail-empty .lines { display: flex; gap: 5px; align-items: flex-end; }
.detail-empty-text {
  font-size: 13px;
  color: var(--mist);
  line-height: 1.8;
  text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}

.detail-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.85);
  flex: 0 0 auto;
}
.detail-more[disabled] { opacity: 0.45; cursor: default; }

.detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-title-row { display: flex; gap: 12px; align-items: flex-start; }
.detail-title-row .title {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: pretty;
  text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}

.info-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 备注：原型是只读 div，事齐要能改，用 textarea 顶上去——尺寸/内边距/描边/内阴影
   /字号/行高全部对齐原型那个 div，另外关掉 resize 手柄（div 本来就没有）。 */
.note-box {
  display: block;
  width: 100%;
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid #dcd6c9;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8f5ed 0%, #fffefb 18%);
  box-shadow: inset 0 2px 5px rgba(60,58,52,0.24), 0 1px 0 rgba(255,255,255,0.9);
  font-family: inherit;
  font-size: 13px;
  color: var(--mist);
  line-height: 1.75;
  resize: none;
  outline: none;
}
.note-box:focus { border-color: var(--blue); }

.subtasks-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.subtasks-progress {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(180deg, #eae6dc, #f2eee5);
  box-shadow: inset 0 2px 4px rgba(60,58,52,0.34), 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
}

.subtask-list { display: flex; flex-direction: column; gap: 3px; }
.subtask-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 130ms ease;
}
.subtask-row:hover { background: rgba(60,58,52,0.07); }
.subtask-row .sub-del {
  background: none;
  border: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 130ms ease;
}
.subtask-row:hover .sub-del { opacity: 1; }

.subtask-add {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 6px;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
}
.subtask-add:hover { color: var(--blue); }

.subtask-form { display: flex; gap: 8px; padding: 4px 0; }
.subtask-form input {
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  border: 1px solid #dcd6c9;
  border-radius: 8px;
  background: var(--carved-grad);
  box-shadow: var(--sh-carved);
  outline: none;
}

.from-anjian {
  display: flex;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid #dcd6c9;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffefb, #f6f2ea);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 1px 3px rgba(43,38,36,0.12);
}
.from-anjian img {
  display: block;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(43,38,36,0.28);
}

/* ---------- 移动端：底部抽屉（详情/快录共用背板；.capture-sheet 桌面下是普通容器） ---------- */

.sheet-backdrop {
  display: none;
}

.sheet-handle, .sheet-head { display: none; }

@media (max-width: 899px) {
  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(20, 18, 15, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sheet-backdrop.open { opacity: 1; pointer-events: auto; }

  .detail-sheet, .capture-sheet.sheet-active {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 71;
    max-height: 86vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -14px 40px rgba(20, 16, 10, 0.28);
    transform: translateY(100%);
    transition: transform 0.24s ease;
    padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  }
  .detail-sheet.open, .capture-sheet.sheet-active.open { transform: translateY(0); }

  .sheet-handle {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    margin: 6px auto 14px;
  }

  .sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .sheet-head h2 { margin: 0; font-size: 15px; }
  .sheet-head button {
    background: none;
    border: none;
    color: var(--blue-lit);
    font-size: 14px;
    padding: 6px 4px;
    cursor: pointer;
  }
}

.fab-capture { display: none; }

/* ---------- 移动端触屏命中区：一律 ≥44px ---------- */
@media (max-width: 899px) {
  .task .check, .detail-title-row .check, .subtask-row .check {
    width: 26px;
    height: 26px;
  }
  .task .check, .task .star, .subtask-row .check, .subtask-row .del {
    position: relative;
  }
  .task .check::after, .task .star::after,
  .subtask-row .check::after, .subtask-row .del::after {
    content: '';
    position: absolute;
    inset: -11px;
  }
  .nav a { min-height: 52px; }
  .capture-chips button, button.ghost { min-height: 30px; }

  .fab-capture {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    right: 16px;
    bottom: calc(70px + env(safe-area-inset-bottom) + 14px);
    z-index: 40;
    padding: 13px 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--blue-lit), var(--blue));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-shadow: var(--text-emboss-dark);
    border: none;
    box-shadow: var(--sh-btn-primary);
  }

  /* hover 快捷钮在触屏上永远不会出现，但它仍然占着一段宽度，
     390px 下会把标题挤成一行两个字。移动端直接不渲染这块。 */
  .task-actions { display: none; }

  /* 移动端主列表页不显示常驻快录条，改走悬浮按钮 + 抽屉；.capture-sheet.sheet-active 时才现身 */
  .capture-sheet:not(.sheet-active) { display: none; }
}

/* ---------- 底部快捷键提示条（原型逐值） ---------- */

.kbd-bar { display: none; }
@media (min-width: 900px) {
  .kbd-bar {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 26px 12px;
    border-top: 1px solid var(--line);
    box-shadow: 0 -1px 0 rgba(255,255,255,0.75);
    font-size: 11px;
    color: var(--faint);
  }
  .kbd-bar > span { display: flex; align-items: center; gap: 6px; }
  .kbd-bar kbd {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 1px solid #dcd6c9;
    border-radius: 5px;
    background: linear-gradient(180deg, #fffefb, #f0ece2);
    font-family: var(--mono);
    font-size: 10px;
    color: var(--mist);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 1px 0 #d3cdc0, 0 2px 3px rgba(43,38,36,0.14);
  }
}

/* ---------- 案齐降级横幅 ---------- */

.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--mist);
}
.banner img { width: 19px; height: 19px; border-radius: 5px; flex: 0 0 19px; }
.banner .msg-text { flex: 1; }
.banner .ts { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.banner.degraded {
  border-color: var(--berry);
  background: var(--berry-soft);
  color: var(--berry-text);
}
.banner.degraded .ts { color: var(--berry-text); opacity: 0.75; }

/* ---------- 完成撤销便签 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 60;
  transform: translateX(-50%) rotate(-1.2deg);
  padding: 10px 16px;
  border-radius: 6px;
  background: #2a2621;
  color: #f3ede0;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toast-in 0.22s ease;
}
@media (min-width: 900px) { .toast { bottom: 56px; } }
.toast button {
  background: none;
  border: none;
  color: var(--tan-lit);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) rotate(-1.2deg) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) rotate(-1.2deg) translateY(0); }
}

/* ---------- 登录 / 注册：深色舞台 + 浮起象牙纸卡片 ---------- */

label {
  display: block;
  margin: 12px 0 5px;
  font-size: 12px;
  color: var(--mist);
}

.auth-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255,255,255,0.05), transparent),
    var(--sidebar-gradient);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 26px 26px 22px;
  border-radius: 18px;
  background: var(--surface-grad);
  box-shadow: 0 30px 60px -20px rgba(10,16,24,0.55), var(--sh-raised-hi);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-brand .logo {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--gold-gradient);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #4a3a14;
}
.auth-brand h1 { margin: 0; font-size: 19px; letter-spacing: 0.1em; }
.auth-brand .tagline { margin: 2px 0 0; font-size: 12px; color: var(--mist); }

.auth-card label:first-of-type { margin-top: 0; }

.auth-card .field-valid {
  position: relative;
}
.auth-card .field-valid input { padding-right: 30px; }
.auth-card .field-valid .dot {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--matcha);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.auth-card .field-valid.ok .dot { opacity: 1; }
.auth-card .field-valid.ok input { border-color: var(--matcha); }

.auth-card button.primary { width: 100%; margin-top: 20px; }
.auth-card button.primary:disabled {
  background: var(--sunken);
  color: var(--faint);
  box-shadow: none;
  cursor: default;
}

.auth-error {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--berry-text);
}
.auth-error:not(:empty)::before {
  content: '!';
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--berry);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.auth-card.error input { border-color: var(--berry); box-shadow: var(--sh-carved), 0 0 0 1px var(--berry); }

.auth-divider {
  margin: 18px 0 14px;
  border: none;
  border-top: 1px solid var(--hair);
}

.auth-card footer {
  font-size: 12.5px;
  color: var(--mist);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
