/* ============================================================
   墨笺 · 个人待办 —— 暖纸 + 墨色 编辑风
   ============================================================ */

:root {
  --bg: #f3eee3;
  --bg-deep: #ece5d4;
  --surface: #faf7ef;
  --surface-2: #f2ecdd;
  --ink: #2a2620;
  --ink-2: #5c5344;
  --muted: #9a907e;
  --hairline: #ddd5c2;
  --hairline-2: #eae3d1;
  --accent: #2f5d4a;
  --accent-ink: #24493a;
  --accent-soft: rgba(47, 93, 74, 0.12);
  --warn: #c2402a;
  --warn-soft: rgba(194, 64, 42, 0.1);
  --gold: #b98a2e;
  --shadow-1: 0 1px 2px rgba(42, 38, 32, 0.05), 0 4px 16px rgba(42, 38, 32, 0.05);
  --shadow-2: 0 2px 6px rgba(42, 38, 32, 0.06), 0 14px 40px rgba(42, 38, 32, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 226px;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input { font-family: inherit; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink-2);
}

/* 纸纹颗粒 */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .05;
  z-index: 60;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================ 布局 ============================ */
.app { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 18px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-right: 1px solid var(--hairline);
  overflow-y: auto;
}

/* 品牌 */
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 26px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--serif);
  font-size: 19px;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(42,38,32,.25);
}
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .06em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .14em; }

/* 导航 */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--ink-2);
  font-size: 14px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 20%; bottom: 20%; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-count { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--muted); }
.nav-count.warn { color: var(--warn); font-weight: 600; }

.nav-divider {
  margin: 22px 10px 8px;
  font-size: 11px; letter-spacing: .18em; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.nav-divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }

#projectNav .nav-item { padding-left: 10px; }
.nav-dot {
  width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0;
}
.nav-project-add {
  margin-top: 4px; padding: 7px 10px; font-size: 13px; color: var(--muted);
  border-radius: 9px; text-align: left; display: flex; align-items: center; gap: 8px;
  opacity: 0; transition: opacity .15s;
}
.sidebar:hover .nav-project-add, .nav-project-add:focus-visible { opacity: 1; }
.nav-project-add:hover { background: var(--surface-2); color: var(--ink); }
.nav-project-add.hidden { display: none; }

.sidebar-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.notify-toggle {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--ink-2);
}
.notify-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.notify-toggle:hover { background: var(--surface-2); }
.notify-toggle.on { color: var(--accent); }
.foot-help { padding: 6px 10px; font-size: 12px; color: var(--muted); text-align: left; border-radius: 9px; }
.foot-help:hover { background: var(--surface-2); color: var(--ink); }

/* ============================ 主区域 ============================ */
.main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; position: relative;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(47,93,74,.05), transparent 60%),
    var(--bg);
}
.main-head {
  padding: 34px 40px 10px;
  display: flex; align-items: baseline; gap: 16px;
}
.view-title { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: .04em; }
.view-meta { font-size: 13px; color: var(--muted); }

/* 快速录入 */
.quickinput {
  margin: 16px 40px 4px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  display: flex; align-items: center;
  padding: 13px 16px;
  gap: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.quickinput:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-1);
}
.quick-glyph { color: var(--accent); font-size: 17px; flex-shrink: 0; }
.quick-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--ink);
}
.quick-input::placeholder { color: var(--muted); }
.quick-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.quick-hint kbd { font-size: 10px; }

.quick-preview {
  position: absolute; left: 16px; right: 16px; top: calc(100% + 8px);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  padding: 10px 12px; box-shadow: var(--shadow-1); z-index: 30;
}
.preview-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface-2); color: var(--ink-2);
}
.preview-chip.project { border-color: var(--pc, var(--accent)); color: var(--pc, var(--accent-ink)); background: rgba(255,255,255,.4); }
.preview-chip.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.preview-chip.pri1 { color: var(--muted); }
.preview-chip.pri2 { color: var(--gold); border-color: rgba(185,138,46,.5); }
.preview-chip.pri3 { color: var(--warn); border-color: rgba(194,64,42,.5); }
.preview-title {
  font-size: 13px; color: var(--ink); font-weight: 600; margin-right: 4px;
}
.preview-title.empty { color: var(--muted); font-weight: 400; }

/* ============ 快捷设置栏（可视化选择日期/时间/优先级/项目） ============ */
.quick-wrap { margin: 16px 40px 4px; }
.quick-bar {
  display: none;
  align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.quick-wrap:focus-within .quick-bar { display: flex; animation: row-in .2s both; }
.qb-field {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.qb-field:hover { border-color: var(--hairline); background: var(--surface-2); }
.qb-field svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.qb-field:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.qb-field:focus-within svg { stroke: var(--accent); }
.qb-field input {
  border: none; outline: none; background: transparent;
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  max-width: 130px;
}
.qb-field input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .5; }
.qb-field input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.qb-prio { display: inline-flex; gap: 4px; padding: 3px 6px; }
.qb-prio .prio-dot { width: 20px; height: 20px; border: 1.5px solid var(--hairline); }
.qb-prio .prio-dot.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.qb-project { padding: 3px 6px; }
.qb-select {
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  max-width: 130px;
}
.qb-select:hover { color: var(--ink); }
.qb-hint { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 内容区 */
.content {
  flex: 1; overflow-y: auto;
  padding: 8px 40px 60px;
  scroll-behavior: smooth;
}
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 8px; border: 3px solid var(--bg); }
.content::-webkit-scrollbar-track { background: transparent; }

/* 视图工具条 */
.view-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 4px 10px;
}
.view-toolbar .count-line { font-size: 13px; color: var(--muted); }
.view-toolbar .spacer { flex: 1; }
.btn-ghost {
  font-size: 13px; color: var(--ink-2); padding: 5px 12px;
  border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface);
  transition: all .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.btn-ghost.warn:hover { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

/* 任务列表 */
.task-list { display: flex; flex-direction: column; gap: 2px; }
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  position: relative;
  transition: background .15s;
  animation: row-in .3s both;
}
.task:hover { background: var(--surface); }
.task.selected { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.task::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px;
  border-radius: 0 3px 3px 0; background: transparent;
  transition: background .2s;
}
.task.pri1::before { background: #b9b2a0; }
.task.pri2::before { background: var(--gold); }
.task.pri3::before { background: var(--warn); }

@keyframes row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 勾选圆 */
.check {
  width: 20px; height: 20px; flex-shrink: 0;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.6px solid var(--muted);
  position: relative;
  transition: border-color .2s, background .2s, transform .15s;
}
.check:hover { border-color: var(--accent); transform: scale(1.1); }
.check svg { position: absolute; inset: 2px; stroke: var(--surface); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task.done .check svg { stroke-dashoffset: 0; transition: stroke-dashoffset .3s ease .05s; }

/* 任务主体 */
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; color: var(--ink); word-break: break-word; position: relative; display: inline-block; }
.task.done .task-title { color: var(--muted); }
.task.done .task-title::after {
  content: ""; position: absolute; left: -1px; right: -1px; top: 52%; height: 1.5px;
  background: var(--muted); border-radius: 2px;
  animation: strike .35s ease forwards;
  transform-origin: left center;
}
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.chip {
  font-size: 12px; padding: 1px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--hairline-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip.project { border-color: transparent; color: var(--accent-ink); background: var(--accent-soft); }
.chip.due.today { color: var(--accent-ink); background: var(--accent-soft); }
.chip.due.overdue { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip.tag { color: var(--muted); }

/* 任务操作 */
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.task:hover .task-actions, .task.selected .task-actions, .task:focus-within .task-actions { opacity: 1; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; color: var(--muted);
  transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--warn); background: var(--warn-soft); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* 内联编辑 */
.inline-edit {
  width: 100%; border: 1.5px solid var(--accent); outline: none;
  background: var(--surface); color: var(--ink);
  font-size: 15px; padding: 4px 8px; border-radius: 6px; font-family: inherit;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 优先级弹层 */
.prio-pop {
  position: absolute; right: 0; top: 110%;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2); padding: 6px; display: flex; gap: 4px; z-index: 40;
}
.prio-dot {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0; border: 1.5px solid var(--hairline); transition: all .12s;
}
.prio-dot:hover { transform: scale(1.15); }
.prio-dot.p0 { background: var(--surface-2); }
.prio-dot.p1 { background: #b9b2a0; }
.prio-dot.p2 { background: var(--gold); }
.prio-dot.p3 { background: var(--warn); }
.prio-dot.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }

/* 可点击 chip（时间/项目） */
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { box-shadow: 0 0 0 1.5px var(--accent); color: var(--accent-ink); }

/* 详情编辑弹层（日期 + 时间 + 项目） */
.detail-pop {
  position: absolute; right: 0; top: 110%;
  width: 250px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px;
  box-shadow: var(--shadow-2); padding: 12px; z-index: 40;
  display: flex; flex-direction: column; gap: 9px;
  animation: pop .2s both;
}
.pop-row { display: flex; gap: 8px; }
.pop-row label { flex: 1; display: flex; }
.pop-row input {
  flex: 1; width: 100%;
  border: 1px solid var(--hairline); border-radius: 7px;
  padding: 6px 8px; font-family: var(--mono); font-size: 13px; color: var(--ink);
  background: var(--bg); outline: none;
  transition: border-color .15s;
}
.pop-row input:focus { border-color: var(--accent); }
.dp-project {
  width: 100%;
  border: 1px solid var(--hairline); border-radius: 7px;
  padding: 6px 8px; font-size: 13px; color: var(--ink-2); background: var(--bg);
  outline: none; cursor: pointer;
}
.pop-actions { display: flex; gap: 8px; }
.pop-btn {
  flex: 1; font-size: 13px; padding: 6px 0; border-radius: 7px;
  background: var(--accent); color: var(--surface); font-weight: 600;
  transition: background .15s;
}
.pop-btn:hover { background: var(--accent-ink); }
.pop-btn.ghost { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--hairline); }
.pop-btn.ghost:hover { background: var(--surface-2); color: var(--warn); border-color: var(--warn); }

/* 空状态 */
.empty {
  text-align: center; padding: 70px 20px; color: var(--muted);
  animation: row-in .4s both;
}
.empty-mark { font-family: var(--serif); font-size: 44px; opacity: .5; margin-bottom: 12px; }
.empty-title { font-size: 16px; color: var(--ink-2); margin-bottom: 4px; }
.empty-sub { font-size: 13px; }

/* 分组标题（今天视图的逾期分组） */
.group-head {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 4px 6px;
  font-size: 12px; letter-spacing: .14em; color: var(--muted);
}
.group-head::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.group-head .gcount { font-family: var(--mono); color: var(--warn); font-size: 11px; }

/* ============================ 统计页 ============================ */
.stats { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-1);
  animation: row-in .4s both;
}
.stat-card:nth-child(2) { animation-delay: .05s; }
.stat-card:nth-child(3) { animation-delay: .1s; }
.stat-card:nth-child(4) { animation-delay: .15s; }
.stat-label { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.stat-value { font-family: var(--serif); font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-value .unit { font-size: 14px; color: var(--muted); font-family: var(--sans); font-weight: 400; margin-left: 3px; }
.stat-value.warn { color: var(--warn); }
.stat-value.accent { color: var(--accent); }

.stat-card-panel {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-1);
  animation: row-in .4s both .1s;
}
.panel-title {
  font-family: var(--serif); font-size: 16px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }

.chart-svg { width: 100%; height: auto; display: block; }
.chart-bars text {
  font-family: var(--mono); font-size: 9px; fill: var(--muted);
}
.bar-rect { transition: opacity .15s; }
.bar-rect:hover { opacity: .75; }

.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.hbar-name { width: 92px; flex-shrink: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { flex: 1; height: 16px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 8px; transition: width .5s ease; }
.hbar-val { width: 46px; text-align: right; font-family: var(--mono); color: var(--muted); font-size: 12px; }

.review-box {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--hairline); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 16px 20px;
  font-size: 14px; line-height: 2; color: var(--ink-2);
}
.review-box b { color: var(--ink); font-weight: 600; }

/* 优先级分布 */
.pri-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.pri-dot-lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* ============================ 浮层 & Toast ============================ */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(42,38,32,.35); backdrop-filter: blur(3px);
  display: grid; place-items: center;
  animation: fade-in .2s both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(480px, 92vw);
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-2);
  padding: 24px 26px;
  animation: pop .25s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h2 { font-family: var(--serif); font-size: 20px; }
.sheet-close { font-size: 24px; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; }
.sheet-close:hover { background: var(--surface-2); color: var(--ink); }
.kbd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; }
.kbd-grid > div { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.kbd-grid span { flex: 1; }
.sheet-note { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 2; }
.sheet-note code {
  font-family: var(--mono); font-size: 11px; background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--hairline);
}

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--ink); color: var(--surface);
  font-size: 13px; padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow-2); z-index: 100;
  animation: toast-in .3s both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 移动端底部导航 */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--hairline);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, 1fr);
  backdrop-filter: blur(8px);
}
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; }
.mobile-nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mobile-nav a.active { color: var(--accent); }

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { height: 100%; }
  .sidebar { display: none; }
  .main { padding-bottom: 56px; }
  .main-head { padding: 20px 18px 6px; }
  .view-title { font-size: 24px; }
  .quick-wrap { margin: 12px 18px 0; }
  .quickinput { padding: 12px 14px; }
  .quick-bar { gap: 6px; padding: 8px 10px; }
  .qb-hint { display: none; }
  .content { padding: 6px 16px 30px; }
  .quick-hint { display: none; }
  .mobile-nav { display: grid; }
  .task-actions { opacity: 1; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .nav-count { margin-left: auto; }
  .stats { gap: 14px; }
  .stat-card-panel { padding: 16px; }
  .task { padding: 10px 10px; }
  .quick-preview { left: 14px; right: 14px; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .kbd-grid { grid-template-columns: 1fr; }
}

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