/* ============================================================
   会员端公共样式
   PC 版与手机版共用这份基础层（变量 / reset / 球 / 按钮 / 表单），
   布局差异分别写在 pc.css 与 m.css，两者互不覆盖。
   ============================================================ */

:root {
  --c-primary: #d32f2f;
  --c-primary-dark: #b71c1c;
  --c-primary-light: #ffebee;
  --c-red: #e53935;
  --c-blue: #1e88e5;
  --c-green: #43a047;
  --c-orange: #f57c00;
  --c-purple: #8e24aa;

  --c-text: #1f2329;
  --c-text-sub: #646a73;
  --c-text-weak: #8f959e;
  --c-border: #e5e6eb;
  --c-bg: #f5f6f7;
  --c-bg-card: #ffffff;
  --c-bg-hover: #f2f3f5;

  --c-success: #00b42a;
  --c-warning: #ff7d00;
  --c-danger: #f53f3f;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
img { border: 0; vertical-align: middle; }

/* 数字统一用等宽，金额和号码列对齐时才不会跳 */
.num, .money, .ball, .countdown {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
}
.card-bd { padding: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-text);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--c-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn.is-disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-text-sub); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--c-text-sub);
}
.input, .select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--c-text);
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--c-primary); }
.input::placeholder { color: var(--c-text-weak); }

/* ---------- 号码球 ---------- */
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text-sub);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .12s;
}
.ball:hover { border-color: currentColor; }
.ball.is-on {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.ball.is-dan {
  color: #fff;
  border-color: transparent;
  position: relative;
}
/* 胆码右上角打点，和普通选中区分开 */
.ball.is-dan::after {
  content: '胆';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 15px;
  height: 15px;
  line-height: 15px;
  border-radius: 50%;
  background: #ff7d00;
  color: #fff;
  font-size: 9px;
  text-align: center;
}
.ball.is-disabled { opacity: .35; pointer-events: none; }

/* 只读展示用的小球（开奖号码、注单明细） */
.ball-view {
  width: 26px;
  height: 26px;
  font-size: 12px;
  cursor: default;
  color: #fff;
  border: 0;
}
.ball-view:hover { border-color: transparent; }
.ball-red   { background: var(--c-red); }
.ball-blue  { background: var(--c-blue); }
.ball-green { background: var(--c-green); }
.ball-gray  { background: #c9cdd4; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.table th {
  background: #fafbfc;
  color: var(--c-text-sub);
  font-weight: 500;
  white-space: nowrap;
}
.table tbody tr:hover { background: var(--c-bg-hover); }
.table .ta-r { text-align: right; }
.table .ta-c { text-align: center; }

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 18px;
}
.tag-gray   { background: #f2f3f5; color: var(--c-text-sub); }
.tag-green  { background: #e8ffea; color: var(--c-success); }
.tag-red    { background: #ffece8; color: var(--c-danger); }
.tag-orange { background: #fff7e8; color: var(--c-warning); }
.tag-blue   { background: #e8f3ff; color: #165dff; }

/* ---------- 金额涨跌色 ---------- */
.up   { color: var(--c-danger); }
.down { color: var(--c-success); }
.mute { color: var(--c-text-weak); }

/* ---------- 空状态 / 加载 ---------- */
.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--c-text-weak);
  font-size: 13px;
}
.loading {
  padding: 32px;
  text-align: center;
  color: var(--c-text-weak);
  font-size: 13px;
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 轻提示 ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  z-index: 9999;
  display: none;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 14px;
  text-align: center;
  word-break: break-all;
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  background: rgba(0, 0, 0, .45);
}
.modal-mask.is-open { display: block; }
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 520px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
}
.modal-bd { padding: 16px; overflow-y: auto; flex: 1; }
.modal-ft {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
}
.modal-close {
  border: 0;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--c-text-weak);
  cursor: pointer;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-size: 13px;
  color: var(--c-text-sub);
}

/* ---------- 通用间距 ---------- */
.mt8  { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.hide { display: none !important; }
