:root {
      --forest: #203529;
      --grass: #78ad50;
      --grass-dark: #3f733f;
      --paper: #f6f0dc;
      --ink: #263b35;
      --muted: #5c6d62;
      --orange: #e98936;
      --border: #233a2d;
      font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
      color: var(--ink);
      background: var(--forest);
    }
    * { box-sizing: border-box; }
    body { margin: 0; min-width: 320px; }
    button, input { font: inherit; }
    button { cursor: pointer; }
    .page {
      min-height: 100vh;
      padding: 22px clamp(18px, 3vw, 48px) 28px;
      background-color: var(--forest);
      background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px);
      background-size: 32px 32px;
    }
    .topbar, .footer { max-width: 1440px; margin-inline: auto; }
    .topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; color: white; }
    .brand { display: flex; align-items: center; gap: 15px; }
    .brand-mark { width: 48px; height: 48px; flex: none; background: var(--grass); border: 4px solid #a8d47d; box-shadow: 5px 5px 0 #101f16; position: relative; }
    .brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: #d3ed9c; width: 10px; height: 10px; }
    .brand-mark::before { left: 6px; top: 6px; }
    .brand-mark::after { right: 5px; bottom: 5px; background: #315f38; }
    .eyebrow { margin: 0 0 3px; font-size: 12px; font-weight: 900; letter-spacing: .16em; color: #b7d997; }
    h1 { margin: 0; font-size: clamp(21px, 2.5vw, 32px); line-height: 1.25; letter-spacing: .04em; }
    .chapter { display: inline-block; border: 2px solid #86ad6b; color: #d9eac8; padding: 8px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; text-decoration: none; }
    .chapter:hover { background: #32513a; }
    .chapter:focus-visible { outline: 3px solid #e98936; outline-offset: 3px; }
    .top-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
    .panel { background: var(--paper); border: 5px solid var(--border); box-shadow: 8px 8px 0 #112118; }
    .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: #e6ddc0; border-bottom: 4px solid var(--border); }
    .panel-heading h2 { margin: 0; font-size: 16px; letter-spacing: .04em; }
    .footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 22px; color: #c3d8bf; font-size: 12px; }
    .footer p { margin: 0; }

    .quiz-panel { margin-top: 30px; }
    .quiz-heading { flex-wrap: wrap; }
    .quiz-progress { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 900; }
    .progress-block { width: 17px; height: 17px; border: 2px solid var(--forest); background: #fffaf0; }
    .progress-block.current { background: #e98936; }
    .progress-block.done { background: var(--grass); }
    .quiz-inner { padding: clamp(16px, 2.5vw, 28px); }
    .quiz-number { margin: 0 0 4px; font-size: 12px; font-weight: 900; letter-spacing: .1em; color: var(--grass-dark); }
    .quiz-inner h3 { margin: 0 0 9px; font-size: clamp(20px, 2vw, 26px); }
    .quiz-prompt { margin: 0 0 20px; line-height: 1.6; color: var(--muted); font-weight: 700; }
    .quiz-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .7fr); gap: 22px; align-items: start; }
    .quiz-visual { min-width: 0; overflow-x: auto; border: 3px solid var(--border); background: #fffaf0; }
    .quiz-visual svg { display: block; width: 100%; height: auto; }
    .quiz-response { display: flex; flex-direction: column; gap: 16px; }
    .quiz-instruction { margin: 0 0 12px; font-size: 14px; font-weight: 800; line-height: 1.55; }
    .word-bank { display: flex; flex-wrap: wrap; gap: 10px; }
    .word-chip { border: 3px solid var(--border); background: #e4ebce; color: var(--ink); padding: 10px 12px; min-height: 46px; font-weight: 900; box-shadow: 3px 3px 0 #a6b69a; touch-action: none; user-select: none; }
    .word-chip.selected { background: #f8d3a9; outline: 3px solid var(--orange); outline-offset: 2px; }
    .word-chip[hidden] { display: none; }
    .drag-ghost { position: fixed; z-index: 20; pointer-events: none; margin: 0; opacity: .9; transform: translate(-50%, -50%); }
    .label-board { position: relative; min-width: 590px; }
    .drop-zone { position: absolute; display: flex; align-items: center; justify-content: center; gap: 5px; width: 16%; min-height: 38px; padding: 4px; border: 2px dashed #466350; background: #fffaf0ef; color: var(--ink); font-size: clamp(11px, 1.1vw, 15px); font-weight: 900; line-height: 1.2; box-shadow: 2px 2px 0 #829784; }
    .drop-zone.filled { border-style: solid; background: #e4ebce; }
    .drop-zone.correct { border-color: #38843f; background: #c9ecb8; }
    .drop-zone.incorrect { border-color: #bf643b; background: #f8d8c4; }
    .zone-number { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; background: var(--forest); color: white; font-size: 11px; }
    .zone-normal { left: 42%; top: 6%; }
    .zone-incident-ray { left: 7%; top: 20%; }
    .zone-reflected-ray { right: 7%; top: 20%; }
    .zone-incidence-angle { left: 28%; top: 53%; }
    .zone-reflection-angle { right: 28%; top: 53%; }
    .quiz-answer-label { display: block; margin-bottom: 9px; font-weight: 900; }
    .number-entry { display: flex; align-items: center; gap: 10px; }
    .number-entry input { width: min(170px, 100%); min-height: 52px; padding: 9px 12px; border: 3px solid var(--border); background: #fff; color: var(--ink); font-size: 22px; font-weight: 900; }
    .number-entry span { font-size: 24px; font-weight: 900; }
    .quiz-feedback { min-height: 50px; margin: 0; padding: 10px 12px; background: #e9e3cf; line-height: 1.5; font-weight: 800; }
    .quiz-feedback.success { background: #d3edbf; color: #255b2d; }
    .quiz-feedback.error { background: #f8d8c4; color: #8a3b1d; }
    .quiz-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
    .quiz-button { min-height: 46px; padding: 9px 16px; border: 3px solid var(--border); background: var(--grass); color: var(--forest); font-weight: 900; box-shadow: 3px 3px 0 var(--border); }
    .quiz-button.secondary { background: #f8d3a9; }
    .quiz-button[hidden] { display: none; }
    .quiz-button:focus-visible, .word-chip:focus-visible, .drop-zone:focus-visible, .number-entry input:focus-visible { outline: 3px solid #e98936; outline-offset: 3px; }
    .quiz-complete { display: grid; place-items: center; min-height: 300px; padding: 24px; text-align: center; font-size: 26px; font-weight: 900; color: #397347; }
    .quiz-complete span { display: block; font-size: 80px; line-height: 1; }

    .quiz-page { max-width: 1440px; margin-inline: auto; }
    @media (max-width: 980px) { .quiz-layout { grid-template-columns: 1fr; } }
    @media (max-width: 620px) {
      .page { padding: 14px 12px 24px; }
      .topbar { flex-wrap: wrap; }
      .chapter { margin-left: auto; padding: 7px 8px; font-size: 11px; }
      .panel { box-shadow: 5px 5px 0 #112118; }
      .panel-heading { padding: 12px; }
      .quiz-panel { margin-top: 20px; }
      .drop-zone { font-size: 12px; }
      .footer { flex-direction: column; gap: 5px; }
    }
