/* =========================================================
   米兰体育入口 · /assets/site.css
   共享外壳样式：reset / 变量 / 中文排版 / 头部 / 页脚 / 基础组件
   ========================================================= */

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

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

body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, figcaption, dl, dd, blockquote {
  margin: 0;
}

ul, ol { padding: 0; list-style: none; }

img, svg, video, canvas { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

table { border-collapse: collapse; width: 100%; }

[hidden] { display: none !important; }

/* ---------- 2. 设计令牌 ---------- */
:root {
  --ink: #0B0C10;
  --ink-2: #14161C;
  --red: #C8102E;
  --red-deep: #8C0A20;
  --cyan: #2EE6D6;
  --amber: #FFB020;
  --ivory: #F5F3EF;
  --mist: #9AA0A8;
  --line: #2A2E38;
  --mint: #7CF2C9;

  --font-display: "Arial Narrow", "Helvetica Neue Condensed", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono",
    Consolas, "Liberation Mono", monospace;

  --maxw: 1240px;
  --gutter: clamp(1.1rem, 4vw, 2.75rem);
  --header-h: 76px;

  --r-sm: 14px;
  --r-card: 24px;
  --r-lg: 28px;
  --r-pill: 999px;

  --dur: 0.2s;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);

  --shadow-up: 0 22px 50px -34px rgba(46, 230, 214, 0.55);
  --shadow-card: 0 26px 60px -46px rgba(0, 0, 0, 0.95);
}

/* ---------- 3. 基础排版 ---------- */
body {
  background-color: var(--ink);
  background-image:
    radial-gradient(90% 55% at 8% -6%, rgba(200, 16, 46, 0.20), transparent 62%),
    radial-gradient(70% 45% at 96% 4%, rgba(46, 230, 214, 0.07), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.96rem + 0.22vw, 1.125rem);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.006em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 1.3rem + 3.4vw, 4.5rem); }
h2 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.9vw, 1.7rem); }
h4 { font-size: clamp(1.02rem, 0.98rem + 0.4vw, 1.22rem); }

p { max-width: 68ch; }

a { transition: color var(--dur) var(--ease); }

::selection { background: var(--red); color: #fff; }

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

/* ---------- 4. 工具类 ---------- */
.ms-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ms-container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ms-num,
.ms-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

.ms-lede {
  font-size: clamp(1.02rem, 0.98rem + 0.45vw, 1.3rem);
  line-height: 1.72;
  color: #DCD9D3;
}

.ms-section {
  padding-block: clamp(3.25rem, 8vw, 7.5rem);
}

.ms-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: clamp(0.75rem, 2vw, 1.6rem);
  margin-bottom: clamp(1.5rem, 3.4vw, 2.75rem);
}

.ms-section__num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  flex: 0 0 auto;
}

.ms-section__num::after {
  content: "";
  display: block;
  width: 46%;
  height: 4px;
  margin-top: 0.5rem;
  background: var(--red);
  transform: skewX(-26deg);
}

.ms-section__label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 0.4rem;
}

.ms-section__title { flex: 1 1 18ch; min-width: 0; }

.ms-grid {
  display: grid;
  gap: clamp(1rem, 2.2vw, 1.75rem);
}

.ms-grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* ---------- 5. 按钮 ---------- */
.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.ms-btn--primary {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  box-shadow: 0 12px 26px -16px rgba(200, 16, 46, 0.95);
}

.ms-btn--primary:hover,
.ms-btn--primary:focus-visible {
  background: linear-gradient(135deg, #E01335, var(--red));
  transform: translateY(-2px);
}

.ms-btn--ghost {
  background: rgba(20, 22, 28, 0.5);
  color: var(--ivory);
  border-color: var(--line);
}

.ms-btn--ghost:hover,
.ms-btn--ghost:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 214, 0.22);
}

.ms-btn--cyan {
  background: var(--cyan);
  color: #04211E;
}

.ms-btn--cyan:hover,
.ms-btn--cyan:focus-visible {
  background: #5BF0E4;
  transform: translateY(-2px);
}

.ms-btn--sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
}

/* ---------- 6. 头部 · 命令栏 ---------- */
.ms-skip {
  position: absolute;
  left: var(--gutter);
  top: -120px;
  z-index: 90;
  padding: 0.65rem 1.1rem;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--cyan);
  color: #04211E;
  font-size: 0.84rem;
  font-weight: 700;
  transition: top var(--dur) var(--ease);
}

.ms-skip:focus { top: 0; }

.ms-header {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: var(--header-h);
  background: linear-gradient(180deg, rgba(11, 12, 16, 0.97), rgba(11, 12, 16, 0.86));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transition: min-height 0.28s var(--ease);
}

.ms-header.is-compact { --header-h: 58px; }

.ms-header__inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.55rem var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.4rem);
  transition: min-height 0.28s var(--ease);
}

/* 品牌 */
.ms-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
}

.ms-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--red), var(--red-deep));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.05em;
  line-height: 1;
  box-shadow: 0 8px 20px -10px rgba(200, 16, 46, 0.9);
  flex: 0 0 auto;
}

.ms-brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(0.98rem, 0.9rem + 0.3vw, 1.16rem);
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  color: var(--ivory);
}

.ms-brand--foot .ms-brand__mark { width: 38px; height: 38px; }

/* 收缩态当前栏目 */
.ms-current {
  display: none;
  align-items: center;
  margin-left: auto;
  padding: 0.36rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(46, 230, 214, 0.10);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 214, 0.42);
  white-space: nowrap;
}

/* 命令栏 */
.ms-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.ms-nav__list {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}

.ms-nav__list::-webkit-scrollbar { display: none; }

.ms-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.48rem 0.82rem;
  border-radius: var(--r-pill);
  color: var(--mist);
  font-size: 0.87rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.ms-nav__idx {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0;
  color: #4A4F5A;
  transition: color var(--dur) var(--ease);
}

.ms-nav__link::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.26rem;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.26s var(--ease);
}

.ms-nav__link:hover { color: var(--ivory); }
.ms-nav__link:hover .ms-nav__idx { color: var(--cyan); }
.ms-nav__link:hover::after { transform: scaleX(1); }

.ms-nav__link[aria-current="page"] {
  color: var(--cyan);
  background: rgba(46, 230, 214, 0.10);
  box-shadow: inset 0 0 0 1px rgba(46, 230, 214, 0.45);
}

.ms-nav__link[aria-current="page"] .ms-nav__idx { color: var(--cyan); }
.ms-nav__link[aria-current="page"]::after { transform: scaleX(0); }

/* 头部右侧 */
.ms-header__aside {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.ms-header__cta { flex: 0 0 auto; }

/* 同步徽标 */
.ms-update-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(20, 22, 28, 0.8);
  color: var(--mist);
  font-size: 0.75rem;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.ms-update-badge:hover,
.ms-update-badge:focus-visible {
  border-color: rgba(255, 176, 32, 0.6);
  color: var(--ivory);
}

.ms-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.14);
  flex: 0 0 auto;
}

.ms-update-badge__text { white-space: nowrap; }
.ms-update-badge__text .ms-num { font-size: 0.75rem; }

.ms-update-badge__pop {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 15rem;
  padding: 0.62rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #101218;
  color: var(--mist);
  font-family: var(--font-sans);
  font-size: 0.77rem;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    visibility var(--dur);
}

.ms-update-badge:hover .ms-update-badge__pop,
.ms-update-badge:focus-visible .ms-update-badge__pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 移动导航按钮 */
.ms-nav-toggle {
  display: none;
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(20, 22, 28, 0.72);
  color: var(--ivory);
  transition: border-color var(--dur) var(--ease);
}

.ms-nav-toggle:hover,
.ms-nav-toggle:focus-visible { border-color: var(--cyan); }

.ms-nav-toggle__bars {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 5px;
}

.ms-nav-toggle__bars span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ivory);
  transition: transform 0.24s var(--ease), opacity 0.2s var(--ease);
}

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

.ms-nav-toggle[aria-expanded="true"] .ms-nav-toggle__bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.ms-nav-toggle[aria-expanded="true"] .ms-nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.ms-nav-toggle[aria-expanded="true"] .ms-nav-toggle__bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 滚动进度 */
.ms-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--amber) 48%, var(--cyan));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ---------- 7. 页脚 ---------- */
.ms-footer {
  position: relative;
  margin-top: clamp(3.5rem, 8vw, 7rem);
  background: linear-gradient(180deg, var(--ink) 0%, #08090D 58%, #06070A 100%);
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.ms-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 260px;
  background:
    linear-gradient(112deg, rgba(200, 16, 46, 0.30), transparent 46%),
    radial-gradient(58% 100% at 88% 0%, rgba(46, 230, 214, 0.10), transparent 66%);
  clip-path: polygon(0 0, 100% 0, 100% 34%, 0 100%);
  pointer-events: none;
}

.ms-footer__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.1fr 1.3fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(2rem, 4vw, 3.25rem);
}

.ms-footer__brandcol { min-width: 0; }

.ms-footer__motto {
  margin-top: 1.05rem;
  max-width: 30ch;
  color: var(--mist);
  font-size: 0.93rem;
  line-height: 1.7;
}

.ms-footer__meta {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: #6C727C;
}

.ms-footer__meta .ms-num { color: var(--mist); letter-spacing: 0.01em; }

.ms-footer__col { min-width: 0; }

.ms-footer__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory);
}

.ms-footer__title::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  flex: 0 0 auto;
}

.ms-footer__list li + li { margin-top: 0.55rem; }

.ms-footer__list a {
  position: relative;
  display: inline-block;
  color: var(--mist);
  font-size: 0.9rem;
  transition: color var(--dur) var(--ease);
}

.ms-footer__list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.24s var(--ease);
}

.ms-footer__list a:hover,
.ms-footer__list a:focus-visible { color: var(--cyan); }
.ms-footer__list a:hover::after,
.ms-footer__list a:focus-visible::after { transform: scaleX(1); }

.ms-footer__list--plain li {
  color: var(--mist);
  font-size: 0.88rem;
  line-height: 1.65;
}

.ms-footer__key {
  display: inline-block;
  min-width: 2.6em;
  margin-right: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #6C727C;
}

.ms-footer__note {
  margin-top: 0.9rem;
  max-width: 30ch;
  font-size: 0.78rem;
  line-height: 1.65;
  color: #6C727C;
}

.ms-footer__bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.2rem;
  border-top: 1px solid var(--line);
}

.ms-footer__legal {
  font-size: 0.79rem;
  color: var(--mist);
  max-width: none;
}

/* ---------- 8. 通用内容组件 ---------- */
/* 档案卡 */
.ms-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(1.1rem, 2.2vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: linear-gradient(160deg, var(--ink-2), #101218);
  transition: border-color 0.22s var(--ease),
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.ms-card:hover,
.ms-card:focus-within {
  border-color: rgba(46, 230, 214, 0.55);
  transform: translateY(-2px);
  box-shadow: var(--shadow-up);
}

.ms-card__tag {
  position: absolute;
  top: clamp(0.85rem, 1.6vw, 1.3rem);
  left: clamp(0.85rem, 1.6vw, 1.3rem);
}

.ms-card__num {
  position: absolute;
  top: clamp(0.85rem, 1.6vw, 1.3rem);
  right: clamp(0.85rem, 1.6vw, 1.3rem);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #545A65;
}

.ms-card__foot {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  color: var(--mist);
}

/* 胶囊标签 */
.ms-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.66rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(11, 12, 16, 0.62);
  color: var(--mist);
  font-family: var(--font-display);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
}

.ms-tag--red {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}

.ms-tag--cyan {
  background: rgba(46, 230, 214, 0.10);
  border-color: rgba(46, 230, 214, 0.5);
  color: var(--cyan);
}

.ms-tag--amber {
  background: rgba(255, 176, 32, 0.10);
  border-color: rgba(255, 176, 32, 0.45);
  color: var(--amber);
}

/* 筛选胶囊 */
.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.46rem 0.98rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--mist);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  transition: color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.ms-chip:hover {
  color: var(--ivory);
  border-color: #4A4F5A;
}

.ms-chip[aria-pressed="true"],
.ms-chip.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-1px);
}

/* 斜切分隔条 */
.ms-divider {
  position: relative;
  height: clamp(72px, 10vw, 132px);
  margin-block: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(102deg, var(--red-deep) 0%, var(--red) 33%, #1A0D12 64%, var(--ink-2) 100%);
  clip-path: polygon(0 26%, 100% 0, 100% 74%, 0 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ms-divider__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  transform: translateY(-6%);
}

.ms-divider__num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(245, 243, 239, 0.94);
}

/* 媒体容器 */
.ms-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(200, 16, 46, 0.35), transparent 58%),
    radial-gradient(90% 80% at 88% 92%, rgba(46, 230, 214, 0.18), transparent 60%),
    linear-gradient(150deg, #171A21, #0D0F14);
}

.ms-media img,
.ms-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ms-media--wide { aspect-ratio: 16 / 9; }
.ms-media--band { aspect-ratio: 24 / 9; }
.ms-media--square { aspect-ratio: 1 / 1; }
.ms-media--tall { aspect-ratio: 3 / 4; }
.ms-media--flow { aspect-ratio: auto; }

.ms-media__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 36%, rgba(11, 12, 16, 0.84) 100%);
  pointer-events: none;
}

.ms-media__caption {
  position: absolute;
  left: clamp(0.9rem, 2vw, 1.4rem);
  right: clamp(0.9rem, 2vw, 1.4rem);
  bottom: clamp(0.8rem, 1.8vw, 1.25rem);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--mist);
}

.ms-media__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 5rem);
  letter-spacing: -0.05em;
  color: rgba(245, 243, 239, 0.07);
  user-select: none;
}

/* 面包屑 */
.ms-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--mist);
}

.ms-breadcrumb a { color: var(--mist); }
.ms-breadcrumb a:hover,
.ms-breadcrumb a:focus-visible { color: var(--cyan); }

.ms-breadcrumb__sep {
  color: #4A4F5A;
  font-family: var(--font-mono);
}

.ms-breadcrumb [aria-current="page"] { color: var(--ivory); }

/* 侧边章节浮标 */
.ms-sideindex {
  position: fixed;
  right: clamp(0.6rem, 1.6vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.ms-sideindex__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  color: var(--mist);
  transition: color var(--dur) var(--ease);
}

.ms-sideindex__name {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  transition: max-width 0.28s var(--ease), opacity 0.2s var(--ease);
}

.ms-sideindex__num { letter-spacing: 0.02em; }

.ms-sideindex__dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  flex: 0 0 auto;
}

.ms-sideindex__item:hover,
.ms-sideindex__item:focus-visible { color: var(--ivory); }

.ms-sideindex__item:hover .ms-sideindex__name,
.ms-sideindex__item:focus-visible .ms-sideindex__name,
.ms-sideindex__item.is-active .ms-sideindex__name {
  max-width: 11rem;
  opacity: 1;
}

.ms-sideindex__item.is-active { color: var(--cyan); }

.ms-sideindex__item.is-active .ms-sideindex__dot {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(46, 230, 214, 0.16);
}

/* 章节锚点避让粘性头部 */
[data-chapter] { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ---------- 9. 响应式 ---------- */
@media (min-width: 1180px) {
  .ms-sideindex { display: flex; }
}

@media (min-width: 901px) {
  .ms-header.is-compact .ms-nav { display: none; }
  .ms-header.is-compact .ms-current { display: inline-flex; }
  .ms-header.is-compact .ms-brand__name { font-size: 0.98rem; }
}

@media (max-width: 1080px) {
  .ms-footer__inner { grid-template-columns: 1fr 1fr; }
  .ms-grid--12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }

  .ms-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .ms-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex: none;
    padding: 0.9rem var(--gutter) 1.4rem;
    background: linear-gradient(180deg, #101218, #0B0C10);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 60px -40px #000;
  }

  .ms-nav[data-open="false"] { display: none; }

  .ms-nav[data-open="true"] {
    display: block;
    animation: ms-panel-in 0.22s var(--ease) both;
  }

  .ms-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0;
    overflow: visible;
  }

  .ms-nav__link {
    justify-content: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: var(--r-sm);
    font-size: 1rem;
  }

  .ms-nav__link::after { display: none; }

  .ms-header__cta { display: none; }

  .ms-header.is-compact { --header-h: 58px; }
}

@keyframes ms-panel-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .ms-grid--12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ms-section__head { align-items: flex-start; }
  .ms-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
  .ms-footer__bottom { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .ms-update-badge { display: none; }
  .ms-grid--12 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ms-brand__name { font-size: 0.95rem; }
  .ms-divider { clip-path: polygon(0 18%, 100% 0, 100% 82%, 0 100%); }
}

/* ---------- 10. 动效偏好 ---------- */
@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;
  }

  .ms-card:hover,
  .ms-card:focus-within,
  .ms-btn:hover { transform: none; }

  .ms-progress { transition: none; }
}
