:root {
  color-scheme: dark;
  --page: #101617;
  --panel: #182222;
  --inset: #111a1b;
  --border: #344344;
  --text: #f4f2de;
  --muted: #acbdb9;
  --gold: #e8bc72;
  --green: #96e7c1;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 80% 0, #1a2728, transparent 55%), var(--page); min-height: 100vh; }
h1, h2, h3, p, ol { margin: 0; }
img { display: block; }
[hidden] { display: none !important; }
.shell { width: min(1180px, 94%); margin-inline: auto; }
.site-head .header-inner { border-bottom: 1px solid var(--border); }
.header-inner { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 13px; font-size: 21px; font-weight: 800; letter-spacing: .09em; }
.brand-icon { flex: none; width: 18px; height: 24px; background: linear-gradient(110deg, #d7ffd5 33%, #7ce0b5 34% 65%, #368f78 66%); clip-path: polygon(45% 0, 100% 32%, 90% 68%, 45% 100%, 0 67%, 5% 33%); }
.brand-copy { display: grid; gap: 2px; }
.brand-subtitle { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.site-nav { display: flex; align-self: stretch; gap: 14px; }
.site-nav a { display: grid; place-items: center; border-bottom: 2px solid transparent; padding: 2px 9px 0; color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--green); }
.save { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; }
.save i, .signal::before { width: 6px; height: 6px; display: inline-block; background: var(--green); }
.layout { display: grid; grid-template-columns: 222px minmax(0, 1fr); gap: 22px; padding-block: 26px; align-items: start; }
.main-column { display: grid; gap: 18px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); }
.levels-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 13px; }
.levels-head h2 { font-size: 17px; }
.levels-head span, .section-head > span, .route-head > span { color: var(--muted); font-size: 14px; }
.stages, .nodes { list-style: none; padding: 0; }
.worlds { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.world-chip { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.world-chip img { width: 21px; height: 21px; image-rendering: pixelated; }
.world-chip[data-status="current"] { border-color: var(--world); color: var(--world); background: color-mix(in srgb, var(--world) 12%, var(--panel)); }
.world-chip[data-status="locked"] img { opacity: .55; }
.world-chip b { white-space: nowrap; }
.stages { display: grid; gap: 4px; padding: 0 8px 8px; }
.stage { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; width: 100%; text-align: left; min-height: 54px; padding: 7px 8px; border: 1px solid transparent; background: transparent; }
.stage:disabled { color: var(--text); border-color: transparent; background: transparent; }
.stage:hover:not(:disabled) { background: #253232; border-color: var(--border); }
.stage[data-status="current"] { background: #22342f; border-color: #507a69; box-shadow: inset 3px 0 var(--green); }
.stage[data-status="locked"] .stage-icon { opacity: .45; }
.stage-icon { background: var(--inset); width: 35px; height: 35px; border: 1px solid var(--border); display: grid; place-items: center; }
.stage-icon img { width: 23px; height: 23px; image-rendering: pixelated; }
.stage b, .stage small { display: block; }
.stage b { font-size: 14px; }
.stage small { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; }
.stage-amount { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.stage[data-status="current"] .stage-amount { color: var(--green); }
.mine { --ore: var(--green); min-width: 0; }
.mine-head { position: absolute; z-index: 1; inset: 17px 20px auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; text-shadow: 0 2px 5px #0a0b09; }
.chapter, .section-label { color: var(--green); font-size: 13px; }
.chapter { margin-bottom: 3px; }
h1 { font-size: clamp(24px, 2.65vw, 36px); line-height: 1.22; letter-spacing: .04em; }
.signal { display: inline-flex; flex: none; align-items: center; gap: 7px; color: #a4efcd; border: 1px solid #588878; background: #112522; font-size: 13px; padding: 6px 10px; }
.signal::before { content: ""; }
.signal[data-idle="true"] { color: #e0c598; background: #332c20; border-color: #5f5138; }
.signal[data-idle="true"]::before { background: var(--gold); }
.signal[data-battle="true"] { color: #ffc0a7; background: #3a2422; border-color: #a16757; }
.signal[data-battle="true"]::before { background: #f19b82; }
.scene { position: relative; overflow: hidden; background: #142224; border-bottom: 1px solid var(--border); }
.scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(95deg, #0c1a1dc4, #13303530 44%, #14272b14 72%, transparent); }
.scene canvas { display: block; width: 100%; height: clamp(207px, 22vw, 282px); object-fit: cover; object-position: right 66%; image-rendering: pixelated; }
.scene-effect {
  --effect-color: #f8ce7e;
  position: absolute;
  z-index: 2;
  top: 29%;
  right: clamp(15px, 13%, 125px);
  max-width: 70%;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 9px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--effect-color) 55%, #1b2725);
  border-left: 3px solid var(--effect-color);
  background: #111918f0;
  box-shadow: 0 3px #080a0b90;
  color: var(--effect-color);
  pointer-events: none;
}
.scene-effect strong { font-size: clamp(13px, 2vw, 16px); white-space: nowrap; }
.scene-effect span { color: var(--text); font-size: 12px; }
.scene-effect[data-effect="encounter"] { --effect-color: #ffb098; animation: encounter-cue .45s ease-out; }
.scene-effect[data-effect="treasure"] { animation: treasure-cue .48s ease-out; }
.scene-effect[data-effect="win"] { --effect-color: var(--green); animation: win-cue .54s ease-out; }
.scene-effect[data-effect="loss"] { --effect-color: #ffa48c; animation: loss-cue .54s ease-out; }
@keyframes encounter-cue { from { opacity: .15; transform: translateX(13px); } }
@keyframes treasure-cue { from { opacity: .15; transform: translateY(7px); } }
@keyframes win-cue { from { opacity: .15; transform: translateY(7px); } }
@keyframes loss-cue { from { opacity: .15; transform: translateX(-8px); } }
.scene-readout { position: absolute; z-index: 1; bottom: 16px; left: 20px; display: grid; gap: 4px; text-shadow: 0 2px 5px #0a0b09; pointer-events: none; }
.scene-readout > span { color: #d2d4c4; font-size: 13px; }
.scene-readout strong { font-family: Consolas, "Courier New", monospace; font-size: clamp(24px, 4vw, 43px); line-height: 1; font-variant-numeric: tabular-nums; }
.yield { position: absolute; z-index: 1; bottom: 12px; right: 20px; display: flex; align-items: center; gap: 7px; background: #112022e8; border: 1px solid #456360; padding: 5px 9px; color: var(--ore); font-size: 13px; }
.yield img { width: 18px; height: 18px; image-rendering: pixelated; }
.route { padding: 15px 21px 13px; }
.route-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.route-head h2 { font-size: 15px; }
.nodes { position: relative; display: grid; grid-template-columns: repeat(7, minmax(74px, 1fr)); gap: 5px; overflow-x: auto; margin-block: 11px 9px; padding-bottom: 3px; }
.nodes::before { content: ""; position: absolute; top: 15px; left: 7.15%; right: 7.15%; height: 1px; background: #435655; }
.node { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; color: var(--muted); font-size: 12px; }
.node b { font-weight: 600; }
.node-icon { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #485e5b; background: #213031; border-radius: 3px; }
.node-icon img { width: 20px; height: 20px; object-fit: contain; }
.node-icon img[data-pixel="true"] { image-rendering: pixelated; }
.node[data-status="future"] .node-icon img { filter: grayscale(.9); opacity: .62; }
.node[data-status="next"] .node-icon { border-color: var(--green); background: #244034; }
.node[data-status="next"] b { color: var(--green); }
.node[data-status="done"] .node-icon { border-color: #58766b; background: #293a36; }
.node[data-status="done"] b { color: #c5ded2; }
.node[data-status="battle"] .node-icon { border-color: #ef9b85; background: #3c2a2a; }
.node[data-status="battle"] b { color: #ffc1a9; }
.node[data-rank="boss"] > span:last-child { color: var(--gold); }
.track { background: #354443; height: 5px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--ore, var(--green)); transition: width .22s linear; }
.encounter { padding: 13px 21px; border-bottom: 1px solid var(--border); background: #182426; }
.encounter-live { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; }
.fighter { --ore: var(--green); min-width: 0; }
.fighter.opponent { --ore: #ef9b85; }
.fighter > div:first-child { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; min-height: 22px; font-size: 14px; }
.fighter > div:first-child span { margin-left: auto; font: 13px Consolas, monospace; white-space: nowrap; color: var(--muted); }
.fighter img { width: 22px; height: 22px; object-fit: contain; }
.round { text-align: center; color: var(--muted); font-size: 12px; }
.round h2 { font-size: 14px; color: #ffc2a9; }
.encounter-result { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 14px; }
.encounter-result strong { color: var(--green); }
.encounter-result[data-outcome="loss"] strong { color: #ffc2a9; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 21px 13px; border-top: 1px solid var(--border); }
.controls p { min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.actions { flex: none; display: flex; flex-wrap: wrap; gap: 7px; }
button { font: inherit; font-size: 14px; font-weight: 700; border: 1px solid #536463; color: var(--text); background: #263232; padding: 8px 13px; cursor: pointer; white-space: nowrap; }
button:hover:not(:disabled) { filter: brightness(1.15); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; color: #9baaa7; background: #263131; border-color: #425453; }
button.primary:not(:disabled) { background: var(--green); border-color: var(--green); color: #0d2b22; }
.tool { display: flex; align-items: center; gap: 15px; padding: 13px 20px; }
.tool-icon { flex: none; width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--inset); }
.tool-icon img { width: 42px; height: 42px; image-rendering: pixelated; }
.tool-icon[data-enchanted="true"] { border-color: #785d83; background: radial-gradient(ellipse at 45% 75%, #423447, #1c1b1a 69%); }
#pick[data-tint="red"] { filter: sepia(1) saturate(4) hue-rotate(308deg); }
#pick[data-tint="green"] { filter: sepia(1) saturate(4) hue-rotate(65deg); }
#pick[data-tint="violet"] { filter: sepia(1) saturate(4) hue-rotate(215deg); }
.tool-info { min-width: 0; }
.tool-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
h2 { font-size: 19px; }
.tool-label span { font-size: 13px; color: #d9b7e6; }
.efficiency { display: flex; gap: 4px; margin-top: 6px; }
.efficiency i { width: 20px; height: 4px; background: #3e4b4b; }
.efficiency .filled { background: #c8a0db; }
.upgrade { display: grid; justify-items: end; gap: 4px; margin-left: auto; }
.upgrade small { color: var(--muted); font-size: 12px; }
.equipment-panel { padding: 13px 15px; }
.combat-summary { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 4px 13px; color: var(--muted); font-size: 13px; }
.combat-summary a { color: var(--green); white-space: nowrap; }
.hero-experience { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.hero-experience .track { width: min(175px, 42%); }
.equipment-reward { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; border-top: 1px solid var(--border); padding-top: 9px; margin-top: 10px; font-size: 13px; }
.equipment-reward > span { color: var(--muted); }
#reward-items { display: flex; gap: 5px; }
#reward-items img { width: 27px; height: 27px; object-fit: contain; }
.section-head { margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field-status { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.card { --ore: #e8bc72; overflow: hidden; }
.card:nth-child(2) { --ore: #87dcd6; }
.card:nth-child(3) { --ore: #b8a1dd; }
.card .display {
  display: grid;
  place-items: center;
  min-height: 103px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 92%, color-mix(in srgb, var(--ore) 23%, transparent), transparent 58%),
    repeating-linear-gradient(0deg, transparent 0 15px, #90afa70b 15px 16px),
    repeating-linear-gradient(90deg, transparent 0 15px, #90afa70b 15px 16px);
}
.card .display img { width: 62%; height: 78px; object-fit: contain; animation: bob 2.3s ease-in-out infinite alternate; }
.card:nth-child(2) img { animation-duration: 1.1s; }
.card:nth-child(3) img { animation-duration: 3s; }
.card.locked .display img { filter: saturate(.45); opacity: .78; animation: none; }
.card .body { min-width: 0; padding: 10px 13px; display: grid; align-content: center; gap: 5px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
.card h3 { font-size: 16px; }
.card a, .habitat { color: var(--muted); font-size: 12px; }
.card .track { height: 3px; }
footer { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
footer details { text-align: right; }
footer summary { cursor: pointer; }
footer p { font-size: 13px; max-width: 345px; margin-top: 7px; }
footer a { color: var(--gold); white-space: nowrap; }
@keyframes bob { from { transform: translateY(2px); } to { transform: translateY(-3px); } }

@media (max-width: 1000px) {
  .shell { width: calc(100% - 36px); }
  .layout { grid-template-columns: 188px minmax(0, 1fr); gap: 14px; }
  .stage { gap: 5px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { min-height: 52px; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-block: 12px; gap: 12px; }
  .levels-head { padding: 8px 12px 4px; }
  .stages { display: flex; overflow-x: auto; gap: 4px; padding: 0 6px 6px; }
  .stages > li { flex: 1 0 105px; }
  .stage { grid-template-columns: 28px minmax(0, 1fr); min-height: 48px; min-width: 98px; padding: 3px 6px; }
  .stage-icon { width: 27px; height: 27px; }
  .stage-icon img { width: 20px; height: 20px; }
  .stage-amount { grid-column: 2; font-size: 11px; }
  .stage small, .stage b { font-size: 12px; }
  .main-column { gap: 11px; }
  .route, .controls { padding-inline: 12px; }
  .encounter { padding-inline: 12px; }
  .mine-head { inset: 13px 12px auto; }
  .scene-readout { left: 12px; }
  .yield { right: 12px; }
}
@media (max-width: 670px) {
  .header-inner { gap: 7px; }
  .brand { gap: 7px; font-size: 16px; letter-spacing: .02em; }
  .brand-icon { width: 12px; height: 16px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding-inline: 6px; }
  .save { gap: 4px; font-size: 11px; }
}
@media (max-width: 480px) {
  .nodes::before { display: none; }
  .world-chip { padding-inline: 5px; gap: 4px; font-size: 12px; }
  .world-chip img { width: 16px; height: 16px; }
  .encounter-live { gap: 8px; }
  .fighter > div:first-child { flex-wrap: wrap; gap: 3px; font-size: 12px; }
  .fighter > div:first-child span { font-size: 11px; }
  .fighter img { display: none; }
  .controls { flex-wrap: wrap; }
  .actions { flex: 1; }
  .actions button { flex: 1; }
  .tool { gap: 8px; padding: 9px; }
  .tool-icon { width: 45px; height: 45px; }
  .tool-icon img { width: 31px; height: 31px; }
  .tool h2 { font-size: 16px; }
  .cards { grid-template-columns: 1fr; gap: 5px; }
  .card { display: grid; grid-template-columns: 36% minmax(0, 1fr); min-height: 90px; }
  .card .display { min-height: 90px; border-bottom: 0; border-right: 1px solid var(--border); }
  .card .display img { width: 75%; height: 68px; }
  .equipment-panel { padding-inline: 9px; }
}
@media (max-width: 540px) {
  .header-inner { flex-wrap: wrap; gap: 0 8px; padding-top: 7px; }
  .site-nav { order: 1; width: 100%; min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .card .display img { animation: none; }
  .scene-effect[data-effect] { animation: none; }
  .track i { transition: none; }
}
