/* ==========================================================
 * 句集 · 样式系统
 * 浅色 = 宣纸 / 深色 = 墨夜，主色朱砂
 * ========================================================== */

:root {
  --bg: #F6F2EA;
  --surface: #FFFDF8;
  --surface-2: #F1EAE0;
  --ink: #221D16;
  --ink-2: #5C5448;
  --ink-3: #918778;
  --line: #E7DFD1;
  --line-2: #D8CEBC;
  --accent: #A8443A;
  --accent-soft: #F5E3DF;
  --gold: #B0842F;
  --shadow-sm: 0 1px 2px rgba(60,45,25,.05), 0 2px 10px rgba(60,45,25,.05);
  --shadow-md: 0 2px 6px rgba(60,45,25,.06), 0 14px 34px rgba(60,45,25,.08);
  --radius: 18px;
  --radius-sm: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #12100E;
  --surface: #1C1917;
  --surface-2: #262120;
  --ink: #EDE6DA;
  --ink-2: #B3A897;
  --ink-3: #7E7466;
  --line: #2E2A26;
  --line-2: #3B3530;
  --accent: #C96A5B;
  --accent-soft: #3B2724;
  --gold: #C79A4A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,.45), 0 16px 40px rgba(0,0,0,.4);
}

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

html, body {
  margin: 0; padding: 0;
  background: #E9E3D8;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
html[data-theme="dark"], html[data-theme="dark"] body { background: #0A0908; }

body { overscroll-behavior-y: none; }

button { font-family: inherit; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
input, textarea, select { font-family: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

.ico { width: 22px; height: 22px; display: block; }
.ico.sm { width: 18px; height: 18px; }

/* ---------------- 应用外壳 ---------------- */
#app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 30px 80px rgba(40,30,15,.12);
  overflow: hidden;
}

/* ---------------- 顶栏 ---------------- */
#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: #FFF9F2;
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(168,68,58,.28);
}
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: .12em; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: .16em; margin-left: 2px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .18s, color .18s;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.on { color: var(--accent); }

/* ---------------- 视图 ---------------- */
#views { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(84px + var(--safe-b)); }
.page { padding: 4px 20px 20px; animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 0 12px;
}
.sec-title { font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.sec-title .en { font-family: var(--sans); font-size: 10px; color: var(--ink-3); letter-spacing: .18em; margin-left: 7px; font-weight: 400; }
.sec-more { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 2px; }
.sec-more .ico { width: 14px; height: 14px; }

/* ---------------- 每日一句 ---------------- */
.hero-date { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.hero-date .d { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; }
.hero-date .m { font-size: 12px; color: var(--ink-3); line-height: 1.5; letter-spacing: .06em; }

.daily {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px 18px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.daily::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 0 3px 3px 0;
}
.daily-mark {
  position: absolute; right: 14px; top: -10px;
  font-family: var(--serif); font-size: 120px; line-height: 1;
  color: var(--accent); opacity: .07; pointer-events: none;
}
.daily-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; letter-spacing: .2em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 14px;
}
.daily-text {
  font-family: var(--serif);
  font-size: 22px; line-height: 1.82; letter-spacing: .02em;
  color: var(--ink); font-weight: 500;
  position: relative; z-index: 1;
}
.daily-meta {
  margin-top: 14px; font-size: 12px; color: var(--ink-3); letter-spacing: .04em;
}
.daily-acts {
  display: flex; gap: 8px; margin-top: 18px;
  padding-top: 14px; border-top: 1px dashed var(--line-2);
}
.act-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; border-radius: 11px;
  font-size: 13px; color: var(--ink-2);
  background: var(--surface-2);
  transition: transform .14s, background .18s, color .18s;
}
.act-btn:active { transform: scale(.96); }
.act-btn.on { color: var(--accent); background: var(--accent-soft); }

/* ---------------- 打卡 ---------------- */
.checkin-card {
  margin-top: 14px;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.ck-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.ck-fire {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #F6E0D6, #F1D2C4);
  color: #B4532F;
}
html[data-theme="dark"] .ck-fire { background: linear-gradient(140deg, #3E2620, #35211C); color: #D98A63; }
.ck-fire .ico { width: 22px; height: 22px; }
.ck-num { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.1; }
.ck-num small { font-size: 11px; font-family: var(--sans); color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.ck-sub { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.ck-btn {
  height: 36px; padding: 0 16px; border-radius: 11px;
  background: var(--accent); color: #FFF9F2;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  box-shadow: 0 4px 12px rgba(168,68,58,.25);
  transition: transform .14s, opacity .2s;
}
.ck-btn:active { transform: scale(.95); }
.ck-btn.done { background: var(--surface-2); color: var(--ink-3); box-shadow: none; }

/* ---------------- 分类 ---------------- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat-tile {
  position: relative; text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
  transition: transform .16s, box-shadow .2s;
}
.cat-tile:active { transform: scale(.97); }
.cat-tile .ct-ico {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 12px;
}
.cat-tile .ct-ico .ico { width: 19px; height: 19px; }
.cat-tile .ct-name { font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.cat-tile .ct-desc { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.cat-tile .ct-count {
  position: absolute; right: 14px; bottom: 12px;
  font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

/* ---------------- 句子卡片 ---------------- */
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  text-align: left; width: 100%;
  transition: transform .15s, border-color .2s;
  overflow: hidden;
}
.q-card:active { transform: scale(.985); }
/* 分类 / 标签色块：颜色由内联 --tc 给出，深浅两套主题各自算一次对比度。
 * 直接内联 color 的话，#4A6E6B 这类暗色在深色背景上会糊得看不清。 */
.q-card .q-cat {
  display: inline-block; font-size: 10px; letter-spacing: .1em;
  padding: 2px 8px; border-radius: 6px; margin-bottom: 9px;
  color: color-mix(in srgb, var(--tc, var(--ink-3)) 90%, var(--ink));
  background: color-mix(in srgb, var(--tc, var(--surface-2)) 13%, transparent);
}
html[data-theme="dark"] .q-card .q-cat {
  color: color-mix(in srgb, var(--tc, var(--ink-2)) 42%, #fff);
  background: color-mix(in srgb, var(--tc, var(--surface-2)) 26%, transparent);
}
.q-card .q-text {
  font-family: var(--serif); font-size: 16px; line-height: 1.78;
  color: var(--ink); letter-spacing: .01em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.q-card .q-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 11px; gap: 8px;
}
.q-card .q-meta { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-card .q-tags { display: flex; gap: 5px; flex-shrink: 0; }
.q-card .q-note {
  margin-top: 10px; padding: 9px 11px; border-radius: 9px;
  background: var(--surface-2); font-size: 12px; line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.q-note-label { color: var(--gold); font-size: 11px; margin-right: 4px; }

.tag-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  color: color-mix(in srgb, var(--tc, var(--ink-2)) 90%, var(--ink));
  background: color-mix(in srgb, var(--tc, var(--surface-2)) 13%, transparent);
  white-space: nowrap;
}
html[data-theme="dark"] .tag-chip {
  color: color-mix(in srgb, var(--tc, var(--ink-2)) 42%, #fff);
  background: color-mix(in srgb, var(--tc, var(--surface-2)) 26%, transparent);
}
/* 标签颜色小圆点：筛选栏与编辑器 chip 里用，颜色由 tagColor() 内联给出 */
.tag-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  display: inline-block; vertical-align: 1px;
  background: var(--tc, var(--ink-3));
}
html[data-theme="dark"] .tag-dot {
  background: color-mix(in srgb, var(--tc, var(--ink-3)) 45%, #fff);
}
.f-chip.on .tag-dot { box-shadow: 0 0 0 1.5px rgba(255,255,255,.55); }
.chip.tag-pill {
  font-weight: 500;
  color: color-mix(in srgb, var(--tc, var(--ink-2)) 90%, var(--ink));
  border-color: color-mix(in srgb, var(--tc, var(--line)) 30%, transparent);
  background: color-mix(in srgb, var(--tc, var(--surface-2)) 10%, transparent);
}
html[data-theme="dark"] .chip.tag-pill {
  color: color-mix(in srgb, var(--tc, var(--ink-2)) 42%, #fff);
  background: color-mix(in srgb, var(--tc, var(--surface-2)) 24%, transparent);
}
.fav-dot { color: var(--accent); display: flex; align-items: center; }
.fav-dot .ico { width: 15px; height: 15px; fill: currentColor; }

/* 横向推荐 */
.hscroll {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 20px 6px;
  margin: 0 -20px; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.rec-card {
  flex: 0 0 218px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  text-align: left; transition: transform .15s;
}
.rec-card:active { transform: scale(.97); }
.rec-why {
  font-size: 10px; color: var(--gold); letter-spacing: .04em;
  display: flex; align-items: center; gap: 4px; margin-bottom: 10px;
}
.rec-why .ico { width: 12px; height: 12px; }
.rec-text {
  font-family: var(--serif); font-size: 15px; line-height: 1.72;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 78px;
}
.rec-meta { font-size: 11px; color: var(--ink-3); margin-top: 10px; }

/* ---------------- 筛选条 ---------------- */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 12px; margin: 0 -20px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.f-chip {
  flex: 0 0 auto; height: 30px; padding: 0 14px; border-radius: 15px;
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s;
}
.f-chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
html[data-theme="dark"] .f-chip.on { background: var(--ink); color: #16130F; }

/* ---------------- 空状态 ---------------- */
.empty {
  text-align: center; padding: 54px 30px;
  color: var(--ink-3); font-size: 13px; line-height: 1.9;
}
.empty .e-ico {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
}
.empty .e-ico .ico { width: 26px; height: 26px; }
.empty b { display: block; font-family: var(--serif); font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }

/* ---------------- 悬浮按钮 ---------------- */
.fab {
  position: fixed; z-index: 40;
  left: 50%; margin-left: 148px;
  bottom: calc(96px + var(--safe-b));
  width: 54px; height: 54px; border-radius: 18px;
  background: var(--accent); color: #FFF9F2;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(168,68,58,.38);
  transition: transform .16s;
}
.fab:active { transform: scale(.92) rotate(90deg); }
.fab .ico { width: 26px; height: 26px; stroke-width: 2; }

/* ---------------- 底部导航 ---------------- */
#tabbar {
  position: sticky; bottom: 0; z-index: 35;
  display: flex; align-items: stretch;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 0; color: var(--ink-3);
  transition: color .18s;
}
.tab .ico { width: 21px; height: 21px; }
.tab span { font-size: 10px; letter-spacing: .04em; }
.tab.on { color: var(--accent); }
.tab.on .ico { stroke-width: 2; }

/* ---------------- 统计 ---------------- */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 12px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.kpi b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi span { font-size: 11px; color: var(--ink-3); margin-top: 5px; display: block; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.donut-wrap { position: relative; width: 168px; height: 168px; margin: 6px auto 4px; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.donut-center b { font-family: var(--serif); font-size: 30px; font-weight: 700; }
.donut-center span { font-size: 10px; color: var(--ink-3); letter-spacing: .14em; margin-top: 2px; }

.legend { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.lg-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.lg-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.lg-name { flex: 1; }
.lg-val { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }

.weekbars { display: flex; gap: 6px; align-items: flex-end; height: 92px; margin-top: 6px; }
.wb-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.wb-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.wb-bar i {
  display: block; width: 60%; max-width: 26px; border-radius: 8px;
  background: var(--line-2); transition: height .4s cubic-bezier(.2,.8,.2,1);
}
.wb-item.on .wb-bar i { background: linear-gradient(180deg, var(--accent), #C9705F); }
.wb-label { font-size: 10px; color: var(--ink-3); margin-top: 7px; }
.wb-item.on .wb-label { color: var(--accent); }

.hbars { display: flex; flex-direction: column; gap: 11px; }
.hb-row { display: flex; align-items: center; gap: 10px; }
.hb-label { width: 62px; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.hb-val { width: 22px; text-align: right; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.chart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; color: var(--ink-3); font-size: 12px;
}
.chart-empty span { position: absolute; }
.chart-empty.small { height: 60px; }

/* ---------------- 我的 ---------------- */
.profile {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.avatar {
  width: 56px; height: 56px; border-radius: 19px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--accent); color: #FFF9F2;
  font-family: var(--serif); font-size: 24px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(168,68,58,.28);
}
.p-name { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.p-bio { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }

.row-group {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; width: 100%; text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background .16s;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--surface-2); }
.row .r-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; }
.row .r-ico .ico { width: 16px; height: 16px; }
.row .r-label { flex: 1; font-size: 13.5px; }
.row .r-val { font-size: 12px; color: var(--ink-3); }
.row .r-chev { color: var(--ink-3); }
.row .r-chev .ico { width: 15px; height: 15px; }
.row.danger .r-label { color: var(--accent); }

/* ---------------- 回收站 ---------------- */
.tr-tip {
  font-size: 11.5px; line-height: 1.8; color: var(--ink-3);
  background: var(--surface-2); border-radius: 11px;
  padding: 11px 13px; margin-bottom: 14px;
}
.tr-list { display: flex; flex-direction: column; gap: 10px; }
.tr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; box-shadow: var(--shadow-sm);
}
.tr-main { flex: 1; min-width: 0; }
.tr-text {
  font-family: var(--serif); font-size: 14px; line-height: 1.7; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tr-meta {
  margin-top: 6px; font-size: 11px; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tr-when { color: var(--ink-3); opacity: .85; }
.tr-btn {
  flex-shrink: 0; height: 30px; padding: 0 13px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft);
  transition: transform .14s;
}
.tr-btn:active { transform: scale(.94); }

/* 开关 */
.switch {
  width: 44px; height: 26px; border-radius: 13px; background: var(--line-2);
  position: relative; transition: background .22s; flex-shrink: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }

/* 打卡日历 */
.cal { margin-top: 4px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-family: var(--serif); font-size: 14px; font-weight: 700; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-week span { text-align: center; font-size: 10px; color: var(--ink-3); padding-bottom: 6px; }
.cal-cell {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: 11.5px; border-radius: 8px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.cal-cell.mute { color: transparent; }
.cal-cell.on { background: var(--accent); color: #FFF9F2; font-weight: 600; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-cell.today.on { box-shadow: none; }

/* ---------------- 遮罩层 ---------------- */
#stage { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.overlay {
  position: absolute; inset: 0; pointer-events: auto;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: slideIn .26s cubic-bezier(.2,.8,.2,1) both;
  max-width: 480px; margin: 0 auto;
}
@keyframes slideIn { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay.sheet { animation: sheetUp .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.overlay.closing { animation: fadeOut .18s ease both; }
@keyframes fadeOut { to { opacity: 0; } }

.ov-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--bg); flex-shrink: 0;
}
.ov-title { flex: 1; font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-align: center; }
.ov-body { flex: 1; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch; }

/* 详情 */
.detail-quote {
  font-family: var(--serif); font-size: 23px; line-height: 1.86;
  letter-spacing: .02em; color: var(--ink);
  padding: 6px 0 20px;
  white-space: pre-wrap; word-break: break-word;
}
.detail-mark { font-family: var(--serif); font-size: 60px; line-height: .6; color: var(--accent); opacity: .22; display: block; margin-bottom: 6px; }
.detail-meta { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-block { margin-top: 20px; }
.detail-block h4 {
  font-size: 11px; letter-spacing: .16em; color: var(--ink-3); font-weight: 500;
  margin: 0 0 9px; text-transform: uppercase;
}
.detail-note {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px; padding: 13px 15px;
  font-size: 13.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap;
}
.detail-acts { display: flex; gap: 9px; margin-top: 26px; }
.detail-acts .act-btn { height: 44px; font-size: 13.5px; }

.rel-list { display: flex; flex-direction: column; gap: 8px; }
.rel-item {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  transition: background .16s, transform .14s;
}
.rel-item:active { transform: scale(.985); background: var(--surface-2); }
.rel-text {
  font-family: var(--serif); font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.rel-meta { font-size: 10.5px; color: var(--ink-3); }

/* 表单 */
.field { margin-bottom: 18px; }
.field > label {
  display: block; font-size: 11px; letter-spacing: .14em; color: var(--ink-3);
  margin-bottom: 8px; text-transform: uppercase;
}
.field input[type="text"], .field input[type="time"], .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); padding: 12px 14px; font-size: 14px;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; min-height: 104px; line-height: 1.8; font-family: var(--serif); font-size: 15px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { font-size: 11px; color: var(--ink-3); margin-top: 7px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 10px;
  font-size: 12.5px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .16s;
}
.chip.on { background: var(--accent); color: #FFF9F2; border-color: var(--accent); }
.chip.add { border-style: dashed; color: var(--ink-3); }
.chip .ico { width: 13px; height: 13px; }

.btn-primary {
  width: 100%; height: 48px; border-radius: 14px;
  background: var(--accent); color: #FFF9F2;
  font-size: 15px; font-weight: 600; letter-spacing: .08em;
  box-shadow: 0 6px 18px rgba(168,68,58,.28);
  transition: transform .15s;
}
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  width: 100%; height: 46px; border-radius: 13px;
  background: var(--surface-2); color: var(--ink-2); font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* 海报 */
.poster-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 6px; }
.poster-frame {
  width: 100%; max-width: 300px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(30,20,10,.22);
  background: #eee;
}
.poster-frame canvas { width: 100%; height: auto; display: block; }
.tpl-row { display: flex; gap: 10px; }
.tpl {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 12px; border: 1.5px solid transparent;
  transition: all .18s;
}
.tpl.on { border-color: var(--accent); background: var(--accent-soft); }
.tpl i { width: 34px; height: 34px; border-radius: 9px; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tpl span { font-size: 11px; color: var(--ink-2); }

/* 搜索 */
.search-box {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 13px; height: 42px; margin: 0 0 16px;
}
.search-box .ico { width: 17px; height: 17px; color: var(--ink-3); flex-shrink: 0; }
.search-box input { flex: 1; border: 0; background: none; outline: none; font-size: 14px; height: 100%; }
.search-hot { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-group-title { font-size: 11px; letter-spacing: .14em; color: var(--ink-3); margin: 18px 0 10px; }
.sr-more-note {
  margin-top: 14px; text-align: center;
  font-size: 11.5px; color: var(--ink-3); line-height: 1.8;
}

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b));
  transform: translate(-50%, 14px);
  background: rgba(30,24,18,.92); color: #FFF6EA;
  padding: 10px 18px; border-radius: 12px; font-size: 13px;
  opacity: 0; pointer-events: none; z-index: 999;
  transition: opacity .22s, transform .22s;
  backdrop-filter: blur(8px); max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 批量粘贴导入 ---------------- */
.sec-tools { display: flex; align-items: center; gap: 12px; }
.sec-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--accent);
  padding: 4px 0;
}
.sec-link .ico { width: 14px; height: 14px; }

.imp-tip { font-size: 12px; color: var(--ink-3); line-height: 1.9; margin-bottom: 12px; }

.imp-area {
  width: 100%; min-height: 176px; max-height: 40vh;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); padding: 13px 14px;
  font-size: 13.5px; line-height: 1.9; color: var(--ink);
  outline: none; resize: none;
  transition: border-color .18s, box-shadow .18s;
}
.imp-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.imp-area::placeholder { color: var(--ink-3); opacity: .8; }

.imp-count {
  display: flex; align-items: center; justify-content: space-between;
  margin: 8px 0 20px; font-size: 11.5px; color: var(--ink-3);
}
.imp-count-acts { display: flex; gap: 14px; }
.imp-link { font-size: 11.5px; color: var(--accent); }

.imp-sum {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12px; color: var(--ink-3); margin-bottom: 14px;
}
.imp-sum b { font-family: var(--serif); font-size: 16px; color: var(--ink); }

.imp-list { display: flex; flex-direction: column; gap: 8px; }
.imp-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 13px; border: 1px solid var(--line);
  border-radius: 13px; background: var(--surface);
  transition: opacity .18s, border-color .18s;
}
.imp-row.off { opacity: .42; }
.imp-check {
  width: 21px; height: 21px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  color: #FFF9F2; margin-top: 1px;
  transition: background .18s, border-color .18s;
}
.imp-row:not(.off) .imp-check { background: var(--accent); border-color: var(--accent); }
.imp-check .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.imp-main { flex: 1; min-width: 0; }
.imp-text {
  font-family: var(--serif); font-size: 14px; line-height: 1.74;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.imp-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 7px; font-size: 11px; color: var(--ink-3);
}
.imp-cat-chip {
  font-size: 10px; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2);
}
.imp-dup { color: var(--gold); font-size: 10.5px; }

.imp-foot {
  flex-shrink: 0;
  padding: 12px 20px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* ---------------- 登录 / 账号 ---------------- */
.field input[type="tel"], .field input[type="email"] {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); padding: 12px 14px; font-size: 14px;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.field input[type="tel"]:focus, .field input[type="email"]:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:disabled { opacity: .55; }

.auth-body { padding: 24px 22px 28px; }

.auth-brand { text-align: center; padding: 6px 0 22px; }
.auth-mark {
  width: 58px; height: 58px; border-radius: 18px; margin: 0 auto 14px;
  background: var(--accent); color: #FFF9F2;
  font-family: var(--serif); font-size: 30px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(168,68,58,.3);
}
.auth-slogan { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
.auth-sub { font-size: 12px; color: var(--ink-3); margin-top: 7px; line-height: 1.7; }

.auth-banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; margin-bottom: 20px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.auth-banner .ico { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.auth-banner b { display: block; font-size: 12.5px; color: var(--accent); margin-bottom: 3px; }
.auth-banner span { font-size: 11.5px; color: var(--ink-2); line-height: 1.65; }

.auth-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--surface-2); border-radius: 12px;
}
.auth-tabs button {
  flex: 1; height: 36px; border-radius: 9px;
  font-size: 13px; color: var(--ink-2); transition: all .18s;
}
.auth-tabs button.on {
  background: var(--surface); color: var(--ink);
  font-weight: 600; box-shadow: var(--shadow-sm);
}

.auth-input-row { display: flex; gap: 9px; }
.auth-input-row input { flex: 1; min-width: 0; }
.auth-code {
  flex-shrink: 0; padding: 0 14px; height: 45px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: opacity .18s;
}
.auth-code.off { opacity: .45; }
.auth-err { font-size: 11.5px; color: var(--accent); margin-top: 7px; }

.btn-primary.off, .btn-primary:disabled { opacity: .4; box-shadow: none; }
.btn-ghost:disabled { opacity: .45; }

.auth-note { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 11px; line-height: 1.7; }

.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px; color: var(--ink-3); font-size: 11px;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-foot {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--ink-3); line-height: 1.7;
}
.auth-foot .ico { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

/* 「我的」页账号入口 */
.acct-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  margin-top: 12px; padding: 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: background .16s;
}
.acct-row:active { background: var(--surface-2); }
.acct-row-ico {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
}
.acct-row-ico.on { background: var(--accent-soft); color: var(--accent); }
.acct-row-ico .ico { width: 17px; height: 17px; }
.acct-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-row-main b { font-size: 13px; font-weight: 600; color: var(--ink); }
.acct-row-main i { font-size: 11px; font-style: normal; color: var(--ink-3); }

.acct-hero { text-align: center; padding: 24px 0 24px; }
.acct-mark {
  width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
}
.acct-mark .ico { width: 26px; height: 26px; }
.acct-hero b { display: block; font-family: var(--serif); font-size: 16px; margin-bottom: 8px; }
.acct-hero span { font-size: 12.5px; color: var(--ink-3); line-height: 1.8; }

.acct-card {
  display: flex; align-items: center; gap: 13px;
  padding: 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.acct-dot { width: 8px; height: 8px; border-radius: 50%; background: #4E9A6A; flex-shrink: 0; }
.acct-dot.dirty { background: var(--gold); }

.acct-note {
  font-size: 11px; color: var(--ink-3); line-height: 1.85;
  margin-top: 10px; padding: 0 4px;
}

/* ---------------- 存储异常横幅 ---------------- */
#storageWarn { flex-shrink: 0; padding: 0 16px; }
.store-warn {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 0 0 8px; padding: 11px 13px; border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  animation: fade .24s ease both;
}
.store-warn .ico { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.sw-main { flex: 1; min-width: 0; }
.sw-main b { display: block; font-size: 12px; color: var(--accent); margin-bottom: 3px; }
.sw-main span { font-size: 11px; color: var(--ink-2); line-height: 1.6; }
.sw-btn {
  flex-shrink: 0; font-size: 11.5px; color: var(--accent);
  padding: 4px 9px; border-radius: 8px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

@media (max-width: 420px) {
  .fab { margin-left: 0; right: 20px; left: auto; }
  .page { padding-left: 16px; padding-right: 16px; }
  .hscroll, .filter-bar { padding-left: 16px; padding-right: 16px; margin-left: -16px; margin-right: -16px; }
}
