/* ==========================================================================
   立博中文站 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 通用组件
   ========================================================================== */

:root {
  --paper: #F5F1E8;
  --paper-2: #E7E0D3;
  --indigo: #17285A;
  --indigo-2: #2B4A8C;
  --ochre: #A63B2A;
  --ochre-dark: #8A2F21;
  --turquoise: #1F8A7A;
  --yellow: #E8B33A;
  --yellow-ink: #7E5F0B;
  --electric: #17C3B2;
  --ink: #1A1A1A;
  --mist: #6B6B6B;

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --frame: 7px;
  --dur: 160ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --z-frame: 80;
  --z-masthead: 50;
  --z-skip: 200;
}

/* ---------- reset ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

a {
  color: var(--indigo-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--ochre); }

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

/* 印刷边框：固定于视口，页面内容在其内部滑动 */
body::before {
  content: "";
  position: fixed;
  inset: var(--frame);
  border: 1px solid rgba(23, 40, 90, .5);
  pointer-events: none;
  z-index: var(--z-frame);
}

/* ---------- 焦点与动效基线 ---------- */

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

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

/* ---------- 中文排版 ---------- */

h1, h2, h3, h4 {
  color: var(--indigo);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.18;
}

h1 { font-size: clamp(34px, 6vw, 76px); }
h2 { font-size: clamp(26px, 3.6vw, 44px); }
h3 { font-size: clamp(20px, 2.2vw, 27px); line-height: 1.35; }
h4 { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.4; letter-spacing: 0; }

strong { font-weight: 700; }

/* ---------- 布局容器与网格 ---------- */

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 40px);
}

.wrap--narrow { max-width: 860px; }

.grid {
  display: grid;
  gap: clamp(16px, 2vw, 28px);
}

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

.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-7  { grid-column: span 7; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .grid--12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--3,
  .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 4; }
}

@media (max-width: 640px) {
  .grid--12 { grid-template-columns: minmax(0, 1fr); }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 1; }
}

/* ---------- 通用按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--indigo);
  border-radius: 0;
  background: var(--indigo);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(23, 40, 90, .2);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.btn:hover {
  color: var(--paper);
  background: var(--indigo-2);
  border-color: var(--electric);
  transform: translateY(-2px);
  box-shadow: 4px 5px 0 rgba(23, 40, 90, .24);
}

.btn:active { transform: translateY(0); box-shadow: 2px 2px 0 rgba(23, 40, 90, .2); }

.btn--primary {
  background: var(--ochre);
  border-color: var(--ochre);
  color: #FFFFFF;
}

.btn--primary:hover {
  background: var(--ochre-dark);
  border-color: var(--electric);
  color: #FFFFFF;
}

.btn--ghost {
  background: transparent;
  color: var(--indigo);
  border-color: var(--indigo);
  box-shadow: none;
}

.btn--ghost:hover {
  background: var(--paper-2);
  color: var(--indigo);
  border-color: var(--electric);
  box-shadow: 2px 2px 0 rgba(23, 40, 90, .16);
}

.btn--sm { padding: 8px 14px; font-size: 14px; }

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

/* ---------- 头部 ---------- */

.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: var(--z-skip);
  padding: 10px 18px;
  background: var(--indigo);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--electric);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 14px;
  color: var(--paper);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-masthead);
  background: var(--paper);
  color: var(--indigo);
  box-shadow: 0 1px 0 var(--paper-2), 0 14px 24px -20px rgba(23, 40, 90, .55);
}

.masthead__grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 36px);
  min-height: 88px;
  padding: clamp(12px, 1.4vw, 18px) clamp(16px, 2.6vw, 44px);
}

.masthead__brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 3px solid var(--ochre);
  padding-left: 12px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  color: var(--indigo);
  text-decoration: none;
}

.brand:hover { color: var(--indigo); }

.brand__cn {
  font-size: clamp(20px, 2.1vw, 26px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.brand__en {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--mist);
  line-height: 1.4;
  white-space: nowrap;
}

.masthead__edition {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--mist);
  line-height: 1.6;
  white-space: nowrap;
}

.masthead__edition::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  background: var(--yellow);
  vertical-align: 1px;
}

.nav { min-width: 0; }

.nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.nav__link {
  display: block;
  padding: 8px 12px;
  color: var(--indigo-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .02em;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--paper-2);
  transition: color var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--indigo);
  background: rgba(23, 195, 178, .1);
  border-color: var(--electric);
}

.nav__link[aria-current="page"] {
  color: var(--paper);
  background: var(--indigo);
  border-color: var(--indigo);
  border-bottom-color: var(--ochre);
}

.nav__link[aria-current="page"]:hover {
  color: var(--paper);
  background: var(--indigo-2);
  border-color: var(--indigo-2);
  border-bottom-color: var(--ochre);
}

.masthead__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.masthead__cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--indigo);
  border-radius: 0;
  color: var(--indigo);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.nav-toggle:hover { border-color: var(--electric); color: var(--indigo-2); }

.nav-toggle__bars {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
  flex: none;
}

.nav-toggle__text { white-space: nowrap; }

.masthead[data-open] .nav-toggle {
  background: var(--indigo);
  border-color: var(--indigo);
  color: var(--paper);
}

.masthead__flag {
  display: flex;
  height: 4px;
}

.masthead__flag i { flex: 1 1 auto; }
.masthead__flag i:nth-child(1) { background: var(--indigo-2); }
.masthead__flag i:nth-child(2) { background: #EDE7DA; }
.masthead__flag i:nth-child(3) { background: var(--ochre); }
.masthead__flag i:nth-child(4) { background: var(--turquoise); }
.masthead__flag i:nth-child(5) { background: var(--yellow); }

@media (max-width: 1279px) and (min-width: 1024px) {
  .nav__link { padding: 8px 9px; font-size: 14px; }
}

@media (max-width: 1023px) {
  .masthead__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    padding-block: 12px;
  }

  .masthead__brand { grid-column: 1; }
  .masthead__tools { grid-column: 2; }

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

  .nav {
    grid-column: 1 / -1;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height var(--dur) var(--ease), visibility var(--dur) var(--ease);
  }

  .masthead[data-open] .nav {
    max-height: 560px;
    visibility: visible;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--paper-2);
  }

  .nav__link {
    padding: 13px 8px;
    font-size: 16px;
    border-bottom: 1px solid var(--paper-2);
    text-align: left;
  }

  .nav__link[aria-current="page"] {
    border-bottom-color: var(--ochre);
  }
}

@media (max-width: 560px) {
  .masthead__grid { gap: 8px 10px; }
  .brand__cn { font-size: 19px; }
  .brand__en { display: none; }
  .masthead__edition { display: none; }
  .masthead__cta { padding: 8px 10px; font-size: 13px; }
  .nav-toggle { padding: 8px 9px; font-size: 13px; }
  .nav-toggle__text { display: none; }
}

/* ---------- 页脚 ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--indigo);
  color: var(--paper);
}

.site-footer__flag {
  display: flex;
  height: 6px;
}

.site-footer__flag i { flex: 1 1 auto; }
.site-footer__flag i:nth-child(1) { background: var(--indigo-2); }
.site-footer__flag i:nth-child(2) { background: #EDE7DA; }
.site-footer__flag i:nth-child(3) { background: var(--ochre); }
.site-footer__flag i:nth-child(4) { background: var(--turquoise); }
.site-footer__flag i:nth-child(5) { background: var(--yellow); }

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(24px, 3vw, 52px);
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(32px, 4.5vw, 60px) clamp(16px, 3vw, 40px) clamp(24px, 3vw, 40px);
}

.site-footer__name {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--paper);
}

.site-footer__note {
  margin-top: 12px;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(245, 241, 232, .74);
}

.site-footer__nav { min-width: 0; }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-links a {
  display: block;
  padding: 7px 0;
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 241, 232, .16);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              padding-left var(--dur) var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--electric);
  border-bottom-color: var(--electric);
  padding-left: 6px;
}

.footer-links a:focus-visible { outline: 3px solid var(--electric); outline-offset: 2px; }

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.site-footer__line {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
  line-height: 1.75;
  color: rgba(245, 241, 232, .86);
  word-break: break-word;
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  max-width: 1180px;
  margin-inline: auto;
  padding: 16px clamp(16px, 3vw, 40px) 30px;
  border-top: 1px solid rgba(245, 241, 232, .22);
}

.site-footer__legal {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.7;
  color: rgba(245, 241, 232, .7);
}

@media (max-width: 1023px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .site-footer__inner { grid-template-columns: 1fr; gap: 26px; }
  .site-footer__base { gap: 6px 20px; }
}

/* ---------- 面包屑 ---------- */

.breadcrumb { font-size: 13px; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  letter-spacing: .06em;
  color: var(--mist);
}

.breadcrumb__link {
  color: var(--indigo-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.breadcrumb__link:hover,
.breadcrumb__link:focus-visible {
  color: var(--ochre);
  border-bottom-color: var(--ochre);
}

.breadcrumb__sep { color: var(--mist); opacity: .7; }

.breadcrumb__current { color: var(--indigo); font-weight: 500; }

/* ---------- 章节标题 ---------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--indigo);
  margin-bottom: clamp(20px, 3vw, 36px);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .3em;
  color: var(--ochre);
  line-height: 1.6;
}

.section-title {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--indigo);
}

/* ---------- 竖排注记 ---------- */

.annotation {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .3em;
  line-height: 1;
  color: var(--mist);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

@media (max-width: 640px) {
  .annotation {
    writing-mode: horizontal-tb;
    letter-spacing: .16em;
  }
}

/* ---------- 资料卡 ---------- */

.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--indigo);
  border-radius: 0;
  padding: clamp(16px, 1.8vw, 24px);
  box-shadow: 3px 3px 0 var(--paper-2), 3px 3px 0 1px rgba(23, 40, 90, .16);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.card:hover,
.card:focus-within {
  transform: translateY(-2px);
  border-color: var(--electric);
  box-shadow: 5px 6px 0 var(--paper-2), 5px 6px 0 1px rgba(23, 40, 90, .22);
}

.card__label {
  display: inline-block;
  margin-bottom: 12px;
  padding-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  line-height: 1.5;
  color: var(--ochre);
  border-bottom: 2px solid var(--yellow);
}

.card__title {
  font-size: clamp(18px, 1.9vw, 22px);
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: 1.35;
  color: var(--indigo);
}

.card__text {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--mist);
}

/* ---------- 票签 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--paper);
  border: 1px solid var(--indigo-2);
  border-radius: 0;
  color: var(--indigo-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.6;
  white-space: nowrap;
}

.tag--blue { color: var(--indigo-2); border-color: var(--indigo-2); }
.tag--ochre { color: var(--ochre); border-color: var(--ochre); }
.tag--green { color: var(--turquoise); border-color: var(--turquoise); }
.tag--yellow {
  color: var(--yellow-ink);
  border-color: var(--yellow);
  background: rgba(232, 179, 58, .16);
}

/* ---------- 正文排版 ---------- */

.prose {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
}

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

.prose p { max-width: 34em; }

.prose h2,
.prose h3,
.prose h4 { margin-top: 1.8em; }

.prose ul,
.prose ol { display: grid; gap: .5em; }

.prose li {
  position: relative;
  padding-left: 1.15em;
  max-width: 34em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 8px;
  height: 2px;
  background: var(--ochre);
}

.prose strong { color: var(--indigo); }

.prose a { color: var(--indigo-2); }

/* ---------- 图片占位容器 ---------- */

.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--indigo);
  border-radius: 0;
  background:
    linear-gradient(125deg,
      rgba(43, 74, 140, .20) 0%,
      rgba(232, 179, 58, .16) 38%,
      rgba(31, 138, 122, .18) 72%,
      rgba(23, 195, 178, .14) 100%);
  box-shadow: 4px 4px 0 var(--paper-2);
}

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

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

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  line-height: 1.7;
  color: var(--mist);
}

@media (max-width: 640px) {
  .media { box-shadow: 3px 3px 0 var(--paper-2); }
}

/* ---------- 分隔线 ---------- */

.rule {
  height: 0;
  margin: clamp(28px, 4vw, 56px) 0;
  border: 0;
  border-top: 1px solid var(--paper-2);
}

/* ---------- 滚动显现 ---------- */

html[data-js="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}

html[data-js="on"] [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html[data-js="on"] [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
