:root {
  --bg1: #1b1f4b;
  --bg2: #3a2f6b;
  --card: #ffffff;
  --ink: #2b2d42;
  --muted: #6b6f8a;
  --accent: #ffb347;
  --accent-ink: #4a2d00;
  --radius: 18px;
  --map: #ffb347;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, #4b3f8f 0, transparent 40%),
              radial-gradient(circle at 80% 30%, #2d5a8f 0, transparent 35%),
              linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  line-height: 1.7;
  font-size: 18px;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 30% 70%, #fff6, transparent),
    radial-gradient(2px 2px at 55% 15%, #fff7, transparent),
    radial-gradient(1px 1px at 75% 55%, #fff8, transparent),
    radial-gradient(2px 2px at 90% 85%, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 45% 90%, #fff5, transparent);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  max-width: 960px; margin: 0 auto; padding: 18px 20px;
  color: #fff;
}
.logo { font-size: 1.3rem; font-weight: 800; text-decoration: none; }
.site-header nav a {
  color: #fff; text-decoration: none; margin-left: 16px; opacity: .9;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] { opacity: 1; text-decoration: underline; }

main { max-width: 960px; margin: 0 auto; padding: 0 20px 48px; }

.parent-note {
  background: #fff3cd; color: #5c4400;
  border-radius: 12px; padding: 10px 16px; margin-bottom: 20px;
  font-size: .95rem;
}

.hero {
  background: var(--card); border-radius: var(--radius);
  padding: 28px; margin-bottom: 24px;
  box-shadow: 0 10px 30px #0003;
}
.hero h1 { margin: 0 0 8px; font-size: 1.9rem; }
.hero p { margin: 6px 0; }

.question-title { color: #fff; font-size: 1.35rem; margin: 8px 0 16px; }

.map-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.map-card {
  display: block; text-decoration: none;
  background: var(--card); border-radius: var(--radius);
  padding: 20px; border-top: 8px solid var(--c, var(--accent));
  box-shadow: 0 6px 18px #0003;
  transition: transform .15s ease, box-shadow .15s ease;
}
.map-card:hover, .map-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 26px #0004; }
.map-card .icon { font-size: 2.4rem; }
.map-card h2 { margin: 6px 0 2px; font-size: 1.3rem; }
.map-card p { margin: 0; color: var(--muted); }
.map-card.random { background: linear-gradient(135deg, #fff, #f1ebff); }

.panel {
  background: var(--card); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 10px 30px #0003;
  border-top: 8px solid var(--map);
}
.panel h1, .panel h2 { margin-top: 0; }

.stage-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; padding: 0; list-style: none;
}
.stage-bar li {
  font-size: .85rem; padding: 4px 12px; border-radius: 999px;
  background: #ffffff26; color: #fff;
}
.stage-bar li.active { background: var(--map); color: #1b1b1b; font-weight: 700; }
.stage-bar li.done { background: #ffffff55; }

.map-heading { color: #fff; display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; }
.map-heading .icon { font-size: 2.6rem; }
.map-heading h1 { margin: 0; font-size: 1.7rem; }
.map-heading p { margin: 0; opacity: .85; }

.q-count { color: var(--muted); font-size: .95rem; margin: 0 0 6px; }
.q-text { font-size: 1.35rem; font-weight: 700; margin: 0 0 14px; }

.feedback {
  background: #eef8ee; color: #245a24; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px;
}

textarea, input[type="text"] {
  width: 100%; font: inherit; color: inherit;
  border: 2px solid #d9dcef; border-radius: 12px;
  padding: 12px; background: #fbfbff;
}
textarea { min-height: 96px; resize: vertical; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--map); background: #fff; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.btn {
  font: inherit; cursor: pointer;
  border: none; border-radius: 999px;
  padding: 10px 20px; font-weight: 700;
  background: #eceefa; color: var(--ink);
  text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(.96); }
.btn:focus-visible { outline: 3px solid var(--map); outline-offset: 2px; }
.btn.primary { background: var(--map); color: #1b1b1b; }
.btn.ghost { background: transparent; border: 2px solid #d9dcef; }

.examples {
  margin-top: 14px; padding: 14px; border-radius: 12px; background: #f5f2ff;
}
.examples p { margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .95rem; cursor: pointer;
  border: 2px solid #d6ccff; background: #fff; border-radius: 999px; padding: 6px 14px;
}
.chip:hover { border-color: var(--map); }

.hint { color: var(--muted); font-size: .95rem; }
.warn { color: #9a3b00; font-size: .95rem; margin: 8px 0 0; }

.said-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.said-list button {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: #f7f7fc; border: 2px solid #e4e6f5; border-radius: 12px; padding: 10px 14px;
}
.said-list button:hover { border-color: var(--map); }
.said-list small { display: block; color: var(--muted); }

.discovery { margin-bottom: 14px; }
.discovery label, .card-field label { font-weight: 700; display: block; margin-bottom: 6px; }

.option-list { display: grid; gap: 10px; margin-bottom: 12px; }
.option {
  display: flex; gap: 10px; align-items: flex-start;
  border: 2px solid #e4e6f5; border-radius: 12px; padding: 12px 14px; cursor: pointer;
}
.option:has(input:checked) { border-color: var(--map); background: #fffaf0; }
.option input { margin-top: 6px; }

.explore-card {
  border: 3px dashed var(--map); border-radius: var(--radius);
  padding: 20px; background: #fffdf7;
}
.explore-card h2 { text-align: center; margin: 0 0 14px; }
.card-field { margin-bottom: 14px; }

.casel-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0 !important; }
.casel-tag {
  font-size: .78rem; padding: 2px 10px; border-radius: 999px;
  background: #ffffff; color: #3a2f6b; font-weight: 700; opacity: 1;
}
.map-card .casel-tag { background: #f1ebff; }
.map-card .casel-tags { margin-top: 10px !important; }

.safety-note {
  margin: 18px 0 0; padding: 12px 14px; border-radius: 12px;
  background: #eef5ff; color: #23466e; font-size: .95rem;
}

.casel-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .95rem; }
.casel-table th, .casel-table td { border: 1px solid #e4e6f5; padding: 8px 10px; text-align: left; vertical-align: top; }
.casel-table th { background: #f5f2ff; }
.table-wrap { overflow-x: auto; }
.refs li { margin-bottom: 6px; font-size: .92rem; }
.callout { background: #fff4f1; border-radius: 12px; padding: 12px 16px; }

.rest { text-align: center; padding: 20px 0; }
.rest .moon { font-size: 4rem; }

.info h2 { margin-top: 28px; }
.info ul { padding-left: 1.3em; }

.site-footer { text-align: center; color: #fffc; font-size: .9rem; padding: 0 20px 30px; }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .hero, .panel { padding: 20px; }
  .site-header nav a { margin-left: 10px; }
}

@media print {
  body { background: #fff; }
  body::before, .site-header, .site-footer, .parent-note, .stage-bar,
  .map-heading, .no-print, .actions { display: none !important; }
  .panel { box-shadow: none; border: none; padding: 0; }
  textarea, input[type="text"] { border: 1px solid #999; background: #fff; }
}
