:root {
  color-scheme: dark;
  --bg: #101215;
  --surface: #181b1f;
  --surface-raised: #20242a;
  --surface-soft: #252a30;
  --line: #343940;
  --line-strong: #474d56;
  --text: #f0f1f2;
  --text-soft: #c1c5cb;
  --muted: #8e959f;
  --crimson: #c34855;
  --crimson-dark: #862f3a;
  --gold: #d6a947;
  --gold-soft: #f0cc78;
  --orange: #e38b49;
  --teal: #49afa3;
  --purple: #a581d1;
  --blue: #659bd1;
  --success: #63b87c;
  --danger: #dd6671;
  --shadow: 0 18px 45px rgb(0 0 0 / 28%);
  --header-height: 68px;
  --mobile-tabs-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
a[href] {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px max(16px, calc((100vw - 1540px) / 2));
  border-bottom: 1px solid var(--line);
  background: #14171a;
}

.brand-lockup,
.account-strip,
.identity-row,
.panel-heading,
.section-title-row,
.preview-topline,
.battle-toolbar,
.battle-actions,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-lockup h1,
.panel-heading h2,
.dialog-heading h2,
.preview-copy h3,
.combatant h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand-lockup h1 {
  font-size: 19px;
  line-height: 1.2;
}

.brand-kicker,
.panel-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.account-strip {
  justify-content: flex-end;
  gap: 8px;
}

.resource {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--gold);
  white-space: nowrap;
}

.resource-label {
  color: var(--muted);
  font-size: 12px;
}

.resource strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.reset-button {
  color: var(--crimson);
}

.game-grid {
  display: grid;
  width: min(1540px, 100%);
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  margin: 0 auto;
  grid-template-columns: minmax(252px, 300px) minmax(440px, 1fr) minmax(280px, 340px);
  background: var(--line);
  gap: 1px;
}

.game-panel {
  min-width: 0;
  background: var(--surface);
}

.character-panel,
.inventory-panel {
  display: flex;
  flex-direction: column;
}

.dungeon-panel {
  display: flex;
  flex-direction: column;
  background: #15181c;
}

.panel-heading {
  min-height: 70px;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.dialog-heading h2 {
  font-size: 17px;
  line-height: 1.25;
}

.class-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #6a333c;
  border-radius: 6px;
  background: #271b1f;
  font-size: 21px;
}

.character-summary,
.power-block,
.progression-section,
.stat-section,
.attribute-section,
.skills-section,
.equipment-section,
.rarity-legend {
  border-bottom: 1px solid var(--line);
}

.character-summary {
  padding: 16px 18px;
}

.identity-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.hero-name,
.hero-class {
  display: block;
}

.hero-name {
  font-size: 15px;
}

.hero-class {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.level-badge,
.points-pill,
.danger-tag,
.status-indicator,
.live-label {
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.level-badge {
  padding: 3px 8px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 12px;
}

.level-badge strong {
  margin-left: 2px;
  color: var(--gold-soft);
}

.meter-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.meter {
  position: relative;
  height: 7px;
  overflow: hidden;
  border: 1px solid #34383d;
  border-radius: 4px;
  background: #0c0e10;
}

.meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--purple);
  transition: width 260ms ease;
}

.meter-hp .meter-fill,
.enemy-hp .meter-fill {
  background: var(--crimson);
}

.power-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: #1d1b17;
}

.power-icon {
  color: var(--gold);
  font-size: 20px;
}

.power-block span:not(.power-icon),
.power-block strong {
  display: block;
}

.power-block div > span {
  color: var(--muted);
  font-size: 11px;
}

.power-block strong {
  color: var(--gold-soft);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.progression-section,
.skills-section {
  padding: 14px 18px;
}

.class-summary-row {
  display: grid;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.progression-icon,
.skill-icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
}

.progression-icon {
  width: 34px;
  height: 34px;
  font-size: 18px;
}

.class-summary-copy,
.class-summary-copy small,
.class-summary-copy strong {
  display: block;
  min-width: 0;
}

.class-summary-copy small {
  color: var(--muted);
  font-size: 10px;
}

.class-summary-copy strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.compact-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.prestige-button {
  display: grid;
  width: 100%;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 7px 9px;
  border: 1px solid #5a4929;
  border-radius: 5px;
  background: #211d16;
  color: var(--gold-soft);
  text-align: left;
  grid-template-columns: 25px minmax(0, 1fr);
}

.prestige-button > span:first-child {
  font-size: 18px;
  text-align: center;
}

.prestige-button strong,
.prestige-button small {
  display: block;
}

.prestige-button strong {
  font-size: 11px;
}

.prestige-button small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.prestige-button:not(:disabled):hover {
  border-color: var(--gold);
  background: #292319;
}

.stat-section,
.attribute-section,
.equipment-section {
  padding: 14px 18px;
}

.section-title-row {
  min-width: 0;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title-row h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.section-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-grid,
.attribute-list,
.preview-details {
  margin: 0;
}

.stat-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-grid > div {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
}

.stat-grid dt,
.stat-grid dd,
.attribute-list dt,
.attribute-list dd,
.preview-details dt,
.preview-details dd {
  margin: 0;
}

.stat-grid dt {
  color: var(--muted);
  font-size: 11px;
}

.stat-grid dt span {
  display: inline-block;
  width: 16px;
  color: var(--teal);
}

.stat-grid dd {
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.points-pill {
  padding: 2px 7px;
  border-color: #504369;
  background: #221e2b;
  color: var(--purple);
  font-size: 11px;
}

.attribute-list {
  display: grid;
  gap: 2px;
}

.attribute-list > div {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}

.attribute-list dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}

.attribute-list dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.attribute-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-raised);
  font-size: 10px;
  font-weight: 800;
}

.attribute-icon.strength {
  color: var(--crimson);
}

.attribute-icon.agility {
  color: var(--teal);
}

.attribute-icon.intelligence {
  color: var(--purple);
}

.attribute-icon.vitality {
  color: var(--success);
}

.equipment-section {
  flex: 1 0 auto;
  border-bottom: 0;
}

.equipment-grid {
  display: grid;
  gap: 7px;
}

.equipment-slot {
  display: flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-raised);
}

button.equipment-slot {
  width: 100%;
  text-align: left;
}

.equipment-slot:hover {
  border-color: var(--line-strong);
}

.slot-icon {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #15171a;
  font-size: 18px;
}

.equipment-slot > span:last-child {
  min-width: 0;
}

.equipment-slot small,
.equipment-slot strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-slot small {
  color: var(--muted);
  font-size: 10px;
}

.equipment-slot strong {
  color: var(--text-soft);
  font-size: 12px;
}

.equipment-slot.is-empty strong {
  color: var(--muted);
  font-weight: 500;
}

.attribute-list dd {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-add-button {
  display: inline-grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--gold-soft);
  line-height: 1;
}

.auto-allocation {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 11px;
}

.auto-allocation input {
  width: 16px;
  height: 16px;
  accent-color: var(--crimson);
}

.skills-list {
  display: grid;
  gap: 6px;
}

.skill-row {
  display: grid;
  min-width: 0;
  min-height: 45px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--purple);
  border-radius: 5px;
  background: var(--surface-raised);
  grid-template-columns: 31px minmax(0, 1fr) auto;
}

.skill-row.is-basic {
  border-left-color: var(--line-strong);
}

.skill-icon {
  width: 31px;
  height: 31px;
  background: #15171a;
  font-size: 16px;
}

.skill-copy,
.skill-copy strong,
.skill-copy small {
  display: block;
  min-width: 0;
}

.skill-copy strong,
.skill-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-copy strong {
  color: var(--text-soft);
  font-size: 11px;
}

.skill-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.skill-level {
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.skill-upgrade-button {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #65517e;
  border-radius: 4px;
  background: #241e2c;
  color: var(--purple);
  font-weight: 800;
}

.skills-reset-button {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.skills-reset-button:hover {
  border-color: var(--purple);
  color: var(--text-soft);
}

.equipment-slot.rarity-excellent,
.inventory-item.rarity-excellent {
  border-left-color: var(--blue);
}

.equipment-slot.rarity-rare,
.inventory-item.rarity-rare {
  border-left-color: var(--purple);
}

.equipment-slot.rarity-legendary,
.inventory-item.rarity-legendary {
  border-left-color: var(--orange);
}

.dungeon-heading {
  min-height: 70px;
}

.dungeon-heading-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.world-back-button {
  white-space: nowrap;
}

.world-map-view {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 10px clamp(10px, 1.6vw, 16px) 10px;
}

.world-map-summary {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 12px;
}

.world-map-summary h3 {
  margin: 2px 0 2px;
  font-size: 16px;
}

.world-map-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.world-map-summary-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px 12px;
}

.world-map-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(72px, auto));
  gap: 4px 12px;
  margin: 0;
}

.world-map-meta > div {
  min-width: 0;
}

.world-map-meta dt {
  color: var(--muted);
  font-size: 10px;
}

.world-map-meta dd {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-soft);
}

.world-map-view-toggle {
  display: inline-grid;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121417;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.world-map-view-toggle button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.world-map-view-toggle button:hover,
.world-map-view-toggle button.is-active,
.world-map-view-toggle button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--gold-soft);
}

/* 舞台：用地图填满中栏可用高度，靠 data-view-mode 切换，不靠滚动条 */
.world-map-stage {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
}

.world-map-svg-host {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #3a3024;
  border-radius: 10px;
  background: #100e0c;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.world-map-svg-mount {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  align-items: stretch;
}

.world-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  max-height: none;
  touch-action: manipulation;
  user-select: none;
}

/* 列表 / 地图互斥：class 与 data-view-mode 双保险 */
.world-map-stage[data-view-mode="map"] .world-map-board,
.world-map-stage.is-map-mode .world-map-board {
  display: none !important;
}

.world-map-stage[data-view-mode="list"] .world-map-svg-host,
.world-map-stage.is-list-mode .world-map-svg-host {
  display: none !important;
}

.world-map-stage[data-view-mode="list"] .world-map-card,
.world-map-stage.is-list-mode .world-map-card {
  display: none !important;
}

.world-map-stage[data-view-mode="list"] .world-map-board,
.world-map-stage.is-list-mode .world-map-board {
  display: grid !important;
}

.world-map-svg .wm-region-fill {
  opacity: 0.88;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.world-map-svg .wm-region-shadow {
  fill: rgba(0, 0, 0, 0.52);
  transform: translate(0, 7px);
  filter: blur(5px);
}

.world-map-svg .wm-region-texture {
  opacity: 0.72;
  pointer-events: none;
}

.world-map-svg .wm-region-rim {
  fill: none;
  stroke: rgba(238, 214, 164, 0.13);
  stroke-width: 1.2;
  stroke-dasharray: 2 6;
  pointer-events: none;
}

.world-map-svg .wm-region.is-current-region .wm-region-fill {
  opacity: 1;
  filter: brightness(1.08);
}

.world-map-svg .wm-region.is-locked-region .wm-region-fill {
  opacity: 0.42;
  filter: saturate(0.35) brightness(0.7);
}

.world-map-svg .wm-region-fog {
  fill: rgba(48, 52, 58, 0.72);
  filter: url(#wm-fog-blur);
  pointer-events: none;
}

.world-map-svg .wm-region-label {
  fill: #d8c7a2;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.65);
  stroke-width: 3px;
}

.world-map-svg .wm-region-sub {
  fill: #9a8d72;
  font-size: 9px;
  font-weight: 600;
}

.world-map-svg .wm-region.is-locked-region .wm-region-label {
  fill: #8a8790;
}

.world-map-svg .wm-region-mystery {
  fill: #c8c4d0;
  font-size: 28px;
  font-weight: 800;
  opacity: 0.55;
  pointer-events: none;
}

.world-map-svg .wm-edge {
  stroke: rgba(120, 110, 90, 0.45);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 6 7;
}

.world-map-svg .wm-edge-shadow {
  stroke: rgba(0, 0, 0, 0.72);
  stroke-width: 6;
  stroke-linecap: round;
  transform: translateY(2px);
}

.world-map-svg .wm-edge.is-lit {
  stroke: url(#wm-edge-lit);
  stroke-width: 2.6;
  stroke-dasharray: 8 6;
  filter: drop-shadow(0 0 3px rgba(220, 180, 80, 0.35));
}

.world-map-svg:not(.is-reduced-motion) .wm-edge.is-lit:not(.no-flow) {
  animation: wm-edge-flow 2.8s linear infinite;
}

@keyframes wm-edge-flow {
  to {
    stroke-dashoffset: -28;
  }
}

.world-map-svg .wm-decor {
  pointer-events: none;
}

.world-map-svg .wm-decor-shadow {
  fill: rgba(0, 0, 0, 0.3);
}

.world-map-svg .wm-decor-fill {
  fill: #111c15;
  stroke: rgba(184, 199, 149, 0.42);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.world-map-svg .wm-decor-trunk {
  fill: #5d432b;
  stroke: #8b6842;
  stroke-width: 0.8;
}

.world-map-svg .wm-decor-detail {
  fill: #b99b61;
  stroke: #d8bd7b;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.world-map-svg .wm-decor-mountain .wm-decor-fill {
  fill: #282620;
  stroke: #80745e;
}

.world-map-svg .wm-decor-mountain .wm-decor-detail {
  fill: #615b4d;
  stroke: none;
}

.world-map-svg .wm-decor-dune .wm-decor-fill {
  fill: #7d592d;
  stroke: #c89954;
}

.world-map-svg .wm-decor-dune .wm-decor-detail {
  fill: none;
  stroke: #dfb86d;
}

.world-map-svg .wm-decor-ruin .wm-decor-fill {
  fill: #3d3931;
  stroke: #948570;
}

.world-map-svg .wm-decor-ruin .wm-decor-detail,
.world-map-svg .wm-decor-camp .wm-decor-detail {
  fill: none;
  stroke: #b8a184;
}

.world-map-svg .wm-decor-skull .wm-decor-fill {
  fill: #b7aa8e;
  stroke: #e1d2ae;
}

.world-map-svg .wm-decor-cutout {
  fill: #342d24;
}

.world-map-svg .wm-decor-flame {
  fill: #d66b31;
  stroke: #f3bd5d;
  stroke-width: 1;
  filter: drop-shadow(0 0 4px rgba(226, 105, 44, 0.72));
}

.world-map-svg .wm-map-frame,
.world-map-svg .wm-map-frame-inner {
  fill: none;
  pointer-events: none;
}

.world-map-svg .wm-map-frame {
  stroke: rgba(205, 173, 108, 0.42);
  stroke-width: 2;
}

.world-map-svg .wm-map-frame-inner {
  stroke: rgba(205, 173, 108, 0.15);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.world-map-svg .wm-map-cartouche rect {
  fill: rgba(17, 13, 9, 0.84);
  stroke: rgba(205, 173, 108, 0.46);
}

.world-map-svg .wm-map-cartouche text {
  fill: #dfc78f;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
}

.world-map-svg .wm-map-cartouche .wm-map-cartouche-sub {
  fill: #8f8067;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.world-map-svg .wm-compass circle {
  fill: rgba(13, 11, 9, 0.55);
  stroke: rgba(205, 173, 108, 0.38);
}

.world-map-svg .wm-compass path {
  fill: #c9a95f;
  stroke: #ead49e;
  stroke-width: 0.8;
}

.world-map-svg .wm-compass .wm-compass-cross {
  fill: none;
  stroke: rgba(205, 173, 108, 0.28);
}

.world-map-svg .wm-compass text {
  fill: #dfc78f;
  font-size: 9px;
  font-weight: 800;
}

.world-map-svg .wm-node {
  cursor: pointer;
  outline: none;
}

.world-map-svg .wm-node.is-locked {
  cursor: not-allowed;
  opacity: 0.55;
}

.world-map-svg .wm-node-disc {
  fill: #1a1612;
  stroke: #8a7040;
  stroke-width: 2;
  filter: url(#wm-node-shadow);
}

.world-map-svg .wm-node-ring {
  fill: rgba(12, 10, 8, 0.66);
  stroke: rgba(224, 192, 112, 0.38);
  stroke-width: 1;
}

.world-map-svg .wm-node.type-town .wm-node-disc {
  stroke: #d4af5f;
  fill: #2a2010;
}

.world-map-svg .wm-node.type-outdoor .wm-node-disc {
  stroke: #4aa88a;
  fill: #102018;
}

.world-map-svg .wm-node.type-dungeon .wm-node-disc {
  stroke: #c05050;
  fill: #241010;
}

.world-map-svg .wm-node-glow {
  fill: rgba(212, 175, 95, 0.12);
  stroke: none;
}

.world-map-svg .wm-node.type-town .wm-node-glow {
  fill: rgba(212, 175, 95, 0.22);
}

.world-map-svg .wm-node.type-outdoor .wm-node-glow {
  fill: rgba(74, 168, 138, 0.18);
}

.world-map-svg .wm-node.type-dungeon .wm-node-glow {
  fill: rgba(192, 80, 80, 0.18);
}

.world-map-svg .wm-node-emoji {
  font-size: 13px;
  pointer-events: none;
}

.world-map-svg .wm-node-caption {
  fill: #e8dcc0;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 2.5px;
}

.world-map-svg .wm-node-label-bg {
  fill: rgba(12, 10, 8, 0.82);
  stroke: rgba(215, 188, 127, 0.28);
  stroke-width: 0.8;
}

.world-map-svg .wm-node-you {
  fill: var(--gold-soft, #d4af5f);
  font-size: 9px;
  font-weight: 800;
  pointer-events: none;
}

.world-map-svg .wm-node-pulse {
  fill: none;
  stroke: rgba(212, 175, 95, 0.55);
  stroke-width: 2;
}

.world-map-svg:not(.is-reduced-motion) .wm-node.is-current .wm-node-pulse {
  animation: wm-node-pulse 1.8s ease-out infinite;
}

.world-map-svg:not(.is-reduced-motion) .wm-region.is-current-region .wm-region-fill {
  animation: wm-region-breathe 3.6s ease-in-out infinite;
}

@keyframes wm-node-pulse {
  0% {
    r: 16;
    opacity: 0.75;
  }
  100% {
    r: 28;
    opacity: 0;
  }
}

@keyframes wm-region-breathe {
  0%,
  100% {
    opacity: 0.92;
  }
  50% {
    opacity: 1;
  }
}

.world-map-svg .wm-node:focus-visible .wm-node-disc,
.world-map-svg .wm-node:hover .wm-node-disc {
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(224, 192, 112, 0.55));
}

/* 信息卡：底部窄条，不盖住地图主体 */
.world-map-card {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid #5a4a30;
  border-radius: 6px;
  background:
    linear-gradient(160deg, rgba(48, 38, 24, 0.96), rgba(18, 15, 12, 0.96));
  color: #e8dcc0;
}

.world-map-card-main {
  min-width: 0;
  flex: 1;
}

.world-map-card-kicker {
  margin: 0;
  color: #b8a070;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.world-map-card h4 {
  margin: 1px 0 0;
  font-size: 13px;
  line-height: 1.2;
  color: #f0e6c8;
}

.world-map-card-desc {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: #b8ad92;
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.world-map-card-meta {
  margin: 2px 0 0;
  color: #8a7f68;
  font-size: 10px;
  line-height: 1.2;
}

.world-map-card-enter {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 12px;
  font-size: 11px;
}

.world-map-card[hidden] {
  display: none !important;
}

.world-map-board {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  gap: 10px;
  padding: 2px;
  overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  align-content: start;
  /* 默认隐藏；列表模式由 stage 规则强制 grid */
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .world-map-svg .wm-edge.is-lit,
  .world-map-svg .wm-node-pulse,
  .world-map-svg .wm-region.is-current-region .wm-region-fill {
    animation: none !important;
  }
}

.world-region-card {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(42, 52, 40, 0.35), transparent 55%),
    #14181c;
}

.world-region-card.is-locked {
  opacity: 0.55;
  background:
    linear-gradient(160deg, rgba(30, 30, 34, 0.5), transparent 55%),
    #121417;
}

.world-region-card.is-active {
  border-color: color-mix(in srgb, var(--gold-soft) 45%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-soft) 18%, transparent);
}

.world-region-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.world-region-header strong {
  display: block;
  font-size: 14px;
}

.world-region-header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.world-region-emoji {
  font-size: 22px;
  line-height: 1;
}

.world-region-desc {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.world-region-lock-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.world-node-grid {
  display: grid;
  gap: 8px;
  margin-top: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.world-node-button {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101317;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.world-node-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--gold-soft) 50%, var(--line));
  background: #171c21;
  transform: translateY(-1px);
}

.world-node-button:disabled,
.world-node-button.is-locked {
  cursor: not-allowed;
  opacity: 0.7;
}

.world-node-button .node-emoji {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.world-node-button .node-copy {
  min-width: 0;
}

.world-node-button .node-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-node-button .node-copy small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.world-node-button[data-node-type="town"] {
  border-left: 3px solid var(--gold-soft);
}

.world-node-button[data-node-type="outdoor"] {
  border-left: 3px solid var(--teal);
}

.world-node-button[data-node-type="dungeon"] {
  border-left: 3px solid var(--crimson);
}

.world-map-legend {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.world-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.world-map-legend .is-muted {
  opacity: 0.75;
}

.town-view {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 28px clamp(20px, 5vw, 64px);
  text-align: center;
}

.town-emblem {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(212, 175, 95, 0.22), transparent 55%),
    #161a1f;
  font-size: 42px;
}

.town-copy {
  max-width: 420px;
}

.town-copy h3 {
  margin: 4px 0 8px;
  font-size: 22px;
}

.town-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.town-flavor {
  margin-top: 10px !important;
  color: var(--gold-soft) !important;
  font-style: italic;
}

.town-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 520px;
}

.town-actions .primary-button,
.town-actions .secondary-button {
  min-width: 140px;
}

.town-tip {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.materials-panel {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.materials-panel .section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.materials-panel h3 {
  margin: 0;
  font-size: 13px;
  color: var(--gold-soft);
}

.materials-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.material-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(16, 18, 22, 0.75);
  font-size: 12px;
}

.material-chip strong {
  font-weight: 600;
}

.material-chip em {
  color: var(--gold-soft);
  font-style: normal;
}

.materials-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.town-npc-section {
  width: min(520px, 100%);
  text-align: left;
}

.town-npc-section .section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.town-npc-section h4 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--gold-soft);
}

.town-npc-list {
  display: grid;
  gap: 8px;
}

.town-npc-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(16, 18, 22, 0.72);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.town-npc-card:hover,
.town-npc-card:focus-visible {
  border-color: rgba(212, 175, 95, 0.55);
  outline: none;
}

.town-npc-card .npc-emoji {
  font-size: 22px;
}

.town-npc-card strong {
  display: block;
  font-size: 14px;
}

.town-npc-card small {
  color: var(--muted);
  font-size: 11px;
}

.town-npc-card .npc-marker {
  min-width: 1.5em;
  font-size: 16px;
  text-align: center;
}

.town-npc-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.event-dialog,
.dialogue-dialog,
.quest-dialog {
  width: min(440px, calc(100vw - 28px));
  max-height: min(720px, calc(100svh - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #1a1e24, #12151a);
  color: inherit;
}

.event-dialog[open],
.dialogue-dialog[open],
.quest-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.event-dialog::backdrop,
.dialogue-dialog::backdrop,
.quest-dialog::backdrop {
  background: rgba(6, 8, 12, 0.72);
}

.event-content,
.dialogue-content,
.quest-log-content {
  min-height: 0;
  padding: 4px 18px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.event-card-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 8px 0 4px;
}

.event-card-hero .event-emoji {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 35% 30%, rgba(212, 175, 95, 0.2), transparent 55%), #161a1f;
  font-size: 34px;
}

.event-card-hero p,
.dialogue-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.event-result-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 95, 0.28);
  background: rgba(212, 175, 95, 0.08);
  color: var(--gold-soft);
  font-size: 13px;
  line-height: 1.5;
}

.event-reward-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.event-reward-chips span {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  color: var(--muted);
}

.event-actions,
.dialogue-actions {
  flex-wrap: wrap;
}

.event-actions .primary-button,
.event-actions .secondary-button,
.dialogue-actions .primary-button,
.dialogue-actions .secondary-button {
  min-width: 120px;
}

.dialogue-heading-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialogue-emoji {
  font-size: 28px;
}

.quest-log-list {
  display: grid;
  gap: 10px;
}

.quest-log-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.quest-log-item strong {
  display: block;
  margin-bottom: 4px;
}

.quest-log-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.quest-log-item .quest-progress {
  margin-top: 6px;
  color: var(--gold-soft);
  font-size: 12px;
}

.quest-log-item.is-ready {
  border-color: rgba(120, 190, 120, 0.45);
}

.quest-log-empty {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--gold-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--gold);
  outline: none;
}

.outdoor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.status-indicator,
.live-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11px;
}

.status-indicator i,
.live-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.status-indicator.is-battling i {
  background: var(--crimson);
}

.idle-view {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(190px, 0.7fr) minmax(270px, 1.3fr);
}

.idle-view[hidden],
.outdoor-view[hidden],
.world-map-view[hidden],
.town-view[hidden],
.battle-view[hidden] {
  display: none !important;
}

.outdoor-view {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px clamp(20px, 5vw, 64px);
  text-align: center;
}

.outdoor-emblem {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid #3f5d4e;
  border-radius: 8px;
  background: #17231d;
  box-shadow: 0 12px 30px rgb(0 0 0 / 24%);
  font-size: 44px;
}

.outdoor-copy {
  max-width: 430px;
}

.outdoor-copy .panel-kicker {
  color: var(--teal);
}

.outdoor-copy h3 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 22px;
  letter-spacing: 0;
}

.outdoor-copy > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.outdoor-stats {
  display: grid;
  width: min(100%, 440px);
  margin: 26px 0 22px;
  border-block: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.outdoor-stats > div {
  min-width: 0;
  padding: 10px 8px;
}

.outdoor-stats > div + div {
  border-left: 1px solid var(--line);
}

.outdoor-stats dt {
  color: var(--muted);
  font-size: 10px;
}

.outdoor-stats dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.outdoor-start-button {
  width: min(100%, 260px);
  border-color: #438172;
  background: #285f55;
}

.outdoor-start-button:hover:not(:disabled) {
  background: #34776a;
}

.floor-select {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.floor-list-heading {
  margin-bottom: 12px;
}

.floor-list {
  display: grid;
  max-height: calc(100vh - 150px);
  max-height: calc(100svh - 150px);
  gap: 6px;
  margin: 0;
  padding: 0 3px 0 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.floor-button {
  display: grid;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  text-align: left;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.floor-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.floor-button.is-selected {
  border-color: #86414b;
  background: #281d21;
  box-shadow: inset 3px 0 var(--crimson);
}

.floor-button.is-cleared {
  border-left: 3px solid var(--teal);
}

.floor-button.is-boss {
  border-left: 3px solid var(--gold);
}

.floor-button:disabled {
  background: #17191c;
}

.floor-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.floor-copy {
  min-width: 0;
}

.floor-copy strong,
.floor-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floor-copy strong {
  font-size: 12px;
}

.floor-copy small {
  color: var(--muted);
  font-size: 10px;
}

.floor-state {
  color: var(--muted);
  font-size: 11px;
}

.floor-preview {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px clamp(20px, 4vw, 52px);
  text-align: center;
}

.preview-topline {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
}

.danger-tag {
  padding: 3px 8px;
  border-color: #63343b;
  background: #281b1f;
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
}

.recommended-power {
  color: var(--muted);
  font-size: 11px;
}

.recommended-power strong {
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.floor-emblem {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  margin: 34px auto 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: 0 12px 30px rgb(0 0 0 / 24%);
  font-size: 42px;
}

.preview-copy {
  max-width: 430px;
}

.preview-copy .panel-kicker {
  color: var(--crimson);
}

.preview-copy h3 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 22px;
}

.preview-copy > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.preview-details {
  display: grid;
  width: min(100%, 390px);
  margin: 26px 0 22px;
  border-block: 1px solid var(--line);
  grid-template-columns: repeat(3, 1fr);
}

.preview-details > div {
  padding: 10px 8px;
}

.preview-details > div + div {
  border-left: 1px solid var(--line);
}

.preview-details dt {
  color: var(--muted);
  font-size: 10px;
}

.preview-details dd {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.primary-button {
  border-color: #d25c69;
  background: var(--crimson-dark);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--crimson);
}

.secondary-button {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text-soft);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}

.enter-button {
  width: min(100%, 260px);
}

.battle-view {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.battle-toolbar {
  min-height: 58px;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: #191c20;
}

.battle-toolbar > div:first-child span,
.battle-toolbar > div:first-child strong {
  display: block;
}

.battle-caption {
  color: var(--muted);
  font-size: 10px;
}

.battle-toolbar > div:first-child strong {
  color: var(--gold-soft);
  font-size: 13px;
}

.battle-actions {
  gap: 8px;
}

.segmented-control {
  display: inline-grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121417;
  grid-template-columns: repeat(3, 38px);
}

.segmented-control button {
  min-width: 38px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented-control button + button {
  border-left: 1px solid var(--line);
}

.segmented-control button:hover,
.segmented-control button.is-active,
.segmented-control button[aria-pressed="true"] {
  background: var(--surface-soft);
  color: var(--gold-soft);
}

.skip-button {
  min-height: 38px;
}

.battlefield {
  display: grid;
  min-height: 250px;
  flex: 1 1 46%;
  align-items: center;
  gap: 20px;
  padding: 22px clamp(16px, 3vw, 34px);
  grid-template-columns: minmax(150px, 0.85fr) 44px minmax(190px, 1.15fr);
}

.combatant {
  min-width: 0;
}

.hero-combatant {
  display: flex;
  align-items: center;
  gap: 13px;
}

.combatant-portrait,
.enemy-portrait {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-raised);
}

.combatant-portrait {
  width: 66px;
  min-width: 66px;
  height: 66px;
  font-size: 34px;
}

.combatant-copy {
  min-width: 0;
  flex: 1;
}

.combatant-side {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.combatant h3 {
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versus-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crimson);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 800;
}

.versus-mark::before,
.versus-mark::after {
  width: 1px;
  height: 38px;
  background: var(--line);
  content: "";
}

.versus-mark {
  flex-direction: column;
  gap: 8px;
}

.enemy-party {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.enemy-combatant {
  display: grid;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  grid-template-columns: 38px minmax(0, 1fr);
}

.enemy-combatant.is-defeated {
  opacity: 0.45;
}

.enemy-portrait {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.enemy-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.enemy-name-row strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enemy-name-row span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.combat-log-section {
  min-height: 210px;
  flex: 1 1 54%;
  padding: 13px 16px 16px;
  border-top: 1px solid var(--line);
  background: #121417;
}

.combat-log-section .section-title-row {
  margin-bottom: 8px;
}

.live-label {
  padding: 2px 7px;
  border-color: #315a54;
  color: var(--teal);
  font-size: 9px;
}

.combat-log {
  height: clamp(170px, 29vh, 310px);
  margin: 0;
  padding: 7px 9px;
  overflow-y: auto;
  border: 1px solid #2b2f34;
  border-radius: 5px;
  background: #0d0f11;
  list-style: none;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.combat-log li {
  padding: 5px 7px;
  border-left: 2px solid transparent;
  color: var(--text-soft);
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.combat-log li + li {
  border-top: 1px solid #1e2226;
}

.combat-log li[data-log-type="damage"] {
  border-left-color: var(--crimson);
}

.combat-log li[data-log-type="skill"] {
  border-left-color: var(--purple);
}

.combat-log li[data-log-type="reward"] {
  border-left-color: var(--gold);
  color: var(--gold-soft);
}

.combat-log li[data-log-type="status"] {
  border-left-color: var(--orange);
  color: var(--orange);
}

.inventory-capacity {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.inventory-capacity strong {
  color: var(--text);
}

.inventory-tabs {
  display: grid;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #15181b;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-tabs button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inventory-tabs button:hover,
.inventory-tabs button.is-active,
.inventory-tabs button[aria-selected="true"] {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--gold-soft);
}

.inventory-tab-panel {
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.inventory-tab-panel:not([hidden]) {
  display: flex;
}

.rarity-legend {
  display: grid;
  flex: 0 0 auto;
  padding: 10px 16px;
  gap: 5px;
  grid-template-columns: repeat(4, 1fr);
}

.rarity-legend span {
  position: relative;
  padding-top: 7px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.rarity-legend span::before {
  position: absolute;
  top: 0;
  left: calc(50% - 9px);
  width: 18px;
  height: 2px;
  background: currentColor;
  content: "";
}

.rarity-normal {
  color: var(--text-soft) !important;
}

.rarity-excellent {
  color: var(--blue) !important;
}

.rarity-rare {
  color: var(--purple) !important;
}

.rarity-legendary {
  color: var(--orange) !important;
}

.inventory-scroll {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.shop-panel {
  background: #17191c;
}

.shop-toolbar {
  display: flex;
  min-height: 55px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.shop-toolbar strong,
.shop-toolbar small {
  display: block;
}

.shop-toolbar strong {
  color: var(--text-soft);
  font-size: 12px;
}

.shop-toolbar small {
  color: var(--muted);
  font-size: 9px;
}

.shop-list {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  gap: 7px;
  padding: 14px 16px;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.shop-item {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 5px;
  background: var(--surface-raised);
}

.shop-item-header {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.shop-price {
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shop-empty {
  min-height: 260px;
}

.inventory-list {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
}

.inventory-item {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--text-soft);
  border-radius: 5px;
  background: var(--surface-raised);
}

.inventory-item-header {
  display: grid;
  align-items: center;
  gap: 9px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.inventory-item-name {
  min-width: 0;
}

.inventory-item-name strong,
.inventory-item-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-name strong {
  font-size: 12px;
}

.inventory-item-name small {
  color: var(--muted);
  font-size: 10px;
}

.item-power {
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 10px;
}

.comparison-up {
  color: var(--success);
}

.comparison-down {
  color: var(--danger);
}

/* 装备推荐:换上后战力提升的装备,标一个醒目的升级徽章。 */
.upgrade-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #05231a;
  background: var(--success);
  white-space: nowrap;
  vertical-align: middle;
}

.inventory-item.is-upgrade {
  box-shadow: inset 0 0 0 1px var(--success);
}

.equip-button {
  min-height: 34px;
}

.item-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-actions .equip-button,
.item-actions .reforge-button {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.sell-button {
  grid-column: 1 / -1;
  min-height: 34px;
  color: var(--gold-soft);
  font-size: 10px;
}

.item-effect {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid #6b4932;
  border-radius: 4px;
  background: #211a17;
  color: var(--orange);
  font-size: 10px;
  line-height: 1.45;
}

.empty-state {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state > span {
  margin-bottom: 12px;
  filter: grayscale(0.4);
  font-size: 40px;
  opacity: 0.7;
}

.empty-state strong {
  color: var(--text-soft);
  font-size: 13px;
}

.empty-state p {
  max-width: 200px;
  margin: 5px 0 0;
  font-size: 11px;
}

.mobile-tabs {
  display: none;
}

.class-dialog,
.reforge-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: min(760px, calc(100svh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.character-dialog {
  width: min(980px, calc(100% - 28px));
}

.reforge-dialog {
  width: min(720px, calc(100% - 28px));
}

.class-dialog[open],
.reforge-dialog[open] {
  display: flex;
  flex-direction: column;
}

.class-dialog::backdrop,
.reforge-dialog::backdrop {
  background: rgb(4 5 7 / 76%);
}

.dialog-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.class-dialog-content,
.reforge-content {
  min-height: 0;
  flex: 1;
  padding: 18px;
  overflow-y: auto;
}

.class-dialog-content > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.character-manager-content {
  display: grid;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  grid-template-columns: minmax(250px, 0.85fr) minmax(390px, 1.45fr);
}

.character-roster,
.character-creator {
  min-width: 0;
  padding: 18px;
  overflow-y: auto;
}

.character-roster {
  border-right: 1px solid var(--line);
  background: #15181b;
}

.character-roster .section-title-row,
.character-creator .section-title-row {
  margin-bottom: 13px;
}

.character-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.character-card {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.character-card.is-active {
  border-color: #765c32;
  box-shadow: inset 3px 0 var(--gold);
}

.character-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #14171a;
  font-size: 23px;
}

.character-card-copy {
  min-width: 0;
}

.character-card-copy strong,
.character-card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-card-copy strong {
  font-size: 12px;
}

.character-card-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.character-card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.character-switch-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #171a1e;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.character-switch-button:hover:not(:disabled) {
  border-color: var(--teal);
}

.character-delete-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  color: var(--danger);
  font-size: 15px;
}

.character-empty {
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.character-name-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.character-name-field input {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: #121417;
  color: var(--text);
}

.character-name-field input:focus {
  border-color: var(--gold);
}

.character-creator .class-options {
  grid-template-columns: 1fr;
}

.character-creator .class-option {
  padding: 10px;
  grid-template-columns: 42px minmax(0, 1fr);
}

.character-creator .class-option-icon {
  width: 42px;
  height: 42px;
  font-size: 23px;
}

.character-create-button {
  width: 100%;
  margin-top: 12px;
}

.class-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.class-option {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  text-align: left;
  grid-template-columns: 48px minmax(0, 1fr);
}

.class-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.class-option.is-selected,
.class-option[aria-checked="true"] {
  border-color: #765c32;
  background: #252118;
  box-shadow: inset 3px 0 var(--gold);
}

.class-option-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15171a;
  font-size: 27px;
}

.class-option-copy,
.class-option-copy strong,
.class-option-copy small,
.class-option-copy > span {
  display: block;
  min-width: 0;
}

.class-option-copy strong {
  font-size: 14px;
}

.class-option-copy small {
  margin-top: 1px;
  color: var(--gold-soft);
  font-size: 10px;
}

.class-option-copy > span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.class-dialog-actions,
.reforge-actions {
  gap: 8px;
}

.reforge-content {
  padding: 18px;
}

.reforge-placeholder {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.reforge-placeholder > span {
  margin-bottom: 10px;
  font-size: 38px;
}

.reforge-placeholder strong {
  color: var(--text-soft);
  font-size: 13px;
}

.reforge-placeholder p {
  max-width: 330px;
  margin: 5px 0 0;
  font-size: 10px;
}

.reforge-comparison {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reforge-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
}

.reforge-column.is-new {
  border-color: #765c32;
  background: #221f18;
}

.reforge-column > h3 {
  margin: 0 0 9px;
  color: var(--text-soft);
  font-size: 12px;
}

.reforge-stat-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  color: var(--text-soft);
  font-size: 11px;
  list-style: none;
}

.result-dialog {
  width: min(500px, calc(100% - 28px));
  max-height: min(680px, calc(100svh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.result-dialog[open] {
  display: flex;
  flex-direction: column;
}

.result-dialog::backdrop {
  background: rgb(4 5 7 / 76%);
}

.dialog-heading {
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #1b1f23;
}

.result-content {
  min-height: 0;
  flex: 1;
  max-height: none;
  padding: 18px;
  overflow-y: auto;
}

.result-content:empty::before {
  color: var(--muted);
  content: "正在整理战利品…";
}

.dialog-actions {
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.dialog-actions .primary-button {
  min-width: 130px;
}

.result-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: var(--surface-raised);
}

.result-banner.is-defeat {
  border-left-color: var(--danger);
}

.result-banner.is-retreat {
  border-left-color: var(--gold);
}

.result-banner > span {
  font-size: 30px;
}

.result-banner strong,
.result-banner p {
  display: block;
  margin: 0;
}

.result-banner p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.result-rewards {
  display: grid;
  margin: 14px 0;
  border-block: 1px solid var(--line);
  grid-template-columns: repeat(2, 1fr);
}

.result-rewards > div {
  padding: 12px;
  text-align: center;
}

.result-rewards > div + div {
  border-left: 1px solid var(--line);
}

.result-rewards span,
.result-rewards strong {
  display: block;
}

.result-rewards span {
  color: var(--muted);
  font-size: 10px;
}

.result-rewards strong {
  margin-top: 2px;
  color: var(--gold-soft);
  font-size: 18px;
}

.result-rewards.is-defeat strong {
  color: var(--danger);
}

.outdoor-rewards {
  grid-template-columns: repeat(3, 1fr);
}

.outdoor-settlement-note {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid #315a54;
  border-radius: 5px;
  background: #17231f;
  color: var(--text-soft);
  font-size: 11px;
}

.level-up-callout,
.defeat-note {
  margin: 12px 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #1d1b17;
  color: var(--gold-soft);
  font-size: 12px;
}

.defeat-note {
  background: #21191c;
  color: var(--text-soft);
}

.loot-result h3 {
  margin: 16px 0 8px;
  font-size: 12px;
}

.result-loot-card {
  display: grid;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--text-soft);
  border-radius: 6px;
  background: var(--surface-raised);
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.result-loot-card.rarity-excellent { border-left-color: var(--blue); }
.result-loot-card.rarity-rare { border-left-color: var(--purple); }
.result-loot-card.rarity-legendary { border-left-color: var(--orange); }

.result-loot-card > div {
  min-width: 0;
}

.result-loot-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #15171a;
  font-size: 23px;
}

.result-loot-card h4,
.result-loot-card p {
  margin: 0;
}

.result-loot-card h4 {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-loot-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.result-loot-card p b {
  font-weight: 700;
}

.salvage-note {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid #61482a;
  border-radius: 5px;
  background: #211d16;
  color: var(--gold-soft);
  font-size: 11px;
}

.save-error-note {
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #79404a;
  border-radius: 5px;
  background: #27191d;
  color: #f0a4ab;
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100% - 36px));
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  background: #20252a;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.toast.is-error {
  border-left-color: var(--danger);
}

.toast.is-reward {
  border-left-color: var(--gold);
}

.noscript-message {
  position: fixed;
  z-index: 120;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 12px;
  border: 1px solid var(--crimson);
  border-radius: 6px;
  background: #281b1f;
  color: var(--text);
  text-align: center;
}

@media (max-width: 1160.999px) {
  .game-grid {
    grid-template-columns: minmax(232px, 270px) minmax(410px, 1fr) minmax(250px, 290px);
  }

  .panel-heading,
  .character-summary,
  .stat-section,
  .attribute-section,
  .progression-section,
  .skills-section,
  .equipment-section {
    padding-right: 14px;
    padding-left: 14px;
  }

  .floor-preview {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 900px) {
  .resource-label { display: inline; }

  .game-grid {
    grid-template-columns: 232px minmax(390px, 1fr) 250px;
  }

  .idle-view {
    grid-template-columns: 172px minmax(218px, 1fr);
  }

  .floor-select {
    padding: 12px;
  }

  .preview-details {
    grid-template-columns: 1fr;
  }

  .preview-details > div {
    display: flex;
    justify-content: space-between;
    padding: 7px 4px;
  }

  .preview-details > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .dungeon-heading-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 1160.999px) {
  :root {
    --header-height: 58px;
  }

  body {
    padding-bottom: calc(var(--mobile-tabs-height) + var(--safe-bottom));
  }

  .topbar {
    min-height: var(--header-height);
    gap: 8px;
    padding: 8px 10px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-lockup h1 {
    font-size: 14px;
    white-space: nowrap;
  }

  .brand-kicker {
    display: none;
  }

  .home-link,
  .reset-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .account-strip {
    gap: 5px;
  }

  .resource {
    min-height: 34px;
    gap: 4px;
    padding: 0 7px;
    font-size: 11px;
  }

  .game-grid {
    display: block;
    min-height: calc(100svh - var(--header-height) - var(--mobile-tabs-height) - var(--safe-bottom));
    background: var(--surface);
  }

  .game-panel {
    display: none;
    min-height: calc(100svh - var(--header-height) - var(--mobile-tabs-height) - var(--safe-bottom));
  }

  .game-panel.is-active {
    display: flex;
  }

  .character-panel,
  .inventory-panel,
  .dungeon-panel {
    width: 100%;
  }

  .panel-heading {
    min-height: 62px;
    padding: 11px 14px;
  }

  .dungeon-heading {
    align-items: flex-start;
  }

  .dungeon-heading-actions {
    align-items: flex-end;
  }

  .world-back-button {
    font-size: 11px;
  }

  .world-map-view {
    padding: 8px 12px 10px;
  }

  .world-map-summary-aside {
    width: 100%;
    justify-content: space-between;
  }

  .world-map-svg {
    min-height: 240px;
  }

  .world-map-card {
    width: 100%;
  }

  .world-map-stage[data-view-mode="list"] .world-map-board,
  .world-map-stage.is-list-mode .world-map-board {
    grid-template-columns: 1fr;
  }

  .world-node-grid {
    grid-template-columns: 1fr 1fr;
  }

  .idle-view {
    display: flex;
    flex-direction: column;
  }

  .floor-select {
    flex: 0 0 auto;
    padding: 13px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .floor-list {
    display: flex;
    max-height: none;
    padding: 0 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .floor-list > li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .floor-button {
    width: 154px;
    min-height: 50px;
  }

  .floor-preview {
    flex: 1;
    padding: 20px 18px 26px;
  }

  .outdoor-view,
  .town-view {
    min-height: 500px;
    padding: 24px 18px 30px;
  }

  .town-actions .primary-button,
  .town-actions .secondary-button {
    min-width: 128px;
  }

  .outdoor-emblem {
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    font-size: 35px;
  }

  .outdoor-stats {
    width: 100%;
    margin: 20px 0 18px;
  }

  .floor-emblem {
    width: 72px;
    height: 72px;
    margin: 24px auto 16px;
    font-size: 35px;
  }

  .preview-copy h3 {
    font-size: 20px;
  }

  .preview-details {
    display: grid;
    width: 100%;
    margin: 20px 0 18px;
    grid-template-columns: repeat(3, 1fr);
  }

  .preview-details > div {
    display: block;
    padding: 9px 5px;
  }

  .preview-details > div + div {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .battle-toolbar {
    min-height: 56px;
    padding: 8px 10px;
  }

  .battle-actions {
    gap: 5px;
  }

  .segmented-control {
    grid-template-columns: repeat(3, 34px);
  }

  .segmented-control button {
    min-width: 34px;
    height: 34px;
  }

  .skip-button {
    min-height: 36px;
    padding: 0 10px;
  }

  .battlefield {
    min-height: 270px;
    align-items: stretch;
    gap: 10px;
    padding: 15px 12px;
    grid-template-columns: 1fr;
  }

  .hero-combatant {
    align-self: center;
  }

  .versus-mark {
    flex-direction: row;
    gap: 8px;
  }

  .versus-mark::before,
  .versus-mark::after {
    width: 38px;
    height: 1px;
  }

  .combat-log-section {
    min-height: 230px;
    padding: 11px 12px 14px;
  }

  .combat-log {
    height: 210px;
  }

  .inventory-scroll {
    min-height: 400px;
  }

  .shop-list {
    min-height: 400px;
  }

  .mobile-tabs {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(var(--mobile-tabs-height) + var(--safe-bottom));
    padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line-strong);
    background: #15181b;
    grid-template-columns: repeat(3, 1fr);
  }

  .mobile-tabs button {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    flex-direction: column;
    font-size: 10px;
  }

  .mobile-tabs button > span {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-tabs button:hover,
  .mobile-tabs button.is-active,
  .mobile-tabs button[aria-current="page"] {
    background: var(--surface-raised);
    color: var(--gold-soft);
  }

  .toast {
    right: 12px;
    bottom: calc(var(--mobile-tabs-height) + var(--safe-bottom) + 10px);
    width: calc(100% - 24px);
  }

  .character-manager-content {
    display: flex;
    overflow-y: auto;
    flex-direction: column;
  }

  .character-roster,
  .character-creator {
    overflow: visible;
  }

  .character-roster {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 600px) {
  .world-map-stage {
    flex: 0 0 auto;
  }

  .world-map-svg-host,
  .world-map-svg-mount,
  .world-map-svg {
    min-height: 0;
    aspect-ratio: 1000 / 560;
  }

  .world-map-svg-host,
  .world-map-svg-mount {
    flex: 0 0 auto;
  }

  .world-map-svg {
    height: auto;
  }

  .brand-lockup > div,
  .resource:nth-of-type(2),
  .resource:nth-of-type(3) {
    display: none;
  }

  .topbar {
    gap: 4px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .brand-lockup {
    flex: 0 0 auto;
  }

  .account-strip {
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
  }

  .home-link,
  .account-strip .icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .resource {
    min-width: 0;
    min-height: 32px;
    padding: 0 6px;
  }

  .resource-label {
    display: none;
  }
}

@media (max-width: 430px) {
  .battle-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .battle-toolbar > div:first-child {
    flex: 1 0 100%;
  }

  .battle-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .combatant-portrait {
    width: 56px;
    min-width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .preview-copy > p:last-child {
    max-width: 290px;
  }

  .result-dialog {
    width: calc(100% - 20px);
  }

  .class-dialog,
  .reforge-dialog {
    width: calc(100% - 20px);
  }

  .character-dialog {
    width: calc(100% - 20px);
  }

  .class-options,
  .reforge-comparison {
    grid-template-columns: 1fr;
  }

  .class-option {
    padding: 11px;
  }

  .character-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .character-card-icon {
    width: 38px;
    height: 38px;
  }

  .character-card-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  .dungeon-heading-actions {
    max-width: 58%;
  }

  .status-indicator {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reforge-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .reforge-actions .primary-button,
  .reforge-actions .secondary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   第四批新增:背包工具条 / 精英与首领徽标 / 战报统计
   ============================================================ */

.inventory-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 0 16px 10px;
  gap: 6px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-button {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text-soft);
}

.chip-button.is-active {
  border-color: var(--gold);
  background: #1d1b17;
  color: var(--gold-soft);
}

.inventory-filter-empty {
  padding: 24px 12px;
}

.unit-badge {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  vertical-align: 1px;
}

.unit-badge.is-elite {
  border: 1px solid #6b5a2c;
  background: #221d12;
  color: var(--gold-soft);
}

.unit-badge.is-boss {
  border: 1px solid #79404a;
  background: #27191d;
  color: #f0a4ab;
}

.enemy-combatant.is-elite {
  border-color: #6b5a2c;
}

.enemy-combatant.is-boss {
  border-color: #79404a;
}

.loot-result .result-loot-card + .result-loot-card {
  margin-top: 8px;
}

.battle-report {
  margin-top: 14px;
}

.battle-report h3 {
  margin: 0 0 8px;
  font-size: 12px;
}

.battle-report-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}

.battle-report-grid > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  gap: 6px;
}

.battle-report-grid span {
  color: var(--muted);
  font-size: 10px;
}

.battle-report-grid strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   第五批新增:召唤物棋子 / 战斗飘字与受击动效 / 界面入场动画
   ============================================================ */

.hero-combatant {
  position: relative;
  flex-wrap: wrap;
  transform-origin: center right;
}

.enemy-combatant {
  position: relative;
  transform-origin: center left;
}

.minion-party {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  gap: 6px;
}

.minion-chip {
  position: relative;
  display: inline-flex;
  min-width: 34px;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  gap: 3px;
  animation: minion-in 0.28s ease-out;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.minion-emoji {
  font-size: 15px;
  line-height: 1;
}

.minion-hp {
  width: 26px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: #0c0e10;
}

.minion-hp i {
  display: block;
  height: 100%;
  background: var(--teal, #4db6ac);
  transition: width 0.25s ease;
}

.minion-chip.is-dead {
  opacity: 0.35;
  filter: grayscale(1);
}

@keyframes minion-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— 战斗飘字 —— */
.damage-float {
  position: absolute;
  top: 6px;
  right: 12px;
  z-index: 6;
  color: #f0a4ab;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  animation: float-up 0.95s ease-out forwards;
  pointer-events: none;
}

.damage-float.is-crit {
  color: var(--orange);
  font-size: 16px;
}

.damage-float.is-heal {
  color: #8fd694;
}

.damage-float.is-burn {
  color: var(--orange);
}

.damage-float.is-dodge {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-22px);
  }
}

/* —— 受击闪烁 —— */
.is-hit {
  animation: hit-flash 0.3s ease-out;
}

@keyframes hit-flash {
  0% {
    filter: brightness(2) saturate(1.35);
    transform: translateX(0);
  }
  28% {
    transform: translateX(4px);
  }
  58% {
    transform: translateX(-2px);
  }
  100% {
    filter: brightness(1);
    transform: translateX(0);
  }
}

.is-hit.is-hit-left {
  animation-name: hit-flash-left;
}

@keyframes hit-flash-left {
  0% {
    filter: brightness(2) saturate(1.35);
    transform: translateX(0);
  }
  28% {
    transform: translateX(-4px);
  }
  58% {
    transform: translateX(2px);
  }
  100% {
    filter: brightness(1);
    transform: translateX(0);
  }
}

.is-attacking {
  animation: combat-lunge-right 0.24s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.is-attacking.is-attacking-left {
  animation-name: combat-lunge-left;
}

.is-area-attacking {
  animation: combat-area-strike 0.27s cubic-bezier(0.2, 0.75, 0.25, 1);
}

@keyframes combat-lunge-right {
  0%, 100% { transform: translateX(0) scale(1); }
  42% { transform: translateX(10px) scale(1.025); }
  62% { transform: translateX(8px) scale(1.02); }
}

@keyframes combat-lunge-left {
  0%, 100% { transform: translateX(0) scale(1); }
  42% { transform: translateX(-8px) scale(1.025); }
  62% { transform: translateX(-6px) scale(1.02); }
}

@keyframes combat-area-strike {
  0%, 100% { transform: translateX(0) scale(1); }
  28% { transform: translateX(5px) scale(1.035) rotate(-0.5deg); }
  54% { transform: translateX(10px) scale(1.02) rotate(0.6deg); }
}

.hit-impact {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: 1px;
  height: 1px;
  animation: hit-impact-life 0.46s ease-out forwards;
  pointer-events: none;
}

.hit-impact-ring {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(248, 193, 105, 0.82);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(240, 116, 70, 0.5);
  transform: translate(-50%, -50%) scale(0.18);
  animation: hit-ring-expand 0.34s ease-out forwards;
}

.hit-impact.is-critical .hit-impact-ring {
  width: 40px;
  height: 40px;
  border-width: 3px;
  border-color: rgba(255, 221, 132, 0.95);
  box-shadow: 0 0 15px rgba(244, 111, 53, 0.72);
}

.hit-spark {
  position: absolute;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #f6c46d;
  box-shadow: 0 0 5px rgba(239, 103, 48, 0.88);
  transform: translate(-50%, -50%) rotate(32deg);
  animation: hit-spark-fly 0.34s var(--spark-delay, 0ms) ease-out forwards;
}

.hit-impact.is-critical .hit-spark {
  width: 9px;
  height: 3px;
  background: #ffe3a0;
}

@keyframes hit-impact-life {
  0%, 72% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes hit-ring-expand {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.18); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes hit-spark-fly {
  from { opacity: 1; transform: translate(-50%, -50%) scaleX(0.45); }
  to { opacity: 0; transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scaleX(1); }
}

.battle-view.is-impacting {
  animation: battle-impact-shake 0.2s ease-out;
}

.battle-view.is-critical-impact {
  animation-duration: 0.25s;
}

@keyframes battle-impact-shake {
  0%, 100% { transform: translate(0); }
  24% { transform: translate(-2px, 1px); }
  48% { transform: translate(2px, -1px); }
  72% { transform: translate(-1px, 0); }
}

.enemy-combatant.is-defeated {
  filter: grayscale(0.9);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

/* —— 日志逐条滑入 —— */
.combat-log li {
  animation: log-in 0.18s ease-out;
}

@keyframes log-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— 弹窗与提示入场 —— */
dialog[open] {
  animation: dialog-in 0.22s ease-out;
}

dialog[open]::backdrop {
  animation: backdrop-in 0.22s ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.toast:not([hidden]) {
  animation: toast-in 0.24s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— 结算内容入场 —— */
.result-banner,
.result-rewards,
.loot-result .result-loot-card,
.battle-report {
  animation: rise-in 0.26s ease-out backwards;
}

.loot-result .result-loot-card:nth-child(2) {
  animation-delay: 0.06s;
}

.loot-result .result-loot-card:nth-child(3) {
  animation-delay: 0.12s;
}

.battle-report {
  animation-delay: 0.08s;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.level-up-callout {
  animation: callout-pulse 0.5s ease-out;
}

@keyframes callout-pulse {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   第六批新增:生涯统计 / 批量出售 / 锁定 / 词条成色 / 顶栏工具
   ============================================================ */

.career-section .career-grid {
  display: grid;
  margin: 0;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.career-grid > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
  gap: 6px;
}

.career-grid dt {
  color: var(--muted);
  font-size: 10px;
}

.career-grid dd {
  margin: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.bulk-sell-row {
  align-items: center;
}

.bulk-rarity-select {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.bulk-sell-hint {
  color: var(--muted);
  font-size: 9px;
}

.lock-button {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.lock-button.is-locked {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.inventory-item.is-locked {
  box-shadow: inset 0 0 0 1px rgba(201, 162, 84, 0.25);
}

.inventory-item .inventory-item-header {
  align-items: center;
}

/* —— 词条成色徽标 —— */
.item-affix-quality {
  display: flex;
  flex-wrap: wrap;
  margin: 6px 0 0;
  gap: 4px;
}

.affix-chip {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.affix-roll {
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.q-high {
  color: var(--gold-soft);
  border-color: #6b5a2c;
}

.q-mid {
  color: var(--text-soft);
}

.q-low {
  color: var(--muted);
}

/* 结算弹窗双按钮 */
.dialog-actions [data-result-again] {
  margin-right: auto;
}

/* Desktop workspace: keep the three core columns inside the viewport. */
@media (min-width: 1161px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  .game-grid {
    height: calc(100vh - var(--header-height));
    height: calc(100svh - var(--header-height));
    min-height: 0;
  }

  .game-panel {
    min-height: 0;
  }

  .character-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }

  .character-panel > .panel-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--surface);
  }

  .inventory-panel,
  .dungeon-panel,
  .idle-view {
    overflow: hidden;
  }

  .floor-select {
    display: flex;
    min-height: 0;
    flex-direction: column;
    padding: 14px;
  }

  .floor-list {
    min-height: 0;
    flex: 1;
    max-height: none;
  }

  .floor-preview {
    min-height: 0;
    justify-content: flex-start;
    padding: 20px clamp(18px, 2.6vw, 38px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }

  .floor-emblem {
    width: 76px;
    height: 76px;
    margin: auto auto 14px;
    font-size: 37px;
  }

  .preview-details {
    margin: 18px 0 16px;
  }

  .floor-preview .enter-button {
    margin-bottom: auto;
  }

  .outdoor-view,
  .town-view,
  .world-map-view,
  .battle-view {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }
}

/* ============================================================
   暗黑式整备台：纸娃娃配装 / 装备网格 / 单件详情
   ============================================================ */

.inventory-heading-actions,
.inventory-tools-row,
.loadout-heading,
.item-inspector-power {
  display: flex;
  align-items: center;
}

.inventory-heading-actions {
  justify-content: flex-end;
  gap: 8px;
}

.equipment-manager-close {
  display: none;
}

.inventory-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.equipment-workbench {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
}

.inventory-browser {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 95, 0.055), transparent 34%),
    #15181b;
}

.inventory-tools-row {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.loadout-pane,
.item-inspector {
  display: none;
}

.inventory-list {
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
}

.inventory-item-tile {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 92px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 10px 5px 7px;
  overflow: hidden;
  border: 1px solid #41464f;
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 45%),
    #1b1f24;
  color: var(--text-soft);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.22);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.inventory-item-tile:hover,
.inventory-item-tile:focus-visible,
.inventory-item-tile.is-selected {
  z-index: 1;
  border-color: var(--gold);
  background:
    radial-gradient(circle at 50% 28%, rgba(212, 175, 95, 0.13), transparent 42%),
    #20242a;
  box-shadow: 0 0 0 1px rgba(212, 175, 95, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}

.inventory-item-tile.rarity-excellent { border-color: rgba(76, 146, 210, 0.72); }
.inventory-item-tile.rarity-rare { border-color: rgba(159, 104, 210, 0.78); }
.inventory-item-tile.rarity-legendary { border-color: rgba(220, 132, 58, 0.82); }

.inventory-item-tile.is-upgrade::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-bottom-left-radius: 7px;
  background: rgba(74, 180, 119, 0.94);
  content: "";
}

.item-tile-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(8, 10, 13, 0.55);
  font-size: 21px;
  line-height: 1;
}

.item-tile-power {
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.item-tile-name {
  width: 100%;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-tile-level {
  color: var(--muted);
  font-size: 8px;
}

.item-tile-upgrade,
.item-tile-lock {
  position: absolute;
  z-index: 2;
  font-size: 10px;
  line-height: 1;
}

.item-tile-upgrade {
  top: 3px;
  right: 4px;
  color: #071b10;
  font-weight: 900;
}

.item-tile-lock {
  top: 5px;
  left: 5px;
}

.materials-tab-panel {
  padding: 14px;
  overflow-y: auto;
  background: #15181b;
}

.materials-tab-panel .materials-panel {
  margin: 0;
}

body.has-equipment-manager {
  overflow: hidden;
}

@media (min-width: 1161px) {
  .inventory-panel.is-expanded {
    position: fixed;
    z-index: 80;
    inset: calc(var(--header-height) + 10px) 12px 12px;
    display: flex;
    width: auto;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #61543e;
    border-radius: 10px;
    background: #14171a;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.66), 0 0 0 9999px rgba(5, 7, 9, 0.72);
  }

  .inventory-panel.is-expanded > .panel-heading {
    min-height: 62px;
    padding: 10px 18px;
  }

  .inventory-panel.is-expanded .equipment-manager-open {
    display: none;
  }

  .inventory-panel.is-expanded .equipment-manager-close {
    display: inline-grid;
  }

  .inventory-panel.is-expanded .inventory-tabs {
    padding-right: 18px;
    padding-left: 18px;
  }

  .inventory-panel.is-expanded .equipment-workbench {
    grid-template-columns: minmax(230px, 0.72fr) minmax(430px, 1.55fr) minmax(310px, 0.9fr);
  }

  .inventory-panel.is-expanded .loadout-pane,
  .inventory-panel.is-expanded .item-inspector {
    display: flex;
  }

  .inventory-panel.is-expanded .inventory-list {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    padding: 16px 18px 20px;
  }

  .inventory-panel.is-expanded .inventory-item-tile {
    min-height: 108px;
  }
}

.loadout-pane {
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 36%, rgba(110, 91, 57, 0.18), transparent 34%),
    linear-gradient(160deg, #181a1d, #111316);
}

.loadout-heading {
  justify-content: space-between;
  gap: 10px;
}

.loadout-heading span,
.loadout-heading strong {
  display: block;
}

.loadout-heading span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.loadout-heading strong {
  margin-top: 2px;
  font-size: 14px;
}

.loadout-heading .loadout-power {
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
}

.loadout-paper-doll {
  position: relative;
  width: min(100%, 280px);
  min-height: 330px;
  margin: 16px auto 12px;
  border: 1px solid rgba(212, 175, 95, 0.16);
  border-radius: 50% 50% 18px 18px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(212, 175, 95, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
}

.loadout-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 88px;
  height: 148px;
  place-items: center;
  border: 1px solid rgba(212, 175, 95, 0.22);
  border-radius: 42px 42px 24px 24px;
  background: linear-gradient(180deg, #24231f, #161719);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.36), inset 0 0 25px rgba(212, 175, 95, 0.06);
  transform: translate(-50%, -50%);
}

.loadout-avatar span {
  font-size: 38px;
}

.loadout-avatar strong {
  align-self: start;
  color: var(--gold-soft);
  font-size: 10px;
}

.loadout-slot {
  position: absolute;
  display: grid;
  width: 82px;
  min-height: 64px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid #41464f;
  border-radius: 7px;
  background: rgba(24, 27, 31, 0.96);
  color: var(--text-soft);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.loadout-slot:hover,
.loadout-slot.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(212, 175, 95, 0.2), 0 8px 22px rgba(0, 0, 0, 0.34);
}

.loadout-slot > span { font-size: 21px; }
.loadout-slot small { color: var(--muted); font-size: 8px; }
.loadout-slot strong {
  width: 100%;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadout-slot.is-empty {
  border-style: dashed;
  opacity: 0.58;
}

.loadout-slot.rarity-excellent { border-color: var(--blue); }
.loadout-slot.rarity-rare { border-color: var(--purple); }
.loadout-slot.rarity-legendary { border-color: var(--orange); }
.loadout-slot.slot-helmet { top: 12px; left: calc(50% - 41px); }
.loadout-slot.slot-weapon { top: 104px; left: 8px; }
.loadout-slot.slot-armor { top: 104px; right: 8px; }
.loadout-slot.slot-accessory { bottom: 18px; left: 18px; }
.loadout-slot.slot-footwear { right: 18px; bottom: 18px; }

.loadout-stats {
  display: grid;
  margin: auto 0 0;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.loadout-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-raised);
}

.loadout-stats dt { color: var(--muted); font-size: 9px; }
.loadout-stats dd { margin: 0; color: var(--text); font-size: 12px; font-weight: 700; }

.item-inspector {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 8%, rgba(212, 175, 95, 0.08), transparent 30%),
    #17191d;
}

.item-inspector-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  font-size: 16px;
}

.item-inspector-empty {
  display: grid;
  min-height: 260px;
  margin: auto;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.item-inspector-empty span { color: var(--gold-soft); font-size: 36px; }
.item-inspector-empty strong { margin-top: 10px; color: var(--text-soft); }
.item-inspector-empty p { max-width: 200px; margin: 5px 0 0; font-size: 11px; }

.item-inspector-hero {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 4px 40px 12px 0;
  border-bottom: 2px solid var(--text-soft);
  grid-template-columns: 52px minmax(0, 1fr) auto;
}

.item-inspector-hero.rarity-excellent { border-bottom-color: var(--blue); }
.item-inspector-hero.rarity-rare { border-bottom-color: var(--purple); }
.item-inspector-hero.rarity-legendary { border-bottom-color: var(--orange); }

.item-inspector-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101216;
  font-size: 27px;
}

.item-inspector-hero p,
.item-inspector-hero h3 {
  margin: 0;
}

.item-inspector-hero p { color: var(--muted); font-size: 9px; }
.item-inspector-hero h3 { margin-top: 3px; font-size: 16px; line-height: 1.25; }
.item-inspector-hero .lock-button { width: 32px; min-width: 32px; height: 32px; }

.item-inspector-power {
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(212, 175, 95, 0.25);
  border-radius: 6px;
  background: rgba(212, 175, 95, 0.055);
  gap: 8px;
}

.item-inspector-power span { color: var(--muted); font-size: 10px; }
.item-inspector-power strong { margin-left: auto; color: var(--gold-soft); font-size: 15px; }
.item-inspector-power em { font-size: 11px; font-style: normal; font-weight: 800; }

.item-comparison-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.item-inspector-stats {
  display: grid;
  gap: 5px;
}

.item-inspector-stats > div {
  display: grid;
  align-items: baseline;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.item-inspector-stats span { color: var(--muted); font-size: 10px; }
.item-inspector-stats strong { font-size: 12px; }
.item-inspector-stats em { min-width: 42px; font-size: 10px; font-style: normal; font-weight: 800; text-align: right; }
.item-inspector-no-stats { margin: 0; color: var(--muted); font-size: 11px; }

.item-inspector .item-affix-quality {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}

.item-inspector-actions {
  display: grid;
  margin-top: auto;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-inspector-actions .inspector-sell-button {
  grid-column: 1 / -1;
  color: var(--gold-soft);
}

@media (max-width: 1160.999px) {
  body.has-equipment-manager { overflow: auto; }

  .equipment-manager-open,
  .equipment-manager-close {
    display: none !important;
  }

  .equipment-workbench {
    display: flex;
    overflow: visible;
    flex-direction: column;
  }

  .loadout-pane {
    display: flex;
    flex: 0 0 auto;
    padding: 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .loadout-paper-doll {
    min-height: 250px;
    margin-top: 10px;
  }

  .loadout-avatar {
    width: 72px;
    height: 116px;
  }

  .loadout-slot {
    width: 74px;
    min-height: 56px;
  }

  .loadout-slot.slot-helmet { left: calc(50% - 37px); }
  .inventory-browser { min-height: 500px; }
  .inventory-list { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }

  .item-inspector {
    position: fixed;
    z-index: 75;
    right: 8px;
    bottom: calc(var(--mobile-tabs-height) + var(--safe-bottom) + 8px);
    left: 8px;
    display: none;
    max-height: min(580px, calc(100svh - var(--header-height) - var(--mobile-tabs-height) - 24px));
    padding: 16px;
    border: 1px solid #61543e;
    border-radius: 10px;
    background: #17191d;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.72), 0 0 0 9999px rgba(5, 7, 9, 0.58);
  }

  .inventory-panel.has-item-selection .item-inspector {
    display: flex;
  }
}

@media (max-width: 520px) {
  .loadout-pane {
    padding: 10px;
  }

  .loadout-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .loadout-stats > div {
    align-items: center;
    flex-direction: column;
    padding: 6px 3px;
  }

  .inventory-toolbar {
    padding-right: 10px;
    padding-left: 10px;
  }

  .inventory-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px;
    gap: 6px;
  }

  .inventory-item-tile {
    min-height: 88px;
  }

  .item-tile-name {
    font-size: 8px;
  }
}

/* ============================================================
   角色工作台：摘要常驻，详情按工作区切换
   ============================================================ */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.character-panel {
  min-height: 0;
  overflow: hidden;
}

.character-dashboard {
  flex: 0 0 auto;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.character-dashboard .character-summary {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.character-dashboard .identity-row {
  margin-bottom: 9px;
}

.character-combat-summary {
  display: grid;
  min-width: 0;
  grid-template-columns: 1fr;
}

.character-combat-summary .power-block {
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.character-combat-summary .power-icon {
  font-size: 17px;
}

.character-combat-summary .power-block strong {
  font-size: 18px;
}

.character-combat-summary .stat-section {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.character-combat-summary .stat-grid {
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.character-combat-summary .stat-grid > div {
  min-width: 0;
  padding: 5px 3px;
  text-align: center;
}

.character-combat-summary .stat-grid dt {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-combat-summary .stat-grid dt span {
  width: auto;
  margin-right: 1px;
}

.character-combat-summary .stat-grid dd {
  margin-top: 1px;
  font-size: 13px;
}

.character-dashboard .progression-section {
  padding: 9px 12px;
  border-bottom: 0;
}

.character-dashboard .class-summary-row {
  min-height: 36px;
  gap: 8px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.character-dashboard .progression-icon {
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.character-dashboard .compact-button {
  min-height: 28px;
  padding-right: 8px;
  padding-left: 8px;
}

.character-workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.character-workspace-tabs {
  display: grid;
  flex: 0 0 auto;
  min-width: 0;
  border-bottom: 1px solid var(--line-strong);
  background: #17191c;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.character-workspace-tabs button {
  position: relative;
  min-width: 0;
  min-height: 38px;
  padding: 0 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.character-workspace-tabs button:hover,
.character-workspace-tabs button:focus-visible {
  background: var(--surface-raised);
  color: var(--text-soft);
}

.character-workspace-tabs button.is-active,
.character-workspace-tabs button[aria-selected="true"] {
  border-bottom-color: var(--gold);
  color: var(--gold-soft);
}

.character-workspace-panels {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.character-workspace-panel {
  display: none;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: 0;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.character-workspace-panel.is-active {
  display: block;
}

.character-workspace-panel[hidden] {
  display: none !important;
}

.character-workspace-panel .section-title-row {
  margin-bottom: 9px;
}

.character-workspace-panel .attribute-list {
  gap: 1px;
}

.character-workspace-panel .auto-allocation {
  min-height: 30px;
  margin-top: 7px;
}

.character-workspace-panel .career-grid {
  gap: 4px;
}

.character-workspace-panel .prestige-button {
  margin-top: 10px;
}

.character-workspace-panel .equipment-grid {
  gap: 6px;
}

.skill-budget-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 8px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #15171a;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.skill-tree-header {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
}

.skill-tree-header > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.skill-tree-header > div:first-child strong { color: var(--gold-soft); font-size: 12px; }
.skill-tree-header > div:first-child small { color: var(--muted); font-size: 8px; }
.skill-tree-header .skill-budget-summary { margin: 0; }

.skill-tree-node { position: relative; padding-top: 15px; }
.skill-tree-node-label { position: absolute; top: 2px; left: 39px; color: var(--muted); font-size: 8px; letter-spacing: .04em; }
.skill-tree-connector { display: block; width: 1px; height: 9px; margin: -3px 0 0 50%; background: var(--line-strong); }
.skill-tree-node .skill-branches { position: relative; margin-top: 0; }
.skill-tree-node .skill-branches::before { content: ""; position: absolute; top: 16px; left: 25%; right: 25%; height: 1px; background: var(--line-strong); }
.skill-tree-node .skill-branch-option { position: relative; z-index: 1; background: #17191c; }

.language-toggle {
  display: inline-grid; min-width: 36px; height: 32px; place-items: center; padding: 0 7px;
  border: 1px solid var(--line-strong); border-radius: 5px; background: #17191c; color: var(--gold-soft);
  font-size: 10px; font-weight: 800; cursor: pointer;
}

.language-toggle:hover { border-color: var(--gold); }

.battle-diagnosis { margin-top: 12px; padding: 10px; border: 1px solid #5a4930; border-radius: 6px; background: #191712; }
.battle-diagnosis h3 { margin: 0 0 8px; color: var(--gold-soft); font-size: 12px; }
.battle-diagnosis > div { display: grid; gap: 6px; }
.battle-diagnosis article { padding: 7px 8px; border-left: 2px solid var(--muted); background: #141619; }
.battle-diagnosis article.severity-high { border-left-color: var(--crimson); }
.battle-diagnosis article.severity-medium { border-left-color: var(--orange); }
.battle-diagnosis article strong { font-size: 11px; }
.battle-diagnosis article p { margin: 3px 0; color: var(--text-soft); font-size: 10px; line-height: 1.4; }
.battle-diagnosis article small { color: var(--muted); font-size: 9px; line-height: 1.4; }

.endgame-objective { display: grid; min-width: 180px; max-width: 290px; gap: 1px; padding: 6px 9px; border-left: 2px solid var(--purple); background: #191620; }
.endgame-objective span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.endgame-objective strong { color: #d5c3ee; font-size: 11px; }
.endgame-objective small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

body[data-language="en-US"] .character-workspace-tabs button,
body[data-language="en-US"] .mobile-tabs button { font-size: 9px; }
body[data-language="en-US"] .skill-copy small { white-space: normal; line-height: 1.35; }
body[data-language="en-US"] .skill-branch-option strong { white-space: normal; line-height: 1.25; }

.skill-entry {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.skill-entry:last-child {
  border-bottom: 0;
}

.skill-branches {
  min-width: 0;
  margin: -2px 0 7px 39px;
}

.skill-branch-heading {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
}

.skill-branch-options {
  display: grid;
  min-width: 0;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skill-branch-option {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #17191c;
  color: var(--text-soft);
  text-align: left;
}

.skill-branch-option:hover:not(:disabled),
.skill-branch-option:focus-visible {
  border-color: var(--gold);
  background: #211e18;
}

.skill-branch-option.is-selected {
  border-color: var(--gold);
  background: #272117;
  color: var(--gold-soft);
}

.skill-branch-option:disabled:not(.is-selected) {
  cursor: not-allowed;
  opacity: 0.52;
}

.skill-branch-option strong,
.skill-branch-option small,
.skill-branch-option em {
  min-width: 0;
}

.skill-branch-option strong {
  display: block;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-branch-option span {
  min-width: 0;
}

.skill-branch-option em {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.skill-branch-option small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.floor-gate-hint {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 7px 8px;
  border-left: 2px solid var(--gold);
  background: #211e18;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.35;
}

.floor-gate-hint strong {
  color: var(--gold-soft);
  font-size: 10px;
}

.floor-gate-hint span {
  color: var(--muted);
}

@media (max-width: 430px) {
  .account-strip .language-toggle {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }

  .skill-branches {
    margin-left: 0;
  }

  .skill-branch-option {
    min-height: 32px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .skill-branch-options { grid-template-columns: 1fr; }
  .skill-tree-node .skill-branches::before { display: none; }
  .endgame-objective { min-width: 0; width: 100%; max-width: none; }
}

@media (max-width: 1160.999px) {
  .character-panel {
    overflow: hidden;
  }

  .character-workspace-panel {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 430px) {
  .character-dashboard .character-summary {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .character-dashboard .progression-section {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .character-workspace-tabs button {
    min-height: 36px;
    font-size: 10px;
  }
}
