/* =============================================================
   《我是大矿工》矿金黄主题
   主色: 矿金黄 #FFD124 / 深矿黑 #1A1203 / 矿石灰 #6B6359
   金属银 #D0D0D0 / 预警红 #E53935 / 安全绿 #34C759
   ============================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --gold: #ffd124; --gold-deep: #f5b800; --black: #1a1203; --card: #221a08;
  --gray: #6b6359; --silver: #d0d0d0; --red: #e53935; --green: #34c759;
  --line: rgba(255, 209, 36, 0.35);
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--black); color: #f5edd8;
  overflow: hidden; user-select: none;
  max-width: 540px; margin: 0 auto;
}
button { font-family: inherit; border: none; cursor: pointer; }
input { font-family: inherit; }
.gold { color: var(--gold); font-weight: 700; }
.dim { color: #9a8f78; font-size: 12px; }
.empty-tip { text-align: center; color: #9a8f78; padding: 16px; font-size: 13px; }

/* ---------------- 按钮分级 ---------------- */
.btn1 {
  background: var(--gold); color: #1a1203; font-weight: 800;
  border-radius: 12px; padding: 12px 20px; font-size: 15px;
  box-shadow: 0 0 12px rgba(255, 209, 36, 0.35), inset 0 -2px 0 rgba(0,0,0,0.15);
}
.btn1:active { transform: scale(0.96); }
.btn1.big { width: 100%; padding: 15px; font-size: 17px; border-radius: 14px; }
.btn1.sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn1:disabled { opacity: 0.45; }
.btn2 {
  background: #3a3226; color: var(--gold); font-weight: 600;
  border-radius: 12px; padding: 12px 20px; font-size: 14px;
  border: 1px solid rgba(255, 209, 36, 0.25);
}
.btn2.sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn2:disabled { opacity: 0.45; }
.btn-danger {
  background: linear-gradient(135deg, #e53935, #f5b800); color: #fff; font-weight: 800;
  border-radius: 12px; padding: 12px 20px;
}
.btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.btn-row > button { flex: 1; }

/* ---------------- 启动页 ---------------- */
#splash-view {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #2e2206 0%, #1a1203 65%);
  transition: opacity 0.6s;
}
#splash-view.fade { opacity: 0; }
.splash-ores i {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  background: var(--gold); opacity: 0.7; top: -20px;
  animation: oreFall linear infinite;
}
.splash-ores i:nth-child(1) { left: 12%; animation-duration: 5s; animation-delay: 0s; }
.splash-ores i:nth-child(2) { left: 28%; animation-duration: 7s; animation-delay: 1s; width: 5px; height: 5px; }
.splash-ores i:nth-child(3) { left: 45%; animation-duration: 6s; animation-delay: 2.2s; }
.splash-ores i:nth-child(4) { left: 63%; animation-duration: 8s; animation-delay: 0.6s; width: 6px; height: 6px; }
.splash-ores i:nth-child(5) { left: 78%; animation-duration: 5.5s; animation-delay: 1.8s; }
.splash-ores i:nth-child(6) { left: 90%; animation-duration: 7.5s; animation-delay: 3s; width: 5px; height: 5px; }
@keyframes oreFall { to { transform: translateY(110vh) rotate(300deg); } }
.splash-logo { text-align: center; }
.splash-drill { width: 120px; filter: drop-shadow(0 0 24px rgba(255, 209, 36, 0.6)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.splash-title {
  font-size: 42px; font-weight: 900; color: var(--gold); letter-spacing: 4px;
  text-shadow: 0 0 18px rgba(255, 209, 36, 0.55), 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000;
  margin-top: 8px;
}
.splash-sub { color: #b3a67f; font-size: 14px; letter-spacing: 6px; margin-top: 10px; }
.splash-progress {
  width: 220px; height: 8px; border-radius: 4px; background: #3a3226;
  margin-top: 46px; overflow: hidden; border: 1px solid rgba(255, 209, 36, 0.3);
}
#splash-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width 0.4s; border-radius: 4px; }
#splash-tip { margin-top: 12px; color: #9a8f78; font-size: 12px; }

/* ---------------- 登录页 ---------------- */
#login-view {
  min-height: 100vh; padding: 9vh 26px 30px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%, #2e2206 0%, #1a1203 70%);
}
.login-logo { text-align: center; }
.login-logo img { width: 92px; filter: drop-shadow(0 0 18px rgba(255, 209, 36, 0.5)); }
.login-title {
  font-size: 34px; font-weight: 900; color: var(--gold); letter-spacing: 3px;
  text-shadow: 0 0 14px rgba(255, 209, 36, 0.5), 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000;
}
.login-card {
  margin-top: 30px; background: #26201a; border-radius: 18px; padding: 24px 20px;
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.field { margin-bottom: 14px; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid #4a4234;
  background: #332c22; color: #fff; font-size: 15px; outline: none; caret-color: var(--gold);
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 209, 36, 0.2); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn1 { white-space: nowrap; }
#btn-sms-login { margin: 6px 0 12px; }
#btn-guest { width: 100%; }
.login-link { text-align: center; color: #9a8f78; font-size: 13px; margin-top: 16px; cursor: pointer; }
.login-compliance {
  text-align: center; color: #8a7f66; font-size: 11px; line-height: 1.8; margin-top: 26px;
}
.login-compliance.in-app { padding-bottom: 20px; }

/* ---------------- 游戏框架 ---------------- */
#game-view { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
  background: linear-gradient(180deg, #2e2206, #221a08);
  border-bottom: 1px solid var(--line);
}
.hud-user { display: flex; align-items: center; gap: 8px; }
.hud-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #1a1203; font-weight: 900; display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255, 209, 36, 0.6); font-size: 15px;
}
.hud-avatar.big { width: 58px; height: 58px; font-size: 22px; }
.hud-nick { color: var(--gold); font-weight: 700; font-size: 14px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-uid { color: #8a7f66; font-size: 10px; }
.hud-assets { display: flex; align-items: center; gap: 8px; }
.hud-item { font-size: 13px; color: #f5edd8; }
.hud-item b { color: var(--gold); margin-left: 2px; font-size: 13px; }
.hud-item.gem b { color: #7ee0ff; }
.hud-bell {
  position: relative; background: none; font-size: 17px; padding: 2px;
}
.hud-bell i {
  position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff;
  font-size: 9px; font-style: normal; min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

#pages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tab-page { padding: 12px 12px 90px; min-height: 100%; }

#navbar {
  display: flex; background: #221a08; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; background: none; color: #8a7f66; font-size: 11px; padding: 7px 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-btn i { font-style: normal; font-size: 21px; filter: grayscale(0.7); }
.nav-btn.active { color: var(--gold); font-weight: 700; }
.nav-btn.active i { filter: none; }

/* ---------------- 首页 ---------------- */
#home-stage { position: relative; height: 340px; border-radius: 16px; overflow: hidden; background: #14100a; border: 1px solid var(--line); }
#home-canvas { position: absolute; inset: 0; }
.stage-overlay { position: absolute; top: 10px; left: 0; right: 0; text-align: center; pointer-events: none; }
.drill-name {
  display: inline-block; background: rgba(26, 18, 3, 0.75); color: var(--gold);
  font-weight: 800; font-size: 15px; padding: 6px 16px; border-radius: 20px;
  border: 1px solid var(--line);
}
.home-status { margin-top: 8px; font-size: 15px; font-weight: 700; text-shadow: 0 2px 4px #000; }
.home-status.running { color: var(--gold); animation: glowText 1.6s ease-in-out infinite; }
.home-status.stopped { color: #ff6655; }
@keyframes glowText { 50% { text-shadow: 0 0 14px rgba(255, 209, 36, 0.9); } }
.dots i { animation: dotB 1.2s infinite; font-style: normal; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotB { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }
.stage-floats { position: absolute; right: 10px; top: 64px; display: flex; flex-direction: column; gap: 10px; }
.float-btn {
  background: rgba(26, 18, 3, 0.8); border: 1px solid var(--line); color: var(--gold);
  border-radius: 12px; padding: 8px 10px; font-size: 11px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 20px;
}
.float-btn span { font-size: 10px; }

.fuel-bar {
  position: relative; height: 22px; background: #332c22; border-radius: 11px; margin-top: 12px;
  overflow: hidden; border: 1px solid #4a4234;
}
.fuel-bar .fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width 0.5s; border-radius: 11px; }
.fuel-bar .fill.low { background: linear-gradient(90deg, #e53935, #ff7043); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
.fuel-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.cycle-text { text-align: center; color: #b3a67f; font-size: 12px; margin-top: 6px; }

.start-btn {
  width: 100%; margin-top: 14px; padding: 17px; border-radius: 16px; font-size: 19px; font-weight: 900;
  letter-spacing: 2px; transition: transform 0.1s;
}
.start-btn:active { transform: scale(0.97); }
.start-btn.off { background: var(--gold); color: #1a1203; box-shadow: 0 0 18px rgba(255, 209, 36, 0.45), inset 0 -3px 0 rgba(0,0,0,0.15); }
.start-btn.on { background: #3a3226; color: var(--gold); border: 1px solid var(--line); }
.start-btn.repair { background: linear-gradient(135deg, #e53935, #f5b800); color: #fff; }

.quick-row { display: flex; gap: 8px; margin-top: 14px; }
.qb {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  color: var(--gold); font-size: 19px; padding: 10px 0; display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.qb span { font-size: 11px; color: #d8cba8; }

.today-card, .cycle-card, .field-card, .me-card, .tip-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 12px;
}
.today-title, .card-title { color: var(--gold); font-weight: 800; font-size: 14px; }
.today-vals { display: flex; justify-content: space-around; margin-top: 12px; }
.today-vals > div { display: flex; flex-direction: column; align-items: center; font-size: 17px; }
.today-vals b { color: var(--gold); font-size: 19px; }
.today-vals span { color: #8a7f66; font-size: 11px; }

.rc-item { display: flex; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px dashed rgba(255, 209, 36, 0.12); font-size: 12px; color: #b3a67f; }
.rc-item:last-child { border-bottom: none; }
.rc-item b { margin-left: auto; font-size: 13px; }
.rc-normal b { color: #d8cba8; }
.rc-good b { color: var(--green); }
.rc-gem b { color: #7ee0ff; }
.rc-bad b { color: var(--red); }

/* ---------------- 背包 ---------------- */
.page-title {
  color: var(--gold); font-weight: 900; font-size: 18px; margin: 6px 0 12px;
  text-shadow: 0 0 10px rgba(255, 209, 36, 0.3);
}
.drill-card { background: var(--card); border: 1px solid #4a4234; border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.drill-card.equipped { border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 209, 36, 0.25); }
.drill-card.is-broken { opacity: 0.75; }
.dc-head { display: flex; align-items: center; gap: 10px; }
.dc-head img { width: 52px; height: 52px; }
.dc-head > div { flex: 1; }
.dc-name { font-weight: 800; font-size: 15px; color: #f5edd8; }
.dc-sub { color: #9a8f78; font-size: 12px; margin-top: 2px; }
.tag { font-style: normal; font-size: 10px; padding: 3px 8px; border-radius: 8px; }
.tag.run { background: rgba(52, 199, 89, 0.18); color: var(--green); }
.tag.idle { background: rgba(154, 143, 120, 0.15); color: #9a8f78; }
.tag.broken { background: rgba(229, 57, 53, 0.18); color: var(--red); }
.tag.eq { background: rgba(255, 209, 36, 0.18); color: var(--gold); margin-left: 4px; }
.tag.soon { background: rgba(255, 209, 36, 0.15); color: var(--gold); font-size: 10px; }
.dc-info { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; font-size: 12px; color: #b3a67f; }
.dc-btns { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.gem-row { display: flex; gap: 10px; margin-top: 10px; }
.gem-chip {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid; border-radius: 12px; padding: 10px 4px; font-size: 11px;
}
.gem-chip i { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.gem-chip b { font-size: 14px; }
.tip-card { color: #9a8f78; font-size: 12px; line-height: 1.7; }

/* ---------------- 矿场 ---------------- */
.mult-row { display: flex; gap: 8px; margin-top: 10px; }
.mult-btn {
  flex: 1; background: #332c22; border: 1px solid #4a4234; border-radius: 12px;
  padding: 10px 4px; color: #d8cba8; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.mult-btn b { font-size: 20px; font-weight: 900; }
.mult-btn span { font-size: 11px; }
.mult-btn i { font-size: 9px; color: #8a7f66; font-style: normal; }
.mult-btn.active { background: linear-gradient(180deg, rgba(255, 209, 36, 0.25), rgba(255, 209, 36, 0.08)); border-color: var(--gold); color: var(--gold); }
.mult-btn.locked { opacity: 0.45; }
.mult-btn:nth-child(4) b { color: var(--gold); }
.card-desc { color: #9a8f78; font-size: 12px; margin: 8px 0 12px; line-height: 1.6; }
.card-tip { color: #8a7f66; font-size: 11px; margin-top: 8px; }
.card-title .right { float: right; font-weight: 400; color: #b3a67f; font-size: 12px; }
.card-title .right b { color: var(--gold); }
.field-card.blind { background: linear-gradient(160deg, #2e2206, #221a08); }
.fortune-now { margin: 10px 0; font-size: 14px; }
.fortune-now b { font-size: 20px; margin-right: 8px; }
.luck-1 { color: #9a8f78; } .luck-2 { color: #d8cba8; } .luck-3 { color: var(--gold); } .luck-4 { color: #ff9d0a; }
.luck-big { font-size: 42px; font-weight: 900; text-align: center; margin: 16px 0 6px; }
.buff-tip { background: rgba(255, 209, 36, 0.12); border: 1px solid var(--line); color: var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 12px; margin-top: 12px; }
.field-card.locked { opacity: 0.55; }

/* 盲矿结果弹窗 */
.bd-body { text-align: center; padding: 10px 0; }
.bd-ore { font-size: 34px; font-weight: 900; color: var(--gold); text-shadow: 0 0 14px rgba(255, 209, 36, 0.5); }
.bd-gem { font-size: 18px; color: #7ee0ff; margin-top: 8px; font-weight: 700; }
.bd-loss { color: var(--red); margin-top: 8px; font-size: 14px; }
.bd-left { color: #9a8f78; font-size: 12px; margin-top: 10px; }
.bd-tip { text-align: center; color: #8a7f66; font-size: 11px; margin-top: 12px; }

/* ---------------- 商城 ---------------- */
.mall-head {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px;
}
.mall-head > div { flex: 1; }
.mall-head b { color: var(--gold); font-size: 17px; }
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goods-card { background: var(--card); border: 1px solid #4a4234; border-radius: 14px; padding: 12px; text-align: center; }
.goods-img { width: 64px; height: 64px; }
.goods-emoji { font-size: 44px; }
.goods-title { font-weight: 700; font-size: 13px; margin-top: 8px; }
.goods-sub { color: #8a7f66; font-size: 10px; margin-top: 3px; }
.goods-cost { color: var(--gold); font-weight: 800; font-size: 14px; margin: 8px 0; }
.goods-cost.ore { font-size: 13px; }
.tier-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.tier-btn {
  background: #332c22; border: 1px solid var(--line); border-radius: 12px; padding: 12px 4px;
  color: #f5edd8; display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.tier-btn b { color: var(--gold); font-size: 17px; }
.tier-btn span { font-size: 11px; }

/* ---------------- 我的 ---------------- */
.me-card { display: flex; align-items: center; gap: 14px; }
.me-nick { font-size: 19px; font-weight: 800; color: var(--gold); }
.me-sub { color: #9a8f78; font-size: 12px; margin-top: 4px; }
.me-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 13px; color: #d8cba8; }
.me-menu { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.me-item {
  width: 100%; background: none; color: #f5edd8; text-align: left; padding: 15px 14px;
  font-size: 14px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255, 209, 36, 0.08);
}
.me-item:last-child { border-bottom: none; }
.me-item span { color: #8a7f66; font-size: 11px; }
.me-item.danger { color: var(--red); }

/* ---------------- 通用弹窗 ---------------- */
#modal-root { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 24px; }
.mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.modal-card {
  position: relative; width: 100%; max-width: 420px; max-height: 82vh; overflow-y: auto;
  background: var(--black); border: 1px solid var(--gold); border-radius: 16px; padding: 20px;
  box-shadow: 0 0 30px rgba(255, 209, 36, 0.15);
}
.modal-close {
  position: absolute; top: 10px; right: 10px; background: none; color: #8a7f66; font-size: 16px; padding: 6px;
}
.m-title { color: var(--gold); font-size: 18px; font-weight: 900; text-align: center; margin-bottom: 10px; }
.m-title.red { color: var(--red); }
.m-desc { color: #b3a67f; font-size: 13px; line-height: 1.8; text-align: center; }
.m-list { margin-top: 8px; max-height: 55vh; overflow-y: auto; }
.li-head { color: var(--gold); font-size: 12px; font-weight: 700; margin: 14px 0 6px; }
.li-item { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed rgba(255, 209, 36, 0.12); font-size: 12px; color: #b3a67f; }
.li-item b { margin-left: auto; }
.li-item .up { color: var(--green); }
.li-item .down { color: var(--red); }
.st-review { color: #9a8f78; font-style: normal; }
.st-shipped { color: var(--gold); font-style: normal; }
.st-done { color: var(--green); font-style: normal; }
.mail-item { padding: 10px; border-bottom: 1px dashed rgba(255, 209, 36, 0.12); cursor: pointer; }
.mail-item b { color: var(--gold); font-size: 13px; }
.mail-item p { color: #b3a67f; font-size: 12px; margin-top: 4px; line-height: 1.5; }
.mail-item.read { opacity: 0.5; }
.compliance p { color: #b3a67f; font-size: 12px; line-height: 2; }
.compliance b { color: var(--gold); }
.input {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid #4a4234;
  background: #332c22; color: #fff; font-size: 14px; margin-top: 10px; outline: none; caret-color: var(--gold);
}
.input:focus { border-color: var(--gold); }

/* ---------------- Toast & 公告 ---------------- */
#toast-box { position: fixed; top: 18%; left: 0; right: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(26, 18, 3, 0.92); border: 1px solid var(--line); color: #f5edd8;
  padding: 10px 20px; border-radius: 22px; font-size: 13px; opacity: 0; transform: translateY(-8px);
  transition: all 0.3s; max-width: 86%; text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; transform: none; }
.toast-success { border-color: var(--gold); color: var(--gold); }
.toast-warn { border-color: #ff9d0a; color: #ffb340; }
.toast-error { border-color: var(--red); color: #ff8a80; }
#announce-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 350; background: linear-gradient(90deg, rgba(245, 184, 0, 0.95), rgba(255, 209, 36, 0.95));
  color: #1a1203; font-weight: 700; font-size: 13px; text-align: center; padding: 10px;
  transform: translateY(-110%); transition: transform 0.4s;
}
#announce-bar.show { transform: none; }

/* PC 端居中窄屏 */
@media (min-width: 541px) {
  body { box-shadow: 0 0 60px rgba(0, 0, 0, 0.8); }
  #home-stage { height: 380px; }
}
