/* ============ 设计变量 ============ */
:root {
  --bg: #f6f1e9;
  --bg-deco: radial-gradient(900px 480px at 12% -10%, #fdf8ef 0%, transparent 60%),
              radial-gradient(700px 420px at 100% 0%, #f0e8dc 0%, transparent 55%);
  --surface: #fffdf9;
  --surface-2: #faf5ec;
  --ink: #2b2622;
  --ink-2: #524a43;
  --muted: #8d8177;
  --faint: #b3a89d;
  --line: #e7ddcf;
  --line-strong: #d8cbbb;
  --accent: #b0523a;
  --accent-ink: #fff7f2;
  --accent-soft: #f6e3da;
  --danger: #b23b3b;
  --ok: #2f7d5d;
  --shadow-sm: 0 1px 2px rgba(70, 52, 32, 0.05), 0 2px 8px rgba(70, 52, 32, 0.04);
  --shadow-md: 0 10px 30px rgba(70, 52, 32, 0.10), 0 2px 8px rgba(70, 52, 32, 0.05);
  --shadow-lg: 0 24px 70px rgba(50, 36, 20, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513;
    --bg-deco: radial-gradient(900px 480px at 10% -10%, #221e1a 0%, transparent 60%),
                radial-gradient(700px 420px at 100% 0%, #1e1a17 0%, transparent 55%);
    --surface: #211d19;
    --surface-2: #1b1815;
    --ink: #efe7dc;
    --ink-2: #cfc5b8;
    --muted: #9c9187;
    --faint: #6f655c;
    --line: #332d27;
    --line-strong: #453d35;
    --accent: #d47a58;
    --accent-ink: #241512;
    --accent-soft: #3a241d;
    --danger: #e07373;
    --ok: #6fbf98;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image: var(--bg-deco);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--ink); }

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 28px 80px;
}

/* ============ 顶栏 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #c0674a, #8f402b);
  color: #fff8f2;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  padding-top: 2px;
  box-shadow: 0 8px 18px rgba(150, 70, 45, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  user-select: none;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.14em;
  font-weight: 600;
  line-height: 1.2;
}

.brand-text p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.ai-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 18%, transparent);
}

.ai-badge.on::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.ai-badge.local::before { background: #c99a3c; box-shadow: 0 0 0 3px rgba(201, 154, 60, 0.18); }
.ai-badge.busy::before { animation: pulse 1.1s ease-in-out infinite; background: var(--accent); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--ink-2);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(8px);
}

.icon-btn:hover { background: var(--surface); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.96); }

.current-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 170px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.current-user:hover { border-color: var(--line-strong); background: var(--surface-2); }

.user-avatar {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-time { color: var(--faint); margin-right: 8px; }
.composer-hint { color: var(--faint); }

@media (max-width: 720px) {
  .current-user { max-width: 42px; padding: 4px; }
  .current-user .user-name { display: none; }
}

#logoutTopBtn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

.icon-btn.labeled {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ============ 布局 ============ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 30px;
  align-items: start;
}

.main-col { min-width: 0; }
.side-col {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 24px;
}

/* ============ 输入卡片 ============ */
.composer {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 14px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 40%);
  opacity: 0.35;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent), var(--shadow-md);
}

#composerInput {
  width: 100%;
  min-height: 66px;
  max-height: 320px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

#composerInput::placeholder { color: var(--faint); }

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  margin-top: 6px;
}

.hint {
  color: var(--faint);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

kbd {
  font-family: var(--sans);
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
  color: var(--muted);
}

.composer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-count {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: right;
}

.primary-btn {
  height: 38px;
  padding: 0 20px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: linear-gradient(160deg, #bd5d40, #9d452c);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px rgba(150, 70, 45, 0.24);
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.primary-btn:hover { box-shadow: 0 8px 22px rgba(150, 70, 45, 0.3); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }

.primary-btn .spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.ghost-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ghost-btn:hover { background: var(--surface-2); border-color: var(--muted); }

.danger-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: transparent;
  color: var(--danger);
  font-size: 13.5px;
}

.danger-btn:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 6px;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  --cat: var(--muted);
  height: 30px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat);
  opacity: 0.85;
}

.chip .n {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.chip:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }

.chip.active {
  background: color-mix(in srgb, var(--cat) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--cat) 45%, var(--line));
  color: var(--cat);
  font-weight: 600;
}

.chip.active .n { color: color-mix(in srgb, var(--cat) 70%, var(--faint)); }

.chip[data-cat="all"] { --cat: var(--ink-2); }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--faint);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search:focus-within { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--surface); }

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
  width: 128px;
  color: var(--ink);
}

.search input::placeholder { color: var(--faint); }

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-pill:hover { border-color: var(--line-strong); }
.check-pill input { accent-color: var(--accent); width: 14px; height: 14px; margin: 0; }
.check-pill:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent); }

/* ============ 时间线 ============ */
.timeline { margin-top: 18px; }

.day-group { margin-bottom: 26px; }

.day-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 11px 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.day-head .day-title {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  font-weight: 600;
}

.day-head .day-sub { color: var(--faint); font-size: 11.5px; letter-spacing: 0.04em; }

.day-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.note {
  --cat: var(--faint);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 15px 17px 14px 19px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.note.note-enter { animation: card-in 0.3s ease both; }

.note.note-pinned {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.note.note-pinned::before { opacity: 1; }

.mini-btn.pin.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.mini-btn.share.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.pinned-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  line-height: 1.6;
  white-space: nowrap;
}

.pinned-badge svg { width: 10px; height: 10px; }

.pinned-group .day-title { color: var(--accent); }

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

.note:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }

.note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cat);
  opacity: 0.75;
}

.note-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11.5px;
}

.note-time { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }

.cat-tag {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cat) 11%, transparent);
  color: color-mix(in srgb, var(--cat) 82%, var(--ink));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.cat-tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.note-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.03em;
}

.note-status .spinner {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

.note-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
  opacity: 0.72;
  transition: opacity 0.15s ease;
}

.composer-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 2px 2px;
}

.pending-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  overflow: hidden;
}

.pending-file small { color: var(--faint); }
.pending-file button {
  border: 0;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: inherit;
  padding: 0 1px;
}
.pending-file button:hover { color: var(--danger); }

.note:hover .note-actions, .note:focus-within .note-actions { opacity: 1; }

.mini-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  transition: background 0.14s ease, color 0.14s ease;
}

.mini-btn:hover { background: var(--surface-2); color: var(--ink-2); }
.mini-btn.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }

.note-text {
  font-size: 15px;
  line-height: 1.78;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.01em;
}

.note-text .hl { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 3px; padding: 0 1px; }

.note-text .inline-image {
  display: block;
  max-width: 100%;
  max-height: 460px;
  margin: 12px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.note-text .inline-image-missing { color: var(--faint); font-size: 12px; }

.note-text a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-all;
}

.note-text a:hover { color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }

.note-summary {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.note-summary svg { flex: none; margin-top: 3px; opacity: 0.6; }

.note-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.tag::before { content: "#"; color: var(--faint); margin-right: 2px; }

.mood {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mood .m-dot { width: 5px; height: 5px; border-radius: 50%; }
.mood.positive .m-dot { background: #4c9a76; }
.mood.neutral .m-dot { background: #b0a496; }
.mood.negative .m-dot { background: #c26a6a; }

.todo-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-2));
  border: 1px dashed color-mix(in srgb, var(--accent) 26%, var(--line));
}

.todo-line input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
  flex: none;
}

.todo-line .todo-title {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.todo-line .todo-due { font-size: 11px; color: var(--accent); margin-left: auto; white-space: nowrap; }

.todo-line.done .todo-title { text-decoration: line-through; color: var(--faint); }

/* 空状态 */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty-mark {
  font-family: var(--serif);
  font-size: 44px;
  color: var(--line-strong);
  margin-bottom: 10px;
}

.empty h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.08em; }
.empty p { margin: 0; font-size: 13px; color: var(--faint); }

/* ============ 侧栏 ============ */
.panel {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

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

.panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.panel-sub { color: var(--faint); font-size: 11px; letter-spacing: 0.04em; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.stat strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat span { font-size: 10.5px; color: var(--faint); letter-spacing: 0.06em; }

.dist-bars { display: grid; gap: 9px; }

.dist-row { display: grid; grid-template-columns: 40px 1fr 22px; align-items: center; gap: 8px; }

.dist-name { font-size: 11.5px; color: var(--ink-2); letter-spacing: 0.04em; }

.dist-track {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--cat);
  opacity: 0.8;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.dist-n { font-size: 11px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }

.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.todo-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  cursor: pointer;
}

.todo-item input { width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.todo-item.done span { text-decoration: line-through; color: var(--faint); }

.side-empty { color: var(--faint); font-size: 12px; padding: 2px 0; }

.ai-panel {
  display: flex;
  gap: 13px;
  align-items: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

.ai-orb {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 140deg, #c9754f, #d9a441, #6fa98c, #7d8fc4, #c9754f);
  filter: blur(0.4px);
  opacity: 0.8;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.45), 0 4px 14px rgba(150, 100, 60, 0.2);
}

.ai-panel h2 { font-size: 13px; margin-bottom: 4px; }
.ai-panel p { margin: 0 0 9px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.ai-panel .ghost-btn { height: 29px; padding: 0 11px; font-size: 11.5px; border-radius: 8px; }

/* ============ 弹窗 ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(40, 30, 22, 0.42);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fade 0.16s ease both;
}

.modal-backdrop[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.close-btn { width: 30px; height: 30px; border: 0; background: transparent; color: var(--faint); font-size: 14px; }
.close-btn:hover { background: var(--surface-2); }

.modal-body { padding: 14px 20px 6px; display: grid; gap: 13px; }

.modal-note { margin: 0 0 2px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.modal-note code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 11px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 9px 11px;
  font-size: 13.5px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}

.field textarea { resize: vertical; line-height: 1.7; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-hint { font-style: normal; font-size: 11.5px; color: var(--faint); }

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 11.5px;
  color: var(--danger);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover { opacity: 0.75; }

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}

.check-row input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

.test-result {
  font-size: 12px;
  line-height: 1.6;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.test-result.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.test-result.err { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px 18px;
}

.modal-foot-right { display: flex; gap: 9px; }

/* ============ 提示 ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(440px, calc(100vw - 36px));
  background: #2e2823;
  color: #f7f0e6;
  font-size: 13px;
  line-height: 1.55;
  padding: 11px 18px;
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.22s ease both;
}

.toast[hidden] { display: none; }
.toast.err { background: #8f2f2f; color: #fff2f0; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============ 登录页 ============ */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}

.auth-shell { width: 100%; max-width: 400px; }

.auth-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 26px 20px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}

.auth-brand .brand-mark { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
.auth-brand h1 { margin: 0; font-family: var(--serif); font-size: 21px; letter-spacing: 0.14em; }
.auth-brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: 0.05em; }

.auth-head h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.auth-head p { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.auth-form { display: grid; gap: 12px; }

.auth-hint { margin: -2px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.5; }

.auth-error {
  margin: 0;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.5;
}

.auth-submit { width: 100%; height: 42px; margin-top: 4px; justify-content: center; }

.auth-foot { margin: 18px 0 0; text-align: center; font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em; }

.wechat-box { margin-top: 4px; }

.wechat-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--faint);
  font-size: 11px;
}

.wechat-divider::before,
.wechat-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.wechat-btn {
  width: 100%;
  height: 42px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, #07c160 35%, var(--line));
  background: color-mix(in srgb, #07c160 8%, var(--surface));
  color: color-mix(in srgb, #07c160 70%, var(--ink));
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.wechat-btn:hover { background: color-mix(in srgb, #07c160 13%, var(--surface)); }
.wechat-btn:active { transform: translateY(1px); }

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.social-btn {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.social-btn:hover { background: var(--surface); border-color: var(--line-strong); }

.social-bind-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.social-bind-grid .social-btn { height: 32px; font-size: 11.5px; }
.social-bind-grid .social-btn.bound { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); color: var(--accent); }

.admin-users { display: grid; gap: 6px; max-height: 190px; overflow: auto; }

.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
}

.admin-user small { color: var(--faint); font-size: 10.5px; }

#settingsBtn { position: relative; }

.pending-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}

.pending-notice {
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--danger);
  font-size: 12px;
}

.admin-user.is-pending {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: color-mix(in srgb, var(--danger) 5%, var(--surface-2));
}

.admin-user-main { display: grid; gap: 3px; min-width: 0; }

.admin-user-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.status-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.5;
}

.status-badge.pending {
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
}

.status-badge.disabled {
  color: var(--faint);
  border: 1px solid var(--line-strong);
}

.mini-btn {
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.mini-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.mini-btn:disabled { opacity: 0.5; cursor: default; }
.mini-btn.approve { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.mini-btn.reject { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

.note-assets { display: grid; gap: 8px; margin-top: 11px; }

.note-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.note-image {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  display: block;
}

.note-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
}

.note-file a {
  color: var(--ink-2);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-file a:hover { color: var(--accent); }
.note-file small { color: var(--faint); margin-left: auto; white-space: nowrap; }
.note-file .mini-btn { padding: 2px 6px; flex: none; }

/* ============ 账号区块 ============ */
.account-block {
  border-top: 1px dashed var(--line);
  padding-top: 13px;
  display: grid;
  gap: 10px;
}

.account-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.account-line strong { color: var(--ink-2); font-weight: 600; word-break: break-all; }

.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-actions .ghost-btn { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

.danger-text { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }

/* ============ 分类管理 ============ */
.cat-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.cat-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-strong) 35%, transparent);
}

.cat-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cat-info strong { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.cat-info small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cat-system {
  font-style: normal;
  font-size: 9.5px;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 400;
}

.cat-row-actions { display: flex; gap: 2px; }
.cat-row .mini-btn { opacity: 0.8; }

.cat-add-btn { width: 100%; }

.cat-form {
  display: grid;
  gap: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  margin-top: 2px;
}

.cat-form h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.cat-palette { display: flex; flex-wrap: wrap; gap: 8px; }

.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.swatch:hover { transform: translateY(-1px); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--c); }

.cat-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.manage-chip {
  border-style: dashed;
  color: var(--muted);
}

.manage-chip:hover { color: var(--ink-2); border-color: var(--muted); }

/* ============ 回顾页 ============ */
.view-nav {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(8px);
}

.view-btn {
  border: 0;
  background: transparent;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: background 0.15s ease, color 0.15s ease;
}

.view-btn:hover { color: var(--ink-2); }
.view-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.review { animation: fade 0.2s ease both; }

.review-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 22px;
  flex-wrap: wrap;
}

.review-title h2 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.review-title p { margin: 0; color: var(--muted); font-size: 13px; }

.period-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.period-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease;
}

.period-tab.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.review-main { display: grid; gap: 16px; min-width: 0; }
.review-side { display: grid; gap: 16px; }

.review-tools { display: flex; align-items: center; gap: 10px; }
.ghost-btn.tiny { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }

.report-body { display: grid; gap: 16px; }

.report-summary {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink);
  margin: 0;
}

.report-section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.report-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.report-list li {
  position: relative;
  padding-left: 15px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.report-list li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.65;
}

.report-list.todo li::before { background: var(--faint); }

.report-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.report-chip {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.report-foot {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.report-foot strong { color: var(--ink-2); font-weight: 600; }

.report-warning {
  font-size: 12px;
  padding: 8px 11px;
  border-radius: 8px;
  background: color-mix(in srgb, #c99a3c 9%, var(--surface));
  border: 1px solid color-mix(in srgb, #c99a3c 28%, var(--line));
  color: color-mix(in srgb, #8a6420 65%, var(--ink));
  line-height: 1.6;
}

.report-empty { color: var(--muted); font-size: 13px; line-height: 1.8; }

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), color-mix(in srgb, var(--line) 60%, var(--surface-2)), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.skeleton-line.short { width: 62%; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* 问答 */
.ask-form { display: flex; gap: 8px; }
.ask-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 0 12px;
  font-size: 13.5px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ask-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}

.ask-result { margin-top: 14px; display: grid; gap: 12px; }
.ask-text { margin: 0; font-size: 14px; line-height: 1.8; color: var(--ink); white-space: pre-wrap; }
.ask-note { margin: 0; font-size: 12px; color: var(--faint); }

.ask-sources { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }

.ask-source {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  border: 0;
  background: transparent;
  padding: 4px 0;
  line-height: 1.55;
}

.ask-source:hover { color: var(--ink-2); }
.ask-source time { font-variant-numeric: tabular-nums; color: var(--faint); }
.ask-source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 今日清单 */
.todo-plan { display: grid; gap: 4px; }

.plan-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 9px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

.plan-item:last-child { border-bottom: 0; }
.plan-item input { width: 15px; height: 15px; margin: 4px 0 0; accent-color: var(--accent); cursor: pointer; }
.plan-title { font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.plan-why { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.plan-badge {
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.plan-advice {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--surface-2);
}

/* 情绪曲线 */
.mood-chart svg { width: 100%; height: auto; display: block; }
.mood-legend { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--faint); margin-top: 6px; }
.mood-empty { color: var(--faint); font-size: 12px; padding: 14px 0; text-align: center; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; }
.cloud-tag {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 9px;
  line-height: 1.5;
}
.cloud-tag small { color: var(--faint); margin-left: 3px; font-size: 9.5px; }

/* 悬而未决 */
.loose-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

.loose-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.loose-item time { display: block; font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em; }
.loose-item span {
  display: block;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.loose-item:hover span { color: var(--accent); }

/* 历史上的今天 */
.on-this-day { display: grid; gap: 10px; }
.otd-item { font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.otd-item strong { display: block; font-size: 10.5px; color: var(--faint); font-weight: 500; letter-spacing: 0.06em; margin-bottom: 2px; }

.modal-foot-left { display: flex; gap: 8px; }

/* ============ 响应式 ============ */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-col { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-panel { grid-column: 1 / -1; }
  .review-grid { grid-template-columns: minmax(0, 1fr); }
  .review-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app { padding: 18px 14px 60px; }
  .topbar { margin-bottom: 18px; gap: 8px; }
  .brand-mark { width: 40px; height: 40px; font-size: 21px; border-radius: 12px; }
  .brand-text h1 { font-size: 22px; }
  .brand-text p { display: none; }
  .ai-badge { font-size: 11px; padding: 0 10px; height: 30px; }
  .view-btn { padding: 6px 10px; font-size: 12.5px; }
  .composer { padding: 16px 16px 12px; border-radius: 15px; }
  #composerInput { font-size: 16px; min-height: 56px; }
  .hint { display: none; }
  .toolbar { gap: 10px; margin-top: 18px; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .toolbar-right { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .side-col { grid-template-columns: minmax(0, 1fr); }
  .note-actions { opacity: 1; }
  .modal { border-radius: 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot-right { margin-left: auto; }

  .review-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .review-title h2 { font-size: 21px; }
  .review-side { grid-template-columns: minmax(0, 1fr); }
  .review-tools { gap: 7px; }
  .period-tab { padding: 6px 11px; }
  .ask-form input { height: 38px; }
  .ask-source { grid-template-columns: 58px 1fr; }
}

@media (max-width: 560px) {
  .ai-badge { display: none; }
  .icon-btn.labeled { padding: 0 9px; }
  .icon-btn.labeled span { display: none; }
}
