[hidden] { display: none !important; }
:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1d1d1b; --muted: #6b6a64; --line: #e3e1da;
  --accent: #1f5f4a; --accent-ink: #ffffff; --warn: #a3401f; --soft: #edf3ef; --us: #1f5f4a; --them: #6a4c93;
  --radius: 10px; font-family: -apple-system, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --panel: #1f1f1d; --ink: #ecebe6; --muted: #9a998f; --line: #34332f;
    --accent: #6fbf9c; --accent-ink: #10231b; --warn: #e58a67; --soft: #22302a; --us: #6fbf9c; --them: #b49ae0; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 16px; align-items: center; justify-content: space-between;
  flex-wrap: wrap; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); font-size: 17px; }
.brand span { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); }
nav a.on { background: var(--soft); color: var(--accent); font-weight: 600; }
main { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 8px; }
h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
button, .btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--warn); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, textarea, select { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 8px 0; }
label.check input { width: auto; margin-top: 4px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.tabs button.on { background: var(--soft); color: var(--accent); border-color: var(--accent); }
.note { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 12px 0; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--accent); }
.pill.error { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.pill.us { color: var(--us); } .pill.them { color: var(--them); }
.list a.item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.list a.item:last-child { border-bottom: 0; }
.list a.item:hover { background: var(--soft); }
.sec { margin-top: 18px; }
.sec-rows .r { display: grid; gap: 6px; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) 32px; margin-bottom: 6px; }
.sec-rows .r input:first-child { grid-column: span 1; }
.sec-head { display: grid; gap: 6px; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) 32px; font-size: 12px; color: var(--muted); }
.x { padding: 4px; width: 32px; }
.output { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 8px; font-size: 14px; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 18px; }
.timeline .ev { position: relative; margin-bottom: 18px; }
.timeline .ev::before { content: ""; position: absolute; left: -25px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.todo input { width: auto; margin-top: 5px; }
.todo.done span.t { text-decoration: line-through; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { font-size: 13px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: calc(100% - 32px); }
@media (max-width: 640px) {
  .sec-head { display: none; }
  .sec-rows .r { grid-template-columns: 1fr 32px; }
  .sec-rows .r > :not(:first-child):not(.x) { grid-column: 1; }
  .sec-rows .r .x { grid-column: 2; grid-row: 1; }
}
.tldr { padding-left: 20px; margin: 4px 0 8px; } .tldr li { margin: 2px 0; }
input.inline { border-color: transparent; background: transparent; padding: 2px 6px; }
input.inline:hover, input.inline:focus { border-color: var(--line); background: var(--bg); }
.uc { display: flex; gap: 8px; align-items: center; padding: 4px 0; } .uc .muted { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.qc .todo { align-items: center; } .qc .todo input[type=checkbox] { margin-top: 0; }
.qc .todo input.inline { flex: 1; width: 100%; min-width: 0; margin-top: 0; }
.uc { display: grid; grid-template-columns: auto minmax(120px, 260px) 1fr; }
.uc input.inline { width: 100%; }
@media (max-width: 640px) { .uc { grid-template-columns: 1fr; gap: 2px; } }

.rec-btn { width: 100%; padding: 14px; font-size: 17px; margin-top: 8px; }
.rec-live { text-align: center; padding: 24px 0 8px; }
.rec-dot { width: 18px; height: 18px; border-radius: 50%; background: #d23b2e; margin: 0 auto 10px; animation: pulse 1.4s infinite; }
.rec-dot.paused { background: var(--muted); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }
.rec-time { font-size: 48px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.meter { height: 6px; background: var(--line); border-radius: 3px; max-width: 320px; margin: 14px auto; overflow: hidden; }
.meter div { height: 100%; width: 0; background: var(--accent); transition: width .08s; }
.rec-live button { min-width: 120px; padding: 12px 18px; font-size: 16px; }

/* 手機 app 模式：安全區與大按鈕 */
.top { padding-top: max(12px, env(safe-area-inset-top)); }
main { padding-bottom: max(80px, env(safe-area-inset-bottom)); }
@media (max-width: 640px) {
  .top { padding-left: 16px; padding-right: 16px; }
  nav a { padding: 6px 9px; font-size: 14px; }
  .rec-time { font-size: 56px; }
  .rec-live .row { flex-direction: column; align-items: stretch; }
  .rec-live button { width: 100%; padding: 16px; font-size: 18px; }
}

/* 處理進度 */
.prog .bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 14px; }
.prog .bar div { height: 100%; background: var(--accent); transition: width .6s ease; }
.steps { margin: 0 0 12px; padding-left: 22px; }
.steps li { color: var(--muted); padding: 3px 0; }
.steps li.on { color: inherit; font-weight: 600; }
.steps li.done { color: inherit; }
.steps li.done::after { content: " ✓"; color: var(--accent); }
.linklike { background: none; border: none; color: var(--accent); text-decoration: underline; margin-top: 10px; cursor: pointer; }

/* 會前備忘 */
.memo h3 { margin: 14px 0 6px; font-size: 15px; }
.memo h3:first-child { margin-top: 0; }
.memo p, .memo ul { margin: 4px 0; }
.pmlist { margin: 4px 0 10px; padding-left: 20px; }
.pmlist li { padding: 2px 0; }
.pmlist li.late { color: var(--warn); }
.plan { padding: 4px 0; }

/* 問記憶庫 */
.ask .q { margin-top: 12px; font-weight: 600; }
.ask .q::before { content: "Q　"; color: var(--accent); }
.ask .a { margin-top: 4px; padding-left: 10px; border-left: 3px solid var(--line); }
.ask .steps { font-size: 13px; }
a.cite { font-size: 12px; padding: 0 4px; border-radius: 4px; background: var(--soft); text-decoration: none; }

/* 登入 */
.auth { max-width: 420px; margin: 40px auto; }
