:root {
  --bg: #0b0f17;
  --panel: #151b26;
  --panel-2: #1b2331;
  --line: #293247;
  --text: #eef3ff;
  --muted: #9baccc;
  --gold: #f0c674;
  --green: #7ed7a6;
  --red: #ff7b86;
  --blue: #7ab8ff;
  --purple: #bf9cff;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: radial-gradient(circle at top, #1a2233 0%, var(--bg) 42%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { display: flex; justify-content: center; }
.phone-shell {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  padding: 6px 8px 100px;
}
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}
.topbar {
  padding: 6px 8px 7px;
  position: sticky;
  top: 4px;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.topline-left {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
.topline-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  margin-left: auto;
  min-width: 0;
}
.cloud-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.cloud-status-label {
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
}
.topline h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: 0.08em;
  font-weight: 900;
  color: #f6e7b7;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.16),
    0 0 10px rgba(240,198,116,0.18),
    0 2px 10px rgba(0,0,0,0.28);
}
.topline p { margin: 1px 0 0; color: var(--muted); font-size: 9px; line-height: 1.1; }
.realm {
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid #6c5a2f;
  color: var(--gold);
  background: rgba(240,198,116,0.08);
  white-space: nowrap;
  font-size: 9px;
}
.realm:empty {
  display: none;
}
.hero-hud { display: grid; gap: 5px; margin-top: 6px; }
.hero-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hero-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hero-name { font-size: 13px; font-weight: 800; }
.hero-realm-inline {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(240,198,116,0.28);
  color: var(--gold);
  background: rgba(240,198,116,0.08);
  font-size: 9px;
  white-space: nowrap;
}
.hero-level { color: var(--gold); font-size: 9px; white-space: nowrap; }
.mini-bar-grid.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.mini-bar-wrap { display: grid; gap: 2px; }
.mini-bar-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.mini-bar {
  height: 6px;
  border-radius: 999px;
  background: #0d1320;
  overflow: hidden;
  border: 1px solid #2b3240;
}
.mini-bar span { display: block; height: 100%; }
.mini-bar.hp span { background: linear-gradient(90deg, #57d58d, #95f3b7); }
.mini-bar.mp span { background: linear-gradient(90deg, #5fa8ff, #94c6ff); }
.mini-bar.exp span { background: linear-gradient(90deg, #f0c674, #ffe39a); }
.stage {
  margin-top: 8px;
  padding: 10px;
  min-height: 70vh;
}
.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.stage-head h2 { margin: 0; font-size: 14px; }
.stage-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.cloud-status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.inline-cloud-status {
  margin-top: 0;
  font-size: 9px;
  max-width: 88px;
  text-align: right;
  white-space: normal;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.cloud-status.ok { color: var(--green); }
.cloud-status.warn { color: var(--gold); }
.cloud-status.err { color: var(--red); }
.state-badge {
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--gold);
  font-size: 10px;
}
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }
.regions, .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
button {
  border: 1px solid #3a465e;
  background: linear-gradient(180deg, #263046, #1b2332);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}
button.danger {
  border-color: #6d3740;
  background: linear-gradient(180deg, #49252c, #35191f);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.15);
}
#rankTabs {
  margin-top: 0;
  margin-bottom: 10px;
}
#rankTabs .mini-action.active {
  border-color: #6c5a2f;
  color: var(--gold);
  background: linear-gradient(180deg, #3b3020, #251d14);
}
.encounter-box, .panel-box, .list, .subsection {
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.detail-card {
  padding: 10px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid #273041;
}
.detail-card.empty { color: var(--muted); }
.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.detail-name { font-size: 14px; font-weight: 800; }
.detail-desc, .detail-effects {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.recovery-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.recovery-input {
  flex: 1;
  min-width: 0;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.filter-btn {
  padding: 6px 8px;
  font-size: 11px;
}
.filter-btn.active {
  border-color: #5f7db3;
  background: linear-gradient(180deg, #304364, #203049);
}
.explore-hero {
  margin-top: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, rgba(44,70,108,0.96), rgba(24,38,58,0.96));
}
.explore-title {
  color: var(--gold);
  font-size: 11px;
}
.explore-region {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 800;
}
.explore-desc {
  margin-top: 4px;
  color: #c7d8fb;
  font-size: 11px;
  line-height: 1.4;
}
.explore-tag {
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(240,198,116,0.12);
  border: 1px solid rgba(240,198,116,0.25);
  color: var(--gold);
  font-size: 10px;
  white-space: nowrap;
}
.region-fold {
  margin-top: 10px;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(29,38,54,0.95), rgba(18,24,35,0.95));
}
.region-fold-btn {
  width: 100%;
  list-style: none;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}
.region-fold-btn::-webkit-details-marker {
  display: none;
}
.region-fold .regions {
  margin-top: 8px;
}
.region-group {
  margin-top: 8px;
}
.region-group:first-child {
  margin-top: 0;
}
.region-group-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}
.event-box {
  background: linear-gradient(180deg, rgba(29,38,54,0.95), rgba(18,24,35,0.95));
}
.explore-actions-pro button {
  flex: 1 1 30%;
}
.primary-action {
  border-color: #6d8de0;
  background: linear-gradient(180deg, #4d6fd0, #2f468a);
  font-weight: 700;
}
.story-box {
  background: linear-gradient(180deg, rgba(20,27,38,0.96), rgba(17,22,31,0.96));
}
.shop-hero {
  margin-top: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(53,75,121,0.95), rgba(30,42,66,0.95));
}
.shop-title {
  font-size: 15px;
  font-weight: 800;
}
.shop-subtitle {
  margin-top: 4px;
  color: #c7d8fb;
  font-size: 11px;
  line-height: 1.35;
}
.shop-wallet {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(240,198,116,0.4);
  background: rgba(15,20,31,0.42);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.shop-list {
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.03));
}
.shop-detail-section {
  position: sticky;
  top: 8px;
  z-index: 7;
}
.shop-detail-floating {
  position: relative;
  padding: 12px 12px 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(40,52,78,0.96), rgba(20,27,40,0.96));
  border: 1px solid rgba(122,184,255,0.22);
  box-shadow: 0 10px 24px rgba(4,8,18,0.28), 0 0 0 1px rgba(255,255,255,0.03) inset;
  backdrop-filter: blur(12px);
}
.shop-detail-floating::after {
  content: '';
  position: absolute;
  inset: auto 18px -8px 18px;
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  filter: blur(10px);
  z-index: -1;
}
.shop-detail-floating .detail-name {
  color: #f5f1cf;
}
.shop-detail-floating .detail-actions {
  margin-top: 12px;
}
.shop-side {
  display: grid;
  gap: 6px;
  justify-items: end;
}
.shop-row-extended {
  align-items: flex-start;
}
.shop-row-compact {
  align-items: center;
}
.shop-tip {
  margin-top: 5px;
  font-size: 10px;
  color: #dbe8ff;
}
.shop-tip.good {
  color: #b8f3cf;
}
.shop-tip.warn {
  color: #ffd79b;
}
.equip-slot-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.equip-slot-main {
  min-width: 0;
  flex: 1 1 auto;
}
.equip-slot-side {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
}
.equip-slot-side .mini-action,
.equip-slot-side .badge {
  white-space: nowrap;
}
.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #263041;
}
.shop-tabs {
  margin-bottom: 10px;
}
.shop-tabs .filter-btn {
  min-width: 56px;
}
.shop-divider {
  margin: 10px 0 4px;
  color: var(--gold);
  font-size: 11px;
}
.compare {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  border: 1px solid #2f3b4f;
  background: #182131;
}
.compare.good { color: var(--green); }
.compare.bad { color: #ff9aa1; }
.compare-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.compare-line {
  padding: 2px 6px;
  border-radius: 999px;
}
.equip-tier-note {
  margin-top: 4px;
  font-size: 10px;
  color: #cfe1ff;
}
.breakthrough-head {
  align-items: flex-start;
}
.breakthrough-block {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(122,184,255,0.14);
  background: rgba(17,24,37,0.52);
}
.breakthrough-block.worth.good {
  border-color: rgba(126,215,166,0.24);
  background: rgba(126,215,166,0.08);
}
.breakthrough-label {
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 6px;
  font-weight: 700;
}
.breakthrough-text {
  font-size: 12px;
  line-height: 1.55;
  color: #e8efff;
}
.breakthrough-checklist {
  display: grid;
  gap: 6px;
}
.breakthrough-check {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #2c3648;
  background: rgba(255,255,255,0.02);
}
.breakthrough-check.ok {
  color: #bff1d1;
  border-color: rgba(126,215,166,0.26);
  background: rgba(126,215,166,0.08);
}
.breakthrough-check.bad {
  color: #ffd6d9;
  border-color: rgba(255,123,134,0.22);
  background: rgba(255,123,134,0.06);
}
.breakthrough-gains {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.breakthrough-gains span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(240,198,116,0.2);
  background: rgba(240,198,116,0.08);
  font-size: 11px;
  color: #f7eac0;
}
  background: rgba(255,255,255,0.04);
  font-size: 10px;
}
.encounter-label { color: var(--gold); font-size: 11px; margin-bottom: 6px; }
.encounter-text { line-height: 1.5; font-size: 12px; }
.panel-box h3, .subsection h3 { margin: 0 0 8px; font-size: 13px; }
.log {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}
.log-entry {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid #273041;
  line-height: 1.4;
  font-size: 12px;
}
.battle-top-banner {
  margin-top: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  background: linear-gradient(135deg, rgba(70,37,44,0.96), rgba(32,18,24,0.96));
}
.battle-realm-strip {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(122,184,255,0.18);
  background: rgba(122,184,255,0.08);
  color: #cfe1ff;
  font-size: 11px;
  line-height: 1.45;
}
.battle-realm-strip.advantage {
  border-color: rgba(126,215,166,0.34);
  background: rgba(126,215,166,0.10);
  color: #dffff0;
}
.battle-realm-strip.danger {
  border-color: rgba(255,123,134,0.34);
  background: rgba(255,123,134,0.10);
  color: #ffd8dc;
}
.battle-scene-title {
  font-size: 14px;
  font-weight: 800;
}
.battle-scene-sub {
  color: #ffd4d7;
  font-size: 10px;
}
.battlefield {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.battlefield.pro {
  gap: 8px;
}
.fighter {
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
}
.enemy-side {
  grid-template-columns: 1fr 58px;
}
.fighter .avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 0;
}
.hero .avatar { background: linear-gradient(135deg, #4a7df0, #243c7f); }
.enemy .avatar { background: linear-gradient(135deg, #f05f6c, #7b1f2a); }
.fighter-main { min-width: 0; position: relative; }
.enemy-main { text-align: right; }
.damage-float {
  position: absolute;
  top: -6px;
  font-size: 14px;
  font-weight: 800;
  color: #ffb3b9;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.damage-left { right: 8px; }
.damage-right { left: 8px; }
.damage-float.show {
  animation: floatDmg .7s ease;
}
.fighter-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.enemy-topline {
  justify-content: space-between;
}
.fighter .name { font-size: 14px; font-weight: 700; margin-bottom: 0; }
.fighter-power {
  font-size: 10px;
  color: var(--gold);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(240,198,116,0.08);
  border: 1px solid rgba(240,198,116,0.25);
}
.danger-text {
  color: #ff9aa1;
  background: rgba(255,123,134,0.08);
  border-color: rgba(255,123,134,0.25);
}
.skill-flow {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.skill-panel {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.skill-panel-label {
  color: var(--muted);
  font-size: 10px;
}
.skill-panel-value {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}
.cost-ok { color: var(--green); }
.cost-bad { color: #ff9aa1; }
.hp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.enemy-hp-row {
  grid-template-columns: 1fr auto;
}
.hp {
  height: 6px;
  border-radius: 999px;
  background: #0d1320;
  overflow: hidden;
  border: 1px solid #2b3240;
}
.hp span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #57d58d, #95f3b7);
  width: 100%;
  transition: width .25s ease;
}
.hp-text { margin-top: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.battle-centerline {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 2px 0;
}
.battle-hint {
  font-size: 10px;
  color: var(--muted);
}
.battle-badge {
  font-size: 10px;
  color: #cfdcff;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(72,95,140,0.16);
  border: 1px solid rgba(122,163,255,0.18);
}
.vs {
  text-align: center;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 3px;
  font-size: 11px;
}
.battle-skillbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.battle-utility-row {
  margin-top: 8px;
}
.battle-utility-row .skill-btn {
  width: 100%;
}
.skill-btn {
  min-height: 46px;
  font-size: 11px;
  display: grid;
  justify-items: center;
  gap: 2px;
  position: relative;
  transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.skill-btn.is-primed {
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.skill-btn.is-ready {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 0 18px rgba(255,255,255,0.06);
}
.skill-btn.is-overdrive {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1) inset, 0 0 22px rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.skill-btn.is-active {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 0 14px rgba(255,255,255,0.08);
}
.skill-btn.is-cooldown {
  opacity: 0.92;
}
.skill-btn.is-locked {
  opacity: 0.7;
}
.skill-btn.sword.is-primed,
.skill-btn.sword.is-ready,
.skill-btn.sword.is-overdrive {
  border-color: rgba(127, 189, 255, 0.42);
  background: linear-gradient(180deg, rgba(68,107,166,0.26), rgba(25,34,54,0.96));
}
.skill-btn.shield.is-primed,
.skill-btn.shield.is-ready,
.skill-btn.shield.is-overdrive,
.skill-btn.shield.is-active {
  border-color: rgba(106, 224, 181, 0.4);
  background: linear-gradient(180deg, rgba(39,118,99,0.26), rgba(19,34,33,0.96));
}
.skill-btn.thunder.is-primed,
.skill-btn.thunder.is-ready,
.skill-btn.thunder.is-overdrive {
  border-color: rgba(181, 141, 255, 0.45);
  background: linear-gradient(180deg, rgba(87,58,166,0.28), rgba(27,22,46,0.96));
}
.skill-btn.sword .skill-desc { color: #cfe4ff; }
.skill-btn.shield .skill-desc { color: #ccffe9; }
.skill-btn.thunder .skill-desc { color: #ead7ff; }
.skill-btn.is-overdrive.sword .skill-name,
.skill-btn.is-overdrive.thunder .skill-name,
.skill-btn.is-overdrive.shield .skill-name {
  color: #fff6d8;
}
.skill-btn:not(:disabled):active {
  transform: translateY(1px) scale(0.985);
}
.skill-name {
  font-size: 11px;
  font-weight: 700;
}
.skill-desc {
  font-size: 9px;
  color: #c5d4f7;
}
.skill-cd {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff2bd;
  font-size: 9px;
  font-weight: 700;
}
.status-strip {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #2f3b4f;
  background: linear-gradient(180deg, rgba(31,38,54,0.96), rgba(18,23,33,0.96));
  color: #d7e5ff;
  font-size: 10px;
}
.combat-flow-strip {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #34405a;
  background: linear-gradient(180deg, rgba(58,44,85,0.24), rgba(23,28,43,0.92));
  color: #d7dcff;
  font-size: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.flow-label {
  color: var(--muted);
  margin-right: 2px;
}
.flow-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 10px;
  font-weight: 700;
}
.flow-pill.sword {
  background: rgba(240,198,116,0.12);
  border-color: rgba(240,198,116,0.28);
  color: #ffe39a;
}
.flow-pill.shield {
  background: rgba(88,199,173,0.12);
  border-color: rgba(88,199,173,0.28);
  color: #9ff0d8;
}
.flow-pill.thunder {
  background: rgba(122,184,255,0.14);
  border-color: rgba(155,140,255,0.32);
  color: #c6c2ff;
}
.flow-pill.ready {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 12px rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
#view-skill .list-item {
  align-items: flex-start;
}
#view-skill .shop-side {
  min-width: 70px;
}
.compact-box {
  padding-top: 10px;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat {
  padding: 8px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.stat .label { color: var(--muted); font-size: 11px; }
.stat .value { font-size: 14px; font-weight: 700; margin-top: 3px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #263041;
}
.clickable { cursor: pointer; }
.selected-item {
  background: rgba(122,184,255,0.08);
  border-radius: 10px;
  padding-left: 8px;
  padding-right: 8px;
}
.list-item:last-child { border-bottom: 0; }
.meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: #252f43;
  border: 1px solid #35415a;
  font-size: 11px;
}
.badge.gold { color: var(--gold); }
.badge.green { color: var(--green); }
.badge.purple { color: var(--purple); }
.bag-row-side {
  display: grid;
  gap: 5px;
  justify-items: end;
}
.inline-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}
.inline-tag.story {
  color: #ffd79b;
  background: rgba(255,215,155,0.1);
  border-color: rgba(255,215,155,0.22);
}
.inline-tag.skill {
  color: #c6c2ff;
  background: rgba(155,140,255,0.1);
  border-color: rgba(155,140,255,0.24);
}
.inline-tag.growth {
  color: #cbf5dd;
  background: rgba(126,215,166,0.1);
  border-color: rgba(126,215,166,0.24);
}
.region-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(240,198,116,0.14);
  border: 1px solid rgba(240,198,116,0.28);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  margin-right: 8px;
}
.mini-action {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
}
.chapter-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.chapter-steps {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.chapter-step {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #2a3448;
  background: rgba(255,255,255,0.02);
  font-size: 11px;
  color: #d9e5ff;
}
.chapter-step.done {
  border-color: rgba(126,215,166,0.35);
  color: var(--green);
  background: rgba(126,215,166,0.06);
}
.chapter-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6,10,18,0.72);
  z-index: 30;
}
.chapter-modal.hidden {
  display: none;
}
.chapter-modal-card {
  width: min(360px, 100%);
  padding: 18px 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(33,42,63,0.98), rgba(19,24,36,0.98));
}
.chapter-modal-tag {
  color: var(--gold);
  font-size: 11px;
}
.chapter-modal-title {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
}
.chapter-modal-desc {
  margin-top: 8px;
  color: #d9e5ff;
  font-size: 12px;
  line-height: 1.55;
}
.chapter-modal-rewards {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  text-align: left;
}
.chapter-modal-rewards.hidden {
  display: none;
}
.chapter-reward-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid #31405c;
  font-size: 11px;
  color: #d9e5ff;
}
.chapter-reward-title {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 2px;
}
.chapter-modal-card .primary-action {
  width: 100%;
  margin-top: 14px;
}
.name-modal-card {
  text-align: left;
}
.login-modal-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 24px 18px 18px;
  background: radial-gradient(circle at top, rgba(122,184,255,0.16), rgba(19,24,36,0.98) 42%), linear-gradient(180deg, rgba(23,29,42,0.98), rgba(11,15,24,0.98));
  border: 1px solid rgba(122,184,255,0.2);
  box-shadow: 0 24px 60px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.05);
}
.login-hero-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  color: #f7fbff;
  background: linear-gradient(135deg, rgba(240,198,116,0.95), rgba(122,184,255,0.95));
  box-shadow: 0 10px 30px rgba(122,184,255,0.25);
}
.login-tag {
  margin-bottom: 6px;
}
.login-title {
  font-size: 28px;
  letter-spacing: 1px;
}
.login-subtitle {
  max-width: 320px;
  margin: 8px auto 0;
  color: #c6d5f7;
}
.login-entry-grid {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.login-entry-card {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px 12px;
  align-items: center;
  text-align: left;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(122,184,255,0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.login-entry-card .login-entry-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #f7fbff;
  background: linear-gradient(135deg, rgba(122,184,255,0.85), rgba(155,140,255,0.85));
}
.login-entry-card .login-entry-main {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #eef4ff;
}
.login-entry-card .login-entry-sub {
  display: block;
  grid-column: 2;
  font-size: 11px;
  line-height: 1.45;
  color: #9fb2d8;
  margin-top: -4px;
}
.login-entry-card:hover,
.login-entry-card:active {
  transform: translateY(-1px);
  border-color: rgba(122,184,255,0.32);
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.login-panel {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(122,184,255,0.14);
  background: rgba(10,14,22,0.58);
  text-align: left;
}
.login-panel-title {
  font-size: 15px;
  font-weight: 800;
  color: #eef4ff;
}
.login-panel-desc {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: #9fb2d8;
}
.login-actions {
  margin-top: 12px;
}
.login-input {
  margin-top: 12px;
}
.login-footnote {
  margin-top: 14px;
  font-size: 10px;
  line-height: 1.5;
  color: #7f93ba;
}
.name-input {
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #31405c;
  background: rgba(8,12,20,0.56);
  color: var(--text);
  font-size: 14px;
}
.name-error {
  margin-top: 10px;
  color: #ffb7bd;
  font-size: 11px;
}
.name-error.hidden {
  display: none;
}
.material-usage {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(122,184,255,0.08);
  border: 1px solid rgba(122,184,255,0.2);
  color: #dbe8ff;
  font-size: 11px;
  line-height: 1.5;
}
.material-usage.gear-fit {
  background: rgba(240,198,116,0.08);
  border-color: rgba(240,198,116,0.22);
  color: #f8e1a4;
}
.material-usage.material-need {
  background: rgba(126,215,166,0.08);
  border-color: rgba(126,215,166,0.22);
  color: #cbf5dd;
}
.material-need-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.material-need-row .mini-action {
  flex: 0 0 auto;
}
.material-usage.replacement-note {
  background: rgba(183,142,255,0.08);
  border-color: rgba(183,142,255,0.22);
  color: #e0d0ff;
}
.material-usage.consumable-note {
  background: rgba(255,215,122,0.08);
  border-color: rgba(255,215,122,0.22);
  color: #ffe7ad;
}
.bag-action-feedback {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
  border: 1px solid rgba(255,255,255,0.12);
}
.bag-action-feedback.info {
  background: rgba(122,184,255,0.08);
  border-color: rgba(122,184,255,0.22);
  color: #dbe8ff;
}
.bag-action-feedback.good {
  background: rgba(126,215,166,0.08);
  border-color: rgba(126,215,166,0.22);
  color: #cbf5dd;
}
.bag-action-feedback.warn {
  background: rgba(240,198,116,0.08);
  border-color: rgba(240,198,116,0.22);
  color: #f8e1a4;
}
.bag-action-feedback.bad {
  background: rgba(255,123,134,0.08);
  border-color: rgba(255,123,134,0.22);
  color: #ffc4ca;
}
.detail-fold {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.detail-fold summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 10px;
  color: #cfd8ea;
}
.detail-fold summary::-webkit-details-marker {
  display: none;
}
.detail-fold summary::after {
  content: '展开';
  float: right;
  color: #8aa0c8;
}
.detail-fold[open] summary::after {
  content: '收起';
}
.detail-fold-body {
  padding: 0 10px 10px;
}
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 6px;
  width: min(404px, calc(100% - 16px));
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(21,27,38,0.96), rgba(15,20,30,0.96));
}
.nav-btn {
  padding: 6px 2px;
  font-size: 10px;
  min-height: 40px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  background: linear-gradient(180deg, #222c3f, #171f2e);
  border-color: #32415c;
}
.nav-ico {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  font-size: 10px;
  color: #c9dafd;
}
.nav-btn.active {
  background: linear-gradient(180deg, #4c6db0, #2d436f);
  border-color: #719cf9;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 8px 18px rgba(60,110,210,0.18);
}
.nav-btn.active .nav-ico {
  background: rgba(255,255,255,0.16);
  color: #ffffff;
}
.hit { animation: hitFlash .28s ease; }
.attack { animation: lunge .25s ease; }
@keyframes hitFlash {
  0% { filter: brightness(1); transform: translateX(0); }
  35% { filter: brightness(1.65); transform: translateX(4px); }
  100% { filter: brightness(1); transform: translateX(0); }
}
@keyframes lunge {
  0% { transform: translateX(0); }
  40% { transform: translateX(14px); }
  100% { transform: translateX(0); }
}
@keyframes floatDmg {
  0% { opacity: 0; transform: translateY(6px) scale(0.94); }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(1.04); }
}
