/* ============================================================
   启博指南 / Site Kit 共享样式
   高原框架式编辑部版式 · 冷青主色 · 砂岩暖橙操作色
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --ink: #1C2A30;
  --ink-soft: #465B64;
  --deep: #0A2A3A;
  --deep-2: #0C3447;
  --lake: #0B5F7A;
  --lake-bright: #0D7492;
  --glacier: #E9F3F5;
  --cloud: #FBFDFD;
  --sand: #A94D18;
  --sand-bright: #C4601F;
  --flag-yellow: #F2B544;
  --flag-green: #2C7A5B;
  --flag-red: #A33A3A;
  --sky: #BFE4EE;
  --line: rgba(10, 42, 58, 0.16);
  --line-soft: rgba(10, 42, 58, 0.09);
  --on-dark: rgba(233, 243, 245, 0.72);

  --font-display: "HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  --header-h: 62px;
  --rail-w: 0px;
  --gutter: clamp(18px, 4.2vw, 56px);
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-soft: 0 20px 48px -30px rgba(10, 42, 58, 0.55);
}

@media (min-width: 1024px) {
  :root {
    --header-h: 74px;
    --rail-w: 158px;
  }
}

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

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

html.nav-open { overflow: hidden; }

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

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

button { font: inherit; color: inherit; }

a { color: inherit; }

/* ---------- 3. Base typography ---------- */
body {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.02vw, 17.5px);
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: 0.012em;
  color: var(--ink);
  background-color: var(--glacier);
  background-image:
    linear-gradient(168deg, rgba(191, 228, 238, 0.5) 0%, rgba(233, 243, 245, 0) 42%),
    repeating-linear-gradient(118deg, rgba(10, 42, 58, 0.028) 0 1px, transparent 1px 88px);
  background-attachment: fixed;
  padding-top: var(--header-h);
  padding-left: var(--rail-w);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--deep);
  line-height: 1.16;
  letter-spacing: 0.03em;
  font-weight: 700;
}

p { text-wrap: pretty; }

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

::selection {
  background: var(--flag-yellow);
  color: var(--deep);
}

/* ---------- 4. Skip link ---------- */
.skip-link {
  position: absolute;
  left: 14px;
  top: -120px;
  z-index: 220;
  padding: 12px 22px;
  background: var(--flag-yellow);
  color: var(--deep);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

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

/* ---------- 5. Header shell ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 130;
  background: var(--deep);
  color: var(--cloud);
  border-bottom: 1px solid rgba(191, 228, 238, 0.16);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
}

/* Brand lockup */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  padding: 4px 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: var(--sand);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 66% 100%, 0 100%);
  transition: background 0.18s var(--ease);
}

.brand:hover .brand-mark { background: var(--sand-bright); }

.brand-text {
  display: block;
  min-width: 0;
}

.brand-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.25;
  color: var(--cloud);
}

.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.5;
  color: rgba(233, 243, 245, 0.58);
  white-space: nowrap;
}

@media (max-width: 419px) {
  .brand-sub { display: none; }
}

/* Desktop primary action */
.header-tools { display: none; }

@media (min-width: 1024px) {
  .header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }
}

.header-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  background: var(--sky);
  color: var(--deep);
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}

.header-call:hover {
  background: var(--cloud);
  transform: translateY(-1px);
}

.header-call:active { transform: translateY(0); }

.header-call--sand {
  background: var(--sand);
  color: #fff;
}

.header-call--sand:hover {
  background: var(--sand-bright);
  color: #fff;
}

/* Mobile toggle */
.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: transparent;
  color: var(--cloud);
  border: 1px solid rgba(191, 228, 238, 0.34);
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.nav-toggle:hover {
  background: rgba(191, 228, 238, 0.1);
  border-color: var(--sky);
}

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 18px;
  height: 12px;
}

.nav-toggle-bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transition: transform 0.22s var(--ease);
}

.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { bottom: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-toggle-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
}

/* Scroll progress */
.progress-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(191, 228, 238, 0.14);
  overflow: hidden;
  pointer-events: none;
}

.progress-bar {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--sand) 0%, var(--sand-bright) 55%, var(--flag-yellow) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* Scrim */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(10, 42, 58, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.nav-scrim[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .nav-scrim { display: none; }
}

/* ---------- 6. Frame navigation ---------- */
.frame-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 16px 30px;
  background: linear-gradient(192deg, var(--deep) 0%, var(--deep-2) 58%, var(--deep) 100%);
  border-left: 1px solid rgba(191, 228, 238, 0.18);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 115;
  transform: translateX(103%);
  visibility: hidden;
  transition: transform 0.3s var(--ease), visibility 0.3s var(--ease);
}

.frame-nav[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
}

@media (min-width: 1024px) {
  .frame-nav {
    left: 0;
    right: auto;
    width: var(--rail-w);
    transform: none;
    visibility: visible;
    transition: none;
    border-left: 0;
    border-right: 1px solid rgba(191, 228, 238, 0.18);
    padding: 26px 10px 22px;
    justify-content: space-between;
    gap: 18px;
    z-index: 110;
  }
}

.frame-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.frame-nav-item { display: block; }

.frame-nav-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  text-decoration: none;
  color: var(--on-dark);
  border-left: 2px solid transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.frame-nav-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(191, 228, 238, 0.52);
  transition: color 0.18s var(--ease);
}

.frame-nav-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-nav-link:hover {
  background: rgba(191, 228, 238, 0.1);
  border-left-color: var(--sky);
  color: #fff;
}

.frame-nav-link:hover .frame-nav-num { color: var(--flag-yellow); }

.frame-nav-link[aria-current="page"] {
  background: var(--sand);
  border-left-color: var(--flag-yellow);
  color: #fff;
}

.frame-nav-link[aria-current="page"] .frame-nav-num { color: var(--flag-yellow); }

@media (min-width: 1024px) {
  .frame-nav-list { gap: 3px; }

  .frame-nav-link {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 9px 8px;
    border-left-width: 2px;
  }

  .frame-nav-num { font-size: 9.5px; letter-spacing: 0.1em; }

  .frame-nav-label {
    font-size: 12.5px;
    letter-spacing: 0.04em;
    white-space: normal;
    overflow: visible;
  }
}

.frame-nav-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(191, 228, 238, 0.16);
}

.frame-nav-kicker {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(191, 228, 238, 0.48);
}

.frame-nav-kicker:first-child { margin-top: 0; }

.frame-nav-utility {
  display: block;
  padding: 6px 2px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: rgba(233, 243, 245, 0.8);
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}

.frame-nav-utility:hover {
  color: var(--flag-yellow);
  padding-left: 6px;
}

@media (min-width: 1024px) {
  .frame-nav-utility {
    font-size: 11px;
    padding: 4px 2px;
    letter-spacing: 0.02em;
  }
}

/* ---------- 7. Footer ---------- */
.site-footer {
  margin-top: clamp(56px, 9vw, 132px);
  background: var(--glacier);
  border-top: 1px solid var(--line);
}

.footer-contact {
  background: var(--deep);
  color: var(--glacier);
}

.footer-contact-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 26px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
}

.footer-contact-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--flag-yellow);
  text-transform: uppercase;
}

.footer-contact-line {
  font-size: 13.5px;
  letter-spacing: 0.03em;
  color: rgba(233, 243, 245, 0.82);
}

.footer-contact-line strong {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #fff;
}

.footer-contact-note {
  flex-basis: 100%;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(233, 243, 245, 0.52);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 62px) var(--gutter) clamp(28px, 4vw, 46px);
}

@media (min-width: 880px) {
  .footer-main {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }
}

.footer-brand-name {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1.2;
  color: var(--deep);
}

.footer-brand-sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--lake);
  text-transform: uppercase;
}

.footer-summary {
  margin-top: 16px;
  max-width: 44ch;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.footer-col-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--deep);
}

.footer-col-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--sand);
}

.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-link {
  display: block;
  margin-top: 11px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}

.footer-link:hover {
  color: var(--sand);
  padding-left: 5px;
}

.footer-legal {
  background: var(--cloud);
  border-top: 1px solid var(--line);
}

.footer-legal-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px var(--gutter);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.footer-copy { font-family: var(--font-mono); }

.footer-icp {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgba(28, 42, 48, 0.62);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
  list-style: none;
  margin-block: 0;
  padding: 0;
}

.footer-legal-link {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.18s var(--ease);
}

.footer-legal-link:hover { color: var(--sand); }

/* ---------- 8. Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure { max-width: 46ch; }
.measure-wide { max-width: 64ch; }

.rule-line {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: clamp(28px, 4vw, 52px) 0;
}

/* ---------- 9. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 28px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--lake);
  color: #fff;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:hover {
  background: var(--lake-bright);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn--sand { background: var(--sand); }
.btn--sand:hover { background: var(--sand-bright); }

.btn--ghost {
  background: transparent;
  color: var(--deep);
  border-color: rgba(10, 42, 58, 0.32);
}

.btn--ghost:hover {
  background: var(--deep);
  color: #fff;
  border-color: var(--deep);
}

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

/* ---------- 10. Panels ---------- */
.cut-panel {
  position: relative;
  padding: clamp(20px, 3vw, 34px);
  background: var(--cloud);
  border: 1px solid var(--line-soft);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.note-card {
  padding: 16px 20px;
  background: var(--cloud);
  border-left: 3px solid var(--sand);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* ---------- 11. Labels ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sand);
}

.chapter-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.chapter-num {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sand);
  transition: color 0.2s var(--ease);
}

[data-chapter].is-current .chapter-num { color: var(--flag-yellow); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: rgba(191, 228, 238, 0.42);
  color: var(--deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1px solid rgba(11, 95, 122, 0.22);
}

.chip--sand {
  background: rgba(169, 77, 24, 0.12);
  color: var(--sand);
  border-color: rgba(169, 77, 24, 0.3);
}

.chip--green {
  background: rgba(44, 122, 91, 0.14);
  color: var(--flag-green);
  border-color: rgba(44, 122, 91, 0.32);
}

/* ---------- 12. Media frames (页面阶段放置占位/图片) ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--deep);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

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

.media-frame img,
.media-frame video,
.media-frame .media-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  display: flex;
  align-items: flex-end;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(233, 243, 245, 0.72);
  background:
    linear-gradient(152deg, rgba(11, 95, 122, 0.95) 0%, rgba(10, 42, 58, 0.98) 64%),
    var(--deep);
}

.media-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(116deg, rgba(191, 228, 238, 0.16) 0 1px, transparent 1px 62px);
  pointer-events: none;
}

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

@media (max-width: 640px) {
  .media-frame {
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  }
}

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