/* ==========================================================================
   拾光集 · 应用页样式（复用 style.css 的 :root token 与按钮）
   ========================================================================== */

.app-page { min-height: 100vh; }

/* 元素显隐统一交给 hidden 属性，避免被 display 规则覆盖 */
[hidden] { display: none !important; }

/* ── 登录 / 注册 ───────────────────────────────────────── */
.auth {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 64px) 18px;
}
.auth-card {
  width: min(430px, 100%);
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(420px 200px at 85% -10%, rgba(232, 180, 115, 0.14), transparent 72%),
    rgba(255, 255, 255, 0.025);
  box-shadow: 0 50px 100px -60px #000;
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; }
.auth-lead { margin: 14px 0 20px; font-size: 13px; color: var(--muted); line-height: 1.8; }
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.auth-tabs button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.auth-tabs button.on {
  color: var(--paper);
  background: rgba(232, 180, 115, 0.12);
  box-shadow: inset 0 0 0 1px rgba(232, 180, 115, 0.28);
}
.auth-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.field > span { letter-spacing: 0.04em; }
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { height: 64px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: #6f6860; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(232, 180, 115, 0.5);
  box-shadow: 0 0 0 3px rgba(232, 180, 115, 0.12);
}
.field select option { background: #14110e; color: var(--paper); }
.auth-error { min-height: 17px; margin: 0; font-size: 12px; line-height: 1.5; color: #e08b6a; }
.auth-submit { width: 100%; }
.auth-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.auth-back { color: var(--muted); }
.auth-back:hover { color: var(--paper); }

/* ── 应用外壳 ───────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 60%);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.aside-brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px; }
.aside-nav { display: flex; flex-direction: column; gap: 2px; }
.aside-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.aside-nav button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}
.aside-nav button:hover { color: var(--paper); background: rgba(255, 255, 255, 0.035); }
.aside-nav button.on {
  color: var(--paper);
  background: linear-gradient(90deg, rgba(232, 180, 115, 0.14), rgba(232, 180, 115, 0.02));
  border-color: rgba(232, 180, 115, 0.22);
}
.aside-nav button.on svg { color: var(--gold); opacity: 1; }
.aside-nav button .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #6b645b;
}
.aside-label {
  margin: 14px 11px 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: #6b645b;
}
.aside-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--line);
}
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--paper-dim); }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, #e8b473, #8a5f33);
  color: #22160a;
  font-size: 11px;
  font-weight: 700;
}
.aside-foot .icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.main { min-width: 0; padding: 26px clamp(16px, 3.4vw, 40px) 64px; }
.main-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.main-top h1 { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 1.95rem); }
.main-top p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.main-actions { display: flex; gap: 8px; }
.view { display: grid; gap: 14px; max-width: 1060px; }

/* ── 卡片 / 磁贴 ────────────────────────────────────────── */
.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.035), rgba(255, 250, 242, 0.012));
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--paper-dim);
}
.card-h small { font-size: 11.5px; color: #7f776d; }
.card-h a { font-size: 12px; color: var(--gold); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
}
.tile b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.15;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.tile b em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 2px; }
.tile span { display: block; margin-top: 2px; font-size: 11.5px; letter-spacing: 0.04em; color: var(--muted); }

/* ── 随手记 ─────────────────────────────────────────────── */
.quick { display: flex; gap: 8px; }
.quick .input { flex: 1; }
.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: #6f6860; }
.input:focus {
  outline: none;
  border-color: rgba(232, 180, 115, 0.5);
  box-shadow: 0 0 0 3px rgba(232, 180, 115, 0.12);
}
.quick-hint { margin-top: 9px; font-size: 11.5px; color: #7f776d; }

/* ── 记录列表 ───────────────────────────────────────────── */
.record {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(243, 236, 226, 0.07);
}
.record:last-child { border-bottom: 0; padding-bottom: 0; }
.record:first-child { padding-top: 0; }
.record-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid rgba(232, 180, 115, 0.16);
  border-radius: 9px;
  background: rgba(232, 180, 115, 0.08);
  color: var(--gold);
}
.record-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 13.5px; color: var(--paper); }
.record-note { margin-top: 2px; font-size: 11.5px; line-height: 1.7; color: var(--muted); overflow-wrap: anywhere; }
.record-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
  font-size: 11px;
  color: #7f776d;
  white-space: nowrap;
}
.record-meta b { font-size: 12.5px; font-weight: 500; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.record-meta b.in { color: #9ccfa9; }
.record-del {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 2px 0 0 2px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: #6b645b;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.record-del svg { width: 13px; height: 13px; margin: 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; }
.record:hover .record-del,
.record-del:focus-visible { opacity: 1; }
.record-del:hover { color: #e08b6a; border-color: rgba(224, 139, 106, 0.35); }

/* ── 过滤胶囊 ───────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip-btn:hover { color: var(--paper); }
.chip-btn.on {
  color: var(--paper);
  border-color: rgba(232, 180, 115, 0.4);
  background: rgba(232, 180, 115, 0.1);
}

/* ── 图表 ───────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 132px; }
.bars i {
  flex: 1;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #e8b473, rgba(232, 180, 115, 0.14));
}
.bars i.zero { background: rgba(243, 236, 226, 0.07); }
.bars-labels { display: flex; gap: 6px; margin-top: 7px; font-size: 9.5px; color: #6b645b; }
.bars-labels span { flex: 1; text-align: center; }

.dist { display: grid; gap: 10px; }
.dist-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
  color: var(--paper-dim);
}
.dist-row .track { height: 6px; border-radius: 3px; background: rgba(243, 236, 226, 0.07); overflow: hidden; }
.dist-row .track i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #c2884a, #f3cd8c); }
.dist-row b { font-weight: 500; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* ── 模块视图中的新增表单 ───────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.empty { padding: 38px 18px; text-align: center; }
.empty b { display: block; margin-bottom: 6px; font-size: 15px; color: var(--paper); }
.empty p { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.empty .btn { margin-top: 14px; }

.two-col { display: grid; grid-template-columns: 1.25fr minmax(0, 1fr); gap: 14px; align-items: start; }

/* ── toast ──────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  padding: 11px 18px;
  border: 1px solid rgba(232, 180, 115, 0.32);
  border-radius: 999px;
  background: rgba(20, 17, 14, 0.96);
  color: var(--paper);
  font-size: 13px;
  box-shadow: 0 24px 60px -24px #000;
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.app-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── 搜索 ───────────────────────────────────────────────── */
.search-row { position: relative; margin: 2px 0 12px; }
.search-row > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
}
.search-row .input { padding-left: 34px; }

/* ── 记录上的编辑 / AI 标记 ────────────────────────────── */
.record-edit {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 2px 0 0 2px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: #6b645b;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.record-edit svg { width: 13px; height: 13px; margin: 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; }
.record:hover .record-edit,
.record-edit:focus-visible { opacity: 1; }
.record-edit:hover { color: var(--gold); border-color: rgba(232, 180, 115, 0.35); }
.record:hover .record-del { opacity: 1; }

.src-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid rgba(232, 180, 115, 0.3);
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--gold);
  vertical-align: 1px;
}
.ai-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: #8fc9a0;
  box-shadow: 0 0 0 3px rgba(143, 201, 160, 0.12);
  vertical-align: 1px;
}

/* ── 年度报告 ───────────────────────────────────────────── */
.year-bar { display: flex; align-items: center; gap: 12px; padding: 4px 2px 10px; }
.year-bar b {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--paper);
}
.year-bar small { margin-left: 2px; font-size: 12px; color: var(--muted); }
.year-bar .icon-btn:first-of-type svg { transform: rotate(180deg); }

.top-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(243, 236, 226, 0.07);
}
.top-row:last-child { border-bottom: 0; padding-bottom: 0; }
.top-row .num {
  width: 32px;
  flex: none;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2;
  color: var(--gold);
}
.top-row b { display: block; font-size: 13px; font-weight: 500; color: var(--paper); }
.top-row small { font-size: 11px; color: var(--muted); }

/* ── 成就墙 ─────────────────────────────────────────────── */
.ach-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ach {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.ach.on {
  border-color: rgba(232, 180, 115, 0.4);
  background:
    radial-gradient(220px 120px at 20% 0%, rgba(232, 180, 115, 0.16), transparent 70%),
    rgba(232, 180, 115, 0.04);
}
.ach-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: #5f584f;
}
.ach.on .ach-ico { color: var(--gold); border-color: rgba(232, 180, 115, 0.3); background: rgba(232, 180, 115, 0.1); }
.ach-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.ach b { font-size: 13.5px; font-weight: 500; color: var(--paper-dim); }
.ach.on b { color: var(--paper); }
.ach p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.ach .track { height: 4px; margin-top: 2px; border-radius: 2px; background: rgba(243, 236, 226, 0.08); overflow: hidden; }
.ach .track i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #c2884a, #f3cd8c); }
.ach small { font-size: 10px; color: #6b645b; }

/* ── 设置 ───────────────────────────────────────────────── */
.setting-desc { margin: 0 0 14px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.settings-form { display: grid; gap: 12px; margin-bottom: 16px; }
.settings-form:last-child { margin-bottom: 0; }
.settings-form + .settings-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(243, 236, 226, 0.1);
}
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--paper-dim);
  cursor: pointer;
}
.check input { width: 15px; height: 15px; accent-color: #e8b473; }
.form-hint { min-height: 1.3em; margin: 0; font-size: 11.5px; line-height: 1.7; color: #7f776d; }

/* ── 编辑弹窗 ───────────────────────────────────────────── */
.edit-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #100e0c;
  color: var(--paper-dim);
  box-shadow: 0 60px 120px -50px #000;
}
.edit-dialog::backdrop { background: rgba(6, 5, 4, 0.72); backdrop-filter: blur(3px); }
.edit-form { display: grid; gap: 12px; padding: 20px; }
.edit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.edit-head h2 { font-family: var(--font-display); font-size: 18px; color: var(--paper); }
.edit-head svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 1080px) {
  .ach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* ── 手机底部导航 / 悬浮按钮 ───────────────────────────── */
.tabbar,
.fab { display: none; }

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding: 6px 10px env(safe-area-inset-bottom, 0px);
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(10, 9, 8, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #7f776d;
  font-size: 10px;
  cursor: pointer;
}
.tabbar button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar button.on { color: var(--gold); }
.tabbar-gap { display: block; }

.fab {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 45;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #f6d3a0, #e3a961);
  color: #221505;
  box-shadow: 0 16px 36px -12px rgba(232, 180, 115, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  cursor: pointer;
}
.fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fab:active { transform: translateX(-50%) scale(0.94); }

/* ── 快捷记录 chips ─────────────────────────────────────── */
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.home-quick button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--paper-dim);
  font-size: 12px;
  cursor: pointer;
}
.home-quick button:hover { border-color: rgba(232, 180, 115, 0.35); color: var(--paper); }
.home-quick svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.module-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.module-chips button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.module-chips button.on { color: var(--paper); border-color: rgba(232, 180, 115, 0.45); background: rgba(232, 180, 115, 0.12); }
.module-chips svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* ── 标签 ───────────────────────────────────────────────── */
.tag {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 1px 7px;
  border: 1px solid rgba(232, 180, 115, 0.25);
  border-radius: 999px;
  font-size: 10px;
  color: #c9b48f;
  cursor: pointer;
}
.tag:hover { border-color: rgba(232, 180, 115, 0.5); color: var(--gold-hi); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.tag-cloud button.on { color: var(--paper); border-color: rgba(232, 180, 115, 0.45); background: rgba(232, 180, 115, 0.1); }

/* ── 热力图 ─────────────────────────────────────────────── */
.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-columns: 1fr;
  gap: 3px;
  max-width: 520px;
  margin: 4px auto 0;
}
.heatmap i { display: block; aspect-ratio: 1; border-radius: 2px; background: rgba(243, 236, 226, 0.05); }
.heatmap i.l1 { background: rgba(232, 180, 115, 0.22); }
.heatmap i.l2 { background: rgba(232, 180, 115, 0.45); }
.heatmap i.l3 { background: rgba(232, 180, 115, 0.68); }
.heatmap i.l4 { background: rgba(232, 180, 115, 0.95); }
.heat-legend { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; font-size: 10px; color: #6b645b; }
.heat-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ── 趋势图 ─────────────────────────────────────────────── */
.trend-chart { width: 100%; height: 132px; display: block; }
.trend-empty { padding: 26px 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ── 待办 / 小列表 ──────────────────────────────────────── */
.todo-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px dashed rgba(243, 236, 226, 0.07); }
.todo-row:last-child { border-bottom: 0; }
.todo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.todo-row.overdue .todo-dot { background: #e08b6a; }
.todo-main { flex: 1; min-width: 0; font-size: 12.5px; color: var(--paper-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-day { font-size: 11px; color: #7f776d; white-space: nowrap; }
.todo-row.overdue .todo-day { color: #e08b6a; }

.mini-top { display: grid; gap: 8px; }
.mini-top .row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--paper-dim); }
.mini-top .row b { font-family: var(--font-mono); font-size: 11px; color: var(--gold); flex: none; }
.mini-top .row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-top .row em { font-style: normal; font-size: 11px; color: #7f776d; }

/* ── toast 操作按钮 ─────────────────────────────────────── */
.toast-action {
  margin-left: 12px;
  padding: 2px 8px;
  border: 1px solid rgba(232, 180, 115, 0.45);
  border-radius: 999px;
  background: rgba(232, 180, 115, 0.12);
  color: var(--gold-hi);
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .tabbar { display: grid; }
  .fab { display: grid; }
  body.app-page { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .aside { display: none; }
  .shell { display: block; }
}

.record-tags { margin-top: 4px; line-height: 1; }

@media (max-width: 860px) {
  .main {
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .main-top { margin-bottom: 16px; }
  .aside { display: none; }
}

/* ── 响应式 ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .aside {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .aside-brand .brand-text i { display: none; }
  .aside-brand { padding: 0; flex: none; }
  .aside-nav {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .aside-nav::-webkit-scrollbar { display: none; }
  .aside-label { display: none; }
  .module-nav { display: flex; gap: 2px; }
  .aside-nav button { width: auto; flex: none; padding: 8px 10px; white-space: nowrap; }
  .aside-nav button .count { display: none; }
  .aside-foot { margin: 0; padding: 0; border: 0; flex: none; }
  .aside-foot .user-chip span:last-child { display: none; }
  .main { padding: 18px 16px 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .main-top { flex-direction: column; align-items: flex-start; }
  .quick { flex-direction: column; }
  .quick .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .record-meta { font-size: 10.5px; }
  .record { gap: 9px; }
  .auth-card { padding: 20px; }
  .app-toast { width: max-content; max-width: calc(100vw - 36px); text-align: center; }
}
