/* ============================================================
   Arrivewell — iOS 风格设计系统
   ============================================================ */
:root {
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-strong: rgba(120, 120, 128, 0.2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.18);
  --tint: #0E9F6E;          /* 品牌绿：平安、抵达 */
  --tint-soft: rgba(14, 159, 110, 0.12);
  --blue: #007AFF;
  --orange: #FF9500;
  --red: #FF3B30;
  --purple: #AF52DE;
  --indigo: #5856D6;
  --teal: #30B0C7;
  --pink: #FF2D55;
  --yellow: #FFCC00;
  --bubble-me: #D9FDD3;
  --bubble-them: #FFFFFF;
  --chat-bg: #EFEAE2;
  --bar: rgba(249, 249, 249, 0.78);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: calc(84px + var(--safe-bottom));
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --spring-pop: cubic-bezier(0.3, 1.32, 0.5, 1);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(0, 0, 0, 0.06);
  --ind: rgba(120, 120, 128, 0.14);
  --ind-press: rgba(120, 120, 128, 0.22);
  --knock: #FFFFFF;
  --glow: rgba(14, 159, 110, .18);
  --lens: rgba(255, 255, 255, 0.55);
  --lens-rim: rgba(255, 255, 255, 0.95);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #1C1C1E;
    --bg-secondary: #1C1C1E;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --label: #FFFFFF;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.6);
    --tint: #30D158;
    --tint-soft: rgba(48, 209, 88, 0.16);
    --blue: #0A84FF;
    --bubble-me: #005C4B;
    --bubble-them: #1F2C34;
    --chat-bg: #0B141A;
    --bar: rgba(22, 22, 24, 0.78);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --glass: rgba(36, 36, 38, 0.82);
    --glass-edge: rgba(255, 255, 255, 0.10);
    --ind: rgba(255, 255, 255, 0.12);
    --ind-press: rgba(255, 255, 255, 0.2);
    --knock: #2A2A2C;
    --glow: rgba(255, 255, 255, .14);
    --lens: rgba(255, 255, 255, 0.16);
    --lens-rim: rgba(255, 255, 255, 0.28);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.2px;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }

#app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}
@media (min-width: 520px) {
  body { background: #d9dde3; }
  #app { height: min(100dvh, 920px); top: 50%; transform: translateY(-50%); border-radius: 36px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
}

/* ---------------- Views ---------------- */
#views { position: absolute; inset: 0; }
.view {
  position: absolute; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + 24px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--from, 0px));
  transition: opacity .25s ease, transform .45s var(--spring);
}
.view.active { opacity: 1; pointer-events: auto; transform: none; }

/* Navigation bar（滚动后出现的紧凑标题） */
.navbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 17px;
  background: transparent;
  border-bottom: .5px solid transparent;
  transition: background .2s, border-color .2s;
}
.navbar .nav-title { opacity: 0; transition: opacity .2s; }
.navbar .nav-action {
  position: absolute; right: 16px; bottom: 8px;
  color: var(--tint); font-size: 17px;
  display: flex; align-items: center; gap: 4px;
}
.navbar .nav-action svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.view.scrolled .navbar {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--separator);
}
.view.scrolled .nav-title { opacity: 1; }

.large-title {
  font-size: 34px; font-weight: 700; letter-spacing: 0.3px;
  margin: 0; padding: 2px 16px 8px;
}
.subtitle { color: var(--label-2); font-size: 15px; padding: 0 16px 12px; margin-top: -4px; }

/* ---------------- Grouped list ---------------- */
.section-header {
  text-transform: none; font-size: 13px; color: var(--label-2);
  padding: 18px 32px 7px; letter-spacing: -0.1px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-header b { font-size: 20px; font-weight: 700; color: var(--label); letter-spacing: 0.2px; }
.section-header .count { font-size: 13px; }
.section-footer { font-size: 13px; color: var(--label-2); padding: 7px 32px 0; }

.group {
  margin: 0 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
}
.row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  width: 100%;
  text-align: left;
  transition: background .15s;
}
a.row { color: inherit; text-decoration: none; }
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0;
  left: var(--inset, 16px);
  border-top: .5px solid var(--separator);
}
.row.has-icon { --inset: 60px; }
.row-icon {
  flex: none; width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center; color: #fff;
}
.row-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; }
.row-sub { font-size: 14px; color: var(--label-2); margin-top: 2px; }
.row-detail { color: var(--label-2); font-size: 15px; flex: none; }
.chev { flex: none; width: 8px; height: 14px; stroke: var(--label-3); stroke-width: 2.2; fill: none; }

/* ---------------- Plan ---------------- */
.hero {
  margin: 4px 16px 0;
  padding: 18px;
  border-radius: 20px;
  background: var(--bg-secondary);
  display: flex; gap: 18px; align-items: center;
}
.ring { position: relative; width: 92px; height: 92px; flex: none; }
.ring svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--fill); }
.ring .bar { stroke: var(--tint); stroke-linecap: round; transition: stroke-dashoffset .8s var(--spring); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .ring-label b { font-size: 24px; font-weight: 700; display: block; line-height: 1; }
.ring .ring-label span { font-size: 11px; color: var(--label-2); }
.hero-text h3 { margin: 0 0 4px; font-size: 20px; }
.hero-text p { margin: 0; color: var(--label-2); font-size: 14px; }
.hero-next { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: var(--tint-soft); color: var(--tint); font-size: 13px; font-weight: 600; }

.segmented {
  margin: 16px 16px 0;
  display: flex; padding: 2px;
  background: var(--fill); border-radius: 9px;
  position: relative;
}
.segmented button {
  flex: 1; position: relative; z-index: 1;
  padding: 6px 0; font-size: 13px; font-weight: 500;
  border-radius: 7px;
  transition: color .2s;
}
.segmented .seg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px; pointer-events: none;
  transition: transform .5s var(--spring-pop), width .5s var(--spring-pop);
}
.segmented .seg-thumb i {
  position: absolute; inset: 0; border-radius: 7px; background: var(--bg-elevated);
  box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04);
  transition: transform .42s var(--spring-pop), background .3s, box-shadow .3s, border-radius .3s;
}
.segmented { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.segmented.lift .seg-thumb i, .segmented.dragging .seg-thumb i {
  transform: scale(var(--sx, 1.1), var(--sy, 1.45)); border-radius: 12px;
  background: var(--lens);
  box-shadow: 0 8px 22px rgba(0,0,0,.14), inset 0 0 0 1px var(--lens-rim), inset 0 1.5px 1px rgba(255,255,255,.9),
    inset 3px 0 4px rgba(255,70,160,.16), inset -3px 0 4px rgba(40,160,255,.18);
}
.segmented.lift .seg-thumb i.moving { animation: seg-move .5s var(--spring); }
@keyframes seg-move { 0% { transform: scale(1.1, 1.45); } 40% { transform: scale(1.35, 1.3); } 100% { transform: scale(1.1, 1.45); } }
.segmented.dragging .seg-thumb { transition: none; }
.segmented button { transition: color .2s, transform .4s var(--spring-pop); }
.segmented button.hot { transform: scale(1.12); }
@media (prefers-color-scheme: dark) { .segmented .seg-thumb i { background: #636366; } }

.task { align-items: flex-start; }
.check {
  flex: none; width: 24px; height: 24px; margin-top: 1px;
  border-radius: 50%; border: 1.6px solid var(--label-3);
  display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .2s var(--spring);
}
.check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.4); transition: all .25s var(--spring); }
.task.done .check { background: var(--tint); border-color: var(--tint); }
.task.done .check svg { opacity: 1; transform: none; }
.task.done .row-title { color: var(--label-2); text-decoration: line-through; text-decoration-color: var(--label-3); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--fill); color: var(--label-2); }
.tag.red { background: rgba(255,59,48,.12); color: var(--red); }
.tag.orange { background: rgba(255,149,0,.14); color: #C76E00; }
.tag.green { background: var(--tint-soft); color: var(--tint); }
@media (prefers-color-scheme: dark) { .tag.orange { color: var(--orange); } }

/* ---------------- Tools ---------------- */
.feature {
  margin: 4px 16px 0; padding: 18px; border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #10B981 0%, #0E9F6E 55%, #0B7A57 100%);
  display: flex; gap: 14px; align-items: center;
  width: calc(100% - 32px); text-align: left;
  transition: transform .2s var(--spring);
}
.feature .f-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.feature .f-icon svg { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 0 0 3px; font-size: 18px; }
.feature p { margin: 0; font-size: 14px; opacity: .9; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 16px; }
.tile {
  background: var(--bg-secondary); border-radius: 16px; padding: 14px;
  text-align: left; min-height: 112px;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .2s var(--spring);
}
.tile .row-icon { width: 36px; height: 36px; border-radius: 10px; }
.tile .row-icon svg { width: 20px; height: 20px; }
.tile b { font-size: 16px; display: block; margin-top: 10px; }
.tile span { font-size: 13px; color: var(--label-2); }
.tile b { color: var(--label); }

/* ---------------- Translate (WhatsApp 式对话) ---------------- */
.view[data-view="translate"] { padding-bottom: 0; background: var(--chat-bg); display: flex; flex-direction: column; overflow: hidden; }
.chat-head {
  flex: none; z-index: 5;
  padding: calc(8px + var(--safe-top)) 16px 10px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--separator);
  display: flex; align-items: center; gap: 10px;
}
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--tint); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.chat-head .who b { display: block; font-size: 16px; }
.chat-head .who span { font-size: 12px; color: var(--label-2); }
.lang-switch {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 99px; background: var(--fill);
  font-size: 13px; font-weight: 600;
}
.lang-switch svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; transition: transform .35s var(--spring); }
.lang-switch.flipped svg { transform: rotate(180deg); }

.chat {
  flex: 1; overflow-y: auto; padding: 12px 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px);
  background-size: 18px 18px;
}
@media (prefers-color-scheme: dark) { .chat { background-image: radial-gradient(rgba(255,255,255,.04) 1px, transparent 1px); } }
.day-chip { align-self: center; font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--bg-elevated); color: var(--label-2); margin: 6px 0; box-shadow: 0 1px .5px rgba(0,0,0,.08); }
.bubble {
  max-width: 82%; padding: 6px 9px 6px 10px;
  border-radius: 10px; font-size: 16px;
  box-shadow: 0 1px .5px rgba(0,0,0,.13);
  position: relative;
  animation: pop .32s var(--spring);
  word-break: break-word;
}
.bubble.me { align-self: flex-end; background: var(--bubble-me); border-top-right-radius: 3px; }
.bubble.them { align-self: flex-start; background: var(--bubble-them); border-top-left-radius: 3px; }
.bubble .orig { color: var(--label-2); font-size: 13px; margin-bottom: 3px; }
.bubble .tr { font-size: 17px; }
.bubble .roma { color: var(--label-2); font-size: 12px; margin-top: 2px; font-style: italic; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 3px; font-size: 11px; color: var(--label-2); }
.bubble .meta button { color: var(--tint); font-weight: 600; font-size: 12px; }
.bubble.note { align-self: center; max-width: 90%; background: rgba(255, 214, 102, .35); color: var(--label); font-size: 13px; text-align: center; box-shadow: none; }
@media (prefers-color-scheme: dark) { .bubble.note { background: rgba(255, 214, 102, .14); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

.chips { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 8px 10px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 12px; border-radius: 99px;
  background: var(--bg-elevated); font-size: 14px;
  box-shadow: 0 1px .5px rgba(0,0,0,.1);
  transition: transform .15s var(--spring), background .15s;
}
.chip.on { background: var(--tint); color: #fff; }

.composer {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 6px 8px calc(var(--tabbar-h) + 4px);
}
.composer .field {
  flex: 1; display: flex; align-items: flex-end;
  background: var(--bg-elevated); border-radius: 22px;
  padding: 4px 6px 4px 14px; min-height: 44px;
  box-shadow: 0 1px .5px rgba(0,0,0,.1);
}
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; max-height: 120px; padding: 9px 0; font-size: 17px; line-height: 1.3; }
.composer .cam { width: 34px; height: 34px; display: grid; place-items: center; color: var(--label-2); }
.composer .cam svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.send {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: var(--tint); color: #fff; display: grid; place-items: center;
  transition: transform .2s var(--spring);
}
.send svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------------- Records ---------------- */
.search {
  margin: 0 16px 6px; display: flex; align-items: center; gap: 6px;
  background: var(--fill); border-radius: 10px; padding: 0 8px; height: 36px; color: var(--label-2);
}
.search svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--label); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { box-shadow: none; background: var(--bg-secondary); }
.filters .chip.on { background: var(--tint); color: #fff; }
.thumb {
  flex: none; width: 52px; height: 52px; border-radius: 10px;
  background: var(--fill) center/cover no-repeat;
  display: grid; place-items: center; color: var(--label-2);
}
.thumb svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.row.has-thumb { --inset: 80px; }
.empty { text-align: center; color: var(--label-2); padding: 40px 32px; font-size: 15px; }

.swipe-wrap { position: relative; overflow: hidden; }
.swipe-wrap .swipe-del {
  position: absolute; right: 0; top: 0; bottom: 0; width: 84px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 500;
  display: grid; place-items: center;
}
.swipe-wrap > .row { background: var(--bg-secondary); transition: transform .3s var(--spring); }
.swipe-wrap + .swipe-wrap > .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset, 16px); border-top: .5px solid var(--separator); }

/* ---------------- Status ---------------- */
.checkin {
  margin: 4px 16px 0; padding: 20px; border-radius: 20px;
  background: var(--bg-secondary); text-align: center;
}
.checkin-btn {
  width: 132px; height: 132px; border-radius: 50%;
  margin: 6px auto 12px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #3EDC8E, #0E9F6E);
  color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(14,159,110,.35);
  position: relative;
  transition: transform .25s var(--spring);
}
.checkin-btn::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(14,159,110,.35);
  animation: pulse 2.4s ease-out infinite;
}
.checkin-btn.done { background: radial-gradient(circle at 30% 30%, #8E8E93, #636366); box-shadow: none; }
.checkin-btn.done::after { display: none; }
@keyframes pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.18); opacity: 0; } }
.checkin p { margin: 0; color: var(--label-2); font-size: 14px; }

.report {
  margin: 0 16px; border-radius: 16px; overflow: hidden;
  background: var(--bg-secondary);
}
.report-head { padding: 14px 16px 10px; display: flex; justify-content: space-between; align-items: center; }
.report-head b { font-size: 17px; }
.report-head span { font-size: 13px; color: var(--label-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: .5px solid var(--separator); }
.stat { padding: 12px 8px; text-align: center; }
.stat + .stat { border-left: .5px solid var(--separator); }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--label-2); }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--fill-strong); transition: background .25s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform .3s var(--spring); }
.switch input:checked + .track { background: #34C759; }
.switch input:checked ~ .knob { transform: translateX(20px); }

/* ---------------- Tab bar（悬浮胶囊 + 可滑动选择） ---------------- */
.tabbar {
  position: absolute; z-index: 40;
  left: 14px; right: 14px; bottom: calc(var(--safe-bottom) + 10px);
  height: 64px; padding: 6px;
  display: flex;
  border-radius: 32px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .05), inset 0 0 0 .5px var(--glass-edge);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .45s var(--spring), opacity .3s;
}
.tab-ind {
  position: absolute; top: 6px; bottom: 6px; left: 0; width: 0;
  pointer-events: none; will-change: transform, width;
  transition: transform .55s var(--spring-pop), width .55s var(--spring-pop);
}
.tab-ind i {
  position: absolute; inset: 0; border-radius: 26px;
  background: var(--ind);
  transform: scale(1);
  transition: transform .42s var(--spring-pop), background .3s ease, box-shadow .3s ease;
}
/* 液态玻璃「镜片」：按下、拖动、切换途中浮起 */
.tabbar.lift .tab-ind i,
.tabbar.pressing .tab-ind i,
.tabbar.dragging .tab-ind i {
  transform: scale(var(--sx, 1.2), var(--sy, 1.32));
  background: var(--lens);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .14),
    0 2px 6px rgba(0, 0, 0, .06),
    inset 0 0 0 1px var(--lens-rim),
    inset 0 1.5px 1px rgba(255, 255, 255, .9),
    inset 3px 0 4px rgba(255, 70, 160, .16),
    inset -3px 0 4px rgba(40, 160, 255, .18),
    inset 0 -2px 4px rgba(0, 0, 0, .05);
}
.tabbar.pressing:not(.dragging):not(.lift) .tab-ind i { --sx: 1.08; --sy: 1.18; }
.tabbar.lift .tab-ind i.moving { animation: lens-move .5s var(--spring); }
@keyframes lens-move {
  0%   { transform: scale(1.2, 1.32); }
  40%  { transform: scale(1.48, 1.2); }
  100% { transform: scale(1.2, 1.32); }
}
.tabbar.dragging .tab-ind { transition: width .3s var(--spring); }
.tabbar.dragging .tab-ind i { transition: transform .12s linear, background .3s, box-shadow .3s; }

.tab {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--label); font-size: 11px; font-weight: 600; letter-spacing: 0;
  touch-action: none;
}
.tab .ic { position: relative; width: 27px; height: 27px; transition: transform .35s var(--spring); }
.tab .ic svg { position: absolute; inset: 0; width: 27px; height: 27px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s, transform .35s var(--spring); }
.tab .ic-fill { opacity: 0; transform: scale(.7); }
.tab .ic-fill .solid { fill: currentColor; stroke: none; }
.tab .ic-fill .knock { stroke: var(--knock); stroke-width: 1.9; }
.tab .ic-fill.bold { stroke-width: 2.4; }
.tab.active .ic-line { opacity: 0; transform: scale(1.2); }
.tab.active .ic-fill { opacity: 1; transform: none; }
.tab .lbl { transition: transform .35s var(--spring); }
.tab.hot .ic { transform: scale(1.22) translateY(-1px); }
.tab.hot .lbl { transform: scale(1.1) translateY(1px); }
.tab.pop .ic { animation: pop-ic .45s var(--spring); }
@keyframes pop-ic { 0% { transform: scale(1); } 40% { transform: scale(.82); } 100% { transform: scale(1); } }

/* ---------------- Sheet ---------------- */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(0,0,0,.4); opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 92%;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  transform: translateY(105%);
  transition: transform .45s var(--spring);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.sheet.show { transform: none; }
.sheet.dragging { transition: none; }
.sheet-grabber { flex: none; width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 6px auto 0; }
.sheet-body { overflow-y: auto; padding: 0 0 calc(24px + var(--safe-bottom)); }
.sheet-nav { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; }
.sheet-nav b { font-size: 17px; }
.sheet-nav button { color: var(--tint); font-size: 17px; min-width: 50px; }
.sheet-nav button.strong { font-weight: 600; text-align: right; }
.sheet-hero { text-align: center; padding: 8px 24px 16px; }
.sheet-hero .row-icon { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 10px; }
.sheet-hero .row-icon svg { width: 32px; height: 32px; }
.sheet-hero h2 { margin: 0 0 4px; font-size: 22px; }
.sheet-hero p { margin: 0; color: var(--label-2); font-size: 15px; }
.prose { margin: 0 16px; padding: 14px 16px; background: var(--bg-secondary); border-radius: var(--radius); font-size: 15px; color: var(--label); }
.prose p { margin: 0 0 8px; } .prose p:last-child { margin: 0; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; margin: 16px 16px 0; border-radius: 14px;
  background: var(--tint); color: #fff; font-size: 17px; font-weight: 600;
  width: calc(100% - 32px);
  transition: transform .15s var(--spring), opacity .15s;
}
.btn.secondary { background: var(--tint-soft); color: var(--tint); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.form-row { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 44px; position: relative; }
.form-row + .form-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--separator); }
.form-row label { flex: none; width: 88px; }
.form-row input, .form-row select { flex: 1; border: 0; outline: 0; background: transparent; padding: 11px 0; font-size: 17px; text-align: right; }
.form-row input[type="number"] { -moz-appearance: textfield; }

.meter { margin: 14px 16px 0; padding: 16px; border-radius: var(--radius); background: var(--bg-secondary); }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; }
.meter-top b { font-size: 28px; }
.meter-top span { color: var(--label-2); font-size: 14px; }
.meter-bar { height: 10px; border-radius: 99px; background: var(--fill); margin-top: 10px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: 99px; background: var(--tint); transition: width .5s var(--spring), background .3s; }
.meter p { margin: 10px 0 0; font-size: 14px; color: var(--label-2); }

.big-phrase { margin: 0 16px; padding: 28px 20px; border-radius: 20px; background: var(--bg-secondary); text-align: center; }
.big-phrase .jp { font-size: 30px; font-weight: 700; line-height: 1.35; }
.big-phrase .roma { margin-top: 10px; color: var(--label-2); font-style: italic; }
.big-phrase .zh { margin-top: 14px; padding-top: 14px; border-top: .5px solid var(--separator); color: var(--label-2); }

.scan-result .kv { display: flex; justify-content: space-between; gap: 12px; }
.scan-result .kv span:first-child { color: var(--label-2); }
.scan-preview { margin: 0 16px 12px; border-radius: 14px; max-height: 220px; width: calc(100% - 32px); object-fit: cover; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill); border-top-color: var(--tint); animation: spin .8s linear infinite; margin: 30px auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Toast ---------------- */
.toast {
  position: absolute; left: 50%; top: calc(14px + var(--safe-top)); z-index: 80;
  transform: translate(-50%, -150%);
  padding: 10px 16px; border-radius: 99px;
  background: var(--bg-elevated); color: var(--label);
  font-size: 15px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px;
  transition: transform .45s var(--spring);
}
.toast.show { transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; stroke: var(--tint); fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }


/* ============================================================
   全局按压反馈：按下弹性收缩 + 指尖光晕，松手带回弹
   ============================================================ */
.btn, .tile, .feature, .chip, .send, .checkin-btn, .lang-switch, .hero-next, .cam, .nav-action, .sheet-nav button, .check, .search {
  transition: transform .55s var(--spring-pop), background .25s ease, color .25s ease, box-shadow .3s ease, opacity .2s;
  will-change: transform;
}
.btn, .tile, .feature, .chip, .hero-next, .lang-switch { position: relative; overflow: hidden; isolation: isolate; }
.btn::before, .tile::before, .feature::before, .chip::before, .hero-next::before, .lang-switch::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: var(--px, 50%); top: var(--py, 50%); width: 220px; height: 220px; margin: -110px 0 0 -110px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  opacity: 0; transform: scale(.3);
  transition: opacity .45s ease, transform .6s var(--spring);
}
.feature::before, .btn:not(.secondary)::before { --glow: rgba(255,255,255,.38); }
.pressed::before { opacity: 1; transform: scale(1); transition: opacity .12s ease, transform .35s var(--spring); }

.pressed { transform: scale(.955); transition: transform .22s var(--spring), background .15s, color .2s, box-shadow .2s; }
.tile.pressed, .feature.pressed { transform: scale(.965); }
.chip.pressed, .hero-next.pressed, .lang-switch.pressed { transform: scale(.92); }
.send.pressed, .cam.pressed, .nav-action.pressed { transform: scale(.85); }
.checkin-btn.pressed { transform: scale(.9); }
.check.pressed { transform: scale(.8); }
.sheet-nav button.pressed { transform: scale(.9); opacity: .55; }
.search.pressed { transform: none; }
.released { animation: release .6s var(--spring-pop); }
@keyframes release { 0% { transform: scale(.955); } 55% { transform: scale(1.025); } 100% { transform: scale(1); } }
.checkin-btn.released { animation: release-big .75s var(--spring-pop); }
@keyframes release-big { 0% { transform: scale(.9); } 45% { transform: scale(1.07); } 75% { transform: scale(.98); } 100% { transform: scale(1); } }

/* 列表行：高亮淡入淡出，不缩放 */
.row { transition: background .35s ease; }
.row.pressed { background: var(--fill); transform: none; transition: background .08s; }
.row.released { animation: none; }

/* 开关：按住时滑块拉长、变成玻璃 */
.switch .knob { transition: transform .45s var(--spring-pop), width .35s var(--spring-pop), box-shadow .3s; }
.switch.pressed { transform: none; }
.switch.pressed .knob { width: 35px; box-shadow: 0 4px 14px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.9); }
.switch.pressed input:checked ~ .knob { transform: translateX(12px); }
.switch.released { animation: none; }

/* 勾选完成：一圈扩散 */
.check { position: relative; }
.check::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--tint); opacity: 0; pointer-events: none; }
.check.burst::after { animation: burst .6s ease-out; }
@keyframes burst { 0% { opacity: .8; transform: scale(.8); } 100% { opacity: 0; transform: scale(2.1); } }

/* 选中的筛选标签：弹一下 */
.chip.on { animation: chip-on .5s var(--spring-pop); }
@keyframes chip-on { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* 列表进场：逐行错开 */
.enter > .row, .enter > .swipe-wrap { animation: row-in .5s var(--spring) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 打开弹层时，后面的页面像 iOS 一样缩小退后 */
#views, .tabbar { transition: transform .55s var(--spring), border-radius .55s var(--spring), filter .4s; }
#app.sheet-open #views { transform: scale(.935) translateY(10px); border-radius: 18px; overflow: hidden; filter: brightness(.96); }
#app.sheet-open .tabbar { transform: translateY(14px) scale(.96); }
.sheet { transition: transform .6s cubic-bezier(.32, 1.12, .5, 1); }
.sheet-body > * { transition: opacity .3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   黑白主题：统一单色（覆盖上面的彩色设置）
   ============================================================ */
:root {
  --tint: #000000; --tint-soft: rgba(0, 0, 0, .06); --on-tint: #FFFFFF;
  --blue: #000000; --orange: #000000; --red: #000000; --purple: #000000;
  --indigo: #000000; --teal: #000000; --pink: #000000; --yellow: #000000;
  --bubble-me: #000000; --bubble-them: #FFFFFF; --chat-bg: #F2F2F7;
  --glow: rgba(0, 0, 0, .08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --tint: #FFFFFF; --tint-soft: rgba(255, 255, 255, .1); --on-tint: #000000;
    --blue: #FFFFFF; --orange: #FFFFFF; --red: #FFFFFF; --purple: #FFFFFF;
    --indigo: #FFFFFF; --teal: #FFFFFF; --pink: #FFFFFF; --yellow: #FFFFFF;
    --bubble-me: #FFFFFF; --bubble-them: #1C1C1E; --chat-bg: #000000;
    --glow: rgba(255, 255, 255, .12);
  }
}

/* 图标：浅灰底 + 黑色线条 */
.row-icon { background: var(--fill) !important; color: var(--label) !important; }
.sheet-hero .row-icon { background: var(--tint) !important; color: var(--on-tint) !important; }

/* 按钮与选中态 */
.btn { color: var(--on-tint); }
.btn.secondary { background: var(--fill) !important; color: var(--label) !important; }
.send, .avatar, .chip.on, .filters .chip.on { color: var(--on-tint); }
.check svg { stroke: var(--on-tint); }
.switch input:checked + .track { background: var(--tint); }
@media (prefers-color-scheme: dark) {
  .switch input:checked ~ .knob { background: #000; }
}

/* 主卡片 */
.feature { background: linear-gradient(135deg, #3A3A3C 0%, #1C1C1E 50%, #000 100%); color: #fff; }
.feature::before { --glow: rgba(255, 255, 255, .22); }
@media (prefers-color-scheme: dark) {
  .feature { background: linear-gradient(135deg, #3A3A3C 0%, #2C2C2E 60%, #1C1C1E 100%); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12); }
}

/* 报平安 */
.checkin-btn { background: radial-gradient(circle at 30% 30%, #48484A, #000); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.checkin-btn::after { border-color: rgba(0, 0, 0, .25); }
.checkin-btn.done { background: radial-gradient(circle at 30% 30%, #D1D1D6, #AEAEB2); color: #fff; }
@media (prefers-color-scheme: dark) {
  .checkin-btn { background: radial-gradient(circle at 30% 30%, #FFFFFF, #C7C7CC); color: #000; box-shadow: 0 10px 30px rgba(255, 255, 255, .12); }
  .checkin-btn::after { border-color: rgba(255, 255, 255, .3); }
  .checkin-btn.done { background: radial-gradient(circle at 30% 30%, #48484A, #2C2C2E); color: #fff; }
}

/* 标签：用深浅和描边区分紧急程度 */
.tag.red { background: var(--label); color: var(--bg); }
.tag.orange { background: transparent; color: var(--label); box-shadow: inset 0 0 0 1px var(--label); }
.tag.green { background: var(--fill); color: var(--label-2); }

/* 对话 */
.bubble.me { color: var(--on-tint); }
.bubble.me .meta, .bubble.me .meta span { color: inherit !important; opacity: .6; }
.bubble.them .meta button { color: var(--label); }
.bubble.note { background: var(--fill); }

/* 其他 */
.swipe-wrap .swipe-del { background: #3A3A3C; }
.hero-next { color: var(--label); }

/* 玻璃镜片：去掉彩色折射，改成中性的高光 */
.tabbar.lift .tab-ind i, .tabbar.pressing .tab-ind i, .tabbar.dragging .tab-ind i,
.segmented.lift .seg-thumb i, .segmented.dragging .seg-thumb i {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, .14),
    0 2px 6px rgba(0, 0, 0, .06),
    inset 0 0 0 1px var(--lens-rim),
    inset 0 1.5px 1px rgba(255, 255, 255, .9),
    inset 0 -2px 4px rgba(0, 0, 0, .06);
}

/* 防止外层容器被浏览器自动滚动（例如聚焦输入框时） */
#app { overflow: clip; }
.sheet { visibility: hidden; transition: transform .6s cubic-bezier(.32, 1.12, .5, 1), visibility 0s linear .6s; }
.sheet.show { visibility: visible; transition: transform .6s cubic-bezier(.32, 1.12, .5, 1), visibility 0s; }
.sheet.dragging { transition: none; }

/* 翻译页：极简头部，只保留语言切换 */
.chat-head { justify-content: center; padding-top: calc(10px + var(--safe-top)); padding-bottom: 10px; }
.chat-head .lang-switch { margin: 0; padding: 8px 16px; font-size: 15px; }
.chat { padding-top: 16px; }

/* 点缀色：报平安和开关用绿色，其余保持黑白 */
:root { --green: #34C759; }
@media (prefers-color-scheme: dark) { :root { --green: #30D158; } }
.switch input:checked + .track { background: var(--green); }
.switch input:checked ~ .knob { background: #fff; }
.checkin-btn { background: radial-gradient(circle at 30% 30%, #5EE08A, #1FA34A); color: #fff; box-shadow: 0 10px 30px rgba(52, 199, 89, .35); }
.checkin-btn::after { border-color: rgba(52, 199, 89, .4); }
.checkin-btn.done { background: radial-gradient(circle at 30% 30%, #D1D1D6, #AEAEB2); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  .checkin-btn { background: radial-gradient(circle at 30% 30%, #5EE08A, #1FA34A); color: #fff; box-shadow: 0 10px 30px rgba(48, 209, 88, .25); }
  .checkin-btn::after { border-color: rgba(48, 209, 88, .4); }
  .checkin-btn.done { background: radial-gradient(circle at 30% 30%, #48484A, #2C2C2E); }
}
.checkin-btn::before { --glow: rgba(255, 255, 255, .3); }

/* ============================================================
   手感系统（由 JS 弹簧驱动：--s 缩放，--mx/--my 磁吸偏移）
   ============================================================ */
.btn, .tile, .feature, .chip, .send, .checkin-btn, .lang-switch, .hero-next, .cam, .nav-action, .sheet-nav button, .check {
  transform: translate(var(--mx, 0px), var(--my, 0px)) scale(var(--s, 1)) !important;
  animation: none !important;
  transition-property: background, color, box-shadow, opacity, border-color !important;
  transition-duration: .28s !important;
}
/* 旧的指尖光晕换成跟手波纹 */
.btn::before, .tile::before, .feature::before, .chip::before, .hero-next::before, .lang-switch::before { display: none; }
.send, .row { overflow: hidden; }
.row { position: relative; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: currentColor; opacity: var(--rip, .28);
  transform: scale(0);
}
.row > *:not(.ripple), .btn > *:not(.ripple), .tile > *:not(.ripple), .feature > *:not(.ripple) { position: relative; z-index: 1; }
/* 按下时阴影减弱 */
.checkin-btn.pressed { box-shadow: 0 4px 12px rgba(52, 199, 89, .22); }
.tile.pressed, .feature.pressed, .chip.pressed, .btn.pressed { box-shadow: none; }

/* 弹性开关：滑块位置和横向拉伸由 JS 控制，底色 280ms 渐变 */
.switch .track { transition: background .28s ease !important; }
.switch .knob { width: 27px !important; transform: translateX(var(--kx, 0px)) scaleX(var(--ksx, 1)) !important; transition: box-shadow .3s !important; }
.switch input:checked ~ .knob { --kx: 20px; }
.switch.pressed .knob { box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* 报平安：散开的小圆点 + 数字滚动 */
.checkin { position: relative; }
.burst-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--green); pointer-events: none; z-index: 2; }
.roll { display: inline-grid !important; overflow: hidden; vertical-align: bottom; }
.roll > span { grid-area: 1 / 1; display: block; font: inherit; color: inherit; }

/* 复选框：对勾 300ms 描边画出 */
.check svg { opacity: 1 !important; transform: none !important; }
.check svg path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .3s cubic-bezier(.4,0,.2,1) .06s; }
.task.done .check svg path { stroke-dashoffset: 0; }
.task .row-title { transition: color .3s ease, text-decoration-color .3s ease; text-decoration: line-through; text-decoration-color: transparent; }
.task.done .row-title { text-decoration-color: var(--label-3); }

/* 键盘弹出时：页面固定不滚动，只移动输入框 */
html, body { position: fixed; inset: 0; width: 100%; overflow: hidden; }
.view[data-view="translate"] .composer { position: relative; z-index: 1; transition: transform .38s cubic-bezier(.32,.72,0,1); will-change: transform; }
.view[data-view="translate"] .chat { transition: padding-bottom .25s cubic-bezier(.2,.8,.2,1); }
body.kb-open .tabbar { opacity: 0; pointer-events: none; }

.stat b.roll { display: grid !important; justify-content: center; }
.burst-dot { width: 11px; height: 11px; }

/* ============================================================
   规划页：苹果日历式月历
   ============================================================ */
.view[data-view="plan"] .navbar + .cal { margin-top: 0; }
.cal { margin: 4px 16px 0; padding: 12px 8px 8px; background: var(--bg-secondary); border-radius: 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; }
.cal-title { font-size: 26px; font-weight: 700; letter-spacing: .2px; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-btn { height: 32px; min-width: 32px; padding: 0 10px; border-radius: 99px; background: var(--fill); display: grid; place-items: center; font-size: 14px; font-weight: 600; transition: transform .4s var(--spring-pop), background .2s; }
.cal-btn.pressed { transform: scale(.88); }
.cal-arrow { padding: 0; }
.cal-arrow svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; font-weight: 600; color: var(--label-2); padding-bottom: 4px; }
.cal-viewport { position: relative; overflow: hidden; transition: height .38s cubic-bezier(.32,.72,0,1); touch-action: pan-y; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cal-cell { height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3px; gap: 3px; }
.cal-num {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; font-variant-numeric: tabular-nums;
  transition: background .25s ease, color .25s ease, transform .45s var(--spring-pop);
}
.cal-cell.wkend .cal-num, .cal-week .wkend { color: var(--label-2); }
.cal-cell.today .cal-num { font-weight: 700; color: var(--label); background: var(--fill); }
.cal-cell.sel .cal-num { background: var(--label); color: var(--bg-secondary); font-weight: 700; transform: scale(1.04); }
.cal-cell.pressed .cal-num { transform: scale(.86); }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--label); }
.cal-dot.done { background: var(--label-3); }
.sheet .cal { margin: 4px 16px 0; }

.add-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; transform: scale(var(--s, 1)); }
.add-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.section-header .add-btn { margin-left: auto; }
.empty-day { margin: 0 16px; padding: 22px 16px; border-radius: var(--radius); background: var(--bg-secondary); color: var(--label-2); font-size: 15px; text-align: center; }
.sub-header { font-size: 13px; color: var(--label-2); padding: 14px 32px 6px; }
.pill {
  flex: none; height: 30px; padding: 0 14px; border-radius: 99px;
  background: var(--fill); font-size: 14px; font-weight: 600;
  transform: scale(var(--s, 1)); transition: background .2s;
}

/* 工具页：所有工具同样大小、同样颜色 */
.grid .tile { min-height: 120px; }
/* 输入框只在键盘弹起时盖在导航栏上方，平时不能挡住导航栏 */
body.kb-open .view[data-view="translate"] .composer { z-index: 45; }

/* ---------------- 待安排：可折叠的二级菜单 ---------------- */
.fold-head {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  color: var(--label); -webkit-tap-highlight-color: transparent;
}
.fold-head .count { margin-left: auto; font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.fold-chev { width: 8px; height: 14px; flex: none; fill: none; stroke: var(--label-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.fold.open > .fold-head .fold-chev { transform: rotate(90deg); }
.fold-head.lvl1 { padding: 22px 32px 8px; }
.fold-head.lvl1 b { font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.fold-head.lvl1 .fold-chev { stroke: var(--label-2); }
.fold-head.lvl2 {
  margin: 8px 16px 0; width: calc(100% - 32px); min-height: 50px; padding: 0 16px;
  background: var(--bg-secondary); border-radius: var(--radius);
  font-size: 17px; transition: border-radius .35s ease, background .2s;
}
.fold.lvl2.open > .fold-head { border-radius: var(--radius) var(--radius) var(--radius) var(--radius); }
.fold-head.pressed { background: var(--fill); }
.fold-head.lvl1.pressed { background: transparent; opacity: .6; }
.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s cubic-bezier(.32,.72,0,1); }
.fold.open > .fold-body { grid-template-rows: 1fr; }
.fold-inner { min-height: 0; overflow: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity .3s ease, transform .5s cubic-bezier(.32,.72,0,1); }
.fold.open > .fold-body > .fold-inner { opacity: 1; transform: none; transition-delay: .05s; }
.fold.lvl2 .fold-inner > .group:first-child, .fold.lvl2 .fold-inner > .sub-header:first-child { margin-top: 8px; }
.fold.lvl2 .fold-inner { padding-bottom: 2px; }
.add-row { width: 100%; gap: 10px; color: var(--label); font-size: 17px; }
.add-row svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* 日历小圆点：像苹果日历一样，有安排的日子下面一个灰点 */
.cal-dot { width: 6px; height: 6px; background: var(--label-2); }
.cal-dot.done { background: var(--label-3); opacity: .6; }

/* ---------------- 时间：24 小时制滚轮 ---------------- */
.time-val { font-size: 17px; color: var(--label-2); font-variant-numeric: tabular-nums; margin-right: 10px; }
.wheel {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 4px;
  margin: 8px 16px 0; height: 180px; border-radius: var(--radius); background: var(--bg-secondary); overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel-band { position: absolute; left: 12px; right: 12px; top: 72px; height: 36px; border-radius: 10px; background: var(--fill); pointer-events: none; }
.wheel-col {
  position: relative; width: 72px; height: 180px; overflow-y: auto; scroll-snap-type: y mandatory;
  padding: 72px 0; box-sizing: border-box; scrollbar-width: none; overscroll-behavior: contain;
}
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-col > div {
  height: 36px; line-height: 36px; text-align: center; scroll-snap-align: center;
  font-size: 22px; font-variant-numeric: tabular-nums; color: var(--label-3);
  transition: color .15s, transform .2s;
}
.wheel-col > div.on { color: var(--label); font-weight: 600; transform: scale(1.08); }
.wheel-colon { position: relative; font-size: 22px; font-weight: 600; }

/* 当天列表里的时间，像苹果日历 */
.row-time { flex: none; font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* 键盘弹起：导航栏原地淡出（不移动），输入框和键盘同步升起 */
.tabbar { transition: transform .55s var(--spring), border-radius .55s var(--spring), filter .4s, opacity .22s ease; }
body.kb-open .tabbar { opacity: 0 !important; pointer-events: none; transition: opacity .12s ease; }
#chat { transition: padding-bottom .38s cubic-bezier(.32,.72,0,1); }

/* 输入框升降：放慢、先慢后快再慢（变速），升起和落下各自一条曲线 */
.view[data-view="translate"] .composer { transition: transform .52s cubic-bezier(.55, 0, .15, 1) !important; }
body.kb-open .view[data-view="translate"] .composer { transition: transform .6s cubic-bezier(.4, 0, .08, 1) !important; }
#chat { transition: padding-bottom .52s cubic-bezier(.55, 0, .15, 1); }
body.kb-open #chat { transition: padding-bottom .6s cubic-bezier(.4, 0, .08, 1); }
.tabbar { transition: transform .55s var(--spring), border-radius .55s var(--spring), filter .4s, opacity .35s ease .12s; }
body.kb-open .tabbar { transition: opacity .2s ease; }

/* 工具卡片按压反馈：卡片下沉变灰，图标被压扁并歪一下，松手弹回 */
.tile { transition-property: background, color, box-shadow, opacity, border-color !important; transition-duration: .25s !important; }
.tile.pressed { background: var(--fill) !important; }
.tile.chosen { background: var(--bg-secondary); }
.tile .row-icon { transform: scale(var(--is, 1)) rotate(calc(var(--ir, 0) * 1deg)); will-change: transform; transition: background .25s, color .25s; }
.tile.pressed .row-icon { background: var(--label) !important; color: var(--bg-secondary) !important; }
.tile.pressed .row-icon svg { stroke: currentColor; }
.fold-head.lvl2 { transform: scale(var(--s, 1)); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fold-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* 分类重命名：编辑模式下名称直接变成输入框 */
.fold-head-wrap { display: flex; align-items: center; }
.fold-head-wrap .fold-head.lvl1 { flex: 1; min-width: 0; padding-right: 10px; }
.edit-link {
  flex: none; margin: 14px 24px 0 0; height: 32px; padding: 0 12px; border-radius: 99px;
  font-size: 15px; font-weight: 600; color: var(--label); background: var(--fill);
  transition: opacity .25s ease, transform .4s var(--spring-pop), background .2s;
}
.edit-link.pressed { transform: scale(.9); }
.fold.lvl1:not(.open) > .fold-head-wrap .edit-link { opacity: 0; pointer-events: none; transform: scale(.8); }
.fold-head.lvl2.editing { cursor: text; animation: foldEditIn .35s cubic-bezier(.32,.72,0,1); }
@keyframes foldEditIn { from { transform: scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
.fold-input {
  flex: 1; min-width: 0; height: 36px; border: 0; outline: 0; border-radius: 10px;
  padding: 0 10px; margin-left: -10px; font: inherit; font-size: 17px; color: var(--label);
  background: var(--fill); -webkit-appearance: none; appearance: none;
}
.fold-input:focus { box-shadow: 0 0 0 2px var(--label) inset; background: transparent; }
.fold.open > .fold-head-wrap .fold-chev { transform: rotate(90deg); }

/* ---------------- 分类左滑：重命名 / 删除 ---------------- */
.swipe-box { position: relative; margin: 8px 16px 0; border-radius: var(--radius); overflow: hidden; --p: 0; isolation: isolate; }
.swipe-box > .fold-head.lvl2 {
  position: relative; z-index: 1; margin: 0; width: 100%;
  touch-action: pan-y; will-change: transform;
}
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; width: 168px; display: flex; z-index: 0; }
.sa {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 600; color: #fff;
  opacity: min(1, calc(var(--p) * 1.6));
  transition: opacity .2s;
}
.sa svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transform: scale(calc(.5 + .5 * min(1, var(--p)))); }
.sa-rename { background: #8E8E93; }
.sa-del { background: #1C1C1E; }
@media (prefers-color-scheme: dark) { .sa-rename { background: #48484A; } .sa-del { background: #F2F2F7; color: #000; } }
.sa.pressed { filter: brightness(.85); }
.swipe-box .fold-head.lvl2.editing { margin: 0; width: 100%; }

.restore-link { display: block; margin: 12px 32px 0; padding: 6px 0; font-size: 14px; font-weight: 600; color: var(--label); text-decoration: underline; text-underline-offset: 3px; }

/* 删除确认（苹果式操作表） */
.action-sheet { padding: 18px 16px 4px; text-align: center; }
.as-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--label); }
.as-sub { margin: 0 8px 18px; font-size: 14px; line-height: 1.45; color: var(--label-2); }
.action-sheet .btn { margin-left: 0; margin-right: 0; width: 100%; }
.swipe-box > .fold-head.lvl2 { border-radius: 0; }

/* 事项左滑 */
.row-swipe { margin: 0; border-radius: 0; }
.row-swipe > .row { background: var(--bg-secondary); touch-action: pan-y; will-change: transform; z-index: 1; }
.row-swipe + .row-swipe > .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--inset, 16px); border-top: .5px solid var(--separator); }
.row-swipe .swipe-actions { width: 168px; }
.row-input {
  flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; border-radius: 9px; padding: 0 10px; margin-left: -10px;
  font: inherit; font-size: 17px; color: var(--label); background: transparent; box-shadow: 0 0 0 2px var(--label) inset;
}
.row.renaming .row-main { display: block; }
.row-input { display: block; width: calc(100% + 10px); }
.swipe-face.pressed { background: var(--fill) !important; }

/* 当天安排全部完成：日期下的小点变绿 */
.cal-dot.done { background: var(--green) !important; opacity: 1 !important; }
.cal-dot.pop { animation: dotPop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes dotPop { 0% { transform: scale(.4); } 55% { transform: scale(1.8); } 100% { transform: scale(1); } }

/* 下滑时不再出现顶部的紧凑标题栏：标题栏只作为顶部留白，随页面一起滚走 */
.navbar { position: relative !important; background: transparent !important; border-bottom-color: transparent !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.navbar .nav-title { display: none; }

/* ---------------- 症状描述卡 ---------------- */
.sym-box { margin: 0 16px; padding: 12px 14px 4px; background: var(--bg-secondary); border-radius: var(--radius); }
.sym-part { font-size: 13px; color: var(--label-2); margin: 2px 2px 8px; }
.sym-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sym-chip { box-shadow: none !important; background: var(--fill) !important; color: var(--label); font-size: 15px; padding: 8px 14px; transform: scale(var(--s, 1)) !important; transition: background .2s, color .2s !important; }
.sym-chip.on { background: var(--label) !important; color: var(--bg-secondary) !important; }
.sym-card { margin: 8px 16px 16px; padding: 22px 20px 18px; background: #fff; color: #000; border-radius: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
@media (prefers-color-scheme: dark) { .sym-card { box-shadow: none; } }
.sc-top { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid #000; }
.sc-top span { font-size: 26px; font-weight: 800; }
.sc-top small { font-size: 13px; color: #666; }
.sc-sec { padding: 14px 0 4px; border-bottom: .5px solid #ddd; }
.sc-h { font-size: 12px; font-weight: 700; color: #888; letter-spacing: .5px; margin-bottom: 6px; }
.sc-line { padding: 4px 0 8px; }
.sc-line b { display: block; font-size: 21px; font-weight: 700; line-height: 1.35; }
.sc-line span { display: block; font-size: 13px; color: #8a8a8e; margin-top: 2px; }
.sc-foot { padding-top: 14px; font-size: 17px; font-weight: 600; text-align: right; }

/* 时间选择：滚轮直接可用，全天时滚轮变淡，一碰就激活 */
.time-pick { margin: 14px 16px 0; padding: 12px 0 10px; background: var(--bg-secondary); border-radius: var(--radius); }
.time-head { display: flex; align-items: center; gap: 10px; padding: 0 16px 6px; font-size: 17px; }
.time-head .time-val { margin: 0 0 0 auto; font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; transition: color .25s; }
.time-allday { height: 30px; padding: 0 12px; border-radius: 99px; font-size: 14px; font-weight: 600; background: var(--fill); color: var(--label);
  transition: background .25s, color .25s, transform .4s var(--spring-pop); }
.time-allday.on { background: var(--label); color: var(--bg-secondary); }
.time-allday.pressed { transform: scale(.9); }
.time-pick .wheel { margin: 0 8px; background: transparent; transition: opacity .3s ease; }
.time-pick.allday .wheel { opacity: .4; }
.time-pick.allday .time-val { color: var(--label-2); }
.form-row > span { flex: none; }

/* 苹果式时间滚轮（自绘）：整块区域都能拨，首尾循环 */
#timeWheel { position: relative; height: 200px; display: flex; align-items: stretch; justify-content: center; gap: 0;
  touch-action: none; -webkit-user-select: none; user-select: none; cursor: grab; perspective: 600px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent);
          mask-image: linear-gradient(transparent, #000 28%, #000 72%, transparent); }
#timeWheel .wheel-band { top: 81px; height: 38px; left: 16px; right: 16px; }
#timeWheel .wcol { position: relative; flex: 1; transform-style: preserve-3d; }
#timeWheel .wcol[data-col="h"] .witem { justify-content: flex-end; padding-right: 22px; }
#timeWheel .wcol[data-col="m"] .witem { justify-content: flex-start; padding-left: 22px; }
#timeWheel .witem { position: absolute; left: 0; right: 0; top: 81px; height: 38px; display: flex; align-items: center;
  font-size: 23px; font-variant-numeric: tabular-nums; color: var(--label-2); backface-visibility: hidden; will-change: transform, opacity; }
#timeWheel .witem.on { color: var(--label); font-weight: 600; }
#timeWheel .wheel-colon { align-self: center; position: relative; z-index: 1; font-size: 23px; font-weight: 600; width: 12px; text-align: center; }

/* ---------------- 标志 ---------------- */
.logo { display: block; flex: none; border-radius: 22.5%; }
@media (prefers-color-scheme: dark) { .logo { box-shadow: 0 0 0 1px rgba(255,255,255,.14); } }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 12px; margin-top: -6px; }
.brand b { font-size: 24px; font-weight: 800; letter-spacing: -.6px; color: var(--label); }
.brand .logo { transition: transform .5s var(--spring-pop); }
.brand:active .logo { transform: scale(.9) rotate(-6deg); }

/* 启动画面：A 先画出来，再打勾，然后整体淡出 */
#splash { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--bg, #F2F2F7); transition: opacity .5s ease, transform .5s cubic-bezier(.32,.72,0,1); }
#splash b { font-size: 30px; font-weight: 800; letter-spacing: -.8px; color: var(--label); opacity: 0; transform: translateY(8px); }
#splash .logo { opacity: 0; transform: scale(.6); }
#splash .logo-a { stroke-dasharray: 700; stroke-dashoffset: 700; }
#splash .logo-check { stroke-dasharray: 200; stroke-dashoffset: 200; }
#splash.play .logo { animation: spLogo .6s cubic-bezier(.3,1.5,.5,1) forwards; }
#splash.play .logo-a { animation: spDraw .5s .15s cubic-bezier(.6,0,.2,1) forwards; }
#splash.play .logo-check { animation: spDraw .35s .55s cubic-bezier(.3,0,.2,1) forwards; }
#splash.play b { animation: spText .5s .35s cubic-bezier(.32,.72,0,1) forwards; }
#splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
@keyframes spLogo { to { opacity: 1; transform: scale(1); } }
@keyframes spDraw { to { stroke-dashoffset: 0; } }
@keyframes spText { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #splash { display: none; } }
/* 提示条收起时完全藏起来，不在顶部露出一角 */
.toast { opacity: 0; transition: transform .45s var(--spring), opacity .25s ease; }
.toast.show { opacity: 1; }

/* 新建待安排：日期行 */
.date-head { display: flex; align-items: center; gap: 10px; padding: 20px 32px 8px; font-size: 13px; color: var(--label-2); }
.date-head b { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--label); }
#timeBox { transition: opacity .3s ease; }
#timeBox.muted { opacity: .45; }
.form-row input, .form-row select { min-width: 0; width: 0; }

/* 新建分类按钮 */
.add-cat { display: flex; align-items: center; justify-content: center; gap: 6px; width: calc(100% - 32px); margin: 8px 16px 0; min-height: 46px;
  border-radius: var(--radius); border: 1.5px dashed var(--separator); color: var(--label-2); font-size: 16px; font-weight: 600;
  transform: scale(var(--s, 1)); transition: background .2s, color .2s; }
.add-cat svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.add-cat.pressed { background: var(--fill); color: var(--label); }
.fold.open > .swipe-box > .fold-head .fold-chev { transform: rotate(90deg); }
