/* 全站共用样式与实景练习页。正文 18px，按钮触控高度不低于 44px。 */
:root {
  --ink: #183b3e; --muted: #3f5f5b; --teal: #12484b; --teal-dark: #103d41;
  --rule: #cbd7d3; --bg: #f5f7f5; --soft: #eaf2ee; --accent: #f3c776;
  font: 112.5%/1.6 "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body, figure, h1, h2, h3, p { margin: 0; }
button, summary { cursor: pointer; }
button { font: inherit; color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #bb7205; outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--teal); }

/* 页头：品牌与栏目导航在同一条深色栏里，窄屏时导航换到第二行并可横向滑动 */
.siteHeader { background: var(--teal-dark); color: white; border-bottom: 4px solid #e2b75e; }
.siteHeader .bar { max-width: 1200px; margin: auto; padding: 10px clamp(16px, 4vw, 56px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: white; text-decoration: none; font-weight: 700; font-size: 1.1rem; min-height: 44px; }
.plane { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #173c3b; }
.moduleNav { flex: 1 1 auto; display: flex; justify-content: flex-end; gap: 4px; }
.moduleNav a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border-radius: 999px; color: #dbe8e5; text-decoration: none; font-weight: 650; white-space: nowrap; }
.moduleNav a:hover { background: #ffffff1f; }
.moduleNav a[aria-current=page] { background: var(--accent); color: #173c3b; }
.siteHeader a:focus-visible { outline-color: var(--accent); }
.tripButton { order: 3; min-height: 44px; padding: 6px 16px; border: 1px solid #ffffff66; border-radius: 999px; background: transparent; color: white; font-weight: 650; white-space: nowrap; }
.tripButton:hover { background: #ffffff1f; }
.tripButton:focus-visible { outline-color: var(--accent); }

/* 页面主体与标题 */
main { max-width: 1200px; margin: auto; padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 56px) 32px; }
.pageHead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.2; }
.pageIntro { margin-top: 8px; max-width: 760px; color: var(--muted); }
#count { font-weight: 700; color: var(--muted); }

/* 通用卡片、按钮与弹窗 */
figure, article, #done, dialog { border: 1px solid var(--rule); background: white; border-radius: 16px; }
.primary, .secondary { min-height: 48px; border-radius: 10px; font-weight: 650; }
.primary { background: var(--teal); color: white; border: 0; padding: 10px 22px; }
.secondary { background: white; border: 1px solid var(--rule); padding: 6px 16px; }
.secondary:hover { background: var(--soft); }
a.secondary { display: inline-flex; align-items: center; text-decoration: none; }
dialog { color: inherit; width: min(92vw, 640px); max-width: none; max-height: 88dvh; overflow: auto; padding: 20px; }
dialog::backdrop { background: #10232dd1; }
.dialogTop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialogTop h2 { margin: 0; font-size: 1.35rem; }
.dialogTop button { flex-shrink: 0; min-height: 44px; padding: 6px 16px; border: 1px solid #80a1a0; border-radius: 999px; background: transparent; }

/* 页脚与往返行程 */
.siteFooter { max-width: 1200px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 56px) 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; border-top: 1px solid var(--rule); }
/* 行程弹窗：每段航班画成一张登机牌，主联和副联之间是打孔虚线 */
#trip { background: #f5f7f5; }
#trip h3 { margin: 18px 0 8px; font-size: 1.1rem; }
.tripNote { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.ticket { position: relative; display: grid; grid-template-columns: 1fr 96px; border-radius: 14px; background: white; box-shadow: 0 2px 8px #10232d1f; overflow: hidden; }
.ticketMain { padding: 0 0 12px; }
.ticketTop { display: flex; justify-content: space-between; padding: 6px 16px; background: var(--teal-dark); color: white; font-size: .9rem; font-weight: 650; }
.ticketRoute { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 10px 16px 0; }
.port { display: grid; }
.port:last-child { text-align: right; }
.port b { font-size: 1.9rem; line-height: 1.1; letter-spacing: .04em; color: var(--teal-dark); }
.port span { font-size: .9rem; color: var(--muted); }
.port time { font-size: 1.25rem; font-weight: 700; }
.port small { color: #b3261e; font-weight: 650; font-size: .9rem; }
.ticketPlane { font-size: 1.4rem; color: var(--teal); }
.ticketStub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-left: 2px dashed #cbd7d3; background: #fbecc8; }
.ticketStub span { font-size: .9rem; color: #7a5a1f; }
.ticketStub b { font-size: 1.15rem; color: #173c3b; }
.ticket::before, .ticket::after { content: ""; position: absolute; right: 85px; width: 20px; height: 20px; border-radius: 50%; background: #f5f7f5; }
.ticket::before { top: -10px; }
.ticket::after { bottom: -10px; }
.tripGap { margin: 6px 0 6px 22px; padding: 4px 0 4px 14px; border-left: 2px dashed #80a1a0; color: var(--muted); font-size: .9rem; }
@media (max-width: 480px) {
  .ticket { grid-template-columns: 1fr 76px; }
  .ticket::before, .ticket::after { right: 65px; }
  .port b { font-size: 1.5rem; }
  .port time { font-size: 1.1rem; }
  .ticketTop { padding: 6px 12px; }
  .ticketRoute { padding: 8px 12px 0; }
}

/* 实景练习 */
progress { display: block; appearance: none; width: 100%; height: 6px; margin: 18px 0 24px; border: 0; border-radius: 9px; overflow: hidden; background: #d7e1dc; }
progress::-webkit-progress-bar { background: #d7e1dc; }
progress::-webkit-progress-value { background: #27726a; }
progress::-moz-progress-bar { background: #27726a; }
#exercise { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); align-items: start; }
figure { overflow: hidden; }
#zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #182d30; }
#photo { display: block; width: 100%; height: clamp(250px, 32vw, 440px); object-fit: contain; }
#zoom span { position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; border-radius: 24px; background: #102928ed; color: white; font-size: .9rem; }
figcaption { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 12px 16px; }
figcaption details { font-size: .9rem; text-align: right; color: var(--muted); }
#imageError { padding: 12px; }
article, #done { padding: clamp(18px, 2.8vw, 32px); }
#question { font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.45; margin-bottom: 18px; }
#choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: #fafcfb; text-align: left; font-weight: 650; }
.choice span { min-width: 32px; border: 1px solid var(--rule); border-radius: 6px; text-align: center; font-weight: 700; }
.choice:hover:enabled { background: #edf4f1; }
.choice[aria-pressed=true] { background: #e2efea; border-color: #287166; }
.choice.wrong { background: #fff2dc; border-color: #be8733; }
#feedback:not(:empty) { margin: 15px 0; padding: 12px 14px; border-radius: 8px; background: #f2f5ef; }
#feedback strong { display: block; }
#next:not([hidden]) { margin-top: 10px; width: 100%; }
.questionActions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.questionActions .secondary { min-height: 44px; font-weight: 500; font-size: .9rem; color: var(--muted); }
#savedNotice:not(:empty) { margin-top: 8px; font-size: .9rem; }
#done h2 { font-size: 1.5rem; margin-bottom: 8px; }
#review { margin: 16px 0; padding-inline-start: 1.4em; }
#review li { margin-bottom: 12px; }
#review .secondary { display: block; margin-top: 6px; min-height: 40px; font-size: .9rem; }
#viewer { width: 94vw; max-width: 1360px; }
.pan { overflow: auto; max-height: 74dvh; margin-top: 12px; }
.pan img { display: block; width: max(100%, var(--zoom-width, 850px)); }

/* 开发者模式：.devOnly 只在 body.devMode 时显示 */
body:not(.devMode) .devOnly { display: none !important; }
.quizDevBar { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--rule); font-size: .85rem; color: var(--muted); }
.quizDevBar p { margin-bottom: 8px; font-family: monospace; overflow-wrap: anywhere; }
.quizDevBar .secondary, .quizDevBar select { min-height: 40px; font-size: .85rem; }
.quizDevBar select { max-width: 100%; padding: 4px 8px; border: 1px solid #80a1a0; border-radius: 8px; background: white; font: inherit; }
.noteActions { display: flex; flex-wrap: wrap; gap: 8px; }
.devMode #exercise figure.marked { outline: 3px solid #b3261e; }
/* 反馈：供开发者自己试做时使用 */
#reportPrompt, #reportSummary { margin-top: 12px; }
:is(#reportForm, .noteForm) { display: grid; gap: 8px; margin-top: 14px; }
:is(#reportForm, .noteForm) label { font-weight: 650; }
:is(#reportForm, .noteForm) :is(select, textarea) { width: 100%; padding: 8px 10px; border: 1px solid #80a1a0; border-radius: 8px; background: #fafcfb; font: inherit; color: inherit; }
:is(#reportForm, .noteForm) textarea { resize: vertical; }
#reportForm .primary { justify-self: start; }
.reportHelp { font-size: .9rem; color: var(--muted); }
:is(#reportEntries, .noteEntries) { padding-inline-start: 22px; overflow-wrap: anywhere; }
:is(#reportEntries, .noteEntries) li { margin-bottom: 10px; white-space: pre-wrap; }
:is(#reportEntries, .noteEntries) .secondary { display: block; margin-top: 4px; min-height: 36px; }

@media (max-width: 760px) {
  .tripButton { order: 1; margin-left: auto; }
  .moduleNav { order: 2; flex-basis: 100%; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
  .moduleNav a { justify-content: center; padding: 6px 2px; font-size: .9rem; }
}
/* 实景练习：iPad 竖屏或较窄时改成上图下题，照片占满整行 */
@media (max-width: 900px), (orientation: portrait) {
  #exercise { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #photo { height: clamp(200px, 56vw, 480px); }
}
@media (max-width: 480px) {
  .moduleNav { grid-template-columns: repeat(3, 1fr); }
}
