/* 暖色淺色、固定不跟系統變黑；大字、大按鈕、一次一步。 */
:root {
  color-scheme: light;
  --bg: #fff7ec;
  --card: #ffffff;
  --ink: #3b2a1e;
  --muted: #6e5848;
  --line: #ead9c4;
  --main: #b8481a;
  --main-ink: #ffffff;
  --main-press: #973a14;
  --soft: #fde9d5;
  --ok: #2f7a3d;
  --warn: #a33a1d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-size: 19px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

main, .top, .foot {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 頂端：名稱與 4 格進度 */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: 4px;
}
.brand { margin: 0; font-weight: 700; color: var(--main); }
.progress { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.progress li {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 700;
  background: var(--card); border: 2px solid var(--line); color: var(--muted);
}
.progress li.done { background: var(--soft); border-color: var(--main); color: var(--main); }
.progress li.now { background: var(--main); border-color: var(--main); color: var(--main-ink); }

/* 每一步 */
.step { padding-bottom: 24px; }
.step-no { margin: 16px 0 0; color: var(--muted); font-weight: 700; }
h1 { font-size: 1.75rem; line-height: 1.3; margin: 4px 0 8px; }
h2 { font-size: 1.25rem; margin: 28px 0 10px; }
.lead { margin: 0 0 16px; font-size: 1.05rem; }

/* 按鈕：最小 56px 高，整列寬 */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  min-height: 56px;
  margin: 12px 0 0;
  padding: 12px 20px;
  border-radius: 14px;
  border: 2px solid var(--main);
  font: inherit; font-size: 1.1rem; font-weight: 700;
  text-align: center; text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-main { background: var(--main); color: var(--main-ink); }
.btn-main:active { background: var(--main-press); }
.btn-sub { background: var(--card); color: var(--main); }
.btn-small { width: auto; min-height: 48px; margin: 6px 0 0; font-size: 1rem; background: var(--card); color: var(--main); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:focus-visible, .choice input:focus-visible + span { outline: 3px solid #1f5fbf; outline-offset: 2px; }

/* 選項：整塊可點 */
.choices { border: 0; margin: 0 0 8px; padding: 0; }
.choices legend { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; padding: 0; }
.choice { display: block; margin: 8px 0; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: flex; align-items: center;
  min-height: 56px; padding: 10px 16px 10px 52px;
  position: relative;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card);
  font-size: 1.1rem; cursor: pointer;
}
.choice span::before {
  content: ""; position: absolute; left: 16px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--muted); background: #fff;
}
.choice input:checked + span { border-color: var(--main); background: var(--soft); font-weight: 700; }
.choice input:checked + span::before { border-color: var(--main); background: var(--main); box-shadow: inset 0 0 0 4px #fff; }

.prompt {
  margin: 0; padding: 14px 16px;
  background: var(--card); border: 2px dashed var(--line); border-radius: 14px;
  font: inherit; font-size: 1rem; line-height: 1.7;
  white-space: pre-wrap;
}

/* 第 2 步 */
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-pick { margin: 0; background: var(--card); color: var(--main); }
.btn-pick[aria-pressed="true"] { background: var(--main); color: var(--main-ink); }
.card {
  margin-top: 16px; padding: 4px 16px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px;
}
.todo { padding-left: 1.4em; }
.todo li { margin: 8px 0; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { margin: 8px 0; padding-left: 1.6em; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

.help {
  margin-top: 16px; padding: 0 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px;
}
.help summary { min-height: 56px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.help[open] { padding-bottom: 12px; }
.fix { padding: 8px 0; border-top: 1px solid var(--line); }
.fix p { margin: 4px 0; }
.fix-text { color: var(--muted); }

/* 第 3 步 */
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.status { min-height: 1.6em; margin: 12px 0 0; font-weight: 700; }
.status.bad { color: var(--warn); }
.status.good { color: var(--ok); }
.stickers {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  margin: 12px 0 0; padding: 0; list-style: none;
}
.stickers li {
  border: 2px solid var(--line); border-radius: 12px; overflow: hidden;
  /* 棋盤格表示透明 */
  background: #fff conic-gradient(#efe6da 25%, #fff 0 50%, #efe6da 0 75%, #fff 0) 0 0 / 16px 16px;
}
.stickers img { display: block; width: 100%; height: auto; }
.stickers .num { display: block; padding: 2px 8px; background: var(--card); font-size: 0.85rem; color: var(--muted); }

/* 底部固定的上一步／下一步 */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  max-width: 560px; margin: 0 auto;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: rgba(255, 247, 236, 0.96);
  border-top: 2px solid var(--line);
}
.bar .btn { margin: 0; padding: 12px; white-space: nowrap; }

.foot { padding-bottom: 120px; color: var(--muted); font-size: 0.85rem; }
.foot a { color: var(--main); }
