/* ==========================================================================
   优乐电子 · 共享站点样式  /assets/site.css
   01 复位  02 变量  03 排版  04 布局容器  05 按钮与卡片  06 头部
   07 页脚  08 通用组件  09 交互与动效  10 响应式
   ========================================================================== */

/* 01 复位 ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { list-style: none; }

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

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

a { color: inherit; }

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

/* 02 变量 ---------------------------------------------------------------- */
:root {
  --blue:        #0A4D8C;
  --blue-deep:   #062E55;
  --orange:      #FF6B35;
  --amber:       #FFB03A;
  --ice:         #E6EFF8;
  --mist:        #EFF2F6;
  --white:       #FFFFFF;
  --ink:         #16202B;
  --gray:        #5C6B7A;
  --green:       #12A87B;
  --line:        #C7D5E3;

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", system-ui,
               -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace,
               SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --shadow-hard: 6px 6px 0 0 var(--blue);
  --shadow-deep: 4px 4px 0 0 var(--blue-deep);

  --wrap: 1280px;
  --gap: 24px;
  --pad-x: clamp(16px, 4vw, 40px);
  --header-h: 106px;
}

/* 03 排版 ---------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.2; font-weight: 800; color: var(--ink); }

p { line-height: 1.75; }

b, strong { font-weight: 800; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--gray);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--orange);
}

.h-display {
  font-weight: 200;
  font-size: clamp(40px, 6vw, 92px);
  line-height: 1.02;
  letter-spacing: -.02em;
}

.h-section {
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 56px);
  line-height: 1.1;
  letter-spacing: -.01em;
}

/* 04 布局容器 ------------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: clamp(40px, 6vw, 88px); }
.section--ice  { background: var(--ice); }
.section--mist { background: var(--mist); }

.section-rule {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 0 var(--pad-x);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--gray);
}

.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.prose { max-width: 720px; }
.prose p { margin-bottom: 1.1em; font-size: 17px; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { font-size: clamp(24px, 2.4vw, 32px); margin: 1.6em 0 .6em; }
.prose h3 { font-size: 20px; margin: 1.4em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.1em 1.2em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4em; font-size: 16.5px; }

/* 05 按钮与卡片 ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 2px solid var(--blue-deep);
  background: var(--white);
  color: var(--blue-deep);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  text-decoration: none;
  box-shadow: var(--shadow-deep);
  transition: transform .18s ease, box-shadow .18s ease,
              background-color .18s ease, color .18s ease, border-color .18s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--blue-deep);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 var(--blue-deep);
}

.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-deep); }

.btn--accent { background: var(--orange); color: var(--ink); border-color: var(--blue-deep); }
.btn--accent:hover { background: var(--amber); }

.btn--ghost {
  background: transparent;
  color: var(--blue-deep);
  border-color: var(--line);
  box-shadow: none;
}
.btn--ghost:hover { border-color: var(--orange); box-shadow: 4px 4px 0 0 var(--line); }

.card {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--white);
  border: 2px solid var(--blue);
  box-shadow: var(--shadow-hard);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
  transform: translate(-4px, -4px);
  border-color: var(--orange);
  box-shadow: 10px 10px 0 0 var(--blue);
}

/* 06 头部 ---------------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 999;
  padding: 12px 22px;
  background: var(--blue-deep);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  border: 2px solid var(--orange);
  transition: top .2s ease;
}

.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--blue-deep);
}

.strip { position: relative; }

.strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  min-height: 48px;
}

/* 上层：品牌信息轨 */
.strip--brand {
  background: var(--blue-deep);
  color: var(--ice);
  background-image:
    linear-gradient(to right, rgba(199, 213, 227, .10) 1px, transparent 1px);
  background-size: 72px 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--orange);
  color: var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  border: 2px solid var(--white);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand__name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--white);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: #A9C6E4;
}

.strip__note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: #9FBCDC;
  white-space: nowrap;
}

.quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  color: #DCE9F6;
  border: 1px solid rgba(199, 213, 227, .45);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.quick-link:hover,
.quick-link:focus-visible {
  background: var(--ice);
  color: var(--blue-deep);
  border-color: var(--ice);
}

.quick-link--accent {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--orange);
  font-weight: 800;
}

.quick-link--accent:hover,
.quick-link--accent:focus-visible {
  background: var(--amber);
  color: var(--ink);
  border-color: var(--amber);
}

/* 下层：主栏目轨 */
.strip--nav {
  background: var(--white);
  border-top: 1px solid var(--line);
}

.strip__inner--nav {
  min-height: 58px;
  gap: 16px;
  flex-wrap: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--ice);
  color: var(--blue-deep);
  border: 2px solid var(--blue-deep);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 3px 3px 0 0 var(--blue-deep);
}

.nav-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--blue-deep); }

.nav-toggle__bars {
  display: block;
  width: 16px;
  height: 12px;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  position: relative;
}

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

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { bottom: 0; }

.nav-toggle__label { letter-spacing: .04em; }

.site-nav { display: block; }

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  counter-reset: navitem;
}

.site-nav__item {
  display: flex;
  align-items: center;
}

.site-nav__item::before {
  counter-increment: navitem;
  content: counter(navitem, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--line);
  letter-spacing: .04em;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 17px 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.site-nav__link:hover {
  color: var(--blue);
  background: rgba(230, 239, 248, .7);
  border-bottom-color: var(--amber);
}

.site-nav__link[aria-current="page"] {
  color: var(--blue-deep);
  background: var(--ice);
  border-bottom-color: var(--orange);
}

.site-nav__link[aria-current="page"]::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--orange);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .03em;
  color: var(--gray);
  white-space: nowrap;
}

.nav-status .mono { color: var(--blue-deep); font-weight: 700; }

.nav-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 168, 123, .16);
  animation: dot-breathe 2s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(18, 168, 123, .16); }
  50%      { box-shadow: 0 0 0 6px rgba(18, 168, 123, .05); }
}

.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  pointer-events: none;
}

.scroll-meter__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .1s linear;
}

/* 07 页脚 ---------------------------------------------------------------- */
.site-footer {
  background: var(--blue-deep);
  color: #D7E5F2;
  border-top: 6px solid var(--blue);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.7fr;
  gap: clamp(24px, 3vw, 48px);
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--pad-x) clamp(28px, 4vw, 48px);
  border-bottom: 1px solid rgba(199, 213, 227, .24);
}

.footer__brand .brand__mark { border-color: var(--blue-deep); }
.footer__brand .brand__name { color: var(--white); }
.footer__brand .brand__sub { color: #9FBCDC; }

.footer__brand-desc {
  margin-top: 18px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.8;
  color: #A9C6E4;
}

.footer__cta { margin-top: 22px; }

.footer__col { min-width: 0; }

.footer__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--amber);
}

.footer__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(199, 213, 227, .26);
}

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

.footer__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: #D7E5F2;
  text-decoration: none;
  transition: color .18s ease;
}

.footer__link::before {
  content: "";
  width: 6px;
  height: 6px;
  border: 1px solid var(--line);
  transition: background-color .18s ease, border-color .18s ease;
}

.footer__link:hover { color: var(--white); }

.footer__link:hover::before {
  background: var(--orange);
  border-color: var(--orange);
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #BFD5EA;
}

.footer__contact-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  word-break: break-word;
}

.footer__contact-item::before {
  content: attr(data-key);
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.5;
  letter-spacing: .06em;
  color: var(--amber);
  border: 1px solid rgba(255, 176, 58, .5);
  white-space: nowrap;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 20px var(--pad-x) 32px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .03em;
  color: #8FAFCE;
}

.footer__meta { white-space: nowrap; }

/* 08 通用组件 ------------------------------------------------------------ */
.breadcrumbs {
  padding-block: 18px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--gray);
}

.breadcrumbs li { display: flex; align-items: center; }

.breadcrumbs li + li::before {
  content: "/";
  margin-inline: 9px;
  color: var(--line);
}

.breadcrumbs a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumbs a:hover { border-bottom-color: var(--orange); }

.grid { display: grid; gap: var(--gap); }
.grid--bento { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.span-2   { grid-column: span 2; }
.span-4   { grid-column: 1 / -1; }
.span-1x2 { grid-row: span 2; }
.span-2x2 { grid-column: span 2; grid-row: span 2; }

.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--ice);
  border: 2px solid var(--blue);
  aspect-ratio: 16 / 10;
}

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

.media--wide   { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall   { aspect-ratio: 3 / 4; }

.media--texture {
  background-image:
    linear-gradient(to right, rgba(10, 77, 140, .08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 77, 140, .08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.figure { display: block; margin: 0; }

.figure__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .03em;
  color: var(--gray);
}

.toc {
  position: sticky;
  top: 132px;
  align-self: start;
}

.toc__title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--gray);
}

.toc__list { border-left: 1px solid var(--line); }

.toc__link {
  display: block;
  margin-left: -1px;
  padding: 7px 0 7px 14px;
  font-size: 13.5px;
  color: var(--gray);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}

.toc__link:hover { color: var(--blue); }

.toc__link[aria-current] {
  color: var(--blue-deep);
  font-weight: 700;
  border-left-color: var(--orange);
}

/* 09 交互与动效 ---------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s ease, transform .32s ease;
  transition-delay: var(--reveal-delay, 0ms);
}

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

.to-top {
  position: fixed;
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: var(--white);
  color: var(--blue-deep);
  border: 2px solid var(--blue-deep);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: var(--shadow-deep);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--ice); }

body.is-nav-open .to-top { opacity: 0; visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] { transform: none; transition: opacity .2s linear; }
  .nav-status__dot { animation: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* 10 响应式 -------------------------------------------------------------- */
@media (max-width: 1100px) {
  .strip__note { display: none; }
  .nav-status { display: none; }
}

@media (max-width: 1024px) {
  .grid--bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2x2 { grid-column: span 2; grid-row: span 1; }
  .span-1x2 { grid-row: span 1; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 96px; }

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

  .strip__inner--nav {
    min-height: 56px;
    justify-content: flex-start;
  }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    max-height: 82vh;
    overflow-y: auto;
    padding: 6px 0 max(16px, env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 2px solid var(--blue-deep);
    box-shadow: 0 -8px 0 0 rgba(10, 77, 140, .10);
    transform: translateY(110%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  }

  .site-header[data-open] .site-nav { transform: translateY(0); }

  .site-header[data-open]::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(6, 46, 85, .42);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__item { border-bottom: 1px solid var(--line); }

  .site-nav__item::before { margin-left: 20px; }

  .site-nav__link {
    flex: 1;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0;
    border-left: 3px solid transparent;
  }

  .site-nav__link:hover { background: var(--mist); border-bottom-color: transparent; }

  .site-nav__link[aria-current="page"] {
    background: var(--ice);
    border-left-color: var(--orange);
    border-bottom-color: transparent;
  }

  .site-nav__link[aria-current="page"]::after { display: none; }

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

@media (max-width: 720px) {
  .brand__sub { display: none; }
  .quick-link { padding: 5px 10px; font-size: 11.5px; }
  .quick-actions { gap: 6px; }
  .toc { position: static; }
}

@media (max-width: 640px) {
  .grid--bento,
  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }

  .span-2, .span-2x2, .span-4 { grid-column: 1 / -1; }
  .span-1x2, .span-2x2 { grid-row: auto; }

  .footer__grid { grid-template-columns: 1fr; }
  .footer__legal { flex-direction: column; align-items: flex-start; }
  .footer__meta { white-space: normal; }

  .strip__inner { min-height: 44px; padding-block: 6px; }
  .brand__mark { width: 34px; height: 34px; font-size: 12px; }
  .brand__name { font-size: 15.5px; }

  .btn { width: 100%; }
  .to-top { right: 12px; bottom: 12px; }
}
