/* 掼蛋俱乐部平台 · 设计系统
   平安品牌橙：#FF6600（大面积色块/描边/图标）· 深档文字 #D95300（正文/金额保可读）
   亮端渐变 #FF8A29 · 极浅底 #FFF5ED */

:root {
  --brand: #ff6600;
  --brand-deep: #d95300;
  --brand-light: #ff8a29;
  --brand-tint: #fff5ed;
  --brand-tint-2: #ffece0;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --line: #eef0f3;
  --line-2: #e3e6eb;
  --bg: #f7f8fa;
  --white: #fff;
  --green: #2fa96b;
  --red: #e5484d;
  --amber: #ffa51c;
  --teal: #2e93b4;
  --violet: #8b5fc7;
  --rose: #d4548f;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(31, 35, 41, 0.04), 0 4px 16px rgba(31, 35, 41, 0.06);
  --shadow-lg: 0 8px 32px rgba(217, 83, 0, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
button { font-family: inherit; }
.boot { padding: 60px; text-align: center; color: var(--ink-3); }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex: 0 0 224px; background: var(--white);
  border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.logo-badge {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.32);
}
.logo-text b { display: block; font-size: 15px; color: var(--ink); }
.logo-text span { font-size: 11px; color: var(--ink-3); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); cursor: pointer; font-weight: 500; border: none; background: none; width: 100%; text-align: left;
  font-size: 14px;
}
.nav-item:hover { background: var(--brand-tint); color: var(--brand-deep); }
.nav-item.active { background: var(--brand-tint-2); color: var(--brand-deep); font-weight: 700; }
.nav-group { font-size: 11px; color: var(--ink-3); padding: 14px 12px 6px; font-weight: 700; letter-spacing: .5px; }
.suit-dot { color: var(--brand); font-size: 15px; width: 16px; text-align: center; flex: 0 0 16px; line-height: 1; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-tint-2); color: var(--brand-deep);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 30px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; }
.topbar .sub { font-size: 12px; color: var(--ink-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 22px; max-width: 1240px; width: 100%; }

/* ---------- 卡片 ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-head .grow { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--ink-3); }
.stat .value { font-size: 26px; font-weight: 800; color: var(--brand-deep); margin-top: 4px; letter-spacing: -.5px; }
.stat .value.plain { color: var(--ink); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--white);
  color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--brand-light), var(--brand)); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(255, 102, 0, .28); }
.btn.primary:hover { filter: brightness(1.04); background: linear-gradient(135deg, var(--brand-light), var(--brand)); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--red); border-color: #f6d5d6; }
.btn.danger:hover { background: #fdeceb; border-color: var(--red); color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--ink-3); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px; font-size: 14px;
  font-family: inherit; background: var(--white); color: var(--ink); transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 102, 0, .12); }
textarea { resize: vertical; min-height: 72px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.checkline input { width: auto; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: var(--brand-tint); color: var(--brand-deep);
  font-weight: 700; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--line-2);
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr:hover { background: #fcfcfd; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .rank { font-weight: 800; color: var(--ink-3); }
table.tbl tr.top1 .rank { color: #d95300; }
table.tbl tr.top2 .rank { color: #c07a1f; }
table.tbl tr.top3 .rank { color: #7d9bb0; }
.muted { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.gray { background: #f2f3f5; color: var(--ink-2); }
.tag.orange { background: var(--brand-tint-2); color: var(--brand-deep); }
.tag.green { background: #e8f6ee; color: #1f7d4d; }
.tag.red { background: #fdeceb; color: #c0343a; }
.tag.blue { background: #e8f3f8; color: #22697f; }
.tag.violet { background: #f2ecfa; color: #6a45a0; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(31, 35, 41, .45); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 760px; }
.modal-head { padding: 18px 20px 12px; display: flex; align-items: center; }
.modal-head h3 { font-size: 16px; flex: 1; }
.modal-body { padding: 0 20px 8px; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 提示 ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--white); border: 1px solid var(--line-2); border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 11px 15px; box-shadow: var(--shadow); font-size: 13px; min-width: 200px; max-width: 340px;
  animation: slidein .18s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }
.auth-hero {
  background: linear-gradient(150deg, #ff8a29 0%, #ff6600 55%, #e25600 100%);
  color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.auth-hero .suit { position: absolute; font-size: 200px; opacity: .1; right: -30px; bottom: -60px; }
.auth-hero h2 { font-size: 34px; letter-spacing: -.5px; }
.auth-hero p { margin-top: 12px; font-size: 15px; opacity: .94; max-width: 460px; }
.hero-list { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.hero-list div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; opacity: .96; }
.hero-list b { font-weight: 700; }
.auth-panel { display: grid; place-items: center; padding: 40px 22px; background: var(--white); }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 22px; margin-bottom: 6px; }
.auth-form .lead { color: var(--ink-3); font-size: 13px; margin-bottom: 22px; }
.tabs { display: flex; gap: 4px; background: #f2f3f5; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.tabs button { flex: 1; border: none; background: none; padding: 8px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs button.active { background: var(--white); color: var(--brand-deep); box-shadow: var(--shadow); }

/* ---------- 录分 ---------- */
.score-table { display: flex; flex-direction: column; gap: 10px; }
.hand-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.hand-row.done { border-color: #d6ecdf; background: #f5fbf7; }
.hand-row .hn { font-weight: 800; color: var(--ink-3); width: 46px; flex: 0 0 46px; font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { border: none; background: var(--white); padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--brand-tint-2); color: var(--brand-deep); }
.seg button.on.b { background: #e8f3f8; color: #22697f; }
.side-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.side-pill.a { background: var(--brand-tint-2); color: var(--brand-deep); }
.side-pill.b { background: #e8f3f8; color: #22697f; }

.pairing-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pairing-card .pc-head { padding: 9px 13px; background: var(--brand-tint); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--brand-deep); }
.pairing-card .pc-body { padding: 12px 13px; }

/* ---------- 大屏 ---------- */
.screen-body { background: #101418; color: #fff; min-height: 100vh; padding: 26px 32px; }
.screen-body h1 { font-size: 30px; color: #fff; }
.screen-sub { color: #8a949e; font-size: 14px; margin-top: 6px; }
.screen-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px; margin-top: 22px; }
@media (max-width: 1100px) { .screen-grid { grid-template-columns: 1fr; } }
.screen-card { background: #1a2027; border: 1px solid #262e36; border-radius: 14px; padding: 16px 18px; }
.screen-card h3 { color: #ff8a29; font-size: 15px; margin-bottom: 12px; }
table.screen-tbl { width: 100%; border-collapse: collapse; font-size: 17px; }
table.screen-tbl th { text-align: left; color: #7d8892; font-size: 12px; padding: 6px 8px; font-weight: 600; }
table.screen-tbl td { padding: 9px 8px; border-top: 1px solid #232b33; }
table.screen-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.screen-tbl .r1 { color: #ffb066; font-weight: 800; }
table.screen-tbl .r2 { color: #d7dee5; font-weight: 700; }
table.screen-tbl .r3 { color: #a9b3bc; font-weight: 700; }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 6px; font-size: 15px; }
.loading { padding: 30px; text-align: center; color: var(--ink-3); }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--brand-tint-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-light), var(--brand)); }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; gap: 10px; font-size: 13px; padding: 5px 0; }
.kv .k { color: var(--ink-3); width: 82px; flex: 0 0 82px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* ---------- 移动端适配 ---------- */
.menu-btn { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .menu-btn { display: inline-flex; padding: 6px 11px; font-size: 16px; line-height: 1; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 44px rgba(31, 35, 41, .22); overflow-y: auto;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(31, 35, 41, .42);
  }
  .topbar { height: auto; min-height: 56px; padding: 9px 12px; gap: 8px; align-items: flex-start; }
  .topbar h1 { font-size: 15px; }
  .topbar .sub { display: none; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; }
  .content { padding: 12px; }
  .card-head { padding: 12px 13px; }
  .card-body { padding: 13px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { max-width: 100%; }
  .modal-body { padding: 0 13px 8px; }
  .score-table { gap: 8px; }
  .hand-row { flex-wrap: wrap; row-gap: 8px; }
  .hand-row .spacer { display: none; }
  .screen-body { padding: 16px; }
  .screen-body h1 { font-size: 20px; }
  table.screen-tbl { font-size: 14px; }
}

@media (max-width: 560px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .stat .value { font-size: 22px; }
  table.tbl { font-size: 12px; }
  table.tbl th, table.tbl td { padding: 8px 9px; }
  .card-head { flex-wrap: wrap; }
  .card-head input[type=text] { width: 100% !important; }
}
