/* 心算日課招募頁（2026-10-27 改成 App 自己的「計算紙」風格，不再用多益產生器的樣式）。
   方格計算紙底、白色直角卡片細框、墨色實心按鈕、朱紅左邊條標題、IBM Plex Mono 數字、紅圈印章，色票照 design/Spec.kt（Light／Dark）。
   App 規則：不用漸層、毛玻璃、emoji 圖示（方格線是紙的紋路，不算裝飾漸層）。
   之後別再用 ToeicApp/tools/join-gen/gen.mjs 覆蓋這份 css；步驟、文案有改時手動同步 index.html 與 en/index.html。 */
:root {
  color-scheme: light;
  --ground: #F5F2E9; --surface: #FDFBF6; --grid: #E2DCCB; --ink: #1C2230; --on-ink: #F5F2E9;
  --muted: #5C6170; --rule: #C9C2B1; --accent: #C63F2B; --accent-txt: #B23A27; --good: #2B7A5B; --track: #E2DCCB;
  --imp-bg: #FBEDE8; --ok: var(--good); --alert: var(--accent-txt);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #171A20; --surface: #1F232B; --grid: #252A34; --ink: #E8E4D8; --on-ink: #171A20;
    --muted: #A9ADB8; --rule: #3A404C; --accent: #E06A55; --accent-txt: #F08872; --good: #5CB890; --track: #2A2F3A;
    --imp-bg: #2E2023;
  }
}
* { box-sizing: border-box; }
html { background: var(--ground); }
body {
  margin: 0; overflow-wrap: anywhere; color: var(--ink);
  font: 17px/1.75 "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background-color: var(--ground);
  /* 計算紙方格 */
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px;
}
main { max-width: 640px; margin: 0 auto; padding: 28px 16px 80px; }
.mono, .num { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; }
b { font-weight: 700; }
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* 標題區：日期列、粗黑大標、算式、紅圈印章 */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 4px 0 20px; }
.top > div:first-child { flex: 1; min-width: 0; }
.kicker { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .06em; }
h1, h2, .line h3 { line-height: 1.35; }
html[lang="zh-Hant"] h1 { word-break: keep-all; }
h1 { font-size: 34px; font-weight: 900; margin: 6px 0 10px; letter-spacing: .02em; }
.lead { color: var(--muted); margin: 0; }
/* 算式卡：像練習畫面的題目，紅色等號底線 */
.eq { display: inline-flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; padding: 6px 16px 8px; background: var(--surface); border: 1px solid var(--rule);
  font: 600 30px/1.3 "IBM Plex Mono", ui-monospace, monospace; }
.eq i { font-style: normal; color: var(--muted); }
.eq u { text-decoration: none; color: var(--accent); border-bottom: 3px solid var(--accent); padding: 0 4px; }
.eq small { font: 700 16px "Noto Sans TC", sans-serif; color: var(--muted); }
/* 紅圈印章（App 的蓋章月曆） */
.stamp { flex: none; width: 92px; height: 92px; margin-top: 26px; border-radius: 50%; transform: rotate(-10deg);
  border: 3px solid var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4.5px var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  color: var(--accent-txt); font-weight: 700; font-size: 13px; line-height: 1.15; background: var(--surface); }
.stamp b { font: 700 30px/1.05 "IBM Plex Mono", ui-monospace, monospace; }

/* 段落標題：朱紅左邊條（App 的區塊標題） */
h2 { font-size: 22px; font-weight: 900; margin: 40px 0 12px; padding-left: 12px; border-left: 5px solid var(--accent); }

/* 白色直角卡片、細框 */
.reward, form, .line, .note-box, .steps li, details { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 0; }
.reward { padding: 18px 20px; margin: 18px 0; font-size: 18px; border-top: 4px solid var(--ink); }
.reward b { color: var(--accent-txt); font-size: 20px; white-space: nowrap; }
.note-box { padding: 12px 16px; font-size: 16px; }
.line { padding: 16px; margin-top: 16px; }
.line h3 { margin: 0 0 6px; font-size: 18px; }
.line p { margin: 6px 0; }

/* App 畫面：細框手機截圖 */
.shots { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scroll-padding-left: 2px;
  scrollbar-color: var(--rule) transparent; }
.shots figure { flex: none; width: 168px; margin: 0; scroll-snap-align: start; text-align: center; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); background: var(--surface); }
figcaption { font-size: 15px; color: var(--muted); margin-top: 8px; }

/* 步驟：方框數字 01、02（App 的心算技巧清單） */
ol, ul { padding-left: 1.3em; margin: 8px 0; }
li { margin: 6px 0; }
ul li::marker { color: var(--accent); }
.steps { list-style: none; counter-reset: st; padding: 0; }
.steps li { counter-increment: st; padding: 14px 16px 14px 64px; margin: 12px 0; }
.steps li::before { content: counter(st, decimal-leading-zero); position: absolute; left: 16px; top: 14px;
  font: 600 22px/1.3 "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); }
.steps li p { margin: 10px 0 0; }
.steps .btn { width: 100%; }

/* 按鈕：墨色實心直角（App 的「開始今日練習」） */
.btn, button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 8px 18px;
  border-radius: 0; font-family: inherit; font-weight: 700; font-size: 17px; line-height: 1.3; text-decoration: none; cursor: pointer;
  color: var(--on-ink); background: var(--ink); border: 1px solid var(--ink); transition: transform .08s; }
.btn:active, button:active:not(:disabled) { transform: translateY(2px); }
.btn.dark { color: var(--on-ink); background: var(--ink); }
button { width: 100%; margin-top: 10px; }
#go { font-size: 18px; min-height: 54px; }
button:disabled { opacity: .5; cursor: default; }
.gbtn { background: var(--surface); color: var(--ink); border: 1px solid var(--ink); font-weight: 500; margin: 0 0 4px; }

/* 表單 */
form { padding: 24px 18px; margin-top: 12px; border-top: 4px solid var(--ink); }
label { display: block; font-weight: 700; margin-bottom: 4px; }
input[type=email] { width: 100%; min-height: 50px; padding: 8px 12px; font: 17px "IBM Plex Mono", ui-monospace, Consolas, monospace;
  background: var(--ground); color: var(--ink); border: 1px solid var(--ink); border-radius: 0; }
input[type=email]::placeholder { color: var(--muted); }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .shots:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
#stepsDone:focus-visible { outline: 3px solid var(--good); outline-offset: 2px; }
input[aria-invalid="true"] { border: 2px solid var(--accent); }
.hint { font-size: 15px; color: var(--muted); margin: 6px 0 16px; }
fieldset { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.opt { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 4px 0; min-height: 40px; }
.opt input, .check input { width: 22px; height: 22px; flex: none; accent-color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; font-weight: 400; }
.check input { margin-top: 4px; }
.opt.off { opacity: .45; }
.msg { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--rule); display: none; }
.msg.show { display: block; }
.msg.ok { border-color: var(--good); color: var(--good); font-weight: 700; }
.msg.err { border-color: var(--accent-txt); color: var(--accent-txt); }
.hp { position: absolute; left: -9999px; }
.kw { color: var(--accent-txt); font-weight: 700; }
.slots { margin: 0 0 12px; font-weight: 700; }
.slots.full { color: var(--accent-txt); border: 1px solid var(--accent-txt); padding: 8px 12px; }

/* 常見問題 */
details { margin: 10px 0; padding: 0 16px; }
summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
summary::marker { color: var(--accent); }
details p { margin: 0 0 12px; }

footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); text-align: center; }
footer a { color: var(--muted); }
.lang { float: right; font-size: 15px; font-weight: 700; margin: 0 0 8px 12px; padding: 4px 12px; border: 1px solid var(--ink); background: var(--surface); text-decoration: none; }
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20;
  width: auto; min-width: 56px; min-height: 44px; margin: 0; padding: 8px 14px; font: 600 14px "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .08em; }

/* 重要提示：朱紅粗框 */
.note-box.important { background: var(--imp-bg); border: 2px solid var(--accent); border-left-width: 8px; font-weight: 500; }
.note-box.important b { color: var(--accent-txt); }
.note-box .imp { display: inline-block; background: var(--accent); color: #FFF; font-size: 14px; font-weight: 700;
  line-height: 1.5; padding: 0 8px; margin-right: 4px; vertical-align: 1px; }
@media (prefers-color-scheme: dark) { .note-box .imp { color: #171A20; } }
.note-box.done { border: 2px solid var(--good); font-weight: 700; margin: 0 0 8px; }

/* 螢幕閱讀器、鍵盤 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 30; padding: 10px 16px; background: var(--ink); color: var(--on-ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

@media (max-width: 480px) {
  h1 { font-size: 28px; }
  .eq { font-size: 24px; }
  .stamp { width: 72px; height: 72px; margin-top: 32px; font-size: 11px; } .stamp b { font-size: 23px; }
  .shots figure { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, button { transition: none; } }
.email-warn { background: color-mix(in srgb, var(--accent-txt) 10%, transparent); border: 2px solid var(--accent-txt); border-radius: 10px; padding: 10px 14px; margin: 4px 0 16px; font-size: 16px; font-weight: 500; }

/* 沒填或沒勾的那一組：紅框從外面收進來、晃一下、再閃三下；錯誤訊息也用提醒色（2026-10-28 使用者：未勾同意很不明顯） */
.attn { outline: 3px solid var(--alert, var(--accent)); outline-offset: 6px; border-radius: 8px;
  background: color-mix(in srgb, var(--alert, var(--accent)) 10%, transparent);
  animation: attn-in .35s ease-out, attn-shake .4s ease-in-out .35s, attn-blink .7s ease-in-out .75s 3; }
@keyframes attn-in { from { outline-offset: 18px; outline-color: transparent; } }
@keyframes attn-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes attn-blink { 50% { outline-color: color-mix(in srgb, var(--alert, var(--accent)) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .attn { animation: none; } }
.msg.err { border-color: var(--alert, var(--accent)); color: var(--alert, var(--accent)); border-width: 2px; font-weight: 700; }

/* 封測進度（第幾天、截止、正式版上架；2026-10-28 使用者） */
.test-status { border: 2px solid var(--ok, var(--accent)); border-radius: 10px; padding: 12px 14px; margin: 16px 0;
  background: color-mix(in srgb, var(--ok, var(--accent)) 8%, transparent); }
.test-status.ended { border-color: var(--alert, var(--accent)); background: color-mix(in srgb, var(--alert, var(--accent)) 8%, transparent); }
.test-status p { margin: 0; }
.test-status .ts-main { font-weight: 700; font-size: 17px; }
.test-status .ts-sub { margin-top: 6px; }
.test-status .btn { margin-top: 10px; }
.ts-bar { height: 10px; border-radius: 5px; margin: 10px 0 2px; overflow: hidden; background: color-mix(in srgb, currentColor 14%, transparent); }
.ts-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok, var(--accent)); transform-origin: left; animation: ts-grow .9s ease-out; }
@keyframes ts-grow { from { transform: scaleX(0); } }
.test-status.appear { animation: ts-in .28s ease-out; }
@keyframes ts-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .ts-bar i, .test-status.appear { animation: none; } }

.msg.field-err { margin: 8px 0 6px; }

/* 重點小卡（2026-10-28 使用者：招募頁說明改成重點式） */
.facts { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; }
.facts li { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; animation: ts-in .28s ease-out backwards; }
.facts li:nth-child(2) { animation-delay: .05s; } .facts li:nth-child(3) { animation-delay: .1s; } .facts li:nth-child(4) { animation-delay: .15s; } .facts li:nth-child(5) { animation-delay: .2s; } .facts li:nth-child(6) { animation-delay: .25s; }
.facts .ic { grid-row: span 2; font-size: 22px; line-height: 1.2; }
.facts b { font-size: 15px; }
.facts span:last-child { font-size: 14px; color: var(--muted); line-height: 1.45; }
.brief { padding-left: 20px; margin: 8px 0 16px; }
.brief li { margin: 4px 0; }
@media (prefers-reduced-motion: reduce) { .facts li { animation: none; } }
/* 重點小卡套這一頁的配色 */
.facts li { background: var(--surface); border-radius: 0; }
