/* 球拍筆記選拍測驗 — 樣式（手機優先；桌面置中窄欄）
   顏色取自品牌 logo：奶油底、logo 黑、網球綠。 */
:root {
  --cream: #FAF6EF;
  --paper: #FFFFFF;
  --ink: #1F1F1F;
  --ink-2: #5F5B53;
  --rule: #E4DCCD;
  --ball: #C8D224;
  --warn: #FFF1C9;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.app {
  max-width: 460px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  padding: 22px 22px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.loading, .noscript { color: var(--ink-2); padding: 40px 0; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }

/* ---- 頁首 ---- */
.top { display: flex; align-items: center; gap: 10px; }
.top .logo { width: 46px; height: 36px; flex: none; display: flex; align-items: center; font-weight: 800; font-size: 12px; line-height: 1.1; }
.logo img, .hero-logo img, .mascot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.top .name { font-weight: 800; font-size: 16px; letter-spacing: .06em; }
.top .where { margin-left: auto; font-size: 13px; color: var(--ink-2); }

/* ---- 按鈕 ---- */
.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  border: 0; border-radius: 14px; padding: 17px 20px;
  background: var(--ink); color: var(--cream); font-weight: 700; font-size: 17px; letter-spacing: .04em;
}
.btn:hover { background: #000; }
.btn:active { transform: scale(.985); }
.btn.quiet { background: none; color: var(--ink); border: 1.5px solid var(--ink); padding: 14px 20px; font-size: 16px; }
.btn.quiet:hover { background: var(--ink); color: var(--cream); }
.text-btn { background: none; border: 0; padding: 10px 0; color: var(--ink-2); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule); }
.text-btn:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ---- 首頁 ---- */
.home { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 12px 0 24px; }
.hero-logo { width: 148px; height: 116px; margin-left: -6px; display: flex; align-items: center; font-weight: 800; }
.home .site { font-size: 15px; font-weight: 700; letter-spacing: .08em; margin-top: 18px; }
.home h1 { font-size: clamp(30px, 8.6vw, 40px); line-height: 1.22; font-weight: 900; letter-spacing: -.01em; margin: 10px 0 18px; }
.home .lead { font-size: 16px; color: var(--ink-2); max-width: 24em; }
.home .btn { margin-top: 30px; }
.home .small { margin-top: 16px; font-size: 13.5px; color: var(--ink-2); }

/* ---- 測驗 ---- */
.quiz { flex: 1; display: flex; flex-direction: column; }
.progress { margin-top: 26px; }
.steps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.steps i { height: 5px; border-radius: 3px; background: var(--rule); }
.steps i.done { background: var(--ink); }
.steps i.now { background: var(--ball); box-shadow: inset 0 0 0 1px var(--ink); }
.progress-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.progress-meta .countdown { color: var(--ink); font-weight: 800; }
.flash { margin-top: 18px; font-size: 14.5px; font-weight: 600; display: flex; gap: 9px; align-items: baseline; }
.flash::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ball); box-shadow: inset 0 0 0 1px var(--ink); flex: none; transform: translateY(-1px); }
.question { font-size: 29px; line-height: 1.3; font-weight: 900; margin: 26px 0 20px; }
.flash + .question { margin-top: 14px; }
.options { display: grid; gap: 10px; }
.option {
  width: 100%; text-align: left; background: var(--paper); border: 1.5px solid var(--rule); border-radius: 14px;
  padding: 17px 18px; font-size: 17px; font-weight: 600; line-height: 1.4;
  transition: border-color .12s, background .12s, color .12s;
}
.option:hover { border-color: var(--ink); }
.option:active, .option.selected { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.quiz-foot { margin-top: auto; padding-top: 24px; }

/* ---- 計算畫面 ---- */
.calc { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.calc ul { display: grid; gap: 14px; }
.calc li { font-size: 21px; font-weight: 800; line-height: 1.4; color: var(--rule); transition: color .2s; }
.calc li.on { color: var(--ink); }
.calc li.past { color: var(--ink-2); }
.calc .track { height: 5px; border-radius: 3px; background: var(--rule); margin-top: 30px; overflow: hidden; }
.calc .track i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; animation: fill 1.35s linear both; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- 結果頁 ---- */
.result-head { margin: 28px 0 16px; }
.result-head .kind { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.result-head h1 { font-size: 27px; line-height: 1.32; font-weight: 900; margin-top: 4px; }
.statement { font-size: 14.5px; line-height: 1.75; padding: 14px 16px; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; }
.answers { margin-top: 14px; font-size: 13.5px; color: var(--ink-2); }
.note { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; background: var(--warn); }

.pick { margin-top: 28px; }
.media {
  position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 4 / 3;
  background: var(--ph, #444); color: var(--ph-ink, #fff);
}
.media svg { position: absolute; right: -4%; top: -14%; height: 132%; width: auto; transform: rotate(24deg); opacity: .92; }
.media .ph-text { position: absolute; left: 18px; bottom: 16px; right: 42%; line-height: 1.2; }
.media .ph-brand { display: block; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.media .ph-model { display: block; font-size: 26px; font-weight: 900; margin-top: 2px; }
.media.has-img { background: var(--paper); border: 1px solid var(--rule); }
.media.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tagline { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.role { font-size: 13px; font-weight: 800; padding: 3px 9px; border-radius: 6px; background: var(--ball); }
.pick.alt .role { background: none; padding: 0; color: var(--ink-2); }
.over { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--warn); }
.pick h2 { font-size: 30px; line-height: 1.2; font-weight: 900; margin-top: 8px; }
.pick h2 span { display: block; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.blurb { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-top: 1.5px solid var(--ink); }
.specs div { padding: 10px 0 9px; border-bottom: 1px solid var(--rule); }
.specs div.wide { grid-column: 1 / -1; }
.specs dt { font-size: 12.5px; color: var(--ink-2); }
.specs dd { margin: 0; font-size: 24px; font-weight: 900; line-height: 1.25; font-variant-numeric: tabular-nums; }
.specs dd small { font-size: 13px; font-weight: 600; margin-left: 3px; }
.why { margin-top: 16px; }
.why h3 { font-size: 15px; font-weight: 800; }
.why li { font-size: 14.5px; line-height: 1.7; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.why li:last-child { border-bottom: 0; }
.why li b { font-weight: 800; }
.buy { margin-top: 12px; }
.debug { margin-top: 8px; font-size: 12px; color: var(--ink-2); }

.pick.alt { padding-top: 22px; border-top: 1.5px solid var(--ink); }
.alt-head { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; }
.pick.alt .media { aspect-ratio: 1; border-radius: 14px; }
.pick.alt .media svg { right: 8%; top: -6%; height: 112%; }
.pick.alt .media .ph-text { display: none; }
.pick.alt .tagline { margin-top: 0; }
.pick.alt h2 { font-size: 21px; margin-top: 4px; }
.pick.alt h2 span { font-size: 13px; }
.line-specs { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pick.alt .why { margin-top: 10px; }
.pick.alt .why li { font-size: 13.5px; padding: 7px 0; }

.section-title { font-size: 19px; font-weight: 900; margin: 34px 0 10px; padding-top: 22px; border-top: 1.5px solid var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 4px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; vertical-align: bottom; }
th:first-child, td:first-child { text-align: left; white-space: normal; padding-left: 0; min-width: 92px; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
td em { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); }
td strong { font-weight: 700; }
.tip { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.result-foot { margin-top: 28px; display: flex; gap: 14px; align-items: center; }
.result-foot .fineprint { flex: 1; font-size: 12.5px; line-height: 1.75; color: var(--ink-2); }
.mascot { width: 76px; height: 76px; flex: none; border-radius: 50%; overflow: hidden; font-size: 11px; color: var(--ink-2); display: flex; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--rule); }
.mascot.has-img { border: 0; }
.mascot img { object-fit: cover; }
.retry { margin-top: 22px; }
.error { margin: 40px 0; font-size: 15px; }
.error code { background: var(--rule); padding: 1px 6px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  .calc .track i { animation: none; }
  .option, .calc li { transition: none; }
}
