/* 標題字型：源流明體（ButTaiwan，SIL OFL），只子集 h1/h2 字元
   改標題文字後重跑 projects/taiwanize/scripts/build_font.py */
@font-face {
  font-family: "GenRyuMin TW";
  src: url("../fonts/GenRyuMin2TW-B-subset.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fff;
  --card: #fff;
  --ink: #000;
  --muted: #666;
  --accent: #2D6A4F;
  --line: #E5E5E5;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }

html { overflow-x: clip; }

/* 滑鼠點擊不畫 focus 框，鍵盤 Tab 仍有（a11y） */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body {
  font: 16px/1.6 "Noto Sans TC", system-ui, sans-serif;
  background: #fff;
  background-image: radial-gradient(circle, rgba(45, 106, 79, 0.10) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--ink);
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}

/* 頂列：蘋果風磨砂玻璃——滿版 sticky（負邊距撐破 860 版心），半透明白＋backdrop blur
   只在手機顯示（桌機 h1 就在首屏，頂列多餘） */
.topbar {
  display: none;
}

@media (max-width: 560px) {
  .topbar { display: block; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -40px calc(50% - 50vw) 40px;
  padding: 12px max(24px, calc(50vw - 406px));
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

@supports not (backdrop-filter: blur(20px)) {
  .topbar { background: rgba(255, 255, 255, 0.95); }
}

.brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}

h1, h2 {
  font-family: "GenRyuMin TW", "Noto Sans TC", serif;
}

h1 {
  font-size: 2.3rem;
  font-weight: 700;
  margin: 0 0 16px;
  text-align: center;
}

mark {
  background: linear-gradient(transparent 55%, rgba(45, 106, 79, .35) 0);
  color: inherit;
  padding: 0 .08em;
}

.intro {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  text-align: left;
  margin: 0 auto 56px;
  max-width: 52em;
}

.intro p {
  margin: 0 0 8px;
}

.intro ul {
  margin: 0;
  padding-left: 1.5em;
}

.intro li {
  margin-bottom: 2px;
}

.panel {
  margin-bottom: 24px;
}

.panel-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

textarea {
  width: 100%;
  min-height: 240px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  font: inherit;
  line-height: 1.8;
  resize: vertical;
  transition: border-color 200ms ease;
  background: var(--card);
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 40px 0 32px;
}

button {
  font: inherit;
  cursor: pointer;
  min-height: 40px;
  padding: 9px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  transition: all 200ms ease;
}

button:hover {
  border-color: var(--accent);
}

button:active {
  transform: scale(0.97);
}

/* 推薦模式：預設就帶主色框 */
button.recommended {
  border-color: var(--accent);
  color: var(--accent);
}

button.go {
  background: var(--accent);
  color: #fff;
  border: none;
}

button.go:hover {
  opacity: 0.85;
}

.marker-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--muted);
}

.marker-row input {
  width: 60px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font: inherit;
  font-size: 14px;
}

.marker-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* 輸出 label 行：左標籤、右發現筆數 */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.stats {
  font-size: 13px;
  color: var(--muted);
}

.stats .num {
  color: var(--accent);
  font-weight: 700;
}

/* 工具下方 SEO 正文：標題置中、內文靠左 */
.landing-body {
  max-width: 52em;
  margin: 96px auto 72px;
  text-align: left;
}

.landing-body h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 16px;
  text-align: center;
}

.landing-body p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.9;
  margin: 0 0 16px;
}

.landing-body a {
  color: var(--accent);
  text-decoration: none;
}

.landing-body a:hover {
  text-decoration: underline;
}

/* FAQ：編號手風琴（CSS counter 生序號，配 FAQPage schema） */
.faq {
  counter-reset: faq;
  max-width: 52em;
  margin: 0 auto;
  padding: 24px 0 0;
  text-align: left;
}

.faq h2 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 32px;
}

.faq details {
  counter-increment: faq;
  padding: 4px 0;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: counter(faq, decimal-leading-zero);
  flex: none;
  width: 1.6em;
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}

.faq summary h3 {
  flex: 1;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.7;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.15;
  color: var(--accent);
  transition: transform 200ms ease;
}

.faq details[open] summary { color: var(--accent); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }

.faq details p {
  margin: 0;
  padding: 0 4px 22px;
  padding-left: calc(1.6em + 16px + 4px);
  color: var(--muted);
  line-height: 2;
  font-size: 15px;
  overflow-wrap: break-word;
}

.faq details a {
  color: var(--accent);
  text-decoration: none;
}

.faq details a:hover {
  text-decoration: underline;
}

.updated {
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  margin: 48px 0 0;
}

footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.footlinks {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 8px;
}

.footlinks a {
  color: var(--muted);
  text-decoration: none;
}

.footlinks a:hover {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
