/* ===== 斗灵大陆·命运转盘 - 清新简约风 ===== */
:root {
  --bg: #eef2f3; --card: #fff;
  --primary: #1e4e63; --primary-dark: #163e4f; --primary-light: #2a6178;
  --accent: #a52f46; --accent-light: #aa3449; --danger: #b32555;
  --gold: #8a6a2f;
  --text: #202a31; --text-mid: #315466; --text-light: #60717a; --text-muted: #87939a;
  --border: #edf0f1; --border-mid: #d8e3e7;
  --shadow-card: 0 8px 24px #263b4a1f; --shadow-btn: 0 5px 13px #246c8338;
  --radius-card: 20px; --radius-btn: 14px;
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
}
* { margin:0; padding:0; box-sizing:border-box; }
html, body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* 按钮 */
.btn { font-family: var(--font); font-size: 15px; font-weight: 700; border: none; border-radius: var(--radius-btn); padding: 13px 28px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover:not(:disabled) { background: var(--primary-light); }
.btn-secondary { background: #f0f4f8; color: var(--text-mid); border: 1px solid var(--border-mid); }
.btn-secondary:hover:not(:disabled) { background: #e2e8ea; }
.btn-dark { background: var(--primary-dark); color: #fff; }
.btn-dark:hover:not(:disabled) { background: #1e4356; }
.btn-danger { background: #fae8eb; color: var(--accent-light); }
.btn-danger:hover:not(:disabled) { background: #f5dde2; }
.btn-sm { font-size:13px; padding:8px 16px; border-radius:8px; }
.btn-block { width: 100%; }

/* 起始页 */
.start-page { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(165deg, #edf4f5, #fff 55%, #f6f0e6); padding: 20px; }
.start-card { background: var(--card); border-radius: var(--radius-card); box-shadow: 0 22px 70px #263b4a1f; padding: 48px 40px; max-width: 440px; width: 100%; text-align: center; }
.start-logo { width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 50%; background: var(--primary-dark); color: #f3d38d; font-family: var(--font-serif); font-size: 32px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.start-title { font-family: var(--font-serif); font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.start-desc { font-size: 14px; color: #66747c; line-height: 1.7; margin-bottom: 28px; }
.seed-input { width: 100%; padding: 12px 16px; font-size: 14px; font-family: var(--font); color: var(--text); background: #fff; border: 1px solid #ccd7dc; border-radius: 10px; outline: none; transition: border-color .2s; margin-bottom: 24px; }
.seed-input:focus { border-color: var(--primary); }
.start-buttons { display: flex; flex-direction: column; gap: 12px; }
.start-buttons .btn { width: 100%; padding: 13px; font-size: 15px; }
.start-wechat { position: fixed; bottom: 16px; left: 16px; font-size: 12px; color: var(--text-muted); background: var(--card); padding: 6px 14px; border-radius: 999px; box-shadow: 0 2px 8px #0001; cursor: pointer; }

/* 游戏页 */
.game-page { min-height: 100vh; display: flex; flex-direction: column; }
.topnav { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 52px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.nav-left { display: flex; align-items: baseline; gap: 8px; }
.nav-logo { font-size: 15px; font-weight: 700; color: var(--text); }
.nav-logo-circle { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-dark); color: #f3d38d; font-family: var(--font-serif); font-size: 15px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px #0002; }
.nav-auth { font-size: 9px; color: var(--text-muted); letter-spacing: .5px; }
.nav-menu { display: flex; gap: 4px; }
.nav-btn { font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--primary-light); background: none; border: none; padding: 6px 12px; cursor: pointer; border-radius: 6px; transition: background .2s; }
.nav-btn:hover { background: #f1f5f6; }
.nav-btn.active { color: var(--accent-light); }
.nav-gear { font-size: 17px; padding: 6px 10px; }

.game-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 28px 20px 48px; gap: 14px; }

/* 右上角状态栏 */
.status-bar { display: flex; align-items: center; gap: 24px; width: 100%; justify-content: center; padding: 10px 16px; }
.status-item { display: flex; align-items: baseline; gap: 4px; }
.status-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.status-big { font-size: 32px; font-weight: 800; color: var(--primary); font-family: var(--font); line-height: 1; }
.status-unit { font-size: 13px; color: var(--text-light); }
.status-spirit { font-size: 15px; font-weight: 700; color: var(--text); padding: 4px 12px; background: #f1f3f4; border-radius: 999px; border: 1px solid var(--border-mid); }
.status-cat { font-size: 12px; font-weight: 600; color: var(--primary); background: #edf2f4; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-mid); white-space: nowrap; }
.stage-cat { font-size: 12px; font-weight: 600; color: var(--primary); letter-spacing: 2px; }
.stage-title { font-family: var(--font-serif); font-size: 20px; font-weight: 700; color: var(--text); text-align: center; }
.stage-hint { font-size: 13px; color: var(--text-light); background: #f1f3f4; padding: 6px 16px; border-radius: 999px; }
.wheel-area { position: relative; display: flex; flex-direction: column; align-items: center; margin: 6px 0; }
.stage-label-top { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; min-height: 20px; }
#wheel { cursor: pointer; filter: drop-shadow(0 6px 10px #22323d1b); max-width: calc(100vw - 40px); height: auto; }
.action-bar { display: flex; gap: 12px; align-items: center; }
.btn-action { min-width: 110px; text-align: center; }
.btn-spin { min-width: 180px; font-size: 16px; padding: 15px 36px; }
.extra-controls { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* 抽屉 */
.drawer-mask { position: fixed; inset: 0; background: #17232a70; z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 90vw; background: var(--card); box-shadow: -8px 0 32px #0003; z-index: 91; display: flex; flex-direction: column; overflow: hidden; animation: slideIn .3s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-title { font-size: 15px; font-weight: 700; color: var(--text); }
.drawer-body { padding: 16px 20px; overflow-y: auto; flex: 1; }

/* 角色档案字段 */
.char-field { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid #f0f3f4; font-size: 14px; }
.char-field-label { color: var(--text-light); font-size: 13px; flex-shrink: 0; }
.char-field-value { color: var(--text); text-align: right; }
.char-field-value.highlight { color: var(--primary); font-weight: 700; }
.char-field-value.empty { color: var(--text-muted); }
.char-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 0; }
.stat-item { text-align: center; padding: 10px 4px; background: #f3f7f8; border: 1px solid var(--border-mid); border-radius: 8px; }
.stat-item .s-label { display:block; font-size:11px; color:var(--text-muted); }
.stat-item .s-num { display:block; font-size:18px; font-weight:700; color:var(--primary); margin-top:3px; }
.stat-item .s-num.neg { color: var(--accent); }
.stat-item .s-num.warn { color: #a13d20; }

/* 存档与导出 */
.save-section { margin-bottom: 20px; }
.save-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.save-info { font-size: 13px; color: var(--text-mid); margin-bottom: 10px; line-height: 1.6; }
.save-info b { color: var(--primary); }
.save-row { display: flex; gap: 8px; margin-bottom: 8px; }
.save-row .btn { flex: 1; }
.save-note { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* 命运纪事 */
.chronicle-search { width: 100%; padding: 8px 12px; font-size: 13px; font-family: var(--font); color: var(--text); border: 1px solid var(--border-mid); border-radius: 8px; outline: none; margin-bottom: 10px; }
.chronicle-search:focus { border-color: var(--primary); }
.chronicle-filter { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.chronicle-select { font-size: 13px; padding: 6px 10px; border: 1px solid var(--border-mid); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; }
.chronicle-check { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-mid); cursor: pointer; }
.chronicle-clear { font-size: 12px; color: var(--accent-light); background: none; border: none; cursor: pointer; }
.chronicle-list { max-height: 400px; overflow-y: auto; }
.chronicle-item { padding: 8px 0; border-bottom: 1px solid #f0f3f4; font-size: 13px; line-height: 1.6; color: var(--text-mid); }
.chronicle-item .ci-cat { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-right: 6px; font-weight: 600; }
.chronicle-item.major { color: var(--text); }
.chronicle-item.major .ci-cat { background: #fae8eb; color: var(--accent-light); }
.chronicle-empty { text-align: center; color: var(--text-muted); padding: 30px 0; font-size: 13px; }

/* 肥宅模式 */
.feizhai-panel { text-align: center; padding: 20px 0; }
.feizhai-icon { font-size: 48px; margin-bottom: 16px; }
.feizhai-desc { font-size: 14px; color: var(--text-mid); line-height: 1.8; margin-bottom: 24px; }
.feizhai-status { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }

/* 结局弹窗 */
.ending-overlay { position: fixed; inset: 0; background: #17232ab8; display: none; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(6px); }
.ending-overlay.show { display: flex; }
.ending-card { background: var(--card); border-radius: var(--radius-card); box-shadow: 0 22px 70px #0004; padding: 40px 36px; max-width: 440px; width: 90%; text-align: center; animation: rise .6s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from{transform:translateY(30px);opacity:0} to{transform:none;opacity:1} }
.ending-seal { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 36px; font-weight: 800; color: #fff; }
.ending-title { font-family: var(--font-serif); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.ending-desc { font-size: 14px; line-height: 1.8; color: var(--text-mid); margin-bottom: 24px; }
.ending-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 24px; }
.ending-stats > div { padding: 10px; background: #f1f3f4; border-radius: 8px; }
.ending-stats span { display:block; font-size:11px; color:var(--text-muted); margin-bottom:3px; }
.ending-stats b { font-size:17px; color:var(--primary); }

/* 版本号 */
.version-tag { position: fixed; bottom: 12px; right: 14px; font-size: 10px; font-weight: 600; color: #3d484eb8; background: #dae0e3ad; padding: 2px 8px; border-radius: 4px; border: 1px solid rgba(94,108,115,.12); z-index: 50; }

/* 设置按钮 */
.settings-btn { position: fixed; bottom: 10px; right: 60px; width: 28px; height: 28px; border: 1px solid rgba(94,108,115,.12); background: #dae0e3ad; border-radius: 4px; font-size: 15px; cursor: pointer; color: #3d484eb8; z-index: 50; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.settings-btn:hover { background: #cdd5d9; }

/* 设置抽屉内容 */
.settings-section { margin-bottom: 20px; }
.settings-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.settings-row-label { color: var(--text-mid); }
.settings-row-value { color: var(--primary); font-weight: 600; font-size: 13px; min-width: 40px; text-align: right; }
input[type="range"].settings-slider { flex: 1; max-width: 140px; margin: 0 12px; accent-color: var(--primary); height: 4px; }
input[type="checkbox"].settings-check { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.settings-radio-group { display: flex; gap: 8px; }
.settings-radio { padding: 4px 12px; font-size: 13px; border: 1px solid var(--border-mid); border-radius: 8px; cursor: pointer; background: #fff; color: var(--text-mid); transition: all .2s; }
.settings-radio.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.settings-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* 响应式 - 手机适配 */
@media (max-width: 600px) {
  /* 起始页 */
  .start-page { padding: 12px; }
  .start-card { padding: 28px 20px; max-width: 100%; }
  .start-logo { width: 48px; height: 48px; font-size: 24px; margin-bottom: 16px; }
  .start-title { font-size: 19px; }
  .start-desc { font-size: 13px; margin-bottom: 20px; }
  .seed-input { padding: 10px 14px; font-size: 13px; margin-bottom: 18px; }
  .start-buttons .btn { padding: 11px; font-size: 14px; }

  /* 导航栏 */
  .topnav { padding: 0 10px; height: 46px; }
  .nav-logo-circle { width: 22px; height: 22px; font-size: 12px; }
  .nav-logo { font-size: 13px; }
  .nav-auth { display: none; }
  .nav-btn { font-size: 11px; padding: 4px 7px; }
  .nav-gear { font-size: 15px; padding: 4px 7px; }

  /* 状态栏 */
  .status-bar { gap: 10px; padding: 6px 4px; flex-wrap: wrap; justify-content: center; }
  .status-big { font-size: 22px; }
  .status-label { font-size: 10px; }
  .status-unit { font-size: 11px; }
  .status-spirit { font-size: 12px; padding: 3px 8px; }
  .status-cat { font-size: 10px; padding: 3px 8px; }

  /* 主区域 */
  .game-main { padding: 14px 10px 40px; gap: 10px; }
  .stage-title { font-size: 15px; }
  .stage-hint { font-size: 11px; padding: 4px 10px; }
  .stage-label-top { font-size: 11px; }

  /* 转盘 */
  #wheel { max-width: calc(100vw - 24px); }

  /* 按钮组 */
  .action-bar { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .btn-action { min-width: 68px; padding: 10px 14px; font-size: 13px; }
  .btn-spin { min-width: 110px; padding: 11px 20px; font-size: 14px; }
  .extra-controls { gap: 6px; }
  .btn-sm { font-size: 12px; padding: 7px 12px; }

  /* 抽屉全屏 */
  .drawer { width: 100vw; max-width: 100vw; }
  .drawer-body { padding: 12px 14px; }

  /* 角色档案 */
  .char-field { font-size: 13px; padding: 6px 0; }
  .char-field-label { font-size: 12px; }
  .stats-grid { gap: 6px; }
  .stat-item { padding: 8px 2px; }
  .stat-item .s-label { font-size: 10px; }
  .stat-item .s-num { font-size: 16px; }

  /* 存档 */
  .save-row { flex-direction: column; }
  .save-row .btn { width: 100%; }

  /* 纪事 */
  .chronicle-search { font-size: 12px; padding: 7px 10px; }
  .chronicle-select { font-size: 12px; }
  .chronicle-check { font-size: 12px; }
  .chronicle-item { font-size: 12px; }

  /* 结局弹窗 */
  .ending-card { padding: 24px 18px; }
  .ending-seal { width: 60px; height: 60px; font-size: 30px; }
  .ending-title { font-size: 18px; }
  .ending-desc { font-size: 13px; }
  .ending-stats { gap: 8px; }
  .ending-stats > div { padding: 8px; }
  .ending-stats b { font-size: 15px; }

  /* 版本号 */
  .version-tag { font-size: 9px; bottom: 8px; right: 8px; }

  /* 设置 */
  .settings-row { font-size: 13px; }
  .settings-row-label { font-size: 12px; }
  input[type="range"].settings-slider { max-width: 100px; margin: 0 8px; }
}
