/**
 * base.css —— reset、排版、#app 容器、通用卡片/按钮、toast、info 气泡。
 * 响应式断点（设计 §7.2）：≤480px 手机全宽；>480px 桌面居中型（手机宽卡片）。
 */
*, *::before, *::after { box-sizing: border-box; }

/* 防御宿主 App（如安卓端哔哩哔哩 WebView）强制缩放网页文字，导致元素拥挤错位；
   iOS 端本就不缩放，此属性为 no-op，不影响 iPhone 排版 */
html, body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink-1);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: break-word; /* 防长英文/URL 撑破容器；中文无视觉影响 */
}

#app {
  min-height: 100vh;
  background: var(--card);
}

@media (max-width: 480px) {
  #app { width: 100%; }
}

@media (min-width: 481px) {
  #app {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--shadow-2);
  }
}

/* 通用卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-1);
}

/* 主按钮 */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--c-a);
  color: #fff;
  border: none;
  border-radius: var(--r-s);
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
}
.btn-primary:active { opacity: .9; }

/* 兜底空态 */
.page-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
}

/* ===== toast（替代 wx.showToast） ===== */
.oc-toast-host {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.oc-toast {
  background: rgba(26, 26, 30, .92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  max-width: 88vw;
  text-align: center;
  opacity: 1;
  transition: opacity .25s ease, transform .25s ease;
}
.oc-toast--hide { opacity: 0; transform: translateY(8px); }

/* ===== ⓘ 解释气泡（设计 §7.5） ===== */
.oc-info-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.oc-info-bubble {
  background: #fff;
  color: var(--ink-1);
  border-radius: var(--r-m);
  padding: 16px;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--shadow-2);
}

/* ===== 表单控件归一（HTML input/select/button 对齐小程序观感） ===== */
input, select, textarea, button {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
  color: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; }
button { cursor: pointer; }
/* 去掉数字框默认上下箭头，靠右对齐更像小程序文本输入 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
