/* =========================================================
   云时代 · 共享样式 /assets/site.css
   ========================================================= */

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

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

html.nav-open,
html.nav-open body { overflow: hidden; }

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

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

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

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

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

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

/* ---------- 2. Tokens ---------- */
:root {
  --ink-900: #0B1B2B;
  --ink-800: #122A44;
  --ink-700: #17334F;
  --snow: #F4F7F9;
  --linen: #EFE7D8;
  --stone: #6F7B84;
  --sky: #4FA3D9;
  --gold: #D8A24A;
  --gold-bright: #E8B45E;
  --flag-red: #C8553D;
  --flag-green: #4F7D5C;
  --flag-yellow: #E3C15A;

  --line-soft: rgba(244, 247, 249, 0.10);
  --line-mid: rgba(244, 247, 249, 0.18);
  --line-strong: rgba(244, 247, 249, 0.28);

  --ink-text: rgba(244, 247, 249, 0.78);
  --ink-text-dim: rgba(244, 247, 249, 0.58);

  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;

  --shell: 1280px;
  --gutter: clamp(16px, 3vw, 40px);
  --radius: 2px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. Base ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--snow);
  background-color: var(--ink-900);
  background-image:
    radial-gradient(1150px 720px at 82% -12%, rgba(79, 163, 217, 0.18), transparent 62%),
    radial-gradient(900px 640px at 6% 104%, rgba(216, 162, 74, 0.10), transparent 64%),
    linear-gradient(180deg, #0B1B2B 0%, #0E2138 48%, #122A44 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { display: block; }

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- 4. Layout ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow { max-width: 900px; }
.shell--wide { max-width: 1500px; }

/* ---------- 5. Typography ---------- */
.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 6.2vw, 68px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--snow);
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 50px);
  line-height: 1.18;
  letter-spacing: 0.01em;
  color: var(--snow);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(21px, 2.6vw, 31px);
  line-height: 1.32;
  letter-spacing: 0.02em;
  color: var(--snow);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--sky);
}

.lede {
  max-width: 44ch;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.8;
  color: var(--ink-text);
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--stone);
}

.index-note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}

.tint-gold { color: var(--gold); }
.tint-sky { color: var(--sky); }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background-color 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

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

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-900);
  font-weight: 600;
}

.btn-gold:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--snow);
}

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

.btn-quiet {
  padding: 0;
  border: 0;
  background: none;
  color: var(--sky);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ---------- 7. Header ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 300;
  padding: 10px 18px;
  background: var(--gold);
  color: var(--ink-900);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: linear-gradient(180deg, rgba(9, 22, 36, 0.96), rgba(11, 27, 43, 0.86));
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--line-soft);
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--sky) 0%, var(--gold) 100%);
  transition: width 0.12s linear;
}

.header-inner {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-left: 7px;
  border: 1px solid rgba(216, 162, 74, 0.55);
  flex: 0 0 auto;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 5px;
  height: 5px;
  background: var(--snow);
  opacity: 0.85;
}

.brand-mark i { display: block; height: 3px; }
.brand-mark i:nth-child(1) { width: 16px; background: var(--sky); }
.brand-mark i:nth-child(2) { width: 11px; background: var(--gold); }
.brand-mark i:nth-child(3) { width: 6px; background: var(--flag-red); }

.brand-text { display: block; }

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.16em;
  color: var(--snow);
}

.brand-coord {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--stone);
}

.nav-toggle { display: none; }

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item { display: block; }

.nav-link {
  position: relative;
  display: block;
  padding: 8px 11px;
  font-size: 14px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--ink-text-dim);
  transition: color 0.22s var(--ease);
}

.nav-link:hover { color: var(--snow); }

.nav-link[aria-current="page"] { color: var(--snow); }

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 1px;
  background: var(--gold);
}

.nav-utility {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 20px;
  border-left: 1px solid var(--line-soft);
}

.nav-utility-link {
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--stone);
  transition: color 0.22s var(--ease);
}

.nav-utility-link:hover { color: var(--sky); }

/* ---------- 8. Footer ---------- */
.site-footer {
  margin-top: clamp(72px, 9vw, 132px);
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(8, 20, 33, 0.55) 0%, rgba(6, 15, 25, 0.95) 100%);
  color: var(--ink-text);
}

.footer-main {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 76px) var(--gutter) clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.4fr 1fr;
  gap: clamp(24px, 3vw, 52px);
}

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

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-mark {
  width: 30px;
  height: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-left: 6px;
  border: 1px solid rgba(216, 162, 74, 0.5);
  flex: 0 0 auto;
}

.footer-mark i { display: block; height: 2px; }
.footer-mark i:nth-child(1) { width: 14px; background: var(--sky); }
.footer-mark i:nth-child(2) { width: 10px; background: var(--gold); }
.footer-mark i:nth-child(3) { width: 6px; background: var(--flag-red); }

.footer-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--snow);
}

.footer-line {
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-text-dim);
}

.footer-col { min-width: 0; }

.footer-col-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--stone);
}

.footer-links li { margin-bottom: 11px; }

.footer-links a {
  display: inline-block;
  font-size: 15px;
  color: var(--ink-text);
  transition: color 0.22s var(--ease), transform 0.22s var(--ease);
}

.footer-links a:hover {
  color: var(--gold);
  transform: translateX(2px);
}

.footer-links--plain li { margin-bottom: 13px; }

.footer-mono {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--ink-text);
  word-break: break-word;
}

.footer-addr {
  display: block;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-text-dim);
}

.footer-cta {
  max-width: var(--shell);
  margin-inline: auto;
  padding: 22px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.footer-cta-text {
  font-size: 15px;
  color: var(--ink-text-dim);
}

.footer-bar {
  padding: 14px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 28px;
  background: rgba(4, 12, 22, 0.55);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

.footer-bar-item { white-space: nowrap; }

/* ---------- 9. Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--stone);
}

.breadcrumbs-link { color: var(--stone); transition: color 0.22s var(--ease); }
.breadcrumbs-link:hover { color: var(--sky); }
.breadcrumbs-sep { color: rgba(111, 123, 132, 0.55); }
.breadcrumbs-item[aria-current="page"] { color: var(--snow); }

/* ---------- 10. Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.8;
  white-space: nowrap;
  color: var(--ink-text);
  border: 1px solid var(--line-mid);
  border-radius: 999px;
}

.tag--gold { border-color: rgba(216, 162, 74, 0.55); color: var(--gold); }
.tag--sky { border-color: rgba(79, 163, 217, 0.55); color: var(--sky); }
.tag--red { border-color: rgba(200, 85, 61, 0.6); color: #E07A62; }
.tag--green { border-color: rgba(79, 125, 92, 0.75); color: #7FB794; }

/* ---------- 11. Media frames ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(150deg, var(--ink-800), var(--ink-900));
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.media-frame--empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 247, 249, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 247, 249, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--stone);
}

/* ---------- 12. Prose ---------- */
.prose {
  max-width: 42em;
  color: var(--ink-text);
}

.prose > * + * { margin-top: 1.1em; }

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.35;
  color: var(--snow);
}

.prose h2 {
  margin-top: 1.9em;
  font-size: clamp(21px, 2.4vw, 29px);
}

.prose h3 {
  margin-top: 1.6em;
  font-size: clamp(18px, 1.9vw, 22px);
}

.prose a {
  color: var(--sky);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.prose ul { padding-left: 0; }

.prose li {
  position: relative;
  padding-left: 20px;
}

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

.prose li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* ---------- 13. Reveal ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* ---------- 14. Responsive ---------- */
@media (min-width: 1024px) {
  body { background-attachment: fixed; }
}

@media (max-width: 1120px) {
  .nav-link { padding: 8px 8px; font-size: 13.5px; }
  .nav-utility { gap: 12px; padding-left: 14px; }
  .nav-utility-link { font-size: 12px; }
  .nav-wrap { gap: 16px; }
}

@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 34px 44px;
  }
}

@media (max-width: 960px) {
  .header-inner {
    padding-block: 12px;
    gap: 12px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line-mid);
    border-radius: var(--radius);
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--snow);
    transition: border-color 0.22s var(--ease), color 0.22s var(--ease);
  }

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

  .nav-toggle-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 16px;
  }

  .nav-toggle-bars i {
    display: block;
    height: 1px;
    background: currentColor;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  }

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

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

  .nav-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 130;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 10px var(--gutter) 22px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(9, 22, 36, 0.98);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-wrap[data-open="true"] { display: flex; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    padding: 14px 2px;
    font-size: 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-link[aria-current="page"] { color: var(--gold); }

  .nav-link[aria-current="page"]::after {
    left: 2px;
    right: auto;
    bottom: 9px;
    width: 18px;
  }

  .nav-utility {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 0;
    border-left: 0;
  }

  .nav-utility-link { font-size: 14px; }
}

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

  .brand-name { font-size: 17px; letter-spacing: 0.12em; }
  .brand-coord { font-size: 9px; letter-spacing: 0.14em; }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .footer-bar-item { white-space: normal; }
}

@media (max-width: 420px) {
  .nav-toggle-label { display: none; }
  .nav-toggle { padding: 8px 10px; }
}

/* ---------- 15. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

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

  .scroll-progress__bar { transition: none; }

  .btn:hover,
  .footer-links a:hover { transform: none; }
}
