@charset "UTF-8";
:root {
  color-scheme: dark;
  --background: #101216;
  --surface: #181b22;
  --surface-raised: #1e222b;
  --surface-hover: #242832;
  --text: #eeece6;
  --text-muted: #acaeb7;
  --text-soft: #979aa7;
  --line: #30343e;
  --gold: #dfbc7c;
  --gold-dark: #6e5734;
  --gold-surface: #30291f;
  --green: #9ac9ad;
  --purple: #b7a0df;
  --blue: #9bbbd4;
  --rose: #d4a1a8;
  --sidebar: 300px;
  --radius: 8px;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-title: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--background);
  font-size: 15px;
  line-height: 1.65;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button, a { transition: color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { background: #615039; color: white; }
[hidden] { display: none !important; }
svg.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 20px; top: -100px; background: var(--gold); color: var(--background); padding: 12px; z-index: 30; }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #14161c; border-right: 1px solid var(--line); padding: 30px 16px 20px; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; font-family: var(--font-title); font-size: 1.4rem; font-weight: 700; white-space: nowrap; letter-spacing: 1px; }
.brand-mark { color: var(--gold); width: 36px; height: 44px; flex-shrink: 0; }
.brand-mark svg { width: 100%; height: 100%; }
.brand small { display: block; font: 0.53333333rem/1.8 var(--font-body); letter-spacing: 1.5px; color: var(--text-muted); margin-top: 3px; }
.sidebar-caption { margin: 30px 12px 6px; color: var(--text-soft); font-size: 0.66666667rem; letter-spacing: 1px; }
.nav-group { margin-top: 17px; }
.nav-group-title { font-size: 0.73333333rem; color: var(--text-soft); padding: 0 12px; margin-bottom: 7px; letter-spacing: 1px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; margin: 3px 0; border: 1px solid transparent; border-radius: 5px; color: #b8bac4; font-size: 0.8rem; }
.nav-link:hover { color: var(--text); background: var(--surface-raised); }
.nav-link.active { color: var(--gold); background: linear-gradient(90deg, #30291f, #25221f); border-color: #55462e; box-shadow: inset 2px 0 var(--gold); }
.nav-icon { display: flex; color: #9b9dab; }
.nav-icon .icon { width: 18px; height: 18px; }
.active .nav-icon { color: var(--gold); }
.nav-status { flex-shrink: 0; padding: 1px 6px; border: 1px solid var(--gold-dark); border-radius: 4px; background: var(--gold-surface); color: var(--gold); font-size: .73333333rem; line-height: 1.6; white-space: nowrap; }
.nav-count { margin-left: auto; color: var(--text-soft); font: 0.73333333rem/1.5 monospace; }
.active .nav-count { color: var(--gold); }
.sidebar-bottom { margin-top: 28px; border-top: 1px solid var(--line); padding: 20px 10px 0; font-size: 0.73333333rem; color: var(--text-soft); }
.sidebar-bottom a { display: flex; gap: 6px; align-items: center; color: var(--text-muted); }
.sidebar-bottom p { line-height: 1.9; font-size: 0.66666667rem; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); display: inline-block; }
.workspace { margin-left: var(--sidebar); }
.topbar { height: 64px; border-bottom: 1px solid #282c35; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; background: #14161b; }
.breadcrumb { font-size: 0.73333333rem; color: var(--text-soft); display: flex; gap: 14px; align-items: center; }
.breadcrumb strong { color: var(--text); font-weight: 400; }
.breadcrumb > span { color: #666b78; }
.topbar-links { display: flex; align-items: center; gap: 24px; font-size: 0.73333333rem; color: var(--text-muted); }
.topbar-links a:hover { color: var(--gold); }
.menu-toggle { display: none; }
main { max-width: 1560px; margin: auto; padding: 0 40px 64px; min-height: calc(100vh - 130px); }
#page-intro { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 214px; border-bottom: 1px solid var(--line); overflow: hidden; }
#page-intro.class-intro { min-height: 258px; }
.hero-copy { padding: 32px 0; position: relative; z-index: 1; max-width: 68%; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--gold); font: 0.66666667rem/1.6 monospace; letter-spacing: 1.9px; }
.eyebrow > span:first-child { width: 17px; height: 1px; background: var(--gold); }
.eyebrow-divider { color: #837354; margin: 0 3px; }
h1 { font: 700 2.8666667rem/1.4 var(--font-title); letter-spacing: 3px; margin: 15px 0 10px; }
.title-dot { color: var(--gold); margin-left: 4px; }
.intro-description { color: var(--text-muted); font-size: 0.86666667rem; line-height: 1.9; max-width: 560px; margin: 0; }
.hero-links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 24px; }
.hero-links a { display: flex; align-items: center; gap: 8px; color: #e0c38c; font-size: 0.73333333rem; }
.hero-links .icon { width: 15px; height: 15px; }
.hero-links a:nth-child(2) { color: var(--text-muted); }
.hero-links a:hover { color: white; }
.hero-art { position: absolute; right: -22px; inset-block: 0; width: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: -1; }
.hero-art img { width: 100%; height: auto; max-height: 265px; object-fit: contain; }
.hero-art > span { font: 0.53333333rem/1.3 monospace; color: #a48b64; letter-spacing: 2.7px; position: absolute; bottom: 23px; }
.codex-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; min-height: 58px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.73333333rem; color: var(--text-muted); }
.summary-heading { font-size: 0.66666667rem; letter-spacing: 1px; color: var(--text-soft); padding-right: 16px; border-right: 1px solid var(--line); }
.codex-summary strong { font: 1.3333333rem/1 Georgia, serif; color: var(--gold); margin-right: 5px; }
.codex-summary a { display: flex; gap: 6px; align-items: center; margin-left: auto; font-size: 0.66666667rem; }
.codex-summary .icon { width: 14px; height: 14px; }
.directory-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 32px 0 20px; }
.section-kicker { font: 0.6rem/1.6 monospace; letter-spacing: 1.7px; color: var(--text-soft); }
.directory-heading h2 { margin: 4px 0 0; font: 600 1.4666667rem/1.5 var(--font-title); letter-spacing: 1px; }
.directory-hint { font-size: 0.73333333rem; color: var(--text-soft); }
.catalog-controls { background: #171a21; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-icon { position: absolute; top: 14px; left: 15px; color: var(--gold); width: 18px !important; height: 18px !important; }
.search-wrap input { width: 100%; min-width: 0; height: 46px; padding: 11px 108px 11px 44px; background: #111419; border: 1px solid #414653; border-radius: 5px; color: var(--text); font-size: 0.86666667rem; }
.search-wrap input::placeholder { color: #9a9da9; }
.search-wrap input:focus { border-color: var(--gold); }
.search-hint { position: absolute; top: 14px; right: 15px; font-size: 0.66666667rem; color: var(--text-soft); pointer-events: none; }
.view-toggle { display: flex; gap: 3px; background: #111419; border: 1px solid var(--line); padding: 3px; border-radius: 5px; }
.view-toggle button { display: grid; place-items: center; border: 0; border-radius: 3px; width: 38px; height: 38px; background: transparent; color: var(--text-soft); }
.view-toggle button.active { background: #393126; color: var(--gold); }
.view-toggle button:hover { background: var(--surface-hover); }
.view-toggle .icon { width: 17px; height: 17px; }
.class-tabs { display: flex; gap: 24px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.class-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 8px 0 12px; font-size: 0.86666667rem; color: var(--text-muted); }
.class-tabs button.active { border-bottom-color: var(--gold); color: var(--gold); }
.class-tabs button span { display: inline-block; margin-left: 7px; padding: 0 5px; border-radius: 3px; background: #282c35; font: 0.66666667rem/1.7 monospace; color: var(--text-muted); }
.class-tabs button.active span { color: var(--gold); background: #3b3021; }
.filters { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr 1fr 1.2fr; gap: 12px; }
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: 0.66666667rem; color: var(--text-soft); min-width: 0; }
.filters select { border: 1px solid #3a3f4b; background: #1d212a; padding: 8px 24px 8px 10px; border-radius: 4px; font-size: 0.73333333rem; color: #d3d3da; min-height: 37px; width: 100%; max-width: 100%; }
.results-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 16px 0 26px; font-size: 0.66666667rem; color: var(--text-soft); }
.result-count strong { color: var(--gold); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 26px 0 12px; }
.section-heading h2 { font-size: 1.2rem; font-weight: 600; letter-spacing: 1px; margin: 0; display: flex; align-items: center; gap: 12px; }
.section-heading small { font: 0.66666667rem/1.7 var(--font-body); color: var(--text-soft); letter-spacing: 0; margin-left: 2px; }
.group-number { font: 0.8rem/1 monospace; color: var(--gold); border-right: 1px solid #68543a; padding-right: 12px; }
.catalog-note { font-size: 0.73333333rem; color: var(--text-muted); line-height: 1.8; margin: 0 0 20px; }
.subtle-tag { color: var(--text-muted); border: 1px solid var(--line); padding: 4px 8px; border-radius: 4px; font-size: 0.66666667rem; }
.class-group + .class-group { margin-top: 38px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.class-card { --accent: var(--gold); position: relative; background: linear-gradient(135deg, #20232b, #181b22 70%); border: 1px solid #373b46; border-radius: 7px; min-width: 0; padding: 16px 18px 0; transition: border-color 180ms, box-shadow 180ms; }
.class-card.blue { --accent: var(--blue); }
.class-card.purple { --accent: var(--purple); }
.class-card.green { --accent: var(--green); }
.class-card.rose { --accent: var(--rose); }
.class-card::before { content: ""; position: absolute; top: -1px; left: 18px; width: 32px; height: 2px; background: var(--accent); opacity: .75; }
.class-card:hover { border-color: #8a7453; box-shadow: 0 8px 24px #0003; }
.class-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dark); }
.card-index { display: flex; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: 0.6rem; margin-bottom: 18px; }
.card-index > span:first-child { font-family: monospace; letter-spacing: 1px; }
.card-index > span:last-child { color: var(--accent); }
.card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 19px; }
.class-emblem { display: grid; place-items: center; width: 50px; height: 56px; color: var(--accent); background: #292a2a; background: color-mix(in srgb, var(--accent) 8%, #1a1d24); border: 1px solid color-mix(in srgb, var(--accent) 35%, #292d35); clip-path: polygon(0 0, 100% 0, 100% 82%, 50% 100%, 0 82%); flex-shrink: 0; }
.class-emblem .icon { width: 29px; height: 29px; }
.card-title { flex: 1; min-width: 0; }
.card-title button { display: block; font: 600 1.3333333rem/1.5 var(--font-title); background: none; border: 0; padding: 0; text-align: left; letter-spacing: 1px; min-height: 32px; }
.card-title button:hover { color: var(--gold); }
.record-index { color: var(--text-soft); font-size: 0.66666667rem; margin-top: 3px; }
.card-arrow { display: grid; place-items: center; width: 30px; height: 34px; color: var(--text-soft); background: none; border: 0; padding: 0; flex-shrink: 0; }
.card-arrow:hover { color: var(--gold); }
.card-arrow .icon { width: 17px; height: 17px; }
.growth-label { display: flex; justify-content: space-between; align-items: center; color: var(--text-soft); font-size: 0.6rem; margin: 0 0 7px; }
.growth-label span { font: 0.53333333rem/1.7 monospace; letter-spacing: .5px; color: #a4a7b2; }
.growth-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin: 0 0 14px; }
.growth-stat { text-align: center; padding: 7px 0 5px; background: #111419; border: 1px solid #2d313a; border-radius: 3px; }
.growth-stat small { display: block; color: var(--text-muted); font-size: 0.6rem; }
.grade { display: inline-block; color: #b9bbc5; font: 600 1.4rem/1.5 Georgia, serif; }
.grade-S { color: #f0ce8e; }
.grade-A { color: #a8d3b7; }
.grade-B { color: #afc8e5; }
.grade-C { color: #c6bdd9; }
.grade-D { color: #b7b9c3; }
.grade-E { color: #9fa2af; }
.grade-unknown { color: #9fa2af; }
.card-skill-preview { display: flex; flex-wrap: wrap; gap: 5px; min-height: 25px; margin: 0 0 10px; }
.card-skill-preview span { color: #c0c0ca; padding: 2px 6px; background: #242832; border-radius: 3px; font-size: 0.66666667rem; }
.card-skill-preview .more-skills { background: transparent; color: var(--text-soft); padding-inline: 2px; }
.card-description { color: var(--text-muted); font-size: 0.73333333rem; line-height: 1.7; min-height: 38px; margin: 0 0 13px; overflow-wrap: anywhere; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid #343844; padding: 10px 0; min-height: 48px; }
.data-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.6rem; color: #aad0b6; padding: 3px 0; }
.data-chip::before { content: ""; display: block; width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.data-chip.review { color: #edc88a; }
.data-chip.pending { color: var(--text-soft); }
.compare-check { display: flex; align-items: center; gap: 6px; font-size: 0.66666667rem; color: var(--text-muted); cursor: pointer; min-height: 28px; }
.compare-check input { width: 14px; height: 14px; accent-color: var(--gold); margin: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.catalog-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; background: var(--surface); white-space: nowrap; }
.catalog-table th { text-align: left; font-size: 0.66666667rem; color: var(--text-muted); background: #242832; padding: 13px 12px; font-weight: 500; }
.catalog-table td { padding: 12px; border-top: 1px solid var(--line); }
.catalog-table tbody tr:hover { background: #22262f; }
.catalog-table .grade { font-size: 1.2rem; }
.catalog-table td.skill-effect { min-width: 230px; max-width: 380px; white-space: normal; line-height: 1.9; }
.text-button { display: inline-block; border: 0; background: none; padding: 2px 0; color: var(--gold); text-decoration: none; text-underline-offset: 4px; }
.text-button:hover { text-decoration: underline; color: #f9dcaa; }
.skill-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.skill-card { position: relative; min-width: 0; background: var(--surface); border: 1px solid #373b46; padding: 22px; border-radius: 6px; }
.skill-card:hover { border-color: #6c5d45; }
.skill-card-emblem { color: var(--purple); margin-bottom: 14px; }
.skill-card h3 { font: 600 1.2rem/1.6 var(--font-title); margin: 0 0 12px; }
.skill-card h3 button { background: none; border: 0; padding: 0; text-align: left; font: inherit; }
.skill-card h3 button:hover { color: var(--gold); }
.skill-card h3 button > span { font-size: 0.8rem; color: var(--text-soft); margin-left: 4px; }
.skill-card p { color: var(--text-muted); font-size: 0.8rem; line-height: 1.9; margin: 14px 0; }
.skill-class-list { padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.73333333rem; color: var(--text-soft); line-height: 1.9; }
.skill-class-list a:hover { color: var(--gold); }
.small-pill { display: inline-block; color: #c3c4cc; background: #252934; border: 1px solid #3a3e4a; padding: 2px 7px; border-radius: 3px; font: 0.66666667rem/1.7 var(--font-body); margin: 0 5px 5px 0; }
.item-card { background: radial-gradient(ellipse at top right, #342d22, transparent 70%), var(--surface); }
.item-seal { color: var(--gold); margin-bottom: 18px; }
.item-seal .icon { width: 38px; height: 38px; }
.panel { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin: 0 0 18px; }
.panel h2 { font: 600 1.3333333rem/1.6 var(--font-title); margin: 0 0 12px; }
.panel h3 { font-size: 0.93333333rem; margin: 20px 0 10px; }
.panel p, .panel li { font-size: 0.86666667rem; line-height: 1.9; color: var(--text-muted); }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rule-grid .panel { margin: 0; border-top: 2px solid #7d6744; }
.rule-quote { color: #c5c5cd; font-size: 0.93333333rem; line-height: 2; }
.rule-source { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.source-card h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; overflow-wrap: anywhere; }
.source-card code { display: block; font-size: 0.73333333rem; white-space: normal; overflow-wrap: anywhere; color: var(--text-muted); }
.source-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; color: var(--text-soft); font-size: 0.66666667rem; }
.research-status { display: inline-block; font: 0.66666667rem/1.8 var(--font-body); padding: 3px 8px; margin-left: 10px; color: var(--gold); background: var(--gold-surface); border: 1px solid #625033; border-radius: 3px; }
.empty-state { padding: 48px 24px; text-align: center; background: var(--surface); border: 1px dashed #48424a; border-radius: 6px; }
.empty-icon { color: var(--gold); }
.empty-icon .icon { width: 38px; height: 38px; }
.empty-state h2 { font: 600 1.6rem/1.5 var(--font-title); margin: 16px 0 12px; }
.empty-state p { max-width: 480px; margin: 0 auto 20px; color: var(--text-muted); font-size: 0.86666667rem; line-height: 1.9; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid #806741; border-radius: 4px; background: var(--gold-surface); color: var(--gold); padding: 9px 16px; font-size: 0.8rem; }
.secondary-button:hover { background: #403522; }
.field-tags, .subnav { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.field-tags span, .subnav a { color: #c4c5cd; background: #232731; border: 1px solid #3b404b; padding: 7px 10px; border-radius: 3px; font-size: 0.8rem; }
.subnav a:hover { color: var(--gold); border-color: var(--gold-dark); }
.more-note { display: flex; align-items: center; gap: 16px; margin-top: 32px; border-top: 1px solid var(--line); padding: 24px 0 0; }
.more-note > .icon { color: var(--gold); width: 26px; height: 26px; }
.more-note p { flex: 1; color: var(--text-soft); font-size: 0.73333333rem; margin: 0; }
.more-note strong { display: block; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.more-note > a { font-size: 0.73333333rem; color: var(--gold); }
.more-note > a .icon { width: 14px; }
.footnote { font-size: 0.73333333rem; color: var(--text-muted); margin-top: 18px; }
details { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
summary { font-size: 0.8rem; color: #c8b38d; min-height: 28px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 0.73333333rem/1.9 monospace; color: #bec0ca; background: #111419; border: 1px solid #313540; padding: 16px; border-radius: 4px; }
footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 22px 40px; color: var(--text-soft); font-size: 0.66666667rem; }
footer > span > span { color: var(--gold); margin-inline: 6px; }
.loading { color: var(--text-muted); padding: 80px 20px; text-align: center; }
.fatal { padding: 24px; margin-top: 32px; color: #f5bcaa; background: #35241f; border: 1px solid #815243; border-radius: 6px; }
dialog { width: min(960px, calc(100vw - 40px)); max-height: 90vh; max-height: 90dvh; padding: 0; color: var(--text); border: 1px solid #766140; border-radius: 9px; background: #14171e; box-shadow: 0 30px 100px #0009; overflow: auto; scrollbar-width: thin; }
dialog::backdrop { background: #05070bc9; backdrop-filter: blur(6px); }
.dialog-bar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 6px 18px 6px 28px; background: #1b1e26; border-bottom: 1px solid var(--line); z-index: 2; }
.dialog-bar > span { color: #c8b58f; font: 0.6rem/1.6 monospace; letter-spacing: 1.6px; }
.icon-button { display: grid; place-items: center; color: var(--text-muted); background: transparent; border: 1px solid #454a56; width: 36px; height: 36px; border-radius: 4px; font-size: 1.5333333rem; }
.icon-button:hover { color: var(--gold); border-color: var(--gold); }
#detail-content { padding: 30px; }
.detail-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.detail-emblem { display: grid; place-items: center; width: 76px; height: 82px; background: linear-gradient(140deg, #3a3022, #23232a); border: 1px solid #8c7249; border-radius: 5px 5px 24px 24px; color: var(--gold); flex-shrink: 0; }
.detail-emblem .icon { width: 40px; height: 40px; }
.dialog-eyebrow { color: var(--gold); letter-spacing: 1px; font: 0.66666667rem/1.8 monospace; }
dialog h2 { font: 600 2.1333333rem/1.5 var(--font-title); letter-spacing: 1px; margin: 10px 0 24px; }
.detail-hero h2 { margin: 3px 0 0; }
dialog h3 { font-size: 1.0666667rem; margin: 20px 0 12px; }
dialog .growth-grid { max-width: 510px; margin-block: 20px; }
dialog .growth-stat { padding: 10px 0 6px; }
dialog .growth-stat small { font-size: 0.73333333rem; }
dialog .grade { font-size: 1.8rem; }
.detail-meta { font-size: 0.8rem; color: var(--text-muted); line-height: 1.9; }
.detail-section { padding: 22px; margin-top: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 0.86666667rem; overflow-wrap: anywhere; }
.detail-section h3 { margin: 0 0 12px; color: #e8d0a5; }
.detail-section h3:not(:first-child) { margin-top: 22px; }
.detail-section p { color: #c0c2cc; line-height: 1.9; }
.detail-section > .raw { padding: 12px; background: #111419; border-left: 2px solid #796443; font-size: 0.8rem; }
.detail-section .panel { background: #1d212a; }
.evidence { display: inline-block; color: var(--text-soft); font-size: 0.66666667rem; overflow-wrap: anywhere; }
td .evidence { display: block; padding-top: 6px; }
.unlock-list { color: #c4c6ce; padding-left: 20px; line-height: 2; }
.unlock-list a { display: inline-block; min-height: 28px; }
.mastery-result { display: block; color: var(--gold) !important; background: var(--gold-surface); border: 1px solid #635034; padding: 12px 14px; border-radius: 4px; }
.detail-section details pre { max-height: 350px; overflow: auto; }
.review-note { color: #e5c49b; background: #31291f; border-left: 3px solid var(--gold); padding: 14px; font-size: 0.8rem; }
.compare-tray { position: fixed; bottom: 20px; left: calc(var(--sidebar) + 30px); right: 30px; max-width: 960px; margin: auto; padding: 14px 18px; display: flex; align-items: center; gap: 12px; border: 1px solid #a28554; border-radius: 6px; background: #2c2822; color: var(--text); box-shadow: 0 8px 32px #0008; font-size: 0.86666667rem; z-index: 15; }
.compare-tray .compare-count { margin-right: auto; }
.compare-tray button { background: #1d2027; color: var(--text); border: 1px solid #726345; border-radius: 4px; padding: 9px 14px; min-height: 38px; font-size: 0.8rem; }
.compare-tray .open-compare { background: var(--gold); color: #211b14; font-weight: 600; }
.compare-table th:first-child { position: sticky; left: 0; background: #242832; z-index: 1; }
.compare-table td { min-width: 130px; white-space: normal; }
html { scroll-padding-block: 65px 100px; }
@media (min-width: 1700px) { .cards, .skill-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1250px) {
  :root { --sidebar: 270px; }
  .brand { font-size: 1.2rem; gap: 9px; padding-inline: 2px; }
  .brand small { font-size: 0.46666667rem; }
  main { padding-inline: 28px; }
  .topbar { padding-inline: 28px; }
  .cards, .skill-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { width: 280px; }
  .codex-summary { gap: 16px; }
  .summary-heading { display: none; }
  .directory-hint { display: none; }
  .filters { gap: 8px; }
  .filters select { padding-left: 7px; font-size: 0.66666667rem; }
}
@media (max-width: 900px) {
  :root { --sidebar: 250px; }
  .sidebar { padding-inline: 10px; }
  .brand { font-size: 1.0666667rem; }
  .brand-mark { width: 28px; }
  .brand small { font-size: 0.4rem; }
  .nav-link { padding-inline: 9px; font-size: 0.73333333rem; gap: 7px; }
  .hero-copy { max-width: 75%; }
  .hero-art { right: -70px; opacity: .65; }
  .hero-art > span { display: none; }
  .codex-summary a { display: none; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-heading { gap: 9px; }
  .card-title button { font-size: 1.2rem; }
  .class-card { padding-inline: 14px; }
  .class-emblem { width: 42px; height: 49px; }
  .growth-label span { display: none; }
  .card-bottom { flex-wrap: wrap; }
  .more-note > a { display: none; }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(320px, calc(100vw - 48px)); height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; z-index: 51; transform: translateX(-100%); visibility: hidden; transition: transform 220ms ease, visibility 220ms; }
  .menu-open .sidebar { transform: translateX(0); visibility: visible; }
  .menu-open { overflow: hidden; }
  .drawer-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .menu-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 60%); z-index: 50; }
  .brand { font-size: 1.4rem; }
  .brand small { font-size: 0.53333333rem; }
  .brand-mark { width: 34px; height: 40px; }
  .sidebar-caption, .sidebar-bottom { display: none; }
  #navigation { display: block; margin-top: 16px; }
  .nav-group-title { font-size: 0.73333333rem; }
  .nav-link { font-size: 0.8rem; min-height: 44px; }
  .workspace { margin-left: 0; }
  .topbar { padding: 0 20px; height: 54px; justify-content: start; gap: 12px; }
  .menu-toggle { display: grid; width: 44px; height: 44px; flex-shrink: 0; font-size: 1.1333333rem; }
  .breadcrumb { font-size: 0.73333333rem; gap: 8px; }
  .topbar-links { margin-left: auto; font-size: 0.66666667rem; }
  .topbar-links > a:first-child { display: none; }
  main { padding-inline: 20px; padding-bottom: 44px; }
  #page-intro, #page-intro.class-intro { min-height: 234px; }
  .hero-copy { max-width: 78%; padding: 28px 0; }
  .eyebrow { font-size: 0.53333333rem; letter-spacing: 1px; gap: 6px; }
  h1 { font-size: 2.3333333rem; letter-spacing: 2px; margin-block: 12px; }
  .intro-description { font-size: 0.8rem; line-height: 1.9; }
  .hero-art { width: 240px; right: -100px; opacity: .38; }
  .hero-links { gap: 14px; margin-top: 20px; }
  .hero-links a { font-size: 0.66666667rem; }
  .hero-links a:nth-child(2) { display: none; }
  .codex-summary { gap: 16px; min-height: 58px; font-size: 0.6rem; }
  .codex-summary strong { font-size: 1.2666667rem; }
  .directory-heading { margin-top: 26px; }
  .directory-heading h2 { font-size: 1.4rem; }
  .catalog-controls { padding: 14px 12px; }
  .search-wrap input { font-size: 1.0666667rem; padding-right: 12px; height: 46px; }
  .search-hint { display: none; }
  .toolbar { gap: 8px; }
  .view-toggle button { width: 30px; height: 38px; }
  .class-tabs { gap: 20px; }
  .class-tabs button { font-size: 0.8rem; padding-bottom: 11px; min-height: 44px; }
  .class-tabs button span { font-size: 0.6rem; margin-left: 4px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filters label { font-size: 0.73333333rem; }
  .filters select { font-size: 0.8rem; min-height: 40px; padding-inline: 8px 20px; }
  .filters label:last-child { grid-column: 1 / -1; }
  .results-meta { margin-bottom: 24px; font-size: 0.6rem; }
  .section-heading h2 { font-size: 1.1333333rem; gap: 9px; }
  .section-heading small { font-size: 0.66666667rem; }
  .cards, .skill-cards { gap: 14px; }
  .card-description { font-size: 0.8rem; }
  .catalog-note { font-size: 0.8rem; }
  .rule-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .source-card h2 { font-size: 1.2rem; }
  .skill-card { padding: 18px; }
  footer { padding: 20px; flex-direction: column; gap: 5px; }
  .compare-tray { left: 12px; right: 12px; bottom: 12px; gap: 8px; padding: 12px; font-size: 0.73333333rem; }
  .compare-tray button { padding-inline: 9px; font-size: 0.73333333rem; min-height: 42px; }
  dialog { width: calc(100vw - 20px); max-height: 93dvh; }
  .dialog-bar { padding-inline: 18px 10px; }
  #detail-content { padding: 22px 16px; }
  .detail-section { padding: 16px; }
  .detail-hero { gap: 16px; }
  .detail-emblem { width: 60px; height: 68px; }
  dialog h2 { font-size: 1.8666667rem; }
  .detail-meta { font-size: 0.8rem; }
  .catalog-table th, .catalog-table td { padding: 10px; }
  .section-heading { flex-wrap: wrap; }
}
@media (max-width: 580px) {
  .cards, .skill-cards { grid-template-columns: 1fr; }
  .class-card { padding: 18px 20px 0; }
  .class-emblem { width: 52px; height: 58px; }
  .card-heading { gap: 14px; margin-bottom: 20px; }
  .card-title button { font-size: 1.5333333rem; min-height: 36px; }
  .card-index { font-size: 0.66666667rem; }
  .record-index { font-size: 0.73333333rem; }
  .growth-label { font-size: 0.66666667rem; }
  .growth-label span { display: block; font-size: 0.53333333rem; }
  .growth-stat { padding-block: 8px 5px; }
  .growth-stat small { font-size: 0.66666667rem; }
  .grade { font-size: 1.6666667rem; }
  .card-skill-preview span { font-size: 0.73333333rem; padding: 3px 8px; }
  .card-description { min-height: 0; margin-bottom: 16px; }
  .data-chip { font-size: 0.66666667rem; }
  .compare-check { font-size: 0.8rem; min-height: 36px; }
  .compare-check input { width: 16px; height: 16px; }
  .card-bottom { min-height: 55px; }
  .card-arrow { width: 36px; height: 44px; }
  .card-arrow .icon { width: 20px; height: 20px; }
  .skill-card h3 { font-size: 1.4rem; }
  .skill-card p { font-size: 0.86666667rem; }
  .small-pill { font-size: 0.73333333rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* 收緊查詢區的節奏，讓首屏直接露出職業資料。 */
.icon-button.menu-toggle { display: none; }
#page-intro.class-intro { min-height: 208px; }
.hero-copy { padding-block: 26px; }
.hero-art img { max-height: 220px; }
.hero-art > span { bottom: 14px; }
.codex-summary { min-height: 52px; }
.directory-heading { margin: 24px 0 16px; }
.catalog-controls { padding-block: 12px 14px; }
.toolbar { margin-bottom: 8px; }
.class-tabs { margin-bottom: 10px; }
.class-tabs button { padding-block: 5px 9px; }
.results-meta { margin-block: 12px 20px; }
@media (max-width: 760px) {
  .icon-button.menu-toggle { display: grid; }
  #page-intro.class-intro { min-height: 220px; }
  .class-tabs button { min-height: 44px; }
  .catalog-controls { padding-block: 12px; }
}
.filter-toggle { display: none; }
@media (max-width: 760px) {
  #page-intro, #page-intro.class-intro { min-height: 190px; }
  .hero-copy { padding-block: 23px; }
  .hero-links { margin-top: 14px; }
  .directory-heading { margin-top: 20px; }
  .filters { display: none; }
  .filters-open .filters { display: grid; padding-top: 10px; }
  .filter-toggle { display: flex; align-items: center; justify-content: end; gap: 7px; width: 100%; min-height: 36px; padding: 4px 0; background: none; border: 0; color: var(--text-muted); font-size: 0.73333333rem; }
  .filter-toggle .icon { width: 15px; height: 15px; }
  .filter-toggle[aria-expanded="true"] { color: var(--gold); }
  .class-tabs { margin-bottom: 0; }
}
.filters { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; }
@media (max-width: 900px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sidebar { padding-block: 12px; }
  #page-intro, #page-intro.class-intro { min-height: 170px; }
  .hero-copy { padding-block: 20px; }
  .directory-heading { margin-block: 18px 14px; }
  .directory-heading .section-kicker { display: none; }
  .filters label:last-child { grid-column: auto; }
}
/* 延伸主要按鈕點擊範圍，次要連結及比較控制保持獨立。 */
.class-card, .skill-card { position: relative; }
.class-card .card-open::after, .skill-card .card-open::after { content: ""; position: absolute; inset: 0; border-radius: 6px; cursor: pointer; z-index: 1; }
.class-card .card-open:focus-visible, .skill-card .card-open:focus-visible { outline: none; }
.class-card .card-open:focus-visible::after, .skill-card .card-open:focus-visible::after { outline: 2px solid var(--gold); outline-offset: 4px; }
.compare-check, .skill-class-list a, .item-card > a { position: relative; z-index: 2; }
.class-card .card-arrow { pointer-events: none; }
.catalog-table tr[data-open-class] { cursor: pointer; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); background: var(--surface); font-size: 0.73333333rem; white-space: nowrap; }
.theme-toggle > span:first-child { font-size: 1.2666667rem; line-height: 1; }
.theme-toggle:hover { background: var(--surface-hover); }
.theme-status:empty { display: none; }
.theme-status { color: var(--text-muted); font-size: 0.8rem; margin: 12px 24px; }
@media (max-width: 760px) {
  .topbar-links { gap: 10px; }
  .topbar-links .theme-toggle { display: inline-flex; }
  .theme-toggle { padding-inline: 7px; min-height: 34px; font-size: 0.66666667rem; gap: 4px; }
}
@media (max-width: 400px) { .topbar-links .source-link { display: none; } }
.theme-toggle .icon { width: 16px; height: 16px; }
@media (max-width: 760px) { .topbar-links > a[href="#strategies"] { display: none; } }

/* 保留文字換行與控制項所需空間。 */
.topbar { height: auto; min-height: 64px; padding-block: 10px; gap: 12px; flex-wrap: wrap; }
.hero-copy { max-width: 80%; }
.search-wrap input { height: auto; min-height: 52px; padding-right: 12px; }
.search-hint { display: none; }
.filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cards, .skill-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); }
.card-heading { flex-wrap: wrap; }
.card-title { min-width: 140px; }
.section-heading h2 { flex-wrap: wrap; }
.directory-heading { flex-wrap: wrap; }
.class-links { display: flex; flex-wrap: wrap; gap: 8px; }
.class-links .text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid var(--gold-dark); border-radius: 4px; background: var(--gold-surface); }
.class-links .text-button:hover { border-color: var(--gold); }
@media (max-width: 1100px) and (min-width: 761px) {
  .toolbar { flex-wrap: wrap; }
  .search-wrap { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .hero-copy { max-width: 100%; padding-block: 16px; }
  .hero-art { opacity: .15; }
  .toolbar { flex-wrap: wrap; }
  .search-wrap { flex-basis: 100%; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-tray { flex-wrap: wrap; }
  .menu-open #navigation { grid-template-columns: 1fr; }
  .breadcrumb { flex-wrap: wrap; }
}
@media (max-width: 580px) {
  /* 手機優先顯示查詢與職業資料，收起圖鑑的裝飾性介紹。 */
  .class-intro .intro-description, .class-intro .eyebrow, .class-intro .hero-links { display: none; }
  #page-intro.class-intro { min-height: 118px; }
  .class-tabs { flex-wrap: nowrap; gap: 14px; overflow-x: auto; }
  .class-tabs button { flex-shrink: 0; white-space: nowrap; }
  .directory-heading { margin-block: 14px 10px; }
  .section-heading { margin-top: 16px; }
}
@media (max-width: 580px) {
  #page-intro.class-intro { min-height: 98px; }
  .class-intro .hero-copy { padding-block: 8px; }
  .class-intro h1 { margin-block: 4px; }
  .results-meta { margin-block: 8px 12px; }
  .section-heading { margin-top: 12px; }
}
/* 規則手冊、寶石工坊與冒險圖鑑。 */
.collection-stamp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 22px 0; color: var(--text-muted); font-size: .8rem; }
.guide-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin: 24px 0; }
.guide-index a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: .87rem; min-height: 44px; }
.guide-index a span { font: .73rem monospace; color: var(--gold); }
.guide-index a:hover { border-color: var(--gold); color: var(--gold); }
.guide-toolbar { margin-block: 24px 14px; }
.handbook { max-width: 1000px; }
.handbook-section { scroll-margin-top: 24px; padding: 28px 32px; }
.handbook-section > h2 { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.handbook-section h3 { font-size: 1rem; color: var(--gold); margin: 24px 0 12px; }
.handbook-section p, .handbook-section li, .guide-mechanics p, .guide-mechanics li { font-size: .93rem; line-height: 1.95; }
.handbook-section ul, .guide-mechanics ul { padding-left: 22px; }
.handbook-section li + li, .guide-mechanics li + li { margin-top: 10px; }
.handbook-section code, .guide-mechanics code { display: inline; overflow-wrap: anywhere; white-space: normal; padding: 2px 5px; border-radius: 3px; color: var(--text); background: var(--surface-raised); font-size: .9em; }
.guide-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.guide-highlights > div { padding: 20px; border: 1px solid var(--line); background: var(--surface); border-top: 2px solid var(--gold-dark); border-radius: 5px; }
.guide-highlights span { display: block; font-size: .8rem; color: var(--text-muted); }
.guide-highlights strong { display: block; font: 600 1.6rem/1.5 var(--font-title); margin-top: 8px; color: var(--gold); }
.guide-highlights p { color: var(--text-muted); font-size: .8rem; margin: 6px 0 0; }
.guide-mechanics summary { font-size: .93rem; color: var(--gold); min-height: 44px; align-content: center; }
.guide-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.guide-tabs button { min-height: 44px; padding: 8px 14px; border-radius: 4px; font-size: .87rem; background: var(--surface); color: var(--text-muted); border: 1px solid var(--line); }
.guide-tabs button[aria-pressed="true"] { background: var(--gold-surface); color: var(--gold); border-color: var(--gold-dark); }
.gem-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gem-card-top .small-pill { margin: 0; }
.gem-card-top .skill-card-emblem { margin: 0; }
.gem-card h3, .stage-card h3 { margin-top: 16px; }
.gem-card .card-open, .stage-card .card-open { color: var(--text); }
.gem-card .card-open:hover, .stage-card .card-open:hover { color: var(--gold); }
.gem-card p, .stage-card p { font-size: .87rem; }
.gem-facts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--text-muted); }
.gem-facts strong { color: var(--gold); }
.stage-card .stage-unlock { color: var(--gold); }
.stage-drops { border-top: 1px solid var(--line); padding-top: 12px; }
.ingredient-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ingredient-list b { color: var(--text-muted); font-weight: 500; }
.ingredient-plus { color: var(--text-soft); }
.recipe-row + .recipe-row { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.recipe-number { display: block; font-size: .8rem; color: var(--text-soft); margin-bottom: 8px; }
.recipe-result { color: var(--gold) !important; margin-block: 8px 0; }
.guide-empty { padding: 32px 20px; text-align: center; color: var(--text-muted); border: 1px dashed var(--line); border-radius: 5px; }
@media (max-width: 760px) {
  .guide-highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .guide-highlights > div { padding: 12px 10px; }
  .guide-highlights strong { font-size: 1.1rem; overflow-wrap: anywhere; }
  .guide-highlights p { font-size: .73rem; }
  .handbook-section { padding: 20px 18px; }
  .guide-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-index a { font-size: .8rem; padding: 10px; gap: 8px; }
}

/* 城鎮商店沿用圖鑑卡片與主題色。 */
.town-shop-intro { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; align-items: center; margin-top: 24px; }
.town-shop-intro p { margin-bottom: 0; }
.town-shop-context { border-left: 1px solid var(--line); padding-left: 24px; }
.town-shop-context .small-pill { margin: 0; }
.town-sort { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: var(--text-muted); }
.town-sort select { min-height: 44px; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; color: var(--text); background: var(--surface); max-width: 100%; }
.shop-product-card h3 { margin-top: 16px; }
.shop-product-card .card-open { color: var(--text); }
.shop-product-card .card-open:hover { color: var(--gold); }
.shop-product-description { white-space: pre-line; }
.shop-product-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.shop-product-stats > span { flex: 1; min-width: 70px; text-align: center; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; background: var(--background); }
.shop-product-stats small { display: block; font-size: .73rem; color: var(--text-muted); }
.shop-product-stats strong { display: block; font-size: 1rem; color: var(--gold); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .town-shop-intro { grid-template-columns: 1fr; gap: 16px; }
  .town-shop-context { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .town-sort { width: 100%; }
}

.currency-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-block: 1.5rem;
}
.currency-flow > div { min-width: 0; }
.currency-flow-arrow { display: grid; justify-items: center; font-size: 1.8rem; }
.currency-flow-arrow small { font-size: .8rem; }
@media (max-width: 760px) {
  .currency-flow { grid-template-columns: 1fr; }
  .currency-flow-arrow { justify-items: start; font-size: 1.2rem; }
}

@media (max-width: 600px) {
  .resource-highlights { grid-template-columns: 1fr; }
}

.codex-progress { margin-bottom: 1.5rem; }
.codex-progress-heading, .codex-progress-value { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.codex-progress-heading h2 { margin: 0; font-size: 1.1rem; }
.codex-progress-heading > span { font-size: .8rem; color: var(--text-muted); }
.codex-progress-value { margin-block: 1rem .5rem; }
.codex-progress-value strong { font-size: 1.5rem; }
.codex-progress-value small { font-size: 1rem; font-weight: normal; }
.codex-progress progress { display: block; width: 100%; height: .5rem; accent-color: var(--gold); }
.codex-progress p { margin-bottom: 0; }

#blackmarket-section { margin-top: 1rem; }
.blackmarket-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.blackmarket-prizes { list-style: none; padding: 0; }
.blackmarket-prizes li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.blackmarket-prizes strong { white-space: nowrap; color: var(--gold); }
.blackmarket-prizes small { font-size: .75rem; font-weight: normal; }
@media (max-width: 760px) { .blackmarket-groups { grid-template-columns: 1fr; gap: 1rem; } }

/* 行動導覽與觸控操作 */
.drawer-heading, .menu-backdrop { display: none; }
@media (max-width: 760px) {
  .drawer-heading { display: flex; }
  .menu-backdrop:not([hidden]) { display: block; }
  .topbar { position: sticky; top: 0; z-index: 20; background: var(--background); padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .topbar-links > a { display: none; }
  .breadcrumb { min-width: 0; }
  .breadcrumb strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .icon-button, .view-toggle button, .theme-toggle, .filters select { min-width: 44px; min-height: 44px; }
  .view-toggle { flex-shrink: 0; }
  .compare-check { min-height: 44px; padding: 8px; }
  .compare-tray { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  body:has(.compare-tray:not([hidden])) main { padding-bottom: 120px; }
  .dialog-bar { position: sticky; top: 0; z-index: 2; background: var(--surface); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.alchemy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.alchemy-recipe { margin: 0; min-width: 0; }
.alchemy-recipe .ingredient-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alchemy-recipe a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.alchemy-result { display: flex; align-items: center; gap: 12px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.detail-section > .alchemy-recipe { margin-top: 12px; }
@media (max-width: 760px) { .alchemy-grid { grid-template-columns: 1fr; } }

/* 一般圖鑑採緊湊資訊卡；職業卡維持原有版面。 */
.skill-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); grid-auto-rows: 1fr; gap: 12px; align-items: stretch; }
.skill-card { padding: 14px 16px; }
.skill-card h3 { margin-block: 0 6px; }
.skill-card h3 .card-open { display: inline-flex; align-items: center; min-height: 44px; }
.skill-card p { margin-block: 8px; line-height: 1.7; }
.skill-card p:empty { display: none; }
.skill-card-emblem, .item-seal { float: left; display: flex; align-items: center; min-height: 44px; margin: 0 10px 0 0; }
.item-seal .icon { width: 24px; height: 24px; }
.skill-card > h3 + .small-pill { clear: left; }
.skill-class-list { padding-top: 8px; margin-top: 8px; }
.gem-card-top { float: right; margin-left: 10px; min-height: 44px; }
.gem-card-top .skill-card-emblem { display: none; }
.gem-card h3, .stage-card h3, .shop-product-card h3 { margin-top: 0; }
.gem-card p, .stage-card p, .shop-product-stats { clear: both; }
.gem-facts { gap: 6px; padding-top: 8px; }
.shop-product-stats { gap: 12px; margin-block: 6px; }
.shop-product-stats > span { display: inline-flex; align-items: baseline; flex: 0 1 auto; gap: 6px; min-width: 0; border: 0; padding: 0; background: none; text-align: left; flex-wrap: wrap; }
.shop-product-stats small, .shop-product-stats strong { display: inline; }
.stage-drops { padding-top: 8px; }
.alchemy-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); grid-auto-rows: 1fr; gap: 10px; align-items: stretch; }
.alchemy-recipe { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; }
.alchemy-recipe .ingredient-list { gap: 4px 8px; }
.alchemy-result { margin: 0; padding: 0; border: 0; gap: 8px; }
@media (max-width: 760px) {
  .skill-cards { gap: 10px; }
  .skill-card { padding: 12px 14px; }
  .alchemy-recipe { padding: 8px 12px; }
}
.town-shop-intro { padding: 14px 16px; gap: 14px; }
.town-shop-intro h2 { margin-bottom: 4px; }
.town-shop-intro p { margin-top: 4px; }
.town-shop-context { padding-left: 14px; }
.guide-mechanics { padding: 14px 16px; }
@media (max-width: 760px) {
  .town-shop-intro { gap: 6px; }
  .town-shop-context { border: 0; padding: 0; }
}

/* 遊戲圖示使用本地素材；文字保留供辨識與輔助閱讀。 */
.game-icon { display: inline-block; width: 20px; height: 20px; object-fit: contain; vertical-align: middle; flex: 0 0 auto; margin-right: 4px; }
.growth-stat small { display: flex; align-items: center; justify-content: center; gap: 3px; }
.growth-stat .game-icon { width: 16px; height: 16px; margin: 0; }
.shop-product-stats small { display: inline-flex; align-items: center; }

.research-navigation { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 16px; }
.research-navigation a, .stage-strategy-link { display: inline-flex; align-items: center; min-height: 44px; }
.stage-strategies { position: relative; z-index: 2; border-top: 1px solid var(--line); margin-top: 8px; }
.strategy-article, .strategy-section { scroll-margin-top: 80px; }
.strategy-section + .strategy-section { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 8px; }
.strategy-section li { margin-block: 8px; }
.research-cards .text-button { min-height: 44px; display: inline-flex; align-items: center; }

/* 怪物圖鑑與關卡互連。 */
.monster-toolbar { align-items: end; flex-wrap: wrap; }
.monster-stage-filter { display: grid; gap: 6px; color: var(--text-muted); font-size: .8rem; }
.monster-stage-filter select { min-height: 44px; max-width: 100%; }
.monster-card { min-width: 0; }
.monster-card h3 { margin-top: 12px; }
.monster-habitats { font-size: .87rem; overflow-wrap: anywhere; }
.monster-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.monster-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: .8rem; }
.monster-links a:hover { border-color: var(--gold); }
.monster-encounter + .monster-encounter { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.monster-encounter h4 { margin-block: 10px; color: var(--gold); }
.monster-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 14px 0; }
.monster-stats > div { min-width: 0; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.monster-stats dt { display: flex; align-items: center; color: var(--text-muted); font-size: .8rem; }
.monster-stats dd { margin: 6px 0 0; font-size: 1.1rem; font-weight: 600; }
.monster-rewards { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: .87rem; }
.monster-rewards > span { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 600px) {
  .monster-toolbar > * { width: 100%; min-width: 0; }
}
.stage-card .monster-links { clear: both; }
.monster-links a { position: relative; z-index: 2; }

/* 裝備頁沿用商店的緊湊卡片與能力值。 */
.equipment-toolbar { flex-wrap: wrap; align-items: end; }
.equipment-sort { display: grid; gap: 6px; color: var(--text-muted); font-size: .8rem; }
.equipment-sort select { min-height: 44px; max-width: 100%; }
@media (max-width: 600px) {
  .equipment-toolbar > * { width: 100%; min-width: 0; }
}

/* 鍊金與合成為獨立系統，共用材料連結與緊湊版面。 */
.production-system { margin-block: 20px; padding: 16px 20px; }
.production-system h2 { font-size: 1rem; margin: 0; }
.production-system p { font-size: .87rem; margin-block: 10px 0; }
.production-system code { overflow-wrap: anywhere; }
.synthesis-toolbar { flex-wrap: wrap; align-items: end; }
.synthesis-sort { display: grid; gap: 6px; color: var(--text-muted); font-size: .8rem; }
.synthesis-sort select { min-height: 44px; max-width: 100%; }
.synthesis-recipe { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; }
.synthesis-recipe-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.synthesis-recipe-heading h3 { margin: 0; font-size: 1rem; }
.synthesis-recipe-heading > strong { color: var(--gold); font-size: .8rem; white-space: nowrap; }
.synthesis-recipe a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 600px) {
  .synthesis-toolbar > * { width: 100%; min-width: 0; }
}

.dynamic-growth { padding: 14px; margin-block: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.dynamic-growth strong { color: var(--gold); font-size: .93rem; }
.dynamic-growth p { margin: 6px 0 0; color: var(--text-muted); font-size: .8rem; }

/* 冒險卡片以場景圖示與色條辨識，沿用主題色且不以顏色表示難度。 */
[data-scene-tone="green"] { --scene-accent: var(--green); }
[data-scene-tone="blue"] { --scene-accent: var(--blue); }
[data-scene-tone="purple"] { --scene-accent: var(--purple); }
[data-scene-tone="rose"] { --scene-accent: var(--rose); }
[data-scene-tone="gold"] { --scene-accent: var(--gold); }
.stage-card { border-top: 3px solid var(--scene-accent); background: linear-gradient(135deg, color-mix(in srgb, var(--scene-accent) 7%, transparent), transparent 65%), var(--surface); }
.stage-card-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stage-scene-icon { display: inline-flex; flex: 0 0 44px; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 10px; background: color-mix(in srgb, var(--scene-accent) 13%, var(--surface)); font: 26px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.stage-card-title { flex: 1; min-width: 0; }
.stage-card-title h3 { margin: 0; line-height: 1.5; }
.stage-card-title h3 .card-open { min-height: 44px; }
.stage-category { display: block; color: var(--scene-accent); font-size: .8rem; line-height: 1.5; }
.stage-floors { flex-shrink: 0; margin: 0; }
.stage-card .stage-unlock { color: var(--text-muted); }
.stage-card:focus-within { border-color: var(--scene-accent); }
.stage-detail-heading { display: flex; align-items: center; gap: 12px; }
.stage-detail-heading h2 { min-width: 0; }
.skill-card.stage-card[data-scene-tone] { border-top-color: var(--scene-accent); }

/* 社群入口置於導覽底部，手機抽屜內同樣可使用。 */
.sidebar-bottom { margin-top: auto; }
.sidebar-bottom .discord-invite { min-height: 44px; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: .86666667rem; color: var(--text); }
.discord-icon { width: 24px; height: 24px; flex: 0 0 24px; color: var(--blue); }
.sidebar-bottom .discord-invite:hover { background: var(--surface-hover); border-color: var(--blue); }
.sidebar-bottom .discord-invite:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 760px) {
  .sidebar-bottom { display: block; margin-top: 16px; }
  .sidebar-bottom p { display: none; }
}

/* 怪物名稱以一致色盤標示，保留行內閱讀節奏。 */
.strategy-monster { font-weight: 600; white-space: nowrap; }
.strategy-monster[data-monster-tone="blue"] { color: var(--blue); }
.strategy-monster[data-monster-tone="green"] { color: var(--green); }
.strategy-monster[data-monster-tone="purple"] { color: var(--purple); }
.strategy-monster[data-monster-tone="rose"] { color: var(--rose); }
.strategy-monster[data-monster-tone="gold"] { color: var(--gold); }
.strategy-article { max-width: 960px; }
.strategy-article .strategy-section li { margin-block: 12px; line-height: 1.95; }

.gem-card .card-open, .gem-detail-title { display: flex; align-items: center; gap: 8px; }

/* 數值圖鑑共用卡片／列表模式與可操作排序欄位。 */
.catalog-view-toggle { align-self: end; }
.catalog-view-toggle button { min-width: 44px; min-height: 44px; }
.equipment-toolbar, .monster-toolbar { align-items: end; flex-wrap: wrap; }
.monster-sort { display: grid; gap: 6px; color: var(--text-muted); font-size: .8rem; }
.monster-sort select { min-height: 44px; max-width: 100%; }
.numeric-table-wrap { max-height: 75dvh; scrollbar-width: thin; }
.numeric-table-wrap:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.numeric-catalog-table { min-width: 900px; }
.numeric-catalog-table caption { text-align: left; padding: 10px 14px; color: var(--text-muted); background: var(--surface); }
.numeric-catalog-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-raised); }
.numeric-catalog-table th:first-child { z-index: 3; }
.numeric-catalog-table :is(th, td):first-child { position: sticky; left: 0; min-width: 140px; background: var(--surface); }
.numeric-catalog-table th:first-child { background: var(--surface-raised); }
.numeric-catalog-table td { font-variant-numeric: tabular-nums; }
.numeric-catalog-table th button { display: flex; gap: 6px; align-items: center; min-height: 44px; padding: 4px 0; background: transparent; border: 0; color: inherit; text-align: left; white-space: nowrap; }
.numeric-catalog-table th button span { color: var(--gold); }
.numeric-catalog-table th button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.numeric-catalog-table td .text-button { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }
.numeric-catalog-table td small { white-space: nowrap; }
.numeric-catalog-table .catalog-effect { min-width: 220px; max-width: 340px; white-space: normal; }
.numeric-catalog-table tr[data-open-route] { cursor: pointer; }
.numeric-catalog-table tr:hover td { background: var(--surface-hover); }
@media (max-width: 760px) {
  .monster-sort, .equipment-sort { flex: 1 1 170px; min-width: 0; }
  .numeric-catalog-table :is(th, td):first-child { min-width: 120px; max-width: 150px; }
  .numeric-catalog-table td:first-child a { white-space: normal; }
}

.currency-icon { display: inline-flex; vertical-align: middle; white-space: nowrap; }
.currency-icon .game-icon { margin: 0; }

.numeric-catalog-table th { padding-block: 6px; }
.numeric-catalog-table td { padding-block: 5px; }
.numeric-catalog-table caption { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
