/* ============================================================
   米兰体育官网 · 共享样式表 /assets/site.css
   深夜赛场 + 数据仪表盘 · 堆叠画板系统
   ============================================================ */

:root {
  --ink: #0A0B0F;
  --panel: #15171E;
  --panel-soft: #1B1E27;
  --red: #C8102E;
  --red-deep: #7A0B1D;
  --red-bright: #FF5C6E;
  --cyan: #14E0D2;
  --gold: #F2B441;
  --porcelain: #EDEFF2;
  --mist: #9AA3B0;
  --line: #232733;

  --rail-w: 264px;
  --pad-x: clamp(20px, 5vw, 72px);
  --max-w: 1240px;

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Noto Sans Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-narrow: "Barlow Condensed", "Oswald", "Arial Narrow", "Noto Sans SC", sans-serif;

  --shadow-panel: 0 26px 60px rgba(0, 0, 0, .55);
  --radius: 2px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; }
h1, h2, h3, h4 { font-weight: 900; line-height: 1.15; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius);
}
::selection { background: var(--red); color: #fff; }

/* ---------- 版面基底 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(200, 16, 46, .10), rgba(200, 16, 46, 0) 480px),
    repeating-linear-gradient(90deg, rgba(35, 39, 51, .42) 0 1px, rgba(0, 0, 0, 0) 1px 96px);
  color: var(--porcelain);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  body { padding-left: var(--rail-w); }
}

/* ---------- 跳转链接 ---------- */
.ms-skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 11px 18px;
  background: var(--cyan);
  color: #04120f;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform .2s var(--ease);
}
.ms-skip:focus { transform: translateY(0); }

/* ---------- 头部骨架 ---------- */
.ms-header { position: relative; z-index: 80; }

.ms-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #191c25;
  z-index: 160;
  pointer-events: none;
}
.ms-progress__fill {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(20, 224, 210, .7);
  transition: transform .12s linear;
}
@media (min-width: 1024px) {
  .ms-progress { left: var(--rail-w); }
}

/* ---------- 移动顶栏 ---------- */
.ms-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px 13px;
  background: linear-gradient(180deg, rgba(10, 11, 15, .99), rgba(10, 11, 15, .86));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.ms-topbar__brand {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .03em;
  color: var(--porcelain);
}
.ms-topbar__brand::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 6px;
  background: var(--red);
}

.ms-nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--porcelain);
  font-size: 13px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.ms-nav-toggle__bars { position: relative; display: block; width: 20px; height: 14px; }
.ms-nav-toggle__bars i {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--porcelain);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.ms-nav-toggle__bars i:first-child { top: 1px; }
.ms-nav-toggle__bars i:last-child { bottom: 1px; }
.ms-nav-toggle__text { line-height: 1; }
.ms-nav-toggle:hover { border-color: var(--mist); }
.ms-nav-toggle[aria-expanded="true"] { border-color: var(--red); color: var(--cyan); }
.ms-nav-toggle[aria-expanded="true"] .ms-nav-toggle__bars i { background: var(--cyan); }
.ms-nav-toggle[aria-expanded="true"] .ms-nav-toggle__bars i:first-child { transform: translateY(5px) rotate(45deg); }
.ms-nav-toggle[aria-expanded="true"] .ms-nav-toggle__bars i:last-child { transform: translateY(-5px) rotate(-45deg); }

@media (min-width: 1024px) {
  .ms-topbar { display: none; }
}

/* ---------- 侧边轨道 ---------- */
.ms-rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px 20px 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, #0d0f16 0%, #0A0B0F 55%, #0c0e14 100%);
  border-right: 1px solid var(--line);
}
.ms-rail::after {
  content: "";
  position: absolute;
  top: 0; right: -1px;
  width: 2px;
  height: 34%;
  background: linear-gradient(180deg, var(--red), rgba(200, 16, 46, 0));
}

.ms-brandwrap { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ms-brand { display: block; color: var(--porcelain); }
.ms-brand__name {
  display: block;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1.15;
}
.ms-brand__name::before {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  margin-bottom: 11px;
  background: var(--red);
}
.ms-brand__sub {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--mist);
}
.ms-brand__badge {
  display: inline-block;
  margin-top: 13px;
  padding: 4px 11px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--gold);
  border: 1px solid rgba(242, 180, 65, .42);
  border-radius: 999px;
}

.ms-rail__nav { flex: 1 1 auto; }
.ms-rail__list { display: flex; flex-direction: column; gap: 2px; }
.ms-rail__item { display: block; }

.ms-rail__link {
  position: relative;
  display: grid;
  grid-template-columns: 8px 30px 1fr;
  grid-template-areas:
    "dot idx label"
    ".   .   note";
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: var(--mist);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.ms-rail__dot {
  grid-area: dot;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2b3040;
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.ms-rail__index {
  grid-area: idx;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: #5d6675;
  transition: color .2s var(--ease);
}
.ms-rail__label {
  grid-area: label;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.4;
}
.ms-rail__note {
  grid-area: note;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--mist);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .24s var(--ease), max-height .24s var(--ease);
}
.ms-rail__link:hover,
.ms-rail__link:focus-visible { background: var(--panel); color: var(--porcelain); }
.ms-rail__link:hover .ms-rail__note,
.ms-rail__link:focus-visible .ms-rail__note { opacity: 1; max-height: 44px; }

.ms-rail__link[aria-current="page"] { background: var(--panel-soft); color: var(--porcelain); }
.ms-rail__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--red);
}
.ms-rail__link[aria-current="page"] .ms-rail__dot {
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(20, 224, 210, .15);
}
.ms-rail__link[aria-current="page"] .ms-rail__index { color: var(--cyan); }
.ms-rail__link[aria-current="page"] .ms-rail__note { opacity: 1; max-height: 44px; }

.ms-rail__utility {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.ms-rail__cta,
.ms-rail__ghost { justify-content: center; font-size: 14px; padding: 12px 14px; }

/* ---------- 抽屉导航 ---------- */
.ms-drawer {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 104px 20px 40px;
  overflow-y: auto;
  background: rgba(8, 9, 13, .985);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .32s var(--ease), visibility .32s linear;
}
.ms-drawer[data-open] { transform: none; visibility: visible; }
html[data-nav-open] body { overflow: hidden; }

.ms-drawer__list { display: flex; flex-direction: column; gap: 2px; }
.ms-drawer__item { display: block; }
.ms-drawer__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--porcelain);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .02em;
  transition: color .2s var(--ease);
}
.ms-drawer__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--mist);
}
.ms-drawer__label { display: block; }
.ms-drawer__link:hover { color: var(--cyan); }
.ms-drawer__link[aria-current="page"] { color: var(--cyan); }
.ms-drawer__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  background: var(--red);
}
.ms-drawer__foot { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

@media (min-width: 1024px) {
  .ms-drawer { display: none; }
}

/* ---------- 按钮 ---------- */
.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.ms-btn:active { transform: translateY(1px); }
.ms-btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.ms-btn--primary:hover { background: var(--red-deep); border-color: var(--red-deep); }
.ms-btn--cyan { background: var(--cyan); border-color: var(--cyan); color: #04120f; }
.ms-btn--cyan:hover { background: #0fc4b8; border-color: #0fc4b8; }
.ms-btn--gold { background: transparent; border-color: rgba(242, 180, 65, .5); color: var(--gold); }
.ms-btn--gold:hover { background: rgba(242, 180, 65, .1); }
.ms-btn--ghost { background: transparent; border-color: var(--line); color: var(--porcelain); }
.ms-btn--ghost:hover { border-color: var(--mist); background: var(--panel-soft); }

/* ---------- 页脚 ---------- */
.ms-footer {
  position: relative;
  margin-top: clamp(72px, 10vw, 140px);
  background: linear-gradient(180deg, #0b0d13, #08090d);
  border-top: 1px solid var(--line);
}
.ms-footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: min(240px, 55%);
  height: 3px;
  background: var(--red);
}
.ms-footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: clamp(24px, 4vw, 56px);
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 84px) var(--pad-x) clamp(32px, 4vw, 48px);
}
.ms-footer__brand { min-width: 0; }
.ms-footer__mark { font-size: 22px; font-weight: 900; letter-spacing: .01em; }
.ms-footer__tag { margin-top: 7px; font-size: 12px; letter-spacing: .16em; color: var(--gold); }
.ms-footer__desc { margin-top: 14px; max-width: 34ch; font-size: 14px; color: var(--mist); }
.ms-footer__badge {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 11px;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.ms-footer__col { min-width: 0; }
.ms-footer__title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--cyan);
}
.ms-footer__list { display: flex; flex-direction: column; gap: 10px; }
.ms-footer__list a {
  font-size: 15px;
  color: var(--porcelain);
  transition: color .2s var(--ease);
}
.ms-footer__list a:hover { color: var(--red-bright); }

.ms-footer__contact { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--mist); }
.ms-footer__contact p { margin: 0; }
.ms-footer__mail {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  word-break: break-all;
}

.ms-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px var(--pad-x) 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--mist);
}
.ms-footer__sign { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }

.ms-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--porcelain);
  font-size: 13px;
  letter-spacing: .1em;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.ms-to-top:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- 通用版面组件 ---------- */
.ms-shell { width: 100%; max-width: var(--max-w); margin-inline: auto; }
.ms-main { display: block; padding: clamp(40px, 6vw, 96px) var(--pad-x) 0; }

.ms-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--mist);
}
.ms-crumbs a:hover { color: var(--porcelain); }
.ms-crumbs__sep { color: #3b4252; }
.ms-crumbs [aria-current="page"] { color: var(--cyan); }

.ms-head { position: relative; margin-bottom: 28px; padding-left: 18px; }
.ms-head::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--red);
}
.ms-head__index {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--cyan);
}
.ms-head__title {
  margin-top: 6px;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.ms-head__lede { margin-top: 10px; max-width: 62ch; color: var(--mist); }

.ms-panel {
  position: relative;
  padding: clamp(22px, 3vw, 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}
.ms-panel--offset { margin-left: clamp(0px, 4vw, 72px); }
.ms-panel--offset-r { margin-right: clamp(0px, 4vw, 72px); }
.ms-panel--red {
  background: linear-gradient(160deg, #1a0a10, var(--panel) 62%);
  border-color: #3a1119;
}
.ms-panel--flush { padding: 0; overflow: hidden; }

.ms-grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.ms-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1023px) {
  .ms-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ms-panel--offset { margin-left: 0; }
  .ms-panel--offset-r { margin-right: 0; }
}
@media (max-width: 639px) {
  .ms-grid--2,
  .ms-grid--3 { grid-template-columns: 1fr; }
}

.ms-divider {
  position: relative;
  height: 1px;
  margin: clamp(40px, 7vw, 88px) 0;
  background: var(--line);
}
.ms-divider::before {
  content: "";
  position: absolute;
  left: 0; top: -2px;
  width: min(180px, 40%);
  height: 5px;
  background: var(--red);
  transform: skewX(-24deg);
}

/* ---------- 文字与数据 ---------- */
.ms-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ms-tag--red { color: var(--red-bright); border-color: rgba(200, 16, 46, .45); }
.ms-tag--cyan { color: var(--cyan); border-color: rgba(20, 224, 210, .4); }
.ms-tag--gold { color: var(--gold); border-color: rgba(242, 180, 65, .42); }

.ms-data {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--cyan);
}
.ms-data--price { color: var(--gold); }
.ms-data--muted { color: var(--mist); }
.ms-data--xl { font-size: clamp(34px, 6vw, 64px); line-height: 1; }
.ms-data--lg { font-size: clamp(24px, 3vw, 40px); line-height: 1.1; }

.ms-note {
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--mist);
}
.ms-note--vertical {
  writing-mode: vertical-rl;
  letter-spacing: .18em;
  color: var(--mist);
}
@media (max-width: 767px) {
  .ms-note--vertical { writing-mode: horizontal-tb; }
}

/* ---------- 图像容器 ---------- */
.ms-figure {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #141821, #0c0e14 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}
.ms-figure--slant { clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%); }
.ms-figure__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(.94) contrast(1.06);
}
.ms-figure__cap {
  position: absolute;
  left: 0; bottom: 0;
  padding: 6px 12px;
  background: rgba(10, 11, 15, .82);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--cyan);
}

/* ---------- 显现动效 ---------- */
html[data-js="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
html[data-js="on"] [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 响应式：轨道与抽屉 ---------- */
@media (max-width: 1023px) {
  .ms-rail { display: none; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --rail-w: 96px; }
  .ms-rail { align-items: center; padding: 26px 12px 18px; }
  .ms-brandwrap { width: 100%; text-align: center; }
  .ms-brand__name {
    font-size: 14px;
    writing-mode: vertical-rl;
    letter-spacing: .12em;
    margin-inline: auto;
  }
  .ms-brand__name::before { width: 26px; height: 3px; margin: 0 auto 10px; }
  .ms-brand__sub,
  .ms-brand__badge { display: none; }
  .ms-rail__link {
    grid-template-columns: 1fr;
    grid-template-areas: "dot" "idx" "label";
    justify-items: center;
    row-gap: 6px;
    padding: 12px 0;
    width: 100%;
  }
  .ms-rail__label { writing-mode: vertical-rl; font-size: 13px; letter-spacing: .12em; }
  .ms-rail__index { font-size: 10px; }
  .ms-rail__note { display: none; }
  .ms-rail__link[aria-current="page"]::before { left: -12px; }
  .ms-rail__utility { display: none; }
}

/* ---------- 页脚响应式 ---------- */
@media (max-width: 1023px) {
  .ms-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ms-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .ms-footer__inner { grid-template-columns: 1fr; }
  .ms-footer__legal { flex-direction: column; align-items: flex-start; }
}

/* ---------- 降级动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html[data-js="on"] [data-reveal] { opacity: 1; transform: none; }
  .ms-drawer { transition: none; }
  .ms-progress__fill { transition: none; }
}
