/* ============================================================
 * 小目标模拟器 · 样式（喜庆红金 · 手机优先，兼容电脑）
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* ---------- 全局滚动条美化 ---------- */
* { scrollbar-width: thin; scrollbar-color: #c05030 rgba(60, 16, 18, .55); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(40, 10, 12, .6); border-radius: 8px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e07a2a, #b8431f);
  border-radius: 8px;
  border: 2px solid rgba(40, 10, 12, .85);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ff9a3a, #d05426); }
::-webkit-scrollbar-corner { background: transparent; }

/* 更细的窄条：日志区 / 回顾区 / 遮罩内容 */
.log-box::-webkit-scrollbar { width: 5px; }
.log-box::-webkit-scrollbar-thumb { border: 1px solid rgba(40, 10, 12, .85); }
.review-scroll::-webkit-scrollbar { width: 6px; }
.mask-box::-webkit-scrollbar { width: 6px; }
.lb-body::-webkit-scrollbar { width: 6px; }
html, body { height: 100%; }
body {
  background: #2a0d10;
  background-image:
    radial-gradient(1200px 620px at 50% -12%, #7a1f14 0%, #4a1210 40%, #2a0d10 75%);
  color: #ffe9dd;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  overflow-x: hidden;
}
#app { max-width: 500px; margin: 0 auto; min-height: 100%; position: relative; }
.view { padding: 16px; min-height: 100vh; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%;
  padding: 12px 16px; margin: 8px 0;
  background: #4a1820; border: 1px solid #8a3038; color: #ffd9c2;
  border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: center; line-height: 1.3;
  transition: transform .05s, background .15s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #ffd24d, #ff8a2a);
  border: none; color: #4a1506; font-size: 17px;
  box-shadow: 0 3px 10px rgba(255, 100, 20, .35);
}
.btn-primary:disabled { background: #5c4548; color: #a58a82; cursor: not-allowed; box-shadow: none; }
.btn-danger { background: #571f24; border-color: #a2343f; color: #ffb3a6; }
.btn-big { padding: 14px 16px; font-size: 16px; }
.btn-follow { background: #5c1d16; border-color: #c04a22; color: #ffcf9a; }

.home-hero { text-align: center; padding: 40px 0 10px; }
.home-title {
  font-size: 40px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(180deg, #ffe9a8, #ff7a2a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(255, 120, 30, .25);
}
.home-sub { color: #e6b9a4; margin: 10px 0 6px; font-size: 14px; }
.home-sub b { color: #ffc94d; }
.home-count { text-align: center; color: #e6b9a4; font-size: 13px; margin: 8px 0; }
.home-count b { color: #ffc94d; }
.home-bonus-line { text-align: center; color: #ffd58a; font-size: 12.5px; margin: 2px 0 18px; }
.home-btns { margin-top: 22px; }
.home-ach-row { display: flex; gap: 10px; }
.home-ach-row .btn { flex: 1; }
.home-link-btns { display: flex; gap: 10px; margin-top: 0; }
.home-link-btns .btn { flex: 1; background: #3c1518; }

.qr-area { text-align: center; margin: 14px auto 0; }
.qr-text { color: #caa796; font-size: 12px; margin-bottom: 6px; }
.qr-img { width: 180px; height: 180px; background: #fff; border-radius: 8px; padding: 6px; }

/* ---------- 游戏页 ---------- */
.game-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 2px; }
.game-age { font-size: 16px; font-weight: 800; color: #ffe0b0; }
.btn-pause {
  width: 42px; height: 42px; border-radius: 50%;
  background: #4a1820; border: 1px solid #8a3038; color: #ffd9c2; font-size: 17px; cursor: pointer;
}
.attr-line { color: #efc3b0; font-size: 13px; padding: 2px 0 12px; }
.life-tag { color: #ff9a76; }
.asset-box {
  background: linear-gradient(135deg, #4a1216, #6b1a12);
  border: 1px solid #a33a26; border-radius: 16px;
  padding: 16px 14px; margin: 2px 0 14px; text-align: center;
  box-shadow: inset 0 0 24px rgba(255, 120, 20, .08);
}
.asset-label { color: #f0b095; font-size: 12px; letter-spacing: 3px; }
.asset-val { font-size: 24px; font-weight: 900; color: #ffd24d; word-break: break-all; margin: 4px 0; }
.asset-sub { color: #ff9a3a; font-size: 13px; min-height: 16px; }

.log-box {
  background: #210708; border: 1px solid #571a1d; border-radius: 12px;
  padding: 8px 10px; max-height: 56vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.log-item { font-size: 12.8px; color: #f0c6b2; padding: 4px 2px; border-bottom: 1px dashed #4a1618; line-height: 1.45; }
.log-item.intro { color: #ffe9a8; font-weight: 700; background: #5a1c10; border-radius: 8px; padding: 8px; font-size: 14px; }
.log-item.work { color: #7fe0a8; }
.log-item.bg { color: #7fe0a8; }
.log-item.ev-good { color: #ffdf70; }
.log-item.ev-bad { color: #ff6b74; }
.log-item.ev-even { color: #f4c46a; }
.log-item.interest { color: #8fe0c0; }
.log-item.ev-start, .log-item.ev-invest { color: #ffd58a; }
.log-item.ev-r2 { color: #ffb0d0; }
.log-item.ev-r3 { color: #e6b0ff; }
.log-item.ev-r4 { color: #ffe44d; }
.log-item.year { color: #b07f70; }
.log-item.dead { color: #ff7b7b; font-weight: 700; }

/* ---------- 结算页 ---------- */
.settle-box { text-align: center; padding-top: 18px; }
.settle-title { font-size: 30px; font-weight: 900; margin: 10px 0 4px; }
.settle-title.god { color: #ffd24d; }
.settle-sub { color: #e6b9a4; font-size: 13px; margin-bottom: 16px; }
.settle-rows {
  background: #3a1012; border: 1px solid #7a2520; border-radius: 14px;
  padding: 6px 14px; margin: 0 auto 14px; text-align: left;
}
.s-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed #5a1a1c; }
.s-row:last-child { border-bottom: none; }
.s-row span { color: #e6b9a4; font-size: 13px; }
.s-row b { color: #ffe9dd; font-size: 13.5px; max-width: 64%; text-align: right; }
.settle-rank { color: #ffd24d; font-weight: 700; margin: 8px 0; }

/* ---------- 页面（排行/成就/说明） ---------- */
.page-view { padding-top: 6px; }
.page-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 10px; }
.page-title { font-size: 20px; }
.btn-close {
  width: 40px; height: 40px; border-radius: 50%;
  background: #4a1820; border: 1px solid #8a3038; color: #ffd9c2; font-size: 16px; cursor: pointer;
}
.tabs { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.tab {
  flex: 1; min-width: 64px; padding: 9px 4px;
  background: #3c1518; border: 1px solid #73251f; color: #f0c3a8;
  border-radius: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: center;
}
.tab.active { background: #7a2a16; border-color: #ffd24d; color: #ffe9a8; }
.tabs-small .tab { font-size: 12px; padding: 6px 2px; }

.lb-note { color: #ffd24d; font-size: 13px; margin: 8px 2px 6px; }
.lb-body { background: #25090b; border: 1px solid #521a1c; border-radius: 12px; overflow: hidden; }
.lb-row { display: flex; align-items: center; padding: 8px 10px; border-bottom: 1px solid #421316; gap: 8px; }
.lb-row:last-child { border-bottom: none; }
.lb-rank {
  width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 8px;
  background: #57202a; color: #ffd9c2; font-weight: 700; font-size: 13px; flex: none;
}
.lb-rank.top { background: #ff8a2a; color: #fff; }
.lb-rank.top.r1 { background: #ff3b30; }
.lb-rank.top.r2 { background: #ff9500; }
.lb-rank.top.r3 { background: #ffd24d; color: #513b00; }
.lb-user { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lb-avatar { width: 26px; height: 26px; border-radius: 50%; background: #7a2a16; flex: none; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ffe0cf; font-size: 13px; }
.lb-time { color: #b07f70; font-size: 11px; flex: none; }
.lb-score { color: #ffd24d; font-size: 13px; font-weight: 700; flex: none; }
.lb-tip { text-align: center; color: #b07f70; padding: 26px 10px; font-size: 14px; }

/* ---------- 成就 ---------- */
.ach-total { text-align: center; color: #ffd24d; font-size: 14px; padding: 10px 0 6px; }
.ach-list { display: flex; flex-direction: column; gap: 8px; }
.ach-item {
  display: flex; align-items: center; gap: 8px;
  background: #3a1012; border: 1px solid #7a2520; border-radius: 12px; padding: 10px 12px;
}
.ach-item.done { border-color: #ff9a3a; background: #4a1c0a; }
.ach-name { flex: none; color: #ffe9dd; font-weight: 700; }
.ach-need { flex: 1; color: #d19c84; font-size: 12px; text-align: right; }
.ach-bonus { flex: none; color: #ffd58a; font-size: 12.5px; min-width: 46px; text-align: right; }

/* ---------- 说明 ---------- */
.about-text { color: #f0cfbc; line-height: 1.75; font-size: 14.5px; }
.about-text b { color: #ffc94d; }

/* ---------- 遮罩 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 4, 6, .86);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.mask-box {
  background: #3d1114; border: 1px solid #a33a26; border-radius: 18px;
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
  padding: 20px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
.mask-title { font-size: 20px; font-weight: 900; text-align: center; margin-bottom: 10px; color: #ffe0b0; }
.mask-info { color: #efc3b0; font-size: 13px; text-align: center; margin: 6px 0 10px; }

/* 加点 */
.attr-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.attr-row {
  display: flex; align-items: center; gap: 10px;
  background: #521a1c; border-radius: 12px; padding: 8px 12px;
}
.attr-name { flex: 1; color: #ffe0cf; font-weight: 700; }
.attr-val { width: 56px; text-align: center; color: #ffd24d; font-size: 18px; font-weight: 900; }
.attr-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: #7a2a16; border: 1px solid #c05030; color: #fff; font-size: 18px; cursor: pointer;
}
.attr-remain { text-align: center; color: #efc3b0; font-size: 14px; margin: 6px 0 4px; }
.attr-remain b { color: #ffd24d; }
.extra-box { border-top: 1px dashed #a33a26; margin-top: 6px; padding-top: 4px; }
.extra-box .mask-info { color: #ffd58a; }

/* 抉择 */
.career-box .mask-title { margin-bottom: 0; }
.career-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.career-head .mask-title { margin: 0; }
.career-head .btn-close { width: 34px; height: 34px; flex: none; }
.career-list { display: flex; flex-wrap: wrap; gap: 10px; }
.career-btn { flex: 1 1 76px; white-space: nowrap; background: #4a1820; border: 2px solid transparent; margin: 0; }
.career-btn.active { border-color: #ffd24d; background: #7a2a16; color: #ffe9a8; }
.career-info {
  background: #2b0c0f; border-radius: 12px; padding: 12px;
  color: #f0c6b2; font-size: 13px; line-height: 1.7; text-align: center; margin: 12px 0 4px;
}
.career-info b { color: #ffd24d; }
.invest-bar {
  background: #2b0c0f; border-radius: 12px; padding: 10px 12px 12px;
  color: #f0c6b2; font-size: 13px; margin: 4px 0;
}
.invest-head { display: flex; align-items: center; justify-content: space-between; color: #efc3b0; font-size: 13px; }
.invest-head b { color: #ffd24d; font-size: 15px; }
.invest-range { width: 100%; margin: 4px 0 2px; accent-color: #ff8a2a; }
.invest-tip { color: #caa796; font-size: 12px; line-height: 1.5; text-align: left; }
.invest-tip b { color: #ffd58a; }

/* 暂停 */
.speed-row { display: flex; align-items: center; gap: 10px; color: #efc3b0; font-size: 13px; margin: 8px 0 12px; }
.speed-range { flex: 1; }

/* 回顾 */
.review-box { overflow: hidden; display: flex; flex-direction: column; }
.review-box .mask-title { flex: none; }
.review-box .btn { flex: none; }
.review-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 2px; }
.review-chart { margin-bottom: 10px; flex: none; }
.review-box .review-log { background: #24080a; border: 1px solid #571a1d; border-radius: 10px; padding: 10px; }
.review-box .review-log div { font-size: 12.5px; padding: 2px 0; color: #f0c6b2; line-height: 1.5; }
.rv-intro { color: #ffe9a8 !important; font-weight: 700; }
.rv-ev-good, .rv-ev-r4 { color: #ffdf70 !important; }
.rv-ev-bad { color: #ff6b74 !important; }
.rv-work { color: #7fe0a8 !important; }
.rv-bg { color: #7fe0a8 !important; }
.rv-interest { color: #8fe0c0 !important; }
.rv-ev-start, .rv-ev-invest { color: #ffd58a !important; }
.rv-dead { color: #ff7b7b !important; font-weight: 700 !important; }

/* 关注引导 */
.follow-rows { display: flex; flex-direction: column; gap: 8px; }
.follow-action { display: flex; justify-content: space-between; align-items: center; background: #4a1820; }
.fb-state { font-size: 12.5px; }
.fb-state.todo { color: #b07f70; }
.fb-state.done { color: #7fe0a8; }
.fb-total { font-weight: 700; }

/* 成就 toast */
.ach-toast {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  background: linear-gradient(90deg, #7a2a16, #a33a26);
  color: #ffe9a8; text-align: center; font-weight: 700; font-size: 14px;
  padding: 12px; transform: translateY(-100%); transition: transform .3s;
}
.ach-toast.show { transform: translateY(0); }

/* ---------- 设置页 ---------- */
.settings-body { display: flex; flex-direction: column; gap: 10px; }
.set-card { background: #3a1012; border: 1px solid #7a2520; border-radius: 12px; padding: 12px 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; color: #ffe0cf; font-size: 15px; }
.set-label { font-weight: 700; }
.set-switch { position: relative; display: inline-block; }
.set-switch input { width: 0; height: 0; opacity: 0; }
.set-switch .track {
  display: inline-block; width: 44px; height: 24px; border-radius: 24px;
  background: #6d2a2a; position: relative; cursor: pointer; transition: background .2s;
  vertical-align: middle;
}
.set-switch .track::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #ffe0cf; transition: transform .2s;
}
.set-switch input:checked + .track { background: #ff8a2a; }
.set-switch input:checked + .track::after { transform: translateX(20px); }
.set-tip { color: #d19c84; font-size: 12px; margin-top: 8px; }
.speed-label { display: flex; justify-content: space-between; color: #ffe0cf; font-size: 15px; margin-bottom: 10px; }
.speed-label b { color: #ffd24d; }
.speed-range { width: 100%; accent-color: #ff8a2a; }

/* ---------- 玩家等级 / 自动手动 / 开场 ---------- */
.home-lv {
  background: #3a1012; border: 1px solid #7a2520; border-radius: 12px;
  padding: 10px 14px; margin: 6px 0 8px;
}
.lv-head { display: flex; align-items: center; gap: 8px; }
.lv-name { color: #e6b9a4; font-size: 13px; }
.lv-lv { color: #ffd24d; font-size: 17px; font-weight: 900; }
.lv-bonus { color: #ffb87a; font-size: 11.5px; flex: 1; text-align: right; }
.lv-bar { height: 8px; background: #7a2520; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.lv-bar-fill { height: 100%; background: linear-gradient(90deg, #ff8a2a, #ffd24d); border-radius: 4px; transition: width .3s; }
.lv-exp-line { color: #e6b9a4; font-size: 12px; text-align: right; margin-top: 4px; }

.mode-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: #efc3b0; font-size: 14px; margin: 6px 0;
  background: #3a1012; padding: 8px; border-radius: 10px; border: 1px solid #7a2520;
}
.mode-row input { width: 18px; height: 18px; accent-color: #ff8a2a; }
.pause-mode { margin: 4px 0 10px; }

.manual-bar { margin-top: 10px; }
.manual-tip { text-align: center; color: #e6b9a4; font-size: 12px; margin-bottom: 6px; }

.intro-text { font-size: 15px; line-height: 1.9; padding: 6px 2px; color: #ffe0cf; text-align: left; }

/* ---------- 游戏主界面：第一行 总资产/寿元，第二行 四维 ---------- */
.top-cols { display: flex; gap: 10px; margin: 6px 0 10px; }
.col {
  flex: 1; min-width: 0;
  background: linear-gradient(135deg, #4a1216, #5e1a10);
  border: 1px solid #a33a26; border-radius: 14px;
  padding: 10px 8px; text-align: center;
}
.col-label { font-size: 11.5px; color: #e6b9a4; letter-spacing: 2px; margin-bottom: 4px; }
.col-val { font-size: 15px; color: #ffd24d; font-weight: 800; word-break: break-all; line-height: 1.3; }
.col-life .col-val { font-size: 21px; color: #8fe0a8; font-weight: 900; }

.attr-grid { display: flex; gap: 8px; margin: 0 0 12px; }
.attr-cell {
  flex: 1; min-width: 0;
  background: #3a1012; border: 1px solid #7a2520; border-radius: 12px;
  padding: 7px 2px; text-align: center;
}
.a-name { display: block; color: #e6b9a4; font-size: 11px; margin-bottom: 2px; }
.attr-cell b { color: #ffe0b0; font-size: 16px; font-weight: 800; word-break: break-all; }

@media (min-width: 520px) {
  .view { padding-top: 26px; }
}
