/* ============================================================
   优乐在线站 · /assets/site.css
   共享外壳：框架式导航轨道 + 分节页脚 + 通用画布组件
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --ink-900: #071C2C;
  --deep-800: #0B3B46;
  --indigo-700: #243B6B;
  --cyan-400: #28E0D0;
  --orange-500: #FF8A3D;
  --sage-300: #B9CDBF;
  --paper-100: #F4F1E8;
  --text-900: #102129;
  --slate-500: #6E8589;

  --rail-w: 268px;
  --shell: 1180px;
  --gutter: clamp(18px, 4vw, 48px);

  --font-sans: "HarmonyOS Sans SC", "Inter", "Noto 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", "STSong", serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular",
    Menlo, Consolas, monospace;

  --radius-organic: 20px 8px 20px 8px;
  --radius-soft: 14px;
  --ease: cubic-bezier(0.22, 0.68, 0.35, 1);
  --shadow-quiet: 0 18px 44px -32px rgba(7, 28, 44, 0.55);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

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

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

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

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

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

/* ---------- 3. 中文排版基底 ---------- */
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-900);
  background: var(--paper-100);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, li {
  text-wrap: pretty;
}

h1, h2, h3, h4 {
  text-wrap: balance;
  line-height: 1.25;
}

main {
  display: block;
}

/* ---------- 4. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  padding: 11px 20px;
  border-radius: 0 0 12px 0;
  background: var(--cyan-400);
  color: #04222a;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 5. 框架式导航轨道（移动优先） ---------- */
.site-rail {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  width: 100%;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(40, 224, 208, 0.1), transparent 62%),
    linear-gradient(180deg, #061723 0%, var(--ink-900) 55%, var(--deep-800) 100%);
  color: var(--paper-100);
  border-bottom: 1px solid rgba(40, 224, 208, 0.24);
}

.site-rail[data-open] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: 0;
}

.rail-frame {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px var(--gutter);
}

.site-rail[data-open] .rail-frame {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 22px;
  min-height: 100%;
  padding: 14px var(--gutter) 34px;
}

.rail-head {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.rail-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 14px 5px 14px 5px;
  background: linear-gradient(140deg, var(--cyan-400), #17968f);
  color: #04222a;
  font-weight: 800;
  font-size: 19px;
  line-height: 1;
}

.rail-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rail-brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--paper-100);
}

.rail-brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(244, 241, 232, 0.5);
  white-space: nowrap;
}

.rail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid rgba(40, 224, 208, 0.45);
  border-radius: 999px;
  color: var(--cyan-400);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.rail-toggle:hover {
  background: rgba(40, 224, 208, 0.12);
}

.rail-toggle[aria-expanded="true"] {
  border-color: var(--orange-500);
  color: var(--orange-500);
}

.rail-toggle-lines {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 15px;
}

.rail-toggle-lines i {
  display: block;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}

/* 导航本体：移动端隐藏，展开时出现 */
.rail-nav,
.rail-foot {
  display: none;
}

.site-rail[data-open] .rail-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-rail[data-open] .rail-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.rail-nav-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(40, 224, 208, 0.8);
  padding-left: 12px;
}

.rail-nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rail-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 14px 11px 12px;
  border-radius: 11px;
  color: rgba(244, 241, 232, 0.72);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.rail-link:hover {
  color: var(--paper-100);
  background: rgba(40, 224, 208, 0.09);
}

.rail-link[aria-current="page"] {
  color: var(--paper-100);
  background: rgba(40, 224, 208, 0.14);
  box-shadow: inset 2px 0 0 var(--cyan-400);
}

.rail-link-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(110, 133, 137, 0.9);
  flex: 0 0 auto;
}

.rail-link[aria-current="page"] .rail-link-idx {
  color: var(--cyan-400);
}

.rail-link-text {
  font-size: 15.5px;
  font-weight: 500;
  transition: transform 0.18s var(--ease);
}

.rail-link:hover .rail-link-text {
  transform: translateX(2px);
}

.rail-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rail-stamp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(244, 241, 232, 0.5);
  padding-left: 2px;
}

.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange-500);
  box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.55);
  animation: rail-pulse 3.4s ease-out infinite;
}

@keyframes rail-pulse {
  0%, 62% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0.5); }
  100% { box-shadow: 0 0 0 9px rgba(255, 138, 61, 0); }
}

/* ---------- 6. 桌面端：导航成为左侧视觉边框 ---------- */
@media (min-width: 1080px) {
  html {
    scroll-padding-top: 24px;
  }

  body {
    padding-left: var(--rail-w);
  }

  .site-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: auto;
    width: var(--rail-w);
    border-bottom: 0;
    border-right: 1px solid rgba(40, 224, 208, 0.22);
    overflow: hidden;
  }

  .rail-frame {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 24px;
    height: 100%;
    padding: 26px 20px 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .rail-head {
    flex: 0 0 auto;
  }

  .rail-brand-sub {
    display: block;
  }

  .rail-toggle {
    display: none;
  }

  .rail-nav,
  .rail-foot {
    display: flex;
    flex-direction: column;
  }

  .rail-nav {
    flex: 1 1 auto;
    gap: 8px;
  }

  .rail-foot {
    gap: 16px;
    margin-top: auto;
  }
}

/* ---------- 7. 页脚 ---------- */
.site-foot {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #061723 0%, var(--ink-900) 46%, #05141f 100%);
  color: rgba(244, 241, 232, 0.78);
  border-top: 1px solid rgba(40, 224, 208, 0.2);
}

.site-foot::before {
  content: "";
  position: absolute;
  top: -280px;
  right: -200px;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 42%, rgba(36, 59, 107, 0.6), transparent 68%);
  pointer-events: none;
}

.foot-inner {
  position: relative;
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  padding: 56px 0 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 38px;
}

.foot-mark {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--paper-100);
}

.foot-note {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(244, 241, 232, 0.58);
  max-width: 34ch;
}

.foot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.foot-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 20px;
}

.foot-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(40, 224, 208, 0.82);
  margin-bottom: 14px;
}

.foot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot-list a {
  position: relative;
  display: inline-block;
  font-size: 15px;
  color: rgba(244, 241, 232, 0.74);
  transition: color 0.18s var(--ease);
}

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

.foot-list a:hover {
  color: var(--paper-100);
}

.foot-list a:hover::after {
  transform: scaleX(1);
}

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

.foot-contact-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.foot-contact-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--slate-500);
}

.foot-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--paper-100);
  word-break: break-all;
}

.foot-base {
  position: relative;
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(244, 241, 232, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(244, 241, 232, 0.48);
}

@media (min-width: 720px) {
  .foot-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 44px;
  }

  .foot-cols {
    gap: 32px;
  }
}

@media (min-width: 1080px) {
  .foot-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 48px;
    padding: 68px 0 42px;
  }
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease);
}

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

.btn--accent {
  background: var(--orange-500);
  color: #2a1608;
}

.btn--accent:hover {
  background: #ffa062;
}

.btn--outline {
  border-color: rgba(40, 224, 208, 0.45);
  color: var(--cyan-400);
}

.btn--outline:hover {
  background: rgba(40, 224, 208, 0.12);
  border-color: var(--cyan-400);
}

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

/* ---------- 9. 布局与画布 ---------- */
.wrap {
  width: min(var(--shell), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.section {
  padding: clamp(38px, 6vw, 76px) 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 62ch;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  color: var(--slate-500);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--orange-500);
  flex: 0 0 auto;
}

.title-sans {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.16;
}

.title-serif {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.24;
}

.lede {
  font-size: clamp(16px, 1.6vw, 18.5px);
  line-height: 1.78;
  color: rgba(16, 33, 41, 0.78);
}

.prose {
  max-width: 68ch;
  line-height: 1.8;
}

.prose p + p {
  margin-top: 1.05em;
}

.prose h2 {
  font-family: var(--font-sans);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  margin-top: 2em;
  margin-bottom: 0.55em;
}

.prose h3 {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 700;
  margin-top: 1.7em;
  margin-bottom: 0.45em;
}

.prose ul,
.prose ol {
  margin-top: 0.9em;
  padding-left: 1.15em;
  list-style: disc;
}

.prose li + li {
  margin-top: 0.4em;
}

.band {
  padding: clamp(38px, 5.5vw, 72px) 0;
}

.band--paper {
  background: var(--paper-100);
}

.band--sage {
  background: rgba(185, 205, 191, 0.3);
}

.band--dark {
  background:
    radial-gradient(90% 120% at 90% 0%, rgba(36, 59, 107, 0.55), transparent 62%),
    linear-gradient(160deg, var(--ink-900), var(--deep-800));
  color: var(--paper-100);
}

.band--dark .lede {
  color: rgba(244, 241, 232, 0.76);
}

.band--dark .eyebrow {
  color: rgba(185, 205, 191, 0.75);
}

/* ---------- 10. 网格与面板 ---------- */
.grid {
  display: grid;
  gap: var(--gap, 24px);
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

.panel {
  padding: clamp(20px, 2.6vw, 30px);
  border-radius: var(--radius-organic);
  background: rgba(185, 205, 191, 0.22);
}

.band--dark .panel {
  background: rgba(40, 224, 208, 0.08);
}

/* ---------- 11. 标签与面包屑 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(40, 224, 208, 0.14);
  color: #0a5a57;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tag--warm {
  background: rgba(255, 138, 61, 0.18);
  color: #8a4413;
}

.band--dark .tag {
  background: rgba(40, 224, 208, 0.16);
  color: var(--cyan-400);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--slate-500);
}

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

.crumbs li + li::before {
  content: "/";
  color: rgba(110, 133, 137, 0.55);
}

.crumbs a {
  color: var(--slate-500);
  transition: color 0.16s var(--ease);
}

.crumbs a:hover {
  color: var(--indigo-700);
}

.crumbs [aria-current="page"] {
  color: var(--text-900);
  font-weight: 500;
}

/* ---------- 12. 媒体容器基础 ---------- */
.media-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-organic);
  background:
    linear-gradient(135deg, var(--deep-800), var(--indigo-700) 58%, var(--ink-900));
  box-shadow: var(--shadow-quiet);
}

.media-frame > img,
.media-frame > picture > img,
.media-frame > svg,
.media-frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(114deg, transparent 45.6%, rgba(40, 224, 208, 0.32) 45.8%,
      rgba(40, 224, 208, 0.32) 46.4%, transparent 46.6%),
    radial-gradient(64% 58% at 88% 8%, rgba(255, 138, 61, 0.26), transparent 72%);
}

.media-frame--wide {
  aspect-ratio: 21 / 9;
}

.media-frame--tall {
  aspect-ratio: 4 / 5;
}

.media-frame--square {
  aspect-ratio: 1 / 1;
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--slate-500);
}

/* ---------- 13. 页面内目录（滚动高亮） ---------- */
.spy-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spy-list a {
  display: block;
  padding: 9px 12px 9px 15px;
  border-radius: 9px;
  font-size: 14.5px;
  color: var(--slate-500);
  box-shadow: inset 2px 0 0 rgba(110, 133, 137, 0.28);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.spy-list a:hover {
  color: var(--indigo-700);
  background: rgba(36, 59, 107, 0.06);
}

.spy-list a.is-active {
  color: var(--text-900);
  font-weight: 700;
  background: rgba(255, 138, 61, 0.09);
  box-shadow: inset 2px 0 0 var(--orange-500);
}

/* ---------- 14. 阅读进度轨 ---------- */
.progress-track {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 80;
  pointer-events: none;
  background: rgba(7, 28, 44, 0.35);
}

.progress-fill {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan-400), var(--orange-500));
  transition: transform 0.12s linear;
}

@media (min-width: 1080px) {
  .progress-track {
    left: var(--rail-w);
    height: 4px;
  }
}

/* ---------- 15. 显现 ---------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 16. 减少动态 ---------- */
@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;
  }

  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .rail-dot {
    animation: none;
  }
}

/* ---------- 17. 打印 ---------- */
@media print {
  .site-rail,
  .site-foot,
  .progress-track,
  .skip-link {
    display: none !important;
  }

  body {
    padding-left: 0 !important;
    background: #fff;
    color: #000;
  }

  .band--dark {
    background: #fff !important;
    color: #000 !important;
  }
}
