/* ============================================================
   君临国际 · 共享样式 /assets/site.css
   曜石黑 · 深海蓝 · 雾白 · 沙漠金 · 极光青
   ============================================================ */

:root {
  --ink: #0B0E13;
  --deep: #0E2A47;
  --deep-2: #081B2F;
  --rock: #5E6A78;
  --line: #C7CDD6;
  --mist: #F3F5F8;
  --white: #FFFFFF;
  --gold: #C2A15A;
  --gold-2: #8A6A22;
  --aurora: #34E2C6;
  --aurora-2: #0A7A6B;

  --on-dark: #F3F5F8;
  --on-dark-2: rgba(243, 245, 248, 0.72);
  --on-dark-3: rgba(243, 245, 248, 0.50);

  --rail-w: 56px;
  --head-h: 60px;
  --edge: 20px;
  --max-w: 1360px;

  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --hair-dark: 1px solid rgba(199, 205, 214, 0.18);
  --hair-light: 1px solid rgba(11, 14, 19, 0.12);
}

@media (min-width: 768px) {
  :root { --edge: 28px; --head-h: 64px; }
}

@media (min-width: 1024px) {
  :root { --rail-w: 96px; --head-h: 68px; --edge: 32px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
}

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

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

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

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

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

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

:focus-visible {
  outline: 2px solid var(--aurora-2);
  outline-offset: 2px;
}

.section--ink :focus-visible,
.section--deep :focus-visible,
.section--deep-2 :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--aurora);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 基础排版 ---------- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--mist);
  padding-left: var(--rail-w);
  padding-top: var(--head-h);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(40px, 7vw, 96px); }
h2 { font-size: clamp(28px, 3.4vw, 44px); }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

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

.t-muted { color: var(--rock); }

.section--ink .t-muted,
.section--deep .t-muted,
.section--deep-2 .t-muted { color: var(--on-dark-2); }

/* ---------- 布局容器 ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

.section { padding-top: 56px; padding-bottom: 56px; }

@media (min-width: 1024px) {
  .section { padding-top: 96px; padding-bottom: 96px; }
}

.section--ink { background: var(--ink); color: var(--on-dark); }
.section--deep { background: var(--deep); color: var(--on-dark); }
.section--deep-2 { background: var(--deep-2); color: var(--on-dark); }
.section--mist { background: var(--mist); color: var(--ink); }
.section--white { background: var(--white); color: var(--ink); }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: 1fr; }

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

/* ---------- 章节四件套 ---------- */
.sec-head {
  display: grid;
  gap: 12px;
  margin-bottom: 32px;
}

.sec-index {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--gold-2);
}

.section--ink .sec-index,
.section--deep .sec-index,
.section--deep-2 .sec-index { color: var(--gold); }

.sec-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sec-note {
  writing-mode: vertical-rl;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--rock);
}

.section--ink .sec-note,
.section--deep .sec-note,
.section--deep-2 .sec-note { color: var(--on-dark-3); }

/* ---------- 面包屑 ---------- */
.crumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--rock);
  padding-top: 20px;
  padding-bottom: 20px;
}

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

.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: "/"; color: var(--line); }
.crumbs a:hover { color: var(--aurora-2); }
.crumbs [aria-current="page"] { color: var(--ink); }

.section--ink .crumbs,
.section--deep .crumbs { color: var(--on-dark-3); }
.section--ink .crumbs [aria-current="page"],
.section--deep .crumbs [aria-current="page"] { color: var(--on-dark); }

/* ---------- 正文 ---------- */
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 24px; margin-top: 2em; }
.prose h3 { font-size: 18px; margin-top: 1.6em; }
.prose ul, .prose ol { display: grid; gap: 0.6em; }
.prose li { position: relative; padding-left: 20px; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 10px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}
.prose a {
  color: var(--aurora-2);
  border-bottom: 1px solid currentColor;
}
.prose a:hover { color: var(--aurora); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: 0;
  transition: background-color 0.18s var(--ease),
              color 0.18s var(--ease),
              border-color 0.18s var(--ease);
}

.btn--primary {
  background: var(--aurora);
  border-color: var(--aurora);
  color: var(--ink);
}
.btn--primary:hover {
  background: transparent;
  color: var(--aurora);
}

.btn--ghost {
  border-color: rgba(11, 14, 19, 0.24);
  color: inherit;
}
.btn--ghost:hover {
  border-color: var(--aurora-2);
  color: var(--aurora-2);
}

.section--ink .btn--ghost,
.section--deep .btn--ghost,
.section--deep-2 .btn--ghost { border-color: rgba(199, 205, 214, 0.45); }
.section--ink .btn--ghost:hover,
.section--deep .btn--ghost:hover,
.section--deep-2 .btn--ghost:hover {
  border-color: var(--aurora);
  color: var(--aurora);
}

/* ---------- 图片容器 ---------- */
.img-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--deep-2);
  border: var(--hair-dark);
  border-radius: 0;
}

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

.img-frame--16x9 { aspect-ratio: 16 / 9; }
.img-frame--4x3 { aspect-ratio: 4 / 3; }
.img-frame--1x1 { aspect-ratio: 1 / 1; }
.img-frame--21x9 { aspect-ratio: 21 / 9; }

.section--mist .img-frame,
.section--white .img-frame { border: var(--hair-light); }

.img-caption {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--rock);
}

.section--ink .img-caption,
.section--deep .img-caption,
.section--deep-2 .img-caption { color: var(--on-dark-3); }

/* ---------- 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: calc(var(--rail-w) + 10px);
  z-index: 200;
  padding: 10px 18px;
  background: var(--aurora);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline-offset: 3px;
}

#main-content:focus { outline: none; }

/* ============================================================
   头部框架
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  z-index: 85;
}

.brand-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px 22px;
  background: var(--ink);
  border-right: 1px solid rgba(199, 205, 214, 0.16);
  color: var(--on-dark);
  overflow: hidden;
}

.rail-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rail-mark-cn {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: var(--on-dark);
}

.rail-mark-en {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.28em;
  color: var(--aurora);
}

.rail-tagline {
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--on-dark-3);
}

.rail-scale {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.rail-scale-track {
  position: relative;
  display: block;
  width: 1px;
  height: 76px;
  background: rgba(199, 205, 214, 0.24);
}

.rail-scale-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 0;
  background: var(--aurora);
  transition: height 0.12s linear;
}

.rail-scale-label {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

@media (max-height: 640px) {
  .rail-tagline { display: none; }
  .rail-scale-track { height: 52px; }
}

/* --- 顶部横梁 --- */
.header-main {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--head-h);
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--edge);
  background: var(--deep);
  border-bottom: 1px solid rgba(199, 205, 214, 0.2);
  color: var(--on-dark);
}

.version-chip {
  order: 1;
  flex: none;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid rgba(194, 161, 90, 0.45);
  padding: 3px 8px;
  white-space: nowrap;
}

.entry-link {
  order: 3;
  flex: none;
  display: none;
  font-size: 13px;
  color: var(--aurora);
  border-bottom: 1px solid rgba(52, 226, 198, 0.55);
  padding-bottom: 2px;
  white-space: nowrap;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.entry-link:hover {
  color: #8CF3E2;
  border-bottom-color: #8CF3E2;
}

@media (min-width: 600px) {
  .entry-link { display: inline-block; }
}

.nav-toggle {
  order: 4;
  margin-left: auto;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(199, 205, 214, 0.32);
  transition: border-color 0.18s var(--ease);
}

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

.nav-toggle-bar {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--on-dark);
  transition: transform 0.22s var(--ease), opacity 0.18s linear;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-of-type(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* --- 主导航 --- */
.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--deep-2);
  border-bottom: 1px solid rgba(199, 205, 214, 0.22);
  max-height: calc(100vh - var(--head-h));
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.site-nav[data-open] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.nav-list {
  display: flex;
  flex-direction: column;
}

.nav-link {
  position: relative;
  display: block;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--on-dark-2);
  border-bottom: 1px solid rgba(199, 205, 214, 0.08);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

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

.nav-link[aria-current="page"] {
  color: var(--white);
  background: rgba(52, 226, 198, 0.08);
  box-shadow: inset 2px 0 0 var(--aurora);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--aurora);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .header-main { gap: 28px; }

  .site-nav {
    position: static;
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border-bottom: 0;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .nav-link {
    padding: 8px 12px;
    font-size: 14px;
    border-bottom: 0;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 1px;
    background: var(--aurora);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.24s var(--ease);
  }

  .nav-link:hover::after { transform: scaleX(1); }

  .nav-link[aria-current="page"] {
    background: transparent;
    box-shadow: none;
    color: var(--white);
  }

  .nav-link[aria-current="page"]::after { transform: scaleX(1); }

  .entry-link { order: 3; }

  .nav-toggle { display: none; }
}

/* ============================================================
   页脚
   ============================================================ */

.site-footer {
  background: var(--deep);
  color: var(--on-dark);
  border-top: 1px solid rgba(199, 205, 214, 0.2);
  position: relative;
  z-index: 1;
}

.footer-quick {
  display: flex;
  flex-wrap: wrap;
  background: var(--deep-2);
  border-bottom: 1px solid rgba(199, 205, 214, 0.16);
}

.quick-item {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--edge);
  font-size: 14px;
  color: var(--on-dark-2);
  border-right: 1px solid rgba(199, 205, 214, 0.12);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.quick-item:last-child { border-right: 0; }
.quick-item:hover { background: rgba(52, 226, 198, 0.08); color: var(--white); }

.quick-index {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  flex: none;
}

.quick-label { line-height: 1.5; }

.footer-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px var(--edge) 40px;
  display: grid;
  gap: 36px;
  grid-template-columns: 1fr;
}

.footer-brand-cn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.04em;
  color: var(--on-dark);
}

.footer-brand-en {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.footer-brand-line {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--on-dark-3);
}

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

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(199, 205, 214, 0.22);
}

.footer-col-list {
  margin-top: 14px;
  display: grid;
  gap: 9px;
}

.footer-col-list a {
  display: inline-block;
  font-size: 13.5px;
  color: var(--on-dark-2);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer-col-list a:hover {
  color: var(--aurora);
  border-bottom-color: var(--aurora);
}

.footer-col-list a[aria-current="page"] {
  color: var(--white);
  border-bottom-color: var(--aurora);
}

@media (min-width: 720px) {
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .footer-body {
    grid-template-columns: 1fr 2.2fr;
    gap: 56px;
    padding-top: 64px;
    padding-bottom: 52px;
  }
}

.footer-contact {
  background: var(--deep-2);
  border-top: 1px solid rgba(199, 205, 214, 0.16);
}

.footer-contact-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 30px var(--edge) 34px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

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

.contact-item {
  display: grid;
  gap: 8px;
  align-content: start;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.contact-value,
.contact-copy {
  font-size: 14px;
  line-height: 1.7;
  color: var(--on-dark);
}

.contact-copy {
  text-align: left;
  word-break: break-all;
  color: var(--aurora);
  border-bottom: 1px solid rgba(52, 226, 198, 0.45);
  justify-self: start;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.contact-copy:hover {
  color: #8CF3E2;
  border-bottom-color: #8CF3E2;
}

.footer-contact-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(199, 205, 214, 0.14);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--on-dark-3);
  max-width: 78ch;
}

.footer-legal {
  border-top: 1px solid rgba(199, 205, 214, 0.16);
  background: var(--deep-2);
}

.footer-legal-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px var(--edge) 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 26px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--on-dark-3);
}

.legal-year { margin-left: auto; }

/* ============================================================
   入场动效
   ============================================================ */

[data-reveal] {
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}

[data-reveal].reveal-pending {
  opacity: 0;
  transform: translateY(12px);
}

/* ============================================================
   偏好设置
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

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

  .site-nav {
    transform: none;
  }
}
