/* 世界杯决赛盘口 — 暗调低饱和 / 卡片式 / 深浅双主题 / 手机优先 */
:root {
  --bg: #131417;
  --card: #1b1d22;
  --card2: #22252c;
  --border: #2a2d35;
  --text: #e6e7e9;
  --text2: #9aa0a9;
  --text3: #686e77;
  --accent: #f27b2c;
  --accent-dim: rgba(242, 123, 44, 0.14);
  --esp: #c4544b;
  --esp-dim: rgba(196, 84, 75, 0.16);
  --arg: #6ba3c9;
  --arg-dim: rgba(107, 163, 201, 0.16);
  --good: #58a279;
  --bad: #c05f5f;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f3f4;
    --card: #ffffff;
    --card2: #f6f6f7;
    --border: #e3e4e7;
    --text: #1d1f23;
    --text2: #5d636d;
    --text3: #969ba3;
    --accent: #ea5504;
    --accent-dim: rgba(234, 85, 4, 0.09);
    --esp: #b13f37;
    --esp-dim: rgba(177, 63, 55, 0.1);
    --arg: #4579a1;
    --arg-dim: rgba(69, 121, 161, 0.1);
    --good: #35845a;
    --bad: #b04a4a;
    --shadow: 0 1px 3px rgba(20, 22, 26, 0.07);
  }
}
:root[data-theme='dark'] {
  --bg: #131417; --card: #1b1d22; --card2: #22252c; --border: #2a2d35;
  --text: #e6e7e9; --text2: #9aa0a9; --text3: #686e77;
  --accent: #f27b2c; --accent-dim: rgba(242, 123, 44, 0.14);
  --esp: #c4544b; --esp-dim: rgba(196, 84, 75, 0.16);
  --arg: #6ba3c9; --arg-dim: rgba(107, 163, 201, 0.16);
  --good: #58a279; --bad: #c05f5f; --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
:root[data-theme='light'] {
  --bg: #f3f3f4; --card: #ffffff; --card2: #f6f6f7; --border: #e3e4e7;
  --text: #1d1f23; --text2: #5d636d; --text3: #969ba3;
  --accent: #ea5504; --accent-dim: rgba(234, 85, 4, 0.09);
  --esp: #b13f37; --esp-dim: rgba(177, 63, 55, 0.1);
  --arg: #4579a1; --arg-dim: rgba(69, 121, 161, 0.1);
  --good: #35845a; --bad: #b04a4a; --shadow: 0 1px 3px rgba(20, 22, 26, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Segoe UI', sans-serif;
  min-height: 100dvh;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 12px 14px 56px; }
.wrap.wide { max-width: 860px; }

/* ---- 头部 ---- */
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; white-space: nowrap;
}
.top .brand { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.top .spacer { flex: 1; }
.top a, .top button.linkish {
  color: var(--text2); text-decoration: none; font-size: 13px;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.top a:active, .top button.linkish:active { color: var(--text); }

/* ---- 卡片 ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 13px; font-weight: 600; color: var(--text2);
  letter-spacing: 1px; margin-bottom: 12px; white-space: nowrap;
}
.card h2 .h2-side { float: right; font-weight: 400; letter-spacing: 0; color: var(--text3); }

/* ---- 状态徽章与圆点 ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 10px; white-space: nowrap; vertical-align: 2px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); flex: none; }
.dot.open { background: var(--good); }
.dot.locked { background: var(--accent); }
.dot.settled { background: var(--arg); }
.dot.cancelled { background: var(--bad); }

.team-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 1px 8px; border-radius: 6px; white-space: nowrap;
  color: var(--text2); background: var(--card2);
  overflow: hidden; text-overflow: ellipsis; max-width: 9em; vertical-align: bottom;
}
.team-badge.ESP { color: var(--esp); background: var(--esp-dim); }
.team-badge.ARG { color: var(--arg); background: var(--arg-dim); }

/* ---- 比赛主卡 ---- */
.match-head { display: flex; align-items: stretch; gap: 8px; }
.side {
  flex: 1; text-align: center; padding: 14px 6px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card2);
  position: relative; overflow: hidden;
}
.side::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
}
.side.esp::before { background: var(--esp); }
.side.arg::before { background: var(--arg); }
.side .t-name { font-size: 15px; font-weight: 700; white-space: nowrap; }
.side .t-odds {
  font-size: 34px; font-weight: 800; line-height: 1.25;
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.side.esp .t-odds { color: var(--esp); }
.side.arg .t-odds { color: var(--arg); }
.side .t-odds.flash { animation: flash 0.9s ease; }
@keyframes flash { 0% { opacity: 0.2; } 100% { opacity: 1; } }
.side .t-pool { font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vs {
  align-self: center; font-size: 12px; color: var(--text3);
  font-weight: 700; letter-spacing: 1px; flex: none;
}
.pool-bar {
  display: flex; height: 6px; border-radius: 3px; overflow: hidden;
  margin-top: 12px; background: var(--card2);
}
.pool-bar .pb-esp { background: var(--esp); transition: width 0.6s ease; }
.pool-bar .pb-arg { background: var(--arg); transition: width 0.6s ease; }
.match-meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; color: var(--text3); margin-top: 8px; white-space: nowrap;
}

/* ---- 表单与按钮 ---- */
label.fl { display: block; font-size: 13px; color: var(--text2); margin: 12px 0 6px; }
input[type='text'], input[type='password'], input[type='number'],
input[type='datetime-local'], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--card2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.7; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text);
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: opacity 0.15s;
}
.btn:active { opacity: 0.75; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: none; border-color: var(--bad); color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- 选边按钮 ---- */
.pick-row { display: flex; gap: 10px; }
.pick {
  flex: 1; padding: 12px 8px; text-align: center;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--card2); cursor: pointer; font-family: inherit; color: var(--text);
}
.pick .p-name { font-size: 14px; font-weight: 700; white-space: nowrap; }
.pick .p-odds { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pick.esp .p-odds { color: var(--esp); }
.pick.arg .p-odds { color: var(--arg); }
.pick.esp.on { border-color: var(--esp); background: var(--esp-dim); }
.pick.arg.on { border-color: var(--arg); background: var(--arg-dim); }

/* ---- 玩法说明浮窗 ---- */
.card.mk-card { position: relative; }
.mk-help {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.mk-help .q {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 1px solid var(--text3); color: var(--text3);
  font-size: 10.5px; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.mk-help:hover .q, .mk-help.on .q { border-color: var(--accent); color: var(--accent); }
.mk-tip {
  display: none; position: absolute; left: 12px; right: 12px; top: 44px;
  z-index: 20; background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--text2); line-height: 1.8;
  font-weight: 400; letter-spacing: 0; white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.mk-tip.open { display: block; }
@media (hover: hover) and (pointer: fine) {
  .mk-card:has(.mk-help:hover) .mk-tip { display: block; }
}

/* ---- 多盘口选项按钮 ---- */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.opt-btn {
  position: relative; overflow: hidden;
  padding: 10px 6px 9px; text-align: center;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--card2); cursor: pointer; font-family: inherit; color: var(--text);
}
.opt-btn::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--text3); }
.opt-btn[data-tone='esp']::before { background: var(--esp); }
.opt-btn[data-tone='arg']::before { background: var(--arg); }
.opt-btn .o-name {
  font-size: 12.5px; font-weight: 600; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.opt-btn .o-odds { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; }
.opt-btn[data-tone='esp'] .o-odds { color: var(--esp); }
.opt-btn[data-tone='arg'] .o-odds { color: var(--arg); }
.opt-btn .o-pool { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt-btn:active { border-color: var(--accent); }
.opt-btn.win { border-color: var(--good); background: rgba(88, 162, 121, 0.08); }
.opt-btn.win .o-name { color: var(--good); }
.opt-btn:disabled { cursor: default; opacity: 0.75; }
.mk-tag { font-size: 11px; color: var(--text3); font-weight: 400; letter-spacing: 0; }

.amt-row { display: flex; gap: 8px; margin-top: 10px; }
.amt-row .chip {
  flex: 1; padding: 8px 0; font-size: 13px; border-radius: 8px;
  border: 1px solid var(--border); background: none; color: var(--text2);
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.amt-row .chip:active { border-color: var(--accent); color: var(--accent); }

.est {
  display: flex; justify-content: space-between; gap: 8px;
  background: var(--accent-dim); border-radius: 10px;
  padding: 10px 12px; margin-top: 12px; font-size: 13px;
  white-space: nowrap;
}
.est b { font-variant-numeric: tabular-nums; }

/* ---- 列表 ---- */
.list { list-style: none; }
.list li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0; border-top: 1px solid var(--border);
  font-size: 13px; white-space: nowrap;
}
.list li:first-child { border-top: none; }
.list .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 9em; }
.list .grow { flex: 1; }
.list .num { font-variant-numeric: tabular-nums; }
.list .muted { color: var(--text3); font-size: 12px; }
.net-pos { color: var(--good); font-weight: 700; }
.net-neg { color: var(--bad); font-weight: 700; }

/* ---- 数据网格(管理端) ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; min-width: 0;
}
.stat .s-label { font-size: 11px; color: var(--text3); white-space: nowrap; }
.stat .s-val {
  font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat .s-val.good { color: var(--good); }
.stat .s-val.bad { color: var(--bad); }
.stat .s-val.esp { color: var(--esp); }
.stat .s-val.arg { color: var(--arg); }

/* ---- 提示条 ---- */
.note {
  font-size: 12px; color: var(--text3); line-height: 1.7;
  margin-top: 10px; text-wrap: balance;
}
.alert {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 12px; font-size: 13px;
  color: var(--text2); margin-top: 12px;
}

/* ---- toast / modal ---- */
#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 18px; font-size: 14px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  max-width: 88vw; z-index: 50; text-align: center;
}
#toast.show { opacity: 1; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  display: none; align-items: flex-end; justify-content: center; z-index: 40;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px 16px 0 0; padding: 20px 18px 26px;
  width: 100%; max-width: 560px;
}
.modal h3 { font-size: 16px; margin-bottom: 12px; }
.modal .m-row {
  display: flex; justify-content: space-between; padding: 7px 0;
  font-size: 14px; color: var(--text2); white-space: nowrap;
}
.modal .m-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.modal .m-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal .m-btns .btn { flex: 1; }
@media (min-width: 600px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 16px; max-width: 420px; }
}

/* ---- 主视觉图 ---- */
.hero-img {
  width: 100%; display: block; border-radius: 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}

/* ---- 登录页 ---- */
.hero { text-align: center; padding: 40px 0 8px; }
.hero .h-title { font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.hero .h-sub { font-size: 13px; color: var(--text3); margin-top: 4px; }
.hero .h-vs {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 22px 0 6px; font-weight: 800;
}
.hero .h-team { font-size: 17px; letter-spacing: 2px; }
.hero .h-team.esp { color: var(--esp); }
.hero .h-team.arg { color: var(--arg); }
.hero .h-x { color: var(--text3); font-size: 12px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.tabs button {
  flex: 1; padding: 10px 0; background: none; border: none;
  color: var(--text3); font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.agree-row {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 14px; font-size: 12.5px; color: var(--text2); line-height: 1.7;
  cursor: pointer;
}
.agree-row input[type='checkbox'] {
  flex: none; width: 16px; height: 16px; margin-top: 3px; accent-color: var(--accent);
}
.agree-row a { color: var(--accent); text-decoration: none; }

/* ---- 表格式用户列表 ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td {
  text-align: left; padding: 8px 6px;
  border-top: 1px solid var(--border); white-space: nowrap;
}
.tbl th { color: var(--text3); font-weight: 500; font-size: 12px; border-top: none; }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow-x: auto; }

.footer {
  text-align: center; font-size: 12px; color: var(--text3);
  margin-top: 24px; line-height: 1.8; text-wrap: balance;
}
.footer a { color: var(--text3); }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
