/* ============================================================================
 * 牛萌杯 2026 · 样式
 * 深紫 + 霓虹青的对战感，与主站（番股行情）的浅色行情风刻意区分开。
 * ==========================================================================*/

:root {
  --bg: #0d0917;
  --bg2: #150f24;
  --card: #1a1230;
  --card2: #221741;
  --line: #2e2150;
  --line2: #3d2c68;
  --txt: #ece7f7;
  --dim: #9c93b8;
  --dim2: #6f6689;
  --acc: #35e0d0;
  --acc2: #7c5cff;
  --gold: #ffcb45;
  --red: #ff5d7a;
  --q1: #5eb8ff;
  --q2: #6ee7a0;
  --q3: #ffb454;
  --q4: #c58bff;
  --r: 14px;
  --r2: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(124, 92, 255, .22), transparent 62%),
    radial-gradient(760px 460px at 92% 4%, rgba(53, 224, 208, .14), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; }

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  background: rgba(13, 9, 23, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--txt);
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  color: #0d0917;
  background: linear-gradient(140deg, var(--acc), var(--acc2));
  box-shadow: 0 4px 16px rgba(124, 92, 255, .4);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text b { font-size: 17px; letter-spacing: .5px; }
.brand-text i { font-size: 11px; font-style: normal; color: var(--dim); letter-spacing: .4px; }

.tabs {
  display: flex;
  gap: 2px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs a {
  padding: 7px 15px;
  border-radius: 9px;
  color: var(--dim);
  font-size: 14px;
  white-space: nowrap;
  transition: .15s;
}
.tabs a:hover { color: var(--txt); background: rgba(255, 255, 255, .05); text-decoration: none; }
.tabs a.on { color: #0d0917; background: var(--acc); font-weight: 600; }

.topright { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.who { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 6px; }
.shadow-tag {
  font-style: normal;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 203, 69, .16);
  color: var(--gold);
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--acc), #26bfd4);
  color: #08201e;
  font-weight: 700;
  font-size: 14px;
  transition: .16s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.ghost {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line2);
  font-weight: 500;
}
.btn.ghost:hover { color: var(--txt); border-color: var(--dim2); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------------- 主体 ---------------- */

#main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

.loading, .empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--dim2);
  font-size: 14px;
}

/* ---------------- 阶段横幅 ---------------- */

.stage-banner {
  border-radius: var(--r);
  padding: 24px 26px;
  margin-bottom: 20px;
  border: 1px solid var(--line2);
  background: linear-gradient(135deg, var(--card2), var(--card));
  position: relative;
  overflow: hidden;
}
.stage-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 200px at 88% -20%, rgba(53, 224, 208, .16), transparent 70%);
  pointer-events: none;
}
.stage-banner.prep { border-color: var(--line); }
.stage-banner.qual { border-color: rgba(53, 224, 208, .45); }
.stage-banner.group { border-color: rgba(124, 92, 255, .5); }
.stage-banner.elim { border-color: rgba(255, 93, 122, .42); }
.stage-banner.done { border-color: rgba(255, 203, 69, .5); background: linear-gradient(135deg, #2a1e10, var(--card)); }

.sb-title { font-size: 21px; font-weight: 800; letter-spacing: .3px; margin-bottom: 6px; }
.sb-sub { color: var(--dim); font-size: 14px; margin-bottom: 14px; }
.stage-banner .btn { position: relative; z-index: 1; }

.champ { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.champ .cov { width: 84px; height: 84px; flex: 0 0 auto; }
.champ.big .cov { width: 120px; height: 120px; }
.champ-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ-info b { font-size: 19px; }
.champ.big .champ-info b { font-size: 24px; }
.champ-info span { color: var(--dim); font-size: 13px; }
.champ-info em { color: var(--gold); font-style: normal; font-size: 12px; }
.runner { margin-top: 12px; color: var(--dim); font-size: 14px; }

/* ---------------- 统计 ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat b { font-size: 22px; font-weight: 800; color: var(--acc); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--dim2); }

/* ---------------- 区块 ---------------- */

.sec { margin-bottom: 32px; }
.sec h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-left: 11px;
  border-left: 3px solid var(--acc);
  line-height: 1.3;
}
.sec h2 small { font-weight: 400; font-size: 12px; color: var(--dim2); margin-left: 7px; }

/* ---------------- 封面 ---------------- */

.cov {
  width: 68px;
  height: 68px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--card2);
  flex: 0 0 auto;
}
.cov img { width: 100%; height: 100%; object-fit: cover; }
.cov-empty {
  display: grid;
  place-items: center;
  color: var(--dim2);
  font-size: 20px;
  font-weight: 700;
  background: var(--card2);
}

/* ---------------- 比赛卡片 ---------------- */

/* 一行一场：两列并排会把「VS 两边」压得很窄，单列读起来更像比赛卡 */
.matches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.match {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .18s;
}
.match:hover { border-color: var(--line2); }
.match.closed { opacity: .92; }

.m-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  font-size: 12px;
}
.m-stage { color: var(--dim); }
.m-live { color: var(--acc); margin-left: auto; font-weight: 600; }
.m-done { color: var(--dim2); margin-left: auto; }

.m-body {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: stretch;
}

.vs {
  display: grid;
  place-items: center;
  color: var(--dim2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
}

.side {
  display: flex;
  gap: 11px;
  padding: 14px;
  background: transparent;
  border: 0;
  text-align: left;
  transition: background .15s;
  min-width: 0;
}
.side:not(:disabled):hover { background: rgba(53, 224, 208, .07); }
.side:disabled { cursor: default; }
.side.picked { background: rgba(53, 224, 208, .1); box-shadow: inset 0 0 0 1px rgba(53, 224, 208, .4); }
.side.win { background: rgba(255, 203, 69, .08); }
.side.lose { opacity: .52; }
.side.win .cov { box-shadow: 0 0 0 2px var(--gold); }

.side-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.side-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.side-jp {
  font-size: 11px;
  color: var(--dim2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  margin-top: 4px;
}
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.side-meta { font-size: 11px; color: var(--dim2); font-variant-numeric: tabular-nums; }
.side-meta b { color: var(--txt); font-size: 12px; }
.side-meta em { color: var(--gold); font-style: normal; font-weight: 700; }

.m-pending { padding: 26px; text-align: center; color: var(--dim2); font-size: 13px; }

/* ---------------- 季度标签 ---------------- */

.qtag {
  display: inline-block;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: 1px;
  background: rgba(255, 255, 255, .08);
  color: var(--dim);
}
.qtag.q1 { background: rgba(94, 184, 255, .18); color: var(--q1); }
.qtag.q2 { background: rgba(110, 231, 160, .18); color: var(--q2); }
.qtag.q3 { background: rgba(255, 180, 84, .18); color: var(--q3); }
.qtag.q4 { background: rgba(197, 139, 255, .18); color: var(--q4); }

/* ---------------- 海选 ---------------- */

.qual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.qual-head h2 { margin: 0 0 6px; font-size: 19px; }
.qual-head h2 small { font-size: 12px; color: var(--dim2); font-weight: 400; margin-left: 6px; }
.hint { color: var(--dim); font-size: 13px; margin: 0; line-height: 1.6; }
.qual-act { display: flex; align-items: center; gap: 12px; }
.cnt { font-size: 13px; color: var(--dim); }
.cnt b { color: var(--acc); font-size: 17px; }
.qual-left { font-size: 12px; color: var(--dim2); margin-bottom: 16px; }

/* 海选工具条：搜索 + 排序 */
.qtools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.qsearch {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
  display: flex;
  align-items: center;
}
.qsearch input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 74px 8px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.qsearch input::placeholder { color: var(--dim2); }
.qsearch input:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(53, 224, 208, .12);
}
.qsearch input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); cursor: pointer; }
.qsearch::before {
  content: '🔍';
  position: absolute;
  left: 11px;
  font-size: 12px;
  opacity: .55;
  pointer-events: none;
}
.qcount {
  position: absolute;
  right: 12px;
  font-size: 11px;
  color: var(--dim2);
  pointer-events: none;
  white-space: nowrap;
}
.qsort { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qlabel { font-size: 12px; color: var(--dim2); margin-right: 2px; }
.sbtn {
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  color: var(--dim);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.sbtn:hover { color: var(--txt); border-color: var(--line2); background: var(--card2); }
.sbtn.on {
  color: #0b0714;
  background: var(--acc);
  border-color: var(--acc);
  font-weight: 600;
}
.qempty {
  grid-column: 1 / -1;
  padding: 36px 16px;
  text-align: center;
  color: var(--dim2);
  font-size: 13px;
  background: var(--card);
  border: 1px dashed var(--line2);
  border-radius: var(--r2);
}

.qlist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qrow {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  transition: .15s;
  cursor: pointer;
  min-width: 0;
}
.qrow:hover { border-color: var(--line2); background: var(--card2); }
.qrow.sel { border-color: var(--acc); background: rgba(53, 224, 208, .09); }
.qrow.qualified { box-shadow: inset 3px 0 0 var(--gold); }

.qrank {
  width: 26px;
  flex: 0 0 auto;
  text-align: right;
  font-size: 12px;
  color: var(--dim2);
  font-variant-numeric: tabular-nums;
}
.qrow .cov { width: 112px; height: 156px; border-radius: 10px; }
.qinfo { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qname {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qname .seed {
  font-style: normal;
  font-size: 10px;
  color: var(--gold);
  background: rgba(255, 203, 69, .14);
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 5px;
}
.qjp {
  font-size: 12px;
  color: var(--dim2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qmeta { font-size: 12px; color: var(--dim2); font-variant-numeric: tabular-nums; }
.qmeta b { color: var(--acc); }
.qmeta em { color: var(--gold); font-style: normal; }

.qcheck {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  border: 1.5px solid var(--line2);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #08201e;
}
.qrow.sel .qcheck { background: var(--acc); border-color: var(--acc); }

/* ---------------- 种子 ---------------- */

.seedgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.seedcard {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  position: relative;
  min-width: 0;
}
.seedcard .cov { width: 112px; height: 156px; border-radius: 10px; }
.snum {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  opacity: .85;
}
.sinfo { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sname {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 30px;
}
.sjp {
  font-size: 11.5px;
  color: var(--dim2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smeta { font-size: 11.5px; color: var(--dim2); font-variant-numeric: tabular-nums; }

/* ---------------- 模态 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 10, .72);
  backdrop-filter: blur(3px);
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.modal-box h3 { margin: 0 0 8px; font-size: 18px; }
.modal-box label {
  display: block;
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--dim);
}
.modal-box input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 9px;
  color: var(--txt);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.modal-box input:focus { border-color: var(--acc); }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal-box .hint { margin-bottom: 4px; }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 11px 22px;
  border-radius: 10px;
  background: rgba(34, 23, 65, .97);
  border: 1px solid var(--line2);
  color: var(--txt);
  font-size: 13.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  max-width: min(90vw, 460px);
  text-align: center;
  animation: toastIn .2s ease;
}
.toast[hidden] { display: none; }
.toast.err { border-color: var(--red); color: #ffc3ce; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- 推广位（牛萌 → 动画顺） ---------------- */

.promo {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 22px 0 8px; padding: 18px 20px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(53, 224, 208, .10));
  border: 1px solid var(--line2);
}
.promo-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.promo-txt b { font-size: 15px; color: var(--txt); }
.promo-txt span { font-size: 12.5px; color: var(--dim); }
.promo .btn { flex: 0 0 auto; }

/* ---------------- 页脚 ---------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--dim2);
}
.foot-in { max-width: 1180px; margin: 0 auto; }
.foot-sep { margin: 0 8px; opacity: .5; }
.foot a { color: var(--dim); }

/* ---------------- 规则页 ---------------- */

.rules { display: flex; flex-direction: column; gap: 16px; max-width: 900px; margin: 0 auto; }

.rule-hero {
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 24px 22px;
  background:
    radial-gradient(700px 200px at 15% 0%, rgba(124, 92, 255, .22), transparent 70%),
    radial-gradient(600px 200px at 90% 100%, rgba(53, 224, 208, .14), transparent 70%),
    var(--card);
}
.rule-hero h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: .5px; }
.rule-hero p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.7; }
.rule-flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 18px;
}
.rule-flow .rf {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--card2);
  font-size: 12.5px; color: var(--dim);
}
.rule-flow .rf b { font-size: 15px; color: var(--acc); font-variant-numeric: tabular-nums; }
.rule-flow i { color: var(--dim2); font-style: normal; font-size: 13px; }

.rule-sec { display: flex; flex-direction: column; gap: 9px; }
.rule-sec h2 {
  display: flex; align-items: center; gap: 9px;
  margin: 6px 0 0; font-size: 15.5px; font-weight: 700; color: var(--txt);
}
.rule-sec h2 i {
  font-style: normal; font-size: 11px; font-weight: 700;
  color: var(--acc); background: rgba(53, 224, 208, .12);
  border: 1px solid rgba(53, 224, 208, .28);
  padding: 2px 7px; border-radius: 6px; letter-spacing: .5px;
}
.rule-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 16px 18px;
}
.rule-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 9px; }
.rule-list li { font-size: 13.5px; line-height: 1.75; color: var(--dim); }
.rule-list li b, .rule-note b { color: var(--txt); font-weight: 600; }
.rule-list code {
  font-size: 12px; padding: 1px 5px; border-radius: 4px;
  background: var(--card2); color: var(--acc); border: 1px solid var(--line);
}
.rule-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.rule-ol li { font-size: 13.5px; line-height: 1.75; color: var(--dim); }
.rule-ol b { color: var(--txt); font-weight: 600; }
.rule-note {
  margin: 12px 0 0; font-size: 12.5px; line-height: 1.75;
  color: var(--dim2);
  border-left: 2px solid var(--line2);
  padding-left: 11px;
}
.rule-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rule-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 460px;
}
.rule-table th, .rule-table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  line-height: 1.6; color: var(--dim);
  vertical-align: top;
}
.rule-table th {
  font-size: 12px; font-weight: 600; color: var(--dim2);
  text-transform: uppercase; letter-spacing: .4px;
  background: var(--card2);
  white-space: nowrap;
}
.rule-table th:first-child { border-top-left-radius: 9px; }
.rule-table th:last-child { border-top-right-radius: 9px; }
.rule-table tbody tr:last-child td { border-bottom: none; }
.rule-table td:first-child { color: var(--txt); font-weight: 500; white-space: nowrap; }
.rule-table b { color: var(--acc); font-weight: 700; }

/* ---------------- 经典赛程树 ---------------- */

/* 一列 8 场（a–h），胜者往右一列前进，最后一列是冠军。
   用一张 grid 承载所有列，格子按 2 的幂跨行，才能保证跨列严格对齐。 */
.btree-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }

.btree {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(150px, 1fr));
  grid-template-rows: auto repeat(var(--rows, 8), minmax(50px, auto));
  column-gap: 34px;
  row-gap: 0;
  min-width: 720px;
}

.bhead {
  grid-row: 1;
  padding: 0 0 8px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--dim2);
  text-transform: uppercase;
}

.btitle {
  margin: 16px 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: .02em;
}
.sec > .btitle:first-of-type { margin-top: 2px; }

.bslot {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
/* 出线：从卡片右缘伸到下一列 */
.bslot::after {
  content: '';
  position: absolute;
  right: -17px;
  top: 50%;
  width: 17px;
  border-top: 1px solid var(--line2);
}
.bslot.noline::after { display: none; }
/* 入线：跨两行的格子，上下两个子节点的中心正好在 25% / 75% */
.bslot.feed::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 25%;
  height: 50%;
  border-left: 1px solid var(--line2);
}

.bcard {
  flex: 1 1 auto;
  min-width: 0;
  margin: 5px 0;
  padding: 7px 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  transition: border-color .18s;
}
.bcard.live { border-color: rgba(53, 224, 208, .5); }
.bcard.closed { opacity: .94; }
.bcard:hover { border-color: var(--line2); }
.bcard.empty { color: var(--dim2); font-size: 12px; text-align: center; padding: 12px 8px; }

.brow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: var(--dim);
  line-height: 1.4;
}
.brow + .brow { border-top: 1px dashed rgba(255, 255, 255, .05); }
.brow .bn {
  flex: 1 1 auto;
  min-width: 0;
  /* 番剧名普遍很长，单行截断只剩几个字，两行能看清大半 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.35;
}
.brow .bv {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--dim2);
}
.brow.win { color: var(--txt); font-weight: 600; }
.brow.win .bv { color: var(--acc); }
.brow.lose { color: var(--dim2); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .18); }

.bcard .blet {
  float: left;
  margin: -1px 7px 0 0;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: var(--card2);
  color: var(--dim2);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  font-style: normal;
}

/* 冠军 / 晋级 尾列 */
.bchamp {
  flex: 1 1 auto;
  min-width: 0;
  margin: 5px 0;
  padding: 12px;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 203, 69, .14), rgba(124, 92, 255, .12));
  border: 1px solid rgba(255, 203, 69, .38);
  border-radius: 12px;
}
.bchamp .cov { width: 84px; height: 117px; margin: 0 auto 9px; }
.bchamp b { display: block; font-size: 13.5px; color: var(--txt); line-height: 1.45; }
.bchamp span { display: block; margin-top: 3px; font-size: 11px; color: var(--dim2); }
.bchamp .bq { margin-top: 8px; font-size: 11px; color: var(--gold); }
.bchamp.tbd { background: var(--card); border-color: var(--line); color: var(--dim2); }

.badv {
  flex: 1 1 auto;
  min-width: 0;
  margin: 5px 0;
  padding: 9px;
  background: var(--card2);
  border: 1px dashed var(--line2);
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.5;
}

/* 败者组：轮次人数不等（4/4/2/2/1/1），做不出严格二叉树，改用紧凑分栏 */
.lbgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.lbcol { min-width: 160px; }
.lbcol h4 {
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--dim2);
  text-transform: uppercase;
}
.lbcol .bcard { margin: 0 0 8px; }

/* ---------------- 历史记录 ---------------- */

.hchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.hchip {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
  white-space: nowrap;
}
.hchip:hover { border-color: var(--line2); color: var(--txt); }
.hchip.on {
  border-color: rgba(53, 224, 208, .6);
  background: rgba(53, 224, 208, .1);
  color: var(--acc);
  font-weight: 600;
}
.hchip .hdot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--dim2);
  vertical-align: 1px;
}
.hchip.on .hdot { background: var(--acc); }
.hmeta {
  margin: 0 0 13px;
  font-size: 12px;
  color: var(--dim2);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 9px 14px; }
  .tabs { order: 3; width: 100%; flex: 1 0 100%; }
  .tabs a { padding: 6px 12px; font-size: 13px; }
  #main { padding: 16px 14px 50px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .matches { grid-template-columns: 1fr; }
  .qlist { grid-template-columns: 1fr; }
  .seedgrid { grid-template-columns: 1fr; }
  .qrow .cov, .seedcard .cov { width: 84px; height: 117px; }
  .m-body { grid-template-columns: 1fr 26px 1fr; }
  .side { padding: 11px; gap: 9px; }
  .side .cov { width: 48px; height: 48px; }
  .sb-title { font-size: 18px; }
  .btree { column-gap: 24px; min-width: 640px; }
  .bslot::after { right: -12px; width: 12px; }
  .bslot.feed::before { left: -12px; }
  .bcard { padding: 6px 7px; font-size: 11.5px; }
  .lbgrid { grid-template-columns: repeat(6, minmax(150px, 1fr)); }
}

@media (max-width: 480px) {
  .brand-text i { display: none; }
  .qual-head { flex-direction: column; }
  .qual-act { width: 100%; justify-content: space-between; }
  .m-body { grid-template-columns: 1fr; }
  .vs { padding: 4px 0; }
  .qrow .cov, .seedcard .cov { width: 72px; height: 100px; }
  .qrow, .seedcard { gap: 11px; padding: 10px 12px; }
  .promo { flex-direction: column; align-items: stretch; }
  .promo .btn { width: 100%; text-align: center; }
  .rule-hero { padding: 18px 16px; }
  .rule-hero h1 { font-size: 20px; }
  .rule-card { padding: 13px 14px; }
  .rule-table { min-width: 420px; font-size: 12.5px; }
}
