/* ==========================================================================
   汇赢国际中文站 · 共享样式表 /assets/site.css
   设计语言：天山雪青 × 胡杨金 × 葡萄紫 / 极简文字建筑 + 档案编号标签
   ========================================================================== */

/* 1. Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body, h1, h2, h3, h4, h5, p, ul, ol, li, figure, figcaption, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* 2. 设计令牌 ------------------------------------------------------------- */
:root {
  --xue: #3E7C8F;
  --xue-deep: #26525F;
  --xue-pale: #E4EEF1;
  --mist: #F6F9FA;
  --gold: #C99A3D;
  --gold-dark: #B0862F;
  --gold-pale: #F1E4C6;
  --gold-ink: #7A5A16;
  --grape: #6B4E8C;
  --grape-pale: #EDE8F4;
  --ink: #1C2A30;
  --graphite: #5C6D74;
  --canvas: #FCFBF8;
  --line: #C8D4D8;

  --on-dark: #E9F1F3;
  --on-dark-soft: rgba(233, 241, 243, 0.74);
  --on-dark-line: rgba(233, 241, 243, 0.18);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 32px;
  --pill: 999px;

  --wrap: 1180px;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 3. 基础排版 ------------------------------------------------------------- */
body {
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; color: var(--xue-deep); }
h1 { font-size: clamp(40px, 6vw, 84px); font-weight: 900; }
h2 { font-size: clamp(26px, 3vw, 38px); }
h3 { font-size: 21px; line-height: 1.35; }
p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--font-mono); font-size: 0.94em; letter-spacing: 0.02em; }

/* 4. 布局工具 ------------------------------------------------------------- */
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section--mist { background: var(--mist); }
.section--canvas { background: var(--canvas); }
.section--pale { background: var(--xue-pale); }
.section--ink { background: var(--xue-deep); color: var(--on-dark); }
.section--ink h2, .section--ink h3 { color: #fff; }
.section__head { max-width: 68ch; margin-bottom: clamp(24px, 3vw, 40px); }
.section__title { margin-bottom: 12px; }
.section__lede { color: var(--graphite); font-size: 16px; margin: 0; }
.section--ink .section__lede { color: var(--on-dark-soft); }

.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.grid { display: grid; gap: clamp(18px, 2.4vw, 32px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 5. 跳转与进度 ----------------------------------------------------------- */
.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 200;
  background: var(--xue-deep); color: #fff;
  padding: 12px 22px; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 14px; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

.header-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold); transform: scaleX(0); transform-origin: 0 50%;
  z-index: 90; pointer-events: none;
}

/* 6. 页头：居中刊头 ------------------------------------------------------- */
.site-header {
  position: relative;
  background-color: var(--canvas);
  background-image: linear-gradient(102deg, rgba(62, 124, 143, 0.12), rgba(252, 251, 248, 0) 46%);
  border-bottom: 1px solid var(--line);
  padding-top: 26px;
}
.masthead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-bottom: 20px;
}
.masthead__rail { display: flex; align-items: center; gap: 18px; min-width: 0; }
.masthead__rail--start { justify-content: flex-start; }
.masthead__rail--end { justify-content: flex-end; }

.utility-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.utility-links__item { display: inline-flex; }
.utility-links__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--graphite);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.utility-links__link:hover { color: var(--xue-deep); border-bottom-color: var(--xue); }

.masthead__brand { position: relative; text-align: center; padding: 0 64px; }
.brand { display: inline-block; }
.brand__name {
  display: block;
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--xue-deep);
}
.brand:hover .brand__name { color: var(--xue); }
.brand__tagline {
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--graphite);
}
.masthead__mark {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--pill);
  font-size: 14px; font-weight: 500; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.pill--gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.pill--gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.pill--ghost { background: transparent; color: var(--xue-deep); border-color: var(--line); }
.pill--ghost:hover { background: var(--xue-pale); border-color: var(--xue); }

.nav-toggle {
  display: none;
  position: absolute; top: 18px; right: 20px; z-index: 30;
  width: 46px; height: 46px; padding: 0;
  align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--canvas);
}
.nav-toggle__bars { display: block; width: 18px; height: 2px; background: var(--xue-deep); position: relative; transition: background-color 0.2s var(--ease); }
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--xue-deep);
  transition: transform 0.25s var(--ease);
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.mainnav { background: rgba(246, 249, 250, 0.72); border-top: 1px solid var(--line); }
.mainnav__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.mainnav__item { display: flex; }
.mainnav__link {
  position: relative;
  display: block;
  padding: 16px 18px;
  font-size: 15px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--xue-deep);
  transition: color 0.2s var(--ease);
}
.mainnav__link::after {
  content: ""; position: absolute; left: 18px; right: 18px; bottom: 10px; height: 2px;
  background: var(--gold);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.28s var(--ease);
}
.mainnav__link:hover { color: var(--ink); }
.mainnav__link:hover::after,
.mainnav__link[aria-current="page"]::after { transform: scaleX(1); }
.mainnav__link[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* 7. 浮动控件 ------------------------------------------------------------- */
.to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 70;
  width: 48px; height: 48px; border-radius: var(--pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--canvas); border: 1px solid var(--line); color: var(--xue-deep);
  font-size: 15px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease), transform 0.28s var(--ease), border-color 0.2s var(--ease);
}
.to-top.is-shown { opacity: 1; visibility: visible; }
.to-top:hover { border-color: var(--gold); transform: translateY(-2px); }

.dock {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 70; display: none; gap: 8px;
}
.dock__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--pill);
  background: var(--xue-deep); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(28, 42, 48, 0.22);
}

/* 8. 通用组件 ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border-radius: var(--pill);
  font-size: 15px; font-weight: 500; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn--primary { background: var(--xue); border-color: var(--xue); color: #fff; }
.btn--primary:hover { background: var(--xue-deep); border-color: var(--xue-deep); }
.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--xue-deep); }
.btn--ghost:hover { background: var(--xue-pale); border-color: var(--xue); }

.tag-mono {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--pill);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.4; letter-spacing: 0.08em;
  background: var(--grape-pale); color: var(--grape);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.tag-mono--xue { background: var(--xue-pale); color: var(--xue-deep); }
.tag-mono--gold { background: var(--gold-pale); color: var(--gold-ink); }
[data-copy] { cursor: copy; }
[data-copy].is-copied { background: var(--gold-pale); color: var(--gold-ink); }

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--graphite);
}
.breadcrumb__item { display: inline-flex; align-items: center; }
.breadcrumb__item + .breadcrumb__item::before { content: "／"; color: var(--line); margin-right: 8px; }
.breadcrumb__link { color: var(--graphite); border-bottom: 1px solid transparent; }
.breadcrumb__link:hover { color: var(--xue-deep); border-bottom-color: var(--xue); }
.breadcrumb__item[aria-current="page"] { color: var(--ink); }

.prose { max-width: 72ch; font-size: 17px; line-height: 1.9; color: var(--ink); }
.prose h2 { margin: 1.6em 0 0.6em; }
.prose h3 { margin: 1.4em 0 0.5em; color: var(--xue-deep); }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.prose ul { list-style: none; }
.prose ul li { position: relative; padding-left: 4px; }
.prose ul li::before { content: "—"; color: var(--gold); position: absolute; left: -1.2em; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.5em; line-height: 1.8; }
.prose a { color: var(--xue-deep); border-bottom: 1px solid var(--gold); }
.prose a:hover { color: var(--xue); }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--gold); color: var(--graphite);
}
.prose table { font-size: 15px; line-height: 1.6; margin: 1.4em 0; }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--xue-pale); color: var(--xue-deep); font-weight: 700; }
.prose tbody tr:nth-child(even) { background: rgba(228, 238, 241, 0.5); }

.panel { background: var(--canvas); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 36px); }
.panel--soft { background: var(--mist); }
.panel--pale { background: var(--xue-pale); }
.panel--gold { background: var(--gold-pale); }
.panel--ink { background: var(--xue-deep); color: var(--on-dark); }

.entry { display: block; padding: 22px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry__meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; color: var(--grape); }
.entry__title { margin: 8px 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.entry__title a:hover { color: var(--xue); }
.entry__text { color: var(--graphite); font-size: 15.5px; line-height: 1.8; }

/* 9. 左侧索引栏 ----------------------------------------------------------- */
.rail { position: sticky; top: 24px; font-size: 14px; }
.rail__title {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em;
  color: var(--grape); margin-bottom: 14px;
}
.rail__list { border-left: 1px solid var(--line); }
.rail__link {
  display: block; padding: 9px 12px 9px 16px; margin-left: -1.5px;
  border-left: 2px solid transparent; color: var(--graphite);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.rail__link:hover { color: var(--xue-deep); }
.rail__link.is-active { color: var(--ink); font-weight: 700; border-left-color: var(--gold); }

/* 10. 图片容器基础规则 ---------------------------------------------------- */
.figure { margin: 0; position: relative; }
.figure__frame {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--xue-pale);
  aspect-ratio: 16 / 9;
}
.figure__frame--tall { aspect-ratio: 4 / 5; }
.figure__frame--wide { aspect-ratio: 21 / 9; }
.figure__frame img { width: 100%; height: 100%; object-fit: cover; }
.figure__veil {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(62, 124, 143, 0.22), rgba(201, 154, 61, 0.14));
}
.figure__caption { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--graphite); }

/* 11. 页脚 --------------------------------------------------------------- */
.site-footer {
  position: relative; overflow: hidden;
  margin-top: clamp(48px, 8vw, 110px);
  padding: clamp(48px, 6vw, 80px) 0 28px;
  background: var(--xue-deep);
  color: var(--on-dark);
}
.site-footer::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 140px;
  background: linear-gradient(180deg, rgba(62, 124, 143, 0.6), rgba(38, 82, 95, 0));
  pointer-events: none;
}
.site-footer::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: min(48%, 520px); height: 190px;
  background: linear-gradient(135deg, rgba(201, 154, 61, 0.22), rgba(201, 154, 61, 0));
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.footer__inner { position: relative; z-index: 1; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 1.3fr;
  gap: clamp(24px, 3vw, 48px);
}
.footer__col { min-width: 0; }
.footer__brand-name { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; color: #fff; margin-bottom: 12px; }
.footer__brand-desc { font-size: 14px; line-height: 1.8; color: var(--on-dark-soft); max-width: 34ch; margin: 0; }
.footer__heading {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; color: var(--gold);
  margin-bottom: 16px; line-height: 1.4;
}
.footer__list { display: grid; gap: 10px; }
.footer__link { font-size: 15px; color: var(--on-dark-soft); border-bottom: 1px solid transparent; transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.footer__link:hover { color: #fff; border-bottom-color: var(--gold); }
.footer__lines { display: grid; gap: 10px; font-size: 14px; line-height: 1.75; color: var(--on-dark-soft); }
.footer__notes {
  margin-top: clamp(32px, 4vw, 52px);
  padding-top: 26px;
  border-top: 1px solid var(--on-dark-line);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px 32px;
}
.footer__note { font-size: 13.5px; line-height: 1.8; color: var(--on-dark-soft); margin: 0; }
.footer__note--device { border-left: 2px solid var(--gold); padding-left: 14px; }
.footer__base {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--on-dark-line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 24px;
  font-size: 13px; color: rgba(233, 241, 243, 0.62);
}
.footer__legal, .footer__icp { margin: 0; }
.footer__icp { font-family: var(--font-mono); letter-spacing: 0.06em; }
.footer__mini-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer__mini-link { color: rgba(233, 241, 243, 0.7); border-bottom: 1px solid transparent; }
.footer__mini-link:hover { color: #fff; border-bottom-color: var(--gold); }

/* 12. 动效 ---------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* 13. 响应式 -------------------------------------------------------------- */
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .layout-split { grid-template-columns: 1fr; }
  .rail { position: static; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__notes { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .site-header { padding-top: 20px; }
  .masthead { display: flex; flex-direction: column; gap: 14px; padding: 0 0 18px; }
  .masthead__brand { order: 1; padding: 0 52px; }
  .masthead__rail--end { order: 2; justify-content: center; }
  .masthead__rail--start { order: 3; justify-content: center; }
  .masthead__mark { display: none; }
  .nav-toggle { display: inline-flex; }
  .mainnav { display: none; }
  .mainnav[data-open] { display: block; }
  .mainnav__list { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0 12px; }
  .mainnav__item { display: block; }
  .mainnav__link { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
  .mainnav__link::after { left: 4px; right: auto; width: 40px; bottom: 8px; }
  .dock { display: flex; }
}

@media (max-width: 640px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__base { flex-direction: column; align-items: flex-start; }
  .utility-links { gap: 12px; }
  .to-top { right: 16px; bottom: 82px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
