/* ============================================================
   DRIFTPOST — 纸与墨
   CSS 直接取自 design-samples/driftpost.html 与 landing.html，
   应用专有的弹窗、邮戳、海图等在文末按同一套版式补齐。
   ============================================================ */
:root {
  --paper: #f1ece1;
  --paper-2: #f8f4ea;
  --paper-3: #e7dfd0;
  --ink: #1b2526;
  --ink-2: #3d4a48;
  --muted: #6d7975;
  --faint: #97a19c;
  --line: rgba(var(--ink-rgb), .16);
  --line-soft: rgba(var(--ink-rgb), .08);
  --sea: #2e5f5c;
  --rust: #9a4f32;
  --brass: #8d6f3f;
  --serif: "Fraunces", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: "Inter", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  --max: 1180px;
  --pad: 44px;
  --mast: 76px;
  --ink-rgb: 27, 37, 38;
  --paper-rgb: 241, 236, 225;
  --mast-bg: rgba(241, 236, 225, .9);
  --grain-opacity: .22;
  --grain-blend: multiply;
}

/* ------------------------------------------------------------
   三副底片（STUDY 01 墨线 / 02 图版 / 03 夜航）
   白天默认 02，入夜默认 03，右上角可手动切换。
   ------------------------------------------------------------ */
body[data-study="ink"], body[data-study="plate"] {
  --paper: #f1ece1;
  --paper-2: #f8f4ea;
  --paper-3: #e7dfd0;
  --ink: #1b2526;
  --ink-2: #3d4a48;
  --muted: #6d7975;
  --faint: #97a19c;
  --line: rgba(var(--ink-rgb), .16);
  --line-soft: rgba(var(--ink-rgb), .08);
  --sea: #2e5f5c;
  --rust: #9a4f32;
  --brass: #8d6f3f;
  --ink-rgb: 27, 37, 38;
  --paper-rgb: 241, 236, 225;
  --mast-bg: rgba(241, 236, 225, .9);
  --grain-opacity: .22;
  --grain-blend: multiply;
}
body[data-study="night"] {
  color-scheme: dark;
  --paper: #0a141b;
  --paper-2: #101f28;
  --paper-3: #172a33;
  --ink: #f1ece0;
  --ink-2: #c6d2cf;
  --muted: #93a5a6;
  --faint: #6b7f84;
  --line: rgba(231, 227, 216, .16);
  --line-soft: rgba(231, 227, 216, .07);
  --sea: #7fb8b0;
  --rust: #cdb083;
  --brass: #c2a170;
  --ink-rgb: 241, 236, 224;
  --paper-rgb: 10, 20, 27;
  --mast-bg: rgba(10, 20, 27, .86);
  --grain-opacity: .42;
  --grain-blend: soft-light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}
body:has(#app.is-gate) { overflow: hidden; }
body:has(#app.is-gate)::before { display: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .34; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
::selection { background: rgba(46, 95, 92, .22); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 76px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--mast-bg);
  backdrop-filter: blur(12px);
}
.wordmark { display: flex; align-items: center; gap: 12px; }
.wordmark svg { width: 30px; height: 30px; flex: none; }
.wordmark-name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: .055em;
  line-height: 1;
}
.wordmark-sub {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}
.mainnav { display: flex; align-items: center; gap: 27px; }
.mainnav a, .mainnav button {
  position: relative;
  border: 0;
  background: none;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .2s ease;
}
.mainnav a::after, .mainnav button::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.mainnav a:hover, .mainnav button:hover { color: var(--ink); }
.mainnav .is-active { color: var(--ink); }
.mainnav .is-active::after { transform: scaleX(1); }
.mast-actions { justify-self: end; display: flex; align-items: center; gap: 16px; }

/* 底片切换：STUDY 01 / 02 / 03 */
.studies { display: flex; align-items: center; gap: 6px; }
.studies-label {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .18em;
  color: var(--faint); margin-right: 4px;
}
.studies button {
  border: 1px solid transparent; background: none; border-radius: 1px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .08em;
  color: var(--faint); padding: 4px 6px; transition: color .2s, border-color .2s;
}
.studies button:hover { color: var(--ink); }
.studies button.is-on { border-color: var(--line); color: var(--ink); }
/* 语言：一颗排字小按钮 + 纸面浮层，不用系统原生下拉 */
.lang-menu { position: relative; }
.lang {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; padding: 4px 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--muted); transition: color .2s;
}
.lang:hover, .lang-menu.is-open .lang { color: var(--ink); }
.lang-caret {
  width: 0; height: 0; margin-top: 1px;
  border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-top: 3.5px solid currentColor; opacity: .6;
}
.lang-pop {
  position: absolute; top: calc(100% + 9px); right: -6px; z-index: 40; min-width: 126px;
  display: none; padding: 5px; background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 20px 36px -24px rgba(var(--ink-rgb), .55);
}
.lang-menu.is-open .lang-pop { display: block; }
.lang-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; border: 0; background: none; padding: 7px 9px; text-align: left;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.lang-opt:hover { background: rgba(var(--ink-rgb), .05); color: var(--ink); }
.lang-opt.is-on { color: var(--ink); }
.lang-opt.is-on::after { content: "✓"; color: var(--rust); }
.avatar-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: border-color .2s ease;
}
.avatar-btn:hover { border-color: var(--ink); }
.avatar { width: 20px; height: 20px; display: grid; place-items: center; font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; border-radius: 1px;
  padding: 12px 22px;
  font-size: 12px; font-weight: 600; letter-spacing: .035em;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ink, .btn-primary { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.btn-ink:hover, .btn-primary:hover { opacity: .9; }
.btn-line, .btn-ghost, .btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-line:hover, .btn-ghost:hover, .btn-outline:hover { border-color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: 11px; }
.btn-block { width: 100%; }
.text-btn {
  border: 0; background: none; padding: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.text-btn:hover { color: var(--ink); }
.arrow-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.arrow-link:hover { border-color: var(--ink); }

/* ---------- layout ---------- */
.screen { display: block; padding-bottom: 96px; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.eyebrow, .kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .17em;
  text-transform: uppercase; color: var(--muted);
}
.kicker-line { width: 26px; height: 1px; background: var(--rust); }
.lede { max-width: 470px; color: var(--ink-2); font-size: 16px; line-height: 1.75; }

/* ---------- home ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 58px;
  align-items: center;
  padding-top: 74px;
  padding-bottom: 62px;
}
.hero h1 {
  margin: 20px 0 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(54px, 6.6vw, 88px);
  line-height: .97;
  letter-spacing: -.028em;
}
.hero h1 .h1-line { display: block; }
.hero h1 em { font-style: italic; font-weight: 300; color: var(--sea); }
:lang(zh) .hero h1 em, :lang(ja) .hero h1 em { display: block; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 32px; flex-wrap: wrap; }
.hero-note {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}
.hero-chart { position: relative; }
.hero-chart .globe-stage { position: relative; aspect-ratio: 1 / 1; min-height: 320px; }
.chart-caption {
  margin-top: 12px; text-align: center;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  color: var(--faint);
}
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { padding: 26px 26px 24px 0; border-right: 1px solid var(--line-soft); }
.stat:last-child { border-right: 0; }
.stat-n {
  display: block; font-family: var(--serif); font-size: 38px; font-weight: 400;
  line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat-l {
  display: block; margin-top: 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.home-cols {
  display: grid; grid-template-columns: 1.45fr .55fr; gap: 54px;
  padding-top: 54px;
}
.col-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.col-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.letter-list { display: grid; gap: 14px; }
.letter-card {
  display: grid; grid-template-columns: 1fr auto; gap: 20px;
  padding: 22px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  transition: border-color .2s ease, transform .2s ease;
}
.letter-card:hover { border-color: var(--line); transform: translateY(-2px); }
.letter-card h3 { font-family: var(--serif); font-size: 18px; font-weight: 400; margin-bottom: 6px; }
.letter-card p { color: var(--ink-2); font-family: var(--serif); font-size: 15px; line-height: 1.75; }
.letter-card .card-meta {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  color: var(--faint); text-align: right; white-space: nowrap;
}

/* 信件页：三种来源共用的一套行 —— 左标记、中「是什么 + 从哪来」、右状态 */
.letter-rows { border-top: 1px solid var(--line); }
.letter-row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 16px;
  padding: 15px 4px; border-bottom: 1px solid var(--line-soft);
  transition: background .18s ease;
}
.letter-row:hover { background: rgba(var(--ink-rgb), .03); }
.letter-row-art { display: grid; place-items: center; width: 40px; }
.letter-row-glyph { font-size: 17px; line-height: 1; color: var(--muted); }
.letter-row-art .envelope-art.sm { width: 34px; }
.letter-row-main { display: grid; gap: 4px; min-width: 0; }
.letter-row-title {
  font-family: var(--serif); font-size: 15.5px; line-height: 1.45; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .18s;
}
.letter-row:hover .letter-row-title { color: var(--sea); }
.letter-row-meta {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.letter-row-side { display: flex; align-items: center; gap: 14px; }
.row-days { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--faint); white-space: nowrap; }
.pill.sealed { color: var(--rust); border-color: rgba(154, 79, 50, .35); }
.tab-n { margin-left: 7px; font-variant-numeric: tabular-nums; }
.tabs button.is-active .tab-n { color: var(--rust); }
.farthest-line {
  margin: -20px 0 26px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.manifesto { border-left: 1px solid var(--line); padding: 6px 0 0 30px; }
.manifesto blockquote {
  margin: 0 0 20px;
  font-family: var(--serif); font-size: 24px; line-height: 1.35; font-weight: 400;
}
.manifesto p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.manifesto .sig {
  margin-top: 22px; font-family: var(--mono); font-size: 9px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}

/* ---------- section head ---------- */
.screen-head { padding-top: 56px; padding-bottom: 34px; }
.screen-head h1 {
  margin: 16px 0 12px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -.02em;
}
:lang(zh) .screen-head h1, :lang(ja) .screen-head h1 { font-size: clamp(28px, 3.1vw, 38px); }
.screen-head .lede { font-size: 14px; }

/* ---------- 收件台（登录后首页） ---------- */
.desk-intro { padding-top: 54px; padding-bottom: 30px; }
.desk-intro h1 {
  margin: 14px 0 10px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -.02em;
}
:lang(zh) .desk-intro h1, :lang(ja) .desk-intro h1 { font-size: clamp(28px, 3.1vw, 38px); }
.desk-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.desk { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.desk-send { padding: 36px 46px 40px 0; border-right: 1px solid var(--line); }
.desk-inbox { padding: 36px 0 40px 46px; }
.desk-label {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint);
}
.desk-label span { color: var(--rust); }
.desk-send h2 { margin: 18px 0 22px; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.desk-quota { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 0; }
.desk-quota strong { font-family: var(--serif); font-size: 16px; font-weight: 400; line-height: 1; color: var(--ink-2); }
.desk-quota span { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.desk-cta { margin-top: 2px; }
.desk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 18px; }
.desk-head h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; }
.desk-head .arrow-link { border: 0; padding: 0; }
.desk-empty { margin-top: 22px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: var(--faint); }
.inbox-list { margin-top: 8px; }
.inbox-row {
  display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.inbox-row:last-child { border-bottom: 0; }
.inbox-art { display: grid; place-items: center; }
.inbox-main { display: grid; gap: 3px; min-width: 0; }
.inbox-title { font-family: var(--serif); font-size: 15.5px; line-height: 1.45; color: var(--ink); transition: color .2s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-meta { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.inbox-tag { font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; color: var(--faint); border: 1px solid var(--line-soft); padding: 3px 7px; white-space: nowrap; }
.inbox-row.is-sealed .inbox-tag { color: var(--rust); border-color: rgba(154,79,50,.35); }
.inbox-row:hover .inbox-title { color: var(--sea); }

/* ---------- 信封与拆封 ---------- */
.envelope-art { display: block; color: rgba(var(--ink-rgb), .5); }
.envelope-art.sm { width: 54px; }
.envelope-art.lg { width: min(280px, 62%); margin: 0 auto 26px; color: rgba(var(--ink-rgb), .42); }
.envelope-art .env-seal { fill: var(--rust); opacity: .92; }
.env-hold { display: grid; place-items: center; padding: 4px 0 2px; }
.encounter-card.is-sealed { border-style: dashed; background: transparent; }
.ec-sealed-note { font-family: var(--serif); font-size: 14px; line-height: 1.8; color: var(--muted); flex: 1; }
.ec-flag { font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; color: var(--sea); }
.sealed-sheet {
  display: grid; justify-items: center; text-align: center;
  padding: 46px 32px 42px; border: 1px dashed var(--line); background: rgba(var(--ink-rgb), .012);
}
.sealed-sheet h2 { margin: 0 0 12px; font-family: var(--serif); font-weight: 400; font-size: 26px; }
.sealed-sheet p { max-width: 420px; margin: 0 0 26px; color: var(--muted); font-size: 13px; line-height: 1.85; }

/* ---------- write ---------- */
.write-grid { display: grid; grid-template-columns: 1.34fr .66fr; gap: 46px; align-items: start; }
.letter {
  position: relative;
  padding: 42px 44px 52px;
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(to bottom, transparent 0 33px, rgba(var(--ink-rgb),.075) 33px 34px);
  border: 1px solid var(--line-soft);
  box-shadow: 0 18px 40px -28px rgba(var(--ink-rgb),.35);
}
.letter::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 26px; width: 1px;
  background: rgba(154, 79, 50, .18);
}
.letter-top { display: flex; align-items: flex-start; justify-content: space-between; }
.postmark {
  width: 94px; height: 94px; border-radius: 50%;
  border: 1.4px solid var(--rust); color: var(--rust);
  display: grid; place-items: center; text-align: center;
  transform: rotate(-7deg);
  font-family: var(--mono); font-size: 7.5px; letter-spacing: .08em; line-height: 1.6;
}
.postmark strong { display: block; font-family: var(--serif); font-size: 14px; font-weight: 400; letter-spacing: .04em; }
.postmark .pm-ring {
  width: 80px; height: 80px; border-radius: 50%;
  border: 1px dashed rgba(154,79,50,.5);
  display: grid; place-items: center;
}
.postmark.is-stamp { border: 0; width: auto; height: auto; }
.letter-meta {
  text-align: right; font-family: var(--mono); font-size: 8.5px;
  letter-spacing: .12em; line-height: 1.9; text-transform: uppercase; color: var(--faint);
}
.letter-rule { height: 1px; background: var(--line); margin: 26px 0 28px; }
.letter-opening {
  display: block; border: 0; background: transparent; padding: 0; text-align: left;
  font-family: var(--serif); font-style: italic; font-size: 20px;
  color: var(--sea); margin-bottom: 16px;
}
.letter-opening:hover { color: var(--ink); }
.letter-body {
  font-family: var(--serif); font-size: 18px; line-height: 34px;
  color: var(--ink); max-width: 90%; min-height: 238px; outline: none;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.letter-body.is-empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }
.caret { display: inline-block; width: 1px; height: 21px; background: var(--ink); vertical-align: -4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.letter-sign {
  margin-top: 40px; font-family: var(--mono); font-size: 9px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}
.letter-count {
  margin-top: 8px; font-family: var(--mono); font-size: 9px;
  letter-spacing: .1em; color: var(--faint); text-align: right;
}
.letter-foot-stamp {
  position: absolute; right: 34px; bottom: 30px;
  width: 66px; height: 66px; border-radius: 50%;
  border: 1px solid rgba(154,79,50,.55); color: var(--rust);
  display: grid; place-items: center; text-align: center;
  background: transparent;
  transform: rotate(6deg);
  font-family: var(--mono); font-size: 7px; letter-spacing: .06em; line-height: 1.5;
  transition: transform .2s ease;
}
.letter-foot-stamp:hover { transform: rotate(0deg) scale(1.04); }
.letter-foot-stamp .sticker { font-size: 24px; line-height: 1; }
.send-panel { position: sticky; top: 104px; display: grid; gap: 28px; }
.panel-block { border-top: 1px solid var(--line); padding-top: 16px; }
.panel-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.postmark-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pm-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  border: 1px solid var(--line-soft); background: transparent;
  padding: 12px 12px 11px; text-align: left;
  transition: border-color .2s ease, background .2s ease;
}
.pm-option strong { font-family: var(--serif); font-size: 14px; font-weight: 400; }
.pm-option span { font-family: var(--mono); font-size: 8px; letter-spacing: .1em; color: var(--faint); }
.pm-option:hover { border-color: var(--line); }
.pm-option.is-active { border-color: var(--ink); background: rgba(var(--ink-rgb),.035); }

/* 保护期：三格小选择器，默认停在「随时可收留」 */
.protect-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.protect-opt {
  padding: 9px 4px; border: 1px solid var(--line-soft); background: transparent;
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em; color: var(--muted);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.protect-opt:hover { border-color: var(--line); color: var(--ink); }
.protect-opt.is-active { border-color: var(--ink); background: rgba(var(--ink-rgb),.04); color: var(--ink); }
.protect-note { margin-top: 10px; font-family: var(--mono); font-size: 9px; line-height: 1.75; color: var(--faint); }
.quota-row { display: flex; align-items: baseline; justify-content: space-between; }
.quota-row strong { font-family: var(--serif); font-size: 30px; font-weight: 400; }
.quota-row span { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.panel-note { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; color: var(--faint); line-height: 1.8; text-transform: uppercase; }

/* ---------- encounters ---------- */
.encounter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.encounter-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 26px 26px 22px; background: var(--paper-2);
  border: 1px solid var(--line-soft);
}

/* 整张卡片可点进详情；里面的按钮各自拦住，不会误触 */
.encounter-card.is-link { cursor: pointer; transition: border-color .18s, background .18s; }
.encounter-card.is-link:hover { border-color: var(--line); background: var(--paper); }
.encounter-card.is-link:hover .ec-sea { color: var(--sea); }
.ec-read {
  margin-left: auto; white-space: nowrap;
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); transition: color .18s;
}
.encounter-card.is-link:hover .ec-read { color: var(--sea); }
.encounter-card .ec-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ec-sea { font-family: var(--serif); font-size: 19px; }
.ec-meta { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; color: var(--faint); text-align: right; line-height: 1.7; text-transform: uppercase; }
.ec-opening { font-family: var(--serif); font-style: italic; color: var(--sea); font-size: 15px; }
.ec-excerpt { font-family: var(--serif); font-size: 15px; line-height: 1.8; color: var(--ink-2); flex: 1; }
.ec-note {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .06em; line-height: 1.7;
  color: var(--sea); border-left: 1px solid rgba(46,95,92,.35); padding-left: 10px;
}
.ec-actions { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.ec-actions .arrow-link { margin-left: auto; border: 0; padding: 0; }

/* ---------- letters table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 12px 14px 12px 0;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .14em; font-weight: 400;
  text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 18px 14px 18px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.table td:first-child { font-family: var(--serif); font-size: 17px; }
.table tbody tr { cursor: pointer; transition: background .15s ease; }
.table tbody tr:hover { background: rgba(var(--ink-rgb),.022); }
.table tbody tr:last-child td { border-bottom: 0; }
.pill {
  display: inline-block; padding: 3px 8px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 8px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.pill.captured { color: var(--sea); border-color: rgba(46,95,92,.35); }
.table-bottle { display: flex; align-items: center; gap: 12px; }
.table-bottle .sticker { font-size: 18px; }
.table-bottle .tiny { font-family: var(--mono); font-size: 8.5px; letter-spacing: .06em; color: var(--faint); text-transform: uppercase; }
.stat-strip.six { grid-template-columns: repeat(6, 1fr); margin-bottom: 34px; }
.stat-strip.six .stat { padding: 22px 10px 20px; text-align: center; }
.stat-strip.six .stat-n { font-size: 30px; letter-spacing: 0; }
.stat-strip.six .stat-l { margin-top: 8px; font-size: 9px; letter-spacing: .1em; }
.tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs button {
  border: 0; background: none; padding: 12px 0; color: var(--faint);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1px solid transparent; margin-bottom: -1px; transition: .18s ease;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.is-active { color: var(--ink); border-color: var(--ink); }

/* ---------- sea ---------- */
.sea-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.sea-cell { padding: 28px 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sea-cell .n { font-family: var(--serif); font-size: 40px; font-weight: 400; line-height: 1; }
.sea-cell .l { margin-top: 12px; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sea-cell .c { margin-top: 8px; font-size: 12px; color: var(--faint); }
.sea-banner {
  display: flex; align-items: center; gap: 24px; margin-top: 26px;
  padding: 26px 28px; border: 1px solid var(--line);
}
.sea-banner strong { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.sea-banner span { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 150px 1fr; gap: 58px; align-items: start; }
.settings-index { position: sticky; top: 108px; display: grid; gap: 10px; }
.settings-index a {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint); padding: 4px 0;
}
.settings-index a.is-active { color: var(--ink); }
.settings-index a:hover { color: var(--ink-2); }
.settings-section { padding-bottom: 46px; margin-bottom: 46px; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; margin-bottom: 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.section-no { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--rust); }
.section-head h2 { font-family: var(--serif); font-size: 27px; font-weight: 400; }
.section-note { margin-left: auto; font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.field-row {
  display: grid; grid-template-columns: 164px 1fr; gap: 28px;
  padding: 26px 0; border-bottom: 1px solid var(--line-soft);
}
.field-row:last-of-type { border-bottom: 0; }
.field-label {
  padding-top: 2px; font-family: var(--mono); font-size: 9px;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}
.field-control { min-width: 0; }
.help { margin-top: 7px; font-size: 12px; line-height: 1.7; color: var(--faint); }
.value { font-family: var(--serif); font-size: 18px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; max-width: 430px; }
.avatar-option {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid var(--line-soft); background: transparent;
  font-size: 21px; border-radius: 50%;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.avatar-option:hover { border-color: var(--line); transform: translateY(-1px); }
.avatar-option.is-active { border-color: var(--ink); background: rgba(var(--ink-rgb),.04); box-shadow: inset 0 0 0 3px var(--paper); }
.input-line {
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.input-line input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: var(--serif); font-size: 19px; color: var(--ink);
  padding: 2px 0;
}
.input-line input::placeholder { color: var(--faint); }
.input-line .count { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; color: var(--faint); }
.inline-control { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.section-actions { display: flex; justify-content: flex-end; padding-top: 22px; }

/* ---------- footer ---------- */
.foot {
  max-width: var(--max); margin: 0 auto; padding: 26px var(--pad) 40px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 20px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
}
.foot-links { display: flex; gap: 20px; }
.foot a:hover { color: var(--ink); }

/* ---------- toast ---------- */
#toast-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 60;
  transform: translate(-50%, 16px);
  background: var(--ink); color: var(--paper-2);
  padding: 12px 20px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.show, #toast-root .toast { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--rust); }
.toast.success { background: var(--sea); }

:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; }

/* ============================================================
   未登录封面 — 取自 landing.html（作用域限定在 .landing 内）
   ============================================================ */
#app.is-gate { position: fixed; inset: 0; z-index: 2; }
.landing {
  position: relative; height: 100svh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); overflow: hidden;
}
/* 宽屏：整幅封面往右推一档，抬头 / 文字 / 图例 / 页脚共用同一条左基线，
   球体跟着文字右缘走，右缘允许出血几像素，读起来是一整块版心而不是贴左边。 */
@media (min-width: 1100px) {
  .landing { --pad: 84px; }
}

.landing .mast {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 74px; padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.landing .mast-mid { display: flex; align-items: center; gap: 26px; }
.landing .mast-mid a, .landing .mast-mid button {
  border: 0; background: none; padding: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); transition: color .2s;
}
.landing .mast-mid a:hover, .landing .mast-mid button:hover { color: var(--ink); }
.landing .mast-right { justify-self: end; display: flex; align-items: center; gap: 18px; }
.landing .btn-ghost {
  border: 1px solid var(--line); background: none;
  padding: 8px 16px; font-size: 11px; font-weight: 500; letter-spacing: .02em;
  transition: border-color .2s, background .2s;
}
.landing .btn-ghost:hover { border-color: var(--ink); }
.landing .stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.landing .globe-stage { position: absolute; inset: 0; }
.landing .globe-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  cursor: grab; touch-action: none;
}
.landing .globe-canvas.dragging { cursor: grabbing; }
.landing .grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.38'/%3E%3C/svg%3E");
}
.landing .frame { position: absolute; inset: 16px; pointer-events: none; z-index: 6; opacity: .55; }
.landing .frame i { position: absolute; width: 22px; height: 22px; border: 0 solid var(--rust); opacity: .5; }
.landing .frame i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.landing .frame i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.landing .frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.landing .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.landing .cover {
  position: absolute; z-index: 8; left: var(--pad); top: 50%; transform: translateY(-53%);
  /* 宽度收到文字实际宽度：球体按这个右缘对齐，中间不留空带 */
  width: clamp(452px, 40vw, 508px);
}
.landing .kicker {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted);
}
.landing .kicker::before { content: ""; width: 26px; height: 1px; background: var(--rust); opacity: .8; }
.landing .cover h1 {
  margin: 26px 0 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 4.9vw, 72px);
  line-height: 1.02; letter-spacing: -.026em;
}
/* 一行一句，句内不折行：「是这间邮局的邮差。」要落在一行上 */
.landing .cover h1 .h1-line { display: block; white-space: nowrap; }
.landing .cover h1 em { font-style: italic; font-weight: 300; color: var(--sea); }
/* 中日文九字一句，字号收一档才装得进 560px */
:lang(zh) .landing .cover h1, :lang(ja) .landing .cover h1 { font-size: clamp(30px, 3.7vw, 54px); letter-spacing: -.02em; }
.landing .lede {
  margin-top: 28px; max-width: 452px;
  font-size: 15px; line-height: 1.95; color: var(--ink-2);
  white-space: pre-line;
}
.landing .actions { display: flex; align-items: center; gap: 30px; margin-top: 34px; flex-wrap: wrap; }
.btn-solid {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper-2);
  border: 1px solid var(--ink); border-radius: 1px;
  padding: 14px 26px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  transition: transform .2s, opacity .2s;
}
.btn-solid:hover { transform: translateY(-1px); opacity: .92; }
.landing .arrow-link {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-bottom: 1px solid var(--line); background: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
  padding: 0 0 6px; border-radius: 0;
  transition: border-color .2s, color .2s;
}
.landing .arrow-link:hover { border-color: var(--ink); color: var(--ink); }
.landing .micro {
  margin-top: 34px; padding-top: 15px; border-top: 1px solid var(--line-soft);
  max-width: 452px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--faint);
}
.landing .legend { position: absolute; z-index: 8; left: var(--pad); bottom: 34px; display: flex; align-items: flex-end; }
.landing .stat { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line-soft); border-top: 0; }
.landing .stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.landing .stat b {
  display: block; font-family: var(--serif); font-weight: 400; font-size: 30px;
  line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.landing .stat span {
  display: block; margin-top: 6px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint);
}
.landing .foot {
  position: relative; z-index: 12; max-width: none; margin: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 15px var(--pad) 17px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint);
}
.landing .foot-l { display: flex; gap: 26px; align-items: center; }
.landing .foot-c { display: flex; gap: 10px; align-items: baseline; justify-content: center; }
.landing .foot-c b { color: var(--rust); font-weight: 400; letter-spacing: .16em; }
.landing .foot-r { display: flex; gap: 22px; justify-self: end; }
.landing .foot a:hover { color: var(--ink); }
.landing .globe-tooltip {
  position: absolute; z-index: 9; pointer-events: none; display: none;
  padding: 6px 10px; border: 1px solid var(--line); background: var(--paper-2);
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap;
}
.landing .globe-tooltip.show { display: block; }

/* ============================================================
   应用专有：地球、信纸内页、弹窗、表单
   ============================================================ */
.globe-stage { position: relative; }
.globe-stage > .globe-canvas { position: absolute; inset: 0; }
.globe-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.globe-canvas.dragging { cursor: grabbing; }
.globe-tooltip {
  position: absolute; z-index: 5; pointer-events: none; display: none;
  padding: 6px 10px; border: 1px solid var(--line); background: var(--paper-2);
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap;
}
.globe-tooltip.show { display: block; }

/* 信纸内页（读信 / 遇见） */
.letter-sheet {
  position: relative; overflow: hidden; padding: 30px 32px; color: var(--ink);
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(var(--ink-rgb),.055) 31px 32px);
  border: 1px solid var(--line-soft);
  box-shadow: 0 14px 30px -26px rgba(var(--ink-rgb),.28);
}
.letter-sheet::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 1px;
  background: rgba(154, 79, 50, .16);
}
.letter-sheet .page-head, .letter-sheet .bottle-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.letter-sheet .page-no { font-family: var(--mono); font-size: 8.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.letter-sheet .bottle-head { justify-content: flex-start; }
.letter-sheet .bottle-head .tiny, .letter-sheet .bottle-head .meta { color: var(--faint); font-size: 10px; font-family: var(--mono); }
.letter-sheet .bottle-head strong { color: var(--ink); font-family: var(--serif); font-size: 17px; font-weight: 400; }
.letter-sheet .bottle-head .meta { margin-left: auto; text-align: right; }
.letter-sheet .preset-line { color: var(--sea); font-family: var(--serif); font-style: italic; font-size: 16px; margin: 12px 0 9px; position: relative; }
.letter-sheet .page-content, .letter-sheet .excerpt {
  color: var(--ink); font-family: var(--serif); font-size: 15.5px; line-height: 32px; white-space: pre-wrap;
  position: relative;
}
.letter-sheet .page-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 20px; color: var(--faint);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  position: relative;
}
.letter-sheet .language-note {
  margin: 14px 0; padding: 10px 13px; color: var(--sea); background: rgba(46, 95, 92, .06);
  border-left: 1px solid rgba(46, 95, 92, .35); font-size: 11px; position: relative;
}
.letter-sheet .sticker { font-size: 22px; line-height: 1; }

/* 详情 */
.detail-map { margin-bottom: 0; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.detail-map svg { width: 100%; height: auto; display: block; }

/* 海图本体：陆地只给一层极淡的纸灰 + 细描边，绝不能让它压过轨迹 */
.map-grid { background: #dff1ed; }
.map-grid .land path {
  fill: rgba(var(--ink-rgb), .05);
  stroke: rgba(var(--ink-rgb), .3);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.map-grid .graticule line { stroke: rgba(var(--ink-rgb), .1); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-grid .track polyline { fill: none; stroke: #e8846b; stroke-width: 1.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-grid .track circle { fill: #e8846b; }
.map-grid .track circle.origin { fill: #fffdf8; stroke: #e8846b; stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-grid text { font-family: var(--sans); }
.map-legend {
  display: flex; gap: 18px; padding: 12px 16px; color: var(--faint); font-size: 10px;
  flex-wrap: wrap; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.map-legend > span { display: inline-flex; align-items: center; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; }
.detail-summary { margin-top: 30px; }
.detail-summary .stat { padding: 20px 10px 18px; text-align: center; }
.detail-summary .stat-n { font-size: 26px; letter-spacing: 0; }
.detail-summary .stat-l { margin-top: 8px; font-size: 9px; }
.detail-columns { display: grid; grid-template-columns: 1.22fr .78fr; gap: 54px; align-items: start; margin-top: 40px; }
.detail-columns > section > .section-head h2 { font-size: 22px; }
.page-entry { margin-bottom: 16px; }
.side-panel { padding: 22px 24px; margin-bottom: 14px; border: 1px solid var(--line-soft); background: var(--paper-2); }
.side-panel h3 {
  font-size: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; font-weight: 400; color: var(--muted);
}
.log-day { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.log-day:last-child { border-bottom: 0; }
.log-day .d { color: var(--faint); font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; }
.log-day .t { display: block; margin-top: 3px; color: var(--ink); font-family: var(--serif); font-size: 14px; }
.log-day .muted { color: var(--faint); font-size: 11px; }
.stamp-row { display: flex; flex-wrap: wrap; gap: 9px; }
.stamp {
  width: 46px; height: 46px; border-radius: 50%; border: 1px dashed var(--rust);
  display: grid; place-items: center; font-size: 20px; transform: rotate(-6deg); opacity: .8;
}
.stamp:nth-child(even) { transform: rotate(7deg); border-color: var(--sea); }
.receipt { padding: 16px; border-left: 1px solid var(--rust); background: rgba(154, 79, 50, .04); font-size: 12px; }
.receipt strong { display: block; margin-bottom: 5px; color: var(--ink); font-weight: 400; font-family: var(--serif); font-size: 15px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0 0; align-items: center; }
.action-bar .pill { padding: 7px 10px; font-size: 8px; letter-spacing: .05em; }
.farthest-card { padding: 18px 22px; margin-bottom: 30px; border-left: 1px solid var(--rust); background: rgba(154, 79, 50, .04); }
.farthest-card strong { display: block; color: var(--ink); font-family: var(--serif); font-weight: 400; margin-top: 4px; }
.farthest-card .tiny { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

/* 空状态 / 载入 */
.empty-state { padding: 70px 0 40px; text-align: center; }
.empty-state h3 { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.empty-state p { color: var(--muted); margin-top: 10px; font-size: 14px; }
.empty-state .btn { margin-top: 20px; }
.jelly {
  width: 52px; height: 52px; margin: 0 auto 20px; border-radius: 50% 50% 42% 42%;
  border: 1px solid rgba(46, 95, 92, .3); position: relative;
  animation: breathe 5s ease-in-out infinite;
}
.jelly::before, .jelly::after {
  content: ""; position: absolute; top: 43px; width: 12px; height: 22px;
  border-left: 1px solid rgba(46, 95, 92, .3); border-radius: 50%;
}
.jelly::before { left: 13px; transform: rotate(8deg); }
.jelly::after { right: 13px; transform: rotate(-8deg); }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.loading-screen { min-height: 56vh; display: grid; place-items: center; }
.loading-screen > div {
  display: grid; place-items: center; gap: 14px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--faint);
}
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); border-top-color: var(--rust);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 邮戳 */
.pm {
  --pm-ink: #9d3b2c;
  position: relative; display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  font-size: 10px; line-height: 1.16; color: var(--pm-ink);
  transform: rotate(-7deg); transform-origin: center;
  pointer-events: none; user-select: none;
  mix-blend-mode: multiply;
}
.pm-ink-red { --pm-ink: #9d3b2c; }
.pm-ink-blue { --pm-ink: #31495c; }
.pm-ink-ink { --pm-ink: #3b3128; }
.pm-ink-olive { --pm-ink: #5b6142; }
.pm.is-dry { opacity: .4; }
.pm.is-pressed { opacity: .92; }
.pm-port, .pm-meteo {
  width: 8.8em; height: 8.8em; border-radius: 50%;
  border: .16em solid currentColor;
}
.pm-ring { position: absolute; inset: .34em; border: .06em solid currentColor; border-radius: 50%; opacity: .72; }
.pm-text { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1em; padding: 0 .5em; }
.pm-kicker { font-size: .6em; letter-spacing: .17em; opacity: .82; text-transform: uppercase; }
.pm-main { font-family: var(--serif); font-size: 1.95em; line-height: 1.05; letter-spacing: .03em; }
.pm-sub { font-size: .76em; letter-spacing: .02em; opacity: .92; }
.pm-foot { font-size: .66em; letter-spacing: .12em; opacity: .8; }
.pm-tiny { font-size: .55em; letter-spacing: .06em; opacity: .6; }
.pm-cancel { flex-direction: row; align-items: center; gap: .35em; width: 16em; height: 4.2em; }
.pm-cancel-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 0 .5em; border: .12em solid currentColor; border-radius: .08em;
}
.pm-cancel-box em { font-style: normal; font-family: var(--serif); font-size: 1.1em; letter-spacing: .04em; line-height: 1.25; }
.pm-cancel-box i { font-style: normal; font-size: .56em; letter-spacing: .06em; opacity: .85; white-space: nowrap; line-height: 1.5; }
.pm-waves { flex: 1 1 auto; height: 58%; }
.pm-waves path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .72; }
.pm-parcel { width: 12.6em; padding: .22em; border: .16em solid currentColor; border-radius: .1em; }
.pm-frame {
  display: flex; flex-direction: column; align-items: center; gap: .2em;
  width: 100%; padding: .55em .6em; border: .06em solid currentColor;
}
.pm-parcel-main { font-family: var(--serif); font-size: 1.08em; letter-spacing: .02em; }
.pm-parcel-foot { display: flex; gap: .55em; align-items: baseline; font-size: .64em; letter-spacing: .1em; opacity: .85; }
.pm-parcel-foot em, .pm-parcel-foot i { font-style: normal; }
.pm-parcel-foot i { opacity: .72; }
.letter-stamp { position: absolute; right: 34px; bottom: 70px; z-index: 2; }
.letter-stamp .pm { font-size: 11px; }
.sheet-stamp { display: flex; justify-content: flex-end; margin: 16px 6px 0 0; }
.sheet-stamp .pm { font-size: 9px; }
@keyframes pm-press {
  0%   { transform: rotate(-7deg) scale(1.62); opacity: 0; filter: blur(.7px); }
  55%  { transform: rotate(-7deg) scale(.93); opacity: 1; filter: blur(0); }
  72%  { transform: rotate(-7deg) scale(1.04); }
  100% { transform: rotate(-7deg) scale(1); opacity: .92; }
}
.letter-stamp.is-pressing .pm { animation: pm-press .64s cubic-bezier(.25, .8, .3, 1) both; }
@keyframes paper-thud { 0% { transform: scale(1); } 55% { transform: scale(.993); } 100% { transform: scale(1); } }
.letter.is-stamping { animation: paper-thud .5s ease-out; }
.postmark.is-stamp .pm { font-size: 10px; }

/* 弹窗 */
#modal-root { position: relative; z-index: 50; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(var(--ink-rgb), .42);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  animation: fade .22s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 500px; max-height: calc(100svh - 48px); overflow: auto;
  background: var(--paper); border: 1px solid var(--line);
  padding: 34px 36px 30px;
  box-shadow: 0 40px 90px -50px rgba(var(--ink-rgb),.7);
  animation: rise .3s ease both;
}
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.modal-head h2 { font-family: var(--serif); font-size: 27px; font-weight: 400; line-height: 1.1; }
.modal-head p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.icon-btn {
  border: 0; background: none; padding: 0 4px; line-height: 1;
  font-family: var(--mono); font-size: 20px; color: var(--faint);
}
.icon-btn:hover { color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.account-form { display: grid; gap: 18px; }
.account-form label { display: grid; gap: 7px; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.account-form input, .modal textarea, .modal input[type="text"], .modal input[type="email"], .modal input[type="password"], .modal select {
  width: 100%; border: 1px solid var(--line); background: var(--paper-2); border-radius: 0;
  padding: 11px 13px; outline: none; color: var(--ink);
  font-family: var(--sans); font-size: 14px; transition: border-color .18s ease;
}
.account-form input { font-family: var(--mono); font-size: 13px; }
.account-form input:focus, .modal textarea:focus, .modal input:focus, .modal select:focus { border-color: var(--sea); }
.modal textarea { min-height: 150px; line-height: 1.9; resize: vertical; }
.account-note { color: var(--muted); font-size: 13px; line-height: 1.8; }
.account-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.account-row strong { color: var(--ink); font-weight: 400; text-transform: none; letter-spacing: 0; }
.account-logout-row { display: flex; justify-content: flex-end; margin-top: 20px; }
.account-switch { font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: center; }
.account-switch .text-btn { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.account-error { margin-top: 16px; padding: 10px 12px; border-left: 1px solid var(--rust); background: rgba(154,79,50,.06); color: var(--rust); font-size: 12px; }
.indicator-locate { display: flex; }
.city-auto-hint { margin-bottom: 16px; padding: 10px 13px; border-left: 1px solid var(--sea); background: rgba(46,95,92,.05); color: var(--sea); font-size: 12px; }
.locate-btn { margin-bottom: 16px; }
.city-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; max-height: 260px; overflow: auto; }
.city-option {
  border: 1px solid var(--line-soft); background: transparent; padding: 10px 10px;
  font-family: var(--serif); font-size: 14px; text-align: left;
  transition: border-color .18s ease, background .18s ease;
}
.city-option:hover { border-color: var(--line); }
.city-option.selected { border-color: var(--ink); background: rgba(var(--ink-rgb),.04); }
.form-label { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.sticker-option {
  aspect-ratio: 1; border: 1px solid var(--line-soft); background: transparent;
  display: grid; place-items: center; font-size: 22px; transition: .18s ease;
}
.sticker-option:hover { border-color: var(--line); }
.sticker-option.selected { border-color: var(--ink); background: rgba(var(--ink-rgb),.04); }
.counter-row { display: flex; justify-content: space-between; color: var(--faint); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; margin-top: 7px; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.small { font-size: 12px; }

/* ---------- responsive (driftpost) ---------- */
@media (max-width: 1040px) {
  :root { --pad: 32px; }
  .hero { gap: 36px; grid-template-columns: 1fr .85fr; }
  .home-cols { grid-template-columns: 1fr; gap: 40px; }
  .manifesto { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .encounter-grid { grid-template-columns: 1fr 1fr; }
  .desk { grid-template-columns: 1fr; }
  .desk-send { padding: 30px 0 30px; border-right: 0; border-bottom: 1px solid var(--line); }
  .desk-inbox { padding: 30px 0 34px; }
  .stat-strip.six { grid-template-columns: repeat(3, 1fr); }
  .stat-strip.six .stat:nth-child(3n) { border-right: 0; }
  .landing .cover { width: min(520px, 56vw); }
  .landing .mast-mid { gap: 18px; }
  .landing .legend { bottom: 26px; }
  .landing .stat { padding-right: 18px; margin-right: 18px; }
  .landing .stat b { font-size: 25px; }
}
@media (max-width: 860px) {
  .masthead { grid-template-columns: 1fr auto; height: auto; padding-top: 16px; padding-bottom: 0; }
  .masthead .wordmark { padding-bottom: 12px; }
  .mast-actions { padding-bottom: 12px; }
  .masthead .mainnav {
    grid-column: 1 / -1; order: 3; justify-content: flex-start; gap: 22px;
    overflow-x: auto; padding: 14px 0 12px; border-top: 1px solid var(--line-soft);
    scrollbar-width: none;
  }
  .masthead .mainnav::-webkit-scrollbar { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 46px; padding-bottom: 44px; }
  .hero-chart { max-width: 430px; margin: 8px auto 0; width: 100%; }
  .write-grid { grid-template-columns: 1fr; }
  .send-panel { position: static; }
  .settings-grid { grid-template-columns: 1fr; gap: 26px; }
  .settings-index { position: static; display: flex; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
  .detail-columns { grid-template-columns: 1fr; gap: 36px; }
  .landing .mast { grid-template-columns: 1fr auto; height: auto; padding-top: 15px; padding-bottom: 14px; row-gap: 10px; }
  .landing .mast-mid { grid-column: 1 / -1; grid-row: 2; gap: 20px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .landing .mast-mid::-webkit-scrollbar { display: none; }
  .landing .mast-right { grid-row: 1; grid-column: 2; }
  .landing .cover { top: auto; bottom: 112px; transform: none; width: auto; right: var(--pad); }
  .landing .cover h1 { font-size: clamp(32px, 6.6vw, 52px); margin-top: 18px; }
  :lang(zh) .landing .cover h1, :lang(ja) .landing .cover h1 { font-size: clamp(26px, 5.2vw, 42px); }
  .studies { display: none; }
  .landing .lede { font-size: 14px; margin-top: 20px; }
  .landing .actions { margin-top: 24px; }
  .landing .micro { display: none; }
  .landing .legend { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 0; left: var(--pad); right: var(--pad); bottom: 22px; }
  .landing .stat { border-right: 0; padding-right: 0; margin-right: 0; display: flex; align-items: baseline; gap: 8px; }
  .landing .stat b { font-size: 20px; }
  .landing .stat span { margin-top: 0; }
  .landing .foot-c { display: none; }
  .landing .foot { grid-template-columns: 1fr auto; }
  .landing .foot-l span:first-child { display: none; }
  .landing .foot-r { gap: 14px; }
}
@media (max-width: 620px) {
  :root { --pad: 20px; }
  .wordmark-name { font-size: 18px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .encounter-grid, .sea-grid { grid-template-columns: 1fr; }
  .letter { padding: 30px 24px 44px; }
  .letter::before { left: 14px; }
  .letter-body { font-size: 16px; line-height: 32px; max-width: 100%; }
  .field-row { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .field-label { padding-top: 0; }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .avatar-option { font-size: 17px; }
  .section-note { display: none; }
  .foot { flex-direction: column; }
  .table th:nth-child(3), .table td:nth-child(3),
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
  .stat-strip.six { grid-template-columns: 1fr 1fr; }
  .stat-strip.six .stat { border-right: 0; }
  .stat-strip.six .stat:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .stat-strip.six .stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .letter-row { grid-template-columns: 26px 1fr auto; gap: 12px; padding: 14px 2px; }
  .letter-row-art { width: 26px; }
  .letter-row-art .envelope-art.sm { width: 24px; }
  .letter-row-title { font-size: 14.5px; }
  .row-days { display: none; }
  .detail-summary .stat { padding: 18px 10px 16px; }
  .city-list { grid-template-columns: 1fr 1fr; }
  .modal { padding: 26px 22px; }
  .landing .cover { bottom: 96px; }
  .landing .cover h1 { font-size: clamp(26px, 7.4vw, 40px); }
  :lang(zh) .landing .cover h1, :lang(ja) .landing .cover h1 { font-size: clamp(22px, 6.2vw, 34px); }
  .landing .lede { display: none; }
  .landing .micro { display: none; }
  .landing .btn-ghost { padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
