/* ================================================================
   Tokyo — 网格、细线、字体层级。黑白灰为主，朱红只用于“现在”。
   ================================================================ */
:root {
  --paper: #f8f8f6;
  --ink: #0f0f0f;
  --g1: #555553;      /* 次要文字 */
  --g2: #9b9b97;      /* 标注、英文小标 */
  --rule: #dededa;    /* 细线 */
  --accent: #e2402a;  /* 朱红 */
  --side: 20px;
  --col: 68px;        /* 时间列宽 */
  --tabbar: 56px;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --wrap: 680px;
  --display: "Helvetica Neue", "SF Pro Display", -apple-system, Helvetica, Arial, "PingFang SC", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d0d0c;
    --ink: #f0f0ec;
    --g1: #b0b0aa;
    --g2: #6f6f6a;
    --rule: #2a2a28;
    --accent: #ff5a40;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
body.noscroll { position: fixed; left: 0; right: 0; overflow: hidden; }
.top, .tabbar, .btn, .textbtn, .ds-day, .vote, .rowlink, .name, .ov-day { -webkit-user-select: none; user-select: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
h1, h2, h3, p, dl, dd, ol { margin: 0; padding: 0; }
.muted { color: var(--g2); }

/* 英文小标 */
.eyebrow {
  font: 500 10.5px/1.4 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--g2);
}
.eyebrow.split { display: flex; justify-content: space-between; gap: 12px; }

/* 朱红圆点（日之丸） */
.sun { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.sun.big { width: 76px; height: 76px; }

/* ---------- 外壳 ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) max(var(--side), calc((100vw - var(--wrap)) / 2 + var(--side))) 12px;
  padding-left: max(var(--side), env(safe-area-inset-left), calc((100vw - var(--wrap)) / 2 + var(--side)));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.mark { display: flex; align-items: center; gap: 9px; font-family: var(--display); }
.mark b { font-size: 14px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.mark span { font-size: 12px; color: var(--g2); letter-spacing: .08em; }
.sync { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--g2); padding: 10px; margin: -10px; }
.install-step { font-size: 17px; line-height: 1.6; font-weight: 500; }
.sync i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); opacity: .35; }
.sync.off i { background: var(--accent); opacity: 1; }
.sync.off { color: var(--accent); }

.main {
  max-width: var(--wrap); margin: 0 auto;
  padding: 8px max(var(--side), env(safe-area-inset-right)) calc(var(--tabbar) + env(safe-area-inset-bottom) + 56px) max(var(--side), env(safe-area-inset-left));
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding: 0 max(calc(var(--side) - 8px), calc((100vw - var(--wrap)) / 2 + var(--side) - 8px)) env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--rule);
}
.tabbar a {
  position: relative; display: flex; align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: .1em; color: var(--g2);
}
.tabbar a.active { color: var(--ink); font-weight: 600; }
.tab-ind { position: absolute; top: -1px; left: 26%; right: 26%; height: 2px; background: var(--ink); }

.notice {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  margin: 14px var(--side) 0; padding: 12px 14px;
  border: 1px solid var(--ink); font-size: 13px; line-height: 1.55;
}

/* ---------- 区块标题 ---------- */
.sec {
  display: flex; align-items: baseline; gap: 10px;
  margin-top: 44px; padding-top: 10px;
  border-top: 1px solid var(--ink);
}
.sec h2 { font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.sec-en { font: 500 10.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--g2); }
.sec-right { margin-left: auto; font-size: 12.5px; }

/* ---------- 今日 · 大字 ---------- */
.hero { padding: 28px 0 4px; }
.hero-num > span, .hero-date > span { display: inline-block; }
.hero-num {
  font: 200 clamp(132px, 46vw, 220px)/.82 var(--display);
  letter-spacing: -.06em;
  margin: 22px 0 26px -.06em;
}
.hero-date {
  font: 200 clamp(56px, 18vw, 84px)/.9 var(--display);
  letter-spacing: -.04em;
  margin: 18px 0 0 -.04em;
}
.hero-date small { font-size: 13px; font-weight: 500; letter-spacing: .14em; margin-left: 12px; color: var(--g2); vertical-align: top; }
.hero-title { font-size: 22px; font-weight: 600; letter-spacing: .02em; margin-top: 14px; line-height: 1.35; }
.hero-next {
  display: grid; grid-template-columns: var(--col) 1fr; grid-template-areas: "l t" "l n" "l m"; row-gap: 2px;
  margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 14px;
}
.hero-next .lbl { grid-area: l; font-size: 11px; color: var(--accent); letter-spacing: .1em; padding-top: 2px; margin: 0; }
.hero-next-time { grid-area: t; font: 500 15px var(--display); }
.hero-next-title { grid-area: n; font-weight: 600; }
.hero-next .muted { grid-area: m; font-size: 12.5px; }

.facts { display: grid; grid-template-columns: 1fr 1fr 1.4fr; border-top: 1px solid var(--rule); }
.facts > div { padding: 10px 12px 0 0; }
.facts > div + div { padding-left: 12px; border-left: 1px solid var(--rule); }
.facts dt { font-size: 11px; color: var(--g2); letter-spacing: .1em; }
.facts dd { font: 500 17px/1.5 var(--display); white-space: nowrap; }
.facts dd small { font-size: 10.5px; color: var(--g2); letter-spacing: .12em; margin-left: 6px; }

/* 行程概览：7 列柱状 */
.overview {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-top: 16px; border-bottom: 1px solid var(--rule);
}
.ov-day { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 6px 12px 0; }
.ov-day + .ov-day { padding-left: 6px; border-left: 1px solid var(--rule); }
.ov-wk { font: 500 10px var(--display); letter-spacing: .12em; color: var(--g2); }
.ov-num { font: 300 24px/1.1 var(--display); letter-spacing: -.02em; }
.ov-bar { display: flex; align-items: flex-end; width: 100%; height: 52px; margin: 8px 0 6px; border-bottom: 1px solid var(--ink); }
.ov-bar i { display: block; width: 6px; background: var(--ink); }
.ov-count { font-size: 11px; color: var(--g2); }
.ov-day.has .ov-count { color: var(--ink); }

/* ---------- 行程：日期条 ---------- */
.daystrip {
  display: grid; grid-template-columns: repeat(var(--n, 7), minmax(40px, 1fr));
  margin: 16px calc(var(--side) * -1) 0; padding: 0 var(--side);
  overflow-x: auto; scrollbar-width: none;
}
.daystrip::-webkit-scrollbar { display: none; }
.ds-day {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 8px 8px 9px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.ds-day + .ds-day { border-left: 1px solid var(--rule); }
.ds-wk { font: 500 10px var(--display); letter-spacing: .12em; color: var(--g2); }
.ds-num { font: 300 22px/1.1 var(--display); }
.ds-day.today::after {
  content: ""; position: absolute; right: 7px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.ds-day.active { background: var(--ink); color: var(--paper); border-bottom-color: var(--ink); }
.ds-day.active .ds-wk { color: var(--paper); opacity: .6; }

.dayhead, .pagehead { padding-top: 28px; }
.dayhead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dayhead .hero-date { margin-top: 10px; }
.dayhead-title { display: block; margin-top: 14px; font-size: 22px; font-weight: 600; letter-spacing: .02em; line-height: 1.35; }
.dayhead-title.placeholder { font-size: 15px; font-weight: 400; color: var(--g2); }
.pagehead h1 { font-size: 34px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; margin-top: 10px; }
.pagehead > p { margin-top: 10px; font-size: 13.5px; }
.pagehead .dayhead-row { align-items: center; }

.listhead {
  display: grid; grid-template-columns: var(--col) 1fr auto; align-items: end;
  margin-top: 34px; padding-bottom: 8px; border-bottom: 1px solid var(--ink);
  font-size: 11px; letter-spacing: .1em; color: var(--g2);
}

/* ---------- 行（列表单元） ---------- */
.row {
  display: grid; grid-template-columns: var(--col) 1fr; align-items: start;
  padding: 18px 0 20px; border-bottom: 1px solid var(--rule);
}
.sec + .row, .listhead + .row { border-top: 0; }
.row.item { cursor: pointer; }
.row.info { grid-template-columns: 1fr; }
.row-time { display: flex; flex-direction: column; font-family: var(--display); line-height: 1.25; padding-top: 1px; }
.t1 { position: relative; font-size: 17px; font-weight: 500; letter-spacing: .01em; }
.t2 { font-size: 12.5px; color: var(--g2); margin-top: 3px; }
.t-tbd { font-size: 12.5px; color: var(--g2); letter-spacing: .08em; padding-top: 3px; }
.tz { font-size: 10px; color: var(--g2); letter-spacing: .06em; margin-top: 6px; }
.row-body { min-width: 0; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 11px; color: var(--g2); letter-spacing: .08em; }
.kicker i { font: normal 500 9.5px var(--display); letter-spacing: .14em; text-transform: uppercase; margin-left: 6px; }
.flag {
  font-size: 10px; letter-spacing: .1em; line-height: 1; padding: 3px 6px 2px;
  border: 1px solid var(--ink); color: var(--ink);
}
.flag.now { background: var(--accent); border-color: var(--accent); color: #fff; }
.flag.warn { border-color: var(--accent); color: var(--accent); }
.row-title { font-size: 17px; font-weight: 600; letter-spacing: .02em; line-height: 1.4; margin-top: 4px; overflow-wrap: anywhere; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.row-head .row-title { margin-top: 0; }
.row-line { font-size: 13px; color: var(--g1); margin-top: 6px; overflow-wrap: anywhere; }
.row-line.links { display: block; }
.row-line.links .ext + .ext { margin-left: 18px; white-space: nowrap; }
.lbl { font-size: 11px; color: var(--g2); letter-spacing: .08em; margin-right: 10px; }
.row-note { font-size: 13.5px; color: var(--g1); margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.row-note a, .block a:not(.btn) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ext { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ext-mark { font-size: 10px; margin-left: 3px; }
.row-actions { margin-top: 12px; }
.pin { font-size: 10px; font-weight: 400; color: var(--accent); letter-spacing: .1em; margin-left: 10px; vertical-align: 2px; }
.row.info .btn { margin-top: 12px; }

.row.is-past { opacity: .36; }
.row.is-now .t1 { color: var(--accent); }
.row.is-now .t1::before {
  content: ""; position: absolute; left: -12px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* 想去：左侧投票方块 */
.row.wish, .listhead.wide { grid-template-columns: 72px 1fr; }
.vote {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 54px; height: 60px; border: 1px solid var(--ink); text-align: center;
}
.vote b { font: 300 26px/1 var(--display); }
.vote small { font-size: 10px; letter-spacing: .1em; margin-top: 4px; color: var(--g2); }
.vote.on { background: var(--ink); color: var(--paper); }
.vote.on small { color: var(--paper); opacity: .7; }
.row.wish.is-done .row-body, .row.wish.is-done .vote { opacity: .45; }

.row.hist { grid-template-columns: 96px 1fr; padding: 14px 0; }
.row.hist p { font-size: 13.5px; }

/* 明日：紧凑列表 */
.compact { list-style: none; }
.compact li { display: grid; grid-template-columns: var(--col) 1fr; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.compact-time { font: 500 14px var(--display); color: var(--g1); }

.rowlink {
  display: grid; grid-template-columns: 1fr auto 24px; align-items: baseline; gap: 12px; width: 100%;
  padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 15px;
}
.rowlink .muted { font: 500 10.5px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.rowlink .chev { text-align: right; color: var(--g2); }
.rowlink.danger span:first-child { color: var(--accent); }
.menu .rowlink:first-child { border-top: 0; }

.block { padding: 14px 0 4px; font-size: 14px; color: var(--g1); }
.block > * + * { margin-top: 10px; }
.block .big { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.names { display: flex; flex-wrap: wrap; gap: 8px; }
.names > * + * { margin-top: 0; }
.name { padding: 9px 16px; border: 1px solid var(--ink); font-size: 14.5px; color: var(--ink); }
.name:active { background: var(--ink); color: var(--paper); }
.steps { list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: var(--col) 1fr;
  padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--g1);
}
.steps li::before { content: counter(s, decimal-leading-zero); font: 500 13px var(--display); color: var(--ink); }

.empty { padding: 44px 0; border-bottom: 1px solid var(--rule); }
.empty p { font-size: 14px; }
.empty p + p { margin-top: 4px; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-height: 44px; padding: 0 20px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 0;
  font-size: 14px; font-weight: 600; letter-spacing: .12em; white-space: nowrap;
}
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.block { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.textbtn { font-size: 12.5px; color: var(--g1); letter-spacing: .06em; white-space: nowrap; padding: 10px 0; margin: -10px 0; }
.textbtn.strong { color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.textbtn.danger { color: var(--accent); }

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field-label { font-size: 11px; color: var(--g2); letter-spacing: .1em; }
.field small { font-size: 11.5px; color: var(--g2); margin-top: 4px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; padding: 9px 0 10px;
  font: 16px/1.5 var(--sans); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--g2) 50%), linear-gradient(135deg, var(--g2) 50%, transparent 50%);
  background-position: calc(100% - 9px) 52%, calc(100% - 4px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 20px;
}
.field textarea { resize: vertical; }
.field input[type="time"], .field input[type="date"] { min-height: 46px; display: block; }
.field input::-webkit-date-and-time-value { text-align: left; }
.field input::placeholder, .field textarea::placeholder { color: var(--g2); opacity: .7; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 18px; }
.check { display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 14px; color: var(--ink); border-bottom: 1px solid var(--rule); }
.check input { width: 16px !important; height: 16px; accent-color: var(--ink); -webkit-appearance: auto !important; appearance: auto !important; padding: 0 !important; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 22px; margin-top: 6px; }

/* ---------- 底部面板 ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 20;
  background: rgb(0 0 0 / calc(.36 * var(--dim, 1)));
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .3s var(--ease);
  transition: background-color .28s var(--ease);
}
.sheet-wrap.closing { background: rgb(0 0 0 / 0); pointer-events: none; }
.sheet {
  width: 100%; max-width: var(--wrap);
  max-height: calc(100dvh - env(safe-area-inset-top) - 18px); overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--paper);
  padding: 10px var(--side) calc(env(safe-area-inset-bottom) + 24px);
  animation: sheet-up .46s var(--ease);
  transition: transform .34s var(--ease);
}
.sheet.dragging { transition: none; }
.sheet-wrap.closing .sheet { transform: translateY(104%) !important; transition: transform .28s var(--ease-in); }
.grabber { width: 36px; height: 3px; margin: 0 auto 18px; background: var(--rule); }
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--ink);
}
.sheet-head h2 { font-size: 24px; font-weight: 700; letter-spacing: .02em; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px); z-index: 30;
  transform: translateX(-50%); max-width: calc(100vw - 40px);
  background: var(--ink); color: var(--paper); padding: 11px 18px; font-size: 13px; letter-spacing: .04em;
  animation: toast-in .4s var(--ease);
  transition: opacity .26s, transform .26s var(--ease-in);
}
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }

.bigtext {
  position: fixed; inset: 0; z-index: 40; background: #fff; color: #000;
  display: flex; flex-direction: column; justify-content: center; gap: 24px;
  padding: calc(env(safe-area-inset-top) + 32px) 28px calc(env(safe-area-inset-bottom) + 32px);
  animation: fade .3s var(--ease);
  transition: opacity .22s;
}
.bigtext.out { opacity: 0; }
.bigtext-body { animation: row-in .5s var(--ease) .05s both; }
.bigtext .eyebrow { color: #888; position: absolute; top: calc(env(safe-area-inset-top) + 28px); left: 28px; }
.bigtext-body { font: 600 clamp(30px, 9.5vw, 68px)/1.3 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: .02em; }
.bigtext-hint { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 24px); left: 28px; color: #999; font-size: 12px; letter-spacing: .1em; }

/* ---------- 登录海报 ---------- */
.gate {
  max-width: 520px; min-height: 100vh; min-height: 100svh; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 28px) 24px calc(env(safe-area-inset-bottom) + 32px);
  display: flex; flex-direction: column; gap: 22px;
}
.gate-top { display: flex; flex-direction: column; gap: 40px; }
.gate-top .eyebrow { border-top: 1px solid var(--ink); padding-top: 10px; }
.gate-title { display: flex; flex-direction: column; margin-bottom: auto; }
.gate-title > span:first-child {
  font: 700 clamp(84px, 27vw, 148px)/.86 var(--display); letter-spacing: -.055em; margin-left: -.05em;
}
.gate-sub { font: 300 22px/1.4 var(--display); letter-spacing: .02em; margin-top: 14px; color: var(--g1); }
.gate .notice { margin: 0; }
.gate .names { margin-top: -6px; }

@media (min-width: 720px) {
  :root { --side: 32px; --col: 84px; }
}
@media (max-width: 374px) {
  :root { --side: 16px; --col: 58px; }
  .tabbar a { font-size: 12.5px; letter-spacing: .02em; }
  .conv-in { font-size: 24px; }
  .bal-row { grid-template-columns: 1fr auto; }
  .bal-row .muted { display: none; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 .field:last-child { grid-column: span 2; }
  .facts dd { font-size: 15px; }
  .tabbar a { letter-spacing: .06em; }
  .row.wish, .listhead.wide { grid-template-columns: 64px 1fr; }
  .vote { width: 50px; }
  .sheet-head h2 { font-size: 21px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hero-num { font-size: 128px; margin: 12px 0 16px; }
  .gate { min-height: auto; }
  .gate-top { flex-direction: row; align-items: flex-start; gap: 24px; }
  .gate-top .eyebrow { flex: 1; }
  .sun.big { width: 52px; height: 52px; }
}

/* ---------- 天气 ---------- */
.wx { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 10px; font-size: 12.5px; color: var(--g1); letter-spacing: .04em; }
.wx-temp { font: 500 15px var(--display); color: var(--ink); }
.wx-temp i { font-style: normal; color: var(--g2); }
.ds-temp { font: 500 10.5px var(--display); color: var(--g2); margin-top: 2px; }
.ds-day.active .ds-temp { color: var(--paper); opacity: .65; }
.ov-temp { font: 500 10.5px var(--display); color: var(--g2); }

/* ---------- 附件 ---------- */
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.atts.edit { padding: 8px 0 2px; }
.att {
  position: relative; width: 64px; height: 64px; flex: none; overflow: hidden;
  border: 1px solid var(--rule); background: var(--paper); padding: 0;
}
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-doc { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 7px; text-align: left; }
.att-doc b { font: 700 11px var(--display); letter-spacing: .12em; }
.att-doc small { font-size: 9.5px; line-height: 1.3; color: var(--g2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.att.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-style: dashed; border-color: var(--g2); color: var(--g1); }
.att.add span { font: 300 24px/1 var(--display); }
.att.add small { font-size: 9.5px; letter-spacing: .04em; }
.att.busy { display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: var(--g2); animation: pulse 1.2s ease-in-out infinite; }
.att-x {
  position: absolute; top: 0; right: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1;
}
.viewer {
  position: fixed; inset: 0; z-index: 40; background: #fff; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); animation: fade .25s var(--ease); transition: opacity .2s;
}
.viewer.out { opacity: 0; }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.viewer-bar { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; font-size: 12px; color: #888; letter-spacing: .06em; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- 账本与换算 ---------- */
.money-facts { margin-top: 24px; grid-template-columns: 1.2fr 1fr .7fr; }
.money-facts dd { font-size: 16px; }
.conv { display: grid; grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1.2fr); align-items: baseline; gap: 10px; padding: 14px 0 6px; border-bottom: 1px solid var(--rule); }
.conv-in {
  width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; padding: 2px 0 4px;
  font: 300 30px/1.1 var(--display); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.conv-in:focus { outline: none; }
.conv-in::placeholder { color: var(--g2); opacity: .45; }
.conv-unit { font-size: 13px; padding: 6px 8px; border: 1px solid var(--rule); letter-spacing: .06em; }
.conv-unit:active { background: var(--ink); color: var(--paper); }
.conv-eq { color: var(--g2); font: 300 20px var(--display); }
.conv-out { font: 500 17px var(--display); text-align: right; overflow-wrap: anywhere; }
.conv-preview { display: block; margin-top: -10px; font: 500 13px var(--display); color: var(--g1); min-height: 1em; }
.row.settle, .row.expense { grid-template-columns: 1fr; padding: 14px 0; }
.row.expense { cursor: pointer; position: relative; isolation: isolate; }
.row.expense::before { content: ""; position: absolute; z-index: -1; inset: 0 calc(var(--side) * -1); background: var(--ink); opacity: 0; transition: opacity .3s var(--ease); }
.row.expense:active::before { opacity: .05; transition-duration: 0s; }
.settle-line { font-size: 15px; }
.settle-amt, .exp-amt { font: 500 16px var(--display); white-space: nowrap; }
.bal-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.bal-row.me .bal-name { font-weight: 600; }
.bal-row .muted { font: 12px var(--display); }
.bal-net { font: 500 14px var(--display); min-width: 7.5em; text-align: right; }
.bal-net.neg { color: var(--accent); }
.ledger-date { margin-top: 18px; padding-bottom: 4px; font: 500 10.5px var(--display); letter-spacing: .14em; color: var(--g2); border-bottom: 1px solid var(--rule); }

/* ---------- 参与人、筛选、AI 密钥 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.chip { padding: 7px 13px; border: 1px solid var(--rule); font-size: 13.5px; color: var(--g1); transition: background-color .18s, color .18s, border-color .18s, transform .18s var(--ease); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip:active { transform: scale(.95); }
.people { color: var(--ink); letter-spacing: .04em; }
.people.me { font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .1em; color: var(--g2); padding: 8px 0; margin: -8px 0; }
.toggle i { position: relative; width: 26px; height: 14px; border: 1px solid var(--g2); transition: background-color .2s, border-color .2s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; background: var(--g2); transition: transform .26s var(--ease), background-color .2s; }
.toggle.on { color: var(--ink); }
.toggle.on i { background: var(--ink); border-color: var(--ink); }
.toggle.on i::after { background: var(--paper); transform: translateX(12px); }
.notice-text { font-size: 13px; color: var(--accent); line-height: 1.6; }
.keybox { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ink); }
.keybox code { flex: 1; min-width: 0; font: 500 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; color: var(--ink); }
.codebox {
  margin: 6px 0 8px; padding: 12px 14px; background: color-mix(in srgb, var(--ink) 5%, transparent);
  font: 12px/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.tokens { border-top: 1px solid var(--rule); }
.token-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; }
.token-row code { font: 500 12.5px ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); }

/* ================================================================
   动效：节制、快速、有方向。所有过渡都在说明“从哪里来，到哪里去”。
   ================================================================ */
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-fade { from { opacity: 0; } }
@keyframes vt-out-l { to { opacity: 0; transform: translateX(-32px); } }
@keyframes vt-in-r { from { opacity: 0; transform: translateX(40px); } }
@keyframes vt-out-r { to { opacity: 0; transform: translateX(32px); } }
@keyframes vt-in-l { from { opacity: 0; transform: translateX(-40px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes type-up { from { transform: translateY(.32em); clip-path: inset(0 -10% 100% -10%); } to { clip-path: inset(-10% -10% -10% -10%); } }
@keyframes bar-up { from { transform: scaleY(0); } }
@keyframes bump { 0% { transform: scale(.4); opacity: .2; } 55% { transform: scale(1.18); } 100% { transform: none; } }
@keyframes sun-in { from { transform: scale(.15); opacity: 0; } }

/* 页面切换（View Transitions：页眉、导航保持不动，只有正文过渡） */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
.top { view-transition-name: top; }
.tabbar { view-transition-name: tabbar; }
.main { view-transition-name: main; }
.daystrip { view-transition-name: daystrip; }
.tab-ind { view-transition-name: tab-ind; }
.ds-day.active { view-transition-name: ds-active; }
::view-transition-group(main) { animation: none; }
::view-transition-group(tab-ind), ::view-transition-group(ds-active) { animation-duration: .44s; animation-timing-function: var(--ease); }
html[data-vt="tab"]::view-transition-old(main) { animation: vt-out .14s var(--ease-in) both; }
html[data-vt="tab"]::view-transition-new(main) { animation: vt-fade .3s var(--ease) both; }
html[data-vt="next"]::view-transition-old(main) { animation: vt-out-l .24s var(--ease-in) both; }
html[data-vt="next"]::view-transition-new(main) { animation: vt-in-r .44s var(--ease) .04s both; }
html[data-vt="prev"]::view-transition-old(main) { animation: vt-out-r .24s var(--ease-in) both; }
html[data-vt="prev"]::view-transition-new(main) { animation: vt-in-l .44s var(--ease) .04s both; }
html[data-vt="none"]::view-transition-old(main), html[data-vt="none"]::view-transition-new(main) { animation-duration: .18s; }

/* 不支持 View Transitions 的浏览器（如部分微信内核） */
.main.fb-next { animation: vt-in-r .42s var(--ease) both; }
.main.fb-prev { animation: vt-in-l .42s var(--ease) both; }

/* 进入页面：大字揭幕、柱状生长、各行依次浮现 */
.main.enter .hero-num > span, .main.enter .hero-date > span { animation: type-up .9s var(--ease) .05s both; }
.main.enter .hero-title, .main.enter .hero .eyebrow, .main.enter .facts, .main.enter .hero-next,
.main.enter .dayhead-title, .main.enter .pagehead > *:not(.eyebrow) { animation: row-in .6s var(--ease) .14s both; }
.main.enter .ov-bar i { transform-origin: bottom; animation: bar-up .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .25s); }
.main.enter > .sec, .main.enter > .row, .main.enter > .empty, .main.enter > .listhead, .main.enter > .rowlink,
.main.enter .compact li, .main.enter .block, .main.enter .steps li, .main.enter .menu .rowlink {
  animation: row-in .56s var(--ease) both; animation-delay: calc(var(--i, 0) * 32ms + .1s);
}
.gate.enter .sun.big { animation: sun-in 1.1s var(--ease) both; }
.gate.enter .gate-title > span:first-child { animation: type-up 1s var(--ease) .12s both; }
.gate.enter .gate-top .eyebrow, .gate.enter .gate-sub { animation: row-in .7s var(--ease) .3s both; }
.gate.enter > .eyebrow, .gate.enter .names, .gate.enter .form, .gate.enter .notice { animation: row-in .7s var(--ease) .42s both; }

/* 点击反馈 */
.row.item, .row.wish, .rowlink, .compact li { position: relative; isolation: isolate; }
.row.item::before, .rowlink::before {
  content: ""; position: absolute; z-index: -1; inset: 0 calc(var(--side) * -1);
  background: var(--ink); opacity: 0; transition: opacity .3s var(--ease); pointer-events: none;
}
.row.item:active::before, .rowlink:active::before { opacity: .05; transition-duration: 0s; }
.btn, .vote, .name, .tabbar a, .textbtn, .ext, .ds-day, .ov-day {
  transition: transform .22s var(--ease), opacity .2s, background-color .2s, color .2s;
}
.btn:active, .vote:active, .name:active { transform: scale(.955); transition-duration: .06s; }
.textbtn:active, .ext:active, .tabbar a:active, .ov-day:active { opacity: .42; transition-duration: .05s; }
.ds-day:active:not(.active) { background: color-mix(in srgb, var(--ink) 7%, transparent); transition-duration: .05s; }
.vote.bump b { animation: bump .5s var(--ease); }
.sync:active { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
