/* ==========================================================================
   assets/app.css —— 三端共用的设计变量与基础组件
   暗色底 + 纯色块，无渐变无模糊，投屏和大屏都稳。
   ========================================================================== */
:root {
  --bg: #0b1020;
  --panel: #141b31;
  --panel-2: #1b2444;
  --line: #26325a;
  --text: #eaeffb;
  --muted: #8d9abf;
  --accent: #3d7bff;
  --accent-soft: #22407e;
  --good: #21c98a;
  --bad: #ff5c7a;
  --warn: #ffb020;
  --gold: #ffd166;
  --r: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: .2px; }
a { color: var(--accent); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 通用控件 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600;
  transition: filter .12s ease, transform .06s ease;
}
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #06251a; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #2a1c00; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #350009; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2a1d00; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.big { padding: 16px 22px; font-size: 18px; border-radius: 12px; width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > label { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  background: #0e1428; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; width: 100%; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.chip.on { background: var(--accent-soft); color: #cfe0ff; border-color: #33569e; }
.chip.good { color: #a7f0d2; border-color: #1c7a56; background: #10352a; }
.chip.bad { color: #ffc3cf; border-color: #8a2b40; background: #3a131c; }
.chip.gold { color: #ffe9a8; border-color: #8a6d1b; background: #33290d; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px;
}
.card h3 { font-size: 15px; margin-bottom: 10px; }
.card h3 .sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.center { text-align: center; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.ok-text { color: var(--good); font-size: 13px; }

/* ---------- 表格 ---------- */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: #18224a; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 进度条 ---------- */
.bar { height: 10px; border-radius: 6px; background: #0e1428; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s ease; }

/* ---------- 榜单 ---------- */
.rank-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; border: 1px solid transparent;
}
.rank-row + .rank-row { margin-top: 4px; }
.rank-row .no { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-row.top1 .no { color: var(--gold); }
.rank-row.top2 .no { color: #cfd8ea; }
.rank-row.top3 .no { color: #e8a86a; }
.rank-row.me { background: #142a4f; border-color: #2f5da8; }
.rank-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .pts { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3760; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 动效 ---------- */
@keyframes pop { 0% { transform: scale(.86); opacity: 0; } 70% { transform: scale(1.04); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.pop { animation: pop .28s ease; }
.up { animation: slideUp .3s ease; }
.pulse { animation: pulse 1.1s ease-in-out infinite; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(4, 8, 20, .78);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 18px;
}
.dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: min(560px, 96vw); max-height: 88vh; overflow: auto; }
.dialog h3 { margin-bottom: 12px; }
