/* 「还在」——交换日记风格样式。墨蓝写在暖信纸上，旧玫瑰点缀，打字机日期戳。
   手机优先（375px 起）。全站自托管字体，无外部资源。 */

/* ---------- 字体 ---------- */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("/vendor/fonts/fraunces-400.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("/vendor/fonts/fraunces-600.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 400;
  font-display: swap; src: url("/vendor/fonts/fraunces-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Courier Prime"; font-style: normal; font-weight: 400;
  font-display: swap; src: url("/vendor/fonts/courierprime-400.woff2") format("woff2");
}
@font-face {
  font-family: "Courier Prime"; font-style: italic; font-weight: 400;
  font-display: swap; src: url("/vendor/fonts/courierprime-400-italic.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --paper: #F2E9D8;      /* 暖象牙信纸底 */
  --page: #FBF6EA;       /* 更亮的书页 */
  --page-2: #F6EEDD;     /* 次级页面块 */
  --ink: #26364A;        /* 墨蓝正文 */
  --ink-soft: #5D6B7A;   /* 次级文字 */
  --ink-faint: #9AA4AF;  /* 极淡/占位 */
  --rose: #B26A72;       /* 旧玫瑰点缀 */
  --rose-soft: #C98F95;
  --tape: #E7D3A8;       /* 胶带/相角暖调 */
  --rule: rgba(38,54,74,.10);
  --margin: rgba(178,106,114,.32);
  --line: rgba(38,54,74,.16);
  --shadow: rgba(38,54,74,.14);

  --serif: "Fraunces", Georgia, "Songti SC", serif;
  --type: "Courier Prime", "Courier New", ui-monospace, monospace;
  --sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --wrap: 640px;
  --tabh: 60px;
}

/* ---------- reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* 极淡纸纤维噪点，纯内联 SVG，无外部请求 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--ink); }
a { color: var(--rose); text-decoration: none; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; border-radius: 2px; }

/* ---------- 通用排版件 ---------- */
.stamp {          /* 打字机日期戳/小标签 */
  font-family: var(--type);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.serif { font-family: var(--serif); }
.num { font-family: var(--serif); font-feature-settings: "onum" 1, "pnum" 1; }
.eyebrow {
  font-family: var(--type);
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--rose); margin: 0 0 .5em;
}
.hr-rose {
  border: none; height: 0; border-top: 1px solid var(--margin);
  margin: 1.2rem 0;
}

/* ---------- app 容器 ---------- */
#app { min-height: 100vh; }
.screen {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 18px calc(var(--tabh) + 28px);
  min-height: 100vh;
}
.screen.no-tab { padding-bottom: 40px; }

/* ---------- masthead 刊头 ---------- */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 20px 2px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.masthead .site {
  font-family: var(--serif); font-weight: 600;
  font-size: 26px; letter-spacing: .02em; line-height: 1;
}
.masthead .site .cn { font-family: var(--sans); font-weight: 600; }
.masthead .right { display: flex; align-items: center; gap: 14px; }
.masthead .today-stamp { white-space: nowrap; }
.icon-btn {
  background: none; border: none; padding: 4px; line-height: 0;
  color: var(--ink-soft); border-radius: 50%;
}
.icon-btn:hover { color: var(--rose); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 首页 hero ---------- */
.hero { text-align: center; padding: 30px 0 12px; }
.hero .eyebrow { margin-bottom: .8em; }
.hero .dayn {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(84px, 34vw, 150px);
  line-height: .86; letter-spacing: -.01em;
  color: var(--ink);
  font-feature-settings: "lnum" 1;
}
.hero .dayn-label {
  font-family: var(--sans); font-size: 17px; color: var(--ink-soft);
  margin-top: 10px; letter-spacing: .05em;
}
.hero .dayn-label b { color: var(--ink); font-weight: 600; }
.streak {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 0 4px;
  font-family: var(--type); font-size: 12.5px; letter-spacing: .06em;
  color: var(--ink-soft);
}
.streak::before, .streak::after {
  content: ""; width: 34px; height: 1px; background: var(--margin);
}
.streak .heart { color: var(--rose); }

/* ---------- 对页（签名元素）---------- */
.spread {
  margin: 26px 0 8px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 10px 30px -18px var(--shadow), 0 1px 0 rgba(255,255,255,.6) inset;
  overflow: hidden;
  position: relative;
}
.spread-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
}
.spread-head .label { font-family: var(--serif); font-size: 15px; font-style: italic; color: var(--ink-soft); }
.pages { display: grid; grid-template-columns: 1fr; }
/* 手机上下叠，共用装订缝；宽屏并排 */
.page {
  position: relative;
  padding: 18px 18px 20px;
  min-height: 150px;
  /* 信纸横格 */
  background-image: repeating-linear-gradient(
    to bottom, transparent, transparent 31px, var(--rule) 31px, var(--rule) 32px);
  background-position: 0 44px;
}
.page + .page { border-top: 1px dashed var(--margin); }
.page .who {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
}
.page .who .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line); background: var(--page-2); flex: none; }
.page .who .name { font-weight: 600; font-size: 15px; }
.page .who .side { margin-left: auto; }
.page .photo-mount { margin: 6px 0 12px; }
.page .note {
  font-family: var(--serif); font-size: 18px; line-height: 1.55;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.page.empty .placeholder {
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px; min-height: 80px;
}
.page.mine .who .name::after { content: " · 你"; color: var(--rose); font-weight: 400; font-size: 12px; font-family: var(--type); }

@media (min-width: 560px) {
  .pages { grid-template-columns: 1fr 1fr; }
  .page + .page { border-top: none; border-left: 1px solid var(--margin); }
  /* 中缝装订阴影 */
  .pages::after {
    content: ""; grid-column: 1 / -1; }
  .spread .pages { position: relative; }
  .spread .pages::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
    width: 22px; transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(38,54,74,.06) 45%, rgba(38,54,74,.10) 50%, rgba(38,54,74,.06) 55%, transparent);
    pointer-events: none; z-index: 1;
  }
}

/* ---------- 照片相角 / 胶带 ---------- */
.photo-mount {
  position: relative; display: inline-block; max-width: 100%;
}
.photo-mount img {
  border: 5px solid #fff;
  box-shadow: 0 8px 20px -12px var(--shadow);
  border-radius: 2px;
  width: 100%;
}
.photo-mount.tilt { transform: rotate(-1.3deg); }
.photo-mount.tilt2 { transform: rotate(1deg); }
/* 胶带 */
.photo-mount.tape::before {
  content: ""; position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 74px; height: 20px; background: var(--tape); opacity: .72;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 11px 20px; border-radius: 2px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  transition: background .18s, color .18s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--rose); border-color: var(--rose); color: #fff8f3; }
.btn.primary:hover { background: #a35c64; }
.btn.ghost { border-color: var(--line); color: var(--ink-soft); font-weight: 500; }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.link-btn {
  background: none; border: none; padding: 0; color: var(--rose);
  font-family: var(--type); font-size: 12.5px; letter-spacing: .04em;
  text-decoration: underline; text-underline-offset: 3px;
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 表单（信纸下划线感）---------- */
.field { margin: 16px 0; }
.field > label {
  display: block; font-family: var(--type); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 7px;
}
.field input[type=text], .field input[type=date], .field input[type=password],
.field textarea, .field select {
  width: 100%; background: transparent; border: none;
  border-bottom: 1.5px solid var(--line); padding: 8px 2px;
  border-radius: 0; transition: border-color .18s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-bottom-color: var(--rose);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.6; font-family: var(--sans); }
.field .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }
.field.note-serif textarea { font-family: var(--serif); font-size: 17px; }

/* 头像/照片选择块 */
.pick { display: flex; align-items: center; gap: 14px; }
.pick .preview {
  width: 66px; height: 66px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--line); background: var(--page-2); flex: none;
}
.pick .preview.square { border-radius: 4px; }

/* ---------- 卡片列表通用 ---------- */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 0 14px;
}
.section-title h2 { font-family: var(--serif); font-weight: 600; font-size: 23px; margin: 0; }
.section-title .stamp { flex: none; }

.paper-card {
  background: var(--page); border: 1px solid var(--line); border-radius: 3px;
  padding: 16px 16px; margin-bottom: 14px;
  box-shadow: 0 8px 24px -20px var(--shadow);
}
.paper-card h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 0 0 4px; }
.paper-card .meta { font-family: var(--type); font-size: 12px; letter-spacing: .08em; color: var(--ink-soft); }
.paper-card .body { margin-top: 8px; white-space: pre-wrap; word-break: break-word; }

/* 缩略图网格 */
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumbs .th { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 2px;
  background: var(--page-2); border: 1px solid var(--line); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs.big { grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* 相册列表 */
.album-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.album-cell { text-align: left; background: none; border: none; padding: 0; }
.album-cell .cover {
  aspect-ratio: 4/3; overflow: hidden; border-radius: 2px;
  border: 5px solid #fff; box-shadow: 0 8px 22px -14px var(--shadow);
  background: var(--page-2);
}
.album-cell .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cell .t { font-family: var(--serif); font-weight: 600; font-size: 16px; margin-top: 8px; }
.album-cell .m { font-family: var(--type); font-size: 11px; color: var(--ink-soft); letter-spacing: .06em; }

/* ---------- 月历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.cal-head .m-label { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-grid .dow { font-family: var(--type); font-size: 10px; color: var(--ink-soft);
  text-align: center; letter-spacing: .04em; padding-bottom: 4px; }
.cal-cell {
  aspect-ratio: 1; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--page); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-family: var(--type); font-size: 12px; color: var(--ink-soft);
  position: relative; padding: 0;
}
.cal-cell.blank { border: none; background: none; }
.cal-cell .d { font-size: 11px; }
.cal-cell .mark { width: 15px; height: 14px; }
.cal-cell.today { outline: 1.5px solid var(--rose); outline-offset: -1px; }
.cal-cell.both { background: #efe0dd; }
.cal-legend { display: flex; gap: 16px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--type); font-size: 11px; color: var(--ink-soft); }
.cal-legend .m { width: 15px; height: 14px; }

/* heart 标记 */
.hmark { display: inline-block; line-height: 0; }

/* ---------- 城市地图 ---------- */
.map-wrap {
  background: var(--page); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px; overflow: hidden; box-shadow: 0 8px 24px -20px var(--shadow);
  position: relative;
}
.map-scroll { width: 100%; overflow-x: auto; }
.map-wrap svg { width: 100%; height: auto; display: block; }
.map-wrap svg .prov { fill: var(--page-2); stroke: var(--line); stroke-width: .8; }
.map-wrap svg .prov.has { fill: #ecdcd9; }
.map-wrap .pin { fill: var(--rose); stroke: #fff; stroke-width: 1.2; cursor: pointer; }
.map-wrap .pin-label { font-family: var(--type); font-size: 9px; fill: var(--ink); }
.map-hint { font-family: var(--type); font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: 8px; }
.city-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.city-chip {
  font-family: var(--type); font-size: 12px; letter-spacing: .04em;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 40px;
  background: var(--page); color: var(--ink);
}
.city-chip.overseas { border-style: dashed; }
.city-chip .cnt { color: var(--rose); }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; margin: 8px 0 0; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 1.5px; background: var(--margin);
}
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--rose);
}
.tl-item.goal::before { background: var(--rose); }
.tl-item .tl-date { font-family: var(--type); font-size: 11.5px; letter-spacing: .08em; color: var(--ink-soft); }
.tl-item h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 3px 0 4px; }
.tl-item .tl-tag { font-family: var(--type); font-size: 10px; color: var(--rose); letter-spacing: .1em; text-transform: uppercase; }
.tl-item .tl-body { white-space: pre-wrap; word-break: break-word; color: var(--ink); }

/* ---------- 一起做 ---------- */
.goal-group + .goal-group { margin-top: 24px; }
.goal-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 4px; border-bottom: 1px solid var(--rule);
}
.goal-check {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--rose); background: transparent; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.goal-item.done .goal-check { background: var(--rose); }
.goal-item .g-title { font-family: var(--serif); font-size: 17px; }
.goal-item.done .g-title { color: var(--ink-soft); }
.goal-item .g-note { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.goal-item .g-done-note { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 15px; margin-top: 6px; }
.goal-item .g-thumbs { margin-top: 8px; }
.goal-item .g-main { flex: 1; min-width: 0; }
.goal-item .g-edit { flex: none; }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center; padding: 44px 20px; color: var(--ink-soft);
}
.empty-state .big { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin: 6px 0 18px; }

/* ---------- 底部纸 tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabh);
  display: flex; z-index: 50;
  background: var(--page);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -20px var(--shadow);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-soft); font-size: 11px; font-family: var(--sans);
  border-top: 2px solid transparent; margin-top: -1px;
}
.tabbar a .ti { font-family: var(--serif); font-weight: 600; font-size: 15px; line-height: 1; }
.tabbar a.active { color: var(--rose); border-top-color: var(--rose); }

/* ---------- 口令墙 / 设置向导 ---------- */
.gate {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 26px; text-align: center; max-width: 460px; margin: 0 auto;
}
.gate .brand { font-family: var(--serif); font-weight: 600; font-size: 46px; letter-spacing: .04em; }
.gate .brand.cn { font-family: var(--sans); }
.gate .tag { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 17px; margin-top: 6px; }
.gate form { width: 100%; margin-top: 26px; text-align: left; }
.gate .err { color: var(--rose); font-size: 13.5px; min-height: 20px; margin-top: 8px; font-family: var(--type); }
.gate .foot { margin-top: auto; padding-top: 30px; font-family: var(--type); font-size: 11px; color: var(--ink-faint); }

/* 身份选择 */
.identity {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; margin-top: 28px;
}
.identity button {
  background: var(--page); border: 1.5px solid var(--line); border-radius: 4px;
  padding: 22px 10px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  transition: border-color .18s, transform .06s;
}
.identity button:hover { border-color: var(--rose); }
.identity button:active { transform: translateY(1px); }
.identity .av { width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 1.5px solid var(--line); background: var(--page-2); }
.identity .nm { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.identity .role { font-family: var(--type); font-size: 11px; color: var(--ink-soft); letter-spacing: .1em; }

/* 向导步骤 */
.wizard { width: 100%; text-align: left; }
.wizard .step-stamp { font-family: var(--type); font-size: 11px; letter-spacing: .2em; color: var(--rose); text-transform: uppercase; }
.wizard h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 6px 0 4px; }
.wizard .sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 18px; }
.wizard .nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.wizard .dots { display: flex; gap: 7px; justify-content: center; margin-top: 22px; }
.wizard .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.wizard .dots i.on { background: var(--rose); }

/* ---------- Modal / sheet ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(38,54,74,.34);
  z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.sheet-mask.on { opacity: 1; }
.sheet {
  background: var(--paper); width: 100%; max-width: var(--wrap);
  max-height: 92vh; overflow-y: auto; border-radius: 12px 12px 0 0;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px -20px rgba(0,0,0,.4);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.sheet-mask.on .sheet { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 3px; background: var(--line); margin: 8px auto 12px; }
.sheet h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 2px 0 4px; }
.sheet .sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet .sheet-actions .btn { flex: 1; }

/* 上传预览多图 */
.upload-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.upload-preview .up {
  position: relative; aspect-ratio: 1; border-radius: 2px; overflow: hidden;
  border: 1px solid var(--line); background: var(--page-2);
}
.upload-preview .up img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .up .x {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(38,54,74,.72); color: #fff; border: none; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.upload-preview .up.add {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 26px; border-style: dashed; background: none;
}
.add-photo-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px dashed var(--line); background: none; color: var(--ink-soft);
  padding: 10px 16px; border-radius: 3px; font-size: 14px; font-family: var(--sans);
}

/* 大图查看器 */
.viewer {
  position: fixed; inset: 0; background: rgba(28,24,20,.94); z-index: 200;
  display: flex; flex-direction: column; opacity: 0; transition: opacity .2s;
}
.viewer.on { opacity: 1; }
.viewer .v-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
  color: #f0e8da; font-family: var(--type); font-size: 12px; }
.viewer .v-top button { background: none; border: none; color: #f0e8da; font-size: 22px; }
.viewer .v-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viewer .v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .v-cap { padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  color: #d9cfbf; font-family: var(--serif); font-style: italic; text-align: center; min-height: 20px; }
.viewer .v-nav { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none;
  color: #f0e8da; font-size: 40px; padding: 20px; opacity: .8; }
.viewer .v-nav.prev { left: 0; }
.viewer .v-nav.next { right: 0; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabh) + 20px); transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--page); padding: 10px 18px; border-radius: 40px;
  font-size: 14px; z-index: 300; opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 加载态 */
.loading { text-align: center; padding: 80px 20px; color: var(--ink-soft);
  font-family: var(--serif); font-style: italic; font-size: 18px; }

/* 小工具 */
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.mt24 { margin-top: 24px; }
.spacer { flex: 1; }
.tiny { font-size: 12px; }
.pill-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 40px; overflow: hidden; margin: 4px 0 14px; }
.pill-toggle button { background: none; border: none; padding: 7px 18px; font-family: var(--type); font-size: 12px; letter-spacing: .06em; color: var(--ink-soft); }
.pill-toggle button.on { background: var(--rose); color: #fff8f3; }

/* checkbox 行 */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); margin: 10px 0; }
.check-row input { width: 18px; height: 18px; accent-color: var(--rose); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
