/* app.css — 全局样式（自小程序 app.wxss 平移，rpx→px 按 1rpx=0.5px 换算） */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: #F5F6FA;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  color: #2C2C2A;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body { max-width: 750px; margin: 0 auto; }

/* v25.3（2026-09-13）：吞噬天帝游戏视图需满屏宽——解除门户页窄宽限制。
   原因：body max-width:750px 是给「认知/阅读类」门户页设计的，意外把游戏视图也夹成窄列，
   导致主界面下方拍板（养成/天帝之位/六灵根）只占左半、右侧大片空白。游戏视图激活时解锁。 */
body:has(#viewPlay.on) { max-width: none; margin: 0; }

.container { padding: 12px 16px 30px; }

/* ===== 顶部导航（对应小程序 navigationBar #1B1B2F） ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #1B1B2F; color: #fff;
  padding: 10px 16px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
.topbar .brand {
  font-weight: 700; font-size: 15px; margin-right: 10px; white-space: nowrap;
  color: #fff; text-decoration: none;
}
.topbar a.nav-link {
  color: #C9C7D9; text-decoration: none; font-size: 12.5px;
  padding: 4px 9px; border-radius: 12px; white-space: nowrap;
}
.topbar a.nav-link:hover { background: #2B2B45; color: #fff; }
.topbar a.nav-link.active { background: #534AB7; color: #fff; }
.topbar .lang-toggle {
  margin-left: auto; cursor: pointer; user-select: none;
  background: #534AB7; color: #fff; border: none;
  border-radius: 12px; padding: 5px 12px; font-size: 12.5px; font-weight: 600;
}
.topbar .lang-toggle:hover { opacity: 0.85; }

/* ===== 卡片体系 ===== */
.card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}
.card-title {
  font-size: 16px; font-weight: 600; color: #1B1B2F;
  margin-bottom: 8px; display: flex; align-items: center;
}
.card-title::before {
  content: ''; display: inline-block; width: 4px; height: 16px;
  background: #534AB7; border-radius: 2px; margin-right: 8px; flex: none;
}
.card-sub { font-size: 12px; color: #888780; margin-bottom: 10px; line-height: 1.6; }

.btn-primary {
  background: linear-gradient(135deg, #534AB7, #7F77DD);
  color: #FFFFFF; border: none; cursor: pointer;
  border-radius: 8px; font-size: 15px; font-weight: 500;
  padding: 11px 0; width: 100%;
  text-align: center; margin: 8px 0; display: inline-block;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled, .btn-primary.disabled { opacity: 0.5; pointer-events: none; }

.btn-secondary {
  background: #F1EFE8; color: #444441; border: none; cursor: pointer;
  border-radius: 8px; font-size: 14px; padding: 9px 0; width: 100%;
  text-align: center; margin: 6px 0; display: inline-block;
}
.btn-secondary:hover { opacity: 0.85; }
.btn-disabled { opacity: 0.5; pointer-events: none; }

/* ===== 状态条 ===== */
.status-bar {
  display: flex; align-items: center;
  padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: 4px 0 12px;
}
.status-idle    { background: #F1EFE8; color: #5F5E5A; }
.status-running { background: #E6F1FB; color: #185FA5; }
.status-success { background: #E1F5EE; color: #0F6E56; }
.status-error   { background: #FCEBEB; color: #A32D2D; }

.loading-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #185FA5; margin-right: 6px; animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.muted  { color: #888780; }
.faint  { color: #A8A6A0; font-size: 12px; }
.accent { color: #534AB7; font-weight: 600; }
.hidden { display: none; }

/* 通用空态 / 提示 */
.empty-tip { padding: 18px 12px; text-align: center; color: #888780; font-size: 13px; line-height: 1.7; }
.retry-btn { margin-top: 8px; }

/* 通用输入 */
.input-row input, .input-row textarea, .input, textarea {
  width: 100%; border: 1px solid #E3E1DA; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; background: #FAFAF8; color: #2C2C2A;
  outline: none; font-family: inherit;
}
.input-row input:focus, textarea:focus { border-color: #534AB7; }

/* A股颜色纪律：涨红 / 跌绿 / 平灰 */
.up   { color: #C0392B; }
.down { color: #1E8449; }
.flat { color: #888780; }

/* 页面主容器 */
.page-container { padding: 12px 16px 40px; }

/* ============ layer-page 共享组件（wx.showToast / wx.showLoading / live-status 平移） ============ */
.lp-loading {
  position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
}
.lp-loading-box {
  background: rgba(255,255,255,0.96); color: #333; border-radius: 10px;
  padding: 14px 22px; font-size: 14px; box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}
#lp-toast {
  position: fixed; left: 50%; bottom: 14vh; transform: translateX(-50%);
  z-index: 9999; max-width: 80vw; background: rgba(0,0,0,0.78); color: #fff;
  border-radius: 8px; padding: 10px 16px; font-size: 13px; line-height: 1.6;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
#lp-toast.show { opacity: 1; }

/* 各云调用页自建 toast（lg-toast / ep-toast / ta-toast / mb-toast）与 lp-toast 同款 */
#lg-toast, #ep-toast, #ta-toast, #mb-toast {
  position: fixed; left: 50%; bottom: 14vh; transform: translateX(-50%);
  z-index: 9999; max-width: 80vw; background: rgba(0,0,0,0.78); color: #fff;
  border-radius: 8px; padding: 10px 16px; font-size: 13px; line-height: 1.6;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
#lg-toast.show, #ep-toast.show, #ta-toast.show, #mb-toast.show { opacity: 1; }
