/* MARU × LION 英文冒險學習站 — 紙本探險手冊風格 */

:root {
  --navy: #18324b;
  --navy-deep: #10243a;
  --paper: #fbf6ec;
  --paper-2: #f3e9d8;
  --paper-3: #ece0cc;
  --ink: #23303c;
  --ink-soft: #5d6b78;
  --coral: #e8703a;
  --coral-deep: #cf5c28;
  --sage: #7c9a72;
  --gold: #e3b23c;
  --line: rgba(24, 50, 75, .16);
  --radius: 18px;
  --shadow-sm: 0 2px 6px rgba(24, 50, 75, .08);
  --shadow-md: 0 10px 30px rgba(24, 50, 75, .12);
  --shadow-lg: 0 20px 50px rgba(24, 50, 75, .18);
  --font-en: ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-zh);
  color: var(--ink);
  line-height: 1.7;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(232, 112, 58, .07), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(124, 154, 114, .09), transparent 40%),
    radial-gradient(circle at 60% 92%, rgba(227, 178, 60, .08), transparent 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-zh); line-height: 1.35; margin: 0; letter-spacing: .01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 鍵盤焦點可見性（Tab 導覽） ---------- */
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.topbar :focus-visible,
.cert-overlay :focus-visible { outline-color: var(--gold); }

/* ---------- 進站封面（繪本書皮） ---------- */
.cover {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 15% 18%, rgba(232, 112, 58, .08), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(227, 178, 60, .10), transparent 45%),
    linear-gradient(180deg, #fdf9f0, #f6ecd9);
  padding: 20px; overflow: auto;
}
.cover[hidden] { display: none; }
body.cover-open { overflow: hidden; }
.cover-sheet { text-align: center; max-width: 560px; width: 100%; min-width: 0; animation: rise .6s ease both; }
.cover-kicker { font-size: 12px; letter-spacing: .32em; color: var(--ink-soft); }
.cover-title {
  font-family: var(--font-en); font-size: clamp(34px, 9vw, 56px);
  font-weight: 800; color: var(--navy); letter-spacing: .04em; line-height: 1.15;
  margin-top: 8px;
}
.cover-sub {
  font-size: clamp(15px, 3.4vw, 19px); color: var(--coral-deep); font-weight: 700;
  letter-spacing: .5em; text-indent: .5em; margin-top: 4px;
}
.cover-art { margin: 20px auto 16px; max-width: 480px; min-width: 0; border-radius: 18px; overflow: hidden; border: 2.5px solid var(--gold); box-shadow: var(--shadow-md); }
.cover-art img { display: block; width: 100%; height: auto; max-width: 100%; }
.cover-note { margin-top: 14px; font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.cover-seasons {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-bottom: 20px;
}
.cover-seasons li {
  background: #fff; border: 1px solid var(--line); color: var(--navy);
  font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 11px;
}
.cover-cta { font-size: 17px; padding: 13px 34px; }

@media (max-width: 480px) {
  .cover { padding: 14px; }
  .cover-art { max-width: 100%; margin: 16px auto 12px; }
}

/* ---------- 頂列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(24, 50, 75, .97);
  color: #fff;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(16, 35, 58, .25);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: .04em; }
.brand-text small { font-size: 11px; color: rgba(255, 255, 255, .65); letter-spacing: .12em; }

.week-switch { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mini-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08); color: #fff;
  font-size: 18px; line-height: 1; display: grid; place-items: center;
  transition: background .18s, transform .18s;
}
.mini-btn:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.mini-btn.wide { width: auto; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; }
.mini-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.week-picker { display: flex; align-items: center; gap: 8px; }
.sticker {
  background: var(--coral); color: #fff; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
  box-shadow: var(--shadow-sm); letter-spacing: .04em;
}
.week-picker select {
  appearance: none; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .1); color: #fff;
  padding: 6px 30px 6px 12px; border-radius: 999px; font-size: 14px;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.week-picker select option { color: #18324b; }

.topbar-progress { display: flex; align-items: center; gap: 10px; }
.ring {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .16) 0);
  font-size: 12px; font-weight: 700; color: #fff;
  position: relative;
}
.ring::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: var(--navy); 
}
.ring span { position: relative; z-index: 1; }
.ring-meta { display: flex; flex-direction: column; line-height: 1.25; }
.ring-meta strong { font-size: 14px; }
.ring-meta small { font-size: 11px; color: rgba(255, 255, 255, .6); }

/* ---------- 版面 ---------- */
.shell { max-width: 1280px; margin: 0 auto; padding: 32px 20px 64px; display: grid; grid-template-columns: 216px minmax(0,1fr); gap: 32px; }

.sidenav { position: sticky; top: 78px; align-self: start; }
.sidenav-title, .sidenav-note {
  font-size: 11px; letter-spacing: .18em; color: var(--ink-soft);
  text-transform: uppercase; margin: 0 0 12px; padding-left: 14px;
}
.sidenav-note { margin: 18px 0 0; letter-spacing: .02em; text-transform: none; font-size: 12px; line-height: 1.6; }
#sideNav { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--line); }
#sideNav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px;
  transition: color .18s, border-color .18s, background .18s;
}
#sideNav a i { font-style: normal; font-size: 11px; color: var(--coral); font-weight: 700; letter-spacing: .06em; }
#sideNav a:hover { color: var(--navy); background: rgba(24, 50, 75, .04); }
#sideNav a.active { color: var(--navy); font-weight: 700; border-left-color: var(--coral); background: rgba(232, 112, 58, .07); }

.content { min-width: 0; display: flex; flex-direction: column; gap: 40px; }

/* ---------- 通用元件 ---------- */
.reveal { animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.btn {
  border: none; border-radius: 999px; padding: 11px 22px;
  font-size: 15px; font-weight: 700; letter-spacing: .02em;
  transition: transform .18s, box-shadow .18s, background .18s;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(232, 112, 58, .32); }
.btn-primary:hover { background: var(--coral-deep); }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-fb { background: var(--navy); color: #fff; }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn-done.is-done { background: var(--sage); box-shadow: 0 6px 18px rgba(124, 154, 114, .35); }
.btn-done .tick { opacity: 0; transition: opacity .2s; }
.btn-done.is-done .tick { opacity: 1; }

.chip-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 600;
  transition: all .18s;
}
.chip-btn:hover { border-color: var(--navy); color: var(--navy); }
.chip-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.panel {
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 20px; }
.panel-head h2 { font-size: 22px; color: var(--navy); display: flex; align-items: center; gap: 12px; }
.panel-sub { font-size: 13.5px; color: var(--ink-soft); margin-left: auto; }
.day-badge {
  background: var(--gold); color: var(--navy); font-size: 12.5px; font-weight: 700;
  padding: 3px 12px; border-radius: 999px; letter-spacing: .04em;
}

/* ---------- 01 本週任務 ---------- */
.hero {
  display: grid; grid-template-columns: 57.5% 42.5%; gap: 28px; align-items: stretch;
  background: linear-gradient(135deg, #ffffff 0%, #fdf8ef 60%, #f7ecdb 100%);
  border: 1px solid var(--line); border-radius: 24px;
  padding: 30px; box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(24, 50, 75, .035) 0 1px, transparent 1px 26px);
  pointer-events: none;
}
.hero-copy { position: relative; }
.unit-sticker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.unit-sticker b {
  background: var(--navy); color: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 13px; letter-spacing: .06em;
}
.unit-sticker em {
  font-style: normal; background: var(--coral); color: #fff;
  border-radius: 999px; padding: 4px 14px; font-size: 13px; transform: rotate(-1.5deg);
}
.hero h1 { font-size: 27px; color: var(--navy); }
.hero-title {
  font-size: 34px; font-weight: 800; color: var(--coral-deep);
  margin: 10px 0 6px; letter-spacing: .02em;
}
.hero-story { color: var(--ink-soft); font-size: 15px; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 24px; }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 18px; }
.hero-stats dt { font-size: 11.5px; letter-spacing: .1em; color: var(--ink-soft); text-transform: uppercase; }
.hero-stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: var(--navy); }

.hero-art {
  margin: 0; position: relative; border-radius: 16px; overflow: hidden;
  background: var(--paper-2); box-shadow: var(--shadow-md);
  border: 1px solid var(--line); min-height: 260px; display: flex;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-art figcaption {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(24, 50, 75, .88); color: #fff;
  font-size: 12px; padding: 5px 12px; border-radius: 999px; letter-spacing: .06em;
}
.stamp-corner {
  position: absolute; top: 12px; right: 12px;
  border: 2px solid var(--gold); color: var(--gold);
  border-radius: 50%; width: 62px; height: 62px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; transform: rotate(-12deg);
  background: rgba(255, 255, 255, .18); backdrop-filter: blur(2px);
}

/* ---------- 02 今日一句 ---------- */
.switch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.today-grid { display: grid; grid-template-columns: 67.5% 32.5%; gap: 22px; }
.today-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--coral);
}
.sentence {
  font-family: var(--font-en); font-size: 21px; line-height: 1.75;
  color: var(--navy); font-weight: 600; letter-spacing: .01em;
}
.sentence mark, .Ref mark {
  background: linear-gradient(transparent 62%, rgba(227, 178, 60, .55) 0);
  color: inherit; padding: 0 1px; border-radius: 3px;
}
.translation { margin-top: 12px; font-size: 16px; color: var(--ink-soft); animation: rise .3s ease both; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 22px; }
.word-chips li {
  background: var(--paper-2); border: 1px solid var(--paper-3);
  border-radius: 999px; padding: 4px 13px; font-family: var(--font-en);
  font-size: 13.5px; color: var(--navy); font-weight: 600;
}
.today-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--ink-soft); }

.today-art { margin: 0; border-radius: 16px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); position: relative; min-height: 220px; }
.today-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 動畫播放器（Kling 生成的 1:1 動畫疊在插畫窗上） ---------- */
/* 動畫是 1:1、插畫窗是直向比例，用 contain 讓角色完整不被裁掉 */
.today-art video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--paper-2); display: block;
}
.today-art.is-playing img { visibility: hidden; }
.today-art.is-playing video { z-index: 2; }

.anim-btn {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px;
  background: rgba(24, 50, 75, .72); color: #fff;
  font-family: var(--font-zh); font-size: 12.5px; font-weight: 700;
  padding: 6px 13px 6px 10px; cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .18s ease, transform .18s ease;
}
.anim-btn:hover { background: rgba(24, 50, 75, .88); transform: translateY(-1px); }
.anim-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.anim-btn .anim-ico {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--coral); color: #fff;
  display: grid; place-items: center; font-size: 9px; line-height: 1;
  padding-left: 1px;
}
/* 播放中：圖示換成暫停的雙條 */
.today-art.is-playing .anim-btn .anim-ico {
  background: var(--gold);
  font-size: 0;
}
.today-art.is-playing .anim-btn .anim-ico::before {
  content: "";
  width: 8px; height: 10px;
  border-left: 3px solid #fff;
  border-right: 3px solid #fff;
}

@media (max-width: 760px) {
  .anim-btn { font-size: 11.5px; padding: 5px 11px 5px 8px; }
  .anim-btn .anim-txt { display: none; }
}
.today-art figcaption {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(255, 255, 255, .92); color: var(--navy);
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px; font-weight: 700;
}
.art-empty {
  display: grid; place-items: center; gap: 6px; min-height: 220px;
  color: var(--ink-soft); font-size: 13px; text-align: center; padding: 20px;
  width: 100%;
  background-image: repeating-linear-gradient(45deg, rgba(24, 50, 75, .04) 0 8px, transparent 8px 16px);
}
.art-empty b { font-size: 13.5px; letter-spacing: .04em; }
.art-empty span { font-size: 12px; line-height: 1.6; max-width: 26ch; opacity: .85; }

.hero-cover {
  background: linear-gradient(160deg, #2a4a6b 0%, #18324b 55%, #10243a 100%);
  color: #fff; border-radius: 16px; padding: 30px 24px; gap: 4px;
  position: relative; align-content: center;
}
.hero-cover .cover-week {
  font-size: 11px; letter-spacing: .28em; color: var(--gold); font-weight: 700;
}
.hero-cover .cover-title { font-size: 22px; font-weight: 800; margin-top: 6px; }
.hero-cover .cover-note { font-size: 12.5px; color: rgba(255, 255, 255, .72); line-height: 1.7; margin-top: 10px; }
.hero-cover .cover-seal {
  position: absolute; top: 16px; right: 16px;
  border: 2px solid var(--gold); color: var(--gold); border-radius: 50%;
  width: 66px; height: 66px; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .06em; line-height: 1.25;
  transform: rotate(-10deg); text-align: center;
}

.day-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }
.day-nav-label { font-size: 13.5px; color: var(--ink-soft); }
.day-nav-label b { color: var(--navy); font-size: 15px; }

/* ---------- 03 一週路線 ---------- */
.route { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; position: relative; }
.route::before {
  content: ""; position: absolute; left: 0; right: 0; top: 34px;
  border-top: 2px dashed var(--line); z-index: 0;
}
.route li { position: relative; z-index: 1; }
.route button {
  width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 8px 10px; text-align: center;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: block; color: inherit;
}
.route button:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--coral); }
.route .dot {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--paper-2); color: var(--ink-soft); border: 2px solid var(--paper-3);
}
.route b { display: block; font-size: 12.5px; color: var(--navy); }
.route small { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.route li.done .dot { background: var(--sage); border-color: var(--sage); color: #fff; }
.route li.current button { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(232, 112, 58, .14); }
.route li.current .dot { background: var(--coral); border-color: var(--coral); color: #fff; }

/* ---------- 04 核心字詞 ---------- */
.word-wall { display: flex; flex-wrap: wrap; gap: 9px; }
.word-wall button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 15px; font-family: var(--font-en); font-size: 14px;
  color: var(--navy); font-weight: 600; transition: all .16s;
}
.word-wall button:hover { background: var(--coral); color: #fff; border-color: var(--coral); transform: translateY(-2px); }
.word-wall button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.word-detail {
  margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 18px;
  animation: rise .3s ease both;
}
.word-detail h3 { font-family: var(--font-en); font-size: 17px; color: var(--coral-deep); margin-bottom: 10px; }
.word-detail ul { display: grid; gap: 12px; }
.word-detail li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.word-detail .Ref { font-family: var(--font-en); font-size: 15.5px; color: var(--navy); }
.word-detail .Rzh { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.word-detail .Rday { font-size: 11.5px; color: var(--coral); font-weight: 700; letter-spacing: .06em; }

/* ---------- 05 24 週地圖 ---------- */
.map-route {
  display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 12px;
}
.map-route button {
  width: 100%; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; transition: all .18s; color: inherit; position: relative; overflow: hidden;
}
.map-route button:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--coral); }
.map-route .m-week { font-size: 11px; letter-spacing: .1em; color: var(--coral); font-weight: 700; }
.map-route .m-title { display: block; font-size: 14px; font-weight: 700; color: var(--navy); margin-top: 2px; }
.map-route .m-prog { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; }
.map-route .m-bar { display: block; height: 4px; border-radius: 999px; background: var(--paper-3); margin-top: 8px; overflow: hidden; }
.map-route .m-bar i { display: block; height: 100%; background: var(--sage); border-radius: 999px; transition: width .3s; }
.map-route li.stamped button { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(227, 178, 60, .5); }
.map-route li.stamped .m-title::after { content: " 🏅"; }
.map-route li.current button { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(24, 50, 75, .12); }

/* ---------- 06 章印與徽章 ---------- */
.passport { display: grid; gap: 22px; margin-bottom: 18px; }
.passport-bar .bar { height: 12px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.passport-bar .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--gold)); transition: width .5s ease; }
.passport-bar p { font-size: 14px; color: var(--ink-soft); margin-top: 10px; }
.passport-bar p b { color: var(--navy); }
.badges { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; }
.badges li { text-align: center; }
.badges .seal {
  width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  border: 2px dashed var(--paper-3); color: var(--ink-soft); background: #fff;
  letter-spacing: .04em;
}
.badges li.earned .seal {
  border: 2px solid var(--gold); color: var(--navy); background: radial-gradient(circle, #fff6dd, #ffe6ac);
  box-shadow: 0 6px 16px rgba(227, 178, 60, .3);
  animation: pop .45s ease both;
}
@keyframes pop { from { transform: scale(.7) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.badges small { display: block; font-size: 11.5px; color: var(--ink-soft); }

/* ---------- 07 分享 ---------- */
.share textarea {
  width: 100%; margin: 16px 0; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; font-family: var(--font-zh); font-size: 14.5px; line-height: 1.8;
  color: var(--ink); background: #fff; resize: vertical;
}
.share-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toast {
  background: var(--sage); color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; animation: rise .25s ease both;
}

.site-foot { border-top: 1px dashed var(--line); padding-top: 20px; font-size: 13px; color: var(--ink-soft); }
.foot-note { font-size: 12px; margin-top: 6px; opacity: .8; }

/* ---------- 季別切換 ---------- */
.season-tabs {
  display: flex; gap: 6px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow-x: auto; scrollbar-width: none;
}
.season-tabs::-webkit-scrollbar { display: none; }
.season-tab {
  border: none; background: transparent; color: rgba(255, 255, 255, .7);
  border-radius: 999px; padding: 5px 14px; line-height: 1.25; text-align: left;
  display: flex; flex-direction: column; transition: background .18s, color .18s;
}
.season-tab b { font-size: 12.5px; letter-spacing: .06em; }
.season-tab small { font-size: 10.5px; opacity: .75; }
.season-tab:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.season-tab.is-active { background: var(--coral); color: #fff; box-shadow: var(--shadow-sm); }
.season-tab.is-active small { opacity: .9; }

.hero-line {
  font-family: var(--font-en); font-size: 14px; color: var(--coral-deep);
  letter-spacing: .01em; margin-bottom: 8px; opacity: .95;
}
.hero-unitline { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 0 4px; }
.hero-unitline dt { font-size: 11px; letter-spacing: .12em; color: var(--ink-soft); }
.hero-unitline dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--navy); }

.day-sub {
  font-family: var(--font-en); font-size: 13px; color: var(--coral-deep);
  letter-spacing: .04em; margin-bottom: 10px;
}
.word-chips li { display: inline-flex; align-items: baseline; gap: 6px; }
.word-chips .w-gloss { font-family: var(--font-zh); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }

.hero-cover .cover-en {
  font-family: var(--font-en); font-size: 12.5px; color: var(--gold); letter-spacing: .02em;
}

.map-route .m-badge {
  display: inline-block; margin-top: 6px; font-size: 11px; color: var(--coral-deep);
  background: rgba(232, 112, 58, .1); border-radius: 999px; padding: 1px 9px; font-weight: 700;
}
.map-route.is-season2 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.badges.is-season2 { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px 14px; }
.badges .badge-en { display: block; font-family: var(--font-en); font-size: 10.5px; color: var(--ink-soft); margin-top: 2px; opacity: .85; }

/* Season 2｜臺南旅行任務：同一個品牌，換一套城市色 */
body.season-tainan {
  --coral: #c9643a;
  --coral-deep: #a94f2b;
  --sage: #2f7f79;
  --navy: #17403f;
  --navy-deep: #0d2a29;
  --gold: #d8a437;
  --paper: #fbf4e9;
  --paper-2: #f2e6d3;
  --paper-3: #e6d7be;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(201, 100, 58, .08), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(47, 127, 121, .1), transparent 40%),
    radial-gradient(circle at 60% 92%, rgba(216, 164, 55, .09), transparent 45%);
}
body.season-tainan .topbar { background: rgba(23, 64, 63, .97); box-shadow: 0 2px 12px rgba(13, 42, 41, .28); }
body.season-tainan .ring::after { background: var(--navy); }
body.season-tainan .week-picker select option { color: #17403f; }
body.season-tainan .hero-cover { background: linear-gradient(160deg, #2c6b68 0%, #17403f 55%, #0d2a29 100%); }
body.season-tainan .hero-unitline dd { color: #17403f; }
body.season-tainan .hero { background-image: linear-gradient(180deg, rgba(47, 127, 121, .07), rgba(255, 255, 255, 0)); }

/* Season 3｜臺北城市任務：暮色靛藍 × 洋紅 × 城市青，像一張發光的路線圖 */
body.season-taipei {
  --coral: #d4597f;
  --coral-deep: #b84569;
  --sage: #2f8fa8;
  --navy: #272155;
  --navy-deep: #161238;
  --gold: #e8b04a;
  --paper: #f7f4ef;
  --paper-2: #eeeae5;
  --paper-3: #e0dad5;
  background-image:
    radial-gradient(circle at 10% 14%, rgba(212, 89, 127, .09), transparent 42%),
    radial-gradient(circle at 90% 6%, rgba(47, 143, 168, .1), transparent 40%),
    radial-gradient(circle at 62% 94%, rgba(232, 176, 74, .09), transparent 45%);
}
body.season-taipei .topbar { background: rgba(39, 33, 85, .97); box-shadow: 0 2px 12px rgba(22, 18, 56, .3); }
body.season-taipei .ring::after { background: var(--navy); }
body.season-taipei .week-picker select option { color: #272155; }
body.season-taipei .hero-cover { background: linear-gradient(160deg, #413680 0%, #272155 55%, #161238 100%); }
body.season-taipei .hero-unitline dd { color: #272155; }
body.season-taipei .hero { background-image: linear-gradient(180deg, rgba(47, 143, 168, .07), rgba(255, 255, 255, 0)); }
body.season-taipei .seal { letter-spacing: .02em; }

/* Season 4｜上海城市任務：朱紅 × 墨灰 × 江水綠，像一張受潮的老海報 */
body.season-shanghai {
  --coral: #c0472f;
  --coral-deep: #9c3623;
  --sage: #3f7f8c;
  --navy: #2f2b33;
  --navy-deep: #191720;
  --gold: #d9b45b;
  --paper: #faf3ea;
  --paper-2: #f1e6d6;
  --paper-3: #e2d2bd;
  background-image:
    radial-gradient(circle at 14% 16%, rgba(192, 71, 47, .09), transparent 42%),
    radial-gradient(circle at 86% 10%, rgba(63, 127, 140, .1), transparent 40%),
    radial-gradient(circle at 58% 90%, rgba(217, 180, 91, .09), transparent 45%);
}
body.season-shanghai .topbar { background: rgba(47, 43, 51, .97); box-shadow: 0 2px 12px rgba(25, 23, 32, .3); }
body.season-shanghai .ring::after { background: var(--navy); }
body.season-shanghai .week-picker select option { color: #2f2b33; }
body.season-shanghai .hero-cover { background: linear-gradient(160deg, #4a4354 0%, #2f2b33 55%, #191720 100%); }
body.season-shanghai .hero-unitline dd { color: #2f2b33; }
body.season-shanghai .hero { background-image: linear-gradient(180deg, rgba(63, 127, 140, .07), rgba(255, 255, 255, 0)); }
body.season-shanghai .seal { letter-spacing: .04em; }

/* Season 5｜香港城市任務：翡翠綠 × 維港深藍，海風吹過的涼色 */
body.season-hongkong {
  --coral: #e0762f;
  --coral-deep: #bd5c1c;
  --sage: #2f9e8f;
  --navy: #0f3b46;
  --navy-deep: #082730;
  --gold: #e6b84f;
  --paper: #f4f7f3;
  --paper-2: #e7ede6;
  --paper-3: #d6e0d7;
  background-image:
    radial-gradient(circle at 12% 14%, rgba(47, 158, 143, .12), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(15, 59, 70, .1), transparent 40%),
    radial-gradient(circle at 62% 92%, rgba(230, 184, 79, .1), transparent 45%);
}
body.season-hongkong .topbar { background: rgba(15, 59, 70, .97); box-shadow: 0 2px 12px rgba(8, 39, 48, .3); }
body.season-hongkong .ring::after { background: var(--navy); }
body.season-hongkong .week-picker select option { color: #0f3b46; }
body.season-hongkong .hero-cover { background: linear-gradient(160deg, #1c5f6d 0%, #0f3b46 55%, #082730 100%); }
body.season-hongkong .hero-unitline dd { color: #0f3b46; }
body.season-hongkong .hero { background-image: linear-gradient(180deg, rgba(47, 158, 143, .08), rgba(255, 255, 255, 0)); }
body.season-hongkong .seal { letter-spacing: .04em; }

/* Season 6｜加州公路任務：太平洋藍 × 落日橘 × 沙金 */
body.season-california {
  --coral: #e8823a;
  --coral-deep: #c9631f;
  --sage: #2f8ec2;
  --navy: #1b4a6b;
  --navy-deep: #0d2c45;
  --gold: #e8c05a;
  --paper: #fbf6ea;
  --paper-2: #f2ebdb;
  --paper-3: #e3d7c0;
  background-image:
    radial-gradient(circle at 10% 12%, rgba(232, 130, 58, .12), transparent 42%),
    radial-gradient(circle at 90% 8%, rgba(47, 142, 194, .13), transparent 42%),
    radial-gradient(circle at 60% 94%, rgba(232, 192, 90, .12), transparent 45%);
}
body.season-california .topbar { background: rgba(27, 74, 107, .97); box-shadow: 0 2px 12px rgba(13, 44, 69, .3); }
body.season-california .ring::after { background: var(--navy); }
body.season-california .week-picker select option { color: #1b4a6b; }
body.season-california .hero-cover { background: linear-gradient(160deg, #2f6f9c 0%, #1b4a6b 55%, #0d2c45 100%); }
body.season-california .hero-unitline dd { color: #1b4a6b; }
body.season-california .hero { background-image: linear-gradient(180deg, rgba(47, 142, 194, .08), rgba(255, 255, 255, 0)); }
body.season-california .seal { letter-spacing: .04em; }

/* ---------- 學習統計 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px 14px; box-shadow: var(--shadow-sm);
}
.stat-card.streak-card {
  background: linear-gradient(160deg, #fdf3dd 0%, #fffdf7 70%);
  border-color: rgba(227, 178, 60, .55);
}
.stat-label { font-size: 11.5px; letter-spacing: .12em; color: var(--ink-soft); font-weight: 700; }
.stat-figure { margin: 6px 0 4px; display: flex; align-items: baseline; gap: 8px; }
.stat-figure strong { font-size: 34px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-unit { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.stat-note { margin: 0; font-size: 12.5px; color: var(--ink-soft); }

.season-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stat-season {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px;
}
.stat-season.complete { border-color: rgba(227, 178, 60, .65); background: linear-gradient(160deg, #fdf6e3, #fff); }
.ss-code {
  background: var(--navy); color: #fff; font-weight: 800; font-size: 12px;
  border-radius: 8px; padding: 4px 8px; letter-spacing: .06em;
}
.stat-season.complete .ss-code { background: var(--gold); color: var(--navy); }
.ss-label { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.ss-count { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.ss-bar { flex: 1 1 140px; height: 10px; background: var(--paper-2); border-radius: 999px; overflow: hidden; min-width: 120px; }
.ss-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--coral), var(--gold)); border-radius: 999px; transition: width .4s ease; }
.ss-pct { font-weight: 800; color: var(--navy); font-size: 14px; min-width: 44px; text-align: right; }
.ss-cert { white-space: nowrap; }
.ss-cert:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 完季證書浮層 ---------- */
.cert-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 36, 58, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
/* 關鍵：display:flex 會蓋掉 hidden 屬性的預設隱藏，必須補這條才能關閉 */
.cert-overlay[hidden] { display: none; }
.cert-sheet {
  background: var(--paper); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  padding: 22px;
  width: min(1080px, 94vw);
}
.cert-frame {
  aspect-ratio: 297 / 210;
  width: 100%;
  background:
    radial-gradient(circle at 12% 88%, rgba(227, 178, 60, .16), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(232, 112, 58, .10), transparent 34%),
    #fffdf7;
  border: 2.5px solid var(--gold);
  outline: 1.5px solid var(--navy);
  outline-offset: -9px;
  border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3.2% 5%;
  position: relative;
}
.cert-brand { font-size: clamp(11px, 1.3vw, 15px); letter-spacing: .28em; color: var(--ink-soft); margin: 0 0 1.2%; }
.cert-title { font-size: clamp(26px, 3.6vw, 44px); letter-spacing: .3em; color: var(--navy); margin: 0 0 1.6%; font-weight: 800; }
.cert-season {
  font-size: clamp(15px, 1.9vw, 23px); color: var(--coral-deep); font-weight: 700;
  margin: 0 0 2%; padding-bottom: 1.4%;
  border-bottom: 2px dashed rgba(227, 178, 60, .7);
}
.cert-body { font-size: clamp(12px, 1.35vw, 17px); color: var(--ink); margin: 0 0 2.4%; line-height: 1.9; }
.cert-name-row { display: flex; align-items: baseline; gap: 10px; margin: 0 0 2%; }
.cert-here {
  font-size: clamp(20px, 2.6vw, 32px); font-weight: 800; color: var(--navy);
  min-width: 7em; border-bottom: 2.5px solid var(--navy); padding: 0 .4em .1em;
}
.cert-name-row input {
  border: none; border-bottom: 2px dashed var(--coral); background: transparent;
  font-size: clamp(14px, 1.5vw, 18px); color: var(--coral-deep); width: 9em; text-align: center;
  outline: none; padding: 2px 4px;
}
.cert-name-row input::placeholder { color: rgba(207, 92, 40, .45); }
.cert-after { font-size: clamp(14px, 1.6vw, 20px); color: var(--ink-soft); }
.cert-sign { display: flex; align-items: flex-end; justify-content: space-between; width: 82%; margin-top: 1.5%; }
.cert-date { font-size: clamp(11px, 1.25vw, 16px); color: var(--ink-soft); letter-spacing: .08em; }
.cert-seal {
  border: 2.5px solid var(--coral); color: var(--coral); border-radius: 50%;
  width: clamp(52px, 7vw, 86px); height: clamp(52px, 7vw, 86px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 800; font-size: clamp(9px, 1vw, 13px); line-height: 1.35; letter-spacing: .1em;
  transform: rotate(-8deg); opacity: .85;
}
.cert-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }

/* ---------- 列印：只印證書 ---------- */
@media print {
  @page { size: A4 landscape; margin: 0; }
  body.cert-open .topbar,
  body.cert-open .shell { display: none !important; }
  body.cert-open .cert-overlay { position: static; background: none; padding: 0; display: block; }
  body.cert-open .cert-sheet { width: 297mm; box-shadow: none; padding: 0; border-radius: 0; }
  body.cert-open .cert-actions { display: none !important; }
  body.cert-open .cert-frame { width: 297mm; height: 210mm; aspect-ratio: auto; }
}

/* ---------- 09 全站搜尋 ---------- */
.search-box {
  display: flex; gap: 10px; align-items: center;
  position: relative; z-index: 1;
}
.search-box input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 16px;
  padding: 11px 16px;
  border: 2px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  outline: none;
}
.search-box input:focus-visible { border-color: var(--coral); box-shadow: none; }
.search-meta { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.search-results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.search-hit button {
  width: 100%; text-align: left; font: inherit;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; padding: 12px 16px;
  display: grid; gap: 6px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.search-hit button:hover {
  border-color: var(--coral);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.hit-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hit-season {
  font-size: 12px; letter-spacing: .04em;
  color: var(--navy); background: var(--paper-2);
  border-radius: 999px; padding: 3px 10px;
}
.hit-loc { font-size: 12px; color: var(--ink-soft); }
.hit-en { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.hit-zh { margin: 0; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.hit-words { font-size: 12px; color: var(--ink-soft); }
.search-hit mark, .search-results mark {
  background: rgba(244, 162, 54, .32); color: inherit;
  border-radius: 4px; padding: 0 1px;
}
.search-empty {
  border: 1.5px dashed var(--line); border-radius: 14px;
  padding: 16px; text-align: center;
  color: var(--ink-soft); font-size: 14px;
}

/* ---------- 10 使用說明 ---------- */
.guide { display: grid; gap: 10px; max-width: 760px; }
.guide details {
  border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; overflow: hidden;
}
.guide summary {
  cursor: pointer; font-weight: 700; font-size: 15px;
  padding: 13px 18px;
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after {
  content: "+"; margin-left: auto;
  font-size: 18px; color: var(--ink-soft);
  transition: transform .2s ease;
}
.guide details[open] summary::after { transform: rotate(45deg); }
.guide details[open] summary { border-bottom: 1.5px dashed var(--line); }
.guide-body { padding: 12px 18px 15px; font-size: 14px; line-height: 1.8; color: var(--ink); }
.guide-body p { margin: 0 0 8px; }
.guide-body p:last-child { margin-bottom: 0; }

/* ---------- 響應式 ---------- */
@media (max-width: 1080px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 14px; }
  .season-tabs { order: 4; width: 100%; }
  .week-switch { margin-left: auto; }
  .shell { grid-template-columns: minmax(0,1fr); gap: 20px; padding-top: 22px; }
  .sidenav { position: static; }
  .sidenav-title { display: none; }
  #sideNav {
    flex-direction: row; overflow-x: auto; border-left: none;
    border-bottom: 2px solid var(--line); padding-bottom: 8px; gap: 6px;
  }
  #sideNav a { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; padding: 8px 12px; }
  #sideNav a.active { border-left-color: transparent; border-bottom-color: var(--coral); }
  .sidenav-note { display: none; }
  .hero { grid-template-columns: minmax(0,1fr); }
  .today-grid { grid-template-columns: minmax(0,1fr); }
  .map-route, .badges { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .map-route.is-season2 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .hero-unitline { gap: 16px; }
  .season-tab { padding: 5px 10px; }
  .season-tab b { font-size: 11.5px; letter-spacing: .04em; }
  .season-tab small { font-size: 9.5px; white-space: nowrap; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 12px; padding: 10px 14px; }
  .season-tabs { order: 4; width: 100%; flex-wrap: wrap; justify-content: center; }
  .season-tab { flex: 0 1 calc(33.33% - 6px); align-items: center; text-align: center; padding: 6px 8px; }
  .week-switch { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .topbar-progress { margin-left: auto; }
  .shell { padding: 18px 14px 48px; }
  .panel { padding: 20px 16px 22px; }
  .hero { padding: 22px 18px; border-radius: 20px; }
  .hero h1 { font-size: 22px; }
  .hero-title { font-size: 27px; }
  .route { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .route::before { display: none; }
  .map-route, .badges { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .map-route.is-season2, .badges.is-season2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero-line { font-size: 12.5px; }
  .panel-head h2 { font-size: 19px; }
  .panel-sub { margin-left: 0; width: 100%; }
  .sentence { font-size: 19px; }
  .stamp-corner { width: 52px; height: 52px; font-size: 10px; }
  .stats-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .stat-figure strong { font-size: 28px; }
  .cert-overlay { padding: 12px; }
  .cert-sheet { padding: 12px; }
  .cert-actions { flex-wrap: wrap; }
}

/* 小手機（≤480px）：再收緊一級，避免橫向溢出 */
@media (max-width: 480px) {
  .topbar-inner { padding: 8px 10px; gap: 8px 10px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { display: none; }
  .season-tab { flex: 0 1 calc(50% - 4px); padding: 6px; }
  .week-picker select { max-width: 52vw; }
  .ring-meta small { display: none; }
  .shell { padding: 14px 10px 40px; }
  .panel { padding: 16px 12px 18px; }
  .hero { padding: 18px 14px; }
  .hero-title { font-size: 23px; }
  .hero-stats { gap: 14px 18px; }
  .hero-stats dd { font-size: 17px; }
  .sentence { font-size: 17px; }
  .route { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .route button { padding: 10px 6px 8px; }
  .day-nav { gap: 8px; }
  .day-nav .mini-btn.wide { padding: 0 10px; font-size: 13px; }
  .badges { gap: 10px; }
  .badges .seal { width: 54px; height: 54px; font-size: 10.5px; }
  .share-actions .btn { flex: 1 1 46%; justify-content: center; }
  .stat-figure strong { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
