/* ============================================================
   Sketch Plan · 设计系统
   一套结构，三套皮肤（Ink Paper / Pebble / Aurora）+ 移动端
   所有组件只消费 token，不写死颜色
   ============================================================ */

/* ---------------- 基础 ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background .3s ease, color .3s ease;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ============================================================
   主题 · Ink Paper（纸墨手账）
   ============================================================ */
:root,
[data-theme="ink"] {
  --bg: #FBF7EE;
  --surface: #FDFBF5;
  --surface-2: #F5EFE2;
  --surface-3: #EDE5D4;
  --line: rgba(33, 30, 25, .18);
  --line-2: rgba(33, 30, 25, .09);
  --text: #211E19;
  --text-2: #5C5548;
  --text-3: #948B7A;
  --accent: #D9503A;
  --accent-2: #D9503A;
  --on-accent: #FDFBF5;

  --c-study: #37547F;
  --c-work: #8A5A72;
  --c-life: #C0902F;
  --c-health: #5C7C4C;

  --r-1: 8px 5px 9px 4px / 5px 9px 4px 8px;
  --r-2: 14px 8px 16px 6px / 8px 16px 6px 14px;
  --r-3: 20px 12px 22px 9px / 12px 22px 9px 20px;
  --r-pill: 99px;

  --sh-1: 2px 3px 0 rgba(33, 30, 25, .07);
  --sh-2: 4px 6px 0 rgba(33, 30, 25, .10);
  --sh-3: 8px 10px 0 rgba(33, 30, 25, .10);

  --font-display: "Fraunces", "Songti SC", "Source Han Serif SC", Georgia, "SimSun", serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "Inter", ui-monospace, "SF Mono", Menlo, sans-serif;
  --font-hand: "LXGW WenKai", "Kaiti SC", "KaiTi", "楷体", cursive;

  --rail-bg: #F5EFE2;
  --card-bg: #FDFBF5;
  --card-line: rgba(33, 30, 25, .85);
  --card-border-w: 1.5px;
  --topbar-bg: rgba(251, 247, 238, .86);
  --blur: 8px;
  --grain: 1;
  --dotgrid: 1;
  --title-size: 23px;
  --radius-btn: var(--r-2);
  --track-h: 44px;
}

/* ============================================================
   主题 · Pebble（柔彩极简）
   ============================================================ */
[data-theme="pebble"] {
  --bg: #FBFBFD;
  --surface: #FFFFFF;
  --surface-2: #F6F6FA;
  --surface-3: #EFEFF6;
  --line: #E9E9F0;
  --line-2: #F1F1F6;
  --text: #15151B;
  --text-2: #5A5A68;
  --text-3: #8B8B99;
  --accent: #5B6CFF;
  --accent-2: #8B7CFF;
  --on-accent: #FFFFFF;

  --c-study: #6C7DF0;
  --c-work: #E8789B;
  --c-life: #DD9A45;
  --c-health: #45B98A;

  --r-1: 12px;
  --r-2: 18px;
  --r-3: 26px;
  --r-pill: 99px;

  --sh-1: 0 1px 2px rgba(21, 21, 27, .04), 0 8px 20px -16px rgba(21, 21, 27, .35);
  --sh-2: 0 2px 6px rgba(21, 21, 27, .05), 0 18px 40px -28px rgba(21, 21, 27, .45);
  --sh-3: 0 30px 70px -40px rgba(21, 21, 27, .5);

  --font-display: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-hand: "Inter", "PingFang SC", sans-serif;

  --rail-bg: #FBFBFD;
  --card-bg: #FFFFFF;
  --card-line: #EFEFF4;
  --card-border-w: 1px;
  --topbar-bg: rgba(251, 251, 253, .82);
  --blur: 14px;
  --grain: 0;
  --dotgrid: 0;
  --title-size: 24px;
  --radius-btn: 99px;
  --track-h: 46px;
}

/* ============================================================
   主题 · Aurora（夜航）
   ============================================================ */
[data-theme="aurora"] {
  --bg: #0A0B0F;
  --surface: #12141B;
  --surface-2: #171A23;
  --surface-3: #1E222D;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .05);
  --text: #ECEEF6;
  --text-2: #9CA3B7;
  --text-3: #6A7186;
  --accent: #8B5CF6;
  --accent-2: #22D3EE;
  --on-accent: #0A0B0F;

  --c-study: #8B6CFF;
  --c-work: #FF6FA5;
  --c-life: #FFC15E;
  --c-health: #4ADE80;

  --r-1: 8px;
  --r-2: 12px;
  --r-3: 18px;
  --r-pill: 99px;

  --sh-1: 0 0 0 1px rgba(255, 255, 255, .04);
  --sh-2: 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 40px -24px #000;
  --sh-3: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px -30px #000;

  --font-display: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --font-hand: "Inter", "PingFang SC", sans-serif;

  --rail-bg: #0D0E13;
  --card-bg: linear-gradient(165deg, #171A23, #12141B);
  --card-line: rgba(255, 255, 255, .09);
  --card-border-w: 1px;
  --topbar-bg: rgba(10, 11, 15, .78);
  --blur: 16px;
  --grain: 0;
  --dotgrid: 0;
  --title-size: 22px;
  --radius-btn: 10px;
  --track-h: 40px;
}

/* 纸纹与点阵（仅 Ink 主题） */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: calc(var(--grain) * .04);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.6'/></svg>");
}

/* ============================================================
   外壳
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 316px;
  height: 100vh;
}

/* -------- 左栏 -------- */
.rail {
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  padding: 18px 0 12px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 20px 18px; user-select: none; }
.brand .mark {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-1); background: var(--accent); color: var(--on-accent);
}
.brand .mark svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand b { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; display: block; line-height: 1.2; }
.brand em { font-style: normal; font-size: 10px; color: var(--text-3); letter-spacing: .02em; }

.nav { padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--r-1); color: var(--text-2); font-size: 13px;
  transition: background .16s, color .16s, transform .16s;
  text-align: left; width: 100%;
}
.nav-item svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.on { background: var(--text); color: var(--bg); }
[data-theme="aurora"] .nav-item.on { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #0A0B0F; }
[data-theme="pebble"] .nav-item.on { background: var(--surface-3); color: var(--text); font-weight: 600; }
[data-theme="ink"] .nav-item.on { background: var(--text); color: var(--bg); }
.nav-item .k { margin-left: auto; font-size: 10px; opacity: .45; font-variant-numeric: tabular-nums; }

.rail-section { padding: 18px 20px 0; }
.rail-label {
  font-size: 10px; letter-spacing: .12em; color: var(--text-3);
  text-transform: uppercase; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.rail-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-cal .dow { font-size: 9.5px; color: var(--text-3); text-align: center; padding-bottom: 3px; }
.mini-cal .day {
  font-size: 10.5px; text-align: center; padding: 4px 0; border-radius: var(--r-pill);
  color: var(--text-2); font-variant-numeric: tabular-nums; transition: background .15s;
}
.mini-cal .day:hover { background: var(--surface-3); }
.mini-cal .day.out { opacity: .3; }
.mini-cal .day.today { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.mini-cal .day.has { position: relative; }
.mini-cal .day.has::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%; background: var(--text-3);
}
.mini-cal .day.today.has::after { background: var(--on-accent); }

.cat-list { display: flex; flex-direction: column; gap: 1px; }
.cat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 4px 0; }
.cat-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: none; }
.cat-row .n { margin-left: auto; font-size: 10.5px; color: var(--text-3); }

.rail-foot { margin-top: auto; padding: 12px 20px 0; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line);
}
[data-theme="ink"] .avatar { font-family: var(--font-display); border-color: var(--text); }
.rail-foot .who { font-size: 12px; line-height: 1.3; min-width: 0; }
.rail-foot .who em { display: block; font-style: normal; font-size: 10px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }

/* -------- 主区 -------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
[data-theme="ink"] .main {
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 24px 24px;
}
[data-theme="aurora"] .main {
  background:
    radial-gradient(900px 420px at 78% -12%, rgba(139, 92, 246, .16), transparent 70%),
    radial-gradient(700px 400px at 8% 108%, rgba(34, 211, 238, .10), transparent 70%);
}

.topbar {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 22px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(var(--blur));
  position: relative; z-index: 20;
}
.page-title {
  font-family: var(--font-display); font-size: var(--title-size); font-weight: 600;
  letter-spacing: -.02em; display: flex; align-items: baseline; gap: 8px; white-space: nowrap;
}
.page-title small { font-family: var(--font-body); font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.grow { flex: 1; }

[data-theme="ink"] .page-title { font-weight: 600; }
[data-theme="pebble"] .page-title { font-weight: 700; letter-spacing: -.03em; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  border-radius: var(--radius-btn);
  border: var(--card-border-w) solid var(--card-line);
  background: var(--surface); color: var(--text);
  box-shadow: var(--sh-1);
  transition: transform .16s cubic-bezier(.22, .9, .24, 1), box-shadow .16s, background .16s, border-color .16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(1px); box-shadow: var(--sh-1); }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary {
  background: var(--text); color: var(--bg); border-color: var(--text);
  box-shadow: var(--sh-2);
}
[data-theme="pebble"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px -10px rgba(91, 108, 255, .8); }
[data-theme="aurora"] .btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; color: #0A0B0F; }
[data-theme="aurora"] .btn { background: var(--surface-2); box-shadow: none; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 4px 10px; font-size: 11.5px; }
.btn.icon { padding: 7px 9px; }

/* 分段控件 */
.seg {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.seg button {
  padding: 4px 12px; font-size: 12px; color: var(--text-2); border-radius: var(--r-pill);
  transition: background .18s, color .18s;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); font-weight: 600; }
[data-theme="ink"] .seg { border-radius: var(--r-2); border-color: var(--line); background: transparent; }
[data-theme="ink"] .seg button { border-radius: var(--r-1); }
[data-theme="ink"] .seg button.on { background: var(--text); color: var(--bg); box-shadow: none; }
[data-theme="aurora"] .seg { background: var(--surface-2); }
[data-theme="aurora"] .seg button.on { background: rgba(255, 255, 255, .10); box-shadow: none; color: #fff; }

/* 搜索 */
.search { position: relative; }
.search input {
  width: 172px; padding: 6px 10px 6px 28px; font-size: 12.5px;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  outline: none; transition: width .22s, border-color .18s, background .18s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { width: 230px; border-color: var(--accent); background: var(--surface); }
.search svg { position: absolute; left: 9px; top: 8px; width: 13px; height: 13px; stroke: var(--text-3); fill: none; stroke-width: 1.8; }
[data-theme="ink"] .search input { border-radius: var(--r-1); border-width: 1.5px; background: transparent; }

.results {
  position: absolute; top: 36px; left: 0; width: 320px; padding: 6px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: var(--sh-3); display: none; max-height: 320px; overflow: auto;
}
.results.show { display: block; animation: pop .18s cubic-bezier(.22, .9, .24, 1) both; }
.res-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--r-1); font-size: 12.5px; }
.res-item:hover { background: var(--surface-2); }
.res-item em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--text-3); }

/* 内容区 */
.content { flex: 1; min-height: 0; overflow: auto; padding: 16px 22px 24px; }
.view { display: none; animation: fadeUp .3s cubic-bezier(.22, .9, .24, 1) both; }
.view.on { display: block; }

/* -------- 右栏 -------- */
.insp {
  border-left: 1px solid var(--line); background: var(--rail-bg);
  display: flex; flex-direction: column; min-height: 0;
}
.insp-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line-2); }
.insp-date { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 7px; }
.insp-date em { font-style: normal; font-size: 11.5px; color: var(--text-3); font-family: var(--font-body); font-weight: 500; }
.insp-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.insp-body { flex: 1; overflow: auto; padding: 14px 20px 24px; }

.block { margin-bottom: 20px; }
.block h4 {
  font-size: 10.5px; letter-spacing: .1em; color: var(--text-3); font-weight: 500;
  margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.block h4::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* 日程条目 */
.ev-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.ev-row:last-child { border-bottom: none; }
.ev-row .bar-c { width: 3px; align-self: stretch; border-radius: 3px; background: var(--c); flex: none; margin: 2px 0; }
.check {
  width: 19px; height: 19px; flex: none; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--line); display: grid; place-items: center; transition: .18s;
}
.check svg { width: 11px; height: 11px; stroke: transparent; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke .18s; }
.check.on { background: var(--text); border-color: var(--text); }
.check.on svg { stroke: var(--bg); }
[data-theme="pebble"] .check { border-color: #D8D8E2; }
[data-theme="pebble"] .check.on { background: var(--c); border-color: var(--c); }
[data-theme="pebble"] .check.on svg { stroke: #fff; }
[data-theme="aurora"] .check.on { background: var(--c); border-color: var(--c); }
[data-theme="aurora"] .check.on svg { stroke: #0A0B0F; }
.ev-main { min-width: 0; flex: 1; }
.ev-t { font-size: 13px; line-height: 1.4; position: relative; display: inline; }
.ev-m { font-size: 11px; color: var(--text-3); display: flex; gap: 6px; align-items: center; margin-top: 1px; font-variant-numeric: tabular-nums; }
.ev-m .c { color: var(--c); }
.ev-row.done .ev-t { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
[data-theme="ink"] .ev-row.done .ev-t { text-decoration-thickness: 1.5px; }

.rem-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); padding: 5px 0; }
.rem-row time { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; width: 38px; }
.rem-row .bell { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.rem-row small { margin-left: auto; font-size: 10px; color: var(--text-3); }

.empty { font-size: 12.5px; color: var(--text-3); padding: 14px 0; line-height: 1.6; }
[data-theme="ink"] .empty { font-family: var(--font-hand); }

/* ============================================================
   月历
   ============================================================ */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.cal-head span { font-size: 10px; letter-spacing: .1em; color: var(--text-3); padding-left: 2px; }
.month {
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, minmax(92px, 1fr));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  border-radius: var(--r-2); overflow: hidden; background: var(--surface);
  box-shadow: var(--sh-1);
}
[data-theme="pebble"] .month { border-color: var(--line-2); box-shadow: var(--sh-1); }
[data-theme="ink"] .month { border-top-width: 1.5px; border-left-width: 1px; }

.cell {
  border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  padding: 7px 7px 6px; min-width: 0; position: relative; transition: background .16s;
  cursor: pointer; overflow: hidden;
}
.cell:hover { background: var(--surface-2); }
.cell.out { opacity: .38; }
.cell.sel { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cell.sel::after {
  content: ""; position: absolute; inset: 3px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--r-1); pointer-events: none;
}
.cell.weekend { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cell.weekend:hover { background: var(--surface-2); }

.cell-head { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.cell-num {
  font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
  width: 22px; height: 22px; display: grid; place-items: center; position: relative;
}
.cell.today .cell-num { color: var(--accent); font-weight: 700; }
[data-theme="ink"] .cell.today .cell-num .ring { display: block; }
.cell-num .ring { display: none; position: absolute; inset: -4px; }
.cell-num .ring path { fill: none; stroke: var(--accent); stroke-width: 1.5; }

.chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip {
  display: flex; align-items: center; gap: 5px; padding: 2px 6px 2px 7px;
  font-size: 11px; line-height: 1.5; border-radius: 6px; position: relative;
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  color: var(--text); white-space: nowrap; overflow: hidden; min-width: 0; max-width: 100%;
  transition: transform .16s, background .16s;
}
.chip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2.5px; background: var(--c); }
.chip:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--c) 20%, var(--surface)); }
.chip .tm { color: var(--text-3); font-size: 10px; flex: none; font-variant-numeric: tabular-nums; }
.chip .tt { overflow: hidden; text-overflow: ellipsis; }
.chip.done .tt { color: var(--text-3); text-decoration: line-through; }
[data-theme="pebble"] .chip {
  border-radius: 7px; padding: 3px 7px;
  background: color-mix(in srgb, var(--c) 17%, #fff);
  color: color-mix(in srgb, var(--c) 82%, #15151B);
  font-weight: 500;
}
[data-theme="pebble"] .chip .tm { color: color-mix(in srgb, var(--c) 55%, #6B6B79); }
[data-theme="aurora"] .chip {
  background: color-mix(in srgb, var(--c) 26%, #12141B);
  border: 1px solid color-mix(in srgb, var(--c) 42%, transparent);
  border-radius: 6px;
}
[data-theme="aurora"] .chip .tm { color: color-mix(in srgb, var(--c) 70%, #fff); }

.more { font-size: 10.5px; color: var(--text-3); padding-left: 7px; }
.more:hover { color: var(--accent); }

/* ============================================================
   周视图（时间网格）
   ============================================================ */
.week-wrap { border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; }
.week-head { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.week-head .wh { padding: 9px 8px; text-align: center; border-left: 1px solid var(--line-2); }
.week-head .wh b { display: block; font-size: 15px; font-family: var(--font-display); font-weight: 600; }
.week-head .wh span { font-size: 10px; color: var(--text-3); }
.week-head .wh.today b { color: var(--accent); }
.week-head .wh.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.week-body { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; height: 640px; overflow: auto; }
.hour-col { border-right: 1px solid var(--line-2); }
.hour-lbl { height: 46px; font-size: 9.5px; color: var(--text-3); text-align: right; padding-right: 6px; transform: translateY(-6px); font-variant-numeric: tabular-nums; }
.day-col { border-left: 1px solid var(--line-2); position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0 45px, var(--line-2) 45px 46px); }
.day-col.today { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.ev-block {
  position: absolute; left: 3px; right: 3px; padding: 4px 6px; overflow: hidden;
  border-radius: 6px; font-size: 10.5px; line-height: 1.35; cursor: pointer;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  border-left: 3px solid var(--c);
  transition: transform .16s, box-shadow .16s;
}
.ev-block:hover { transform: translateY(-1px); box-shadow: var(--sh-2); z-index: 3; }
.ev-block b { display: block; font-weight: 600; font-size: 11px; }
.ev-block span { color: var(--text-2); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.ev-block.done { opacity: .55; }
[data-theme="pebble"] .ev-block {
  border-left-width: 0; border-radius: 10px; padding: 5px 8px;
  background: color-mix(in srgb, var(--c) 16%, #fff);
  color: color-mix(in srgb, var(--c) 80%, #15151B);
}
[data-theme="pebble"] .ev-block span { color: color-mix(in srgb, var(--c) 55%, #6B6B79); }
[data-theme="aurora"] .ev-block {
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 34%, #12141B), color-mix(in srgb, var(--c) 12%, #12141B));
  border-left: 0; border: 1px solid color-mix(in srgb, var(--c) 42%, transparent);
}
[data-theme="aurora"] .ev-block b { color: #fff; }
[data-theme="aurora"] .ev-block span { color: color-mix(in srgb, var(--c) 40%, #C9CEDC); }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid var(--accent); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -3px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ============================================================
   时间轴
   ============================================================ */
.tl-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tl-tools .hint { font-size: 11px; color: var(--text-3); }
[data-theme="ink"] .tl-tools .hint { font-family: var(--font-hand); font-size: 11.5px; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
.tl-inner { min-width: 1080px; }
.tl-head { display: grid; grid-template-columns: 168px 1fr; border-bottom: 1px solid var(--line); }
.tl-axis { position: relative; height: 42px; }
.tl-month { position: absolute; top: 2px; font-size: 10.5px; color: var(--text-3); padding-left: 5px; letter-spacing: .06em; }
.tl-tick { position: absolute; bottom: 4px; font-size: 9.5px; color: var(--text-3); transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.tl-rows { position: relative; }
.tl-row { display: grid; grid-template-columns: 168px 1fr; align-items: center; height: var(--track-h); border-bottom: 1px solid var(--line-2); }
.tl-label { font-size: 12px; padding-right: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tl-label .cat-dot { width: 6px; height: 6px; }
.tl-label i { font-style: normal; font-size: 9.5px; color: var(--text-3); margin-left: auto; }
.tl-track { position: relative; height: 100%; }
.tl-bar {
  position: absolute; top: 9px; height: calc(var(--track-h) - 20px); min-height: 18px;
  display: flex; align-items: center; padding: 0 8px; gap: 6px;
  border-radius: var(--r-1); font-size: 10.5px; white-space: nowrap; overflow: hidden;
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  color: var(--text); transition: transform .16s, box-shadow .16s;
}
.tl-bar:hover { transform: translateY(-1px); box-shadow: var(--sh-2); z-index: 3; }
.tl-bar b { font-weight: 600; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.tl-bar .pct { margin-left: auto; font-size: 9.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--c) 26%, transparent); pointer-events: none; }
[data-theme="pebble"] .tl-bar { border: none; border-radius: 9px; background: color-mix(in srgb, var(--c) 15%, #fff); color: color-mix(in srgb, var(--c) 80%, #15151B); }
[data-theme="pebble"] .tl-bar .fill { background: color-mix(in srgb, var(--c) 18%, transparent); }
[data-theme="aurora"] .tl-bar { border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: linear-gradient(150deg, color-mix(in srgb, var(--c) 28%, #12141B), color-mix(in srgb, var(--c) 8%, #12141B)); }
[data-theme="aurora"] .tl-bar b { color: #fff; }
.tl-ddl { position: absolute; top: 50%; width: 9px; height: 9px; transform: translate(-50%, -50%) rotate(45deg); background: var(--surface); border: 1.5px solid var(--text); }
.tl-ddl-lbl { position: absolute; top: 2px; transform: translateX(-50%); font-size: 9px; color: var(--accent); background: var(--bg); padding: 0 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--accent); }
.tl-today span { position: absolute; bottom: 2px; left: 3px; font-size: 9px; color: var(--accent); background: var(--bg); padding: 0 2px; white-space: nowrap; }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--line-2); }
.legend { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 10.5px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-bar { width: 20px; height: 9px; border-radius: 3px; border: 1px solid color-mix(in srgb, var(--c-study) 45%, transparent); background: color-mix(in srgb, var(--c-study) 18%, transparent); }
.lg-ddl { width: 7px; height: 7px; border: 1.4px solid var(--text); transform: rotate(45deg); }
.lg-today { height: 12px; border-left: 1.5px dashed var(--accent); }

/* ============================================================
   进度
   ============================================================ */
.pg-head { display: flex; align-items: flex-end; gap: 26px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.pg-stat b { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pg-stat span { font-size: 10.5px; color: var(--text-3); display: block; }
.pg-note { margin-left: auto; font-size: 11px; color: var(--text-3); text-align: right; line-height: 1.6; }
[data-theme="ink"] .pg-note { font-family: var(--font-hand); font-size: 12px; }

.pg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; }
.pg-card {
  background: var(--card-bg); border: var(--card-border-w) solid var(--card-line);
  border-radius: var(--r-2); padding: 16px 18px; box-shadow: var(--sh-1);
  transition: transform .2s, box-shadow .2s;
}
.pg-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
[data-theme="aurora"] .pg-card { border-color: rgba(255, 255, 255, .07); }
.pg-top { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.pg-title { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.pg-sub { margin-left: auto; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pg-meta { font-size: 11.5px; color: var(--text-2); margin: 2px 0 12px; }
.pg-meta b { color: var(--text); font-weight: 600; }

.bar { height: 14px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; position: relative; }
.bar-fill { height: 100%; width: 0; border-radius: var(--r-pill); background: var(--c); transition: width .62s cubic-bezier(.22, .9, .24, 1); position: relative; }
.bar-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255, 255, 255, .12), transparent); }
[data-theme="ink"] .bar { border: 1.5px solid var(--text); padding: 2px; background: transparent; border-radius: 8px 5px 9px 4px / 5px 9px 4px 8px; }
[data-theme="ink"] .bar-fill { background: var(--text); border-radius: 5px 3px 6px 2px; }
[data-theme="ink"] .bar-fill::after { display: none; }
[data-theme="aurora"] .bar { background: rgba(255, 255, 255, .06); }
[data-theme="aurora"] .bar-fill { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); box-shadow: 0 0 18px -4px var(--c); }

.bar-num { display: flex; align-items: baseline; justify-content: space-between; margin-top: 8px; font-variant-numeric: tabular-nums; }
.bar-num b { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.bar-num span { font-size: 10.5px; color: var(--text-3); }
.pg-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.pg-pace { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.pg-pace b { font-weight: 600; }
.pg-pace.risk b { color: var(--accent); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 22px; margin-left: auto; }
.spark i { width: 5px; background: var(--c); opacity: .42; border-radius: 1px; display: block; }
.spark i.hi { opacity: .85; }
.badge { font-size: 10px; padding: 1px 7px; border-radius: var(--r-pill); border: 1px solid currentColor; line-height: 1.6; }
.badge.ok { color: var(--c-health); }
.badge.risk { color: var(--c-life); }
.badge.bad { color: var(--accent); }

/* ============================================================
   弹层 / 提示
   ============================================================ */
.modal-root { position: fixed; inset: 0; z-index: 80; display: none; }
.modal-root.on { display: grid; place-items: center; }
.scrim { position: absolute; inset: 0; background: rgba(12, 12, 16, .34); backdrop-filter: blur(3px); animation: fade .2s both; }
[data-theme="aurora"] .scrim { background: rgba(0, 0, 0, .62); }
.sheet {
  position: relative; width: min(520px, 92vw); max-height: 88vh; overflow: auto;
  background: var(--surface); border: var(--card-border-w) solid var(--card-line);
  border-radius: var(--r-3); box-shadow: var(--sh-3);
  padding: 22px 24px 18px; animation: sheetIn .26s cubic-bezier(.34, 1.05, .64, 1) both;
}
.sheet h3 { font-family: var(--font-display); font-size: 18px; margin-bottom: 2px; }
.sheet .sub { font-size: 11.5px; color: var(--text-3); margin-bottom: 16px; }
[data-theme="ink"] .sheet .sub { font-family: var(--font-hand); font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 13px; }
.field label { font-size: 10px; letter-spacing: .1em; color: var(--text-3); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface-2); padding: 7px 10px; font-size: 13px; outline: none;
  transition: border-color .16s, background .16s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); background: var(--surface); }
[data-theme="ink"] .field input, [data-theme="ink"] .field select {
  border: none; border-bottom: 1.5px solid var(--text); border-radius: 0; background: transparent; padding: 6px 2px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; }

.pick { display: flex; gap: 6px; flex-wrap: wrap; }
.pick button {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; font-size: 11.5px;
  border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--text-2); transition: .16s;
}
.pick button i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pick button:hover { border-color: var(--text-3); }
.pick button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); font-weight: 500; }
.dows { display: flex; gap: 5px; }
.dows button { flex: 1; padding: 6px 0; font-size: 11.5px; border-radius: var(--r-1); border: 1px solid var(--line); color: var(--text-2); }
.dows button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
[data-theme="pebble"] .dows button.on, [data-theme="aurora"] .dows button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.sheet-foot { display: flex; align-items: center; gap: 9px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.sheet-foot .preview { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.sheet-foot .preview b { color: var(--accent); font-weight: 600; }

.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; max-width: 320px; padding: 10px 14px;
  background: var(--surface); border: var(--card-border-w) solid var(--card-line);
  border-radius: var(--r-2); box-shadow: var(--sh-3); font-size: 12.5px;
  animation: toastIn .36s cubic-bezier(.34, 1.1, .64, 1) both;
}
.toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.toast b { display: block; font-weight: 600; }
.toast small { display: block; color: var(--text-3); font-size: 11px; margin-top: 1px; }
.toast.out { animation: toastOut .3s cubic-bezier(.6, .02, .2, 1) both; }
[data-theme="ink"] .toast { background: #FBF0D2; border-color: #2A2620; }
[data-theme="aurora"] .toast { background: #1B1E28; border-color: rgba(255, 255, 255, .12); }

/* 主题选择卡（设置页 / 我的） */
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card {
  border: 1.5px solid var(--line); border-radius: var(--r-2); padding: 10px; text-align: left; color: var(--text); display: block;
  background: var(--surface); transition: .18s; position: relative; overflow: hidden;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-card .swatch { height: 44px; border-radius: var(--r-1); margin-bottom: 8px; display: flex; overflow: hidden; width: 100%; }
.theme-card .swatch i { flex: 1; }
.theme-card b { font-size: 12px; display: block; }
.theme-card span { font-size: 10px; color: var(--text-3); }
.theme-card .tick { position: absolute; right: 8px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: none; place-items: center; font-size: 9px; }

/* ============================================================
   移动端
   ============================================================ */
.tabbar { display: none; }
.mobile-only { display: none !important; }
.only-desktop { display: block; }

@media (max-width: 1240px) {
  .app { grid-template-columns: 212px minmax(0, 1fr); }
  .insp { display: none; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .rail { padding-left: 0; padding-right: 0; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand .txt, .nav-item .lbl, .nav-item .k, .rail-section, .rail-foot .who { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .rail-foot { justify-content: center; }
}

/* 原 @media (max-width: 768px) 规则，改为跟随 body.mobile，便于手动切换界面形态 */
body.mobile .app { grid-template-columns: minmax(0, 1fr); height: 100dvh; }
body.mobile .rail,
body.mobile .insp { display: none; }
body.mobile .topbar { padding: 10px 14px; gap: 8px; }
body.mobile .page-title { font-size: 19px; }
body.mobile .page-title small { font-size: 10.5px; }
body.mobile .search input { width: 120px; }
body.mobile .search input:focus { width: 150px; }
body.mobile .content { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); }
body.mobile .hide-m { display: none !important; }
.mobile-only { display: block !important; }
body.mobile .only-desktop { display: none !important; }
body.mobile .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--topbar-bg); backdrop-filter: blur(var(--blur));
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
body.mobile .tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 9px; font-size: 9.5px; color: var(--text-3);
  }
body.mobile .tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.mobile .tab.on { color: var(--accent); }
body.mobile [data-theme="ink"] .tab.on { color: var(--text); }
body.mobile .tab.on svg { stroke-width: 2.1; }
body.mobile .month { grid-template-rows: repeat(6, minmax(62px, 1fr)); border-radius: var(--r-1); }
body.mobile .cell { padding: 4px 4px 3px; }
body.mobile .chip { font-size: 9.5px; padding: 1px 4px 1px 5px; }
body.mobile .chip .tm { display: none; }
body.mobile .chips .chip:nth-child(n+3) { display: none; }
body.mobile .week-head { grid-template-columns: 32px repeat(7, 1fr); }
body.mobile .week-body { grid-template-columns: 32px repeat(7, 1fr); height: 520px; }
body.mobile .pg-grid { grid-template-columns: 1fr; }
body.mobile .pg-head { gap: 18px; overflow-x: auto; }
body.mobile .theme-cards { grid-template-columns: 1fr; }
body.mobile .toasts { right: 12px; left: 12px; bottom: 78px; align-items: stretch; }
body.mobile .toast { max-width: none; }
body.mobile .sheet { width: 100vw; max-height: 92dvh; border-radius: 20px 20px 0 0; position: fixed; bottom: 0; }
body.mobile .modal-root.on { place-items: end center; }



/* 移动端日议程（时间轨道） */
.m-head { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.m-date { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.m-date em { font-style: normal; font-size: 11px; color: var(--text-3); font-family: var(--font-body); font-weight: 500; margin-left: 6px; }
.m-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.daystrip button { padding: 6px 0 7px; border-radius: var(--r-1); display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid transparent; }
.daystrip .w { font-size: 9.5px; color: var(--text-3); }
.daystrip .n { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.daystrip button.on { background: var(--text); color: var(--bg); }
[data-theme="pebble"] .daystrip button.on { background: var(--accent); color: #fff; }
[data-theme="aurora"] .daystrip button.on { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #0A0B0F; }
.daystrip button.on .w { color: inherit; opacity: .7; }
.daystrip button.today .n { color: var(--accent); }
.daystrip button.on.today .n { color: inherit; }
.daystrip button .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

.rail-list { position: relative; padding-left: 52px; }
.rail-list::before { content: ""; position: absolute; left: 44px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.rail-item { position: relative; padding: 0 0 16px 12px; }
.rail-item .time { position: absolute; left: -52px; top: 1px; width: 38px; text-align: right; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rail-item .node {
  position: absolute; left: -10px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--c);
}
.rail-item .card {
  background: color-mix(in srgb, var(--c) 12%, var(--surface));
  border-radius: var(--r-2); padding: 10px 12px; border-left: 3px solid var(--c);
  transition: transform .16s;
}
.rail-item .card:active { transform: scale(.985); }
.rail-item h5 { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; }
.rail-item .meta { font-size: 10.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.rail-item.done .card { opacity: .55; }
.rail-item.done h5 { text-decoration: line-through; }
[data-theme="pebble"] .rail-item .card { border-left-width: 0; padding: 11px 13px; border-radius: 16px; }
[data-theme="aurora"] .rail-item .card { border-left: 0; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: linear-gradient(150deg, color-mix(in srgb, var(--c) 20%, #12141B), rgba(18, 20, 27, .6)); }

.fab {
  position: fixed; right: 18px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 55;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--text); color: var(--bg); box-shadow: var(--sh-3);
  transition: transform .2s cubic-bezier(.34, 1.2, .64, 1);
}
.fab:active { transform: scale(.94); }
.fab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
[data-theme="pebble"] .fab { background: var(--accent); color: #fff; box-shadow: 0 14px 30px -10px rgba(91, 108, 255, .75); }
[data-theme="aurora"] .fab { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #0A0B0F; box-shadow: 0 0 30px -6px var(--accent); }

/* ============================================================
   动效
   ============================================================ */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
@keyframes barIn { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .001s !important; }
}

/* ---------------- 视图模式（由 JS 根据视口切换） ---------------- */
.m-view { display: none !important; }
body:not(.mobile) .m-view { display: none !important; }
body.mobile .d-view { display: none !important; }
body.mobile .m-view.on { display: block !important; }
body.mobile .tabbar { display: grid; }
body.mobile .fab { display: grid; }
body:not(.mobile) .tabbar, body:not(.mobile) .fab { display: none; }

/* ---------------- 近 30 天完成热力条 ---------------- */
.heat-wrap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.heat-h { font-size: 10.5px; letter-spacing: .08em; color: var(--text-3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.heat-h b { color: var(--text); font-weight: 600; letter-spacing: 0; }
.heat-grid { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; }
.heat {
  height: 30px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line-2);
  position: relative; transition: transform .16s, background .16s;
  border: 1px solid transparent;
}
.heat:hover { transform: translateY(-2px); }
.heat[data-l="1"] { background: color-mix(in srgb, var(--accent) 24%, var(--surface-2)); }
.heat[data-l="2"] { background: color-mix(in srgb, var(--accent) 46%, var(--surface-2)); }
.heat[data-l="3"] { background: color-mix(in srgb, var(--accent) 68%, var(--surface-2)); }
.heat[data-l="4"] { background: color-mix(in srgb, var(--accent) 88%, var(--surface-2)); }
.heat.today { border-color: var(--accent); }
.heat-legend { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.heat-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; background: var(--surface-2); }

/* 手机端月历：用色点代替文字，避免挤压 */
/* 原 @media (max-width: 768px) 规则，改为跟随 body.mobile，便于手动切换界面形态 */
body.mobile .chips { flex-direction: row; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
body.mobile .chip {
    width: 6px; height: 6px; padding: 0; border-radius: 50%;
    background: var(--c); overflow: visible; display: block; flex: none;
  }
body.mobile .chip::before { display: none; }
body.mobile .chip .tm,
body.mobile .chip .tt,
body.mobile .chips .more { display: none; }
body.mobile [data-theme="pebble"] .chip { background: var(--c); }
body.mobile [data-theme="aurora"] .chip { background: var(--c); border: none; }
body.mobile .chips .chip:nth-child(n+3) { display: block; }
body.mobile .chips .chip:nth-child(n+5) { display: none; }



/* ============================================================
   详情抽屉
   ============================================================ */
.detail-root { position: fixed; inset: 0; z-index: 78; pointer-events: none; visibility: hidden; }
.detail-root.on { pointer-events: auto; visibility: visible; }
.detail-scrim { position: absolute; inset: 0; background: transparent; transition: background .24s; }
.detail-root.on .detail-scrim { background: rgba(12, 12, 16, .16); }
.detail {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(432px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -24px 0 70px -50px rgba(0, 0, 0, .9);
  transform: translateX(24px);
  transition: transform .28s cubic-bezier(.22, .9, .24, 1);
  display: flex; flex-direction: column; overflow: auto;
}
.detail-root.on .detail { transform: none; }

.d-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.d-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.d-top .cat-dot { width: 7px; height: 7px; }
.d-top .cat-n { font-size: 10.5px; color: var(--text-3); letter-spacing: .06em; }
.d-top .close { margin-left: auto; color: var(--text-3); padding: 4px; border-radius: 6px; }
.d-top .close:hover { background: var(--surface-2); color: var(--text); }
.d-top .close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.d-title {
  width: 100%; border: none; background: transparent; padding: 2px 0;
  font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.01em;
  border-bottom: 1px solid transparent; outline: none; color: var(--text);
}
.d-title:focus { border-bottom-color: var(--accent); }
.d-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; font-variant-numeric: tabular-nums; }

.d-body { padding: 16px 20px 20px; flex: 1; }
.d-sec { margin-bottom: 20px; }
.d-sec h5 { font-size: 10px; letter-spacing: .12em; color: var(--text-3); margin: 0 0 9px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.d-sec h5::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-field { display: flex; flex-direction: column; gap: 3px; }
.d-field label { font-size: 9.5px; letter-spacing: .1em; color: var(--text-3); }
.d-field input, .d-field select {
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2);
  padding: 6px 8px; font-size: 12.5px; outline: none; width: 100%;
}
.d-field input:focus, .d-field select:focus { border-color: var(--accent); }

.d-sub-list { display: flex; flex-direction: column; }
.d-subitem { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.d-subitem .txt { flex: 1; min-width: 0; }
.d-subitem.done .txt { color: var(--text-3); text-decoration: line-through; }
.d-subitem .x { color: var(--text-3); opacity: 0; transition: opacity .16s; font-size: 14px; padding: 0 2px; }
.d-subitem:hover .x { opacity: 1; }
.d-add { display: flex; gap: 6px; margin-top: 8px; }
.d-add input { flex: 1; border: none; border-bottom: 1px solid var(--line); background: transparent; padding: 5px 2px; font-size: 12.5px; outline: none; }
.d-add input:focus { border-bottom-color: var(--accent); }
.d-note {
  width: 100%; min-height: 88px; border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface-2); padding: 9px 10px; font-size: 12.5px; line-height: 1.7;
  resize: vertical; outline: none; font-family: inherit; color: var(--text);
}
.d-note:focus { border-color: var(--accent); }
.d-foot {
  display: flex; align-items: center; gap: 8px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: var(--surface);
}
.d-del { margin-left: auto; color: var(--accent); }

/* ============================================================
   偏好设置
   ============================================================ */
.set-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: none; }
.set-row .lbl { font-size: 12.5px; }
.set-row .lbl small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.set-row .ctl { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.set-row input[type="time"], .set-row select {
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2);
  padding: 5px 8px; font-size: 12px; outline: none;
}
.switch { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none; border: 1px solid var(--line); transition: background .18s, border-color .18s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .22); transition: transform .18s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(16px); }

/* ============================================================
   拖拽
   ============================================================ */
.chip { cursor: grab; }
.chip.is-drag { opacity: .4; }
.cell.drop { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cell.drop::before {
  content: ""; position: absolute; inset: 4px; border: 1.5px dashed var(--accent);
  border-radius: var(--r-1); pointer-events: none; z-index: 3;
}
.ev-block { cursor: grab; touch-action: none; }
.ev-block.dragging { z-index: 9; cursor: grabbing; box-shadow: var(--sh-3); }
.ev-block.dragging::after {
  content: attr(data-hint); position: absolute; right: 4px; top: -16px;
  font-size: 9px; background: var(--accent); color: var(--on-accent);
  padding: 0 4px; border-radius: 3px; white-space: nowrap;
}

/* 原 @media (max-width: 768px) 规则，改为跟随 body.mobile，便于手动切换界面形态 */
body.mobile .detail {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88dvh;
    border-left: none; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
    transform: translateY(24px);
  }
body.mobile .detail-root.on .detail { transform: none; }
body.mobile .detail-root.on .detail-scrim { background: rgba(12, 12, 16, .38); }



/* ---------------- 自动完成 / 设置分组 ---------------- */
.set-group {
  font-size: 10px; letter-spacing: .12em; color: var(--text-3);
  margin: 16px 0 2px; display: flex; align-items: center; gap: 8px;
}
.set-group::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.set-group:first-child { margin-top: 0; }
.toast-act {
  margin-left: auto; align-self: center; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  border-bottom: 1px solid currentColor; padding: 0 1px; line-height: 1.5;
}
[data-theme="ink"] .toast-act { color: #8A4A32; }
[data-theme="aurora"] .toast-act { color: var(--accent); }
.tag-auto {
  font-size: 9.5px; line-height: 1.5; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 99px; padding: 0 5px;
}

/* ============================================================
   工作集
   ============================================================ */
.col-page { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 22px; align-items: start; }
.col-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.col-list-head { font-size: 10.5px; letter-spacing: .12em; color: var(--text-3); display: flex; justify-content: space-between; padding: 0 2px 2px; }
.col-card {
  position: relative; overflow: hidden; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 14px;
  background: var(--surface); transition: transform .16s, border-color .16s, box-shadow .16s;
}
.col-card:hover { transform: translateY(-1px); border-color: var(--text-3); }
.col-card.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.col-card.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.cc-top { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.cc-top b { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-top em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.cc-note { font-size: 10.5px; color: var(--text-3); margin: 3px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-bar { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cc-bar i { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width .4s; }
.cc-foot { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); margin-top: 6px; }
.cc-late { color: var(--accent); font-style: normal; }
.col-new { border: 1.5px dashed var(--line); border-radius: var(--r-2); padding: 10px; font-size: 12px; color: var(--text-3); background: transparent; transition: .16s; }
.col-new:hover { border-color: var(--accent); color: var(--accent); }
.col-total { font-size: 10px; color: var(--text-3); text-align: center; padding-top: 4px; }

.col-detail { min-width: 0; }
.col-head { display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.ch-l h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; }
.ch-l p { font-size: 12px; color: var(--text-3); margin: 3px 0 0; }
.ch-r { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.col-stats { display: flex; gap: 28px; padding: 14px 0 8px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.col-stats b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.15; }
.col-stats span { font-size: 10px; color: var(--text-3); }
.col-stats .warn b { color: var(--accent); }
.col-stats .span b { font-family: var(--font-body); font-size: 13px; font-weight: 600; padding-top: 4px; }
.col-block { margin-top: 18px; }
.col-block h4 { font-size: 10.5px; letter-spacing: .1em; color: var(--text-3); margin-bottom: 6px; font-weight: 500; }
.col-block h4.late { color: var(--accent); }
.col-ev {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px;
  border-bottom: 1px solid var(--line-2); border-radius: 6px; cursor: pointer; transition: background .14s;
}
.col-ev:hover { background: var(--surface-2); }
.col-ev.done .ce-title { text-decoration: line-through; color: var(--text-3); }
.col-ev.late { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.ce-date { width: 46px; flex: none; font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ce-date em { display: block; font-style: normal; font-size: 9px; color: var(--text-3); }
.ce-time { width: 38px; flex: none; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ce-title { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-tag { flex: none; font-size: 10px; color: var(--c); }
.ce-post { flex: none; font-size: 9.5px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 5px; }
.ce-state { flex: none; font-size: 9.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--text-3); }
.ce-state.ok { color: var(--c-health); border-color: currentColor; }
.ce-state.late { color: var(--accent); border-color: currentColor; }

/* ============================================================
   顺延
   ============================================================ */
.post-opts { display: flex; gap: 6px; }
.post-opts button {
  flex: 1; min-width: 0; padding: 7px 4px; font-size: 11px; white-space: nowrap;
  border: 1px solid var(--line); border-radius: var(--r-1); color: var(--text-2); transition: .16s;
}
.post-opts button:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.d-static { border: 1px solid var(--line); border-radius: var(--r-1); padding: 6px 8px; font-size: 12px; color: var(--text-2); background: var(--surface-2); }
.post-reasons { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.post-reasons button { font-size: 10.5px; padding: 3px 9px; border-radius: 99px; border: 1px dashed var(--line); color: var(--text-3); transition: .16s; }
.post-reasons button:hover { border-style: solid; color: var(--accent); border-color: var(--accent); }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.post-hist { font-size: 10.5px; color: var(--text-3); }

/* ============================================================
   一句话速记
   ============================================================ */
.cap-box {
  border: 1.5px solid var(--line); border-radius: var(--r-2);
  padding: 0 14px; background: var(--surface-2); margin-bottom: 10px; transition: border-color .18s;
}
.cap-box:focus-within { border-color: var(--accent); }
.cap-input { width: 100%; border: none; background: transparent; font-size: 16px; padding: 13px 0; outline: none; color: var(--text); }
.cap-input::placeholder { color: var(--text-3); font-size: 14px; }
.cap-preview {
  min-height: 46px; padding: 10px 12px; border-radius: var(--r-1);
  background: var(--surface-2); font-size: 12px; color: var(--text-2); margin-bottom: 10px;
}
.cap-preview .hint { color: var(--text-3); font-size: 11.5px; }
.cap-out { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cap-out span { border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; background: var(--surface); font-variant-numeric: tabular-nums; }
.cap-out .ttl { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; font-variant-numeric: normal; }
.cap-out i { font-style: normal; color: var(--text-3); }
.cap-warn { margin-top: 7px; font-size: 10.5px; color: var(--accent); }
.cap-examples { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 2px; }
.cap-examples button { font-size: 11px; color: var(--text-3); border: 1px dashed var(--line); border-radius: 99px; padding: 4px 10px; transition: .16s; }
.cap-examples button:hover { color: var(--text); border-style: solid; border-color: var(--text-3); }

@media (max-width: 900px) {
  .col-page { grid-template-columns: 1fr; }
  .col-list { position: static; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 6px; }
  .col-card { min-width: 176px; flex: none; }
  .col-list-head, .col-total { display: none; }
  .col-new { flex: none; white-space: nowrap; padding: 10px 14px; }
  .col-head { flex-wrap: wrap; }
  .ch-r { width: 100%; margin-left: 0; }
  .ce-tag, .ce-time { display: none; }
}

/* 顶栏防挤压 */
.topbar { flex-wrap: nowrap; }
.seg { flex: none; }
.seg button { white-space: nowrap; }
.topbar .search { flex-shrink: 1; min-width: 0; }
@media (max-width: 1600px) {
  .topbar .search input { width: 140px; }
}
@media (max-width: 1480px) {
  .topbar .search { display: none; }
  .btn .tx { display: none; }
}
.cal-head span { color: var(--text-2); font-size: 10.5px; }

/* ============================================================
   周表 · 重叠事件的层叠效果
   ============================================================ */
.week-body .ev-block { right: 3px; min-width: 0; }
.week-body .ev-block b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-body .ev-block:hover { z-index: 40 !important; }

/* 墨纸：叠纸感（硬投影逐层下移） */
[data-theme="ink"] .week-body .ev-block {
  box-shadow:
    0 calc(2px + var(--d, 0) * 1.6px) 0 rgba(33, 30, 25, .12),
    0 calc(1px + var(--d, 0) * 1px) 0 rgba(33, 30, 25, .06);
  filter: brightness(calc(1 - var(--d, 0) * .035));
}
[data-theme="ink"] .week-body .ev-block:hover {
  box-shadow: 0 calc(3px + var(--d, 0) * 2px) 0 rgba(33, 30, 25, .16);
}

/* 柔彩：软阴影逐层加深 */
[data-theme="pebble"] .week-body .ev-block {
  box-shadow:
    0 calc(2px + var(--d, 0) * 2px) calc(6px + var(--d, 0) * 5px) -4px rgba(21, 21, 27, .32),
    0 0 0 1px rgba(255, 255, 255, .7) inset;
  filter: brightness(calc(1 - var(--d, 0) * .045));
}

/* 夜航：描边 + 发光，越上层越亮 */
[data-theme="aurora"] .week-body .ev-block {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    0 calc(4px + var(--d, 0) * 3px) calc(14px + var(--d, 0) * 8px) -8px rgba(0, 0, 0, .95);
  filter: brightness(calc(1 + var(--d, 0) * .06));
}

/* 叠起来时，左缘留一道纸缝，色条更清楚 */

/* 现在线始终在最上 */
.week-body .now-line { z-index: 30; }

/* 叠放计数与悬停展开 */
.week-body .ev-block { transition: transform .16s, box-shadow .16s, left .18s cubic-bezier(.22, .9, .24, 1); }
.week-body .ev-block .ev-more {
  position: absolute; right: 4px; top: 3px; font-style: normal;
  font-size: 8.5px; line-height: 1.5; padding: 0 4px; border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text-2); border: 1px solid var(--line);
}

/* 层叠微调：轻阴影 + 逐层加深分类色 + 左侧色条更明显 */
.week-body .ev-block { border-left-width: 3px; }
[data-theme="ink"] .week-body .ev-block {
  box-shadow:
    0 calc(1px + var(--d, 0) * 1.2px) 0 rgba(33, 30, 25, .10),
    inset 0 1px 0 rgba(255, 255, 255, .55);
  filter: brightness(calc(1 - var(--d, 0) * .02));
}
[data-theme="pebble"] .week-body .ev-block {
  box-shadow:
    0 calc(2px + var(--d, 0) * 1.6px) calc(5px + var(--d, 0) * 4px) -4px rgba(21, 21, 27, .28),
    0 0 0 1px rgba(255, 255, 255, .75) inset;
  filter: none;
}
[data-theme="aurora"] .week-body .ev-block {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    0 calc(3px + var(--d, 0) * 2px) calc(12px + var(--d, 0) * 6px) -8px rgba(0, 0, 0, .95);
  filter: brightness(calc(1 + var(--d, 0) * .05));
}
[data-theme="aurora"] .week-body .ev-block::after { background: #fff; opacity: calc(var(--d, 0) * .05); }

/* 等分列宽后，取消右定位 */

/* 并排三列以上时压缩内距 */
.week-body .ev-block.dense { padding: 3px 4px; font-size: 10px; }
.week-body .ev-block.dense b { font-size: 10.5px; }

/* 周表事件：提一点色浓度，层间阴影更明显 */
[data-theme="ink"] .week-body .ev-block {
  background: color-mix(in srgb, var(--c) 20%, var(--surface));
  box-shadow:
    0 calc(2px + var(--d, 0) * 2px) 0 rgba(33, 30, 25, .12),
    inset 0 1px 0 rgba(255, 255, 255, .6);
}
[data-theme="pebble"] .week-body .ev-block {
  background: color-mix(in srgb, var(--c) 20%, #fff);
}
[data-theme="aurora"] .week-body .ev-block {
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
}

/* ============================================================
   周表 · 垂直堆叠（书堆）
   ============================================================ */
.week-body .ev-block {
  opacity: var(--o, 1);
  transform-origin: left top;
  transition: transform .26s cubic-bezier(.22, .9, .24, 1), opacity .24s ease, box-shadow .24s ease;
  will-change: transform, opacity;
}
.week-body .ev-block.stacked { box-shadow: none; filter: none; }
[data-theme="ink"] .week-body .ev-block.stacked { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
[data-theme="pebble"] .week-body .ev-block.stacked { background: color-mix(in srgb, var(--c) 15%, #fff); }
[data-theme="aurora"] .week-body .ev-block.stacked { filter: brightness(calc(1 + var(--d, 0) * .03)); }

/* 抽出一张：抬起 + 满不透明 + 压到最上 */
.week-body .ev-block:hover {
  opacity: 1 !important;
  z-index: 900 !important;
  transform: translate(10px, -10px) scale(1.02);
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .5), 0 2px 6px -2px rgba(0, 0, 0, .18);
}
[data-theme="ink"] .week-body .ev-block:hover {
  box-shadow: 4px 6px 0 rgba(33, 30, 25, .16);
}
[data-theme="pebble"] .week-body .ev-block:hover {
  box-shadow: 0 14px 30px -14px rgba(21, 21, 27, .45);
}
[data-theme="aurora"] .week-body .ev-block:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent), 0 0 26px -8px var(--c);
}

/* 堆叠卡：统一高度，露出一条边 */
.week-body .ev-block.pile { padding: 4px 7px; }
.week-body .ev-block.pile b { font-size: 10.5px; }
.week-body .ev-block.pile span { font-size: 9px; }
.week-body .ev-block.pile .ev-more {
  position: absolute; right: 5px; top: 4px; font-style: normal;
  font-size: 8.5px; padding: 0 4px; border-radius: 99px;
  background: rgba(255, 255, 255, .55); color: var(--text-2); border: 1px solid var(--line);
}

/* 堆叠卡：只露出色边，文字悬停时才出现 */
.week-body .ev-block.stacked b,
.week-body .ev-block.stacked span { opacity: 0; transition: opacity .18s ease; }
.week-body .ev-block.stacked:hover b,
.week-body .ev-block.stacked:hover span { opacity: 1; }
.week-body .ev-block.stacked { color: transparent; }
.week-body .ev-block.stacked:hover { color: var(--text); }
.week-body .ev-block.pile .ev-more { top: auto; bottom: 3px; right: 4px; }
.week-body .ev-block.pile .ev-more { top: 4px; bottom: auto; }
.week-body .ev-block.pile b { padding-right: 26px; }

/* 每本书露出的一条边：底部压一道分类色 */
.week-body .ev-block.stacked {
  border-bottom: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
}

/* ============================================================
   周表：表头与网格对齐（滚动条只出现在同一容器里）
   ============================================================ */
.week-wrap {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 250px);
}
.week-head {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--surface);
}
.week-head .wh { background: var(--surface); }
.week-body { height: auto; overflow: visible; }
.week-body .hour-col, .week-body .day-col { min-height: 782px; }

/* 原 @media (max-width: 768px) 规则，改为跟随 body.mobile，便于手动切换界面形态 */
body.mobile .week-wrap { max-height: calc(100dvh - 220px); }
body.mobile .week-body .hour-col,
body.mobile .week-body .day-col { min-height: 560px; }



/* ============================================================
   我的（桌面 + 移动共用）
   ============================================================ */
.me-page { max-width: 1080px; margin: 0 auto; }
.me-head { display: flex; align-items: center; gap: 16px; padding: 4px 2px 20px; border-bottom: 1px solid var(--line); }
.me-ava {
  width: 58px; height: 58px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 23px;
  background: var(--surface-3); border: 1px solid var(--line);
}
[data-theme="ink"] .me-ava { border-color: var(--text); }
.me-id h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; margin: 0; }
.me-id p { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.me-tag { font-size: 10px; color: var(--c-health); border: 1px solid currentColor; border-radius: 99px; padding: 0 6px; }
.me-out { margin-left: auto; flex: none; }

.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding-top: 20px; }
.me-sec {
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface);
  padding: 14px 16px 10px; box-shadow: var(--sh-1);
}
.me-sec h3 { font-size: 10.5px; letter-spacing: .12em; color: var(--text-3); margin: 0 0 4px; font-weight: 500; }
.me-sec .set-row { padding: 9px 0; }
.me-sec .set-row .lbl { font-size: 12.5px; }
.me-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.me-note { font-size: 10.5px; line-height: 1.6; color: var(--text-3); margin: 8px 0 4px; }
.me-foot { text-align: center; font-size: 10.5px; color: var(--text-3); padding: 26px 0 6px; }
.dash { color: var(--text-3); margin: 0 6px; }

@media (max-width: 1100px) { .me-grid { grid-template-columns: 1fr; } }
/* 原 @media (max-width: 768px) 规则，改为跟随 body.mobile，便于手动切换界面形态 */
body.mobile .me-page { max-width: none; }
body.mobile .me-head { padding-bottom: 14px; }
body.mobile .me-ava { width: 48px; height: 48px; font-size: 19px; }
body.mobile .me-id h2 { font-size: 18px; }
body.mobile .me-out { display: none; }
body.mobile .me-grid { gap: 12px; padding-top: 14px; }
body.mobile .me-sec { padding: 12px 14px 8px; }



/* ============================================================
   移动端时间轴（横向甘特 + 缩放）
   ============================================================ */
.mtl-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.mtl-scroll {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface);
}
.mtl { position: relative; padding-bottom: 6px; }
.mtl-axis { height: 26px; position: relative; border-bottom: 1px solid var(--line-2); margin-left: 84px; }
.mtl-ticks { position: absolute; inset: 0; }
.mtl-tick { position: absolute; bottom: 5px; font-size: 9px; color: var(--text-3); transform: translateX(-50%); font-style: normal; }
.mtl-row { display: grid; grid-template-columns: 84px 1fr; height: 40px; align-items: center; border-bottom: 1px solid var(--line-2); }
.mtl-row:last-child { border-bottom: none; }
.mtl-lb { font-size: 11px; padding: 0 8px; overflow: hidden; color: var(--text-2); }
.mtl-lb em { display: block; font-style: normal; font-size: 9px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtl-lb em.late { color: var(--accent); }
.mtl-tr { position: relative; height: 100%; }
.mtl-bar {
  position: absolute; top: 12px; height: 16px; display: block; overflow: hidden;
  border-radius: 5px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
}
.mtl-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--c) 34%, transparent); }
.mtl-ddl {
  position: absolute; top: 50%; width: 7px; height: 7px; background: var(--surface);
  border: 1.4px solid var(--text); transform: translate(-50%, -50%) rotate(45deg);
}
.mtl-today-wrap { position: absolute; left: 84px; right: 0; top: 26px; bottom: 0; pointer-events: none; }
.mtl-today { position: absolute; top: 0; bottom: 0; border-left: 1.5px dashed var(--accent); }

/* 移动端：主题卡收紧、时间轴标签不折行 */
.mtl-lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 原 @media (max-width: 768px) 规则，改为跟随 body.mobile，便于手动切换界面形态 */
body.mobile .me-sec .theme-cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
body.mobile .me-sec .theme-card { padding: 6px; }
body.mobile .me-sec .theme-card .swatch { height: 26px; margin-bottom: 5px; }
body.mobile .me-sec .theme-card b { font-size: 11px; }
body.mobile .me-sec .theme-card span { font-size: 9px; }



/* 空状态（进度页等） */
.empty-state {
  border: 1.5px dashed var(--line); border-radius: var(--r-3);
  padding: 40px 24px; text-align: center; background: var(--surface-2);
}
.empty-state b { display: block; font-family: var(--font-display); font-size: 17px; margin-bottom: 6px; }
.empty-state p { margin: 0 auto 16px; max-width: 360px; font-size: 12.5px; line-height: 1.7; color: var(--text-3); }
.empty-state .btn { margin: 0 auto; }

/* ============================================================
   手动切换界面形态（auto / phone / desktop）
   ============================================================ */
.dev-seg { flex: none; }
.dev-seg button { padding: 4px 10px; font-size: 11.5px; }

/* ---- 强制手机版 ---- */
html[data-device="phone"] .rail,
html[data-device="phone"] .insp { display: none !important; }
html[data-device="phone"] .app { grid-template-columns: minmax(0, 1fr); }
html[data-device="phone"] .tabbar { display: grid; }
html[data-device="phone"] .fab { display: grid; }
html[data-device="phone"] .d-view { display: none !important; }
html[data-device="phone"] .m-view.on { display: block !important; }
html[data-device="phone"] .content { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); }
html[data-device="phone"] .topbar { padding: 10px 14px; gap: 8px; }
html[data-device="phone"] .hide-m { display: none !important; }
html[data-device="phone"] .page-title { font-size: 19px; }
html[data-device="phone"] .month { grid-template-rows: repeat(6, minmax(62px, 1fr)); border-radius: var(--r-1); }
html[data-device="phone"] .cell { padding: 4px 4px 3px; }
html[data-device="phone"] .chips { flex-direction: row; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
html[data-device="phone"] .chip { width: 6px; height: 6px; padding: 0; border-radius: 50%; background: var(--c); overflow: visible; display: block; flex: none; }
html[data-device="phone"] .chip::before { display: none; }
html[data-device="phone"] .chip .tm,
html[data-device="phone"] .chip .tt,
html[data-device="phone"] .chips .more { display: none; }
html[data-device="phone"] .chips .chip:nth-child(n+3) { display: block; }
html[data-device="phone"] .chips .chip:nth-child(n+5) { display: none; }
html[data-device="phone"] .pg-grid { grid-template-columns: 1fr; }
html[data-device="phone"] .theme-cards { grid-template-columns: repeat(3, 1fr); gap: 6px; }
html[data-device="phone"] .theme-card { padding: 6px; }
html[data-device="phone"] .theme-card .swatch { height: 26px; margin-bottom: 5px; }
html[data-device="phone"] .theme-card b { font-size: 11px; }
html[data-device="phone"] .theme-card span { font-size: 9px; }
html[data-device="phone"] .me-grid { grid-template-columns: 1fr; gap: 12px; padding-top: 14px; }
html[data-device="phone"] .me-out { display: none; }
html[data-device="phone"] .me-sec { padding: 12px 14px 8px; }
html[data-device="phone"] .me-ava { width: 48px; height: 48px; font-size: 19px; }
html[data-device="phone"] .me-id h2 { font-size: 18px; }
html[data-device="phone"] .toasts { right: 12px; left: 12px; bottom: 78px; align-items: stretch; }
html[data-device="phone"] .toast { max-width: none; }
html[data-device="phone"] .modal-root.on { place-items: end center; }
html[data-device="phone"] .sheet { width: 100vw; max-height: 92dvh; border-radius: 20px 20px 0 0; position: fixed; bottom: 0; }
html[data-device="phone"] .detail { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 88dvh; border-left: none; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0; }
html[data-device="phone"] .detail-scrim { background: rgba(12, 12, 16, .38); }

/* 宽屏下的手机模式：套一个机身 */
@media (min-width: 769px) {
  html[data-device="phone"] body { background: var(--surface-3); }
  html[data-device="phone"] .app {
    position: fixed; left: 50%; transform: translateX(-50%);
    width: 414px; top: 14px; bottom: 14px; height: auto;
    border-radius: 30px; overflow: hidden; border: 1px solid var(--line);
    box-shadow: 0 36px 90px -60px rgba(0, 0, 0, .75);
  }
  html[data-device="phone"] .tabbar { position: fixed; left: 50%; transform: translateX(-50%); width: 414px; bottom: 14px; border-radius: 0 0 30px 30px; }
  html[data-device="phone"] .fab { position: fixed; right: calc(50% - 207px + 18px); bottom: calc(14px + 74px); }
  html[data-device="phone"] .toasts { position: fixed; left: 50%; transform: translateX(-50%); width: 414px; right: auto; bottom: 96px; }
  html[data-device="phone"] .modal-root.on { place-items: end center; }
  html[data-device="phone"] .sheet { position: fixed; bottom: 14px; width: 414px; border-radius: 20px 20px 28px 28px; }
  html[data-device="phone"] .detail { position: fixed; left: 50%; transform: translateX(-50%); width: 414px; bottom: 14px; max-height: 80dvh; border-radius: 20px 20px 28px 28px; }
}

/* ---- 强制电脑版 ---- */
html[data-device="desktop"] .rail { display: flex !important; }
html[data-device="desktop"] .insp { display: flex !important; }
html[data-device="desktop"] .tabbar,
html[data-device="desktop"] .fab { display: none !important; }
html[data-device="desktop"] .app { grid-template-columns: 232px minmax(0, 1fr) 316px; height: 100vh; }
html[data-device="desktop"] .m-view { display: none !important; }
html[data-device="desktop"] .d-view.on { display: block !important; }
html[data-device="desktop"] .content { padding: 16px 22px 24px; }
html[data-device="desktop"] .hide-m { display: block !important; }
html[data-device="desktop"] .topbar { padding: 14px 22px 12px; }
@media (max-width: 900px) {
  html[data-device="desktop"] .app { zoom: .52; }
}

/* 电脑版在窄屏上缩放时，铺满可视高度 */
@media (max-width: 900px) {
  html[data-device="desktop"] .app { height: calc(100vh / .52); }
  html[data-device="desktop"] .toasts { display: none; }
}

/* ============================================================
   v1.6 · 手机端补齐：快捷入口 / 二级页返回条 / 速记悬浮钮
   ============================================================ */
.m-back { display: none; }
body.mobile .m-back.on {
  display: flex; align-items: center; gap: 8px;
  margin: -2px 0 10px; padding: 6px 0 8px;
  border-bottom: 1px solid var(--line-2);
}
.m-back-t { font-size: 11.5px; font-weight: 500; color: var(--text-3); }

.m-quick { display: none; }
body.mobile .m-quick {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 12px 0 2px;
}
.m-q {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 10px 10px 9px; text-align: left;
  background: var(--surface); border: var(--card-border-w) solid var(--card-line);
  border-radius: var(--r-1); box-shadow: var(--sh-1);
  transition: transform .16s cubic-bezier(.22, .9, .24, 1);
}
.m-q:active { transform: scale(.97); }
.m-q i {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--surface-2); margin-bottom: 5px;
}
.m-q i svg { width: 15px; height: 15px; stroke: var(--text); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.m-q b { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; }
.m-q em { font-style: normal; font-size: 9.5px; color: var(--text-3); line-height: 1.3; }
[data-theme="ink"] .m-q { border-radius: var(--r-1) 12px 14px 10px; }

.fab-mini { display: none; }
body.mobile .fab-mini {
  position: fixed; right: 18px; bottom: calc(146px + env(safe-area-inset-bottom)); z-index: 55;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px 7px 9px; border-radius: 999px;
  background: var(--surface); color: var(--text);
  border: var(--card-border-w) solid var(--card-line); box-shadow: var(--sh-2);
  font-size: 11.5px; font-weight: 600;
  transition: transform .2s cubic-bezier(.34, 1.2, .64, 1);
}
body.mobile .fab-mini:active { transform: scale(.94); }
body.mobile .fab-mini svg { width: 14px; height: 14px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 我的页不需要新建按钮，避免遮挡 */
body.mobile[data-mview="mine"] .fab,
body.mobile[data-mview="mine"] .fab-mini { display: none !important; }
body.mobile[data-mview="mine"] .content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* 手机端进度页标题 */
.m-h1 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.m-h1 em { font-style: normal; font-size: 10.5px; font-family: var(--font-body); font-weight: 500; color: var(--text-3); margin-left: 6px; letter-spacing: 0; }
body.mobile .m-head { align-items: center; }
body.mobile .m-head .grow { min-width: 0; }
body.mobile .empty-state { padding: 44px 18px; }

/* 设置弹层里复用「我的」的分区，去掉卡片描边更清爽 */
.me-grid.one { grid-template-columns: 1fr; gap: 6px; padding-top: 0; }
.sheet .me-grid.one .me-sec {
  border: 0; box-shadow: none; background: transparent;
  padding: 8px 0 6px; border-bottom: 1px solid var(--line-2);
}
.sheet .me-grid.one .me-sec:last-child { border-bottom: 0; }
.sheet .me-grid.one .me-sec h3 { font-size: 10.5px; letter-spacing: .1em; margin-bottom: 2px; }
.sheet .me-grid.one .me-foot, .sheet .me-grid.one .me-btns { padding-bottom: 4px; }

/* 手机端工作集：卡片横向滑动，详情单列 */
body.mobile .col-page { grid-template-columns: minmax(0, 1fr); gap: 14px; }
body.mobile .col-list {
  flex-direction: row; overflow-x: auto; overflow-y: hidden;
  position: static; gap: 8px; padding: 2px 0 8px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
body.mobile .col-list .col-card { flex: 0 0 72%; scroll-snap-align: start; }
body.mobile .col-list .col-new { flex: 0 0 44%; }
body.mobile .col-list-head, body.mobile .col-total { display: none; }
body.mobile .col-head { flex-wrap: wrap; gap: 10px; }
body.mobile .ch-l h2 { font-size: 19px; }
body.mobile .ch-r { margin-left: 0; width: 100%; flex-wrap: wrap; }
body.mobile .col-stats { gap: 18px; }
body.mobile .col-stats b { font-size: 18px; }
body.mobile .col-block { margin-top: 14px; }

/* 速记钮放左下角，避免和右下角的新建钮、卡片上的「＋记录」打架。
   注意：宽屏下「手机版」是一个 414px 宽的机身（.app 居中），
   此时 left:18px 会贴到浏览器窗口左边而不是机身内，必须按机身边界重算。 */
body.mobile .fab-mini { right: auto; left: 18px; bottom: calc(74px + env(safe-area-inset-bottom)); }
@media (min-width: 769px) {
  html[data-device="phone"] .fab-mini {
    left: calc(50% - 207px + 16px);
    bottom: calc(14px + 74px);
  }
}
body.mobile .col-list::-webkit-scrollbar { display: none; }
body.mobile .col-list { scrollbar-width: none; }
body.mobile #vm-progress .m-head, body.mobile #vm-collections ~ .m-head { padding-top: 2px; }
body.mobile .m-head { margin-bottom: 10px; }

/* 手机端弹层出现时，提示条挪到顶部，别糊在弹层的按钮上 */
body.mobile .modal-root.on ~ .toasts { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }

/* 手机端搜索按钮与搜索弹层 */
#btnMSearch { display: none; }
body.mobile #btnMSearch { display: inline-flex; }
.m-res { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow: auto; margin: 4px 0 8px; }
.m-res-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 8px; border-radius: var(--r-1); border-bottom: 1px solid var(--line-2);
}
.m-res-item:active { background: var(--surface-2); }
.m-res-item b { font-size: 12.5px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-res-item em { font-style: normal; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.m-res-done { font-size: 9.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 99px; padding: 1px 5px; }
.m-res-hint { font-size: 11.5px; color: var(--text-3); padding: 16px 2px; text-align: center; }

/* 手机模式：提示条抬到右下角新建钮上方，别把 FAB 盖住 */
body.mobile .toasts { bottom: calc(148px + env(safe-area-inset-bottom)); }
@media (min-width: 769px) {
  html[data-device="phone"] .toasts { bottom: 156px; }
}
