/**
 * coaches.css — 主教练页专属样式
 * ===========================================================================
 * 命名空间 ch-*,与 b5-* / fm-* / lg-* 完全隔离。
 * 复用 big5.css 的设计令牌(--fg / --accent / --border / --card ...),
 * 不引入新色板、不引外部字体或图片。对比度按 WCAG AA 校准。
 */

/* ── 工具条:排序 + 筛选 + 搜索 ───────────────────────────────────────── */
.ch-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ch-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ch-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.ch-seg button + button { border-left: 1px solid var(--border); }
.ch-seg button:hover { background: rgba(255, 255, 255, .05); color: var(--fg); }

.ch-seg button.is-active {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
}

.ch-search {
  flex: 1 1 180px;
  min-width: 150px;
  max-width: 260px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  padding: 7px 11px;
}

.ch-search::placeholder { color: var(--fg-muted); }
.ch-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.ch-count {
  font-size: 12.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

/* ── 卡片网格 ─────────────────────────────────────────────────────────── */
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.ch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 15px;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: border-color .2s var(--ease), transform .2s var(--ease),
              box-shadow .2s var(--ease);
}

.ch-card:hover,
.ch-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  outline: none;
}

.ch-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.ch-team {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-secondary);
  letter-spacing: .01em;
}

.ch-rank {
  font-size: 11.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ch-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg);
}

.ch-name__en {
  display: block;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-secondary);
  letter-spacing: 0.01em;
  margin-top: 3px;
}

.ch-name__tw {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--fg-muted);
  margin-top: 2px;
}

.ch-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--fg-secondary);
}

.ch-facts span { white-space: nowrap; }
.ch-facts b {
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* 荣誉计数条:有几座奖杯就画几个点,超过 6 个折叠成 "+n" */
.ch-trophies {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
}

.ch-tdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.ch-tmore { color: var(--accent); font-weight: 600; }

.ch-empty-note {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
}

/* ── 弹窗:教练档案 ───────────────────────────────────────────────────── */
.ch-modal {
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  background: var(--card-solid);
  color: var(--fg);
  padding: 0;
  width: min(680px, calc(100vw - 28px));
  max-height: min(86vh, 900px);
  box-shadow: var(--shadow-lg);
}

.ch-modal::backdrop {
  background: rgba(10, 10, 15, .78);
  backdrop-filter: blur(3px);
}

.ch-modal__hd {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 13px;
  background: var(--card-solid);
  border-bottom: 1px solid var(--border);
}

.ch-modal__hd > div { min-width: 0; flex: 1; }

.ch-modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
}

.ch-modal__sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--fg-muted);
}

.ch-x {
  appearance: none;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-secondary);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.ch-x:hover { background: rgba(255, 255, 255, .06); color: var(--fg); }

.ch-modal__bd {
  padding: 15px 18px 18px;
  overflow-y: auto;
  max-height: calc(min(86vh, 900px) - 74px);
}

.ch-sec + .ch-sec { margin-top: 18px; }

.ch-sec__hd {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.ch-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px 14px;
}

.ch-kv__k { font-size: 11.5px; color: var(--fg-muted); }
.ch-kv__v {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.ch-intro {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--fg-secondary);
  white-space: pre-line;
}

/* 荣誉列表 */
.ch-honors { list-style: none; margin: 0; padding: 0; }

.ch-honors li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13.5px;
}

.ch-honors li + li { border-top: 1px solid var(--border); }

.ch-honors__t { color: var(--fg); }

.ch-honors__n {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.ch-honors__s {
  display: block;
  font-size: 11.5px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
  word-break: break-word;
}

/* 执教履历表 */
.ch-spells-wrap { overflow-x: auto; }

.ch-spells {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ch-spells th,
.ch-spells td {
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ch-spells th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.ch-spells td { color: var(--fg-secondary); }
.ch-spells td.ch-spells__team { color: var(--fg); font-weight: 600; white-space: normal; }
.ch-spells td.ch-spells__date { font-family: var(--font-mono); font-size: 12px; }
.ch-spells tbody tr:hover { background: rgba(255, 255, 255, .035); }

.ch-none {
  margin: 0;
  font-size: 13px;
  color: var(--fg-muted);
  padding: 4px 0;
}

.ch-srcline {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--fg-muted);
  word-break: break-all;
}

.ch-srcline a { color: var(--fg-secondary); }

/* ── 空态 / 加载态 ───────────────────────────────────────────────────── */
.ch-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 34px 14px;
  color: var(--fg-muted);
  font-size: 13.5px;
}

/* ── 方法说明区(本页自有,不借用 form.css 的 fm-method) ─────────────── */
.ch-method { font-size: 13px; line-height: 1.78; color: var(--fg-secondary); }
.ch-method p { margin: 0 0 9px; }
.ch-method p:last-child { margin-bottom: 0; }
.ch-method strong { color: var(--fg); font-weight: 600; }
.ch-method ul { margin: 0 0 9px; padding-left: 20px; }
.ch-method li { margin-bottom: 6px; }
.ch-method code {
  background: rgba(255, 255, 255, .07);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 560px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-modal { width: 100vw; max-height: 92vh; border-radius: var(--radius-lg); }
}
