/* ============================================
   养育手记 · 样式
   设计基调：纸感、留白、serif 标题、克制的陶土色
   ============================================ */

:root {
  /* 纸感基调：更中性、更浅，去掉偏黄的暖调 */
  --paper: #F6F4F0;
  --paper-2: #EDEAE4;
  --card: #FFFFFF;
  --ink: #1B1916;
  --ink-2: #6A645C;
  --ink-3: #A49C93;
  --line: #EBE6DE;
  --line-2: #F3EFE9;
  --accent: #A3613E;
  --accent-soft: #F6EAE1;
  --accent-deep: #7E4629;
  --sage: #58745E;
  --sage-soft: #E9F0E9;
  --amber: #AB8244;
  --amber-soft: #F8F0DE;
  --blue: #56708A;
  --blue-soft: #E8EEF4;
  --red: #A94A3D;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(27, 25, 22, .028);
  --shadow-2: 0 1px 2px rgba(27, 25, 22, .03), 0 8px 26px rgba(27, 25, 22, .045);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* 兼容旧页面的变量名（setup.html） */
  --surface: var(--card);
  --surface-2: var(--paper-2);
  --line-soft: var(--line-2);
  --radius: var(--r);
  --shadow: var(--shadow-1);
  --green: var(--sage);
  --green-soft: var(--sage-soft);
  --green-deep: #3F5F49;
  --clay: var(--accent);
  --clay-soft: var(--accent-soft);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  font-family: var(--sans);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: none; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); }

/* ---------------- 顶栏（仅手机） ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(var(--paper) 78%, rgba(246, 244, 240, 0));
}
.tb-title { font-size: 11.5px; color: var(--ink-3); letter-spacing: .18em; text-transform: uppercase; }
.tb-sub { font-size: 23px; font-family: var(--serif); font-weight: 600; letter-spacing: .01em; margin-top: 2px; }
.tb-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1);
}
.tb-btn svg { width: 19px; height: 19px; }

/* ---------------- 底部 / 侧边导航 ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: stretch; justify-content: space-around;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: rgba(248, 246, 242, .88);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid rgba(235, 230, 222, .9);
}
.brand, .rail-foot { display: none; }
.tabs-nav { display: flex; flex: 1; justify-content: space-around; }
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; padding: 5px 0 3px; border-radius: 12px;
  color: var(--ink-3); transition: color .18s, transform .18s;
}
.tab-btn svg { width: 21px; height: 21px; }
.tab-btn span { font-size: 10px; letter-spacing: .06em; }
.tab-btn.active { color: var(--ink); }
.tab-btn.active svg { stroke-width: 1.9; }
.tab-btn:active { transform: scale(.94); }

/* ---------------- 主体 ---------------- */
.main { padding-bottom: calc(84px + var(--safe-b)); }
.view { padding: 10px 20px 44px; max-width: 780px; margin: 0 auto; }

/* ---------------- 通用文字 ---------------- */
.eyebrow { font-size: 11px; letter-spacing: .2em; color: var(--ink-3); text-transform: uppercase; }
h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: .015em; line-height: 1.32; }
h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: .015em; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.lede { color: var(--ink-2); font-size: 13px; line-height: 1.85; }
.subtle { color: var(--ink-3); font-size: 12.5px; }

/* ---------------- 记录输入卡 ---------------- */
.composer {
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 16px 16px 12px;
  margin-bottom: 20px;
  transition: border-color .2s, box-shadow .2s;
}
.composer.focus { border-color: #E7D6C8; box-shadow: 0 0 0 4px rgba(163, 97, 62, .06), var(--shadow-2); }
.cm-top { display: flex; align-items: flex-start; gap: 11px; }
.cm-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; font-family: var(--serif); font-size: 14px; margin-top: 3px;
}
.cm-input {
  flex: 1; border: none; resize: none; background: none;
  font-size: 16px; line-height: 1.65; min-height: 30px; max-height: 180px;
  padding: 4px 0 2px;
}
.cm-input::placeholder { color: var(--ink-3); }
.cm-kinds { display: flex; gap: 7px; padding: 10px 0 0 0; overflow-x: auto; scrollbar-width: none; }
.cm-kinds::-webkit-scrollbar { display: none; }
.kind-chip {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid transparent; background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
  transition: .15s;
}
.kind-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cm-bar {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2);
}
.cm-bar .spacer { flex: 1; }
.icon-act {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  background: var(--paper-2); transition: .15s;
}
.icon-act:active { transform: scale(.92); }
.icon-act svg { width: 19px; height: 19px; }
.icon-act.rec { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(169, 74, 61, .32); } 50% { box-shadow: 0 0 0 9px rgba(169, 74, 61, 0); } }
.send-btn {
  height: 38px; padding: 0 20px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13.5px; letter-spacing: .05em;
  transition: .15s;
}
.send-btn:disabled { opacity: .38; }
.send-btn:active { transform: scale(.96); }
.cm-progress { height: 2px; background: var(--line-2); border-radius: 2px; margin-top: 8px; overflow: hidden; display: none; }
.cm-progress.on { display: block; }
.cm-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.cm-hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.cm-hint.rec { color: var(--red); }

/* ---------------- 今日小提示 ---------------- */
.daily {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px; margin-bottom: 24px;
  background: var(--paper-2); border-radius: var(--r);
  font-size: 12.5px; color: var(--ink-2);
  overflow-x: auto; scrollbar-width: none;
}
.daily::-webkit-scrollbar { display: none; }
.daily b { color: var(--ink); font-weight: 600; }
.daily .di { white-space: nowrap; }
.daily .go { margin-left: auto; color: var(--accent); white-space: nowrap; font-size: 12.5px; }
.daily-k {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 5px;
  background: #fff; color: var(--ink-3); margin-right: 5px; letter-spacing: .08em;
}

/* ---------------- 记录流 ---------------- */
.filters { display: flex; gap: 7px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  color: var(--ink-3); border: 1px solid transparent; white-space: nowrap;
}
.fchip.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }

.day { margin-bottom: 30px; }
.day-label {
  display: flex; align-items: baseline; gap: 9px;
  padding: 0 2px 12px; position: sticky; top: 60px; z-index: 5;
  background: linear-gradient(var(--paper) 72%, rgba(246, 244, 240, 0));
}
.day-label b { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.day-label span { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; font-variant-numeric: tabular-nums; }

.entry {
  background: var(--card);
  border: none;
  border-radius: 18px;
  padding: 16px 18px 17px;
  margin-bottom: 11px;
  box-shadow: var(--shadow-1);
  animation: rise .28s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.entry.plain { background: none; border: none; box-shadow: none; padding: 4px 2px 8px; }
.entry.kind-milestone, .entry.kind-health { border-left: none; }
.e-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.e-badge {
  font-size: 10.5px; letter-spacing: .1em; padding: 2px 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-3);
}
.e-badge.milestone { background: var(--amber-soft); color: #856018; }
.e-badge.health { background: var(--blue-soft); color: #42607C; }
.e-badge.photo, .e-badge.video { background: var(--sage-soft); color: #3F5F49; }
.e-badge.voice { background: var(--accent-soft); color: var(--accent-deep); }
.e-who { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.e-more { margin-left: auto; color: var(--ink-3); font-size: 17px; line-height: 1; padding: 0 2px; }
.e-text { font-size: 15.5px; line-height: 1.78; color: var(--ink); word-break: break-word; letter-spacing: .002em; }
.entry.kind-milestone .e-text { font-family: var(--serif); font-size: 17.5px; letter-spacing: .015em; line-height: 1.7; }
.e-media { margin-top: 10px; }
.e-media img, .e-media video {
  width: 100%; max-height: 400px; object-fit: cover;
  border-radius: 12px; background: var(--paper-2); cursor: zoom-in;
}
.e-media video { object-fit: contain; background: #000; }
.e-empty {
  font-size: 13px; color: var(--ink-3); margin-top: 6px;
  border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px; display: inline-block;
}
.e-edit { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 12px; resize: vertical; min-height: 60px; font-size: 15px; margin-top: 6px; background: var(--paper); }
.e-edit-bar { display: flex; gap: 8px; margin-top: 8px; }
.play-wrap { position: relative; cursor: zoom-in; }
.play-badge {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(20, 16, 12, .18); border-radius: 10px;
}
.play-badge i {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.play-badge i::after {
  content: ''; margin-left: 3px;
  border-left: 13px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}

/* 语音播放器 */
.v-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; cursor: pointer; position: relative; }
/* 真正干活的 <audio>：留在 DOM 里但看不见（个别安卓浏览器不播脱离文档的媒体元素） */
.v-audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }
.v-play {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; font-size: 12px;
}
.v-wave { flex: 1; height: 26px; display: flex; align-items: center; gap: 2px; position: relative; cursor: pointer; }
.v-wave span { flex: 1; background: var(--line); border-radius: 2px; }
.v-wave .fill { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; overflow: hidden; width: 0; pointer-events: none; }
.v-wave .fill span { background: var(--accent); }
.v-time { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* 放不出来时的兜底：直接给系统播放器 */
.v-native { margin-top: 8px; }
.v-native audio { width: 100%; height: 34px; }
.v-native a { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent); text-decoration: none; }

.stream-empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.stream-empty b { display: block; font-family: var(--serif); font-size: 17px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }

/* ---------------- 相册 ---------------- */
.album-hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 16 / 10; max-height: 420px; background: var(--paper-2); margin-bottom: 26px;
  cursor: zoom-in;
}
.album-hero img { width: 100%; height: 100%; object-fit: cover; }
.album-hero .ah-meta {
  position: absolute; inset: auto 0 0 0; padding: 44px 20px 18px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .58));
  color: #fff;
}
.album-hero .ah-date { font-size: 11px; opacity: .78; letter-spacing: .14em; }
.album-hero .ah-text { font-family: var(--serif); font-size: 19px; margin-top: 5px; line-height: 1.5; }

.month-head {
  display: flex; align-items: baseline; gap: 11px;
  margin: 30px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line-2);
}
.month-head h2 { font-size: 25px; }
.month-head span { font-size: 11px; color: var(--ink-3); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.grid-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.cell {
  position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  background: var(--paper-2); cursor: zoom-in;
}
.cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cell:hover img { transform: scale(1.04); }
.cell .c-play {
  position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); display: grid; place-items: center;
}
.cell .c-play::after {
  content: ''; margin-left: 2px;
  border-left: 7px solid #fff; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
}


/* ---------------- 回顾 ---------------- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 999px; margin-bottom: 22px; }
.seg button { flex: 1; padding: 9px; border-radius: 999px; font-size: 13.5px; color: var(--ink-3); transition: .18s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 500; }

.month-picker { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.month-picker::-webkit-scrollbar { display: none; }
.mp {
  font-size: 13px; padding: 7px 15px; border-radius: 999px;
  border: 1px solid transparent; background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
}
.mp.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mp small { opacity: .5; margin-left: 5px; }

.sheet {
  background: var(--card); border: none;
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-2);
}
.rv-hero {
  padding: 34px 24px 26px; text-align: center;
  background: linear-gradient(180deg, #FCFAF6, var(--card));
  border-bottom: 1px solid var(--line-2);
}
.rv-hero .rv-eyebrow { font-size: 10.5px; letter-spacing: .26em; color: var(--ink-3); }
.rv-hero h1 { font-size: 34px; margin: 10px 0 7px; letter-spacing: .02em; }
.rv-hero .rv-sub { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }
.rv-nums { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; padding: 20px 8px; border-bottom: 1px solid var(--line-2); }
.rv-num b { display: block; font-family: var(--serif); font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rv-num span { font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; }
.rv-block { padding: 24px 24px; border-bottom: 1px solid var(--line-2); }
.rv-block:last-of-type { border-bottom: none; }
.rv-block h3 { font-family: var(--serif); font-size: 16.5px; margin-bottom: 13px; letter-spacing: .05em; }
.rv-ms { list-style: none; display: grid; gap: 9px; }
.rv-ms li { display: flex; gap: 9px; font-size: 14px; line-height: 1.6; }
.rv-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); margin-top: 9px; flex: 0 0 5px; }
.rv-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.rv-photos img { aspect-ratio: 1; object-fit: cover; border-radius: 5px; cursor: zoom-in; }
.rv-quotes { display: grid; gap: 14px; }
.rv-q p { font-family: var(--serif); font-size: 15.5px; line-height: 1.8; }
.rv-q span { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.rv-foot { padding: 16px; text-align: center; font-size: 11px; color: var(--ink-3); letter-spacing: .14em; }

/* ---------------- 数据 ---------------- */
.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-card { background: var(--card); border: none; border-radius: 18px; padding: 18px 16px; text-align: center; box-shadow: var(--shadow-1); }
.stat-card b { display: block; font-family: var(--serif); font-size: 27px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.bar-row { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.bar-label { font-size: 12.5px; color: var(--ink-2); width: 56px; flex: 0 0 56px; }
.bar-track { flex: 1; height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }
.bar-fill.soft { background: var(--sage); }
.bar-val { font-size: 12px; color: var(--ink-3); width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

.chart-card { background: var(--card); border: none; border-radius: 18px; padding: 18px 16px 12px; margin-bottom: 14px; box-shadow: var(--shadow-1); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; padding: 0 4px; }
.chart-head h3 { font-size: 14px; }
.chart-head span { font-size: 11px; color: var(--ink-3); }
canvas { display: block; }

.measure-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.measure-form input { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; width: 100%; }
.measure-form .full { grid-column: 1 / -1; }
.measure-form button { justify-self: start; padding: 0 28px; }
.measure-row {
  display: grid; grid-template-columns: 46px 1fr 1fr 1fr 22px;
  align-items: center; gap: 4px; padding: 9px 0;
  border-bottom: 1px solid var(--line-2); font-size: 12.5px;
}
.measure-row:last-child { border-bottom: none; }
.measure-row .m-date { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.measure-row .m-val { color: var(--ink); }
.m-pct { color: var(--ink-3); font-size: 11px; margin-left: 3px; }
.measure-row button { color: var(--ink-3); font-size: 15px; }

/* ---------------- 指南 ---------------- */
.guide-intro {
  font-size: 13px; line-height: 1.9; color: var(--ink-2);
  background: var(--paper-2); border-radius: 18px;
  padding: 17px 19px; margin-bottom: 22px;
}
.stage-strip { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; padding-bottom: 2px; }
.stage-strip::-webkit-scrollbar { display: none; }
.stg { font-size: 12.5px; padding: 7px 14px; border-radius: 999px; border: 1px solid transparent; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.stg.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.stg.locked { opacity: .4; }

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-2); margin-bottom: 22px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-size: 13.5px; padding: 11px 14px; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

.blk-h { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 30px 0 14px; letter-spacing: .03em; }
.blk-h:first-child { margin-top: 4px; }
.block-item { background: var(--card); border: none; border-radius: 18px; padding: 17px 18px; margin-bottom: 11px; box-shadow: var(--shadow-1); }
.bi-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; letter-spacing: .01em; }
.bi-body { font-size: 14px; color: var(--ink-2); line-height: 1.8; }
.why { margin-top: 11px; font-size: 12.5px; color: var(--ink-2); background: var(--paper-2); border-radius: 12px; padding: 10px 13px; line-height: 1.75; }
.why b { color: var(--ink); font-weight: 600; }
.basis { margin-top: 8px; font-size: 11px; color: var(--ink-3); line-height: 1.65; letter-spacing: .02em; }
.callout { border-radius: 16px; padding: 16px 17px; margin: 18px 0; border-left: 2px solid var(--accent); background: var(--accent-soft); }
.callout.warn { border-left-color: var(--red); background: #F8EAE7; }
.callout.tip { border-left-color: var(--sage); background: var(--sage-soft); }
.callout.good { border-left-color: var(--sage); background: var(--sage-soft); }
.co-title { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.co-body { font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.list-block { margin: 14px 0; }
.lb-title { font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.list-block ul { list-style: none; display: grid; gap: 7px; }
.list-block li { position: relative; padding-left: 15px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.list-block li::before { content: ''; position: absolute; left: 2px; top: 10px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.tbl { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 12.5px; background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-1); }
.tbl th { background: var(--paper-2); text-align: left; padding: 10px 12px; font-weight: 600; font-size: 12px; color: var(--ink-2); letter-spacing: .02em; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; line-height: 1.7; }
.status-card { background: var(--card); border: none; border-radius: 18px; padding: 17px 18px; margin-bottom: 13px; box-shadow: var(--shadow-1); }
.status-title { font-weight: 600; font-size: 14.5px; margin-bottom: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font-size: 12.5px; padding: 5px 12px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.chip.done { background: var(--sage-soft); color: #3F5F49; }
.chip.working { background: var(--amber-soft); color: #856018; }
.chip.next { background: var(--blue-soft); color: #42607C; }
.status-legend { font-size: 11px; color: var(--ink-3); margin-top: 11px; letter-spacing: .03em; }
.book-item { background: var(--card); border: none; border-radius: 18px; padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow-1); }
.book-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.book-title { font-weight: 600; font-size: 15px; }
.book-author { font-size: 11.5px; color: var(--ink-3); }
.book-tag { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: var(--sage-soft); color: #3F5F49; }
.book-body { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.75; }
.book-how { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); line-height: 1.75; }
.book-how b { color: var(--ink); }
.soft-note { margin-top: 32px; padding: 15px 17px; font-size: 11px; color: var(--ink-3); line-height: 1.85; background: var(--paper-2); border-radius: 14px; }
.empty-stage { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty-stage h2 { color: var(--ink-2); margin-bottom: 8px; }

/* ---------------- 弹层 ---------------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(34, 30, 26, .38);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--card); width: 100%; max-width: 480px;
  border-radius: 26px 26px 0 0;
  padding: 24px 20px calc(24px + var(--safe-b));
  max-height: 90vh; overflow-y: auto;
  animation: slideup .26s cubic-bezier(.22, .8, .3, 1);
}
@keyframes slideup { from { transform: translateY(24px); opacity: .6; } }
.modal h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 16px; letter-spacing: .01em; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 7px; letter-spacing: .06em; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line-2); border-radius: 13px;
  padding: 11px 13px; background: var(--paper); font-size: 15px;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.75; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.btn { height: 40px; padding: 0 19px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13.5px; letter-spacing: .04em; }
.btn.ghost { background: var(--paper-2); color: var(--ink-2); }
.btn.small { height: 34px; padding: 0 15px; font-size: 12.5px; }
.kind-select { display: flex; gap: 7px; flex-wrap: wrap; }
.kind-opt { font-size: 13px; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; background: var(--paper-2); color: var(--ink-2); }
.kind-opt.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.action-list { display: grid; gap: 2px; }
.action-list button {
  text-align: left; padding: 14px 4px; font-size: 15px;
  border-bottom: 1px solid var(--line-2); color: var(--ink);
}
.action-list button:last-child { border-bottom: none; }
.action-list button.danger { color: var(--red); }

/* 大图 */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: #14110E;
  display: grid; place-items: center; animation: fade .18s;
}
.lb-stage { max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lb-stage img, .lb-stage video { max-width: 94vw; max-height: 76vh; object-fit: contain; border-radius: 4px; }
.lb-meta { color: #fff; text-align: center; margin-top: 14px; max-width: 640px; }
.lb-date { font-size: 11.5px; opacity: .55; letter-spacing: .1em; }
.lb-text { font-family: var(--serif); font-size: 15.5px; margin-top: 6px; line-height: 1.6; opacity: .92; }
.lb-count { font-size: 11px; opacity: .35; margin-top: 8px; }
.lb-close {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, .12); font-size: 20px;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, .12); font-size: 22px; line-height: 1;
}
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 999px; z-index: 300;
  opacity: 0; pointer-events: none; transition: .22s;
  white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 悬浮记录按钮 */
.fab {
  position: fixed; right: 20px; bottom: calc(92px + var(--safe-b)); z-index: 35;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(27, 25, 22, .22);
  transition: transform .18s;
}
.fab svg { width: 23px; height: 23px; }
.fab:active { transform: scale(.93); }
.fab-top { display: none; }
.fab-top.show { display: grid; }

/* ---------------- 桌面端 ---------------- */
@media (min-width: 900px) {
  .topbar { display: none; }
  .tabbar {
    left: 0; top: 0; right: auto; bottom: 0; width: 236px;
    flex-direction: column; justify-content: flex-start;
    padding: 32px 16px 20px; border-top: none; border-right: 1px solid var(--line-2);
    background: rgba(246, 244, 240, .92);
  }
  .brand { display: block; padding: 0 10px 26px; }
  .brand-name { font-family: var(--serif); font-size: 21px; letter-spacing: .05em; font-weight: 600; }
  .brand-sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; letter-spacing: .06em; }
  .tabs-nav { flex: 0 0 auto; flex-direction: column; gap: 2px; }
  .tab-btn {
    flex-direction: row; justify-content: flex-start; gap: 11px;
    padding: 10px 12px; border-radius: 11px; font-size: 14px;
  }
  .tab-btn svg { width: 19px; height: 19px; }
  .tab-btn span { font-size: 14px; letter-spacing: .02em; }
  .tab-btn.active { background: var(--paper-2); color: var(--ink); font-weight: 500; }
  .tab-btn:hover { color: var(--ink); }
  .tab-btn.active:hover { color: var(--ink); }
  .rail-foot { display: block; margin-top: auto; }
  .share-btn {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 9px 11px; border-radius: 10px;
    color: var(--ink-2); font-size: 13px; border: 1px dashed var(--line);
  }
  .share-btn svg { width: 17px; height: 17px; }
  .share-btn:hover { background: var(--card); }
  .foot-note { font-size: 10.5px; color: var(--ink-3); padding: 10px 4px 0; line-height: 1.6; }
  .main { margin-left: 236px; padding-bottom: 40px; }
  .view { max-width: 760px; padding: 34px 40px 60px; }
  .day-label { top: 0; }
  .grid-photos { grid-template-columns: repeat(4, 1fr); }
  .stat-cards { grid-template-columns: repeat(4, 1fr); }
  .modal-bg { align-items: center; }
  .modal { border-radius: 18px; max-width: 440px; }
  .fab { bottom: 28px; right: 28px; }
  .toast { bottom: 34px; }
  h1 { font-size: 32px; }
}


/* ---------------- 打印 ---------------- */
@media print {
  html, body { background: #fff; }
  .topbar, .tabbar, .fab, .composer, .seg, .month-picker, .toast, .daily, .filters, .print-hide { display: none !important; }
  .main { margin: 0; padding: 0; }
  .view { max-width: none; padding: 0; }
  .sheet { box-shadow: none; border: none; }
  .rv-block { break-inside: avoid; }
}

/* ---------------- 口令门（从外网打开时） ---------------- */
.gate {
  position: fixed; inset: 0; z-index: 90;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card { width: 100%; max-width: 340px; text-align: center; }
.gate-card h1 { font-size: 25px; margin-bottom: 12px; }
.gate-card p { font-size: 13px; color: var(--ink-2); line-height: 1.85; }
.gate-pin {
  width: 100%; margin: 22px 0 4px; padding: 15px 8px;
  text-align: center; font-size: 24px; letter-spacing: .34em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 16px;
  color: var(--ink); box-shadow: var(--shadow-1);
}
.gate-pin:focus { border-color: #E7D6C8; box-shadow: 0 0 0 4px rgba(163, 97, 62, .06); }
.gate-err { color: var(--red); font-size: 12.5px; min-height: 20px; margin-bottom: 10px; }
.gate-btn {
  width: 100%; height: 47px; border-radius: 15px;
  background: var(--ink); color: #fff; font-size: 14.5px; letter-spacing: .08em;
}
.gate-hint { margin-top: 18px; font-size: 11px; color: var(--ink-3); line-height: 1.8; }
/* 多人协作：谁刚记的 */
.sync-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin-right: 5px; vertical-align: middle; }

/* 相册顶部：批量导入入口 */
.album-tools {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 14px; padding: 0 2px;
}
.album-import {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); text-decoration: none;
  transition: background .15s, color .15s;
}
.album-import:hover { background: #EAE3D9; color: var(--ink); }
.album-import:active { transform: scale(.97); }

/* 家人一起用 · 已授权设备 */
/* 地址固定以后，家里人多了、链接可能被转出去，这块让人能一眼看见谁在用 */
.dev-block {
  background: var(--paper-2);
  border-radius: 16px;
  padding: 14px 14px 12px;
  margin: 0 0 14px;
}
.dev-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; color: var(--ink); margin-bottom: 6px;
}
.dev-count { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dev-list { display: grid; }
.dev-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.dev-row:last-child { border-bottom: 0; }
.dev-txt { flex: 1; min-width: 0; }
.dev-name {
  font-size: 13px; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.dev-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: var(--ink); color: #fff; letter-spacing: .02em;
}
.dev-sub {
  font-size: 11.5px; color: var(--ink-3); margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dev-kick {
  flex: 0 0 auto; font-size: 12px; padding: 5px 11px;
  border-radius: 999px; background: transparent; color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(176, 74, 58, .22);
  transition: background .15s;
}
.dev-kick:active { background: rgba(176, 74, 58, .07); }
.dev-kick:disabled { opacity: .45; }
.dev-hint {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.75;
  margin: 10px 0;
}
.dev-rotate { width: 100%; height: 42px; font-size: 13px; border-radius: 13px; }
.dev-switch {
  display: flex; align-items: center; gap: 9px;
  margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.dev-switch input { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; }
.dev-tag.warn { background: var(--amber); }
.dev-ok {
  flex: 0 0 auto; font-size: 12px; padding: 5px 11px;
  border-radius: 999px; background: var(--ink); color: #fff;
}
.dev-ok:disabled { opacity: .45; }
