:root {
  --bg: #080b0a;
  --panel: rgba(18, 24, 20, 0.86);
  --panel-2: rgba(24, 31, 26, 0.92);
  --line: rgba(198, 164, 92, 0.20);
  --line-strong: rgba(198, 164, 92, 0.46);
  --gold: #c9a45c;
  --gold-bright: #e8c987;
  --jade: #7fae83;
  --ink: #e5dece;
  --muted: #8f958b;
  --danger: #c96a5c;
  --epic: #e3b85c;
  --blue: #7fa9c9;
  --hp: #b85c56;
  --mp: #5d87a8;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 760px at 12% -8%, #1a241d 0%, transparent 58%),
    radial-gradient(900px 700px at 108% 4%, #211a11 0%, transparent 55%),
    var(--bg);
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

button, input { font: inherit; }

button { color: inherit; }

[hidden] { display: none !important; }

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

.bg-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
.orb-a { top: -180px; left: -120px; background: #3d5c45; }
.orb-b { right: -160px; top: 18%; background: #6b5126; }

/* ---------------- 顶部（现为页脚） ---------------- */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 26px 24px;
  border-top: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 14px; }

.seal {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--gold-bright);
  font-size: 25px;
  background: rgba(201, 164, 92, 0.06);
  transform: rotate(-2deg);
  box-shadow: inset 0 0 18px rgba(201, 164, 92, 0.08);
}

.brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 8px;
  color: var(--ink);
}

.brand p {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--muted);
}

.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.cloud-status {
  padding: 3px 8px;
  border: 1px solid rgba(201, 164, 92, 0.22);
  border-radius: 999px;
  color: #9da89b;
  font-size: 10.5px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.cloud-status[data-tone="ok"] { color: #b7d2a8; border-color: rgba(127, 174, 131, 0.35); }

/* ---------------- 布局 ---------------- */

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 26px 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(8px);
}

.character-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  scrollbar-width: thin;
}

.character-panel::-webkit-scrollbar { width: 5px; }
.character-panel::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.3); border-radius: 99px; }

.story-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 640px;
  overflow: hidden;
}

/* ---------------- 角色 ---------------- */

.char-head { display: flex; align-items: center; gap: 12px; }

.avatar {
  flex: 0 0 auto;
  display: block;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 35% 30%, rgba(232, 201, 135, 0.18), rgba(10, 14, 11, 0.9));
  box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.08);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
}

.char-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 2px;
}

.char-head p { margin: 3px 0 0; font-size: 12px; }

.status-pill {
  margin-top: 14px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(201, 164, 92, 0.055);
  color: var(--gold-bright);
  font-size: 11.5px;
  letter-spacing: 1px;
  text-align: center;
}

.realm-block { margin-top: 15px; }

.stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stat-line span { color: var(--muted); font-size: 12px; letter-spacing: 2px; }
.stat-line strong { color: var(--gold-bright); font-size: 17px; letter-spacing: 1px; }

.bar-row { margin-top: 11px; }

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11.5px;
}

.bar {
  position: relative;
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s ease;
}

.bar.progress i { background: linear-gradient(90deg, #8b682f, var(--gold-bright)); }
.bar.hp i { background: linear-gradient(90deg, #6e2b2b, #c96a5c); }
.bar.mp i { background: linear-gradient(90deg, #28455c, #7fa9c9); }

.resource-block {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 15px;
}

.stat {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.028);
}

.stat span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 1px; }
.stat strong { display: block; margin-top: 1px; font-size: 15px; font-weight: 600; }

.stat.wide { grid-column: span 2; }

.stat-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.stat-button:hover { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.06); }
.stat-button.ready {
  border-color: var(--line-strong);
  box-shadow: 0 0 16px rgba(201, 164, 92, 0.12);
}
.stat-button.ready strong { color: var(--gold-bright); }
.stat-button strong { margin-top: 0; }

/* ---------------- 装备 ---------------- */

.equipment-section { margin-top: 17px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.section-head h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
}

.ghost-btn.small { padding: 3px 8px; font-size: 11px; }

.section-actions { display: flex; align-items: center; gap: 5px; }
.ring-btn { border-color: rgba(201, 164, 92, 0.38); color: var(--gold); }
.ghost-btn em { color: var(--gold-bright); font-style: normal; }

.equip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.equip-slot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.equip-slot:hover { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.05); }
.equip-slot span { color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.equip-slot b {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.equip-slot.locked { opacity: 0.48; cursor: not-allowed; }
.equip-slot.locked b { color: var(--muted); }

.inventory { margin-top: 17px; }
.inventory ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.inventory li.empty { color: var(--muted); font-size: 11px; }

.item-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(201, 164, 92, 0.045);
  color: var(--ink);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.18s ease;
}
.item-chip:hover { border-color: var(--gold); background: rgba(201, 164, 92, 0.1); }
.item-chip em { margin-left: 5px; color: var(--gold-bright); font-style: normal; }
.item-chip.med { border-color: rgba(127, 169, 201, 0.3); }
.item-chip.med:hover { border-color: var(--blue); background: rgba(127, 169, 201, 0.1); }

/* 空间戒指 */
.ring-tabs {
  display: flex;
  gap: 5px;
  margin: 2px 0 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.ring-tab {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 0.18s ease;
}
.ring-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.035); }
.ring-tab.active {
  border-color: var(--line-strong);
  background: rgba(201, 164, 92, 0.09);
  color: var(--gold-bright);
}
.ring-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 370px;
  overflow-y: auto;
  padding-right: 3px;
}
.ring-list::-webkit-scrollbar { width: 5px; }
.ring-list::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.28); border-radius: 99px; }
.ring-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}
button.ring-row:hover { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.07); }
.ring-row.equip { cursor: default; }
.ring-info { min-width: 0; }
.ring-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ring-main b { font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }
.ring-main em { flex: 0 0 auto; color: var(--muted); font-size: 10.5px; font-style: normal; }
.ring-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.ring-empty { padding: 34px 0; color: var(--muted); font-size: 12.5px; text-align: center; }

.skill-section-title {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 2px;
}
.skill-row { align-items: flex-start; padding: 7px 10px; }
.skill-row .ring-main { align-items: center; }
.ring-list.skill-list { max-height: 500px; }
.skill-grade-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.skill-grade-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.skill-grade-row.current {
  border-color: var(--line-strong);
  background: rgba(201, 164, 92, 0.07);
}
.skill-grade-row small { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.skill-grade-row em { color: var(--muted); font-size: 10.5px; font-style: normal; text-align: right; }
.battle-skill-hint { margin: 8px 0 2px; color: var(--muted); font-size: 11.5px; }

.sk-fan { color: #ece8dc; }
.sk-ling { color: #7fcf8d; }
.sk-xuan { color: #d5dde2; text-shadow: 0 0 10px rgba(206, 226, 235, 0.35); }
.sk-di { color: #f0c75e; text-shadow: 0 0 10px rgba(240, 199, 94, 0.28); }
.sk-tian {
  background: linear-gradient(90deg, #ff8585, #ffd166, #8be28b, #7cc7ff, #d69bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.hint {
  margin-top: 14px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--gold-bright);
  font-size: 11.5px;
  text-align: center;
  animation: breathe 2.4s ease-in-out infinite;
}

/* ---------------- 故事栏 ---------------- */

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 3px;
}

.log {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 12px 22px 20px;
  scrollbar-width: thin;
}

.log::-webkit-scrollbar { width: 5px; }
.log::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.28); border-radius: 99px; }

.log::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  height: 22px;
  margin: -12px -22px 0;
  background: linear-gradient(180deg, rgba(14, 19, 16, 0.96), transparent);
  pointer-events: none;
  z-index: 1;
}

.entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.045);
  animation: fadeUp 0.35s ease;
}

.entry .year {
  padding-top: 3px;
  color: rgba(168, 173, 162, 0.72);
  font-size: 10.5px;
  text-align: right;
  white-space: nowrap;
}

.entry p { margin: 0; font-size: 14.5px; line-height: 1.8; }
.entry.gain p { color: #a9c99b; }
.entry.danger p { color: #d99286; }
.entry.epic p { color: var(--gold-bright); text-shadow: 0 0 18px rgba(227, 184, 92, 0.18); }
.entry.system p { color: var(--muted); font-size: 13.5px; }
.entry.battle p { color: #c9b8a2; }

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

/* ---------------- 行动 ---------------- */

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
}

.action {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.action b { color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 2px; }
.action span { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10.5px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.action:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(201, 164, 92, 0.08);
  transform: translateY(-1px);
}
.action:disabled { opacity: 0.42; cursor: not-allowed; }
.action.ready {
  border-color: var(--line-strong);
  box-shadow: 0 0 20px rgba(201, 164, 92, 0.14);
  animation: breathe 2.8s ease-in-out infinite;
}

.action.meditate-action.active {
  border-color: rgba(127, 174, 131, 0.55);
  background: rgba(127, 174, 131, 0.08);
}
.action.meditate-action.active b { color: var(--jade); }
.action.meditate-action.active span { color: rgba(169, 201, 155, 0.8); }

.action.active:not(.meditate-action) {
  border-color: rgba(201, 164, 92, 0.5);
  background: rgba(201, 164, 92, 0.07);
}

.stone-num {
  color: var(--gold-bright);
  font-weight: 600;
}

/* ---------------- 藏宝阁 ---------------- */

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  margin-top: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.shop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.shop-row.sold { opacity: 0.48; }

.shop-info {
  min-width: 0;
  flex: 1;
}

.shop-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.shop-name b {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-name em {
  flex: none;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 1px;
}

.shop-info small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.shop-buy {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.shop-buy strong {
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.shop-buy-btn {
  min-width: 66px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(201, 164, 92, 0.08);
  color: var(--gold-bright);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.shop-buy-btn:hover:not(:disabled) { background: rgba(201, 164, 92, 0.18); }
.shop-buy-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.badge {
  position: absolute;
  top: 6px;
  right: 7px;
  min-width: 16px;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(201, 164, 92, 0.9);
  color: #171207;
  font-size: 9.5px;
  font-style: normal;
  line-height: 1.4;
  text-align: center;
}

/* ---------------- 闭关 ---------------- */

.seclusion {
  padding: 13px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgba(201, 164, 92, 0.045);
}

.seclusion-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--gold-bright);
  font-size: 12px;
  letter-spacing: 2px;
}

.seclusion-head strong { font-size: 22px; font-weight: 500; letter-spacing: 1px; }
.seclusion-desc { margin: 6px 0 8px; color: var(--muted); font-size: 11.5px; }
.seclusion-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.seclusion-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b682f, var(--gold-bright));
  transition: width 1s linear;
}
.seclusion-note { margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

/* ---------------- 按钮 ---------------- */

.primary-btn {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(135deg, #b8893f, #e0bd74);
  color: #1a1408;
  font-weight: 700;
  letter-spacing: 4px;
  cursor: pointer;
  transition: 0.2s ease;
}
.primary-btn:hover { filter: brightness(1.06); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ghost-btn {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: 0.18s ease;
}
.ghost-btn:hover { border-color: var(--line-strong); color: var(--gold-bright); }
.ghost-btn.wide { width: 100%; }
.ghost-btn.danger:hover { border-color: rgba(201, 106, 92, 0.55); color: #d99286; }

/* ---------------- 弹窗 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 4, 0.78);
  backdrop-filter: blur(6px);
}

html.client-boot #startOverlay {
  display: none !important;
}

.modal {
  width: min(540px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #171d18, #0f1310);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  animation: modalIn 0.26s ease;
  scrollbar-width: thin;
}

.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-thumb { background: rgba(201, 164, 92, 0.3); border-radius: 99px; }

.modal h3 {
  margin: 0 0 12px;
  color: var(--gold-bright);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 3px;
}

.modal p { margin: 0 0 10px; font-size: 14px; line-height: 1.85; }
.modal .muted { font-size: 12.5px; }

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 17px;
}

.choice-btn {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}
.choice-btn:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.07); }
.choice-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.choice-btn b { font-size: 13.5px; font-weight: 600; }
.choice-btn span { color: var(--muted); font-size: 11px; }

/* ---------------- 开始页 ---------------- */

.start-modal { width: min(560px, 100%); }
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 6px;
  text-align: center;
}
.start-modal h2 {
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 33px;
  font-weight: 500;
  letter-spacing: 10px;
  text-align: center;
}
.start-modal .intro { margin-bottom: 16px; text-align: center; font-size: 12.5px; }

.field { display: block; margin-top: 13px; }
.field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 2px;
}

.field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  transition: 0.18s ease;
}
.field input:focus { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }

.name-row { display: flex; gap: 8px; align-items: stretch; }
.name-row input { flex: 1 1 auto; width: auto; min-width: 0; }
.name-random {
  flex: 0 0 auto;
  padding: 0 14px;
  color: var(--gold-bright);
  border-color: var(--line-strong);
}
.name-random:hover { background: rgba(201, 164, 92, 0.12); }

.gender-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.gender-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}
.gender-card:hover { border-color: var(--line-strong); }
.gender-card.selected { border-color: var(--gold); background: rgba(201, 164, 92, 0.09); }
.gender-thumb {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid rgba(201, 164, 92, 0.32);
  object-fit: cover;
  object-position: center 34%;
}
.gender-card b { display: block; font-size: 13px; font-weight: 600; }
.gender-card span { display: block; color: var(--muted); font-size: 10.5px; }

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 14px;
  margin: 15px 0 17px;
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: rgba(201, 164, 92, 0.035);
}
.rules div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 3px 0; }
.rules span { color: var(--muted); font-size: 10.5px; letter-spacing: 1px; }
.rules b { color: var(--ink); font-size: 10.5px; font-weight: 500; text-align: right; }

/* ---------------- 属性 / 装备列表 ---------------- */

.attr-list, .bag-list, .dungeon-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.attr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.027);
}
.attr-row > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
.attr-row b { font-size: 13px; }
.attr-row span { color: var(--muted); font-size: 10.5px; }
.attr-row strong { color: var(--gold-bright); font-size: 15px; }
.attr-plus {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(201, 164, 92, 0.08);
  color: var(--gold-bright);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.attr-plus:disabled { opacity: 0.3; cursor: not-allowed; }

.equip-row, .bag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.027);
}
.equip-row .info, .bag-row .info { min-width: 0; }
.equip-row b, .bag-row b { display: block; overflow: hidden; font-size: 12.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.equip-row span, .bag-row span { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.equip-row button, .bag-row button { flex: 0 0 auto; }

/* ---------------- 战斗 ---------------- */

.battle-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 4px;
}
.battle-side {
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.028);
}
.battle-side h4 { margin: 0 0 4px; color: var(--gold-bright); font-size: 12px; font-weight: 500; }
.battle-side p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.battle-side.enemy h4 { color: #d99286; }

.loot-list { margin: 8px 0 0; padding: 0; list-style: none; }
.loot-list li {
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
}
.loot-list li:last-child { border-bottom: 0; }

.dungeon-row {
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.027);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.dungeon-row:hover {
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(201, 162, 39, 0.07);
  transform: translateY(-1px);
}
.dungeon-row:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}
.dungeon-row.locked {
  cursor: not-allowed;
  opacity: 0.55;
}
.dungeon-row.locked:hover {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.027);
  transform: none;
}
.dungeon-row .dungeon-pick {
  color: var(--gold);
  font-size: 10.5px;
  white-space: nowrap;
}
.dungeon-row .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dungeon-row b { font-size: 13px; }
.dungeon-row .tag { color: var(--gold); font-size: 10px; }
.dungeon-row p { margin: 4px 0 7px; color: var(--muted); font-size: 11px; }
.dungeon-row .bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dungeon-row .bottom span { color: var(--muted); font-size: 10.5px; }

.explore-options {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed rgba(201, 162, 39, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.12);
}
.explore-label { color: var(--gold); font-size: 11px; letter-spacing: 2px; }
.duration-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.duration-btn {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.duration-btn:hover, .duration-btn.active {
  border-color: var(--line-strong);
  color: var(--gold-bright);
  background: rgba(201, 162, 39, 0.1);
}
.duration-custom {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.5px;
}
.duration-custom input {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.duration-custom input:focus { outline: none; border-color: var(--line-strong); }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 9px;
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.6;
  cursor: pointer;
}
.check-row input { accent-color: var(--gold); margin-top: 2px; }
.explore-options .muted { margin: 10px 0 0; font-size: 10.5px; }

/* ---------------- 品质颜色 ---------------- */

/* 装备品质：下品白 / 中品绿 / 上品蓝 / 极品紫 / 准神器银 / 神器紫金 /
   准圣器金 / 圣器黄金 / 准帝兵暗红 / 帝兵血红 / 上古帝兵金红 / 创世神器彩 */
.q0 { color: #f0ede3; }
.q1 { color: #7fc97f; }
.q2 { color: #6fa8dc; }
.q3 { color: #c79bff; }
.q4 { color: #e4eef9; text-shadow: 0 0 8px rgba(210, 230, 255, 0.45); }
.q5 {
  color: #d9a6ff;
  background: linear-gradient(90deg, #c79bff, #e8c25a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.q6 { color: #e8c25a; text-shadow: 0 0 8px rgba(232, 194, 90, 0.3); }
.q7 { color: #ffd700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.45); }
.q8 { color: #9e3b3b; text-shadow: 0 0 7px rgba(158, 59, 59, 0.35); }
.q9 { color: #e03b3b; text-shadow: 0 0 9px rgba(224, 59, 59, 0.45); }
.q10 {
  color: #ffb347;
  background: linear-gradient(90deg, #ffd700, #e03b3b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.q11 {
  color: #ffd6f2;
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bffb8, #6bb5ff, #c86bff, #ff6b6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* 丹药品质：下品白 / 中品蓝 / 上品紫 / 极品金 */
.pill-q-low { color: #f0ede3; }
.pill-q-mid { color: #6fa8dc; }
.pill-q-high { color: #c79bff; }
.pill-q-perfect { color: #e8c25a; text-shadow: 0 0 8px rgba(232, 194, 90, 0.3); }

/* ---------------- 仙界图录 ---------------- */

.codex-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.codex-tab {
  flex: 1;
  padding: 7px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
}
.codex-tab em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}
.codex-tab.active {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(201, 164, 92, 0.1);
}
.codex-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.codex-filters select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 11px;
}
.codex-filter-note {
  flex: none;
  color: var(--muted);
  font-size: 10px;
}
.codex-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.codex-pill-list { grid-template-columns: 1fr; max-height: 440px; }
.codex-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.codex-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.codex-row span {
  color: var(--muted);
  font-size: 10px;
}
.codex-row:hover { border-color: var(--line-strong); background: rgba(201, 164, 92, 0.06); }
.codex-row.locked { opacity: 0.56; border-style: dashed; }
.codex-row.locked b {
  color: #74766f !important;
  background: none !important;
  -webkit-text-fill-color: #74766f;
}
.codex-row.locked:hover { border-color: var(--line); background: rgba(255, 255, 255, 0.02); }
.codex-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}
.codex-pager .ghost-btn { padding: 5px 9px; font-size: 11px; }
.codex-pager .ghost-btn:disabled { opacity: 0.35; cursor: default; }
.codex-empty {
  grid-column: 1 / -1;
  padding: 20px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.codex-detail h4 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}
.codex-detail .codex-meta { color: var(--muted); font-size: 12px; }
.codex-detail .codex-stats {
  margin: 10px 0;
  padding: 8px 10px;
  color: var(--gold-bright);
  background: rgba(201, 164, 92, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
}
.codex-detail .codex-desc {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.8;
}
.codex-detail .muted { margin-top: 10px; }

/* ---------------- 动画 ---------------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 980px) {
  .shell { grid-template-columns: 320px minmax(0, 1fr); }
  .brand h1 { font-size: 23px; letter-spacing: 6px; }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 8px 14px 30px;
  }

  .story-panel { order: 1; height: auto; min-height: 72vh; }
  .character-panel { order: -1; position: static; max-height: none; }

  .log { min-height: 300px; max-height: 48vh; }
  .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #meditateBtn,
  #codexBtn { grid-column: 1 / -1; }

  .topbar { padding: 14px 16px 18px; }
  .brand h1 { font-size: 22px; letter-spacing: 5px; }
  .brand p { letter-spacing: 2px; }

  .start-modal h2 { font-size: 28px; letter-spacing: 7px; }
}

@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .top-actions .ghost-btn { padding: 5px 9px; font-size: 11px; }
  .cloud-status { font-size: 10px; }
  .seal { width: 42px; height: 42px; font-size: 21px; }
  .brand { gap: 10px; }
  .brand h1 { font-size: 20px; }
  .brand p { font-size: 10px; }

  .modal { padding: 19px; }
  .start-modal h2 { font-size: 25px; }
  .rules { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .equip-grid { grid-template-columns: 1fr 1fr; }
  .entry { grid-template-columns: 52px minmax(0, 1fr); gap: 7px; }
  .entry p { font-size: 13.5px; }
  .battle-box { grid-template-columns: 1fr; }
  .skill-row { display: block; }
  .skill-row .ring-main { flex-wrap: wrap; gap: 4px 10px; }
  .skill-row .ring-main b { white-space: nowrap; }
  .skill-row small { margin-top: 4px; }
  .skill-grade-row { grid-template-columns: 1fr; gap: 3px; }
  .skill-grade-row em { text-align: left; }
  .codex-list { grid-template-columns: 1fr; max-height: 360px; }
  .codex-tabs { gap: 4px; }
  .codex-tab { padding: 6px 3px; font-size: 10.5px; }
  .codex-filters { flex-wrap: wrap; }
  .codex-filter-note { width: 100%; text-align: right; }
}

/* 旧版缓存提示 */
.cache-warning {
  position: fixed;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  z-index: 9999;
  max-width: calc(100vw - 24px);
  padding: 9px 14px;
  border: 1px solid rgba(201, 106, 92, 0.55);
  border-radius: 9px;
  background: rgba(42, 20, 17, 0.96);
  color: #f0c9bd;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* ---------------- 云存档 / 排行榜 ---------------- */
.auth-modal { position: relative; width: min(430px, 100%); }
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(201, 164, 92, 0.2);
  border-radius: 50%;
  background: transparent;
  color: #9da89b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--gold-bright); border-color: var(--line-strong); }
.auth-modal h3 { margin-top: 4px; }
.auth-genders { display: flex; gap: 8px; }
.auth-gender {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  color: #c9c3b4;
  font: inherit;
  cursor: pointer;
}
.auth-gender.selected {
  border-color: var(--line-strong);
  background: rgba(201,164,92,.1);
  color: var(--gold-bright);
}
.auth-error {
  min-height: 18px;
  margin: 8px 0 2px;
  color: #d99286;
  font-size: 12px;
  line-height: 1.5;
}
.cloud-actions { display: grid; gap: 8px; margin-top: 14px; }
.danger-text { color: #d99286; }
.leaderboard-list {
  max-height: 52vh;
  overflow-y: auto;
  margin-top: 12px;
  border-top: 1px solid rgba(201,164,92,.14);
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 4px;
  border-bottom: 1px dashed rgba(255,255,255,.06);
}
.leaderboard-rank {
  color: var(--gold);
  font-size: 12px;
  text-align: right;
}
.leaderboard-name { color: #e5dece; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-realm { color: #9da89b; font-size: 11px; white-space: nowrap; }
@media (max-width: 520px) {
  .leaderboard-row { grid-template-columns: 28px minmax(0, 1fr); }
  .leaderboard-realm { grid-column: 2; text-align: left; }
}
