:root {
  /* Align with HUAYI logo: blue #003080 + orange #e87800 */
  --bg: #f5f7fb;
  --ink: #14233f;
  --ink-soft: #3d4f6e;
  --muted: #6b7a95;
  --line: rgba(0, 48, 128, 0.12);
  --teal: #003080;
  --teal-deep: #002060;
  --teal-soft: #e7eef8;
  --amber: #e87800;
  --amber-soft: #fff1e0;
  --paper: rgba(255, 255, 255, 0.82);
  --ok: #1f8a6e;
  --bad: #c45c4a;
  --brand-blue: #003080;
  --brand-orange: #e87800;
  /* Source Han / Noto：SIL Open Font License，可商用 */
  --font-brand: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 40px rgba(0, 48, 128, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button.option, .options > .option {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  position: relative;
  /* 预留下方给「我的答案/正确答案」角标，避免与选项正文重叠 */
  padding: 14px 16px 30px 16px;
  border-radius: 14px;
  border: 1px solid var(--line) !important;
  background: #eef3fa !important;
  color: var(--ink) !important;
}
ul, ol { list-style: none; }

.atmosphere {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #eef2f9 0%, #f7f8fc 42%, #fff6ec 100%);
}
.wash { position: absolute; border-radius: 50%; filter: blur(8px); animation: drift 16s var(--ease) infinite alternate; }
.wash-a { width: 52vw; height: 52vw; left: -12vw; top: -10vw; background: radial-gradient(circle, rgba(0,48,128,0.14), transparent 68%); }
.wash-b { width: 44vw; height: 44vw; right: -10vw; top: 18vh; background: radial-gradient(circle, rgba(232,120,0,0.12), transparent 70%); animation-delay: -5s; }
.grid-fade {
  position: absolute; inset: 0; opacity: 0.35;
  background-image: linear-gradient(rgba(0,48,128,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,48,128,0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 20%, transparent 75%);
}
@keyframes drift { from { transform: translate3d(0,0,0) scale(1);} to { transform: translate3d(18px,28px,0) scale(1.06);} }

.shell { position: relative; z-index: 1; width: min(var(--max), 92vw); margin: 0 auto; padding: 22px 0 72px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(145deg, #0047a8, var(--teal-deep)); color: #f4fbfb;
  font-family: var(--font-brand); font-size: 1.2rem; box-shadow: 0 10px 24px rgba(0,48,128,0.22);
}
.brand h1 { font-family: var(--font-brand); font-size: clamp(1.25rem, 2.8vw, 1.7rem); color: var(--teal-deep); letter-spacing: 0.04em; line-height: 1.2; }
.brand p { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.hero-logo {
  width: min(120px, 28vw);
  height: auto;
  display: block;
  margin-bottom: 14px;
  object-fit: contain;
}
.stat-chip { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 0.84rem; color: var(--ink-soft); backdrop-filter: blur(8px); }
a.chip { text-decoration: none; color: var(--ink-soft); display: inline-flex; align-items: center; cursor: pointer; }
a.chip:hover { border-color: rgba(232,120,0,0.45); }
.chip strong { color: var(--amber); margin-left: 4px; }
.chip-inline { display: inline-flex; margin-bottom: 12px; }

.hero-panel {
  border-radius: 28px; padding: clamp(26px, 4vw, 42px); margin-bottom: 22px;
  border: 1px solid rgba(0,48,128,0.12);
  background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(231,237,248,0.9)), radial-gradient(circle at 88% 12%, rgba(232,120,0,0.14), transparent 42%);
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero-panel .eyebrow { display: inline-block; font-size: 0.78rem; letter-spacing: 0.16em; color: var(--teal); margin-bottom: 12px; }
.hero-panel h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.4rem); color: var(--teal-deep); line-height: 1.25; margin-bottom: 10px; }
.hero-panel .lead { max-width: 38em; color: var(--ink-soft); margin-bottom: 20px; }
.hero-brand { font-family: var(--font-brand); font-size: clamp(2rem, 4.5vw, 3rem); color: var(--teal-deep); letter-spacing: 0.04em; line-height: 1.15; margin-bottom: 6px; }
.hero-brand span { color: var(--amber); margin: 0 0.06em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-size: 0.95rem; font-weight: 500; transition: transform 0.25s var(--ease), background 0.25s ease, box-shadow 0.25s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary, .btn-solid { background: var(--teal); color: #f7fcfc; box-shadow: 0 12px 28px rgba(0,48,128,0.22); }
.btn-primary:hover, .btn-solid:hover { background: var(--teal-deep); }
.btn-gold { background: linear-gradient(135deg, #ff9a2e, var(--amber)); color: #2d1d05; box-shadow: 0 10px 24px rgba(232,120,0,0.25); }
.btn-ghost, .btn-line { border: 1px solid rgba(0,48,128,0.28); background: rgba(255,255,255,0.55); color: var(--teal-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.panel { border-radius: 22px; border: 1px solid rgba(0,48,128,0.1); background: var(--paper); backdrop-filter: blur(10px); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.panel h3 { font-family: var(--font-display); font-size: 1.35rem; color: var(--teal-deep); margin-bottom: 6px; }
.panel .sub { color: var(--muted); font-size: 0.94rem; margin-bottom: 14px; }

.nickname-box { display: flex; gap: 12px; flex-wrap: wrap; }
.nickname-box input, .nickname-box input[type="date"] { flex: 1; min-width: 200px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1rem; outline: none; }
.nickname-box input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,48,128,0.12); }

.progress-rail { height: 10px; border-radius: 999px; background: rgba(0,48,128,0.1); overflow: hidden; margin: 12px 0 6px; }
.progress-rail > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--amber)); transition: width 0.6s var(--ease); }

.gate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.gate-card { position: relative; border-radius: 20px; padding: 20px 18px; border: 1px solid rgba(0,48,128,0.12); background: linear-gradient(180deg, #fff, #f3f6fb); min-height: 220px; overflow: hidden; transition: transform 0.25s var(--ease), box-shadow 0.25s ease; cursor: pointer; }
.gate-card:hover:not(.locked) { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(0,48,128,0.14); }
.gate-card.locked { opacity: 0.58; cursor: not-allowed; filter: grayscale(0.25); }
.gate-card .book { width: 56px; height: 72px; border-radius: 6px 10px 10px 6px; margin-bottom: 14px; box-shadow: 5px 7px 0 rgba(22,48,58,0.08); animation: bookBob 3.2s ease-in-out infinite; position: relative; }
.gate-card .book::after { content: ''; position: absolute; inset: 8px 8px 8px auto; width: 4px; background: rgba(255,255,255,0.35); border-radius: 2px; }
@keyframes bookBob { 0%, 100% { transform: translateY(0) rotate(-2deg);} 50% { transform: translateY(-8px) rotate(2deg);} }
.gate1 .book { background: linear-gradient(160deg, #2f6fd1, #003080); }
.gate2 .book { background: linear-gradient(160deg, #4d7ec7, #002a70); }
.gate3 .book { background: linear-gradient(160deg, #ff9a2e, #e87800); }
.gate4 .book { background: linear-gradient(160deg, #ff7a33, #c45f00); }
.gate-card .tag { position: absolute; top: 14px; right: 14px; font-size: 0.72rem; padding: 4px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.gate-card.done .tag { color: var(--ok); border-color: rgba(31,138,110,0.35); }
.gate-card h4 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 8px; color: var(--ink); }
.gate-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.lock-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; background: rgba(243,247,249,0.55); backdrop-filter: blur(1px); color: var(--muted); }

.quiz-card, .scene-card, .lesson-card {
  border-radius: 18px; border: 1px solid rgba(0,48,128,0.12); background: #fff; padding: 18px; margin-bottom: 14px;
}
.quiz-card h4 { font-size: 1.05rem; margin-bottom: 6px; color: var(--ink); }
.lesson-card h4 { color: var(--teal); margin-bottom: 8px; font-family: var(--font-display); }
.lesson-card p, .scene-card p { color: var(--ink-soft); line-height: 1.7; font-size: 0.94rem; }

.options { display: grid; gap: 10px; margin-top: 14px; }
.option {
  text-align: left;
  padding: 14px 16px 30px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f5f7fb;
  transition: 0.2s;
  position: relative;
}
.option:hover { border-color: var(--teal); background: var(--teal-soft); }
.option.chosen {
  border-color: #e87800; background: rgba(232,120,0,0.14); box-shadow: inset 3px 0 0 #e87800;
}
/* 角标统一右下角，不覆盖选项正文 */
.option.chosen::after,
.option.correct::before,
.option.chosen.wrong::after,
.option.chosen.correct::after {
  position: absolute;
  right: 10px;
  bottom: 8px;
  left: auto;
  top: auto;
  max-width: calc(100% - 24px);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}
.option.chosen::after {
  content: '你的选择';
  color: #c45f00;
}
.option.correct { border-color: #1f8a6e; background: rgba(31,138,110,0.12); animation: pop 0.35s ease; }
.option.correct::before {
  content: '正确答案';
  color: #1f8a6e;
}
.option.chosen.correct::after { content: '我的答案·正确'; color: #1f8a6e; }
.option.chosen.correct::before { content: none; }
.option.wrong { border-color: var(--bad); background: rgba(196,92,74,0.12); animation: shake 0.4s ease; }
.option.chosen.wrong {
  border-color: var(--bad); background: rgba(196,92,74,0.16); box-shadow: inset 3px 0 0 var(--bad);
}
.option.chosen.wrong::after { content: '我的答案·错误'; color: #c45c4a; }
.answer-feedback {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 0.95rem; line-height: 1.55;
  color: var(--ink); background: rgba(0,48,128,0.04); border: 1px solid rgba(0,48,128,0.12);
}
.answer-feedback.ok { border-color: rgba(31,138,110,0.35); background: rgba(31,138,110,0.08); }
.answer-feedback.bad { border-color: rgba(196,92,74,0.35); background: rgba(196,92,74,0.08); }
.answer-feedback .ans { margin-top: 6px; font-weight: 700; color: #1f8a6e; }
.answer-feedback .picked { margin-top: 4px; font-weight: 700; }
.answer-feedback.ok .picked { color: #1f8a6e; }
.answer-feedback.bad .picked { color: #c45c4a; }
@keyframes pop { 0% { transform: scale(0.96);} 60% { transform: scale(1.03);} 100% { transform: scale(1);} }
@keyframes shake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-6px);} 75% { transform: translateX(6px);} }

.dialogue { display: grid; gap: 12px; }
.bubble { max-width: 88%; padding: 12px 16px; border-radius: 16px; line-height: 1.55; font-size: 0.94rem; animation: fadeUp 0.4s ease both; }
.bubble.npc { background: rgba(0,48,128,0.08); border: 1px solid rgba(0,48,128,0.18); border-bottom-left-radius: 4px; }
.bubble.me { margin-left: auto; background: rgba(232,120,0,0.12); border: 1px solid rgba(232,120,0,0.25); border-bottom-right-radius: 4px; }
.bubble.correct { border-color: var(--ok) !important; background: rgba(31,138,110,0.12) !important; }
.bubble.wrong { border-color: var(--bad) !important; background: rgba(196,92,74,0.1) !important; }
.bubble.chosen {
  border-color: #e87800 !important; background: rgba(232,120,0,0.14) !important;
  box-shadow: inset 3px 0 0 #e87800;
}
.bubble.picked { border-color: var(--teal) !important; background: rgba(0,48,128,0.08) !important; }
.video-overlay {
  position: fixed; inset: 0; z-index: 9999; background: #0f1724; display: flex; flex-direction: column;
}
.video-overlay .vbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: rgba(18,28,44,.96); border-bottom: 1px solid #243247; color: #e8eef8;
}
.video-overlay .vbar button {
  border: 0; background: #1f4f9c; color: #fff; border-radius: 8px; padding: 8px 12px; font: inherit;
}
.video-overlay .vtitle { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-overlay .vbody {
  flex: 1; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  position: relative; min-height: 0; overflow: auto;
}
.video-overlay .vstage {
  flex: 0 0 auto; width: 100%;
  display: flex; align-items: flex-start; justify-content: center;
}
.video-overlay .vframe {
  position: relative;
  width: 100%;
  background: #000;
  line-height: 0;
}
.video-overlay video {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 56px);
  background: #000;
  display: block;
  vertical-align: top;
}
.video-overlay .tap-mask {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,14,24,.28); cursor: pointer; border: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.video-overlay .tap-mask.hide { display: none !important; }
.video-overlay .play-btn {
  width: 72px; height: 72px; border-radius: 50%;
  border: 0; padding: 0;
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.video-overlay .play-btn::after {
  content: '';
  display: block;
  width: 0; height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #1f4f9c;
}
.dialogue-group { margin-top: 4px; }
.dialogue-group .dlg-feedback { margin-top: 10px; }

.scene-art {
  height: 160px; border-radius: 16px; margin-bottom: 14px; position: relative; overflow: hidden;
  border: 1px solid rgba(0,48,128,0.12);
  background: linear-gradient(120deg, rgba(0,48,128,0.14), rgba(232,120,0,0.12)), radial-gradient(circle at 30% 40%, rgba(255,255,255,0.7), transparent 40%);
}
.scene-art .avatar {
  position: absolute; width: 70px; height: 70px; border-radius: 50%; bottom: 18px; left: 24px;
  background: linear-gradient(145deg, #5b8fd9, #003080); border: 3px solid rgba(255,255,255,0.8);
  animation: bounceSoft 2s ease-in-out infinite; cursor: pointer;
}
@keyframes bounceSoft { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-10px);} }
.scene-art .hint {
  position: absolute; right: 18px; top: 18px; background: rgba(255,255,255,0.85); padding: 8px 12px;
  border-radius: 12px; font-size: 0.78rem; color: var(--ink-soft); border: 1px solid var(--line);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 0.7;} 50% { opacity: 1;} }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: none;} }

.contract {
  position: relative; background: #fffaf2; color: #2b2118; border-radius: 12px; padding: 20px;
  font-size: 0.94rem; line-height: 1.8; box-shadow: inset 0 0 0 2px #e4d5b8;
}
.contract h4 { font-family: var(--font-display); text-align: center; margin-bottom: 10px; }
.spot {
  position: relative;
  display: inline;
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 4px;
  margin: 0 1px;
  transition: 0.2s;
  background: rgba(0, 48, 128, 0.06);
  box-shadow: inset 0 0 0 1.5px rgba(0, 48, 128, 0.28);
}
.spot::after {
  content: attr(data-zone);
  position: absolute;
  top: -0.85em;
  left: 0;
  font-size: 0.68rem;
  line-height: 1;
  color: var(--teal);
  background: #fff;
  border: 1px solid rgba(0, 48, 128, 0.25);
  border-radius: 999px;
  padding: 1px 6px;
  pointer-events: none;
  white-space: nowrap;
}
.spot:hover { background: rgba(232, 120, 0, 0.18); box-shadow: inset 0 0 0 1.5px rgba(232, 120, 0, 0.55); }
.spot.found {
  background: rgba(0, 48, 128, 0.18);
  box-shadow: inset 0 0 0 2px #003080;
  animation: pop 0.35s ease;
}
.spot.safe-hit {
  background: rgba(106, 133, 144, 0.12);
  box-shadow: inset 0 0 0 2px rgba(106, 133, 144, 0.45);
}
.spot.miss {
  background: rgba(196, 92, 74, 0.12);
  box-shadow: inset 0 0 0 2px var(--bad);
  animation: shake 0.4s ease;
}
.contract-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--muted);
}
.contract-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.contract-legend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(0, 48, 128, 0.08);
  box-shadow: inset 0 0 0 1.5px rgba(0, 48, 128, 0.3);
}
.spot-count { margin-top: 12px; color: var(--amber); font-weight: 700; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(80px);
  background: #002060; border: 1px solid var(--amber); color: #f4fbfb; padding: 12px 18px;
  border-radius: 14px; z-index: 50; opacity: 0; transition: 0.35s; pointer-events: none;
  box-shadow: 0 12px 40px rgba(22,48,58,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.score-fly {
  position: fixed; z-index: 60; font-family: var(--font-display); font-size: 1.5rem; color: var(--amber);
  pointer-events: none; animation: scoreFly 1s ease forwards; text-shadow: 0 0 12px rgba(232,120,0,0.35);
}
@keyframes scoreFly { 0% { opacity: 1; transform: translateY(0) scale(1);} 100% { opacity: 0; transform: translateY(-60px) scale(1.3);} }

.certificate {
  text-align: center; padding: 36px 24px; border: 2px solid rgba(0,48,128,0.45); border-radius: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(0,48,128,0.10), transparent 50%), #fff;
  position: relative; overflow: hidden;
}
.certificate::before, .certificate::after { content: ''; position: absolute; width: 80px; height: 80px; border: 3px solid rgba(0,48,128,0.35); }
.certificate::before { top: 16px; left: 16px; border-right: none; border-bottom: none; }
.certificate::after { bottom: 16px; right: 16px; border-left: none; border-top: none; }
.certificate .seal {
  width: 90px; height: 90px; margin: 18px auto; border-radius: 50%; border: 4px double var(--amber);
  display: grid; place-items: center; font-family: var(--font-display); color: var(--amber);
  animation: spinSlow 12s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg);} }
.confetti { position: absolute; width: 10px; height: 10px; top: -10px; animation: fall 3s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0;} }

.board-list { display: grid; gap: 12px; }
.board-item { padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.board-item .meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.board-form textarea, .reflect textarea {
  width: 100%; min-height: 110px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); padding: 14px; resize: vertical; margin-bottom: 12px; font-family: inherit; line-height: 1.6;
}
.char-count { text-align: right; font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.nav-bottom { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; justify-content: center; align-items: center; }
.hidden-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(196,92,74,0.08); border: 1px dashed rgba(196,92,74,0.45); color: #a14a3c; font-size: 0.78rem; margin-bottom: 12px;
}

@media (max-width: 640px) {
  .shell { padding-top: 16px; }
  .gate-card { min-height: 200px; }
}
