/* ============================================================================
 *  我们的小宇宙 · 视觉系统
 *  方向：夜空是封面，纸是内页。
 *  —— 墨蓝夜色 + 暖象牙文字 + 单一朱砂红；字体用高对比衬线（数字）+ 宋体（中文）；
 *     用发丝线、留白与印刷质感替代玻璃拟态；动效克制，像纸页落定、印章按下。
 * ==========================================================================*/

@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* 夜 */
  --night-0: #070a0f;
  --night-1: #0a0e14;
  --night-2: #10151d;
  --night-3: #161c25;

  /* 墨与纸 */
  --ivory: #f2ede3;
  --ivory-2: #cfc7ba;
  --muted: #948c7f;
  --dim: #877f73;
  --paper: #f4eee2;
  --paper-2: #ece4d4;
  --ink: #22201d;
  --ink-2: #5d554a;
  --seal: #b23a2e;
  --seal-2: #8e2a21;
  --seal-lit: #cf6a5c;

  /* 线 */
  --line: rgba(242, 237, 227, 0.11);
  --line-2: rgba(242, 237, 227, 0.2);
  --line-ink: rgba(34, 32, 29, 0.16);

  /* 字 */
  --serif: "Instrument Serif", "Noto Serif SC", "Songti SC", "Source Han Serif SC",
    "STSong", "STZhongsong", serif;
  --zh-serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong",
    "STZhongsong", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --tab-h: 58px;
  --page-x: 22px;
}

/* ============================================================================
 *  基础
 * ==========================================================================*/
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }

html { background: var(--night-0); }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ivory);
  background:
    radial-gradient(120% 62% at 50% -14%, rgba(74, 96, 126, 0.26), transparent 62%),
    radial-gradient(60% 38% at 92% 4%, rgba(120, 64, 56, 0.13), transparent 66%),
    radial-gradient(90% 50% at 8% 118%, rgba(46, 60, 78, 0.24), transparent 66%),
    linear-gradient(180deg, #080b11 0%, var(--night-0) 52%, #05070a 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}
body.locked { overflow: hidden; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
a { color: inherit; }

::selection { background: rgba(178, 58, 46, 0.32); color: #fff; }

:focus-visible {
  outline: 1px solid var(--seal);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ============================================================================
 *  背景层
 * ==========================================================================*/
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(82% 46% at 74% -6%, rgba(122, 150, 190, 0.1), transparent 62%),
    radial-gradient(46% 30% at 14% 8%, rgba(100, 118, 150, 0.08), transparent 64%),
    radial-gradient(120% 58% at 50% 116%, rgba(110, 66, 56, 0.1), transparent 62%);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ============================================================================
 *  图标
 * ==========================================================================*/
.ico {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* ============================================================================
 *  通用文字
 * ==========================================================================*/
.eyebrow {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.serif { font-family: var(--serif); }
.zh-serif { font-family: var(--zh-serif); }

.link {
  border: 0;
  background: none;
  padding: 4px 0;
  margin: -4px 0;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.25s;
}
.link .ico { width: 13px; height: 13px; }
.link:active { color: var(--ivory); }

.rule { display: block; height: 1px; background: var(--line); }

/* ============================================================================
 *  封面 / 锁屏
 * ==========================================================================*/
.lock {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) var(--page-x) max(22px, env(safe-area-inset-bottom));
  background:
    radial-gradient(70% 46% at 50% 34%, rgba(96, 120, 156, 0.1), transparent 70%),
    rgba(5, 7, 10, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: opacity 0.5s ease, visibility 0.5s;
}
.lock-inner {
  width: 100%;
  max-width: 400px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  padding-top: 18px;
  animation: rise 0.9s var(--ease-out) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.lock-head { text-align: center; }
.lock-brand {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 9px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--dim);
}
.lock-brand i { width: 14px; height: 1px; background: var(--line-2); }

.chart {
  width: 220px;
  max-width: 62%;
  margin: 6px auto 2px;
  opacity: 0.9;
}
.chart svg { display: block; width: 100%; height: auto; overflow: visible; animation: fadeIn 1.6s ease both; }
.chart-line {
  stroke: rgba(242, 237, 227, 0.2);
  stroke-width: 0.7;
  fill: none;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: draw 2.6s var(--ease-out) 0.35s both;
}
.chart-line.soft { stroke: rgba(242, 237, 227, 0.1); animation-delay: 0.7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-star { fill: rgba(242, 237, 227, 0.72); animation: twinkle 4.5s ease-in-out infinite; }
.chart-star.dim { fill: rgba(242, 237, 227, 0.34); animation-delay: -2s; }
.chart-star:nth-of-type(2n) { animation-delay: -1.2s; }
.chart-star:nth-of-type(3n) { animation-delay: -2.8s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.lock-title {
  margin: 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: clamp(28px, 8.4vw, 36px);
  line-height: 1.25;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: var(--ivory);
}
.lock-sub {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--muted);
}

.lock-pick { margin-top: 46px; }
.lock-thread {
  display: block;
  flex: 0 0 auto;
  width: 1px;
  height: 40px;
  margin: auto;
  position: relative;
  background: linear-gradient(180deg, transparent, rgba(242, 237, 227, 0.26), transparent);
}
.lock-thread::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: rgba(242, 237, 227, 0.5);
}
.lock-enter {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 26px;
}

.who { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 16px 8px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(242, 237, 227, 0.015);
  transition: border-color 0.35s, background 0.35s, transform 0.35s var(--ease);
}
.who-seal {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-family: var(--zh-serif);
  font-size: 17px;
  color: var(--ivory-2);
  transition: all 0.35s var(--ease);
}
.who-name {
  font-family: var(--zh-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ivory-2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who-tag { font-size: 9px; letter-spacing: 0.3em; color: var(--dim); }
.who-card.active {
  border-color: rgba(178, 58, 46, 0.55);
  background: rgba(178, 58, 46, 0.06);
}
.who-card.active .who-seal {
  background: var(--seal);
  border-color: var(--seal);
  color: #fdf6ef;
  transform: rotate(-2deg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset;
}
.who-card.active .who-name { color: var(--ivory); }
.who-card:active { transform: scale(0.985); }

.lock-form { display: flex; flex-direction: column; gap: 14px; }
.pass {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 10px;
  transition: border-color 0.3s;
}
.pass-label { font-size: 9px; letter-spacing: 0.3em; color: var(--dim); text-transform: uppercase; }
.pass input {
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ivory);
  font-size: 17px;
  letter-spacing: 0.32em;
  outline: none;
  -webkit-appearance: none;
  border-radius: 0;
}
.pass input::placeholder { color: var(--dim); letter-spacing: 0.08em; font-size: 14px; }
.pass:focus-within { border-bottom-color: var(--seal); }
.lock-form.shake { animation: shake 0.45s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

.enter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 3px;
  background: var(--seal);
  color: #fdf6ef;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 18px 36px -22px rgba(0, 0, 0, 0.9);
  transition: transform 0.25s var(--ease), background 0.25s;
}
.enter-btn .ico { width: 17px; height: 17px; opacity: 0.85; }
.enter-btn:active { transform: scale(0.985); background: var(--seal-2); }

.lock-hint {
  min-height: 1.1em;
  margin: -4px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ivory-2);
  opacity: 0;
  transition: opacity 0.25s;
}
.lock-hint.err { color: #e08b7d; opacity: 1; }
.lock-demo { margin: -6px 0 0; font-size: 9.5px; letter-spacing: 0.1em; color: var(--dim); }

.lock-foot { display: flex; align-items: center; gap: 14px; padding-top: 22px; padding-bottom: 4px; }
.lock-foot .rule { flex: 1; }
.lock-seal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--zh-serif);
  font-size: 10px;
  line-height: 1;
  border-radius: 2px;
  transform: rotate(-3deg);
  opacity: 0.92;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12) inset;
}

/* ============================================================================
 *  应用骨架
 * ==========================================================================*/
.app { position: relative; z-index: 1; min-height: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--page-x) 0;
  background: linear-gradient(180deg, rgba(7, 10, 15, 0.94) 26%, rgba(7, 10, 15, 0.6) 72%, rgba(7, 10, 15, 0));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.top-title { flex: 1; min-width: 0; }
.top-eyebrow {
  display: block;
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-title h1 {
  margin: 5px 0 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 16.5px;
  line-height: 1.1;
  letter-spacing: 0.1em;
  color: var(--ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 8.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.top-meta b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ivory-2);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ivory-2);
  transition: border-color 0.25s, color 0.25s;
}
.icon-btn:active { border-color: var(--line-2); color: var(--ivory); }

.view {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 6px var(--page-x) calc(var(--tab-h) + 48px + env(safe-area-inset-bottom));
}
.view > * { animation: reveal 0.62s var(--ease-out) both; }
.view > *:nth-child(1) { animation-delay: 0.02s; }
.view > *:nth-child(2) { animation-delay: 0.07s; }
.view > *:nth-child(3) { animation-delay: 0.12s; }
.view > *:nth-child(4) { animation-delay: 0.17s; }
.view > *:nth-child(5) { animation-delay: 0.21s; }
.view > *:nth-child(n + 6) { animation-delay: 0.24s; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 底部导航 */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(8, 11, 16, 0.88);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: none;
  color: rgba(242, 237, 227, 0.45);
  transition: color 0.3s;
}
.tab .ico { width: 21px; height: 21px; }
.tab i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.18em;
  line-height: 1;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.3s;
}
.tab.active { color: var(--ivory); }
.tab.active i { border-bottom-color: var(--seal); }

/* 中间的「写一条」：一颗凸起的朱砂印 */
.fab {
  position: relative;
  z-index: 2;
  justify-self: center;
  align-self: center;
  margin-top: -18px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fdf6ef;
  background: var(--seal);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 0 0 1px rgba(242, 237, 227, 0.12),
    0 16px 26px -16px rgba(0, 0, 0, 0.95);
  transition: transform 0.3s var(--ease), background 0.3s;
}
.fab .ico { width: 21px; height: 21px; }
.fab:active { transform: scale(0.93); background: var(--seal-2); }

/* ============================================================================
 *  版面元素
 * ==========================================================================*/
.block { margin-top: 36px; }

.sec {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sec h2 {
  margin: 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--ivory);
}
.sec-no {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--seal-lit);
  font-variant-numeric: tabular-nums;
}
.sec-sub {
  margin-left: auto;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quote-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 44px 0 10px;
  color: var(--dim);
  font-family: var(--zh-serif);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.quote-foot::before,
.quote-foot::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.page-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 12px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
}
.page-meta .count { font-family: var(--serif); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); }

/* ============================================================================
 *  首页
 * ==========================================================================*/
.hero { padding-top: 4px; }
.hero-eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dim);
}
.hero-eyebrow .since { font-family: var(--serif); font-size: 12px; letter-spacing: 0.14em; color: var(--muted); }

.hero-count {
  display: flex;
  align-items: flex-end;
  gap: 11px;
  margin: 16px 0 0;
}
.hero-count .num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(84px, 25vw, 118px);
  line-height: 0.78;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ivory);
  margin-left: -0.055em;
}
.hero-count .unit {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 7px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--zh-serif);
  font-size: 13px;
  border-radius: 2px;
  transform: rotate(-2deg);
  opacity: 0.95;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12) inset;
}

.hero-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.hero-meta .hms {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--ivory-2);
  font-variant-numeric: tabular-nums;
}
.hero-meta .cap {
  font-family: var(--zh-serif);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ledger.four { grid-template-columns: repeat(4, 1fr); }
.ledger > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 0 13px;
  min-width: 0;
}
.ledger > div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.ledger b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
}
.ledger span { font-size: 9px; letter-spacing: 0.2em; color: var(--dim); white-space: nowrap; }

/* 今天 */
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.today-list li:last-child { border-bottom: 0; }
.avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ivory-2);
  font-family: var(--zh-serif);
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: 0;
}
.avatar.her { background: var(--seal); border-color: var(--seal); color: #fdf6ef; }
.avatar.me { background: rgba(242, 237, 227, 0.07); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }

.t-info { min-width: 0; flex: 1; }
.t-info b {
  display: block;
  font-weight: 400;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--ivory);
}
.t-info span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-state { flex: 0 0 auto; color: var(--dim); display: grid; place-items: center; width: 22px; }
.t-state .ico { width: 17px; height: 17px; }
.today-list li.done .t-state { color: var(--seal); }
.t-state .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }

/* ============================================================================
 *  记录卡片
 * ==========================================================================*/
.feed { display: flex; flex-direction: column; }
.moment {
  padding: 18px 0 15px;
  border-bottom: 1px solid var(--line);
}
.moment:last-child { border-bottom: 0; }
.m-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.m-who { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.m-who b {
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ivory-2);
  white-space: nowrap;
}
.m-who span {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-mood {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.m-mood .ico { width: 14px; height: 14px; stroke-width: 1.5; }
.demo-tag {
  flex: 0 0 auto;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 4px 1px 5px;
}

.m-title {
  margin: 10px 0 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--ivory);
}
.m-text {
  margin: 6px 0 0;
  font-size: 14.8px;
  line-height: 1.92;
  letter-spacing: 0.01em;
  color: var(--ivory-2);
  word-break: break-word;
}

.m-photos {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  grid-template-columns: repeat(3, 1fr);
}
.m-photos.n1 { grid-template-columns: 1fr; }
.m-photos.n1 .m-photo { aspect-ratio: 4 / 3; }
.m-photos.n2 { grid-template-columns: 1fr 1fr; }
.m-photo {
  position: relative;
  padding: 0;
  border: 1px solid rgba(242, 237, 227, 0.14);
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--night-2);
}
.m-photo img { width: 100%; height: 100%; object-fit: cover; }
.m-photo .more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 10, 0.62);
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--ivory);
}

.m-foot { display: flex; align-items: center; margin-top: 9px; }
.react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 6px;
  margin-left: -6px;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: color 0.25s;
}
.react .ico { width: 17px; height: 17px; stroke-width: 1.5; transition: transform 0.3s var(--ease); }
.react.on { color: var(--seal-lit); }
.react.on .ico { fill: currentColor; }
.react:active .ico { transform: scale(1.22); }
.react b { font-weight: 400; }

.m-acts { margin-left: auto; display: flex; gap: 8px; }
.m-acts button {
  border: 0;
  background: none;
  min-height: 36px;
  padding: 0 8px;
  margin-right: -8px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  transition: color 0.25s;
}
.m-acts button:last-child { margin-right: -8px; }
.m-acts button:active { color: var(--ivory-2); }

/* ============================================================================
 *  时间流
 * ==========================================================================*/
.feed-tools { padding-top: 2px; }
.search-wrap { position: relative; border-bottom: 1px solid var(--line-2); }
.search-wrap .ico {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--dim);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 11px 0 11px 25px;
  border: 0;
  background: none;
  color: var(--ivory);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  outline: none;
  -webkit-appearance: none;
  border-radius: 0;
}
.search-wrap input::placeholder { color: var(--dim); }
.search-wrap:focus-within { border-bottom-color: var(--seal); }

.chips {
  display: flex;
  gap: 22px;
  margin-top: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 12px 0 10px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-bottom: -1px;
  transition: color 0.25s, border-color 0.25s;
}
.chip.active { color: var(--ivory); border-bottom-color: var(--seal); }

.month {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 2px;
}
.month h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}
.month h3 em {
  font-style: normal;
  font-family: var(--zh-serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-left: 3px;
}
.month .rule { flex: 1; align-self: center; }
.month .n { font-family: var(--serif); font-size: 11px; letter-spacing: 0.1em; color: var(--dim); }

/* ============================================================================
 *  相册
 * ==========================================================================*/
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.album-item {
  position: relative;
  padding: 0;
  border: 1px solid rgba(242, 237, 227, 0.12);
  border-radius: 2px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--night-2);
}
.album-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94);
  transition: transform 0.6s var(--ease), filter 0.4s;
}
.album-item:active img { transform: scale(1.05); filter: saturate(1); }
.album-date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 5px 4px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(242, 237, 227, 0.86);
  background: linear-gradient(180deg, transparent, rgba(5, 7, 10, 0.66));
  text-align: left;
  opacity: 0;
  transition: opacity 0.35s;
}
@media (hover: none) { .album-date { opacity: 1; } }
@media (hover: hover) { .album-item:hover .album-date { opacity: 1; } }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  touch-action: pan-y;
  display: grid;
  place-items: center;
  padding: 64px 0 40px;
  background: rgba(4, 6, 9, 0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease both;
}
.lb-bar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: var(--page-x);
  right: var(--page-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}
.lb-nav-group { display: flex; align-items: center; gap: 4px; }
.lb-count {
  min-width: 64px;
  text-align: center;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: none;
  color: var(--ivory-2);
}
.lb-close .ico { width: 17px; height: 17px; }
.lb-figure { margin: 0; width: min(100%, 620px); padding: 0 10px; }
.lb-img {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--paper);
  padding: 7px;
  border-radius: 1px;
  box-shadow: 0 40px 80px -40px #000, 0 0 0 1px rgba(0, 0, 0, 0.4);
  animation: plate 0.45s var(--ease-out) both;
}
@keyframes plate {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: none; }
}
.lb-img img { max-width: 100%; max-height: 66svh; object-fit: contain; }
.lb-figure figcaption { margin-top: 15px; text-align: center; padding: 0 6px; }
.lb-figure figcaption b {
  display: block;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ivory);
}
.lb-figure figcaption span {
  display: block;
  margin-top: 5px;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}
.lb-nav {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--ivory-2);
  transition: border-color 0.25s, color 0.25s;
}
.lb-nav:active { border-color: var(--line-2); color: var(--ivory); }
.lb-nav .ico { width: 16px; height: 16px; }

/* ============================================================================
 *  我们
 * ==========================================================================*/
.pair-hero { text-align: center; padding: 14px 0 4px; }
.pair-mark { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pair-amp {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--seal);
}
.pair-amp .ico { width: 18px; height: 18px; }
.pair-names {
  margin: 18px 0 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.1em;
  color: var(--ivory);
  line-height: 1.5;
}
.pair-names i {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--seal);
  margin: 0 6px;
}
.pair-since {
  margin: 8px 0 0;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.entries { margin-top: 34px; border-top: 1px solid var(--line); }
.entry {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  transition: opacity 0.25s;
}
.entry:active { opacity: 0.66; }
.entry-ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.entry-ico .ico { width: 20px; height: 20px; stroke-width: 1.4; }
.entry-body { flex: 1; min-width: 0; }
.entry-body b {
  display: block;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--ivory);
}
.entry-body i {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-arrow { flex: 0 0 auto; color: var(--dim); display: grid; place-items: center; }
.entry-arrow .ico { width: 16px; height: 16px; }

.identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 30px 0 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}
.identity b { font-weight: 400; color: var(--muted); }

/* ============================================================================
 *  大事记
 * ==========================================================================*/
.add-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  margin-bottom: 22px;
  border: 1px dashed var(--line-2);
  border-radius: 3px;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  transition: border-color 0.25s, color 0.25s;
}
.add-row .ico { width: 15px; height: 15px; }
.add-row:active { border-color: var(--seal); color: var(--ivory-2); }

.timeline { position: relative; margin: 0; padding: 0 0 0 22px; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 14px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2) 10%, var(--line-2) 82%, transparent);
}
.timeline li { position: relative; padding-bottom: 30px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--night-0);
  border: 1px solid var(--seal);
  box-shadow: 0 0 0 3px rgba(178, 58, 46, 0.14);
}
.tl-head { display: flex; align-items: center; gap: 10px; }
.tl-date {
  display: block;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tl-title {
  margin: 7px 0 4px;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.06em;
  color: var(--ivory);
}
.tl-text { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--ivory-2); }
.tl-del {
  margin-left: auto;
  border: 0;
  background: none;
  min-height: 32px;
  padding: 0 4px;
  margin-right: -4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

/* ============================================================================
 *  情书（纸）
 * ==========================================================================*/
.letter {
  position: relative;
  margin: 8px 0 4px;
  padding: 34px 26px 30px;
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(34, 32, 29, 0.045) 0.6px, transparent 0.8px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0.03));
  background-size: 3px 3px, 100% 100%;
  color: var(--ink);
  border-radius: 1px;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.16),
    0 40px 80px -46px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.letter::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--seal);
  opacity: 0.86;
}
.letter::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid var(--line-ink);
  opacity: 0.5;
}
.letter-head { position: relative; text-align: center; margin-bottom: 26px; }
.letter-head .eyebrow { color: rgba(34, 32, 29, 0.42); }
.letter-title {
  margin: 10px 0 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: #5e2a24;
}
.letter-greet {
  position: relative;
  margin: 0 0 18px;
  font-family: var(--zh-serif);
  font-size: 14.5px;
  letter-spacing: 0.08em;
  color: #5e2a24;
}
.letter-body {
  position: relative;
  font-family: var(--zh-serif);
  font-size: 14.5px;
  line-height: 2.15;
  letter-spacing: 0.03em;
  color: #3a332b;
  min-height: 5em;
}
.letter-body p { margin: 0 0 1.05em; }
.letter-body.typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.02em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--seal);
  animation: caret 0.95s step-end infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.letter-sign-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-top: 26px;
}
.letter-sign {
  margin: 0;
  text-align: right;
  font-family: var(--zh-serif);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: #5e2a24;
}
.letter-seal {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--zh-serif);
  font-size: 12px;
  line-height: 1;
  border-radius: 2px;
  transform: rotate(-4deg);
  opacity: 0.92;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14) inset;
}

/* ============================================================================
 *  设置
 * ==========================================================================*/
.set-form { display: flex; flex-direction: column; gap: 20px; margin-top: 6px; }
.field { display: block; }
.field span {
  display: block;
  margin-bottom: 7px;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}
.field input,
.field textarea {
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  background: none;
  color: var(--ivory);
  font-size: 14px;
  letter-spacing: 0.02em;
  outline: none;
  -webkit-appearance: none;
  transition: border-color 0.25s;
}
.field input:focus,
.field textarea:focus { border-bottom-color: var(--seal); }
.field textarea { resize: vertical; min-height: 80px; line-height: 1.9; }

.note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.95;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.note b { color: var(--ivory-2); font-weight: 400; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.colophon {
  margin: 40px 0 6px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}

/* ============================================================================
 *  按钮
 * ==========================================================================*/
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 3px;
  background: var(--seal);
  color: #fdf6ef;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 18px 34px -24px rgba(0, 0, 0, 0.9);
  transition: transform 0.25s var(--ease), background 0.25s;
}
.btn-primary:active { transform: scale(0.985); background: var(--seal-2); }
.btn-primary.wide { width: 100%; }
.btn-primary.grow { flex: 1; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: none;
  color: var(--ivory-2);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: border-color 0.25s, color 0.25s;
}
.btn-ghost .ico { width: 15px; height: 15px; }
.btn-ghost:active { border-color: var(--ivory-2); color: var(--ivory); }
.btn-ghost.danger { color: #cf7d70; border-color: rgba(178, 58, 46, 0.4); }

/* ============================================================================
 *  底部面板（编辑 / 新增）
 * ==========================================================================*/
.sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vvh, 100%);
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 6, 9, 0.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sheet.open { opacity: 1; }
.sheet-card {
  width: 100%;
  max-width: 560px;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  padding: 8px 22px calc(18px + env(safe-area-inset-bottom));
  border-radius: 6px 6px 0 0;
  background: var(--paper);
  background-image: radial-gradient(rgba(34, 32, 29, 0.05) 0.6px, transparent 0.8px);
  background-size: 3px 3px;
  color: var(--ink);
  box-shadow: 0 -30px 80px -30px rgba(0, 0, 0, 0.9);
  transform: translateY(100%);
  transition: transform 0.42s var(--ease-out);
}
.sheet.open .sheet-card { transform: translateY(0); }
.sheet-grab {
  width: 34px;
  height: 3px;
  margin: 4px auto 10px;
  border-radius: 3px;
  background: rgba(34, 32, 29, 0.2);
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-ink);
}
.sheet-head .eyebrow { color: rgba(34, 32, 29, 0.42); }
.sheet-head h3 {
  margin: 8px 0 0;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.sheet-head .icon-btn { border-color: var(--line-ink); color: var(--ink-2); margin-left: auto; }
.sheet-head .icon-btn .ico { width: 16px; height: 16px; }
.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 0 6px;
}
.sheet-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-ink);
}
.sheet-foot .btn-primary { height: 48px; }
.sheet-foot .btn-ghost { border-color: var(--line-ink); color: #8c3a31; }
.sheet-foot .btn-ghost:active { border-color: #8c3a31; }

/* 心情 */
.moods { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.moods::-webkit-scrollbar { display: none; }
.mood {
  flex: 0 0 auto;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 2px 7px;
  border: 1px solid var(--line-ink);
  border-radius: 3px;
  background: none;
  color: var(--ink-2);
  transition: all 0.25s var(--ease);
}
.mood .ico { width: 18px; height: 18px; stroke-width: 1.5; }
.mood i { font-style: normal; font-size: 8.5px; letter-spacing: 0.04em; color: var(--ink-2); white-space: nowrap; }
.mood.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.mood.on i { color: var(--paper); }
.mood:active { transform: translateY(-1px); }

.c-title {
  width: 100%;
  margin-top: 14px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line-ink);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-family: var(--zh-serif);
  font-size: 18px;
  letter-spacing: 0.06em;
  outline: none;
}
.c-title::placeholder { color: rgba(34, 32, 29, 0.34); font-size: 15px; letter-spacing: 0.06em; }
.c-title:focus { border-bottom-color: var(--seal); }

.c-text {
  width: 100%;
  margin-top: 6px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--zh-serif);
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.02em;
  outline: none;
  resize: none;
  min-height: 4.2em;
}
.c-text::placeholder { color: rgba(34, 32, 29, 0.34); }

.c-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 6px; }
.c-photos:empty { display: none; }
.cp { position: relative; aspect-ratio: 1 / 1; border-radius: 2px; overflow: hidden; border: 1px solid var(--line-ink); }
.cp img { width: 100%; height: 100%; object-fit: cover; }
.cp-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 10, 8, 0.62);
  color: #f5efe4;
  font-size: 13px;
  line-height: 1;
}

.c-tools { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-ink);
  border-radius: 3px;
  background: none;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.tool-btn .ico { width: 16px; height: 16px; stroke-width: 1.5; }
.tool-btn:active { border-color: var(--ink-2); }
.date-pick { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.date-pick .ico { width: 15px; height: 15px; stroke-width: 1.5; }
.date-pick input {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  color-scheme: light;
  outline: none;
  min-height: 32px;
}

/* ============================================================================
 *  确认框 / Toast
 * ==========================================================================*/
.confirm {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 6, 9, 0.72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.24s ease both;
}
.confirm-card {
  width: min(100%, 320px);
  padding: 26px 22px 20px;
  background: var(--paper);
  background-image: radial-gradient(rgba(34, 32, 29, 0.05) 0.6px, transparent 0.8px);
  background-size: 3px 3px;
  border-radius: 4px;
  color: var(--ink);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
  animation: popIn 0.32s var(--ease-out) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: none; }
}
.confirm-card .eyebrow { color: rgba(34, 32, 29, 0.4); }
.confirm-card h3 {
  margin: 10px 0 8px;
  font-family: var(--zh-serif);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.confirm-card p:not(.eyebrow) {
  margin: 0 0 22px;
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.cf-actions { display: flex; gap: 8px; }
.cf-actions .btn-ghost { flex: 1; border-color: var(--line-ink); color: var(--ink-2); }
.cf-actions .btn-primary { flex: 1; height: 42px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom));
  z-index: 95;
  transform: translate(-50%, 8px);
  max-width: 84vw;
  padding: 10px 18px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: rgba(14, 18, 24, 0.96);
  color: var(--ivory);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.25s, transform 0.3s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================================
 *  空状态
 * ==========================================================================*/
.empty { padding: 44px 12px 26px; text-align: center; }
.empty-mark {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  color: var(--dim);
}
.empty-mark .ico { width: 26px; height: 26px; stroke-width: 1.2; }
.empty p {
  margin: 0 0 20px;
  font-family: var(--zh-serif);
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.empty .dim { color: var(--dim); font-size: 10.5px; letter-spacing: 0.1em; }

/* ============================================================================
 *  响应式 / 桌面
 * ==========================================================================*/
@media (min-width: 700px) {
  :root { --page-x: 26px; }
  body { font-size: 16px; }
  .topbar { max-width: 620px; margin: 0 auto; }
  .tabbar {
    max-width: 620px;
    width: min(620px, 100%);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: 6px 6px 0 0;
  }
  .m-photos { grid-template-columns: repeat(4, 1fr); }
  .album-grid { grid-template-columns: repeat(4, 1fr); }
  .c-photos { grid-template-columns: repeat(6, 1fr); }
  .hero-count .num { font-size: min(122px, 16vw); }
  .letter { padding: 42px 40px 36px; }
}

@media (max-width: 380px) {
  :root { --page-x: 18px; }
  .hero-count .num { font-size: clamp(72px, 23vw, 96px); }
  .ledger.four { grid-template-columns: repeat(2, 1fr); }
  .ledger.four > div:nth-child(3) { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .ledger.four > div:nth-child(4) { border-top: 1px solid var(--line); }
  .today-list li { gap: 10px; }
}

/* 降低动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* iOS 输入框不缩放 */
@media (max-width: 480px) {
  input, textarea, select { font-size: 16px; }
  .search-wrap input { font-size: 15px; }
  .pass input { font-size: 17px; }
  .c-title { font-size: 18px; }
  .c-text { font-size: 16px; }
  .date-pick input { font-size: 16px; }
}

/* ============================================================================
 *  纸面里的表单（新增里程碑等）
 * ==========================================================================*/
.sheet .field span { color: rgba(34, 32, 29, 0.45); }
.sheet .field input,
.sheet .field textarea { color: var(--ink); border-bottom-color: var(--line-ink); }
.sheet .field input:focus,
.sheet .field textarea:focus { border-bottom-color: var(--seal); }
.sheet .field textarea { font-family: var(--zh-serif); font-size: 14.5px; line-height: 1.95; }
.sheet .field input::placeholder,
.sheet .field textarea::placeholder { color: rgba(34, 32, 29, 0.28); }
.link-arrow { display: inline-flex; align-items: center; }

/* ============================================================================
 *  细节修订
 * ==========================================================================*/
.link { min-height: 32px; align-items: center; }

/* 子页面不显示「写一条」，版面回到 4 列并保持「我们」高亮 */
body.subpage .fab { display: none; }
body.subpage .tabbar { grid-template-columns: repeat(4, 1fr); }

/* 原生日期控件：隐藏自带图标，整个字段都可点 */
.date-pick { position: relative; }
.date-pick input {
  position: relative;
  width: 124px;
  max-width: 100%;
}
.date-pick input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.date-pick input::-webkit-datetime-edit { padding: 0; }

/* 纸张里的删除按钮更红一点 */
.sheet-foot .btn-ghost.danger { color: #8c3a31; }

/* ============================================================================
 *  今天卡片：直接去写
 * ==========================================================================*/
.t-write {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: none;
  color: var(--ivory-2);
  font-size: 10px;
  letter-spacing: 0.14em;
  transition: border-color 0.25s, color 0.25s;
}
.t-write:active { border-color: var(--seal); color: var(--ivory); }

/* ============================================================================
 *  版权页（设置页底部）
 * ==========================================================================*/
.colophon {
  margin: 54px auto 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.colophon-rule { width: 34px; height: 1px; background: var(--line-2); margin-bottom: 10px; }
.colophon-line {
  margin: 0;
  font-family: var(--zh-serif);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--muted);
}
.colophon-line.small {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-indent: 0;
  color: var(--dim);
}
.colophon-seal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 14px;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--zh-serif);
  font-size: 10px;
  line-height: 1;
  border-radius: 2px;
  transform: rotate(-3deg);
  opacity: 0.9;
}

/* ============================================================================
 *  盖章
 * ==========================================================================*/
.stamp {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.stamp span {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  background: var(--seal);
  color: var(--paper);
  font-family: var(--zh-serif);
  font-size: 46px;
  line-height: 1;
  border-radius: 4px;
  transform: rotate(-5deg);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.08) inset,
    0 24px 50px -20px rgba(0, 0, 0, 0.8);
  opacity: 0;
}
.stamp.play { animation: stampWrap 1s var(--ease-out) both; }
.stamp.play span { animation: stampMark 1s var(--ease-out) both; }
@keyframes stampWrap {
  0%, 72% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes stampMark {
  0% { opacity: 0; transform: scale(1.85) rotate(9deg); }
  16% { opacity: 1; transform: scale(0.96) rotate(-6deg); }
  26% { transform: scale(1) rotate(-4deg); }
  74% { opacity: 1; transform: scale(1) rotate(-4deg); }
  100% { opacity: 0; transform: scale(1) rotate(-4deg); }
}

/* ============================================================================
 *  原生日期 / 时间控件
 * ==========================================================================*/
.field input[type="datetime-local"] { color-scheme: dark; }
.sheet .field input[type="date"] { color-scheme: light; width: 100%; }

/* 搜索框原生清除按钮换成我们自己的风格 */
.search-wrap input::-webkit-search-cancel-button,
.search-wrap input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-wrap input[type="search"] { appearance: none; }

/* 筛选 chip：扩大点击宽度，视觉不变 */
.chip { padding-left: 4px; padding-right: 4px; margin-left: -4px; margin-right: -4px; }
.chip.active { margin-left: -4px; }

/* ============================================================================
 *  桌面：像一本摊开的书，页面两侧各一条发丝线
 * ==========================================================================*/
@media (min-width: 700px) {
  body::before,
  body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(242, 237, 227, 0.07) 14%, rgba(242, 237, 227, 0.07) 86%, transparent);
  }
  body::before { left: calc(50% - 311px); }
  body::after { right: calc(50% - 311px); }
}

.field-hint {
  display: block;
  margin-top: 7px;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

/* 长昵称不挤坏版面 */
.m-who b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.t-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 纸张里的多行输入不出现拖动角 */
.sheet .field textarea { resize: none; }
