﻿:root {
  --bg: #f7f3ea;
  --paper: #fffdf8;
  --ink: #1f2933;
  --muted: #637083;
  --line: #d9dfd8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --gold: #b7791f;
  --good: #15803d;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.site-nav a {
  border: 1px solid #d8b58d;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: #fff8e8;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.intro {
  max-width: 440px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.score-pill,
.mode-row span {
  flex: 0 0 auto;
  border: 1px solid #ead9b7;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--gold);
  background: #fff8e8;
  font-size: 13px;
  font-weight: 800;
}

.quiz-card,
.lookup-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

.quiz-card { padding: 14px; }

.mode-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.visual-card {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px solid #ead9b7;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff8e8, #ffffff);
  font-size: clamp(42px, 14vw, 68px);
  text-align: center;
  line-height: 1.1;
  padding: 12px;
}

.clue {
  margin: 14px 0 10px;
  color: var(--ink);
  font-weight: 700;
}

.hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px dashed #9bd2ca;
  border-radius: 8px;
  color: var(--accent-dark);
  background: #eefaf8;
  font-weight: 700;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid #9bd2ca;
  border-radius: 8px;
  padding: 8px;
  color: var(--accent-dark);
  background: #eefaf8;
  font-weight: 850;
  text-align: center;
}

.choice.correct { color: #fff; background: var(--good); border-color: var(--good); }
.choice.wrong { color: #fff; background: var(--bad); border-color: var(--bad); }
.choice:disabled { opacity: 0.95; }

.feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f5efe4;
}

.feedback strong { display: block; margin-bottom: 4px; }
.feedback p { margin: 0 0 8px; color: var(--muted); }
.feedback a { color: var(--accent-dark); font-weight: 800; }

.controls {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px -4px 14px;
  padding: 8px 4px max(8px, env(safe-area-inset-bottom));
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(10px);
}

.controls button,
.lookup-row button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
}

.lookup-panel,
.guide-panel,
.faq-panel,
.related-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

.guide-panel h2,
.faq-panel h2,
.related-panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.guide-panel p,
.faq-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.guide-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.guide-grid article {
  border: 1px solid #ead9b7;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff8e8;
}

.guide-grid h3 {
  margin: 0 0 5px;
  color: var(--accent-dark);
  font-size: 15px;
  line-height: 1.2;
}

.faq-panel details {
  border-top: 1px solid #ead9b7;
  padding: 10px 0;
}

.faq-panel details:first-of-type {
  border-top: 0;
}

.faq-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.faq-panel details p {
  margin-top: 7px;
}

.related-panel { padding: 14px; }
.lookup-panel label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 850; }
.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.lookup-row input { min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; color: var(--ink); }
.lookup-results { display: grid; gap: 10px; margin-top: 12px; }
.lookup-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; }
.lookup-card h2 { margin: 0 0 2px; font-size: 24px; }
.lookup-card p { margin: 4px 0; color: var(--muted); }
.lookup-card a { color: var(--accent-dark); font-weight: 850; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  font-size: 13px;
}
.footer-links a { color: var(--accent-dark); font-weight: 800; }

@media (max-width: 360px) {
  .choices { grid-template-columns: 1fr; }
  .controls { grid-template-columns: 1fr 1fr; }
}


.choice-hanzi,
.choice-pinyin {
  display: block;
}

.choice-hanzi {
  font-size: 18px;
  line-height: 1.15;
}

.choice-pinyin {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.choice.correct .choice-pinyin,
.choice.wrong .choice-pinyin {
  color: rgba(255, 255, 255, 0.86);
}





/* 20260710 landing copy layout polish */
.lookup-panel,
.guide-panel,
.faq-panel,
.related-panel {
  padding: 18px;
}

.guide-panel,
.faq-panel,
.related-panel {
  overflow: hidden;
}

.guide-panel h2,
.faq-panel h2,
.related-panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.22;
}

.guide-panel > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.guide-grid {
  gap: 12px;
  margin-top: 0;
}

.guide-grid article {
  padding: 14px 15px;
}

.guide-grid h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.guide-grid p {
  font-size: 14px;
  line-height: 1.52;
}

.faq-panel details {
  border-top: 1px solid #ead9b7;
  padding: 12px 0;
}

.faq-panel details:first-of-type {
  border-top: 0;
}

.faq-panel summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.3;
}

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

.faq-panel summary::before {
  content: "+";
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.faq-panel details[open] summary::before {
  content: "-";
}

.faq-panel details p {
  margin: 9px 0 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.related-grid {
  display: grid;
  gap: 10px;
}

.related-grid a {
  display: grid;
  gap: 4px;
  border: 1px solid #ead9b7;
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff8e8;
  text-decoration: none;
}

.related-grid a:hover {
  border-color: #d8b58d;
  background: #fff4dc;
}

.related-grid strong {
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
}

.related-grid span {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
  text-decoration: none;
}

@media (min-width: 560px) {
  .related-grid {
    grid-template-columns: 1fr 1fr;
  }
}
