/* 如意 - 暖色主题 移动优先 */
:root {
  --bg: #FAF6F0;
  --card: #FFFFFF;
  --primary: #E07A5F;      /* 赤陶 */
  --primary-soft: #F9E3DB;
  --accent: #F2CC8F;       /* 暖金 */
  --accent-soft: #FBF0D9;
  --green: #81B29A;
  --green-soft: #E6F0EB;
  --ink: #3D405B;          /* 正文 */
  --ink-2: #8B8FA3;        /* 次要文字 */
  --line: #EFE7DC;
  --danger: #C75146;
  --radius-card: 16px;
  --radius-btn: 12px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px; line-height: 1.6;
}

#app { max-width: 560px; margin: 0 auto; padding: 12px 16px 84px; min-height: 100vh; }

.view { display: none; }
.view.active { display: block; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 顶部 ---------- */
.page-title { font-size: 20px; font-weight: 700; margin: 8px 0 2px; }
.page-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 12px; }

/* ---------- 卡片与通用 ---------- */
.card {
  background: var(--card); border-radius: var(--radius-card);
  padding: 16px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(61, 64, 91, .06);
}
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }

.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 600; font-family: inherit;
  padding: 12px 20px; border-radius: var(--radius-btn);
  transition: opacity .15s;
}
.btn:active { opacity: .82; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }
.btn.ghost {
  background: var(--primary-soft); color: var(--primary);
}
.btn.small { font-size: 13px; padding: 7px 14px; font-weight: 500; }

.link-btn { background: none; border: none; color: var(--ink-2); font-size: 13px; cursor: pointer; font-family: inherit; padding: 4px; }
.link-btn.danger { color: var(--danger); }

/* ---------- 首页 · 一分钟头图 ---------- */
.hero-card {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--primary-soft) 0%, var(--accent-soft) 48%, var(--green-soft) 100%);
  border-radius: 20px; padding: 16px 16px 13px; margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(61, 64, 91, .06);
}
.hero-scene { display: block; width: 100%; height: 104px; }
.hero-kicker {
  font-size: 12px; font-weight: 600; color: var(--primary);
  letter-spacing: .32em; text-indent: .32em; margin-top: 2px;
}
.hero-title { font-size: 21px; font-weight: 700; color: var(--ink); margin: 5px 0 2px; }
.hero-title.solo { margin: 8px 0 12px; color: #E07A5F; } /* v51：首页头图只留一行主标题；v52 颜色跟头图小人同色 */
.hero-sub { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
.hero-cheer {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .72); border-radius: 14px;
  padding: 10px 14px; text-align: left;
}
.cheer-text { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.cheer-time { font-size: 11.5px; color: var(--ink-2); font-weight: 400; display: block; }
.hero-foot { font-size: 12px; color: #5F8F7C; margin-top: 10px; }

.h-sun, .h-sun-core, .h-figure { transform-box: fill-box; transform-origin: center; }
.h-sun, .h-sun-core { animation: hBreathe 7s ease-in-out infinite; }
@keyframes hBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.h-figure { transform-origin: center bottom; animation: hBob 6s ease-in-out infinite; }
@keyframes hBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.h-tw { animation: hTwinkle 4.5s ease-in-out infinite; }
.h-tw.t2 { animation-delay: 1.2s; }
.h-tw.t3 { animation-delay: 2.1s; }
.h-tw.t4 { animation-delay: 3s; }
@keyframes hTwinkle { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  .h-sun, .h-sun-core, .h-figure, .h-tw { animation: none; }
}

/* ---------- 日期导航 ---------- */
.day-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.day-nav .day-label { font-size: 15px; font-weight: 700; }
.day-nav .day-week { color: var(--ink-2); font-size: 12px; margin-left: 6px; font-weight: 400; }
.nav-arrow { background: none; border: none; font-size: 20px; color: var(--ink); cursor: pointer; padding: 6px 14px; border-radius: 10px; }
.nav-arrow[disabled] { opacity: .25; }

/* ---------- 快捷输入（v59 起输入区是 contenteditable 富文本） ---------- */
.ed-area {
  width: 100%; min-height: 96px; box-sizing: border-box; overflow-y: auto;
  resize: vertical; /* v66 加回：v59 富文本化丢了旧 textarea 的拉伸手柄 */
  border: 1.5px solid var(--line); border-radius: var(--radius-btn);
  padding: 12px; font-size: 16px; font-family: inherit; line-height: 1.55;
  background: #FFFDF9; color: var(--ink); word-break: break-word;
}
.ed-area:focus { outline: none; border-color: var(--primary); }
.ed-area:empty::before { content: attr(data-ph); color: var(--ink-2); opacity: .75; pointer-events: none; }
.ed-area h2, .tl-text h2 { font-size: 1.18em; margin: .6em 0 .3em; line-height: 1.4; font-weight: 700; }
.ed-area h3, .tl-text h3 { font-size: 1.06em; margin: .5em 0 .25em; line-height: 1.4; font-weight: 700; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 10px; }
.ed-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 8px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  min-width: 30px; text-align: center;
}
.ed-btn:active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.ed-color { width: 30px; height: 27px; padding: 0; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.tpl-row { display: flex; gap: 12px; margin: 2px 0 8px; flex-wrap: wrap; }
.entry-status { padding: 0 4px; min-height: 18px; }
.draft-saved { font-size: 11px; color: var(--green); text-align: right; min-height: 16px; margin: 2px 2px 6px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip-row .lbl { font-size: 12px; color: var(--ink-2); align-self: center; margin-right: 2px; }
.art-tabs { padding-bottom: 10px; border-bottom: 1px solid var(--line); } /* v59 外修一级：书籍/文章 */
.art-tabs .chip { min-width: 72px; text-align: center; }
.art-src { color: var(--ink-3, #9a917f); } /* v59 文章阅读页来源行 */
.chip { /* v62 起全站切换标签改纯文字风（小红书式）：无底色无边框，未选灰、选中主色加粗 */
  border: none; background: none; color: var(--ink-2);
  border-radius: 0; padding: 5px 10px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.chip.on { background: none; color: var(--primary); font-weight: 600; }
.chip.green.on { background: none; color: #4d7a66; font-weight: 600; }

/* ---------- 时间轴 ---------- */
.day-total { font-size: 12.5px; color: var(--ink-2); margin: 2px 2px 12px; }
.write-entry { /* v64：写作入口=主色实心胶囊（小红书"发布"式 CTA：白笔图标+白字居中+软投影）——v62 浅灰条用户嫌"更丑"，简洁但要醒目有质感 */
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; height: 46px;
  background: var(--primary); color: #fff; border: none; border-radius: 999px;
  font-family: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: 2px;
  margin: 0 0 12px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(224, 122, 95, .28);
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
}
.write-entry:active { transform: scale(.97); box-shadow: 0 2px 8px rgba(224, 122, 95, .22); }
.we-ico { flex: none; display: flex; color: #fff; }
.we-txt { color: #fff; }
@media (hover: hover) {
  .write-entry:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(224, 122, 95, .34); }
}

/* v61：筛选标签行——横向滚动不套卡片；v62 标签改纯文字风（小红书式：无底色，未选灰、选中主色加粗） */
.flt-row {
  display: flex; flex-wrap: nowrap; gap: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 1px 2px 5px; scrollbar-width: none;
}
.flt-row::-webkit-scrollbar { display: none; }
.flt-row + .flt-row { margin-top: 0; }
.fchip {
  flex: none; border: none; background: none; border-radius: 0;
  color: var(--ink-2); padding: 5px 10px; font-size: 13px; line-height: 1.3;
  cursor: pointer; font-family: inherit; transition: color .12s;
}
.fchip.on { color: var(--primary); font-weight: 600; }
.fchip-date .dc-x { margin-left: 4px; opacity: .7; font-size: 14px; }
@media (hover: hover) {
  .fchip:hover { color: var(--ink); }
  .fchip.on:hover { color: var(--primary); }
}
.pick-date-hidden { /* 原生日历藏在标签后面：标签点击 showPicker 弹出，自身不占版面 */
  position: absolute; width: 1px; height: 1px; opacity: 0;
  border: 0; padding: 0; margin: 0; pointer-events: none;
}
.tl-fold { list-style: none; text-align: center; padding: 4px 0 2px; }
.tl-fold .link-btn { font-size: 13.5px; padding: 8px 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item {
  position: relative; padding: 12px 0 12px 20px; border-left: 2px solid var(--line);
  margin-left: 6px;
}
.tl-item::before {
  content: ''; position: absolute; left: -6px; top: 19px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--accent);
}
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.tl-time { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 600;
}
.badge.did { background: var(--primary-soft); color: var(--primary); }
.badge.thought { background: var(--green-soft); color: #4d7a66; }
.badge.mood { background: var(--accent-soft); color: #9a7b2f; }
.badge.dream { background: #EEEAF6; color: #6f5f9c; }
.badge.dur { background: #F1F0F5; color: var(--ink-2); font-weight: 500; }
.tl-text { font-size: 15px; line-height: 24px; white-space: pre-wrap; word-break: break-word; }
.tl-text.clamp { max-height: 120px; overflow: hidden; } /* 5 行 × 24px */
.tl-text.clamp.open { max-height: none; }
.tl-more { margin-top: 4px; padding: 0; font-size: 13px; }
.tl-acts { margin-top: 4px; display: flex; gap: 14px; }
.tl-edit textarea {
  width: 100%; min-height: 72px; border: 1.5px solid var(--primary); border-radius: 10px;
  padding: 10px; font-size: 16px; font-family: inherit; background: #FFFDF9;
}
.empty { text-align: center; color: var(--ink-2); font-size: 14px; padding: 28px 0 20px; }

/* ---------- 占位视图 ---------- */
.placeholder { text-align: center; padding: 48px 20px; color: var(--ink-2); font-size: 14px; }
.placeholder .ph-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}
.tabbar-slogan { display: none; } /* 手机底栏不显示；PC 侧边栏里在品牌下方亮出（v47） */
.tab {
  flex: 1; max-width: 120px; background: none; border: none; cursor: pointer;
  font-family: inherit; color: var(--ink-2); font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
}
.tab .ico { font-size: 20px; line-height: 1; font-weight: 700; }
.tab.on { color: var(--primary); font-weight: 700; }

/* ---------- 遮罩层（锁/引导） ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.overlay.show { display: flex; }
.lock-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.lock-hint { font-size: 13px; color: var(--ink-2); margin: 0 0 18px; min-height: 20px; }
.lock-hint.err { color: var(--danger); }
.lock-dots { display: flex; gap: 14px; margin-bottom: 28px; }
.lock-dots .dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid var(--ink-2); background: transparent;
  transition: all .12s;
}
.lock-dots .dot.on { background: var(--primary); border-color: var(--primary); transform: scale(1.12); }
.lock-dots.shake { animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-5px); }
}
.lock-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.lock-key {
  height: 68px; border-radius: 50%; border: none; cursor: pointer;
  background: #fff; color: var(--ink); font-size: 24px; font-family: inherit;
  box-shadow: 0 2px 5px rgba(61, 64, 91, .10);
}
.lock-key:active { background: var(--primary-soft); }
.lock-key.fn { font-size: 15px; color: var(--ink-2); }

/* 引导页 */
.intro-mark { font-size: 44px; color: var(--primary); font-weight: 700; margin-bottom: 6px; }
.intro-slogan { font-size: 13.5px; color: var(--ink-2); margin: 0 0 18px; letter-spacing: .02em; }
.intro-title { font-size: 24px; font-weight: 700; margin: 0 0 8px; }
.intro-lead { font-size: 14.5px; color: var(--ink); max-width: 300px; margin: 0 0 10px; }
.intro-note { font-size: 12.5px; color: var(--ink-2); max-width: 300px; margin: 0 0 26px; }
.intro-actions { display: flex; flex-direction: column; gap: 10px; width: 240px; }

/* ---------- 设置 ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row .set-lbl { font-size: 14.5px; }
.set-row .set-sub { font-size: 12px; color: var(--ink-2); display: block; }
.set-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; font-family: inherit; background: #FFFDF9; color: var(--ink);
}
.set-input:focus { outline: none; border-color: var(--primary); }
.fb-ta { /* 提建议（v55）：设置页多行吐槽框，观感同 .set-input */
  width: 100%; min-height: 92px; resize: vertical; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 16px; font-family: inherit; background: #FFFDF9; color: var(--ink);
}
.fb-ta:focus { outline: none; border-color: var(--primary); }

/* ---------- 版本更新条 ---------- */
#updateBar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px; z-index: 90;
  background: var(--ink); color: #fff; font-size: 13.5px;
  padding: 10px 12px 10px 18px; border-radius: 999px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 14px rgba(61, 64, 91, .25);
}

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px);
  background: rgba(61, 64, 91, .92); color: #fff;
  padding: 10px 20px; border-radius: 999px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  max-width: 82vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 录音条 ---------- */
.rec-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rec-toggle { flex: none; }
.rec-bar.recording .rec-toggle { background: var(--primary); color: #fff; }
.rec-timer {
  font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink-2); flex: 1;
}
.rec-bar.recording .rec-timer { color: var(--danger); font-weight: 700; }
.rec-bar.recording .rec-timer::before {
  content: '●'; margin-right: 6px; animation: recblink 1s infinite;
}
@keyframes recblink { 50% { opacity: .25; } }
.rec-bar.transcribing .rec-toggle { opacity: .6; }

/* ---------- 待转写横幅 ---------- */
.asr-queue {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius-btn); padding: 10px 12px; margin-bottom: 12px;
  font-size: 13.5px; color: var(--ink);
}
.asr-queue span { flex: 1; }

/* ---------- 看见：总结 ---------- */
.seg-row { margin-bottom: 14px; }
.seg-row .chip { flex: none; }
.stats-card { padding: 12px 16px; }
.stat-line { font-size: 13.5px; color: var(--ink-2); padding: 2px 0; }
.stat-line:first-child { color: var(--ink); font-weight: 600; }
.sum-hint { font-size: 12.5px; color: var(--ink-2); margin: 0 2px 10px; }
.report-body { margin-top: 16px; }
.rep-title { font-size: 14.5px; font-weight: 700; margin: 18px 0 6px; color: var(--ink); }
.rep-list { margin: 0; padding-left: 18px; }
.rep-list li { font-size: 14.5px; margin-bottom: 4px; }
.sum-overview li { font-size: 15px; color: var(--ink); }
.hl li { color: #9a7b2f; }
.te-row {
  display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.te-row:last-child { border-bottom: none; }
.te-area { flex: none; font-weight: 600; color: var(--ink); min-width: 72px; }
.te-note { color: var(--ink-2); flex: 1; }
.encourage {
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border-radius: var(--radius-btn); padding: 14px 16px;
  font-size: 15px; font-weight: 600; margin: 20px 0 8px;
}
.report-meta { font-size: 11.5px; color: var(--ink-2); margin-top: 10px; }
.stale-hint {
  background: var(--accent-soft); border-radius: 10px; padding: 8px 12px;
  font-size: 12.5px; color: #9a7b2f; margin-bottom: 6px;
}
.gen-error {
  background: #F9E9E7; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; color: var(--danger); margin-bottom: 8px;
  word-break: break-word;
}

/* ---------- 能量：念头收藏与加油语 ---------- */
.mini-ta {
  width: 100%; min-height: 72px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--radius-btn);
  padding: 10px 12px; font-size: 16px; font-family: inherit; line-height: 1.55;
  background: #FFFDF9; color: var(--ink);
}
.mini-ta:focus { outline: none; border-color: var(--primary); }
#favText { min-height: 64px; }
.fav-list { margin-top: 12px; }
.fav-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.fav-item:last-child { border-bottom: none; }
.fav-text { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.fav-meta { font-size: 12px; color: var(--ink-2); margin-top: 4px; display: flex; align-items: center; justify-content: space-between; }
.cheer-seg { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.cheer-seg:first-child { padding-top: 6px; }
.cheer-seg:last-child { border-bottom: none; }
.cheer-seg-head { display: flex; align-items: center; margin-bottom: 8px; }
.cheer-seg-head label { display: flex; align-items: center; gap: 8px; }
.cheer-seg-name { font-size: 14.5px; font-weight: 600; }
.cheer-seg-acts { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.seg-saved { font-size: 12px; color: var(--green); }

/* ---------- 看见：情绪/进步（M3） ---------- */
.agree-row { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin-top: 8px; cursor: pointer; }
.agree-row input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; margin-top: 2px; }
.mood-pattern { border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 12px 14px; margin-bottom: 10px; }
.mp-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.mp-row { font-size: 14px; margin-bottom: 4px; }
.mp-lbl { color: var(--ink-2); font-size: 12.5px; margin-right: 4px; }
.mp-row.q { color: #9a7b2f; }
.praise-card { background: var(--green-soft); border-radius: var(--radius-btn); padding: 12px 14px; margin-bottom: 10px; }
.pc-title { font-size: 15px; font-weight: 700; color: #4d7a66; margin-bottom: 6px; }
.pc-row { font-size: 14px; margin-bottom: 4px; }
.nonefound { text-align: center; color: var(--ink-2); font-size: 14.5px; padding: 24px 8px; line-height: 1.7; }

/* ---------- 子页头（能量等从设置进入的页） ---------- */
.subpage-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.subpage-head b { font-size: 16px; }
.subpage-head .link-btn { font-size: 14px; padding: 4px 10px 4px 0; }

/* ---------- 弹层（分享 / 卡片） ---------- */
.modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(61, 64, 91, .45);
  display: none; align-items: flex-end; justify-content: center;
}
.modal.show { display: flex; }
.sheet {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  animation: sheetup .22s ease;
}
@keyframes sheetup { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-bar {
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 2; background: #fff;
  border-radius: 20px 20px 0 0; border-bottom: 1px solid var(--line);
  margin: -16px -18px 10px; padding: 14px 18px 10px;
}
.sheet-bar b { font-size: 16px; }
.sheet-x { background: none; border: none; font-size: 22px; color: var(--ink-2); cursor: pointer; padding: 2px 8px; }
.sheet-quote {
  font-size: 13px; color: var(--ink-2); background: #FAF6F0;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px;
}
.sheet .btn.block { margin-bottom: 10px; }
.sheet .btn.block:last-of-type { margin-bottom: 0; }
#sharePlazaBtn.published { background: var(--green-soft); color: #4d7a66; }
.card-img-wrap { margin: 4px 0 12px; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(61,64,91,.12); }
.card-img-wrap img { display: block; width: 100%; }

/* ---------- 情绪广场 ---------- */
.plaza-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.plaza-top .page-sub { margin-bottom: 4px; }
#plazaSwitch { margin-top: 2px; } /* v48：公开广场/我的小组 页内切换 */
.plaza-state { text-align: center; color: var(--ink-2); font-size: 14px; padding: 26px 12px; line-height: 1.7; }
.plaza-item {
  background: var(--card); border-radius: var(--radius-card);
  padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(61, 64, 91, .06);
}
.plaza-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.plaza-nick { font-size: 14px; font-weight: 700; color: var(--ink); }
.plaza-date { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plaza-text { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.plaza-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* ---- 情绪广场·回复（v26）---- */
.plaza-re-box { margin-top: 4px; }
.plaza-re-list { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.plaza-re { background: var(--bg); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.plaza-re-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.plaza-re-nick { font-size: 13px; font-weight: 700; color: var(--ink); }
.plaza-re-date { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; flex: 1; }
.plaza-re-head .link-btn { font-size: 12px; }
.plaza-re-text { font-size: 14px; line-height: 1.65; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.plaza-re-editor { margin-top: 8px; }
.plaza-re-nick-input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 16px; background: var(--card); color: var(--ink);
  font-family: inherit; margin-bottom: 6px;
}
.plaza-re-ta {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 10px; font-size: 16px; line-height: 1.6; min-height: 72px; resize: vertical;
  background: var(--card); color: var(--ink); font-family: inherit;
}
.plaza-re-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.plaza-re-row .btn { padding: 7px 16px; font-size: 14px; }

/* ---------- 小组（v30）：复用广场卡片与回应区，另加组信息栏与角色徽标 ---------- */
.g-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px;
}
.g-bar-title { font-weight: 700; color: var(--ink); }
.g-bar-invite { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.g-bar-invite b { color: var(--primary); letter-spacing: .12em; font-size: 15px; }
.g-bar .link-btn { font-size: 13px; }
.g-members { width: 100%; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.g-member { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; }
.g-member-nick { font-size: 13.5px; color: var(--ink); }
.g-role { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; flex: none; }
.g-role.owner { background: #F9E3DB; color: #D96A4E; }
.g-role.coach { background: #E6F0EB; color: #5F8F7C; }

/* ---------- 设置：表单 ---------- */
.fld { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.fld .set-input { margin-top: 4px; }
.test-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.test-state { font-size: 12.5px; color: var(--ink-2); flex: 1; word-break: break-word; }
.card-note { font-size: 12.5px; color: var(--ink-2); margin: 10px 0 0; }
.switch { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }

/* ---- 单条笔记洞察（v22）---- */
.ins-lens { font-size: 17px; font-weight: 700; color: var(--ink); margin: 2px 0 10px; }
.ins-p { font-size: 15px; line-height: 1.75; margin: 0 0 12px; color: var(--ink); }
.ins-unspoken, .ins-q, .ins-time {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  font-size: 14.5px;
  line-height: 1.6;
  margin: 12px 0;
}
.ins-q { border-left-color: var(--accent); background: var(--accent-soft); }
.ins-time { border-left-color: var(--green); background: var(--green-soft); } /* v60：AI 估计的时间投入 */
.ins-stale { /* 同 stale-hint 观感，但类名独立：藏在弹层里也不影响别处的 .stale-hint 计数 */
  background: var(--accent-soft); border-radius: 10px; padding: 8px 12px;
  font-size: 12.5px; color: #9a7b2f; margin: 8px 0 6px;
}

/* ---- 全屏写笔记页（v24）---- */
.write-meta { padding: 2px 4px 10px; }
.write-date { font-size: 13px; color: var(--green); }
.write-greet { font-size: 19px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.write-card { padding: 6px 8px; }
#writeText {
  width: 100%; min-height: 46vh; box-sizing: border-box; overflow-y: auto;
  border: none; outline: none;
  padding: 12px 10px; font-size: 17px; font-family: inherit; line-height: 1.9;
  background: transparent; color: var(--ink);
}
.write-status {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 18px; font-size: 11.5px; color: var(--green);
  padding: 4px 4px 6px;
}
#writeTypeChips, #writeDurChips { margin: 10px 2px 0; }
.write-rec { margin: 12px 0 10px; }
#writeEntry { display: block; margin: 10px auto 0; font-size: 13.5px; }

/* ---- 洞察回应（v25）：两张高亮卡下"接着写"，存成新的思考笔记 ---- */
.ins-reply-toggle { margin: 2px 0 14px; font-size: 13.5px; padding: 0; }
.ins-reply { margin: 6px 0 16px; }
.ins-reply-ctx {
  font-size: 12.5px; color: #8a8d9c;
  border-left: 2px solid var(--line); padding-left: 8px; margin-bottom: 8px;
}
.ins-reply-ta {
  width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--radius-btn);
  padding: 10px; font-size: 16px; font-family: inherit; line-height: 1.7;
  background: #FFFDF9; color: var(--ink);
}
.ins-reply-row { display: flex; gap: 10px; margin-top: 8px; }
.ins-reply-hint { font-size: 11.5px; color: var(--green); margin-top: 6px; line-height: 1.5; }
.ins-replies { margin: 4px 0 10px; }
.ins-replies-head { font-size: 13px; font-weight: 700; color: var(--ink); margin: 10px 0 2px; }
.ins-reply-item { border-top: 1px dashed var(--line); padding: 8px 2px 4px; margin-top: 8px; }
.ins-reply-item .t { font-size: 11px; color: var(--green); margin-bottom: 3px; }
.ins-reply-item .x {
  font-size: 14px; line-height: 1.7; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}

/* ================= PC 端适配（v28 起，v44 改判定） =================
   v28 原判定：≥900px。v44 起：≥900px，或"鼠标环境"（hover+pointer:fine）且 ≥640px
   ——微信电脑版内置浏览器/高缩放/未最大化窗口按 CSS 像素常不足 900，被漏在手机版式外；
   鼠标环境放宽到 640 即切电脑版。手机（触摸主指针）两条都不命中，样式一个字节不变 */
@media (min-width: 900px), (hover: hover) and (pointer: fine) and (min-width: 640px) {
  body { background: #F3EDE4; }

  /* 写作入口按钮：宽屏不限宽会拉成一根长条，限宽居中当主行动点（v64） */
  .write-entry { max-width: 440px; margin-left: auto; margin-right: auto; }

  /* 1) 底部 tab 栏 → 左侧导航栏 */
  .tabbar {
    left: 0; right: auto; top: 0; bottom: 0; width: 212px; max-width: none; margin: 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px;
    border-top: none; border-right: 1px solid var(--line);
    padding: 30px 14px 20px;
    background: #FFFDF9;
  }
  .tabbar::before {
    content: '如意';
    display: block;
    font-size: 26px; font-weight: 700; color: var(--primary);
    padding: 0 12px; margin-bottom: 4px; letter-spacing: .1em;
  }
  .tabbar-slogan { display: block; font-size: 11.5px; color: var(--ink-2); line-height: 1.5; padding: 0 12px; margin-bottom: 12px; }
  .tabbar::after {
    content: '观察自己 · 看见自己 · 记录自己';
    display: block;
    font-size: 11.5px; color: var(--ink-2);
    padding: 0 12px; margin-top: auto; line-height: 1.7;
  }
  .tab {
    flex: none; max-width: none;
    flex-direction: row; justify-content: flex-start; align-items: center;
    gap: 12px; font-size: 15px; padding: 12px 14px; border-radius: 12px;
    transition: background .15s, color .15s;
  }
  .tab .ico {
    font-size: 15px; font-weight: 700; width: 30px; height: 30px; line-height: 30px;
    background: var(--accent-soft); color: #9a7b2f; border-radius: 8px; text-align: center;
  }
  .tab:hover { background: var(--primary-soft); color: var(--primary); }
  .tab.on { background: var(--primary-soft); }
  .tab.on .ico { background: var(--primary); color: #fff; }

  /* 2) 内容区右移放宽 */
  #app { margin: 0 0 0 212px; max-width: 900px; padding: 30px 48px 90px; }

  /* 3) 各视图舒适化 */
  .hero-card { padding: 26px 28px 20px; }
  .hero-title { font-size: 24px; }
  .hero-cheer { padding: 12px 18px; }
  .input-area .ed-area { min-height: 120px; }
  #writeText { min-height: 58vh; font-size: 18px; }
  .ins-reply-ta { min-height: 130px; }
  /* v46：行式网格改瀑布流（小红书式）——行式时每行等最高卡排完才起下一行，
     短卡下方大片空白；columns 各栏自行下落、卡片等高不再互相等待（代价：排序按栏竖读） */
  #plazaList, #groupList { columns: 2; column-gap: 12px; }
  #plazaList .plaza-item, #groupList .plaza-item { break-inside: avoid; margin-bottom: 12px; }

  /* 4) 弹层：底部抽屉 → 居中对话框 */
  .modal { align-items: center; }
  .sheet { border-radius: 20px; max-width: 640px; margin: 0 32px; animation: sheetpop .2s ease; }
  @keyframes sheetpop { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

  /* 5) 悬停态（鼠标） */
  .btn:hover { opacity: .88; }
  .chip:hover { color: var(--primary); }
  .nav-arrow:hover { background: #F1EAE0; }
  .link-btn:hover { color: var(--primary); }
  .link-btn.danger:hover { color: var(--danger); }
  .sheet-x:hover { color: var(--ink); }

  /* 6) 浮动件位置（PC 无底部 tab 栏，不必再躲） */
  #toast { bottom: 48px; }
  #updateBar { bottom: 40px; }

  /* 7) 锁屏键盘与引导页放宽 */
  .lock-pad { grid-template-columns: repeat(3, 84px); gap: 16px; }
  .lock-key { height: 74px; }
  .intro-lead, .intro-note { max-width: 420px; }
}

/* ===== 放到桌面引导卡（v35）：压在 tab 栏上方、弹层之下；仅手机浏览器环境出现 ===== */
.a2hs-card { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; background: #FFFFFF; border-radius: 16px; box-shadow: 0 8px 28px rgba(61,64,91,.18); padding: 16px 16px 14px; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.a2hs-card.show { opacity: 1; transform: none; pointer-events: auto; }
.a2hs-card h4 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--ink); }
.a2hs-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: #6B6E85; }
.a2hs-card .row { display: flex; gap: 10px; }
.a2hs-card .row .btn { flex: 1; }

/* ===== 课程书籍（M22）：书架 + 左右对照阅读 + 批注 ===== */
.bk-item { cursor: pointer; transition: box-shadow .15s; }
.bk-item:active { box-shadow: 0 2px 8px rgba(61,64,91,.14); }
.bk-item b { font-size: 16px; }
.bk-intro {
  margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bk-pref-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0; }
.bk-pref-head .link-btn { padding: 4px 0; }
.bk-chap-no {
  text-align: center; color: var(--primary); font-weight: 700;
  letter-spacing: .35em; text-indent: .35em; font-size: 14px; margin: 22px 0 10px;
}
.bk-row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 10px; margin-bottom: 14px;
}
.bk-cell {
  background: var(--card); border-radius: var(--radius-card); padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(61, 64, 91, .06); min-width: 0;
}
.bk-side {
  font-size: 11px; color: var(--ink-2); letter-spacing: .2em; margin-bottom: 8px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.bk-text {
  font-size: 15px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; color: var(--ink);
}
.bk-orig { font-family: Georgia, "Songti SC", "STSong", "SimSun", serif; }
mark.anno {
  background: var(--accent-soft); color: inherit;
  border-bottom: 2px solid var(--accent); border-radius: 2px;
  padding: 0 1px; cursor: pointer;
}
.bk-orphan {
  margin-top: 10px; font-size: 13px; color: #9a7b2f;
  background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.bk-hint { margin: 18px 2px 6px; }
/* 手机阅读·对照滚动模式（v54）：上半原著/下半译文同屏，两侧各自上下滚动、按段落同步（v49 翻页退役） */
#view-bookread.active.paged {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; overflow: hidden;
  max-width: 560px; margin: 0 auto; padding: 10px 16px 0;
  background: var(--bg);
}
#view-bookread.paged #bookBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#view-bookread.paged .pg-page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
#view-bookread.paged .pg-half { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view-bookread.paged .pg-flow { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pg-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 2px; margin-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}
.pg-pos { font-size: 12.5px; color: var(--ink-2); letter-spacing: .04em; }
.note-fab {
  position: fixed; right: 18px; z-index: 70;
  border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; font-family: inherit;
  padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(224, 122, 95, .45);
}
.note-fab:active { opacity: .85; }
#noteText {
  width: 100%; min-height: 110px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--radius-btn);
  padding: 10px 12px; font-size: 16px; font-family: inherit; line-height: 1.55;
  background: #FFFDF9; color: var(--ink);
}
#noteText:focus { outline: none; border-color: var(--primary); }
@media (min-width: 900px), (hover: hover) and (pointer: fine) and (min-width: 640px) {
  .bk-row { grid-template-columns: 1fr 1fr; gap: 14px; }
  .bk-text { font-size: 16.5px; }
  #bookList { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .bk-item { margin-bottom: 0; }
}
