/* ============================================================
   半岛赛场 · 共享样式表 /assets/site.css
   侧边品牌轨道 + 透明叠加导航 + 切角面板 + 珠宝色分区
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[data-nav-open="true"] { overflow: hidden; }

body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4, h5, h6 { font-weight: 400; }

/* ---------- 2. 变量 ---------- */
:root {
  --deep-sea: #0A2340;
  --deep-base: #061729;
  --tidal: #14405E;
  --gold: #D9A62E;
  --gold-light: #F0D08A;
  --gold-ink: #7A5A12;
  --race: #E4572E;
  --meadow: #1E5B54;
  --wine: #7B2B3B;
  --steel: #8FA6B8;
  --pearl: #F5F1E8;
  --ink: #0B0E12;
  --signal: #3FA37A;

  --halo: rgba(245, 241, 232, 0.78);
  --line: rgba(143, 166, 184, 0.22);
  --rail: 240px;
  --gutter: clamp(20px, 4vw, 64px);
  --rail-progress: 0%;

  --chamfer: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  --chamfer-sm: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Source Han Sans CN Light", "Source Han Sans CN", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-text: "Source Han Sans CN", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  background: var(--deep-base);
  color: var(--pearl);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}

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

::selection { background: var(--gold); color: var(--deep-base); }

.display {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.005em;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(26px, 3.6vw, 48px);
  line-height: 1.18;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.3;
}
.h4 { font-size: 18px; font-weight: 500; line-height: 1.5; letter-spacing: 0.01em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  transform: rotate(-14deg);
  flex: none;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.prose { max-width: 760px; font-size: 16px; line-height: 1.75; }
.prose > p + p { margin-top: 1.15em; }
.prose ul, .prose ol { margin: 1.1em 0; padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }

@media (min-width: 1024px) { .prose { font-size: 17px; } }

/* ---------- 4. 容器与分区 ---------- */
.shell {
  width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
@media (min-width: 1024px) {
  .shell--rail {
    padding-left: calc(var(--rail) + var(--gutter));
  }
}

.page-offset { padding-top: 64px; }
@media (min-width: 1024px) { .page-offset { padding-top: 72px; } }

.surface-deep { background: var(--deep-base); color: var(--pearl); }
.surface-sea { background: var(--deep-sea); color: var(--pearl); }
.surface-tidal { background: var(--tidal); color: var(--pearl); }
.surface-wine { background: var(--wine); color: var(--pearl); }
.surface-meadow { background: var(--meadow); color: var(--pearl); }
.surface-pearl { background: var(--pearl); color: var(--ink); }

.surface-pearl .eyebrow { color: var(--gold-ink); }
.surface-pearl .mono { color: var(--deep-sea); }
.surface-pearl .prose { color: #1c2229; }
.surface-pearl a:hover { color: var(--gold-ink); }

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

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 5. 装饰：14° 斜线与切角 ---------- */
.slash {
  display: block;
  width: 72px;
  height: 3px;
  background: var(--gold);
  transform: rotate(-14deg);
  transform-origin: left center;
}
.slash--wide { width: 120px; }
.slash--steel { background: var(--steel); opacity: 0.5; }

.panel {
  position: relative;
  background: var(--tidal);
  color: var(--pearl);
  padding: 28px;
  clip-path: var(--chamfer);
}
.panel--deep { background: var(--deep-sea); }
.panel--wine { background: var(--wine); }
.panel--meadow { background: var(--meadow); }
.panel--pearl { background: var(--pearl); color: var(--ink); }
.panel--pearl .mono { color: var(--deep-sea); }

/* ---------- 6. 状态点 ---------- */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steel);
  flex: none;
  display: inline-block;
}
.status-dot--signal { background: var(--signal); box-shadow: 0 0 0 3px rgba(63, 163, 122, 0.18); }
.status-dot--live {
  background: var(--race);
  box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.2);
  animation: dot-pulse 2.4s var(--ease) infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(228, 87, 46, 0.05); }
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.2;
  clip-path: var(--chamfer-sm);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn--gold { background: var(--gold); color: var(--deep-base); }
.btn--gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn--ghost {
  background: rgba(245, 241, 232, 0.06);
  color: var(--pearl);
  box-shadow: inset 0 0 0 1px rgba(245, 241, 232, 0.34);
}
.btn--ghost:hover { background: rgba(217, 166, 46, 0.16); color: var(--gold-light); }
.btn--sm { padding: 9px 16px; font-size: 12px; }
.btn--wine { background: var(--wine); color: var(--pearl); }
.btn--wine:hover { background: #93344a; }

/* ---------- 8. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 18px 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--steel);
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "/"; color: rgba(143, 166, 184, 0.45); }
.breadcrumb a:hover { color: var(--gold-light); }
.breadcrumb [aria-current="page"] { color: var(--pearl); }

/* ---------- 9. 图片容器 ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--deep-sea);
  clip-path: var(--chamfer);
}
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 23, 41, 0) 42%, rgba(6, 23, 41, 0.86));
  pointer-events: none;
}
.media--plain::after { display: none; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--21x9 { aspect-ratio: 21 / 9; }
.media-caption {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--steel);
}

/* ============================================================
   10. 页头
   ============================================================ */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--gold);
  color: var(--deep-base);
  font-size: 13px;
  letter-spacing: 0.06em;
  transform: translateY(-180%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: transparent;
  color: var(--pearl);
  transition: background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

/* 首屏透明状态下的压暗幕布 */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 23, 41, 0.78), rgba(6, 23, 41, 0));
  opacity: 1;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.site-header[data-scrolled="true"]::before { opacity: 0; }

/* 品牌轨道 · 运动轨迹进度线 */
.site-header::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: calc(var(--rail) - 1px);
  width: 2px;
  pointer-events: none;
  z-index: -1;
  background-image: linear-gradient(
    180deg,
    var(--gold-light) 0,
    var(--gold) var(--rail-progress),
    rgba(143, 166, 184, 0.24) var(--rail-progress),
    rgba(143, 166, 184, 0.24) 100%
  );
}

.site-header[data-scrolled="true"] {
  background: var(--deep-sea);
  box-shadow: 0 1px 0 rgba(217, 166, 46, 0.35), 0 14px 34px rgba(6, 23, 41, 0.5);
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  min-height: 72px;
}

.header-rail {
  flex: 0 0 var(--rail);
  width: var(--rail);
  display: flex;
  align-items: center;
  padding-left: clamp(16px, 2vw, 28px);
}

.header-bar {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: var(--gutter);
  min-width: 0;
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  min-width: 0;
}
.brand-sigil {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--deep-base);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  clip-path: var(--chamfer-sm);
}
.brand-words { display: block; min-width: 0; }
.brand-name {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.3;
  white-space: nowrap;
}
.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel);
  line-height: 1.4;
  white-space: nowrap;
}

/* 章节状态 */
.header-status {
  display: none;
  align-items: center;
  gap: 9px;
  flex: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  white-space: nowrap;
}
.site-header[data-scrolled="true"] .header-status { opacity: 1; }
.header-status-text { color: var(--gold-light); }

/* 主导航 */
.site-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-item { flex: none; }
.nav-link {
  position: relative;
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--halo);
  transition: color 0.25s var(--ease);
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease);
}
.nav-link:hover { color: var(--pearl); }
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--gold-light); }

.header-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.header-cta { white-space: nowrap; }

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--pearl);
}
.nav-toggle-bars { display: grid; gap: 5px; width: 22px; }
.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle-label { font-size: 12px; letter-spacing: 0.14em; }

/* 平板竖屏 / 手机：品牌轨道收起，导航转为右侧滑入面板 */
@media (max-width: 1023px) {
  .site-header::after { display: none; }
  .header-inner { min-height: 64px; }
  .header-rail { flex: 1 1 auto; width: auto; padding-left: 20px; }
  .header-bar { flex: 0 0 auto; margin-left: auto; padding-right: 16px; gap: 8px; }
  .header-status { display: none; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(84vw, 340px);
    margin-left: 0;
    padding: 92px 26px 40px;
    background: var(--deep-sea);
    border-left: 1px solid rgba(217, 166, 46, 0.32);
    box-shadow: -28px 0 64px rgba(6, 23, 41, 0.62);
    overflow-y: auto;
    transform: translateX(102%);
    transition: transform 0.42s var(--ease);
    z-index: 90;
  }
  .site-nav[data-open="true"] { transform: translateX(0); }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link {
    padding: 16px 0;
    font-size: 16px;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--line);
  }
  .nav-link::after {
    left: 0;
    right: auto;
    bottom: 10px;
    width: 28px;
  }
  .nav-link[aria-current="page"] { color: var(--gold-light); }
}

@media (max-width: 560px) {
  .brand-words { display: none; }
  .nav-toggle-label { display: none; }
  .header-cta { padding: 8px 12px; font-size: 11px; letter-spacing: 0.06em; }
}

@media (min-width: 1200px) {
  .header-status { display: flex; }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .nav-link { padding: 10px 8px; font-size: 12px; }
  .nav-link::after { left: 8px; right: 8px; }
}

/* ============================================================
   11. 页脚
   ============================================================ */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--deep-base);
  color: var(--pearl);
  padding-top: 76px;
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0, rgba(217, 166, 46, 0) 62%);
}
.footer-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 64, 94, 0.62), rgba(6, 23, 41, 0) 54%);
}
.footer-trail .slash {
  position: absolute;
  top: 34px;
  right: clamp(20px, 6vw, 120px);
  width: 160px;
  height: 4px;
  background: rgba(217, 166, 46, 0.4);
}

.footer-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
@media (min-width: 1024px) {
  .footer-inner { padding-left: calc(var(--rail) + var(--gutter)); }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding-bottom: 56px;
}
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-grid .footer-col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .footer-grid .footer-col:last-child { grid-column: auto; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid .footer-col:last-child { grid-column: auto; }
}

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

.brand--footer { padding: 0; margin-bottom: 4px; }

.footer-lede {
  max-width: 300px;
  margin: 18px 0 10px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(245, 241, 232, 0.82);
}
.footer-note {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--steel);
}
.footer-col .slash--wide { margin-top: 22px; }

.footer-title {
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-list li { margin-bottom: 10px; }
.footer-list a {
  font-size: 14px;
  color: rgba(245, 241, 232, 0.76);
  transition: color 0.25s var(--ease);
}
.footer-list a:hover { color: var(--gold-light); }

.footer-list--data li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}
.footer-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.footer-value {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(245, 241, 232, 0.88);
  word-break: break-word;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--steel);
}
.footer-cta { margin-top: 18px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  padding: 20px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--steel);
}
.footer-icp { color: var(--steel); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-legal a { color: var(--steel); transition: color 0.25s var(--ease); }
.footer-legal a:hover { color: var(--gold-light); }

/* ============================================================
   12. 回归顶部
   ============================================================ */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 70;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--deep-sea);
  color: var(--gold-light);
  box-shadow: inset 0 0 0 1px rgba(217, 166, 46, 0.45);
  clip-path: var(--chamfer-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s linear;
}
.to-top[data-visible="true"] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--gold); color: var(--deep-base); }
.to-top-arrow {
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg) translate(1px, 1px);
}

/* ============================================================
   13. 滚动显现
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.48s var(--ease), transform 0.48s var(--ease);
}
[data-reveal][data-revealed="true"] { opacity: 1; transform: none; }

[data-chapter] { scroll-margin-top: 96px; }

/* ============================================================
   14. 无障碍：减弱动效
   ============================================================ */
@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;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .site-nav { transition: none !important; }
  .btn--gold:hover { transform: none; }
}
