/* 生活运营官 · 移动端样式（无外部依赖） */

:root {
  --bg: #f3f0e6;
  --bg-deep: #e9e4d6;
  --surface: #fffdf7;
  --surface-2: #faf7ee;
  --ink: #1b241f;
  --ink-2: #46524b;
  --muted: #7c867f;
  --line: #e6e0d1;
  --line-strong: #d6cdb8;
  --green: #1e6f53;
  --green-2: #2b8a68;
  --green-soft: #e2efe8;
  --green-ink: #14503c;
  --amber: #b4762f;
  --amber-soft: #f7ead8;
  --red: #a94b3f;
  --red-soft: #f6e3df;
  --shadow: 0 1px 2px rgba(27, 36, 31, .04), 0 8px 24px -12px rgba(27, 36, 31, .18);
  --shadow-lift: 0 10px 40px -12px rgba(20, 60, 45, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 64px;
  --maxw: 620px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1412;
    --bg-deep: #0a0e0c;
    --surface: #171d1a;
    --surface-2: #1c2320;
    --ink: #edf1ea;
    --ink-2: #c3ccc5;
    --muted: #93a098;
    --line: #2a332e;
    --line-strong: #3a453f;
    --green: #5fc79d;
    --green-2: #7ad9b2;
    --green-soft: #1b2f27;
    --green-ink: #b6ecd6;
    --amber: #e0a45c;
    --amber-soft: #33281a;
    --red: #e08b7f;
    --red-soft: #33211f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .8);
    --shadow-lift: 0 14px 40px -14px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1412;
  --bg-deep: #0a0e0c;
  --surface: #171d1a;
  --surface-2: #1c2320;
  --ink: #edf1ea;
  --ink-2: #c3ccc5;
  --muted: #93a098;
  --line: #2a332e;
  --line-strong: #3a453f;
  --green: #5fc79d;
  --green-2: #7ad9b2;
  --green-soft: #1b2f27;
  --green-ink: #b6ecd6;
  --amber: #e0a45c;
  --amber-soft: #33281a;
  --red: #e08b7f;
  --red-soft: #33211f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -16px rgba(0, 0, 0, .8);
  --shadow-lift: 0 14px 40px -14px rgba(0, 0, 0, .8);
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(43, 138, 104, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(180, 118, 47, .07), transparent 55%);
  z-index: 0;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--green); }

::selection { background: var(--green); color: #fff; }

.shell {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom));
}

@media (min-width: 680px) {
  body { background: var(--bg-deep); }
  .shell {
    box-shadow: 0 0 0 1px var(--line), 0 30px 80px -40px rgba(0, 0, 0, .35);
    min-height: 100vh;
  }
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
}

.topbar.scrolled { border-bottom-color: var(--line); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  letter-spacing: .02em;
  font-size: 15px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--green);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(30, 111, 83, .8);
}
.brand-mark svg { width: 13px; height: 13px; }

.top-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: background .18s ease, color .18s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 主区 ---------- */

.view {
  padding: 6px 20px 20px;
  animation: view-in .28s ease both;
}

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

.section { margin-top: 26px; }
.section:first-child { margin-top: 10px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}

.section-note { font-size: 12px; color: var(--muted); }

/* ---------- 首页 hero ---------- */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 18px 20px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green-soft) 92%, var(--surface)) 0%, var(--surface) 78%);
  border: 1px solid color-mix(in srgb, var(--green) 16%, var(--line));
  box-shadow: var(--shadow);
  margin-top: 6px;
}

.hero-greet { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.hero-date {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .01em;
  margin: 2px 0 8px;
  line-height: 1.25;
}
.hero-sub { font-size: 13px; color: var(--ink-2); max-width: 30ch; }
.hero-sub strong { color: var(--green-ink); }

.ring { position: relative; width: 86px; height: 86px; flex: 0 0 86px; }
.ring svg { transform: rotate(-90deg); }
.ring-track { stroke: color-mix(in srgb, var(--green) 14%, transparent); }
.ring-bar { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.1;
}
.ring-num { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.ring-cap { font-size: 10px; color: var(--muted); letter-spacing: .08em; margin-top: 2px; }

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

.task-list { display: flex; flex-direction: column; gap: 9px; }

.task {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 12px 13px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.task:active { transform: scale(.994); }
.task.done { background: var(--surface-2); }
.task.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.task.doing { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.task.doing::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--green);
}

.check {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.8px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all .18s ease;
  background: transparent;
}
.check svg { width: 15px; height: 15px; stroke-width: 2.6; }
.check:hover { border-color: var(--green); }
.check.done { background: var(--green); border-color: var(--green); color: #fff; }
.check.doing { border-color: var(--green); color: var(--green); background: var(--green-soft); }

.task-main { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.task-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.42;
  word-break: break-word;
}
.task-title .time-pill { margin-left: 6px; vertical-align: 2px; }
.task-next {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  display: flex;
  gap: 5px;
}
.task-next b { font-weight: 600; color: var(--ink-2); }
.task-next.missing { color: var(--amber); }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
}
.task-meta .warn { color: var(--amber); font-weight: 600; }
.more {
  flex: 0 0 30px;
  width: 30px; height: 30px;
  border-radius: 9px;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 17px;
  letter-spacing: 1px;
  margin-top: -2px;
}
.more:hover { background: var(--surface-2); color: var(--ink); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: .02em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.pill.green { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.pill.amber { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.pill.red { background: var(--red-soft); border-color: transparent; color: var(--red); }

.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); display: inline-block; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  font-size: 14.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: transform .16s ease, background .18s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.975); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 18px -8px rgba(30, 111, 83, .8); }
.btn.primary:hover { background: var(--green-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.soft { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.fab {
  position: fixed;
  right: max(20px, calc((100vw - var(--maxw)) / 2 + 20px));
  bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom));
  z-index: 25;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lift);
  transition: transform .18s ease;
}
.fab:active { transform: scale(.92); }
.fab svg { width: 24px; height: 24px; }

/* ---------- 收集箱 ---------- */

.capture {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.capture-row { display: flex; gap: 8px; }
.capture input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 0 13px;
  font-size: 16px;
  outline: none;
}
.capture input[type="text"]:focus { border-color: var(--green); background: var(--surface); }
.capture .btn { flex: 0 0 auto; }
.capture-extra { margin-top: 9px; }
.capture-extra input {
  width: 100%;
  height: 38px;
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  background: transparent;
  padding: 0 2px;
  font-size: 14px;
  outline: none;
}
.capture-extra input:focus { border-bottom-color: var(--green); }

.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.inbox-main { flex: 1; min-width: 0; }
.inbox-text { font-size: 14.5px; font-weight: 550; word-break: break-word; }
.inbox-next { font-size: 12px; color: var(--muted); margin-top: 2px; }
.inbox-actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.inbox-actions .btn { min-height: 30px; font-size: 11.5px; padding: 0 9px; border-radius: 8px; }
.inbox-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; margin-top: 2px; }

/* ---------- 空状态 ---------- */

.empty {
  text-align: center;
  padding: 28px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.empty .empty-icon {
  width: 42px; height: 42px;
  margin: 0 auto 10px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--green-soft);
  color: var(--green);
}
.empty .empty-icon svg { width: 21px; height: 21px; }
.empty-title { color: var(--ink-2); font-weight: 600; font-size: 14px; }
.empty p { margin: 4px 0 0; font-size: 12.5px; }

/* ---------- 复盘 ---------- */

.review-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green-ink);
  font-size: 13px;
  line-height: 1.55;
}
.review-intro svg { width: 22px; height: 22px; flex: 0 0 22px; }

.review-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}
.review-block + .review-block { margin-top: 12px; }
.review-block h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  flex: 0 0 21px;
}
.block-hint { font-size: 12px; color: var(--muted); margin: 0 0 12px 29px; }

.done-list { display: flex; flex-direction: column; gap: 6px; }
.done-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.done-row .check { width: 20px; height: 20px; flex-basis: 20px; margin: 0; background: var(--green); border-color: var(--green); color: #fff; }
.done-row .check svg { width: 11px; height: 11px; }
.done-row .actual { margin-left: auto; font-size: 11px; color: var(--muted); }

.review-task { padding: 12px 0; border-top: 1px dashed var(--line); }
.review-task:first-of-type { border-top: 0; padding-top: 4px; }
.review-task-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.review-task-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 9px; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.chip:active { transform: scale(.96); }

.actions-row { display: flex; gap: 6px; flex-wrap: wrap; }
.actions-row .chip { font-size: 11.5px; padding: 4px 9px; }
.actions-row .chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="number"], .field select, .field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.field textarea { min-height: 82px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); background: var(--surface); }
.field input[aria-invalid="true"] { border-color: var(--red); background: var(--red-soft); }

.tomorrow-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}
.tomorrow-row:first-of-type { border-top: 0; padding-top: 2px; }
.tomorrow-row .n {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 11px; color: var(--muted);
  margin-top: 10px;
}
.tomorrow-row input { width: 100%; }
.tomorrow-row input.primary-input {
  height: 40px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 9px; padding: 0 10px; font-size: 15px; outline: none;
}
.tomorrow-row input.sub-input {
  height: 30px; border: 0; border-bottom: 1px dashed var(--line); background: transparent;
  padding: 0 2px; font-size: 12.5px; color: var(--ink-2); outline: none;
}
.tomorrow-row input.sub-input:focus { border-bottom-color: var(--green); }

.metric-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.metric-label { font-size: 12px; color: var(--muted); width: 34px; }
.metric-row .chip { padding: 4px 9px; font-size: 11.5px; }
.metric-row input[type="number"] { width: 72px; min-height: 34px; padding: 4px 8px; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }

.save-bar {
  position: sticky;
  bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom));
  margin-top: 16px;
  z-index: 5;
}
.save-bar .btn { box-shadow: var(--shadow-lift); }

/* ---------- 报告 ---------- */

.segmented {
  display: flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 4px 0 14px;
}
.segmented button {
  flex: 1;
  min-height: 36px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.date-nav .nav-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
}
.date-nav .nav-btn svg { width: 16px; height: 16px; }
.date-label {
  font-size: 14px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  padding: 6px 10px;
  border-radius: 9px;
}
.date-label:hover { background: var(--surface-2); }
.date-label input[type="date"] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  border: 0; cursor: pointer;
}
.date-label .sub { font-size: 11px; color: var(--muted); font-weight: 400; }

.paper {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}
.paper h1 {
  font-size: 19px;
  line-height: 1.35;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green);
  letter-spacing: .01em;
}
.paper h2 {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--green-ink);
  margin: 20px 0 7px;
  padding-left: 9px;
  border-left: 3px solid var(--green);
  line-height: 1.4;
}
.paper h2:first-of-type { margin-top: 4px; }
.paper ul, .paper ol { margin: 0; padding-left: 20px; }
.paper li { margin: 4px 0; }
.paper li.task-done { list-style: none; margin-left: -20px; padding-left: 20px; position: relative; }
.paper li.task-done::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.paper li.task-undone { list-style: none; margin-left: -20px; padding-left: 20px; position: relative; }
.paper li.task-undone::before { content: "○"; position: absolute; left: 0; color: var(--muted); }
.paper li.advice {
  list-style: none;
  margin: -2px 0 8px -20px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 7px 7px 0;
}
.paper li.advice::before { content: none; }
.paper strong { font-weight: 700; }
.paper code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 4px;
  border-radius: 4px;
}
.paper blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--green);
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 0 8px 8px 0;
}
.paper hr { border: 0; border-top: 1px dashed var(--line-strong); margin: 16px 0; }
.paper table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 2px; }
.paper th, .paper td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.paper th { color: var(--muted); font-weight: 600; font-size: 11px; }
.paper .md-empty { color: var(--muted); }

.report-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.report-actions .btn { flex: 1 1 auto; }
.report-foot { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.65; }

/* ---------- 设置 ---------- */

.settings-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.settings-group + .settings-group { margin-top: 14px; }
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
  min-height: 54px;
}
.settings-row:first-child { border-top: 0; }
.settings-label { flex: 1; min-width: 0; }
.settings-label b { display: block; font-size: 14px; font-weight: 600; }
.settings-label small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.settings-row input[type="text"], .settings-row input[type="time"], .settings-row input[type="number"], .settings-row select {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
  min-height: 36px;
  padding: 4px 9px;
  font-size: 15px;
  outline: none;
  max-width: 130px;
}
.settings-row select { max-width: 120px; }
.settings-row input:focus, .settings-row select:focus { border-color: var(--green); }

.switch {
  position: relative;
  width: 46px; height: 27px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .2s ease;
  flex: 0 0 46px;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

.tag-editor { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0; }
.tag-editor .chip { padding: 4px 9px; font-size: 12px; }
.tag-editor .chip button { color: inherit; opacity: .6; margin-left: 2px; }

.danger { color: var(--red) !important; }

.about-note { font-size: 12px; color: var(--muted); line-height: 1.7; padding: 14px 15px; }
.about-note b { color: var(--ink-2); }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  z-index: 30;
  display: flex;
  align-items: stretch;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--muted);
  position: relative;
  transition: color .18s ease;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--green); font-weight: 650; }
.tab.active::after {
  content: "";
  position: absolute;
  top: 0;
  width: 22px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--green);
}
.tab .badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--amber);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  line-height: 1;
}

/* ---------- 弹层 ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 18, 14, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in .2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  z-index: 41;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5);
  animation: sheet-up .28s cubic-bezier(.2, .9, .25, 1) both;
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes sheet-up { from { transform: translate(-50%, 8%); opacity: .6; } to { transform: translate(-50%, 0); opacity: 1; } }

.sheet-grip {
  width: 38px; height: 4px;
  border-radius: 3px;
  background: var(--line-strong);
  margin: 8px auto 0;
  flex: 0 0 auto;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px 8px;
  flex: 0 0 auto;
}
.sheet-title { font-size: 17px; font-weight: 700; flex: 1; line-height: 1.35; }
.sheet-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  display: grid; place-items: center;
  flex: 0 0 32px;
}
.sheet-close svg { width: 15px; height: 15px; }
.sheet-body {
  padding: 4px 20px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}
.sheet-footer {
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}
.sheet-footer .btn { flex: 1; }

.menu-list { display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 11px;
  text-align: left;
  font-size: 14.5px;
  color: var(--ink);
  min-height: 48px;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 18px; }
.menu-item.danger { color: var(--red); }
.menu-item.danger svg { color: var(--red); }
.menu-item small { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: min(88vw, 460px);
  text-align: center;
  line-height: 1.5;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .undo { color: var(--green-2); font-weight: 700; margin-left: 8px; }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 13px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12.5px;
  margin-bottom: 10px;
  line-height: 1.45;
}
.banner svg { width: 17px; height: 17px; flex: 0 0 17px; }
.banner .banner-action { margin-left: auto; color: inherit; font-weight: 700; white-space: nowrap; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.hint.warn { color: var(--amber); }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 两列表单 / 危险按钮 / 弹层锁定 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.form-grid .field { margin-top: 10px; }
@media (max-width: 380px) { .form-grid { grid-template-columns: 1fr; } }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff !important; }
.btn.danger:hover { filter: brightness(.94); }
body.sheet-open { overflow: hidden; }

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

/* 桌面端不要悬停态过于敏感 */
@media (hover: none) {
  .icon-btn:hover, .more:hover, .menu-item:hover, .date-label:hover { background: none; }
}

/* ================= 理解层：AI 卡片 / 画像 ================= */

.capture textarea {
  width: 100%; min-height: 62px; max-height: 200px; resize: vertical;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 11px 12px; font-size: 16px; line-height: 1.55; color: var(--ink);
  outline: none; font-family: inherit;
}
.capture textarea:focus { border-color: var(--green); background: var(--surface); }
.capture-actions { display: flex; gap: 8px; margin-top: 9px; }
.capture-actions .btn { flex: 0 0 auto; }

.link-btn {
  display: inline-block; margin-top: 4px; padding: 0; border: 0; background: none;
  color: var(--green); font-size: 13px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.inbox-text.clamp {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.inbox-full {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); font-size: 14px; line-height: 1.7; white-space: pre-wrap;
  max-height: 320px; overflow: auto;
}

.ai-busy { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.ai-busy .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: aipulse 1s ease-in-out infinite;
}
@keyframes aipulse { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

.ai-cards { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--surface-2);
}
.ai-card-head { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.ai-kind {
  flex: 0 0 auto; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  border: 1px solid currentColor; line-height: 1.7;
}
.ai-kind.todo { color: #8a5a1f; }
.ai-kind.idea { color: #2d6a8f; }
.ai-kind.decide { color: #6b4b8a; }
.ai-kind.mood { color: #a0524b; }
.ai-kind.person { color: #3f6b4e; }
.ai-kind.fact { color: #5b625c; }
.ai-title { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.ai-body { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.ai-next {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 7px;
  font-size: 13px; color: var(--green);
}
.ai-next svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ai-tags span {
  font-size: 11.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 7px; line-height: 1.8;
}

.stat-big { font-size: 26px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }

.profile-paper { margin-top: 14px; }
.profile-sum { font-size: 16px; line-height: 1.75; }
.insight-row { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.insight-row:last-child { border-bottom: 0; }
.insight-label { font-size: 14.5px; font-weight: 600; }
.insight-detail { margin-top: 3px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.theme-row { display: flex; flex-wrap: wrap; gap: 7px; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}
.theme-chip b { color: var(--green); font-size: 12px; }
.insight-sug {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border-radius: 12px;
  background: var(--green-soft, rgba(30,111,83,.09)); color: var(--ink);
  font-size: 14px; line-height: 1.65;
}
.insight-sug svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 3px; color: var(--green); }

@media (max-width: 360px) {
  .capture-actions .btn { flex: 1 1 auto; }
}
