:root {
  --bg: #f4f6f4; --card: #fff; --ink: #1b1f1c; --muted: #66706a;
  --green: #1f6f43; --green-soft: #e3f1e8; --red: #b3261e; --line: #dfe5e0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121513; --card: #1c211e; --ink: #e8ece9; --muted: #9aa59e;
    --green: #4cb27a; --green-soft: #1f3328; --red: #ff8a80; --line: #2c342f; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--green); color: #fff; }
header .title { font-weight: 700; }
header .who { font-size: 14px; opacity: .9; }
main { padding: 14px 16px 120px; max-width: 640px; margin: 0 auto; }
h2 { font-size: 18px; margin: 18px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
button, .btn { display: block; width: 100%; min-height: 50px; margin: 8px 0; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.99); }
button.primary { background: var(--green); color: #fff; border-color: var(--green); text-align: center; font-weight: 700; }
button.soft { background: var(--green-soft); border-color: transparent; }
button.danger { color: var(--red); }
button.small { min-height: 38px; padding: 6px 10px; font-size: 15px; width: auto; display: inline-block; margin: 4px 6px 4px 0; }
button:disabled { opacity: .5; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.big3 button { text-align: center; font-size: 16px; min-height: 76px; }
input[type=text] { width: 100%; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; text-align: center; word-break: break-all; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .bar { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--green); }
.thumb .x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; min-height: 0; margin: 0; padding: 0;
  border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; text-align: center; font-size: 14px; }
.thumb.done::after { content: "✓"; position: absolute; top: 2px; left: 4px; color: #fff; text-shadow: 0 0 3px #000; font-weight: 700; }
.thumb.err { outline: 3px solid var(--red); }
.crumb { font-size: 15px; color: var(--muted); margin: 4px 0 6px; word-break: break-all; }
.chips button { display: inline-block; width: auto; min-height: 40px; margin: 4px 6px 4px 0; padding: 6px 14px; text-align: center; }
.chips button.on { background: var(--green); color: #fff; border-color: var(--green); }
.status { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); font-size: 15px; z-index: 6; }
.status .meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.status .meter div { height: 100%; background: var(--green); width: 0; transition: width .3s; }
.ok { color: var(--green); font-weight: 700; }
.bad { color: var(--red); }
.linkbox { word-break: break-all; font-size: 14px; background: var(--bg); padding: 8px; border-radius: 8px; }
