:root {
  --ink: #3b2f24; --ink-soft: #7a6a58; --paper: #fbf5e6; --paper-2: #f3e8cf; --line: #dccba6;
  --sea-1: #8fd3e8; --sea-2: #4aa3c7; --gold: #d99a1c; --seal: #c0392b; --ok: #2e7d4f; --warn: #b8741a;
  --shadow: 0 6px 20px rgba(59, 47, 36, .18);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.loading { padding: 40px; text-align: center; color: var(--ink-soft); }

.btn { border: 2px solid var(--ink); background: #fff; border-radius: 10px; padding: 8px 16px; font-weight: 600; box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--gold); }
.btn.danger { background: #f6d5cf; }
.btn.small { padding: 4px 10px; font-size: 14px; box-shadow: 0 2px 0 var(--ink); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; text-decoration: underline; }
:focus-visible { outline: 3px solid #1d6fd1; outline-offset: 2px; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 2px solid var(--line); border-radius: 8px; background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
.hint { color: var(--ink-soft); font-size: 14px; }
.error { color: var(--seal); font-weight: 600; min-height: 1.6em; margin: 8px 0 0; }

/* 登入 */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(180deg, var(--sea-1), var(--sea-2)); }
.login-card { width: min(420px, 100%); background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0; font-size: 26px; }
.login-card .sub { margin: 2px 0 14px; color: var(--ink-soft); }
.login-card .btn { width: 100%; margin-top: 18px; }

/* 頂欄 */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--paper-2); border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.topbar h1 { font-size: 18px; margin: 0; margin-right: auto; }
.chip { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; font-weight: 700; white-space: nowrap; }
.chip.coin::before { content: "🪙 "; }

/* 地圖 */
.map-shell { position: relative; background: radial-gradient(circle at 30% 20%, var(--sea-1), var(--sea-2)); overflow: hidden; }
.world { position: absolute; left: 0; top: 0; width: 1600px; height: 1000px; transform-origin: 0 0; }
.wave { position: absolute; color: rgba(255,255,255,.55); font-size: 28px; user-select: none; pointer-events: none; }
.island { position: absolute; width: 210px; height: 150px; margin: -75px 0 0 -105px; border: 0; background: none; padding: 0; text-align: center; }
.island .land { position: absolute; inset: 14px 6px 34px; border-radius: 52% 48% 46% 54% / 58% 54% 46% 42%; border: 4px solid var(--ink);
  box-shadow: 0 10px 0 #e9d9a8, 0 14px 0 var(--ink), 0 22px 18px rgba(0,0,0,.2); display: grid; place-items: center; font-size: 54px; transition: transform .15s; }
.island:hover .land, .island.near .land { transform: translateY(-5px) scale(1.04); }
.island .tag { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 14px; font-weight: 700; white-space: nowrap; font-size: 20px; }
.island .tag small { color: var(--ink-soft); font-weight: 600; margin-left: 6px; }
.island.done .tag { background: #ffe9a8; }
.island .sealmark { position: absolute; right: 8px; top: 0; }
.avatar { position: absolute; width: 56px; height: 56px; margin: -46px 0 0 -28px; font-size: 44px; line-height: 56px; text-align: center; pointer-events: none;
  filter: drop-shadow(0 6px 3px rgba(0,0,0,.3)); z-index: 5; }
.avatar.walking { animation: bob .35s infinite alternate; }
@keyframes bob { to { transform: translateY(-5px); } }
.map-hint { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.9); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 12px; font-size: 14px; z-index: 6; }
.enter-btn { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 6; }

/* 印章 */
.seal { display: inline-grid; place-items: center; width: 64px; height: 64px; border: 3px double var(--seal); border-radius: 50%; color: var(--seal);
  font-weight: 800; font-size: 12px; line-height: 1.15; text-align: center; transform: rotate(-12deg); background: rgba(192,57,43,.06); flex: none; padding: 4px; overflow: hidden; }
.seal b { font-size: 16px; display: block; }
.seal.big { width: 46px; height: 46px; font-size: 20px; background: #fff; }

/* 彈窗 */
.modal-back { position: fixed; inset: 0; background: rgba(40,30,20,.55); display: grid; place-items: center; padding: 12px; z-index: 50; }
.modal { background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; width: min(760px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow); }
.modal.narrow { width: min(460px, 100%); }
.modal header { position: sticky; top: 0; background: var(--paper-2); border-bottom: 2px solid var(--line); padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; z-index: 1; }
.modal header h2 { margin: 0; font-size: 21px; }
.modal header p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.modal header .close { margin-left: auto; }
.modal .body { padding: 14px 18px 20px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.bar { height: 14px; background: #fff; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); }
h3.sec { margin: 20px 0 6px; font-size: 16px; border-left: 6px solid var(--gold); padding-left: 8px; }

.item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 8px; }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item .meta { font-size: 13px; color: var(--ink-soft); }
.item .fb { font-size: 14px; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: var(--paper-2); overflow-wrap: anywhere; }
.item.approved { border-color: #e2b6ae; background: #fffaf7; }
.item.pending { border-color: #e6cf8f; background: #fffbea; }
.item.returned { border-color: #e2a08f; }
.state { font-size: 13px; font-weight: 700; white-space: nowrap; }
.state.pending { color: var(--warn); }
.state.returned { color: var(--seal); }

/* 老師與管理員 */
.page { max-width: 980px; margin: 0 auto; padding: 16px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 2px solid var(--ink); background: #fff; border-radius: 999px; padding: 4px 16px; font-weight: 700; }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; }
.card { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card .who { font-weight: 700; }
.card .what { margin: 4px 0; overflow-wrap: anywhere; }
.card .note { background: var(--paper-2); border-radius: 8px; padding: 6px 10px; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: end; margin-top: 8px; }
.review-row label { margin-top: 0; font-size: 14px; }
.empty { text-align: center; color: var(--ink-soft); padding: 36px 12px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; white-space: nowrap; }
th { background: var(--paper-2); font-size: 14px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.bad { color: var(--seal); font-weight: 700; }
.good { color: var(--ok); font-weight: 700; }

.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.pass-cell { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 10px; text-align: left; }
.pass-cell .top { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.pass-cell .top span { font-size: 26px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 99; max-width: 90vw; }
#toast.show { opacity: 1; }
@media (max-width: 560px) { .review-row { grid-template-columns: 1fr; } .item { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .avatar.walking { animation: none; } .island .land, .btn { transition: none; } }

/* ================= 遊戲場景皮膚（C-004） ================= */
:root { --display: "LXGW WenKai TC", "PingFang TC", "Noto Sans TC", system-ui, sans-serif; --navy: #12384f; }
h1, h2, h3, .sign, .plank, .btn, .seal, .tabs button, .logo { font-family: var(--display); }

/* 海 */
.map-shell, .scene { background: radial-gradient(120% 90% at 30% 10%, #9be7f2 0%, #55c3de 38%, #2a93c4 72%, #1f6fa8 100%); }
.waves { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='90'%3E%3Cpath d='M10 30 q12 -12 24 0 q12 12 24 0' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' opacity='.7'/%3E%3Cpath d='M130 70 q10 -10 20 0 q10 10 20 0' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' opacity='.45'/%3E%3C/svg%3E");
  animation: drift 14s linear infinite; }
@keyframes drift { to { background-position: 220px 0; } }
.world .wave { display: none; }
.decor { position: absolute; inset: 0; width: 1600px; height: 1000px; pointer-events: none; }
.gull { animation: gull 9s ease-in-out infinite; }
.gull.g2 { animation-duration: 12s; animation-delay: -4s; } .gull.g3 { animation-duration: 10s; animation-delay: -7s; }
@keyframes gull { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(60px, -26px); } }
.buoy { animation: bobSea 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
.buoy.b2 { animation-delay: -1.4s; }
@keyframes bobSea { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
.cloud { position: absolute; width: 260px; height: 70px; border-radius: 60px; background: #fff; opacity: .26; filter: blur(2px); pointer-events: none; z-index: 7;
  box-shadow: 70px -26px 0 -6px #fff, 140px -8px 0 -12px #fff; animation: cloud 60s linear infinite; }
.cloud.c1 { top: 70px; left: -300px; } .cloud.c2 { top: 560px; left: -300px; animation-duration: 85s; animation-delay: -30s; transform: scale(.8); opacity: .2; }
.cloud.c3 { top: 860px; left: -300px; animation-duration: 72s; animation-delay: -50s; opacity: .18; }
@keyframes cloud { to { translate: 2000px 0; } }

/* 島 */
.island { width: 250px; height: 226px; margin: -113px 0 0 -125px; }
.island .art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 12px 10px rgba(8, 50, 80, .28)); transition: transform .18s cubic-bezier(.2, 1.4, .4, 1); }
.island:hover .art, .island.near .art, .island:focus-visible .art { transform: translateY(-8px) scale(1.06); }
.island.near .art { filter: drop-shadow(0 0 14px #fff8c4) drop-shadow(0 12px 10px rgba(8, 50, 80, .28)); }
.p-float { animation: float 4.5s ease-in-out infinite; }
.p-shadow { animation: shadow 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes shadow { 0%, 100% { transform: scale(1); } 50% { transform: scale(.86); } }
.twinkle { animation: twinkle 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.twinkle.t2 { animation-delay: -1.1s; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }
.sign { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: linear-gradient(#f9e7bd, #ecd193); border: 3px solid var(--ink); border-radius: 12px; padding: 3px 12px; box-shadow: 0 4px 0 var(--ink); font-size: 21px; color: var(--ink); }
.sign small { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.mini-bar { width: 46px; height: 9px; border: 2px solid var(--ink); border-radius: 9px; background: #fff; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: linear-gradient(#ffd45e, #f0a020); }
.island.done .sign { background: linear-gradient(#ffe58a, #f6c63c); }
.flag { position: absolute; right: 18px; top: 4px; background: var(--seal); color: #fff; font-family: var(--display); font-weight: 700; font-size: 17px; padding: 2px 10px; border: 3px solid var(--ink); border-radius: 8px; transform: rotate(8deg); box-shadow: 0 3px 0 var(--ink); }

/* 小船 */
.avatar { width: 96px; height: 96px; margin: -78px 0 0 -48px; font-size: 0; filter: drop-shadow(0 8px 5px rgba(8, 50, 80, .35)); }
.avatar svg { width: 100%; height: 100%; overflow: visible; }
.avatar.walking { animation: none; }
.avatar.left .boat-body { transform: scaleX(-1); transform-origin: 45px 45px; }
.avatar .boat-body { animation: rock 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
.avatar.left .boat-body { animation: none; }
.avatar .wake { opacity: .25; transition: opacity .3s; }
.avatar.walking .wake { opacity: .8; animation: wake .5s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes rock { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@keyframes wake { to { transform: scaleX(1.25); } }

/* HUD */
.hud { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; color: #fff;
  background: linear-gradient(#1a4d6b, var(--navy)); border-bottom: 4px solid #0b2535; box-shadow: inset 0 -3px 0 #f6b93b; position: relative; z-index: 8; }
.hud-id { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.portrait { width: 52px; height: 52px; border-radius: 14px; background: radial-gradient(#9be7f2, #2a93c4); border: 3px solid #f6b93b; box-shadow: 0 3px 0 #0b2535; flex: none; overflow: hidden; }
.portrait svg { width: 100%; height: 100%; } .portrait .wake { display: none; }
.hud-name strong { font-family: var(--display); font-size: 19px; display: block; line-height: 1.2; }
.xp { position: relative; width: 190px; max-width: 46vw; height: 20px; background: #0b2535; border: 2px solid #f6b93b; border-radius: 12px; overflow: hidden; margin-top: 3px; }
.xp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#7be08a, #2fa85a); border-radius: 0 10px 10px 0; transition: width .6s; }
.xp span { position: relative; display: block; text-align: center; font-size: 12.5px; font-weight: 700; line-height: 16px; text-shadow: 0 1px 2px #000; }
.hud-coin { display: flex; align-items: center; gap: 6px; background: #0b2535; border: 2px solid #f6b93b; border-radius: 999px; padding: 3px 14px 3px 6px; font-size: 20px; font-variant-numeric: tabular-nums; }
.coin-ico { width: 26px; height: 26px; }
.hud-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.plank { border: 3px solid var(--ink); border-radius: 10px; padding: 5px 14px; font-weight: 700; font-size: 17px; color: var(--ink);
  background: linear-gradient(#f9e7bd, #e6c583); box-shadow: 0 4px 0 #0b2535; transition: transform .08s, box-shadow .08s; }
.plank:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #0b2535; } .plank:active { transform: translateY(3px); box-shadow: 0 1px 0 #0b2535; }
.plank.mini { font-size: 14px; padding: 5px 10px; background: linear-gradient(#e8eef2, #c3d0d8); }
.map-hint { background: rgba(11, 37, 53, .72); color: #fff; border: 0; border-radius: 999px; font-size: 13px; }
.enter-btn { font-size: 20px; padding: 10px 26px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.06); } }
.enter-btn:hover, .enter-btn:active { transform: translateX(-50%); }

/* 護照紙頁與印章 */
.modal { background: linear-gradient(#fdf7e8, #f6ecd2); border-width: 4px; border-radius: 20px; animation: pop .22s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.92) translateY(14px); opacity: 0; } }
.modal header.isle-head { background: linear-gradient(135deg, var(--c), #fdf7e8 85%); border-bottom: 4px solid var(--ink); align-items: center; }
.thumb { display: inline-block; width: 44px; height: 40px; flex: none; } .thumb .art { width: 100%; height: 100%; }
.thumb.big { width: 96px; height: 86px; margin: -8px 0; }
.thumb .p-float, .thumb .p-shadow, .thumb .twinkle { animation: none; }
.item { border-width: 2px; box-shadow: 0 3px 0 var(--line); }
.item.approved { background: linear-gradient(90deg, #fffdf8, #fff3ec); }
.seal { font-family: var(--display); width: 70px; height: 70px; border-width: 4px; box-shadow: inset 0 0 0 2px rgba(192, 57, 43, .25); }
.modal .seal { animation: stampIn .5s cubic-bezier(.2, 1.7, .4, 1) both; animation-delay: .12s; }
@keyframes stampIn { from { transform: rotate(-30deg) scale(2.6); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
.bar { height: 16px; } .bar i { background: linear-gradient(#ffd45e, #f0a020); transition: width .6s; }
h3.sec { font-size: 19px; }
.pass-cell { border-width: 3px; border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); transition: transform .1s; }
.pass-cell:hover { transform: translateY(-3px); }
.pass-cell .top { font-family: var(--display); font-size: 19px; }

/* 慶祝 */
.celebrate { position: relative; padding: 26px 20px 22px; text-align: center; overflow: hidden; }
.celebrate h2 { font-size: 30px; margin: 0; color: var(--seal); }
.big-coin { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 40px; margin: 6px 0 12px; font-family: var(--display); }
.big-coin .coin-ico { width: 46px; height: 46px; animation: spin 1.2s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotateY(180deg); } }
.fresh { display: flex; gap: 12px; align-items: center; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 9px; height: 15px; background: var(--c); border-radius: 2px; animation: fall 2.4s var(--d) ease-in infinite; }
@keyframes fall { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }

/* 登入場景 */
.scene { position: relative; overflow: hidden; }
.scene .deco { position: absolute; pointer-events: none; }
.scene .d1 { width: 300px; left: 4%; bottom: 8%; } .scene .d2 { width: 260px; right: 5%; bottom: 14%; } .scene .d3 { width: 200px; right: 16%; top: 6%; }
.scene .d4 { width: 110px; left: 22%; top: 20%; animation: sail 9s ease-in-out infinite alternate; }
.scene .deco svg { width: 100%; height: auto; overflow: visible; }
@keyframes sail { to { transform: translate(90px, 30px); } }
.login-card { position: relative; z-index: 3; border-width: 4px; border-radius: 22px; box-shadow: 0 8px 0 var(--ink), 0 22px 40px rgba(8, 50, 80, .4); background: linear-gradient(#fdf7e8, #f6ecd2); }
.kicker { margin: 0; font-weight: 700; color: var(--ink-soft); letter-spacing: .12em; font-size: 14px; }
.logo { font-size: 46px !important; line-height: 1.1; margin: 4px 0 8px !important; color: var(--navy); text-shadow: 3px 3px 0 #f6b93b; }

@media (max-width: 640px) { .scene .d2, .scene .d3 { display: none; } .scene .d1 { width: 190px; bottom: 2%; } .hud-name strong { font-size: 16px; } .plank { font-size: 15px; padding: 4px 10px; } }
@media (prefers-reduced-motion: reduce) {
  .waves, .cloud, .gull, .buoy, .p-float, .p-shadow, .twinkle, .avatar .boat-body, .avatar .wake, .enter-btn, .modal, .modal .seal, .big-coin .coin-ico, .confetti i, .scene .d4 { animation: none !important; }
  .confetti { display: none; }
}

/* 申請與蓋章日期 */
.dates { margin: 6px 0 0; font-size: 13.5px; display: grid; gap: 2px; }
.dates div { display: flex; gap: 8px; flex-wrap: wrap; }
.dates dt { font-weight: 700; color: var(--ink-soft); min-width: 4.2em; }
.dates dd { margin: 0; font-variant-numeric: tabular-nums; }

/* 點陣圖素材 */
.art.raster { display: block; }
.art.raster img { width: 100%; height: 100%; object-fit: contain; display: block; }
.island .art.raster { inset: -22px -10px -2px; width: auto; height: auto; }
.island .art.raster.planet img { animation: float 4.5s ease-in-out infinite; }
.thumb .art.raster img { animation: none; }
.boat-raster { display: block; width: 100%; height: 100%; }
.boat-raster img { width: 100%; height: 100%; object-fit: contain; }
.avatar.left .boat-raster img { transform: scaleX(-1); animation: none; }

/* 手繪點陣圖上線後的版面微調（C-006） */
.island { width: 270px; height: 250px; margin: -125px 0 0 -135px; }
.island .art.raster { inset: -18px -6px 6px; }
.island[data-island="di"] .art.raster img { transform: scale(1.2); transform-origin: 50% 82%; }
.island .art.raster.planet img { transform-origin: center; }
.sign { bottom: -10px; }
.flag { right: 6px; top: 10px; }
.enter-btn { top: 14px; bottom: auto; }
.map-hint { top: auto; bottom: 12px; }
.avatar { width: 112px; height: 112px; margin: -92px 0 0 -56px; }
.portrait .boat-raster img { width: 100%; height: 100%; object-fit: contain; animation: none; }
.scene .deco .art.raster { display: block; width: 100%; aspect-ratio: 1; }
.scene .deco .boat-raster { display: block; aspect-ratio: 1; }
.thumb .art.raster { width: 100%; height: 100%; }
.thumb.big { width: 104px; height: 104px; margin: -14px 0; }

/* 登島按鈕跟著靠近的島，浮在島的上方 */
.world .enter-btn { left: 0; top: 0; bottom: auto; font-size: 30px; padding: 10px 28px; border-width: 4px; border-radius: 16px; z-index: 9; white-space: nowrap;
  transform: translate(-50%, -100%); animation: hop 1s ease-in-out infinite; }
.world .enter-btn:hover, .world .enter-btn:active { transform: translate(-50%, -100%); }
@keyframes hop { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, calc(-100% - 8px)); } }
.map-hint { top: 12px; bottom: auto; }
@media (prefers-reduced-motion: reduce) { .world .enter-btn { animation: none; } }

/* 探險日記與商店（C-007） */
.big-emoji { font-size: 52px; line-height: 1; }
.cheer { background: linear-gradient(90deg, #fff3c4, #ffe1a8); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; font-family: var(--display); font-size: 20px; box-shadow: 0 4px 0 var(--ink); animation: pop .3s cubic-bezier(.2, 1.5, .4, 1); }
.diary { background: #fffdf6; border: 2px solid var(--line); border-left: 8px solid var(--gold); border-radius: 12px; padding: 12px 14px; margin-top: 12px; box-shadow: 0 3px 0 var(--line);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(220, 203, 166, .35) 27px 28px); }
.diary header { position: static; background: none; border: 0; padding: 0; display: flex; gap: 8px; align-items: center; font-family: var(--display); font-size: 19px; }
.diary-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 28px; margin: 4px 0 8px; }
.diary.reviewed { border-left-color: var(--ok); }
.teacher-fb { background: #eaf6ee; border: 2px solid #b9dcc4; } .plus { color: var(--warn); white-space: nowrap; }
.tagk { display: inline-block; font-size: 13px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; font-family: var(--display); }
.tagk.k-round { background: #ffd9d2; } .tagk.k-class { background: #d6e9ff; } .tagk.k-other { background: #e8e2d2; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.shop-card { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 10px; text-align: center; box-shadow: 0 5px 0 var(--ink); display: flex; flex-direction: column; gap: 4px; transition: transform .1s; }
.shop-card:hover { transform: translateY(-3px); }
.shop-card strong { font-family: var(--display); font-size: 18px; }
.shop-card .hint { margin: 0; flex: 1; font-size: 13px; }
.shop-card.owned { background: linear-gradient(#fffdf6, #f1f8ee); } .shop-card.on { border-color: var(--warn); box-shadow: 0 5px 0 var(--warn), 0 0 0 4px #ffe58a; }
.shop-art { height: 108px; display: grid; place-items: center; background: radial-gradient(circle, #fff7d6, transparent 70%); }
.shop-art .item-ico { width: 104px; height: 104px; object-fit: contain; } .shop-art .item-ico.emoji { font-size: 62px; line-height: 104px; }
.shop-card:not(.owned) .shop-art .item-ico { filter: saturate(.75); }
.shop-card .btn .coin-ico { width: 18px; height: 18px; vertical-align: -3px; }
.equipped { display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle; }
.equipped .item-ico { width: 26px; height: 26px; object-fit: contain; } .equipped .item-ico.emoji { font-size: 19px; line-height: 26px; }
.hud-coin.dark { color: #fff; margin-left: auto; }
.modal header .hud-coin.dark + .close { margin-left: 8px; }

/* 國考試煉場與教授問答（C-008） */
.island.arena .sign { background: linear-gradient(#ffe58a, #f3b33d); }
.prof { position: absolute; width: 120px; height: 120px; margin: -96px 0 0 -60px; z-index: 6; pointer-events: none; animation: profIn .8s cubic-bezier(.2, 1.3, .4, 1); filter: drop-shadow(0 8px 5px rgba(8, 50, 80, .35)); }
.prof-img { width: 100%; height: 100%; object-fit: contain; display: block; } .prof-img.emoji { font-size: 80px; line-height: 120px; text-align: center; }
@keyframes profIn { from { transform: translateX(260px); opacity: 0; } }
.prof-head .prof-img.emoji { font-size: 64px; line-height: 104px; }
.q-prompt { font-size: 19px; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 12px; }
.q-opts { display: grid; gap: 8px; }
.q-opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 9px 12px; box-shadow: 0 4px 0 var(--ink); transition: transform .08s; }
.q-opt:hover:not(:disabled) { transform: translateY(-2px); background: #fff8dc; }
.q-opt b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--display); }
.q-opt span { flex: 1; overflow-wrap: anywhere; } .q-opt em { font-style: normal; font-weight: 700; font-size: 13px; white-space: nowrap; padding: 1px 8px; border-radius: 999px; background: #fff; border: 2px solid currentColor; }
.q-opt:disabled { cursor: default; opacity: 1; color: var(--ink); box-shadow: 0 2px 0 var(--line); border-color: var(--line); }
.q-opt.right { background: #dff3e4; border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); } .q-opt.right em { color: var(--ok); }
.q-opt.wrong { background: #fde3de; border-color: var(--seal); box-shadow: 0 4px 0 var(--seal); } .q-opt.wrong em { color: var(--seal); }
.q-verdict { font-family: var(--display); font-size: 22px; margin: 14px 0 4px; } .q-verdict.ok { color: var(--ok); } .q-verdict.no { color: var(--seal); }
.subj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.subj { border: 3px solid var(--ink); border-radius: 14px; padding: 12px; text-align: left; box-shadow: 0 5px 0 var(--ink); background: #fff; transition: transform .08s; }
.subj:hover { transform: translateY(-3px); } .subj b { display: block; font-family: var(--display); font-size: 20px; } .subj small { color: var(--ink-soft); }
.subj.all { background: linear-gradient(#ffe58a, #f3b33d); } .subj.s0 { background: #ffe1dc; } .subj.s1 { background: #e2f3d8; } .subj.s2 { background: #dcecff; } .subj.s3 { background: #fff0cf; } .subj.s4 { background: #ecdcff; } .subj.s5 { background: #d9f2ee; }
.stat-list { display: grid; gap: 8px; margin: 10px 0; } .stat { display: grid; grid-template-columns: 9em 1fr 9em; gap: 10px; align-items: center; } .stat small { color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.wrongq { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.wrongq summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; } .wrongq li { margin: 4px 0; overflow-wrap: anywhere; } .wrongq li.right { color: var(--ok); font-weight: 700; } .wrongq li.wrong { color: var(--seal); }
@media (max-width: 560px) { .stat { grid-template-columns: 1fr; gap: 2px; } .stat small { text-align: left; } }
@media (prefers-reduced-motion: reduce) { .prof { animation: none; } }
