/* ==========================================================================
   华体网页版 · 共享外壳样式  /assets/site.css
   基调：深空蓝沉浸底色 + 1px 岩灰刻度边界 + 霓虹青/电光橙交互高亮
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --ink-900: #050B14;
  --ink-800: #0A1626;
  --ink-700: #10233A;
  --stone: #2E3540;
  --bone: #EDE6D8;
  --cyan: #35E0D0;
  --amber: #FF8A3D;
  --moss: #7E9C7A;
  --clay: #B5715A;
  --haze: #6B6B85;

  --line: 1px solid var(--stone);
  --radius: 2px;
  --shell: 1240px;
  --gutter: clamp(16px, 3vw, 34px);

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia,
    "Times New Roman", serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", Menlo, monospace;
}

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

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

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

ul, ol { list-style: none; }

img, svg, video { max-width: 100%; height: auto; }

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

[hidden] { display: none !important; }

/* ---------- 3. 页面基底 ---------- */
html {
  background: var(--ink-900);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--ink-800);
  background-image:
    radial-gradient(1100px 620px at 80% -12%, rgba(53, 224, 208, 0.09), transparent 62%),
    radial-gradient(760px 520px at 2% 6%, rgba(107, 107, 133, 0.14), transparent 60%),
    linear-gradient(180deg, #0A1626 0%, #08131F 100%);
  background-attachment: fixed;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.85;
  letter-spacing: 0.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

#main-content { scroll-margin-top: 130px; }

::selection {
  background: rgba(53, 224, 208, 0.28);
  color: var(--bone);
}

/* ---------- 4. 中文排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--bone);
}

h1 { font-size: clamp(30px, 4.6vw, 54px); }
h2 { font-size: clamp(23px, 3vw, 34px); }
h3 { font-size: clamp(18px, 2.1vw, 23px); }
h4 { font-size: 17px; letter-spacing: 0; }

p { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; color: #F5F0E6; }

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover { color: #62EBDE; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.94em;
  letter-spacing: 0.02em;
}

/* ---------- 5. 焦点可见 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.skip-link {
  position: absolute;
  top: -140px;
  left: 16px;
  z-index: 200;
  display: inline-block;
  padding: 12px 20px;
  background: var(--cyan);
  color: #06121F;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 14px;
  color: #06121F;
}

/* ---------- 6. 布局工具 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow { max-width: 880px; }

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

.panel {
  border: var(--line);
  border-radius: var(--radius);
  background: rgba(16, 35, 58, 0.62);
  padding: clamp(18px, 2.4vw, 30px);
}

.prose {
  max-width: 70ch;
  font-size: 16.8px;
  line-height: 1.9;
}

.prose h2 {
  margin-top: 2.2em;
  margin-bottom: 0.7em;
  padding-top: 0.9em;
  border-top: 1px solid var(--stone);
}

.prose h3 {
  margin-top: 1.7em;
  margin-bottom: 0.6em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.3em;
  padding-left: 1.3em;
}

.prose li { margin-bottom: 0.5em; list-style: disc; }
.prose ol li { list-style: decimal; }

.rule-list {
  border-top: 1px solid var(--stone);
}

.rule-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--stone);
  font-size: 15.5px;
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  background: transparent;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease,
    background-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1A0E06;
}

.btn--primary:hover {
  background: #FFA063;
  border-color: #FFA063;
  color: #1A0E06;
}

.btn--ghost {
  background: rgba(53, 224, 208, 0.06);
  border-color: rgba(53, 224, 208, 0.4);
  color: var(--cyan);
}

.btn--ghost:hover {
  background: rgba(53, 224, 208, 0.14);
  color: #7BF0E5;
}

.btn--block { width: 100%; }

/* ---------- 8. 微标签与状态 ---------- */
.micro {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--haze);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  background: rgba(16, 35, 58, 0.7);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--haze);
  white-space: nowrap;
}

.tag--cyan {
  color: var(--cyan);
  border-color: rgba(53, 224, 208, 0.45);
}

.tag--moss {
  color: #9FBE9A;
  border-color: rgba(126, 156, 122, 0.5);
}

.tag--clay {
  color: #D3907A;
  border-color: rgba(181, 113, 90, 0.5);
}

.tag--amber {
  color: var(--amber);
  border-color: rgba(255, 138, 61, 0.45);
}

/* ---------- 9. 面包屑 ---------- */
.breadcrumb { margin: 22px 0 0; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--haze);
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  margin-right: 8px;
  color: var(--stone);
}

.breadcrumb__link {
  color: var(--haze);
}

.breadcrumb__link:hover { color: var(--cyan); }

/* ---------- 10. 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(53, 224, 208, 0.10) 0%, rgba(53, 224, 208, 0) 46%),
    linear-gradient(315deg, rgba(255, 138, 61, 0.08) 0%, rgba(255, 138, 61, 0) 42%),
    var(--ink-700);
}

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

.media-frame > img,
.media-frame__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame__caption {
  display: block;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--haze);
}

/* ---------- 11. 滚动章节索引协议 ---------- */
[data-index-link] {
  color: var(--haze);
  text-decoration: none;
  transition: color 0.2s ease;
}

[data-index-link]:hover { color: var(--bone); }

[data-index-link][data-active] { color: var(--cyan); }

/* ---------- 12. 页头 · 居中刊头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink-800);
  border-bottom: 1px solid var(--stone);
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-image: linear-gradient(90deg,
      rgba(53, 224, 208, 0) 0%,
      rgba(53, 224, 208, 0.55) 50%,
      rgba(53, 224, 208, 0) 100%);
  background-size: 46% 100%;
  background-repeat: no-repeat;
  background-position: -46% 0;
  animation: headerRail 16s linear infinite;
  pointer-events: none;
}

@keyframes headerRail {
  0% { background-position: -46% 0; }
  100% { background-position: 146% 0; }
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  pointer-events: none;
}

.progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(53, 224, 208, 0.55);
  transition: width 0.14s linear;
}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas:
    "left mast right"
    "nav nav nav";
  align-items: center;
  gap: 4px 20px;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 26px var(--gutter) 15px;
  transition: padding 0.25s ease;
}

.masthead {
  grid-area: mast;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--bone);
}

.brand:hover { color: var(--bone); }

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.brand__suffix {
  padding: 2px 9px;
  border: 1px solid rgba(53, 224, 208, 0.35);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.masthead__tagline {
  margin-top: 9px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.15em;
  color: var(--haze);
}

.nav-toggle {
  grid-area: left;
  justify-self: start;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--stone);
  border-radius: var(--radius);
  background: transparent;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 0.24s ease, top 0.24s ease;
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

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

.site-nav {
  grid-area: nav;
  justify-self: center;
  min-width: 0;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.2vw, 34px);
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 2px 10px;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: rgba(237, 230, 216, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s ease;
}

.site-nav__link:hover { color: var(--bone); }
.site-nav__link:hover::after { transform: scaleX(1); }

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

.header-actions {
  grid-area: right;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- 13. 页头 · 收拢形态（桌面） ---------- */
@media (min-width: 901px) {
  .site-header[data-condensed] .site-header__inner {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "left mast nav right";
    gap: 22px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .site-header[data-condensed] .masthead {
    justify-self: start;
    text-align: left;
  }

  .site-header[data-condensed] .brand {
    flex-direction: row;
    align-items: baseline;
    gap: 9px;
  }

  .site-header[data-condensed] .brand__name { font-size: 19px; }

  .site-header[data-condensed] .brand__suffix {
    font-size: 10px;
    padding: 1px 7px;
  }

  .site-header[data-condensed] .masthead__tagline { display: none; }

  .site-header[data-condensed] .site-nav { justify-self: center; }

  .site-header[data-condensed] .site-nav__link {
    padding: 6px 2px;
    font-size: 14px;
  }

  .site-header[data-condensed] .btn { padding: 8px 16px; font-size: 13px; }
}

/* ---------- 14. 页脚 ---------- */
.site-footer {
  background: var(--ink-900);
  border-top: 1px solid var(--stone);
  color: var(--bone);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 50px);
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 70px) var(--gutter) clamp(28px, 4vw, 42px);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--bone);
}

.footer-brand__name:hover { color: var(--cyan); }

.footer-brand__suffix {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.footer-brand__note {
  max-width: 30ch;
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--stone);
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: var(--haze);
}

.footer-col__title {
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stone);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--haze);
}

.footer-col__list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-col__link {
  font-size: 15px;
  letter-spacing: 0.03em;
  color: rgba(237, 230, 216, 0.74);
}

.footer-col__link:hover { color: var(--cyan); }

.footer-contact {
  border-top: 1px solid var(--stone);
  background: rgba(16, 35, 58, 0.34);
}

.footer-contact__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 22px var(--gutter);
}

.footer-contact__line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: rgba(237, 230, 216, 0.82);
}

.footer-contact__address {
  margin: 0;
  font-size: 13.5px;
  color: var(--haze);
}

.footer-contact__legal {
  margin: 0 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--haze);
}

.footer-bottom {
  border-top: 1px solid rgba(46, 53, 64, 0.65);
  background: var(--ink-900);
}

.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 16px var(--gutter) 28px;
}

.footer-bottom__note {
  margin: 0;
  font-size: 13px;
  color: var(--haze);
}

.footer-bottom__year {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--haze);
}

/* ---------- 15. 响应式 · 移动端页头 ---------- */
@media (max-width: 900px) {
  .site-header__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "left mast right";
    gap: 10px;
    padding: 13px var(--gutter);
  }

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

  .masthead__tagline { display: none; }

  .brand { gap: 4px; }
  .brand__name { font-size: 21px; }

  .brand__suffix {
    font-size: 10px;
    padding: 1px 7px;
  }

  .header-actions .btn {
    padding: 9px 14px;
    font-size: 13px;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    z-index: 5;
    background: var(--ink-700);
    border-top: 1px solid var(--stone);
    border-bottom: 1px solid var(--stone);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav[data-open] { max-height: 78vh; }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px var(--gutter) 14px;
  }

  .site-nav__link {
    display: block;
    padding: 15px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(46, 53, 64, 0.7);
    color: rgba(237, 230, 216, 0.82);
  }

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

  .site-nav__item:last-child .site-nav__link { border-bottom: 0; }

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

  .site-nav__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background: var(--cyan);
  }
}

/* ---------- 16. 响应式 · 网格与页脚 ---------- */
@media (max-width: 1000px) {
  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 26px;
  }

  .footer-brand { grid-column: 1 / -1; }
  .footer-contact__legal { margin-left: 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }

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

  .site-footer__inner { grid-template-columns: minmax(0, 1fr); }

  .footer-contact__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ---------- 17. 降低动态效果 ---------- */
@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;
  }

  .site-header::before { display: none; }
  .progress__bar { transition: none; }
}
