/* ==========================================================================
   优乐电子站 · Site Kit 共享层
   冷底：晨雾蓝 / 深草海蓝 / 墨夜蓝　信号色：电子荧光青　刻度色：暖沙金
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { padding: 0; list-style: none; }
img, svg, picture, 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; }
input, textarea, select { font: inherit; color: inherit; }
p, li { overflow-wrap: break-word; }

:root {
  --ink: #061826;
  --mist: #6F8FA6;
  --deep: #0E2F44;
  --cyan: #2BE7C8;
  --sand: #D8B36A;
  --paper: #F5F8F7;
  --fog: #DCE8E8;
  --slate: #2C4A5A;
  --stable: #1F8F78;
  --maint: #8A7FA6;

  --font-title: Inter, 'Noto Sans SC', 'Source Han Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --w-max: 1180px;
  --gutter: clamp(1.15rem, 4vw, 3rem);
  --hairline: rgba(111, 143, 166, .34);
  --radius: 3px;
  --header-h: 66px;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 焦点与可访问性 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}
.site-header[data-scrolled="true"] :focus-visible,
.site-header[data-nav-open="true"] :focus-visible,
.site-nav :focus-visible { outline-color: var(--deep); }
.site-footer :focus-visible { outline-color: var(--cyan); }

/* ---------- 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 860px; }

.section {
  position: relative;
  padding-block: clamp(2.6rem, 6vw, 5.5rem);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  max-width: 70ch;
  margin-bottom: clamp(1.4rem, 3vw, 2.6rem);
}

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1rem; }

/* ---------- 排版原子 ---------- */
.mono {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: .07em;
  font-variant-numeric: tabular-nums;
}

.section-num {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--mist);
}
.section-num::after {
  content: "";
  display: block;
  width: clamp(28px, 6vw, 56px);
  height: 1px;
  background: var(--sand);
}

.section-title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -.012em;
  color: var(--ink);
}

.lede {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.85;
  color: var(--slate);
  max-width: 62ch;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .78rem 1.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-title);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  transition: transform .2s ease, background-color .2s ease, color .2s ease,
              border-color .2s ease, box-shadow .2s ease;
}
.btn--primary {
  background: var(--cyan);
  color: #04151f;
  box-shadow: 0 14px 32px -22px rgba(43, 231, 200, .95);
}
.btn--primary:hover {
  background: #22d3b6;
  transform: translateY(-1px);
}
.btn--ghost {
  border-color: var(--hairline);
  color: var(--slate);
  background: transparent;
}
.btn--ghost:hover {
  color: var(--ink);
  border-color: var(--cyan);
  background: rgba(43, 231, 200, .1);
}

/* ---------- 资料组件 ---------- */
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--fog);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 2vw, 1.6rem);
  box-shadow: 0 20px 40px -38px rgba(6, 24, 38, .7);
}

.paper {
  position: relative;
  background: #fff;
  border: 1px solid var(--fog);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 2.4vw, 2rem);
  box-shadow:
    5px 5px 0 -1px #fff,
    5px 5px 0 0 var(--fog),
    11px 11px 0 -1px #fff,
    11px 11px 0 0 var(--fog);
  transition: box-shadow .3s ease;
}
.paper:hover {
  box-shadow:
    8px 8px 0 -1px #fff,
    8px 8px 0 0 var(--fog),
    16px 16px 0 -1px #fff,
    16px 16px 0 0 var(--fog);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .55rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: rgba(245, 248, 247, .8);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--live {
  color: #0a5c51;
  border-color: rgba(43, 231, 200, .62);
  background: rgba(43, 231, 200, .13);
}
.tag--stable {
  color: #0d5f50;
  border-color: rgba(31, 143, 120, .5);
  background: rgba(31, 143, 120, .1);
}
.tag--maint {
  color: #574d70;
  border-color: rgba(138, 127, 166, .55);
  background: rgba(138, 127, 166, .13);
}
.tag--sand {
  color: #7a5a1d;
  border-color: rgba(216, 179, 106, .62);
  background: rgba(216, 179, 106, .15);
}

/* ---------- 可复用图像容器 ---------- */
.media-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(111, 143, 166, .4);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 95% at 12% 0%, rgba(43, 231, 200, .18), transparent 62%),
    radial-gradient(90% 70% at 92% 100%, rgba(216, 179, 106, .14), transparent 60%),
    linear-gradient(160deg, var(--deep), var(--ink));
}
.media-frame > img,
.media-frame > picture,
.media-frame > picture > img,
.media-frame > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(245, 248, 247, .055) 0 1px,
    transparent 1px 4px
  );
}
.media-frame--wide { aspect-ratio: 21 / 9; }

.media-frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: .75rem 1rem .7rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--paper);
  background: linear-gradient(180deg, transparent, rgba(6, 24, 38, .88));
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--slate);
}
.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.breadcrumb a {
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.breadcrumb a:hover {
  color: var(--ink);
  border-bottom-color: var(--cyan);
}
.breadcrumb__sep { color: var(--mist); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- 显现动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 侧边章节目录 ---------- */
[data-chapter-link] {
  display: block;
  padding: .38rem 0 .38rem .9rem;
  border-left: 2px solid var(--fog);
  font-size: .88rem;
  line-height: 1.6;
  color: var(--slate);
  transition: color .2s ease, border-color .2s ease;
}
[data-chapter-link]:hover {
  color: var(--ink);
  border-left-color: var(--mist);
}
[data-chapter-link][aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--cyan);
}

/* ==========================================================================
   站点头部
   ========================================================================== */
.site-header {
  --nav-fg: var(--paper);
  --nav-dim: rgba(245, 248, 247, .74);
  position: sticky;
  top: 0;
  z-index: 80;
  color: var(--nav-fg);
  background: rgba(6, 24, 38, .82);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid rgba(43, 231, 200, .16);
  transition: background-color .35s ease, color .35s ease,
              border-color .35s ease, box-shadow .35s ease;
}

.site-header[data-scrolled="true"],
.site-header[data-nav-open="true"] {
  --nav-fg: var(--ink);
  --nav-dim: var(--slate);
  color: var(--ink);
  background: rgba(245, 248, 247, .97);
  border-bottom-color: var(--fog);
  box-shadow: 0 18px 40px -34px rgba(6, 24, 38, .85);
}

/* 跳转链接 */
.skip-link {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: .7rem 1.3rem;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--cyan);
  color: #04151f;
  font-weight: 700;
  letter-spacing: .04em;
  transition: top .22s ease;
}
.skip-link:focus { top: 0; }

/* 信号条 */
.signal-strip {
  display: flex;
  align-items: center;
  gap: .8rem;
  max-height: 48px;
  overflow: hidden;
  padding: .55rem var(--gutter) .6rem;
  background: linear-gradient(90deg, rgba(14, 47, 68, .9), rgba(14, 47, 68, .35) 55%, rgba(14, 47, 68, .9));
  border-bottom: 1px solid rgba(43, 231, 200, .14);
  color: rgba(245, 248, 247, .68);
  font-size: .68rem;
  letter-spacing: .18em;
  transition: max-height .32s ease, opacity .28s ease, padding .32s ease;
}
.signal-strip__label {
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--cyan);
}
.signal-strip__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(43, 231, 200, .14);
  animation: stripPulse 3.4s ease-in-out infinite;
}
.signal-strip__spacer { flex: 1 1 auto; }

.site-header[data-scrolled="true"] .signal-strip,
.site-header[data-nav-open="true"] .signal-strip {
  max-height: 0;
  opacity: 0;
  padding-block: 0;
}

@keyframes stripPulse {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* 头部主条 */
.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(.8rem, 2vw, 2rem);
  min-height: var(--header-h);
  padding-block: .55rem;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  flex: 0 0 auto;
  color: var(--nav-fg);
}
.brand__mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(43, 231, 200, .55);
  background:
    radial-gradient(circle at 50% 50%, var(--cyan) 0 17%, transparent 18%),
    linear-gradient(160deg, var(--deep), var(--ink));
  box-shadow: 0 0 0 3px rgba(43, 231, 200, .08);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(216, 179, 106, .55);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}
.brand__name {
  font-family: var(--font-title);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: .07em;
}
.brand__sig {
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .16em;
  color: var(--nav-dim);
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 1.4vw, 1.2rem);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: .1rem;
}
.nav-link {
  position: relative;
  display: inline-block;
  padding: .48rem .72rem;
  border-radius: var(--radius);
  font-family: var(--font-title);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--nav-dim);
  transition: color .2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: .72rem;
  right: .72rem;
  bottom: .16rem;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s ease;
}
.nav-link:hover { color: var(--nav-fg); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--nav-fg); font-weight: 700; }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-link--dot { padding-right: 1.2rem; }
.nav-link--dot::before {
  content: "";
  position: absolute;
  top: 50%;
  right: .42rem;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(43, 231, 200, .16);
  animation: stripPulse 3.4s ease-in-out infinite;
}
.nav-link--dot::after { right: 1.2rem; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .58rem 1.1rem;
  border: 1px solid var(--cyan);
  border-radius: 999px;
  background: var(--cyan);
  color: #04151f;
  font-family: var(--font-title);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.nav-cta:hover {
  background: #22d3b6;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -16px rgba(43, 231, 200, .95);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--nav-fg);
  transition: border-color .2s ease, background-color .2s ease;
}
.nav-toggle:hover { border-color: var(--cyan); }
.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* 阅读进度 */
.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--sand));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .12s linear;
  pointer-events: none;
}

/* ==========================================================================
   站点页脚
   ========================================================================== */
.site-footer {
  position: relative;
  overflow: hidden;
  padding-top: clamp(2.6rem, 6vw, 4.4rem);
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid rgba(43, 231, 200, .18);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: auto -10% -30% -10%;
  height: 62%;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(111, 143, 166, .16) 0 1px, transparent 1px 26px),
    radial-gradient(70% 100% at 50% 100%, rgba(43, 231, 200, .1), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 65%);
  mask-image: linear-gradient(180deg, transparent, #000 65%);
}

.footer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .95fr) minmax(0, .95fr) minmax(0, 1.3fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-brand__name {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: .09em;
}
.footer-brand__about {
  margin-top: .9rem;
  max-width: 36ch;
  font-size: .92rem;
  line-height: 1.85;
  color: rgba(245, 248, 247, .72);
}

.footer-col__title {
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--cyan);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.footer-list a {
  display: inline-block;
  font-size: .94rem;
  color: rgba(245, 248, 247, .76);
  transition: color .2s ease, padding-left .2s ease;
}
.footer-list a:hover {
  color: var(--paper);
  padding-left: .32rem;
}
.footer-list a[aria-current="page"] {
  color: var(--cyan);
  padding-left: .32rem;
}

.footer-contact__item {
  margin-bottom: .85rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.footer-contact__label {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .18em;
  color: var(--mist);
}
.footer-contact__value {
  font-size: .93rem;
  line-height: 1.6;
  color: var(--paper);
  overflow-wrap: anywhere;
}
.footer-contact__note {
  margin-top: 1rem;
  padding-left: .8rem;
  border-left: 2px solid var(--sand);
  font-size: .8rem;
  line-height: 1.8;
  color: rgba(245, 248, 247, .56);
}

.footer-legal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding-block: 1.15rem;
  border-top: 1px solid rgba(245, 248, 247, .12);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: rgba(245, 248, 247, .6);
}
.footer-legal__icp {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.footer-legal__sep {
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--sand);
}
.footer-legal__copy { color: rgba(245, 248, 247, .6); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .nav-link { padding-inline: .55rem; font-size: .88rem; }
  .nav-link::after { left: .55rem; right: .55rem; }
}

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

  html { scroll-padding-top: 84px; }

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

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .7rem var(--gutter) 1.4rem;
    background: var(--paper);
    color: var(--ink);
    border-top: 1px solid var(--fog);
    box-shadow: 0 28px 46px -34px rgba(6, 24, 38, .8);
  }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav[data-open="false"] { display: none; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-link {
    padding: .85rem .2rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--fog);
    border-radius: 0;
    color: var(--slate);
  }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--ink); }
  .nav-link--dot::before { top: 1.35rem; right: .1rem; }
  .nav-cta { margin-top: 1.1rem; padding-block: .7rem; }

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

@media (max-width: 720px) {
  body { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .brand__sig { font-size: .56rem; letter-spacing: .12em; }
}

@media (max-width: 480px) {
  .brand__sig { display: none; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__name { font-size: .95rem; }
  .signal-strip__label { display: none; }
  .paper {
    box-shadow:
      3px 3px 0 -1px #fff,
      3px 3px 0 0 var(--fog),
      7px 7px 0 -1px #fff,
      7px 7px 0 0 var(--fog);
  }
}

/* ==========================================================================
   动效降级
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
  .header-progress { transition: none; }
  .signal-strip__dot,
  .nav-link--dot::before { animation: none; opacity: 1; }
}
