/* 搶在漲潮前！官方攻略站：漫畫風（粗框＋硬陰影），海洋配色；淺色／深色都在這一個檔 */
:root {
  --bg: #fff5df;
  --bg-dot: rgba(19, 33, 60, .07);
  --text: #16223d;
  --muted: #55627d;
  --ink: #13213c;
  --card: #ffffff;
  --card-2: #fff9ec;
  --soft: #eef6ff;
  --sea: #1f6fe5;
  --sea-2: #1458c2;
  --deep: #0c2f63;
  --teal: #12b3a1;
  --sun: #ffd23f;
  --sun-2: #f2b705;
  --coral: #ff6b57;
  --mint: #d9f7ef;
  --sky: #dcecff;
  --link: #1458c2;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 7px 7px 0 var(--ink);
  --radius: 16px;
  --font: "Baloo 2", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans", "Noto Sans JP", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans", "Noto Sans JP", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a1631;
  --bg-dot: rgba(120, 170, 255, .08);
  --text: #e9f1ff;
  --muted: #a7b7d6;
  --ink: #02060f;
  --card: #13244a;
  --card-2: #0f1e3f;
  --soft: #172d59;
  --sky: #18325f;
  --mint: #123d3c;
  --link: #8cc0ff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a1631; --bg-dot: rgba(120, 170, 255, .08); --text: #e9f1ff; --muted: #a7b7d6; --ink: #02060f;
    --card: #13244a; --card-2: #0f1e3f; --soft: #172d59; --sky: #18325f; --mint: #123d3c; --link: #8cc0ff; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font); line-height: 1.2; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 800; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sun); color: #111; padding: 8px 14px; border: 3px solid var(--ink); border-radius: 10px; z-index: 99; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; }

/* ---------- 頁首 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--card);
  border-bottom: 3px solid var(--ink);
}
.head-in { display: flex; align-items: center; gap: 14px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { width: 46px; height: 46px; border-radius: 12px; border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.brand b { display: block; font-family: var(--font); font-size: 1.12rem; line-height: 1.1; }
.brand small { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a.nav-link { padding: 8px 12px; border-radius: 12px; font-weight: 800; color: var(--text); text-decoration: none; border: 3px solid transparent; }
.nav a.nav-link:hover { border-color: var(--ink); background: var(--soft); }
.nav a.nav-link[aria-current="page"] { background: var(--sun); color: #16223d; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.tools { display: flex; align-items: center; gap: 8px; }
.pill-btn, .lang > summary, .menu > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 7px 12px; border-radius: 12px; border: 3px solid var(--ink); background: var(--card); color: var(--text);
  font: 800 .92rem var(--font-body); box-shadow: 3px 3px 0 var(--ink); user-select: none;
}
.lang > summary::-webkit-details-marker, .menu > summary::-webkit-details-marker { display: none; }
.pill-btn:hover, .lang > summary:hover, .menu > summary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.lang, .menu { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 60;
  background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 6px;
}
.pop a, .pop button { display: flex; width: 100%; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 700; background: none; border: 0; font: 700 .95rem var(--font-body); cursor: pointer; text-align: left; }
.pop a:hover, .pop button:hover { background: var(--soft); }
.pop a[aria-current="true"], .pop button[aria-pressed="true"] { background: var(--sun); color: #16223d; }
.btn-play-sm { padding: 7px 14px; white-space: nowrap; }
.lang > summary, .menu > summary { white-space: nowrap; }
.menu { display: none; }
.pop .pop-label { display: block; padding: 8px 10px 2px; font-size: .78rem; font-weight: 800; color: var(--muted); border-top: 2px solid var(--soft); margin-top: 4px; }
.menu-theme { display: none; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 16px; border: 3px solid var(--ink);
  font: 800 1.08rem var(--font); text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-sun { background: var(--sun); color: #16223d; }
.btn-white { background: var(--card); color: var(--text); }
.btn-sea { background: var(--sea); color: #fff; }

/* ---------- 共用區塊 ---------- */
main { display: block; }
.section { padding: clamp(40px, 7vw, 72px) 0; }
.kicker {
  display: inline-block; padding: 3px 12px; border-radius: 999px; border: 3px solid var(--ink);
  background: var(--sky); color: var(--text); font: 800 .78rem var(--font); letter-spacing: .12em; margin-bottom: 10px;
}
.lead { font-size: 1.12rem; color: var(--muted); max-width: 820px; }
.card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.grid { display: grid; gap: 22px; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px;
  border: 3px solid var(--ink); background: var(--sun); color: #16223d; font-weight: 800; font-size: .88rem;
  box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1.5deg);
}
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

/* ---------- 首頁主視覺 ---------- */
.hero { padding: clamp(32px, 6vw, 64px) 0 clamp(40px, 6vw, 70px); }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero h1 { margin: 18px 0 14px; }
.hero h1 .hl { display: inline-block; background: linear-gradient(transparent 58%, var(--sun) 58%); padding: 0 .08em; }
.hero h1 .sub { display: block; font-size: .62em; color: var(--sea); }
:root[data-theme="dark"] .hero h1 .sub { color: #7fb6ff; }
:root[data-theme="dark"] .hero h1 .hl { background: linear-gradient(transparent 62%, rgba(31, 111, 229, .8) 62%); }
:root[data-theme="dark"] .loop .card:nth-child(2) .ico { background: #4a2430; }
:root[data-theme="dark"] .loop .ico { background: #1d3a6e; }
:root[data-theme="dark"] .loop .card:nth-child(3) .ico { background: #14433f; }
.hero + .section { padding-top: 16px; }
.hero .lead { margin-bottom: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-art { position: relative; }
.hero-frame {
  border: 4px solid var(--ink); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
  transform: rotate(1.6deg); background: var(--sky);
}
.hero-frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.sticker {
  position: absolute; top: -22px; right: -10px; z-index: 2;
  width: 108px; height: 108px; display: grid; place-items: center; text-align: center;
  background: var(--sun); color: #16223d; font: 800 1.15rem/1.1 var(--font);
  border: 4px solid var(--ink); border-radius: 50%; box-shadow: 4px 4px 0 var(--ink); transform: rotate(12deg);
}
.data-note { margin-top: 18px; font-size: .86rem; color: var(--muted); font-weight: 700; }

/* ---------- 搜・打・撤 ---------- */
.loop { counter-reset: step; }
.loop .card { position: relative; padding-top: 28px; }
.loop .ico { width: 76px; height: 76px; border-radius: 18px; border: 3px solid var(--ink); background: var(--sky); display: grid; place-items: center; margin-bottom: 12px; box-shadow: 3px 3px 0 var(--ink); }
.loop .ico img { width: 60px; height: 60px; }
.loop .card:nth-child(2) .ico { background: #ffe1db; }
.loop .card:nth-child(3) .ico { background: var(--mint); }
.loop .step { position: absolute; top: -16px; left: 18px; background: var(--ink); color: #fff; font: 800 .85rem var(--font); padding: 3px 12px; border-radius: 999px; }
:root[data-theme="dark"] .loop .step { background: var(--sun); color: #16223d; }
.loop h3 { font-size: 1.6rem; }

/* ---------- 潮汐時間軸 ---------- */
.tide-bar { display: flex; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); margin: 22px 0 18px; min-height: 64px; }
.tide-seg { padding: 10px 12px; color: #fff; font-weight: 800; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.tide-seg + .tide-seg { border-left: 3px solid var(--ink); }
.tide-seg small { font-weight: 700; opacity: .92; }
.seg-low { background: #12a594; }
.seg-rise { background: var(--sea); }
.seg-high { background: #1b2f68; }
.tide-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tide-legend .card { padding: 14px 16px; }
.tide-legend b { display: block; font-family: var(--font); font-size: 1.1rem; }

/* ---------- 數字 ---------- */
.stat { text-align: center; padding: 18px 10px; }
.stat b { display: block; font: 800 clamp(2rem, 5vw, 3rem)/1 var(--font); color: var(--sea); }
:root[data-theme="dark"] .stat b { color: #7fb6ff; }
.stat span { font-weight: 800; color: var(--muted); font-size: .95rem; }

/* ---------- 兌換代碼 ---------- */
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.code { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.code-txt { font: 800 1.25rem ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; background: var(--soft); border: 2px dashed var(--ink); padding: 4px 10px; border-radius: 10px; }
.code-info { flex: 1; min-width: 0; }
.code-info small { display: block; color: var(--muted); font-weight: 700; }
.code.is-expired { opacity: .55; }
.copy-btn { padding: 8px 14px; font-size: .95rem; border-radius: 12px; }

/* ---------- 更新 ---------- */
.upd ul { margin: 0; padding-left: 1.2em; }
.upd li { margin: .3em 0; }
.upd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.upd-head small { color: var(--muted); font-weight: 800; }

/* ---------- 攻略目錄卡 ---------- */
.guide-card { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--text); transition: transform .12s ease, box-shadow .12s ease; }
.guide-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.guide-card img { width: 84px; height: 84px; flex-shrink: 0; }
.guide-card h3 { margin-bottom: 4px; }
.guide-card p { margin: 0; color: var(--muted); }
.guide-more { border-style: dashed; box-shadow: none; display: flex; align-items: center; color: var(--muted); font-weight: 700; }

/* ---------- 內頁標題 ---------- */
.page-hero { padding: clamp(28px, 5vw, 52px) 0 10px; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 3px solid var(--ink); background: var(--card); color: var(--text); font-weight: 800; text-decoration: none; box-shadow: 3px 3px 0 var(--ink);
}
.chip:hover { background: var(--sun); color: #16223d; }
.chip img { width: 28px; height: 28px; }
.chip small { background: var(--ink); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .78rem; }
.note-box { background: var(--card-2); }
.note-box ul { margin: 0; padding-left: 1.2em; }
.note-box li { margin: .35em 0; }

/* ---------- 武器 ---------- */
.cat-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.cat-head h2 { margin: 0; }
.keyhint { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); font-weight: 800; font-size: .95rem; color: var(--muted); }
.keyhint .keycap { min-width: 28px; height: 28px; font-size: .9rem; color: var(--text); }
.keycap { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 3px solid var(--ink); border-bottom-width: 6px; border-radius: 9px; background: var(--card); font: 800 1rem var(--font); }
.table-wrap { overflow-x: auto; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); background: var(--card); margin: 18px 0 26px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: .95rem; white-space: nowrap; }
.cmp th, .cmp td { padding: 9px 12px; border-bottom: 2px solid var(--soft); text-align: right; }
.cmp th:first-child, .cmp td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.cmp thead th { background: var(--ink); color: #fff; position: sticky; top: 0; }
.cmp thead th:first-child { background: var(--ink); }
.cmp th button { all: unset; cursor: pointer; font-weight: 800; }
.cmp th button::after { content: " ⇅"; opacity: .5; font-size: .8em; }
.cmp th[aria-sort="ascending"] button::after { content: " ▲"; opacity: 1; }
.cmp th[aria-sort="descending"] button::after { content: " ▼"; opacity: 1; }
.cmp tbody tr:hover td { background: var(--soft); }
.cmp td a { color: var(--text); font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.cmp td a:hover { text-decoration: underline; }
.cmp td img { width: 30px; height: 30px; }
.cmp .tag { font-size: .8rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--soft); }
.cmp .tag.pass { background: var(--sun); color: #16223d; }

.wcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.wcard { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 90px; }
.wcard:target { outline: 4px solid var(--sun); outline-offset: 4px; }
.w-top { display: flex; gap: 14px; align-items: center; }
.w-ico { width: 84px; height: 84px; flex-shrink: 0; border-radius: 18px; border: 3px solid var(--ink); background: var(--soft); display: grid; place-items: center; position: relative; box-shadow: inset 0 -6px 0 var(--tier, #d6dce4); }
.w-ico img { width: 68px; height: 68px; }
.w-ico .emo { font-size: 2.2rem; }
.w-name h3 { margin: 0; }
.w-name .en { color: var(--muted); font-weight: 700; font-size: .9rem; }
.w-name .tier { display: inline-block; margin-top: 4px; font-size: .78rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; border: 2px solid var(--ink); background: var(--tier, #d6dce4); color: #16223d; }
.w-desc { margin: 0; color: var(--muted); }
.w-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.w-stats span { background: var(--soft); border: 2px solid var(--ink); border-radius: 10px; padding: 3px 10px; font-weight: 800; font-size: .92rem; }
.w-stats span i { font-style: normal; color: var(--muted); font-weight: 700; margin-right: 4px; }
.w-pvp { font-size: .9rem; color: var(--muted); margin: 0; }
.moves { display: grid; gap: 8px; }
.move { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; background: var(--card-2); border: 2px solid var(--ink); border-radius: 12px; padding: 9px 12px; }
.move .k { grid-row: span 2; }
.move b { font-family: var(--font); font-size: 1.02rem; }
.move p { margin: 0; font-size: .93rem; }
.move small { grid-column: 2; color: var(--muted); font-weight: 700; font-size: .82rem; }
.obtain { border-top: 2px dashed var(--soft); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .93rem; font-weight: 700; }
.mat { display: inline-flex; align-items: center; gap: 4px; background: var(--card-2); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px 1px 3px; }
.mat img { width: 24px; height: 24px; }
.obtain .rank { color: var(--coral); }
.obtain .pass { background: var(--sun); color: #16223d; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; }

/* ---------- 第二批頁面 ---------- */
.section.sub { padding: 34px 0 6px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nav-more > summary { box-shadow: none; border-color: transparent; background: none; padding: 8px 12px; }
.nav-more > summary.on { background: var(--sun); color: #16223d; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.nav-more > summary:hover { border-color: var(--ink); background: var(--soft); transform: none; box-shadow: none; }
.keygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.keyrow { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.keyrow .keycap { min-width: 34px; font-size: .9rem; }
ol.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
ol.steps li { counter-increment: s; position: relative; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px 14px 62px; }
ol.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); color: #16223d; border: 3px solid var(--ink); display: grid; place-items: center; font: 800 1rem var(--font); }
ul.steps-ul, ul.rules { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.rtag { display: inline-block; font-size: .8rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; border: 2px solid var(--ink); background: var(--rc, #d6dce4); color: #16223d; white-space: nowrap; }
.w-name .rtag { margin-top: 4px; }
.qtag { font-weight: 800; padding: 1px 10px; border-radius: 999px; border: 2px solid var(--ink); color: #16223d; }
.qtag.q1 { background: #d68a48; } .qtag.q2 { background: #d6e2ee; } .qtag.q3 { background: #ffcc40; } .qtag.q4 { background: #ff6858; }
.cmp .nm { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.cmp .nm img { width: 30px; height: 30px; }
.cmp small.cost { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; }
.cmp.up td { text-align: center; } .cmp.up td:first-child { text-align: left; }
.cmp .mats { display: inline-flex; flex-wrap: wrap; gap: 4px; white-space: normal; min-width: 180px; }
.cmp td .mat { font-size: .82rem; }
h3.floor { margin: 22px 0 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: .94rem; align-items: baseline; }
.kv > i { font-style: normal; font-weight: 800; color: var(--muted); white-space: nowrap; font-size: .85rem; }
.mapcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 30px; }
.mapcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 90px; }
.mapcard:target { outline: 4px solid var(--sun); outline-offset: 4px; }
.map-banner { width: 100%; aspect-ratio: 512 / 170; object-fit: cover; border-bottom: 3px solid var(--ink); }
.map-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.map-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.map-title h3 { margin: 0; }
.tier-no { font: 800 .9rem var(--font); background: var(--accent); color: #16223d; border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; }
table.perk { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--card-2); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
table.perk caption { text-align: left; font-weight: 800; padding: 0 0 6px; }
table.perk th { text-align: left; white-space: nowrap; padding: 6px 10px; color: var(--muted); font-size: .85rem; width: 1%; }
table.perk td { padding: 6px 10px; }
table.perk tr + tr th, table.perk tr + tr td { border-top: 2px solid var(--soft); }
.ride-skill { margin: 0; font-size: .92rem; background: var(--mint); border: 2px solid var(--ink); border-radius: 12px; padding: 7px 12px; }
button.chip { cursor: pointer; font: 800 .95rem var(--font-body); }
button.chip.on { background: var(--sun); color: #16223d; }
.petcard[hidden] { display: none; }
.storegrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.storecard { display: flex; gap: 14px; align-items: flex-start; scroll-margin-top: 90px; }
.storecard h3 { font-size: 1.1rem; margin-bottom: 4px; }
.st-ico { flex-shrink: 0; width: 76px; height: 76px; border: 3px solid var(--ink); border-radius: 16px; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.st-ico img { width: 72px; height: 72px; }
.st-ico .emo { font-size: 2rem; }
.price { display: inline-block; margin-top: 8px; font: 800 1rem var(--font); background: #00b06b; color: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 12px; }
.updlist, .faqlist { display: grid; gap: 18px; margin-top: 26px; }
.updlist h2, .faq h2 { font-size: 1.35rem; }
.faq p { margin: 0; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.foot-links b { color: #fff; font-family: var(--font); }

/* ---------- 第三版：看圖就懂 ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.quick-t { grid-column: 1 / -1; font: 800 .8rem var(--font); letter-spacing: .1em; color: var(--muted); margin-bottom: -6px; }
.qf { display: flex; align-items: center; gap: 14px; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; }
.qf img, .qf .emo { width: 64px; height: 64px; flex-shrink: 0; font-size: 2.6rem; display: grid; place-items: center; }
.qf b { display: block; font: 800 clamp(1.9rem, 4.6vw, 2.6rem)/1 var(--font); color: var(--sea); }
:root[data-theme="dark"] .qf b { color: #7fb6ff; }
.qf span.l { font-weight: 800; color: var(--muted); font-size: .95rem; line-height: 1.3; }
.tips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tip { background: var(--card); border: 3px solid var(--ink); border-radius: 16px; padding: 12px; box-shadow: 3px 3px 0 var(--ink); display: flex; flex-direction: column; gap: 6px; }
.tip b { font-family: var(--font); font-size: 1.05rem; }
.tip small { color: var(--muted); font-weight: 700; line-height: 1.35; }
.tip .demo { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--soft); position: relative; overflow: visible; }
.tip .demo i { position: absolute; inset: 0 auto 0 0; width: var(--w, 60%); background: var(--sea); border-radius: 999px; }
.tip .demo em { position: absolute; top: -5px; bottom: -5px; left: var(--x, 48%); width: 3px; background: var(--ink); border-radius: 2px; }
details.more { margin-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 800; color: var(--link); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > .more-body { margin-top: 10px; }
details.fulltable > summary { font-size: 1.02rem; padding: 10px 14px; border: 3px dashed var(--ink); border-radius: 14px; background: var(--card-2); width: 100%; }

/* 橫條（數值比較） */
.sbars { display: grid; gap: 7px; }
.sb { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 8px; align-items: center; font-size: .9rem; }
.sb > span:first-child { font-weight: 800; color: var(--muted); white-space: nowrap; }
.sb b { font-family: var(--font); min-width: 3.4em; text-align: right; }
.track { position: relative; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--soft); }
.track i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c, var(--sea)); border-radius: 999px; min-width: 6px; }
.track em { position: absolute; top: -5px; bottom: -5px; left: var(--x); width: 3px; background: var(--ink); border-radius: 2px; }
:root[data-theme="dark"] .track em { background: #fff; }
.bar-note { font-size: .82rem; color: var(--muted); font-weight: 700; margin: 4px 0 0; }

/* 機率長條圖 */
.chart { display: grid; gap: 6px; }
.crow { display: grid; grid-template-columns: minmax(130px, 200px) 1fr 4.2em 4.6em; gap: 10px; align-items: center; }
.crow .cl { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; }
.crow .cl img { width: 40px; height: 40px; flex-shrink: 0; }
.crow .cl a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .track { height: 22px; }
.crow b { font-family: var(--font); text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: .85rem; font-weight: 800; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); background: var(--c); }

/* 100% 堆疊條 */
.stack { display: flex; height: 40px; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.stack span { width: var(--w); background: var(--c); color: #16223d; font-weight: 800; font-size: .85rem; display: grid; place-items: center; white-space: nowrap; overflow: hidden; min-width: 0; }
.stack span + span { border-left: 2px solid var(--ink); }
.stack-row { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.stack-row > b { font-family: var(--font); }

/* 保底、感情示意 */
.pity { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pity img { width: 40px; height: 40px; filter: grayscale(1) opacity(.55); }
.pity .arrow { font: 800 1.4rem var(--font); margin: 0 6px; }
.pity .sure { position: relative; filter: none; width: 56px; height: 56px; }
.pity .sure-wrap { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; border: 3px solid var(--ink); border-radius: 50%; background: #ffcc40; box-shadow: 3px 3px 0 var(--ink); }
.pity .sure-wrap img { filter: none; width: 48px; height: 48px; }
.bondbar { position: relative; height: 20px; border: 3px solid var(--ink); border-radius: 999px; background: linear-gradient(90deg, #ff9fb4, #ff6b8b); margin: 34px 8px 46px; }
.bondbar .ms { position: absolute; top: -34px; transform: translateX(-50%); text-align: center; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.bondbar .ms::after { content: ""; display: block; width: 3px; height: 40px; background: var(--ink); margin: 2px auto 0; }
.bondbar .ms.end { transform: translateX(-100%); text-align: right; }
.bondbar .ms.end::after { margin-right: 0; }
.bondbar .tick { position: absolute; top: 24px; font-size: .78rem; font-weight: 800; color: var(--muted); transform: translateX(-50%); }
.srcs { display: flex; flex-wrap: wrap; gap: 10px; }
.src { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 12px; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.src b { font: 800 1.3rem var(--font); color: #e0457b; }

/* 圖示方塊（怎麼拿到） */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; gap: 12px; align-items: center; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; }
.tile img { width: 64px; height: 64px; flex-shrink: 0; }
.tile b { display: block; font-family: var(--font); font-size: 1.1rem; }
.tile small { color: var(--muted); font-weight: 700; }
.tile .emo { width: 64px; height: 64px; flex-shrink: 0; font-size: 2.6rem; display: grid; place-items: center; }

/* 活頁簿（像 Excel 的工作表頁籤）：頁籤列黏在畫面上方，一次只看一頁 */
.book { margin-top: 26px; }
.sheet-tabs { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 10px 4px 0; border-bottom: 3px solid var(--ink); background: var(--bg); }
.book.js .sheet-tabs { position: sticky; top: 71px; z-index: 30; }
.sheet-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px 7px; border: 3px solid var(--ink); border-bottom: 0;
  border-radius: 12px 12px 0 0; background: var(--soft); color: var(--muted); font: 800 1rem/1.2 var(--font); text-decoration: none; white-space: nowrap; }
.sheet-tab:hover { color: var(--text); background: var(--card-2); }
.sheet-tab[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: inset 0 5px 0 var(--teal); padding-bottom: 10px; margin-bottom: -3px; position: relative; z-index: 1; }
.book.js [data-sheet][hidden] { display: none !important; }
.book .sheet { padding-top: 26px; }
.book.js .sheet { animation: sheetIn .18s ease-out; }
@keyframes sheetIn { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html { scroll-padding-top: 150px; }
/* 搜尋跳到的那一個東西閃一下 */
.flash { animation: flashIt 1.6s ease-out; }
@keyframes flashIt { 0%, 40% { box-shadow: 0 0 0 5px var(--sun), var(--shadow); } 100% { box-shadow: var(--shadow); } }
tr.flash td { animation: flashRow 1.6s ease-out; }
@keyframes flashRow { 0%, 40% { background: var(--sun); color: #16223d; } }

/* 站內搜尋（Ctrl+K） */
.search-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 12px; border: 3px solid var(--ink); border-radius: 12px; background: var(--card);
  color: var(--muted); font: 800 .95rem var(--font); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.search-btn:hover { color: var(--text); }
.search-btn kbd { font: 700 .72rem var(--font-body); border: 2px solid var(--muted); border-radius: 6px; padding: 0 5px; color: var(--muted); }
.search-modal { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(8, 16, 34, .55); }
.search-box { position: relative; width: min(680px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 3px solid var(--ink); font-size: 1.3rem; }
.search-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 700 1.15rem var(--font-body); }
.search-in input::-webkit-search-cancel-button { display: none; }
.search-esc { border: 2px solid var(--muted); border-radius: 8px; background: transparent; color: var(--muted); font: 800 .8rem var(--font); padding: 3px 8px; cursor: pointer; }
.search-res { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-res a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text); text-decoration: none; }
.search-res li[aria-selected="true"] a, .search-res a:hover { background: var(--sky); }
.search-res b { font-family: var(--font); font-size: 1.05rem; line-height: 1.3; }
.search-res small { grid-column: 2; color: var(--muted); font-weight: 700; font-size: .82rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-type { grid-row: 1 / span 2; align-self: center; font: 800 .72rem var(--font); padding: 3px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--sun); color: #16223d; white-space: nowrap; }
.sr-pet, .sr-enchant { background: #ffc3dd; } .sr-weapon, .sr-boss { background: #ffb3a6; } .sr-item, .sr-decor { background: #b8f0e2; }
.sr-map { background: #c9e0ff; } .sr-page, .sr-tab { background: #fff; } .sr-faq, .sr-update, .sr-code, .sr-store { background: #e6dcff; }
.sr-act { background: #c9e0ff; } .sr-enc { background: #ffb3a6; }
.search-none { padding: 18px 12px; color: var(--muted); font-weight: 700; }
.search-foot { border-top: 2px solid var(--soft); padding: 8px 14px; font-size: .8rem; color: var(--muted); font-weight: 700; }
html.search-on { overflow: hidden; }
@media (max-width: 980px) {
  .search-btn .lbl, .search-btn kbd { display: none; }
  .search-btn { padding: 0 9px; font-size: 1.1rem; }
}
@media (max-width: 700px) {
  .sheet-tab { padding: 7px 12px 6px; font-size: .92rem; }
  .sheet-tab[aria-selected="true"] { padding-bottom: 9px; }
  .search-modal { padding: 10px; }
  .search-box { max-height: 88vh; }
  .search-foot { display: none; }
}

/* 寵物：抽到重複 */
.dupe-always { display: flex; align-items: center; gap: 12px; background: var(--card-2); }
.dupe-always .emo { font-size: 2.2rem; }
.dupe-always b { font-family: var(--font); font-size: 1.15rem; }

/* 首頁攻略目錄：三欄時最後一排只剩一張就拉滿整排 */
@media (min-width: 701px) {
  .g3 > .guide-card:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}

/* 附魔頁 */
.ench h3 { margin: 0 0 4px; font-size: 1.25rem; }
.ench .ench-fx { margin: 0 0 10px; font-weight: 800; color: var(--sea); }
.ench .ench-fx small { color: var(--muted); }
h3.floor.withicon { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
h3.floor small { font-family: inherit; font-size: .85rem; font-weight: 700; }
.sbars.wide .sb { grid-template-columns: minmax(7em, 13em) 1fr auto; }
.sbars.wide .sb > span:first-child { white-space: normal; line-height: 1.25; }
a.src { color: inherit; text-decoration: none; }
a.src:hover { transform: translate(-1px, -1px); }
.src b { min-width: 1.6em; text-align: center; }

/* 大卡片（武器、寵物 v2） */
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.vcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; scroll-margin-top: 90px; }
.vcard:target { outline: 4px solid var(--sun); outline-offset: 4px; }
.vcard[hidden] { display: none; }
.v-top { display: flex; gap: 12px; align-items: center; }
.v-ava { width: 104px; height: 104px; flex-shrink: 0; border-radius: 22px; border: 4px solid var(--rc, var(--ink)); background: var(--soft); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--ink), 4px 4px 0 3px var(--ink); margin: 3px; }
.v-ava img { width: 90px; height: 90px; }
.v-ava .emo { font-size: 3rem; }
.v-name h3 { margin: 0 0 4px; font-size: 1.2rem; }
.v-name .en { color: var(--muted); font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.v-chips span { font-size: .82rem; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; background: var(--card-2); }
.v-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.v-get { font-weight: 800; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.cmp-add { font: 800 .85rem var(--font-body); padding: 5px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); color: var(--text); cursor: pointer; }
.cmp-add[aria-pressed="true"] { background: var(--sun); color: #16223d; }
.vcard details.more { margin-top: 0; }
.vcard .more-body { display: grid; gap: 8px; font-size: .92rem; }
.mv { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; }
.mv .keycap { min-width: 28px; height: 28px; font-size: .85rem; grid-row: span 2; }
.mv b { font-size: .95rem; }
.mv small { color: var(--muted); font-weight: 700; }

/* 比較抽屜 */
.cmp-tray { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); padding: 12px 14px; max-width: 1100px; margin: 0 auto; }
.cmp-tray[hidden] { display: none; }
.cmp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmp-head b { font-family: var(--font); font-size: 1.1rem; }
.cmp-head small { color: var(--muted); font-weight: 700; }
.cmp-head .sp { margin-left: auto; display: flex; gap: 8px; }
.cmp-head button { font: 800 .85rem var(--font-body); padding: 5px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card-2); color: var(--text); cursor: pointer; }
.cmp-cols { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.cmp-col { border: 2px solid var(--ink); border-radius: 14px; padding: 10px; background: var(--card-2); }
.cmp-col .v-top img { width: 56px; height: 56px; }
.cmp-col h4 { margin: 0; font-size: 1rem; }
.cmp-tray.min .cmp-cols { display: none; }

/* 寵物卡：大數字＋同本領比較 */
.bigstat { display: flex; align-items: center; gap: 12px; background: var(--card-2); border: 2px solid var(--ink); border-radius: 14px; padding: 8px 12px; }
.bigstat { border-left: 8px solid var(--rc, var(--ink)); }
.bigstat > b { font: 800 2rem/1 var(--font); color: var(--sea); white-space: nowrap; }
:root[data-theme="dark"] .bigstat > b { color: #8cc0ff; }
.bigstat span { font-weight: 800; line-height: 1.25; }
.bigstat small { display: block; color: var(--muted); font-size: .78rem; }
.same { display: grid; gap: 4px; }
.same > small { font-weight: 800; color: var(--muted); font-size: .8rem; }
.sb.mini { grid-template-columns: 7.6em 1fr auto; font-size: .82rem; opacity: .75; }
.sb.mini > span:first-child { display: inline-flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 700; }
.sb.mini img { width: 22px; height: 22px; flex-shrink: 0; }
.sb.mini .track { height: 10px; }
.sb.mini.me { opacity: 1; }
.sb.mini.me > span:first-child { font-weight: 800; }
.sb.mini.me .track { height: 14px; box-shadow: 0 0 0 2px var(--sun); }

/* 固定刻度的長條（孵蛋機率） */
.track.grid { background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--t, 5) - 1px), rgba(19, 33, 60, .18) calc(100% / var(--t, 5) - 1px), rgba(19, 33, 60, .18) calc(100% / var(--t, 5))); background-color: var(--soft); }
:root[data-theme="dark"] .track.grid { background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / var(--t, 5) - 1px), rgba(255, 255, 255, .18) calc(100% / var(--t, 5) - 1px), rgba(255, 255, 255, .18) calc(100% / var(--t, 5))); }
.crow.axis { align-items: end; margin-bottom: -2px; }
.crow.axis small { color: var(--muted); font-weight: 800; font-size: .78rem; }
.ticks { position: relative; height: 18px; }
.ticks span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: .74rem; font-weight: 800; color: var(--muted); }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }

/* 武器頁：分類列固定在上方、每類先顯示幾張 */
.sticky-cats { position: sticky; top: 71px; z-index: 40; background: var(--bg); padding: 10px 0; margin: 0; box-shadow: 0 10px 12px -12px rgba(0, 0, 0, .35); }
.showall-btn { display: none; margin: 14px auto 0; }

/* 手機上表格改成卡片 */
@media (max-width: 700px) {
  .quick { grid-template-columns: 1fr; gap: 8px; }
  .qf { padding: 6px 12px; gap: 12px; border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
  .qf { min-width: 0; }
  .qf > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
  .qf img, .qf .emo { width: 36px; height: 36px; font-size: 1.7rem; }
  .qf b { font-size: 1.6rem; }
  .qf span.l { font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
  .sticky-cats { flex-wrap: nowrap; overflow-x: auto; padding: 8px 2px 10px; scrollbar-width: none; }
  .sticky-cats::-webkit-scrollbar { display: none; }
  .sticky-cats .chip { flex-shrink: 0; padding: 5px 10px; }
  .cards3 > .extra { display: none; }
  .showall .cards3 > .extra { display: flex; }
  .showall-btn { display: flex; }
  .stack-row { grid-template-columns: 1fr; gap: 6px; }
  .crow { grid-template-columns: 1fr auto auto; grid-template-areas: "name val tag" "bar bar bar"; gap: 2px 8px; padding: 4px 0; }
  .crow .cl { grid-area: name; }
  .crow .cl a { white-space: normal; overflow: visible; }
  .crow > .track { grid-area: bar; height: 16px; }
  .crow > b { grid-area: val; }
  .crow > .rtag { grid-area: tag; }
  .crow.axis { grid-template-areas: "name name name" "bar bar bar"; }
  .crow.axis > .ticks { grid-area: bar; }
  .crow.axis > b, .crow.axis > span:last-child { display: none; }
  .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles, .cards3 { grid-template-columns: 1fr; }
  .tile { padding: 8px 12px; }
  .tile img, .tile .emo { width: 48px; height: 48px; }
  .tile .emo { font-size: 2rem; }
  .crow { grid-template-columns: minmax(88px, 108px) 1fr 2.6em auto; gap: 6px; }
  .crow .rtag { font-size: .66rem; padding: 0 6px; }
  .crow .cl img { width: 32px; height: 32px; }
  .crow .cl a { font-size: .88rem; }
  .v-ava { width: 88px; height: 88px; }
  .v-ava img { width: 76px; height: 76px; }
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr { border-bottom: 3px solid var(--ink); padding: 8px 0; }
  table.resp td { display: flex; justify-content: space-between; gap: 10px; text-align: right; border: 0; padding: 4px 12px; position: static; }
  table.resp td::before { content: attr(data-label); font-weight: 800; color: var(--muted); text-align: left; }
  table.resp td:first-child { justify-content: flex-start; }
  table.resp td:first-child::before { content: none; }
  .cmp-cols { grid-template-columns: 1fr; max-height: 50vh; overflow-y: auto; }
}
@media (min-width: 701px) and (max-width: 980px) {
  .cards3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 文章 ---------- */
.prose { max-width: 820px; }
.prose h2 { font-size: 1.5rem; margin-top: 1.6em; }

/* ---------- 頁尾 ---------- */
.site-foot { margin-top: 60px; background: var(--deep); color: #dce8ff; border-top: 4px solid var(--ink); padding: 40px 0 30px; }
.site-foot a { color: #ffe27a; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; }
.foot-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.foot-brand img { width: 48px; height: 48px; border-radius: 12px; border: 3px solid #000; }
.foot-links { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.foot-small { font-size: .85rem; opacity: .85; margin-top: 18px; }

/* ---------- 手機與平板 ---------- */
@media (max-width: 980px) {
  .nav { display: none; }
  .menu { display: block; margin-left: auto; }
  .menu .pop { min-width: 220px; }
  .hero-in { grid-template-columns: 1fr; }
  .hero-art { max-width: 640px; }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wcards, .mapcards { grid-template-columns: 1fr; }
  .storegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .g2, .storegrid, .foot-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .theme-pick { display: none; }
  .menu-theme { display: block; }
  .lang-short { display: none; }
  .search-btn { height: 40px; padding: 0 8px; }
}
@media (max-width: 700px) {
  .g3, .tide-legend, .codes, .foot-in { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand small { display: none; }
  .brand b { font-size: 1rem; }
  .sticker { width: 84px; height: 84px; font-size: .95rem; top: -18px; right: -4px; }
  .tide-seg { padding: 8px 8px; font-size: .9rem; }
  .btn { padding: 12px 18px; font-size: 1rem; }
  .btn-play-sm .lbl { display: none; }
}
@media (max-width: 420px) {
  .head-in { gap: 8px; }
  .brand img { width: 40px; height: 40px; }
  .tools { gap: 6px; }
  .pill-btn, .lang > summary, .menu > summary { padding: 6px 9px; }
  .code { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- 2026-11-18 遊戲圖示取代 emoji ---------- */
img.ei { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -.25em; margin: 0 .12em; }
h1 img.ei, h2 img.ei, h3 img.ei { width: 1.15em; height: 1.15em; }
.tab img.ei, .chip img.ei { width: 1.3em; height: 1.3em; }
.star { color: var(--sun-2); font-weight: 900; }
.ui-ico { display: inline-block; flex-shrink: 0; }
.swatch { display: inline-block; flex-shrink: 0; border-radius: 50%; border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); vertical-align: middle; }
.nm .swatch { margin-right: 8px; }

/* ---------- 2026-11-18 導覽列重新設計：第一排工具、第二排分組導覽（遊戲圖示＋文字） ---------- */
.head-in { gap: 12px; min-height: 64px; }
.head-in .search-btn { flex: 1 1 auto; min-width: 0; max-width: 460px; margin-left: auto; justify-content: flex-start; } /* min-width 0：英文等長字的搜尋框才縮得下，不會把右邊的按鈕擠出畫面 */
.head-in .tools { flex-shrink: 0; }
.head-in .search-btn .lbl { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.navbar { border-top: 2px solid var(--soft); background: var(--card); position: relative; }
/* 2026-11-20 加「港口玩法」「遺跡奇遇」：1000 以上兩排、每排 10 格一樣寬、上下對齊
   （第一排 入門｜港口｜其他，第二排 遺跡｜裝備；格數要和 build.py 的 NAV_ROWS 一致）；
   組和組之間一條虛線（畫在下一組第一格的左邊）。1000 以下照順序變成一排左右滑，右邊淡出提示還有。 */
.nav-row { display: grid; row-gap: 2px; padding: 6px 0 8px; }
.nr { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); column-gap: 2px; }
.ng { display: contents; }
.nl {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  padding: 5px 2px 4px; border-radius: 12px; border: 3px solid transparent;
  text-decoration: none; color: var(--text); font: 800 .82rem/1.15 var(--font-body); text-align: center;
}
/* max-width＋anywhere：每排 10 格之後格子變窄，比格子還寬的單字（葡文 Encantamentos 等）要在格子裡斷行，不能突出去蓋到隔壁 */
.nl span { max-width: 100%; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.nl img { width: 30px; height: 30px; object-fit: contain; }
.ng + .ng > .nl:first-child::before {
  content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; border-left: 2px dashed var(--line, #d9cdb4); pointer-events: none;
}
@media (max-width: 999px) {
  .nav-row { display: flex; position: relative; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-right: 26px; }
  .nav-row::-webkit-scrollbar { display: none; }
  .nr { display: contents; }
  .nl { flex: 0 0 auto; min-width: 72px; max-width: 100px; scroll-snap-align: start; }
  .nr + .nr > .ng:first-child > .nl:first-child::before {
    content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; border-left: 2px dashed var(--line, #d9cdb4); pointer-events: none;
  }
  .navbar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px; background: linear-gradient(to right, transparent, var(--card)); pointer-events: none; }
}
.nl:hover { background: var(--soft); border-color: var(--ink); }
/* 目前這一頁，或目前這一頁的上層（子頁面時 data-up：在釣魚碼頭頁，「港口玩法」那一格也亮） */
.nl[aria-current="page"], .nl[data-up] { background: var(--sun); color: #16223d; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
@media (max-width: 980px) {
  .head-in .search-btn { max-width: none; }
  .head-in .search-btn .lbl { display: block; }
  .head-in .search-btn kbd { display: none; }
}
@media (max-width: 700px) {
  .site-head { position: relative; }
  .brand small { display: none; }
  .head-in .search-btn .lbl { display: none; }
  .head-in .search-btn { flex: 0 0 auto; margin-left: auto; }
  .nl { min-width: 64px; font-size: .74rem; padding: 4px 4px 3px; }
  .nl img { width: 26px; height: 26px; }
}

/* ---------- 2026-11-20 港口玩法：子導覽、總覽頁的大卡、「位置／規則」一列一列的清單、遊戲畫面截圖 ---------- */
/* 子導覽（build.py 的 subnav）：同一類頁面互相切換的一排 .chip；目前這一頁黃底。手機上變成一排左右滑。 */
.chip[aria-current="page"] { background: var(--sun); color: #16223d; }
.subnav { margin-top: 20px; }
.actgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.actcard { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; scroll-margin-top: 90px; }
.act-top { display: flex; align-items: center; gap: 14px; }
.act-top h3 { margin: 0; font-size: 1.35rem; }
.act-ico { flex-shrink: 0; width: 96px; height: 96px; border: 3px solid var(--ink); border-radius: 20px; background: var(--soft); display: grid; place-items: center; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.act-ico img { width: 84px; height: 84px; object-fit: contain; }
.actcard .w-desc { flex: 1; }
.act-go { padding: 8px 16px; font-size: .98rem; }
.actrows { display: grid; gap: 12px; }
.actrow { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 16px; scroll-margin-top: 90px; }
.actrow > img { width: 48px; height: 48px; object-fit: contain; }
.actrow h3 { margin: 0 0 2px; font-size: 1.1rem; }
.actrow h3 a { color: var(--text); }
.actrow p { margin: 0; }
.actwhere { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.actwhere > .actrows:only-child { grid-column: 1 / -1; }
.shot { margin: 0; padding: 10px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 12px; }
.shot figcaption { margin-top: 8px; font-size: .85rem; font-weight: 700; color: var(--muted); }
@media (max-width: 980px) {
  .actgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actwhere { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .actgrid { grid-template-columns: 1fr; }
  .act-ico { width: 76px; height: 76px; border-radius: 16px; }
  .act-ico img { width: 66px; height: 66px; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 8px; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav .chip { flex-shrink: 0; padding: 5px 12px; }
}
