:root {
  --red: #d9342b;
  --red-soft: #fdeceb;
  --blue: #2b6fd6;
  --blue-soft: #e8f0fd;
  --brand: #c81e28;
  --bg: #f2f3f5;
  --card: #ffffff;
  --line: #e6e8ec;
  --text: #1f2328;
  --muted: #7a828e;
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body { max-width: 720px; margin: 0 auto; padding-bottom: 40px; }

.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand); color: #fff;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.site-row { display: flex; align-items: center; gap: 8px; }
.site-row label { font-size: 13px; opacity: .9; white-space: nowrap; }
.site-row input {
  flex: 1; border: none; border-radius: 8px;
  padding: 8px 10px; font-size: 14px; background: rgba(255,255,255,.92); color: #1f2328;
}
.date-row { margin-top: 6px; font-size: 12px; opacity: .85; }

.org-tabs { display: flex; gap: 10px; padding: 12px 16px 4px; }
.org-tabs button {
  flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); font-size: 16px; font-weight: 600;
}
.org-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

main { padding: 0 16px; }

.game-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: left;
}
.game-card h3 { margin: 0 0 4px; font-size: 16px; }
.game-card p { margin: 0; font-size: 12px; color: var(--muted); }
.game-card:active { border-color: var(--brand); }

.picker {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-top: 14px;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.picker-head h2 { margin: 0; font-size: 18px; }
.picker-head .close { border: none; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.picker-note { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.zone { margin-bottom: 14px; }
.zone-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.zone-head .zone-tag { font-weight: 600; }
.zone-head .zone-tag.red { color: var(--red); }
.zone-head .zone-tag.blue { color: var(--blue); }
.zone-head .zone-count { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.num {
  height: 44px; border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--text); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.num.sel.red { background: var(--red); border-color: var(--red); color: #fff; }
.num.sel.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.num:disabled { opacity: .35; }

.digit-row { margin-bottom: 12px; }
.digit-row .digit-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.digit-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.digit-btns .num { flex: 0 0 auto; width: 40px; height: 40px; }

.play-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.play-tabs button {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--text); font-size: 14px;
}
.play-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.match-row {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px;
}
.match-inputs { display: flex; gap: 8px; margin-bottom: 8px; }
.match-inputs input {
  flex: 1; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.match-opts { display: flex; gap: 8px; }
.match-opts button {
  flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px;
}
.match-opts button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.add-match { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; color: var(--muted); }
.match-row .del { float: right; color: var(--muted); border: none; background: none; font-size: 13px; }

.picker-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.picker-actions .bet { flex: 1; font-size: 13px; color: var(--muted); }
.picker-actions .bet strong { color: var(--brand); font-size: 16px; }

button.primary { background: var(--brand); color: #fff; border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 600; }
button.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; font-size: 15px; }
button.primary:disabled { opacity: .5; }

.plan { margin-top: 20px; }
.plan h2 { font-size: 16px; display: flex; justify-content: space-between; }
.plan h2 span { color: var(--muted); font-weight: 400; font-size: 13px; }
.entry {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px;
}
.entry .entry-top { display: flex; align-items: baseline; justify-content: space-between; }
.entry .entry-name { font-weight: 600; }
.entry .entry-name em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.entry .entry-money { color: var(--brand); font-weight: 600; font-size: 14px; }
.entry .entry-nums { margin-top: 8px; font-size: 14px; word-break: break-all; }
.entry .entry-nums .red { color: var(--red); }
.entry .entry-nums .blue { color: var(--blue); }
.entry .entry-matches { margin-top: 6px; font-size: 13px; color: var(--muted); }
.entry .del { margin-top: 8px; border: none; background: none; color: var(--muted); font-size: 13px; padding: 0; }

.plan-summary { text-align: right; font-size: 14px; margin: 6px 2px 12px; }
.plan-summary strong { color: var(--brand); font-size: 18px; }
.plan-actions { display: flex; gap: 10px; }
.plan-actions button { flex: 1; }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.overlay-box { background: #fff; border-radius: var(--radius); padding: 12px; max-height: 92vh; overflow: auto; max-width: 100%; }
.overlay-box img { display: block; width: 100%; border-radius: 8px; }
.overlay-actions { display: flex; gap: 10px; margin-top: 10px; }
.overlay-actions a, .overlay-actions button { flex: 1; text-align: center; text-decoration: none; }
.overlay-actions a.primary { display: flex; align-items: center; justify-content: center; }
.tip { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 0; }

.hidden { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 60;
}

/* ============ 会员中心 ============ */
.member-page .app-header { padding-bottom: 12px; }
.mh-row { display: flex; align-items: center; justify-content: space-between; }
.mh-row h1 { margin: 0; font-size: 18px; font-weight: 600; }
.mh-link { color: #fff; font-size: 13px; text-decoration: none; opacity: .9; }

.seg { display: flex; gap: 0; margin: 12px 0 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.seg button { flex: 1; padding: 11px; border: none; background: transparent; color: var(--text); font-size: 15px; }
.seg button.active { background: var(--brand); color: #fff; font-weight: 600; }

.card-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.card-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.card-form input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
.card-form input:focus { outline: none; border-color: var(--brand); }
button.block { width: 100%; margin-top: 4px; }

.role-pick { display: flex; gap: 10px; margin-bottom: 14px; }
.role-pick .radio {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0; padding: 10px; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.role-pick .radio input { width: auto; margin: 0; }

.user-card {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; flex: 0 0 auto;
}
.user-meta { flex: 1; min-width: 0; }
.u-name { margin: 0; font-size: 16px; font-weight: 600; }
.u-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
button.small { padding: 8px 12px; font-size: 13px; }

.block-title { font-size: 16px; margin: 20px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.block-title span { color: var(--muted); font-weight: 400; font-size: 13px; }

.plan-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin-bottom: 10px;
}
.pi-head { display: flex; align-items: baseline; justify-content: space-between; }
.pi-title { font-weight: 600; }
.pi-money { color: var(--brand); font-weight: 600; font-size: 14px; }
.pi-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.pi-acts { display: flex; gap: 8px; margin-top: 10px; }
.pi-acts button { flex: 1; }

.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 12px; }
.detail-body {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  font-family: inherit; font-size: 14px; line-height: 1.7; color: var(--text);
  max-height: 60vh; overflow: auto;
}
.overlay-box { width: 100%; }

/* ============ 选号页补充 ============ */
.date-row { display: flex; align-items: center; justify-content: space-between; }
.hd-link { color: #fff; text-decoration: none; font-size: 12px; opacity: .9; }
.plan-actions button { font-size: 13px; padding: 12px 8px; white-space: nowrap; }
.picker-body { margin-bottom: 6px; }
.match-row .del { float: right; margin-bottom: 4px; }

/* ============ 入口页 / 单彩种选号页 ============ */
.hd-title { font-size: 16px; font-weight: 600; color: #fff; }
.hd-sub { margin: 4px 0 0; font-size: 12px; opacity: .9; color: #fff; }
.org-title { margin: 18px 0 8px; font-size: 15px; font-weight: 600; color: var(--muted); }
a.game-card { display: block; text-decoration: none; color: inherit; }
.play-page .picker { margin-top: 14px; }
.play-page .plan { margin-top: 24px; }

.grid-10 { grid-template-columns: repeat(5, 1fr); }
.num-single { height: 42px; border-radius: 10px; font-size: 15px; }

.picker-actions { flex-wrap: wrap; }
.picker-actions .bet { flex: 1 0 100%; display: flex; align-items: baseline; gap: 6px; }
.picker-actions > button { flex: 1; white-space: nowrap; }
.bet-hint { font-size: 12px; color: var(--muted); }

/* ============ 会员/业主工作台补充 ============ */
.mh-links { display: flex; gap: 14px; }
.member-filter { margin-bottom: 12px; }
.member-filter select,
.bind-acts select,
.bind-acts input {
  flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); font-size: 14px;
}
.bind-acts { display: flex; gap: 8px; align-items: center; }
.bind-acts select { max-width: 180px; }
.bind-search { margin-bottom: 8px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 14px; }
.auth-links a { color: var(--red); text-decoration: none; }
.tag-remark {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-weight: 400; color: #a2620a;
  background: #fff5e0; border: 1px solid #f0d9a8; border-radius: 6px;
}

/* 订单状态徽标 */
.st-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  font-size: 11px; font-weight: 400; border: 1px solid; border-radius: 6px; vertical-align: 1px;
}
.st-pending   { color: #a2620a; background: #fff5e0; border-color: #f0d9a8; }
.st-ticketed  { color: #1f5fae; background: #e8f0fd; border-color: #c3d8f5; }
.st-redeemed  { color: #1d7a3d; background: #e7f6ec; border-color: #bfe5cc; }
.st-paid      { color: #fff;    background: #1d7a3d; border-color: #1d7a3d; }
.st-rejected  { color: #c81e28; background: #fdecec; border-color: #f3c2c5; }
.st-cancelled { color: #6b7280; background: #f0f1f3; border-color: #d9dce1; }

/* 实票照片弹层 */
#photoImg { display: block; max-width: 100%; max-height: 65vh; margin: 0 auto; border-radius: 10px; }
a.ghost.small, button.ghost.small { text-decoration: none; display: inline-flex; align-items: center; }
.seg button span { font-weight: 400; font-size: 12px; opacity: .85; }
.card-form select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
