/* ============================================================
   米兰赛场 · 共享站点样式 /assets/site.css
   色彩骨架：深墨黑底 + 竞技红强调 + 客场冷蓝对位 + 青绿数据点
   形态：直角、1px 发丝线、精密网格、竖排注释
   ============================================================ */

:root {
  --red: #C8102E;
  --red-deep: #A70D26;
  --ink: #0E0E10;
  --carbon: #1A1C1F;
  --graphite: #2A2E33;
  --rock: #6E7378;
  --ochre: #A8642A;
  --cyan: #2BE0A6;
  --away: #4C7EA8;
  --paper: #F4F2EE;
  --amber: #F2C14E;

  --text: #E7E4DF;
  --text-soft: #CFCBC5;
  --text-muted: #9AA0A5;
  --hair: rgba(244, 242, 238, 0.09);
  --hair-strong: rgba(244, 242, 238, 0.18);

  --font-cn: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "Barlow Condensed", "DIN Condensed", "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;

  --rail: 88px;
  --pad: clamp(16px, 3.2vw, 40px);
  --dur: 0.32s;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html.nav-locked { overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-cn);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- 中文排版基础 ---------- */
h1, h2, h3 {
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--paper);
}

h1 { font-size: clamp(40px, 6vw, 56px); }
h2 { font-size: clamp(28px, 3.4vw, 40px); }
h3 { font-size: clamp(20px, 2.2vw, 28px); }

p { max-width: 68ch; }

strong { color: var(--paper); font-weight: 700; }

a { text-decoration-color: var(--red); text-underline-offset: 4px; }

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 200;
  display: inline-block;
  padding: 10px 18px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}

.skip-link:focus {
  top: 12px;
  outline-offset: 0;
}

/* ---------- 通用容器 ---------- */
.shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding-inline: var(--pad);
}

.page-main {
  display: block;
  padding-block: clamp(28px, 4vw, 56px) clamp(56px, 7vw, 104px);
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  background: var(--ink);
  border-bottom: 1px solid var(--graphite);
}

.site-header__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 6px;
  background: var(--carbon);
  border-right: 2px solid var(--red);
}

.rail-brand {
  display: flex;
  text-decoration: none;
  color: var(--paper);
}

.rail-brand__text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--paper);
  transition: color 0.18s var(--ease);
}

.rail-brand:hover .rail-brand__text { color: var(--amber); }

.rail-year {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--rock);
}

.site-header__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 命令栏 */
.cmdbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 46px;
  padding: 8px 20px 8px 18px;
  background: var(--ink);
  border-bottom: 1px solid var(--graphite);
  position: relative;
  z-index: 3;
}

.cmdbar__path {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmdbar__crumb { color: var(--text-muted); }
.cmdbar__crumb:first-child { color: var(--paper); font-weight: 700; }
.cmdbar__crumb--live { color: var(--cyan); font-weight: 700; }

.cmdbar__sep { color: rgba(244, 242, 238, 0.22); }

.cmdbar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--rock);
}

.dot--live {
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(43, 224, 166, 0.14);
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--graphite);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-toggle:hover { border-color: var(--red); color: var(--paper); }
.nav-toggle[aria-expanded="true"] { border-color: var(--red); }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.nav-toggle__bars i {
  display: block;
  height: 1px;
  width: 100%;
  background: currentColor;
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.nav-toggle__text { line-height: 1; }

/* 主导航 */
.site-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px 0 10px;
  min-width: 0;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.site-nav__item { display: block; }

.site-nav__link {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 14px 11px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.site-nav__idx {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--rock);
  transition: color 0.18s var(--ease);
}

.site-nav__label { line-height: 1.3; white-space: nowrap; }

.site-nav__link:hover {
  color: var(--paper);
  border-bottom-color: rgba(200, 16, 46, 0.55);
}

.site-nav__link[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--red);
  background: linear-gradient(180deg, rgba(200, 16, 46, 0.14), rgba(200, 16, 46, 0));
}

.site-nav__link[aria-current="page"] .site-nav__idx { color: var(--cyan); }

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* 滚动进度 */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--ochre) 58%, var(--amber) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: transparent;
  border: 1px solid var(--graphite);
  border-radius: 0;
  color: var(--paper);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.btn::after {
  content: "›";
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn--primary:hover { background: var(--red-deep); border-color: var(--red-deep); }

.btn--ghost { color: var(--text-soft); }

.btn--ghost:hover {
  color: var(--paper);
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(43, 224, 166, 0.35);
}

/* ---------- 面包屑 ---------- */
.breadcrumb { margin-bottom: clamp(20px, 2.6vw, 32px); }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
}

.breadcrumb__item { display: flex; align-items: center; gap: 8px; }

.breadcrumb__link {
  color: var(--rock);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.breadcrumb__link:hover { color: var(--paper); border-bottom-color: var(--red); }

.breadcrumb__current { color: var(--paper); font-weight: 700; }

.breadcrumb__sep { color: rgba(244, 242, 238, 0.22); }

/* ---------- 章节头与细线 ---------- */
.section-head { margin-bottom: clamp(18px, 2.4vw, 28px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--ochre);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 22px;
  height: 1px;
  background: var(--red);
}

.section-title { margin: 0 0 12px; }

.rule {
  display: block;
  height: 1px;
  width: 100%;
  border: 0;
  margin: clamp(18px, 2.4vw, 30px) 0;
  background: var(--graphite);
}

/* ---------- 面板与数据 ---------- */
.panel {
  position: relative;
  background: var(--carbon);
  border: 1px solid var(--graphite);
  padding: clamp(16px, 2vw, 24px);
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--graphite);
}

.panel__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--paper);
}

.stat { display: flex; flex-direction: column; gap: 2px; }

.stat__num {
  font-family: var(--font-num);
  font-size: clamp(28px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.stat__unit {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-left: 4px;
}

.stat__label {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--graphite);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
}

.tag::before {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  background: currentColor;
}

/* ---------- 筛选 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(16px, 2vw, 22px);
}

.filter-btn {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--graphite);
  border-radius: 0;
  color: var(--rock);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.filter-btn:hover { color: var(--paper); border-color: var(--hair-strong); }

.filter-btn[aria-pressed="true"] {
  color: var(--paper);
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(43, 224, 166, 0.3);
}

.filter-btn[aria-pressed="true"]::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  vertical-align: middle;
  background: var(--amber);
}

.filter-empty {
  padding: 20px;
  border: 1px dashed var(--graphite);
  color: var(--rock);
  font-size: 14px;
}

/* ---------- 图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--carbon);
  border: 1px solid var(--graphite);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72) contrast(1.06) brightness(0.92) hue-rotate(-4deg);
  transition: transform 0.5s var(--ease);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(244, 242, 238, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(14, 14, 16, 0.06) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
  opacity: 0.7;
}

.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 3 / 4; }

.media-frame:hover img { transform: scale(1.02); }

.media-frame__caption {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--rock);
}

/* 章节锚点 */
[data-chapter] { scroll-margin-top: 140px; }

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--carbon);
  border-top: 1px solid var(--graphite);
  color: var(--text-soft);
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--red) 0%,
    var(--red) 38%,
    var(--ochre) 38%,
    var(--ochre) 62%,
    var(--away) 62%,
    var(--away) 100%
  );
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 2.1fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(30px, 4vw, 54px) var(--pad) clamp(22px, 3vw, 38px);
}

.foot-brand { display: flex; flex-direction: column; gap: 12px; }

.foot-brand__name {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--paper);
  text-decoration: none;
  align-self: flex-start;
  border-bottom: 2px solid var(--red);
  padding-bottom: 2px;
}

.foot-brand__name:hover { color: var(--amber); border-bottom-color: var(--amber); }

.foot-brand__desc {
  max-width: 32ch;
  font-size: 13px;
  line-height: 1.75;
  color: var(--rock);
}

.foot-brand__contact {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
}

.foot-brand__note {
  max-width: 34ch;
  font-size: 12px;
  line-height: 1.7;
  color: var(--rock);
  padding-left: 10px;
  border-left: 1px solid var(--graphite);
}

.foot-index {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

.foot-col { min-width: 0; }

.foot-col__title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--graphite);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--paper);
}

.foot-col__list { display: grid; gap: 8px; margin: 0; padding: 0; }

.foot-col__link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.foot-col__link:hover { color: var(--paper); border-bottom-color: var(--red); }

/* 旧版资料库偏轴标签 */
.site-footer__legacy {
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--pad) clamp(24px, 3vw, 36px);
}

.legacy-tag {
  display: flex;
  flex-direction: column;
  max-width: 340px;
  padding: 10px 14px;
  background: var(--ink);
  border: 1px solid rgba(242, 193, 78, 0.55);
  color: var(--amber);
  font-size: 13px;
  line-height: 1.55;
  text-decoration: none;
  transform: rotate(-1.2deg);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.legacy-tag:hover,
.legacy-tag:focus-visible {
  transform: rotate(0deg);
  border-color: var(--amber);
  background: #141416;
}

.legacy-tag__label { font-weight: 700; }

.legacy-tag__note {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  font-size: 12px;
  color: var(--rock);
  transition: max-height 0.22s var(--ease), opacity 0.22s var(--ease), margin-top 0.22s var(--ease);
}

.legacy-tag:hover .legacy-tag__note,
.legacy-tag:focus-visible .legacy-tag__note {
  max-height: 72px;
  margin-top: 6px;
  opacity: 1;
}

/* 法律条 */
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  padding: 18px var(--pad) 28px;
  border-top: 1px solid var(--graphite);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--rock);
}

.legal-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.legal-link {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.legal-link:hover { color: var(--paper); border-bottom-color: var(--red); }

.legal-icp { margin: 0; }

.legal-year {
  margin: 0 0 0 auto;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--rock);
}

/* ---------- 平板 ---------- */
@media (max-width: 1100px) {
  .site-footer__top { grid-template-columns: minmax(0, 1fr); }
  .foot-index { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .site-nav { gap: 12px; padding-right: 12px; }
  .site-nav__link { padding: 14px 8px; }
  .site-nav__actions .btn--ghost { display: none; }
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: minmax(0, 1fr); }

  .site-header__rail {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 46px;
    padding: 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--graphite);
    position: relative;
    z-index: 4;
  }

  .rail-brand__text {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    font-size: 12px;
    letter-spacing: 0.24em;
  }

  .rail-year { letter-spacing: 0.14em; }

  .cmdbar { padding: 8px 14px; }
  .cmdbar__meta { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }

  .site-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 108px 20px 32px;
    background: var(--carbon);
    border-top: 2px solid var(--red);
    overflow-y: auto;
  }

  .site-nav[data-open] { display: flex; }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--graphite);
  }

  .site-nav__link {
    padding: 16px 4px;
    font-size: 17px;
    border-bottom: 1px solid var(--graphite);
    border-left: 2px solid transparent;
  }

  .site-nav__link[aria-current="page"] {
    border-left-color: var(--red);
    border-bottom-color: var(--graphite);
    background: rgba(200, 16, 46, 0.12);
  }

  .site-nav__idx { width: 26px; font-size: 12px; }

  .site-nav__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin: 24px 0 0;
  }

  .site-nav__actions .btn { justify-content: space-between; padding: 14px 16px; }
  .site-nav__actions .btn--ghost { display: inline-flex; }

  .site-footer__legacy { justify-content: flex-start; }
  .legacy-tag { transform: rotate(0deg); max-width: none; }
  .legacy-tag__note { max-height: 72px; margin-top: 6px; opacity: 1; }
}

/* ---------- 手机 ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; line-height: 1.8; }

  .foot-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .site-footer__legal { flex-direction: column; align-items: flex-start; }
  .legal-year { margin-left: 0; }
}

@media (max-width: 420px) {
  .foot-index { grid-template-columns: minmax(0, 1fr); }
  .site-nav { padding-top: 100px; }
  .cmdbar__path { font-size: 11px; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .scroll-meter { transition: none; }
  .media-frame:hover img { transform: none; }
}
