:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #6c6c70;
  --border: #e5e5ea;
  --tile-correct: #6aaa64;
  --tile-present: #c9b458;
  --tile-absent: #787c7e;
  --accent: #1c1c1e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --border: #2c2c2e;
    --accent: #f5f5f7;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 64px 20px 40px;
}

.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: block;
  margin: 0 auto 20px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
  font-family: -apple-system, "SF Pro Rounded", "PingFang SC", system-ui, sans-serif;
}

.hero-tagline {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.cta:hover {
  text-decoration: none;
  transform: translateY(-1px);
  opacity: 0.92;
}

@media (prefers-color-scheme: dark) {
  .cta { color: #000; }
}

/* ===== Demo Board ===== */
.demo {
  margin: 16px auto 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.demo-word {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.demo-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

.board {
  display: grid;
  grid-template-rows: repeat(4, auto);
  gap: 6px;
}

.row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.tile {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 6px;
  color: #fff;
  background: var(--border);
}

.tile.empty {
  background: transparent;
  border: 2px solid var(--border);
  color: transparent;
}

.tile.correct { background: var(--tile-correct); }
.tile.present { background: var(--tile-present); }
.tile.absent  { background: var(--tile-absent); }

.tile.small {
  width: 16px;
  height: 16px;
  font-size: 9px;
  font-weight: 800;
  border-radius: 3px;
}

@media (max-width: 420px) {
  .tile { width: 40px; height: 40px; font-size: 18px; }
  .tile.small { width: 14px; height: 14px; font-size: 8px; border-radius: 2.5px; }
}

/* ===== Section ===== */
.section {
  padding: 40px 0;
}

.section h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 24px;
  text-align: center;
}

/* ===== Features ===== */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.feature {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.feature-emoji {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}

.feature p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .features {
    grid-template-columns: 1fr;
  }
}

/* ===== Samples ===== */
.samples {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 16px;
}

.sample {
  text-align: center;
}

.sample-word {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sample-pinyin {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sample-difficulty {
  font-size: 12px;
  margin-top: 2px;
}

@media (max-width: 520px) {
  .samples { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 64px;
  padding: 72px 20px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-tiles {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 28px 20px 32px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  font-size: 14px;
  font-weight: 500;
}

.footer-nav a {
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.footer-nav a:hover {
  text-decoration: none;
  background: var(--border);
}

.footer-legal {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 540px;
}

.footer-legal a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.footer-legal a:hover {
  color: var(--text);
  text-decoration: none;
}

.footer-legal .sep {
  opacity: 0.45;
  user-select: none;
}

@media (max-width: 520px) {
  .site-footer {
    padding: 56px 20px 0;
    margin-top: 40px;
  }
  .footer-tiles {
    margin: 0;
    padding: 24px 20px 28px;
  }
  .footer-legal .sep { display: none; }
  .footer-legal {
    flex-direction: column;
    gap: 2px;
  }
}

/* ===== Privacy page ===== */
.privacy {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  margin: 32px 0;
}

.privacy h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}

.privacy .meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.privacy h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.privacy p,
.privacy li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}

.privacy ul {
  padding-left: 20px;
  margin: 8px 0 12px;
}

.privacy a {
  color: var(--text);
  text-decoration: underline;
}

.privacy strong {
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin: 24px 0 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

@media (max-width: 520px) {
  .privacy { padding: 24px 18px; }
  .hero { padding: 48px 20px 32px; }
  .hero h1 { font-size: 36px; }
}
