:root {
  /* 品牌色（CEO 2026-10-04）：墨綠 #1F3A2E、琥珀 #D9A441、石白 #F5F1EA、墨黑 #1C2321 */
  --bg: #F5F1EA; --card: #ffffff; --ink: #1C2321; --muted: #6b6f68; --line: #e3ded3;
  --accent: #1F3A2E; --accent-ink: #F5F1EA; --accent-soft: #e2ebe5; --gold: #B8862F;
  --warn: #b45309; --warn-soft: #fdf1e3; --bad: #b42318; --bad-soft: #fde8e6; --good: #2f7d32;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121714; --card: #1a211d; --ink: #EEEAE2; --muted: #9ea69f; --line: #2b332e;
    --accent: #8FC1A5; --accent-ink: #10180f; --accent-soft: #1F3A2E; --gold: #D9A441;
    --warn: #f0a24b; --warn-soft: #3a2a17; --bad: #f2867a; --bad-soft: #3d1d1a; --good: #7cc47f;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #121714; --card: #1a211d; --ink: #EEEAE2; --muted: #9ea69f; --line: #2b332e;
  --accent: #8FC1A5; --accent-ink: #10180f; --accent-soft: #1F3A2E; --gold: #D9A441;
  --warn: #f0a24b; --warn-soft: #3a2a17; --bad: #f2867a; --bad-soft: #3d1d1a; --good: #7cc47f;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.top { display: flex; align-items: baseline; justify-content: space-between; max-width: 720px; margin: 0 auto; padding: 16px 16px 4px; }
.top h1 { margin: 0; display: flex; align-items: center; gap: 10px; line-height: 0; }
.top h1 img.icon { width: 34px; height: 34px; border-radius: 8px; }
.top h1 img.word { height: 22px; width: auto; }
.top .word-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top .word-light { display: none; } :root:not([data-theme="light"]) .top .word-dark { display: block; } }
:root[data-theme="dark"] .top .word-light { display: none; }
:root[data-theme="dark"] .top .word-dark { display: block; }
.badge { background: var(--gold) !important; }
main { max-width: 720px; margin: 0 auto; padding: 8px 16px 24px; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.sub { font-size: 13px; color: var(--muted); }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar > i.over { background: var(--bad); }
.spark { width: 100%; height: 56px; display: block; margin-top: 6px; }
.spark path.l { fill: none; stroke: var(--warn); stroke-width: 2; }
.spark path.a { fill: var(--warn-soft); }
.spark circle { fill: var(--warn); }

/* 表單 */
details.add { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; }
details.add > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--accent); }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { border-bottom: 1px solid var(--line); }
form { padding: 12px 16px 16px; display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button, .opt { flex: 1; }
button {
  font: inherit; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; cursor: pointer;
}
button.on, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.opts button { flex: 1 1 auto; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.err { color: var(--bad); font-size: 14px; }

/* 底部分頁 */
.tabs-old {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.tabs button { border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 12px; display: grid; justify-items: center; gap: 1px; padding: 8px 2px 10px; min-height: 60px; position: relative; }
.tabs button .ic { font-size: 18px; line-height: 1.2; }
.tabs button.on { color: var(--accent); font-weight: 600; background: none; }
.badge { position: absolute; top: 6px; left: calc(50% + 10px); background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; line-height: 17px; }

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto;
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; z-index: 10; font-size: 15px;
}
#toast.bad { background: var(--bad); color: #fff; }
.stack { display: grid; gap: 10px; }
.stack[hidden] { display: none; }
.row > .sub:last-child { white-space: nowrap; }

/* 第一批改版 */
.bar > i.done { background: var(--gold); }
.hero .big .of { font-size: 18px; font-weight: 500; color: var(--muted); }
.hero .next { text-align: right; }
.hero .focus { font-size: 34px; font-weight: 800; color: var(--accent); line-height: 1.1; }
details.inline > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 10px 0 2px; list-style: none; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline form { padding: 10px 0 0; }
a.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); flex: 1; }
a.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
li.todo { display: flex; gap: 12px; align-items: flex-start; }
button.check { min-height: 28px; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--accent); background: none; flex: none; margin-top: 2px; }
button.check:hover { background: var(--accent-soft); }

/* 收藏（第二批） */
.quick { display: flex; gap: 8px; }
.quick input { flex: 1; min-width: 0; }
.quick button { flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips button { flex: none; min-height: 36px; padding: 4px 12px; border-radius: 99px; font-size: 14px; white-space: nowrap; }
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.savelist { display: grid; gap: 10px; }
article.save { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
article.save .body { flex: 1; min-width: 0; display: grid; gap: 4px; }
article.save .title { font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-word; }
article.save a.title::after { content: ' ↗'; color: var(--muted); font-weight: 400; }
img.thumb, .thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; background: var(--accent-soft); }
form img.thumb { width: 100%; height: 160px; }
.thumb.ph { display: grid; place-items: center; font-size: 28px; }
.stat { display: flex; flex-wrap: wrap; gap: 6px; }
.stat button { min-height: 30px; padding: 2px 10px; font-size: 13px; border-radius: 99px; }
.stat button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags .pill { margin-left: 0; }
.big.gold { color: var(--gold); }
.right { text-align: right; }
.pad { padding: 0 4px; }
.save-kinds button { flex: 1 1 30%; white-space: nowrap; }

/* 第三批：學習、專案、右上角「等您決定」 */
.top .decide { border: 0; background: none; min-height: 36px; padding: 4px 6px; position: relative; color: var(--muted); font-size: 14px; }
.top .decide .badge { top: -2px; left: auto; right: -6px; }
.tabs button { font-size: 11px; padding: 8px 0 10px; }
.next-step { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 6px 0; }
textarea[name=output] { min-height: 64px; }

/* 第四批：旅程 */
details.trip > summary { list-style: none; cursor: pointer; }
details.trip > summary::-webkit-details-marker { display: none; }
details.trip[open] > summary { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
details.trip .day { margin: 10px 0; }
details.trip h3 { font-size: 14px; margin: 0 0 2px; color: var(--accent); display: flex; gap: 8px; align-items: baseline; }
details.trip li.off { opacity: .5; text-decoration: line-through; }
details.trip a { color: var(--accent); font-weight: 600; }
button.mini { min-height: 30px; padding: 2px 10px; font-size: 13px; border-radius: 99px; flex: none; }
.share { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; background: var(--accent-soft); border-radius: 10px; }
.share input { font-size: 13px; }
button.sharebtn { margin-top: 10px; width: 100%; }

/* 推播 */
button.mini.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ===== 2026-10-04 版面改版：首頁＋Dock 隨手記＋儀表板 ===== */
.top { align-items: center; gap: 8px; }
.top .home { border: 0; background: none; padding: 0; min-height: 40px; display: flex; align-items: center; gap: 10px; line-height: 0; }
.top .home img.icon { width: 34px; height: 34px; border-radius: 8px; }
.top .home img.word { height: 22px; width: auto; }
body:not([data-page="home"]) .top .home img.word { display: none !important; }
#page-title { flex: 1; font-size: 20px; font-weight: 700; }
.center { text-align: center; }
.pad { padding: 0 16px 14px; }
.full { grid-column: 1 / -1; }
h2.section-h { margin: 18px 4px 8px; font-size: 16px; color: var(--ink); }

/* Dock：5 個隨手記 */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--card); border-top: 1px solid var(--line); padding: 4px 8px env(safe-area-inset-bottom);
}
.dock button { border: 0; background: none; color: var(--muted); font-size: 12px; display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; min-height: 60px; border-radius: 12px; }
.dock button .ic { font-size: 20px; line-height: 1.2; color: var(--accent); }
.dock button:active { background: var(--accent-soft); }
.dock button.center .ic { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%; background: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.18); font-size: 22px; }

/* 半張卡（隨手記的表單）*/
.sheet-back { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 18px 18px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-head { position: sticky; top: 0; background: var(--card); display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet-head .x { min-height: 36px; width: 36px; padding: 0; border-radius: 50%; }
.sheet-body { padding: 12px 16px; display: grid; gap: 10px; }
.sheet-body form { padding: 0; }
body.sheet-open { overflow: hidden; }
input.amount { font-size: 32px; font-weight: 700; text-align: center; min-height: 64px; font-variant-numeric: tabular-nums; }

/* 首頁 */
.hello { font-size: 22px; font-weight: 700; margin: 8px 4px 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tile { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-height: 96px; }
.tile:active { background: var(--accent-soft); }
.tile-ic { font-size: 22px; color: var(--accent); }
.tile strong { font-size: 16px; }

/* 月曆 */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-head strong { flex: 1; text-align: center; font-size: 17px; order: 0; }
.cal-head button:first-child { order: -1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-w { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 46px; padding: 4px 0 6px; border: 0; border-radius: 10px; background: none; display: grid; justify-items: center; align-content: start; gap: 3px; position: relative; }
.cal-day .n { font-size: 15px; font-variant-numeric: tabular-nums; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; }
.cal-day.today .n { color: var(--accent); font-weight: 800; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.sel .n { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal-day .dots { display: flex; gap: 2px; height: 5px; }
.cal-day .dots i, .cal-legend .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); display: inline-block; }
.cal-day .dots i.todo, .cal-legend .dot.todo { background: var(--gold); }
.cal-day.trip::after, .cal-legend .bar { content: ''; position: absolute; left: 2px; right: 2px; bottom: 1px; height: 3px; border-radius: 2px; background: var(--gold); opacity: .7; }
.cal-legend { display: flex; gap: 14px; margin-top: 8px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .bar { position: static; width: 14px; display: inline-block; }

/* 財務 */
.locked { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 28px 16px; }
.lock-ic { font-size: 44px; }
.big-btn { width: 100%; max-width: 320px; min-height: 52px; font-size: 17px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.kpis > div { display: grid; }
.kpis strong { font-size: 17px; text-align: left; }
.neg { color: var(--bad); }
svg.bars { width: 100%; height: auto; display: block; }
svg.bars rect { fill: var(--accent); opacity: .75; }
svg.bars rect.today { fill: var(--gold); opacity: 1; }
svg.bars rect.future { opacity: .15; }
svg.bars line.avg { stroke: var(--muted); stroke-dasharray: 4 3; }
svg.bars text, svg.line text { font-size: 10px; fill: var(--muted); }

/* 健康 */
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.ring-box { position: relative; display: grid; justify-items: center; gap: 2px; }
svg.ring { width: 84px; height: 84px; }
svg.ring circle { fill: none; stroke-width: 8; }
svg.ring .track { stroke: var(--line); }
svg.ring .val { stroke: var(--accent); stroke-linecap: round; }
svg.ring.done .val { stroke: var(--gold); }
.ring-txt { position: absolute; top: 0; height: 84px; display: grid; align-content: center; justify-items: center; line-height: 1.15; }
.ring-txt strong { font-size: 15px; }
.ring-txt .sub { font-size: 11px; }
.heat { display: grid; grid-template-columns: repeat(7, 22px); gap: 5px; margin: 10px 0 6px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: var(--line); }
.heat i.on { background: var(--accent); }
.heat i.today { box-shadow: inset 0 0 0 2px var(--gold); }
svg.line { width: 100%; height: auto; display: block; margin-top: 6px; }
svg.line path.l { fill: none; stroke: var(--accent); stroke-width: 2.2; }
svg.line circle { fill: var(--accent); }
.wbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 120px; margin-top: 8px; }
.wbar { display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 4px; }
.wcol { width: 100%; max-width: 28px; display: flex; align-items: flex-end; background: var(--accent-soft); border-radius: 6px; overflow: hidden; }
.wcol i { display: block; width: 100%; background: var(--accent); border-radius: 6px; }
.wcol i.done { background: var(--gold); }
.inline-form { padding: 10px 0 0; }

/* 課程 */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats3 > div { display: grid; }
.stats3 strong { font-size: 22px; text-align: center; }
.courses { display: grid; gap: 12px; }
article.course { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cover { height: 76px; display: flex; align-items: flex-end; gap: 6px; padding: 10px 14px; background: linear-gradient(135deg, var(--accent), #2f5a46); color: #fff; }
.cover.k-2 { background: linear-gradient(135deg, #6b4a2b, #a8743f); }
.cover.k-3 { background: linear-gradient(135deg, #2b4a6b, #3f74a8); }
.cover.k-4 { background: linear-gradient(135deg, #5a2b6b, #8f4fa8); }
.cover.k-5 { background: linear-gradient(135deg, #6b2b3a, #a84f62); }
.cover-ic { font-size: 30px; margin-right: auto; }
.cover .pill { background: rgba(255,255,255,.22); color: #fff; }
.course-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.course-title { font-size: 17px; }
ul.timeline { list-style: none; margin: 6px 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
ul.timeline li { position: relative; }
ul.timeline li::before { content: ''; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
ul.timeline .pill { margin-left: 0; }
article.course.mini .cover { height: auto; padding: 8px 14px; }
article.course.mini .cover-ic { font-size: 20px; }
article.course.mini .course-body { padding: 10px 14px; gap: 6px; }

/* ===== 2026-10-04 行事曆細修 ===== */
/* iPhone 輸入框字小於 16px 會自動放大畫面 → 一律 16px（CEO：字已經夠大，不要放大） */
input, select, textarea { font-size: 16px; }
.top .gear { font-size: 20px; color: var(--muted); padding: 4px 8px; }
.dock button.center .ic { color: var(--accent-ink); font-size: 28px; font-weight: 300; }
.danger { color: var(--bad); border-color: var(--bad); background: none; }
h2.late { color: var(--bad); }
/* 標籤色（領域）：工作 藍、家人 玫瑰、健身 綠、學習 紫、財務 金、興趣 橘、行程 青、其他 灰 */
.c1 { --c: #2f6fb5; } .c2 { --c: #c2416b; } .c3 { --c: #2f8a4f; } .c4 { --c: #7a4fb5; }
.c5 { --c: #b8862f; } .c6 { --c: #d0662b; } .c7 { --c: #24838a; } .c8 { --c: #7b807a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c1 { --c: #7fb0e6; } :root:not([data-theme="light"]) .c2 { --c: #ec8aa8; } :root:not([data-theme="light"]) .c3 { --c: #7cc98f; } :root:not([data-theme="light"]) .c4 { --c: #b495e6; } :root:not([data-theme="light"]) .c5 { --c: #e2b864; } :root:not([data-theme="light"]) .c6 { --c: #f0a070; } :root:not([data-theme="light"]) .c7 { --c: #6cc4ca; } :root:not([data-theme="light"]) .c8 { --c: #a4aaa3; } }
.cal-day .dots i { background: var(--c, var(--accent)); }
.cal-day .dots i.ring { background: none; box-shadow: inset 0 0 0 1.5px var(--c, var(--gold)); }
i.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--c, var(--accent)); flex: none; }
i.sw.ring { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); border-radius: 50%; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 4px; font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.chips.dom { flex-wrap: wrap; }
.chips.dom button { display: inline-flex; align-items: center; gap: 6px; }
.chips.dom button.on { background: var(--c); border-color: var(--c); color: #fff; }
.chips.dom button.on i.sw { background: #fff; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
button.agenda { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-left: 4px solid var(--c, var(--accent)); background: var(--bg); border-radius: 8px; padding: 10px 12px; min-height: 48px; }
button.agenda .tm { font-size: 13px; color: var(--muted); width: 40px; flex: none; font-variant-numeric: tabular-nums; }
button.agenda .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.agenda .chev { color: var(--muted); }
.trow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.trow select { width: auto; min-width: 64px; }
.trow .tl { font-size: 13px; color: var(--muted); margin: 0 4px 0 6px; }
.trow .tl:first-child { margin-left: 0; }
button.check { border-color: var(--c, var(--accent)); }
button.todo-body { flex: 1; display: grid; gap: 2px; text-align: left; border: 0; background: none; padding: 0; min-height: 0; }
.done-t { text-decoration: line-through; color: var(--muted); }
.agenda-list > li { min-width: 0; }
button.agenda { overflow: hidden; }
.trow { display: grid; grid-template-columns: 44px 1fr 12px 1fr; gap: 6px; align-items: center; }
.trow select { width: 100%; }
.trow .tl { margin: 0; }

/* ===== 2026-10-04 iPhone 16 Pro Max：只上下滑、單指操作 =====
   ①iPhone 的日期框有自己的最小寬度、不聽 width:100% → 撐破格子，整頁能左右拖
   ②一排可左右滑的小按鈕（chips）→ 改成自動換行
   ③畫面一旦被放大就回不去 → viewport 加 maximum-scale=1（不會再因點輸入框放大），頁面只准上下捲 */
html, body { overflow-x: hidden; max-width: 100%; overscroll-behavior-x: none; }
body { touch-action: pan-y; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
label, .grid2 > *, .quick > *, .row > *, form > * { min-width: 0; }
.chips { flex-wrap: wrap; overflow-x: visible; }
img, svg { max-width: 100%; }
.top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* ===== 2026-10-04 v0.11 質感：統一卡片高度＋滑順動畫（CEO：任何切換、滑出都要很滑順）=====
   曲線：進場 --out（快出慢停，像 iOS），離場 --in（慢起快走）。系統「減少動態效果」打開時全部關掉。 */
:root { --out: cubic-bezier(.22, 1, .36, 1); --in: cubic-bezier(.55, 0, .75, .06); }

/* 下方滑出的卡：固定高度，切分頁不會忽長忽短，內容多就在卡裡捲 */
.sheet { height: min(78vh, 680px); max-height: none; display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up .42s var(--out) both; will-change: transform; }
.sheet-head { flex: none; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; align-content: start; }
.sheet-back { animation: fade-in .3s ease both; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet-back.closing { animation: fade-out .24s ease forwards; pointer-events: none; }
.sheet-back.closing .sheet { animation: sheet-down .24s var(--in) forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* 載入中的骨架（取代「載入中…」字） */
.skeleton { height: 44px; border-radius: 10px; background: linear-gradient(90deg, var(--line) 25%, var(--accent-soft) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 分頁內容切換：淡入＋微微上移 */
.pane-in { animation: pane-in .32s var(--out) both; }
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } }

/* 換頁：卡片一張接一張浮上來 */
main.enter > * { animation: page-in .45s var(--out) both; }
main.enter > *:nth-child(2) { animation-delay: .04s; }
main.enter > *:nth-child(3) { animation-delay: .08s; }
main.enter > *:nth-child(4) { animation-delay: .12s; }
main.enter > *:nth-child(5) { animation-delay: .16s; }
main.enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

/* 月曆換月：從左或右滑進來 */
.cal-grid.from-right { animation: from-right .34s var(--out) both; }
.cal-grid.from-left { animation: from-left .34s var(--out) both; }
@keyframes from-right { from { opacity: 0; transform: translateX(28px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-28px); } }

/* 展開區塊（新增、編輯、紀錄）內容淡入 */
details[open] > :not(summary) { animation: pane-in .3s var(--out) both; }
details > summary { transition: color .2s; }

/* 按下去有回饋；顏色切換有過渡 */
button, a.btn, .tile, button.agenda, .cal-day { transition: transform .18s var(--out), background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, opacity .2s; -webkit-tap-highlight-color: transparent; }
button:active, a.btn:active, .tile:active, button.agenda:active { transform: scale(.97); }
.dock button:active { transform: scale(.92); }
.cal-day:active .n { transform: scale(.9); }
.cal-day .n { transition: background-color .25s ease, color .25s ease, transform .18s var(--out); }

/* 長條、圓環從 0 長到目標值 */
.bar > i { width: 0; transition: width .7s var(--out); }
.wcol i { height: 0; transition: height .7s var(--out); }
svg.ring .val { transition: stroke-dasharray .9s var(--out); }

/* 提示訊息滑上來 */
#toast:not([hidden]) { animation: toast-in .38s var(--out) both; }
#update-bar { animation: toast-in .38s var(--out) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* 飲控 */
.water-now { text-align: center; margin-top: 8px; }
.water-now .big { font-size: 44px; }
.water-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.water-btns button { min-height: 72px; font-size: 22px; font-weight: 700; border-radius: 16px; }
button.ghost { border: 0; background: none; color: var(--muted); font-size: 14px; }
.full-btn { width: 100%; margin-top: 12px; }
.pane { display: grid; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 帳戶 */
.chips.acc button { font-size: 14px; }
li.off-acc { opacity: .5; }

/* 記帳 v0.13：金額不再特大；金額＋幣別同一列 */
.amt-row { display: grid; grid-template-columns: 1fr 104px; gap: 10px; }
.amt-row input { font-weight: 700; font-variant-numeric: tabular-nums; }
.l4-row { display: flex; gap: 8px; margin-top: 6px; }
.l4-row input.l4 { width: 120px; min-height: 36px; padding: 6px 10px; letter-spacing: .15em; }

/* 記帳 v0.15：支付方式＋扣款帳號並排；轉帳時扣款帳號佔整列 */
.grid2.one { grid-template-columns: 1fr; }
:root[data-theme="dark"] .c1 { --c: #7fb0e6; } :root[data-theme="dark"] .c2 { --c: #ec8aa8; } :root[data-theme="dark"] .c3 { --c: #7cc98f; } :root[data-theme="dark"] .c4 { --c: #b495e6; }
:root[data-theme="dark"] .c5 { --c: #e2b864; } :root[data-theme="dark"] .c6 { --c: #f0a070; } :root[data-theme="dark"] .c7 { --c: #6cc4ca; } :root[data-theme="dark"] .c8 { --c: #a4aaa3; }

/* 簡約 Logo（v0.18，CEO 選 B）：圓環 C＋琥珀寶石；深色模式換米白版 */
.top .home img.icon { width: 32px; height: 32px; border-radius: 0; }
.top .home img.word { height: 18px; }
.top .icon-dark { display: none; }
:root[data-theme="dark"] .top .icon-light { display: none; }
:root[data-theme="dark"] .top .icon-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .top .icon-light { display: none; } :root:not([data-theme]) .top .icon-dark { display: block; } :root:not([data-theme]) .top .word-light { display: none; } :root:not([data-theme]) .top .word-dark { display: block; } }

/* 課程單元（v0.19）：章節目錄、筆記閱讀 */
.unit-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
.unit-row { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: var(--bg); border-radius: 8px; padding: 8px 10px; min-height: 40px; color: var(--ink); text-decoration: none; font-size: 14px; }
.unit-row .tick { width: 18px; flex: none; color: var(--accent); font-weight: 700; }
.unit-row .uc { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.unit-row .ut { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-row.done .ut { color: var(--muted); }
.ch-title { margin-top: 8px; font-weight: 600; }
.unit-head h2.unit-title { font-size: 20px; color: var(--ink); margin: 4px 0; }
.unit-nav { margin: 12px 0 24px; }
.unit-video { width: 100%; border-radius: 10px; background: #000; }
article.md { font-size: 16px; line-height: 1.75; }
article.md h2 { font-size: 19px; color: var(--accent); margin: 18px 0 6px; }
article.md h3 { font-size: 17px; color: var(--ink); margin: 16px 0 4px; }
article.md h4 { font-size: 16px; margin: 12px 0 4px; }
article.md p { margin: 8px 0; }
article.md ul, article.md ol { padding-left: 22px; margin: 6px 0; }
article.md li { margin: 3px 0; }
article.md li.sub-li { margin-left: 18px; list-style: circle; }
article.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
article.md blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--gold); background: var(--bg); border-radius: 0 8px 8px 0; }
article.md code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 14px; }
.md-table { margin: 8px 0; }
.md-table table { border-collapse: collapse; font-size: 14px; width: 100%; table-layout: fixed; }
.md-table th, .md-table td { word-break: break-word; }   /* 只准上下捲：表格擠在寬度內換行 */
.md-table th, .md-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.md-table th { background: var(--accent-soft); }
/* 每日一書（2026-10-05） */
.book-today { display: grid; gap: 8px; }
.book-today .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-today input.mins { width: 72px; font-size: 16px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.book-today form.row label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }

/* ===== 2026-10-05 選單＋鎖屏首頁＋分頁＋新聞（v0.21.0） ===== */
/* 選單：從左邊滑出 */
.menu { position: fixed; inset: 0; z-index: 50; }
.menu-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .2s ease; }
.menu-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(78vw, 300px); background: var(--card); border-right: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 18px) 12px 24px; overflow-y: auto; transform: translateX(-102%); transition: transform .22s var(--out, ease); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.menu.open .menu-shade { opacity: 1; }
.menu.open .menu-panel { transform: none; }
.menu-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu-panel a { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 16px; }
.menu-panel a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu-panel .m-ic { width: 24px; text-align: center; font-size: 18px; }
.menu-panel .m-sep { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .menu-shade, .menu-panel { transition: none; } }

/* 首頁＝鎖屏 */
body[data-page="home"] #today { display: none; }
.lock { text-align: center; padding: 9vh 0 5vh; }
.lock-date { font-size: 17px; color: var(--muted); letter-spacing: .04em; }
.lock-time { font-size: clamp(76px, 24vw, 112px); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.banners { display: grid; gap: 8px; }
a.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
a.banner.hi { border-color: var(--gold); }
.banner .b-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 17px; }
.banner .b-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.banner .b-title { font-size: 12px; color: var(--muted); }
.banner .b-text { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner .b-go { color: var(--muted); font-size: 20px; }
.banner-empty { text-align: center; color: var(--muted); font-size: 14px; margin: 10px 0; }

/* 頁內分頁（學習、工作、娛樂、新聞的早午晚） */
.subtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 10px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a, .subtabs button { flex: 1 0 auto; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 9px; background: none; color: var(--muted);
  text-decoration: none; font-size: 14px; display: grid; place-items: center; white-space: nowrap; }
.subtabs .on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.subtabs button:disabled { opacity: .4; }

/* 新聞快報 */
.news-day { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.news-day button, .news-day .news-sp { width: 40px; min-height: 36px; border: 0; background: none; font-size: 22px; color: var(--muted); }
ol.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.news-item { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.news-rank { flex: none; width: 26px; font-size: 20px; font-weight: 700; color: var(--gold); text-align: center; line-height: 1.3; }
.news-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.news-meta { display: flex; align-items: center; gap: 8px; }
.news-title { font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.4; }
a.news-title::after { content: ' ↗'; color: var(--muted); font-weight: 400; }
.news-text { margin: 0; font-size: 14px; line-height: 1.6; }
.news-you { margin: 0; font-size: 13px; color: var(--accent); }

/* ===== 語言進修（v0.22.0） ===== */
.lang-list { display: grid; gap: 8px; }
a.lang-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
a.lang-card.dim { opacity: .75; }
.lang-ic { font-size: 28px; width: 40px; text-align: center; flex: none; }
.lang-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lang-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.lang-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 10px; }
.lang-head a.back { color: var(--muted); text-decoration: none; font-size: 15px; min-height: 36px; display: inline-flex; align-items: center; }
.lang-head strong { font-size: 17px; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
a.topic { display: grid; justify-items: center; gap: 4px; padding: 16px 6px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); text-align: center; }
a.topic.dim { opacity: .55; }
.topic-ic { font-size: 28px; }
.quiz { display: grid; gap: 10px; }
.quiz-q { font-size: 26px; font-weight: 700; text-align: center; padding: 14px 0 2px; line-height: 1.3; }
.quiz-q.zh { font-size: 20px; font-weight: 600; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opts .opt { min-height: 48px; font-size: 16px; text-align: left; padding: 8px 14px; }
.quiz-opts .opt.right { background: #e3f1e6; border-color: #5d9a52; color: #23502a; }
.quiz-opts .opt.wrong { background: #fbe6e1; border-color: #c9573f; color: #7a2a1b; }
.quiz-opts .opt:disabled { opacity: 1; }
.quiz-fb { display: grid; gap: 8px; }
.quiz-ex, .quiz-ans { margin: 0; font-size: 15px; line-height: 1.6; }
.quiz-ans { font-size: 18px; font-weight: 600; }
.quiz textarea { font-size: 16px; }
.quiz-done { text-align: center; display: grid; gap: 10px; }
.quiz-done .big { font-size: 36px; font-weight: 700; }
.quiz-done ul.list { text-align: left; }
.lang-article h2, .lang-article h3 { margin-top: 1.2em; }

/* ===== 開門頁（Face ID 登入，v0.23.0） ===== */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px 16px; text-align: center; }
.login-mark { width: 64px; height: 64px; border-radius: 14px; }
.login-page .icon-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-page .icon-light { display: none; } :root:not([data-theme="light"]) .login-page .icon-dark { display: block; } }
:root[data-theme="dark"] .login-page .icon-light { display: none; }
:root[data-theme="dark"] .login-page .icon-dark { display: block; }
.login-btn { min-width: 220px; min-height: 52px; font-size: 17px; border-radius: 999px; margin-top: 12px; }
.login .sub { min-height: 1.4em; }

.login-code { margin-top: 18px; }
.login-code form { display: flex; gap: 8px; margin-top: 8px; }
.login-code input { font-size: 16px; text-transform: uppercase; letter-spacing: .1em; width: 190px; }

/* 財務 → 設定 → 固定支出（2026-10-14 v2）：手機兩行清單、電腦（≥900px）滿版表格 */
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
label.check input { width: 20px; height: 20px; flex: none; }
.fx-total { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.fx-total strong { font-size: 32px; font-variant-numeric: tabular-nums; }
.fx-list .fx-row { display: grid; grid-template-columns: 1fr auto 14px; grid-template-areas: "name mon go" "meta meta go"; column-gap: 10px; row-gap: 2px; align-items: center; min-height: 56px; cursor: pointer; }
.fx-row .fx-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-row .fx-name .pill { margin-left: 6px; }
.fx-row .fx-mon { grid-area: mon; text-align: right; font-weight: 600; }
.fx-row .fx-mon::after { content: '／月'; font-weight: 400; font-size: 12px; color: var(--muted); }
.fx-row .fx-go { grid-area: go; color: var(--muted); text-align: right; }
.fx-row .fx-meta { grid-area: meta; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-row .fx-cat, .fx-row .fx-amt, .fx-row .fx-day { display: none; }
.fx-row.off .fx-name, .fx-row.off .fx-mon { color: var(--muted); text-decoration: line-through; }
.fx-head { display: none !important; }
.fx-row:hover, .fx-row:focus-visible { background: var(--accent-soft); outline: none; }
.ghost-btn { width: 100%; min-height: 48px; background: transparent; border: 1px solid var(--line); color: var(--bad); border-radius: 12px; font-size: 16px; }
@media (min-width: 900px) {
  body[data-page="finance"] main, body[data-page="finance"] .top { max-width: 1160px; }
  .fx-list .fx-row { grid-template-columns: minmax(0, 2.2fr) 1fr 1.2fr 1.1fr 1fr 14px; grid-template-areas: none; min-height: 48px; }
  .fx-row .fx-name, .fx-row .fx-cat, .fx-row .fx-amt, .fx-row .fx-day, .fx-row .fx-mon, .fx-row .fx-go { grid-area: auto; grid-row: auto; grid-column: auto; display: block; font-size: 15px; color: inherit; }
  .fx-row .fx-meta { display: none; }
  .fx-row .fx-cat, .fx-row .fx-day { color: var(--muted); }
  .fx-row .fx-amt { text-align: right; }
  .fx-row .fx-day { padding-left: 28px; }
  .fx-row .fx-mon::after { content: ''; }
  .fx-head { display: grid !important; cursor: default; font-size: 13px; min-height: 36px !important; }
  .fx-head span { color: var(--muted) !important; font-size: 13px !important; }
  .fx-head:hover { background: none; }
}
