:root {
  --bg: #16172b;
  --panel: #1c1d2e;
  --panel2: #23243a;
  --gold: #ffc857;
  --gold2: #ffb800;
  --green: #4ade80;
  --red: #f87171;
  --orange: #ff9f43;
  --text: #e8e8f0;
  --muted: #8889a8;
  --border: #3d3e5c;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: var(--safe-top);
}

/* ===== 顶部标题栏 ===== */
#topbar {
  flex: 0 0 auto;
  height: 48px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}
#topbar .title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}
.reset-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #262840;
  color: var(--muted);
  border: none;
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
}

/* ===== 视图容器 ===== */
.view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.view.hidden { display: none; }

/* ===== 主视图 ===== */
#status-area { flex: 0 0 auto; }
#news-area { flex: 0 0 auto; }
#actions-area { flex: 0 0 auto; }

.columns {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  padding: 8px;
  min-height: 0;
}
.col {
  flex: 1 1 0;
  background: var(--panel);
  border-radius: 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}
.col-title {
  font-size: 15px;
  font-weight: 700;
  padding: 4px 4px 10px;
}
.col-title.gold { color: var(--gold); }
.col-title.green { color: var(--green); }

/* ===== 状态区 ===== */
.status-wrap {
  padding: 10px 8px 4px;
}
.chips {
  display: flex;
  gap: 6px;
}
.chip {
  flex: 1 1 0;
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
}
.chip .label { font-size: 11px; color: var(--muted); }
.chip .value { font-size: 17px; font-weight: 700; margin-top: 2px; }
.chip .sub { font-size: 9px; color: #d4a017; margin-top: 1px; }

.cash-line { text-align: center; margin: 8px 0 2px; }
.cash-line .clabel { font-size: 13px; color: var(--gold); }
.cash-line .cvalue { font-size: 32px; font-weight: 800; color: var(--gold2); }
.asset-line { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tip-lock {
  display: inline-block;
  margin: 4px auto 0;
  background: rgba(248,113,113,0.15);
  color: var(--red);
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 11px;
}

/* ===== 新闻条 ===== */
.news {
  margin: 2px 8px 6px;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  background: linear-gradient(90deg, rgba(74,222,128,0.12), rgba(96,165,250,0.08));
  color: #a0d0a0;
}

/* ===== 操作按钮区 ===== */
.actions { padding: 0 8px; }
.act-row { display: flex; gap: 8px; margin-bottom: 8px; }
.btn {
  flex: 1 1 0;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  padding: 10px 4px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.btn:active { filter: brightness(1.15); }
.btn-house { background: #2d2e4a; }
.btn-car { background: #2d2e4a; }
.btn-heal { background: #2d2e4a; }
.btn-partner { background: #2d2e4a; }
.btn-explore { background: #2d2e4a; }
.btn-hype { background: linear-gradient(135deg, #6d5dd8, #a78bfa); border: 1px solid #a78bfa; font-weight: 700; }
.btn-elite { background: linear-gradient(135deg, #c9a84c, #e8c84a); color: #1a1b2e; font-weight: 700; }
.btn-reset { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.btn-rank { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1b2e; font-weight: 700; }

/* 地下黑市入口 - 恶魔红色纹路背景 */
.bm-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,30,30,0.35) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(180,0,0,0.3) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255,60,0,0.2) 0%, transparent 50%),
    linear-gradient(135deg, #2a0000 0%, #4a0a0a 30%, #3d0000 60%, #1a0000 100%);
  border: 1px solid #6a0a0a;
  border-radius: 10px;
  padding: 14px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 0 12px rgba(140,0,0,0.4), inset 0 0 20px rgba(80,0,0,0.5);
}
.bm-entry .be-title { font-size: 16px; font-weight: 700; color: #ffc857; }
.bm-entry .be-sub { font-size: 13px; font-weight: 700; color: #1a0000; text-shadow: 0 0 4px rgba(255,40,40,0.8), 0 0 8px rgba(255,0,0,0.5); letter-spacing: 2px; }

/* ===== 货仓/市场列表项 ===== */
.item {
  background: var(--panel2);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.item .i-name { font-size: 13px; font-weight: 700; }
.item .i-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 3px; }
.item .i-price { font-size: 13px; font-weight: 700; color: var(--gold); }
.item .i-profit.up { color: var(--green); }
.item .i-profit.down { color: var(--red); }
.item .i-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.mini-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 14px;
  cursor: pointer;
}
.mini-btn.green { background: #34c759; }
.mini-btn.ghost { background: #2d2e4a; }
.section-tip { font-size: 10px; color: var(--muted); text-align: right; padding: 0 4px 4px; }

/* ===== 底部操作栏 ===== */
#bottombar {
  flex: 0 0 auto;
  background: var(--panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 8px 12px var(--safe-bottom);
  gap: 10px;
}
#bottombar .yinfo { font-size: 12px; color: var(--muted); line-height: 1.4; }
#bottombar .grow { flex: 1 1 auto; }
#bottombar .bb-btn {
  border: none;
  border-radius: 10px;
  font-size: 14px;
  padding: 11px 16px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
#bottombar .bb-retire { background: rgba(248,113,113,0.2); color: var(--red); }
#bottombar .bb-next { background: var(--gold); color: #1a1a1a; font-weight: 700; }

/* ===== 子页面（黑市/酒会/排行） ===== */
.sub-header {
  flex: 0 0 auto;
  height: 44px;
  background: var(--panel);
  display: flex;
  align-items: center;
  padding: 0 12px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.sub-header .sub-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
.back-btn { background: none; border: none; color: var(--text); font-size: 15px; cursor: pointer; padding: 4px 0; }
.refresh-btn { margin-left: auto; background: #caa14a; color: #fff; border: none; border-radius: 8px; font-size: 12px; padding: 5px 12px; cursor: pointer; }
.sub-body { flex: 1 1 auto; overflow-y: auto; padding: 10px; -webkit-overflow-scrolling: touch; }

/* 黑市货卡 */
.bm-card { background: #2b2620; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.bm-card .bm-name { font-size: 14px; font-weight: 700; color: var(--text); }
.bm-card .bm-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bm-card .bm-meta .price { color: var(--gold); }
.bm-card .bm-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.bm-bounty { background: #fff7e6; }
.bm-bounty .bm-name { color: #333; }
.bm-bounty .bm-meta { color: #777; }
.bm-bounty .bm-meta .price { color: #c0392b; }
.bm-held { background: var(--panel); }
.bm-held .bm-name { color: var(--gold); }

/* 酒会 - 顶部状态栏 */
.elite-top-bar {
  display: flex; justify-content: space-around; align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 16px 0 18px; margin-bottom: 10px;
}
.elite-stat { display: flex; flex-direction: column; align-items: center; }
.elite-stat-label { font-size: 12px; color: rgba(255,255,255,0.55); margin-bottom: 3px; }
.elite-stat-val { font-size: 22px; font-weight: 900; color: #fff; }
.elite-stat-val.locked { color: #95a5a6; }
.elite-stat-val.unlocked { color: #f1c40f; }
.elite-rep { color: #f1c40f !important; }

/* 未解锁 */
.elite-locked { display: flex; justify-content: center; padding: 40px 20px; }
.elite-locked-card {
  background: var(--panel2); border-radius: 12px; padding: 30px 24px;
  text-align: center; width: 100%;
}
.elite-locked-icon { font-size: 40px; margin-bottom: 10px; }
.elite-locked-title { font-size: 18px; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.elite-locked-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.elite-locked-highlight { color: #e67e22; font-weight: 700; }
.elite-progress-bar { height: 6px; background: #2a2b44; border-radius: 3px; margin-bottom: 6px; overflow: hidden; }
.elite-progress-fill { height: 100%; background: linear-gradient(90deg, #f39c12, #f1c40f); border-radius: 3px; transition: width 0.3s; }
.elite-progress-text { font-size: 11px; color: var(--muted); }

/* Tab */
.elite-tabs { display: flex; margin: 0 12px 10px; gap: 8px; }
.elite-tab {
  flex: 1; text-align: center; padding: 10px 0; border-radius: 8px;
  background: var(--panel); font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer;
}
.elite-tab.active {
  background: linear-gradient(135deg, #1a1a2e, #2c3e50);
  color: #f1c40f;
}

/* 风险提示 */
.risk-notice {
  background: rgba(249,231,150,0.08); border: 1px solid rgba(249,231,150,0.2);
  border-radius: 6px; padding: 8px 10px; margin: 0 12px 10px;
  font-size: 12px; color: #d4a017; text-align: center;
}

/* 投资卡片 */
.elite-invest-card {
  background: var(--panel2); border-radius: 10px; padding: 12px;
  margin: 0 12px 10px;
}
.elite-invest-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 9px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.elite-invest-icon { font-size: 20px; }
.elite-invest-name { font-size: 16px; font-weight: 800; color: var(--text); }
.elite-tiers { display: flex; flex-direction: column; gap: 5px; }
.elite-tier-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--panel);
  cursor: pointer;
}
.elite-tier-item:active { background: rgba(241,196,15,0.05); border-color: #f1c40f; }
.elite-tier-item.disabled { opacity: 0.45; }
.tier-left { flex: 1; min-width: 0; }
.tier-label { font-size: 14px; font-weight: 700; color: var(--text); }
.tier-risk { font-size: 10px; color: #e67e22; margin-top: 1px; }
.tier-right { text-align: right; flex-shrink: 0; margin-left: 8px; }
.tier-amount { font-size: 16px; font-weight: 900; color: #e67e22; }
.tier-rep { font-size: 11px; color: #f1c40f; font-weight: 600; margin-top: 1px; }

/* 娱乐项 */
.elite-content { padding: 0 12px; }
.elite-entertain-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel2); border-radius: 8px; padding: 9px;
  margin-bottom: 6px; cursor: pointer;
}
.elite-entertain-item:active { background: rgba(241,196,15,0.05); }
.elite-entertain-item.disabled { opacity: 0.45; }
.entertain-left { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.entertain-icon { font-size: 18px; flex-shrink: 0; }
.entertain-info { flex: 1; min-width: 0; }
.entertain-name { font-size: 13px; font-weight: 700; color: var(--text); }
.entertain-desc { font-size: 10px; color: var(--muted); margin-top: 1px; }
.entertain-right { text-align: right; flex-shrink: 0; margin-left: 5px; }
.entertain-cost { font-size: 13px; font-weight: 900; color: #e67e22; }
.entertain-rep { font-size: 10px; color: #f1c40f; font-weight: 600; margin-top: 1px; }

/* 排行榜 */
.rank-item { background: var(--panel2); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; display: flex; align-items: center; }
.rank-item .r-no { font-size: 16px; font-weight: 800; width: 36px; color: var(--gold); }
.rank-item .r-info { flex: 1 1 auto; }
.rank-item .r-name { font-size: 13px; font-weight: 600; }
.rank-item .r-title { font-size: 10px; color: var(--muted); }
.rank-item .r-asset { font-size: 13px; font-weight: 700; color: var(--red); }
.rank-empty { text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; }

/* ===== 弹窗 ===== */
.modal-layer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding-top: var(--safe-top);
}
.modal-layer.hidden { display: none; }
.modal {
  width: min(92vw, 340px);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px 18px;
}
.modal h3 { text-align: center; font-size: 16px; font-weight: 700; color: var(--gold); margin-bottom: 14px; }
.modal .m-sub { text-align: center; font-size: 13px; color: var(--muted); margin-top: -8px; margin-bottom: 12px; }

/* 数量选择 */
.qty-row { display: flex; gap: 6px; margin: 14px 0 10px; }
.qty-btn { flex: 1 1 0; border: none; border-radius: 8px; background: #363752; color: #fff; font-size: 15px; padding: 8px 0; cursor: pointer; }
.qty-val { flex: 1 1 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; background: #1c1d2e; border-radius: 8px; }
.m-info { background: #1c1d2e; border-radius: 8px; padding: 10px; text-align: center; font-size: 13px; color: var(--gold); margin-bottom: 12px; }

/* 弹窗按钮组 */
.modal-btns { display: flex; gap: 8px; margin-top: 8px; }
.modal-btns .mb {
  flex: 1 1 0;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  padding: 12px 0;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
}
.mb-confirm { background: var(--green); }
.mb-buy { background: var(--green); }
.mb-sell { background: var(--orange); }
.mb-cancel { background: #363752; }
.mb-gold { background: var(--gold); color: #1a1a1a; }

/* 列表选择弹窗 */
.opt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 50vh; overflow-y: auto; }
.opt {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.opt:active { background: #2a2b44; }
.opt .o-name { font-size: 14px; font-weight: 600; }
.opt .o-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.opt .o-cost { font-size: 12px; color: var(--gold); margin-top: 3px; }

/* 结局弹窗 */
.ending-icon { font-size: 48px; text-align: center; }
.ending-title { font-size: 22px; font-weight: 800; text-align: center; color: var(--gold); margin: 8px 0; }
.ending-desc { font-size: 14px; text-align: center; color: var(--text); margin-bottom: 14px; }

/* 消息弹窗 */
.msg-text { font-size: 14px; line-height: 1.5; margin: 8px 0 14px; text-align: center; color: var(--text); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 100;
  max-width: 80vw;
  text-align: center;
  pointer-events: none;
}
.toast.hidden { display: none; }

/* 新手引导 */
.tut p { font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 8px; }
.tut .t-hl { color: var(--gold); font-weight: 600; }

/* ===== 顶部 🧬 天赋按钮 ===== */
.meta-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #6d5dd8, #a78bfa);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  font-weight: 700;
}
.meta-btn:active { filter: brightness(1.15); }

/* ===== 弹窗关闭叉号 ===== */
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.modal-close:active { background: rgba(255,255,255,0.18); color: #fff; }
.modal { position: relative; }

/* ===== 天赋道场 ===== */
.meta-rep-pool {
  background: linear-gradient(135deg, #2a2150, #3a2a6a);
  border: 1px solid #5a4a9a;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 12px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}
.meta-rep-pool span { font-size: 26px; font-weight: 900; color: var(--gold); margin-left: 6px; }
.meta-tip { font-size: 11px; color: #b9a8e8; margin-top: 6px; }

.meta-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  margin: 16px 14px 4px;
}
.meta-story-sub { font-size: 11px; color: var(--muted); margin: 0 14px 10px; }

/* 出身卡片 */
.meta-story {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 12px 10px;
  cursor: pointer;
}
.meta-story.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); background: rgba(255,200,87,0.06); }
.meta-story .ms-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.meta-story .ms-icon { font-size: 22px; }
.meta-story .ms-name { font-size: 15px; font-weight: 800; color: var(--text); }
.meta-story .ms-desc { font-size: 12px; color: var(--muted); }
.meta-story .ms-story { font-size: 12px; color: #c9c9e6; line-height: 1.5; margin-top: 6px; }
.meta-story .ms-bonus { font-size: 11px; color: var(--green); margin-top: 6px; font-weight: 600; }

/* 特异功能卡 */
.meta-perk {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 12px 10px;
}
.meta-perk .mp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.meta-perk .mp-icon { font-size: 20px; }
.meta-perk .mp-name { font-size: 15px; font-weight: 800; color: var(--text); flex: 1; }
.meta-perk .mp-lv { font-size: 12px; color: var(--gold); font-weight: 700; }
.meta-perk .mp-desc { font-size: 11px; color: var(--muted); }
.meta-perk .mp-effect { font-size: 12px; color: var(--green); margin-top: 4px; }
.mp-up {
  margin-top: 10px;
  width: 100%;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #6d5dd8, #a78bfa);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 0;
  cursor: pointer;
}
.mp-up.disabled { background: #363752; color: var(--muted); cursor: not-allowed; }
.mp-max { margin-top: 10px; text-align: center; font-size: 13px; color: var(--gold); font-weight: 700; }

/* 成就网格 */
.meta-ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 16px; }
.meta-ach {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  opacity: 0.5;
}
.meta-ach.got { opacity: 1; border-color: var(--gold); background: rgba(255,200,87,0.08); }
.meta-ach .ma-icon { font-size: 26px; }
.meta-ach .ma-name { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.meta-ach .ma-desc { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.meta-ach .ma-reward { font-size: 10px; color: var(--gold); margin-top: 4px; font-weight: 600; }

/* ===== 首页（主菜单） ===== */
#view-home { justify-content: flex-start; }
.home-body {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 8vh 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-logo { font-size: 64px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 4px 12px rgba(255,184,0,0.3)); }
.home-title {
  font-size: 30px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--gold), #ff8a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-sub { color: var(--muted); font-size: 14px; margin-top: 6px; letter-spacing: 3px; }
.home-start {
  margin-top: 34px;
  width: 220px; height: 58px;
  border: none; border-radius: 30px;
  background: linear-gradient(135deg, var(--gold), #ff8a3d);
  color: #2a1c00; font-size: 19px; font-weight: 800; letter-spacing: 2px;
  box-shadow: 0 8px 22px rgba(255,184,0,0.35);
  cursor: pointer;
}
.home-start:active { transform: scale(0.97); }
.home-row { display: flex; gap: 14px; margin-top: 22px; }
.home-btn {
  flex: 1; min-width: 130px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel2); color: var(--text);
  font-size: 15px; font-weight: 700; padding: 14px 0;
  cursor: pointer;
}
.home-btn:active { background: var(--panel); }
.home-continue {
  margin-top: 18px;
  width: 220px; border: 1px dashed var(--green); border-radius: 24px;
  background: rgba(74,222,128,0.08); color: var(--green);
  font-size: 14px; font-weight: 700; padding: 10px 0; cursor: pointer;
}
.home-meta {
  margin-top: 30px; font-size: 13px; color: var(--muted);
}
.home-meta b { color: var(--gold); }

/* ===== 出身选择页 ===== */
#view-story { padding-bottom: 90px; }
.story-tip {
  text-align: center; color: var(--muted); font-size: 13px;
  line-height: 1.6; padding: 14px 18px 4px;
}
.story-body { padding: 8px 14px; }
.story-card {
  background: var(--panel2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.story-card.selected { border-color: var(--gold); background: rgba(255,200,87,0.08); }
.sc-head { display: flex; align-items: center; gap: 8px; }
.sc-icon { font-size: 24px; }
.sc-name { font-size: 17px; font-weight: 800; color: var(--text); }
.story-card.selected .sc-name { color: var(--gold); }
.sc-desc { font-size: 12px; color: var(--orange); margin-top: 6px; }
.sc-story { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.sc-bonus { font-size: 12px; color: var(--green); margin-top: 8px; font-weight: 600; }
.story-start-wrap {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 14px 20px calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 30%);
  display: flex; justify-content: center;
}
.story-start-wrap .home-start { margin-top: 0; width: 240px; }

/* ===== 排行榜双榜标签 ===== */
.rank-tabs { display: flex; gap: 10px; padding: 12px 14px 4px; }
.rank-tab {
  flex: 1; text-align: center; padding: 10px 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel2); color: var(--muted);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.rank-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(255,200,87,0.1); }

/* ===== 天赋 detail 文案 ===== */
.meta-perk .mp-detail { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; font-style: italic; }
.meta-count { font-size: 12px; color: var(--gold); background: rgba(255,200,87,0.12); padding: 2px 8px; border-radius: 10px; margin-left: 6px; }

/* ===== 数量滑动条（进货/出货/黑市/悬赏 通用） ===== */
.qty-slider-wrap { margin: 16px 0 4px; }
.qty-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: 6px;
  background: linear-gradient(90deg, var(--gold2), #ff8a3d);
  outline: none; cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.45);
}
.qty-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff8e6;
  border: 3px solid var(--gold2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  cursor: pointer;
}
.qty-slider::-webkit-slider-thumb:active { transform: scale(1.12); }
.qty-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff8e6; border: 3px solid var(--gold2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5); cursor: pointer;
}
.qty-slider::-moz-range-track { height: 8px; border-radius: 6px; background: transparent; }
.qty-scale {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-top: 6px;
}
.qty-hint {
  text-align: center; font-size: 12px; color: #60a5fa;
  margin-bottom: 10px; line-height: 1.5;
}
.qty-max { background: var(--gold2) !important; color: #2a1c00 !important; font-weight: 800; }
.qty-lock {
  background: rgba(255,90,90,0.12);
  border: 1px solid rgba(255,90,90,0.4);
  color: #ff8f8f;
  border-radius: 10px; padding: 14px; text-align: center;
  font-size: 13px; line-height: 1.6; margin: 14px 0;
}

/* ===== 黑市声望门槛条 ===== */
.bm-rep {
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--border); background: var(--panel2);
}
.bm-rep.ok { border-color: rgba(74,222,128,0.5); background: rgba(74,222,128,0.07); }
.bm-rep.locked { border-color: rgba(255,90,90,0.5); background: rgba(255,90,90,0.08); }
.bm-rep-head { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.bm-rep.ok .bm-rep-head { color: #4ade80; }
.bm-rep.locked .bm-rep-head { color: #ff8f8f; }
.bm-rep-bar {
  height: 7px; border-radius: 5px; background: #1c1d2e; overflow: hidden;
}
.bm-rep-bar i {
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--gold2), #ff8a3d);
  transition: width 0.25s;
}
.bm-rep-note { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.bm-rep-note b { color: var(--gold); }
.bm-card.bm-dim { opacity: 0.55; }
.mini-btn.locked {
  background: #4a3030 !important; color: #ff8f8f !important;
  cursor: not-allowed; opacity: 0.85;
}
.bm-entry.bm-entry-locked { filter: grayscale(0.55) brightness(0.7); }
.bm-entry.bm-entry-locked .be-sub { color: #ffb3b3; }

/* ============ 新增：姓名输入 / 调养期 / 订单 / 恋爱 / 排行榜来源 ============ */

/* 姓名输入 */
.name-input {
  width: 100%; box-sizing: border-box; margin: 14px 0 6px;
  padding: 12px 14px; font-size: 18px; text-align: center; letter-spacing: 2px;
  color: var(--gold2); background: transparent;
  border: none; border-bottom: 2px solid var(--gold);
  border-radius: 0; outline: none;
}
.name-input::placeholder { color: #6b6252; letter-spacing: 1px; font-size: 15px; }
.name-input:focus { border-bottom-color: #ffd766; box-shadow: 0 2px 10px -6px #ffd766; }

.story-name {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,190,60,0.10); border: 1px solid rgba(255,190,60,0.3);
  color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.story-name b { color: var(--gold2); font-size: 16px; }
.name-edit {
  margin-left: auto; padding: 4px 10px; font-size: 12px; cursor: pointer;
  color: var(--gold2); background: rgba(255,190,60,0.14);
  border: 1px solid rgba(255,190,60,0.35); border-radius: 6px;
}

/* 调养期 / 追求中 状态条 */
.recovery-bar, .courting-bar {
  margin: 6px 0 0; padding: 7px 10px; border-radius: 8px;
  font-size: 12px; text-align: center; line-height: 1.5;
}
.recovery-bar { background: rgba(255,77,79,0.14); border: 1px solid rgba(255,77,79,0.4); color: #ff9c9e; }
.recovery-bar b { color: #ff4d4f; }
.courting-bar { background: rgba(255,107,157,0.14); border: 1px solid rgba(255,107,157,0.4); color: #ffa8c6; }
.courting-bar b { color: #ff6b9d; }

/* 好感度进度条 */
.aff-bar {
  height: 10px; margin: 8px 0 12px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,0.08);
}
.aff-bar > i {
  display: block; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #ff6b9d, #ffa8c6);
  transition: width .3s ease;
}

/* 大宗订单 */
.order-box {
  margin-top: 8px; padding: 8px 10px 4px; border-radius: 10px;
  background: rgba(82,196,26,0.08); border: 1px solid rgba(82,196,26,0.28);
}
.order-title { font-size: 12px; color: #8ee06a; margin-bottom: 6px; font-weight: 600; }
.order-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 0; border-top: 1px dashed rgba(255,255,255,0.08);
}
.order-item:first-of-type { border-top: none; }
.order-item.done { opacity: .5; }
.oi-main { flex: 1 1 100%; font-size: 12px; color: var(--text); }
.oi-main b { color: var(--gold2); }
.oi-price { color: #8ee06a; }
.oi-sub { flex: 1; font-size: 11px; color: var(--muted); }

/* 锁定的选项（找对象 / 捐款） */
.opt.locked { opacity: .45; cursor: not-allowed; filter: grayscale(0.6); }

/* 排行榜数据来源提示 */
.rank-src {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; font-size: 11px;
}
.rank-src.on  { background: rgba(82,196,26,0.12); border: 1px solid rgba(82,196,26,0.3); color: #8ee06a; }
.rank-src.off { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--muted); }
.rank-refresh {
  margin-left: auto; padding: 3px 9px; font-size: 11px; cursor: pointer;
  color: inherit; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
}
.r-no.g { color: #ffd700; }
.r-no.s { color: #d8d8d8; }
.r-no.b { color: #cd8a4b; }

/* 慈善按钮 */
.btn-donate { background: linear-gradient(160deg, #3a5c46, #2b4436); border-color: rgba(82,196,26,0.35); }
