/* ==========================================================================
   博王主站 · 共享样式 /assets/site.css
   轨道导航 + 切角面板 + 草原青绿 / 赭石 / 金属铜
   ========================================================================== */

/* ---------- 1. 重置 ---------- */
*,
*::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, h6,
p, figure, blockquote, dl, dd, hr { margin: 0; }

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

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

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

a { color: inherit; }

table { border-collapse: collapse; }

/* ---------- 2. 变量 ---------- */
:root {
  --c-green:        #1D6B57;
  --c-ink:          #0E2E27;
  --c-green-mid:    #2E8C72;
  --c-green-light:  #7FBFA8;
  --c-mist:         #CFE3DA;
  --c-paper:        #F7F4EC;
  --c-ochre:        #8E4A22;
  --c-ochre-bright: #C0703A;
  --c-copper:       #B98A4B;
  --c-char:         #2B2F2C;
  --c-rule:         #D9D3C4;

  --rail-w:      88px;
  --rail-w-open: 260px;
  --shell-max:   1440px;
  --gut:         clamp(20px, 4vw, 64px);
  --cut:         22px;

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

  --ease:   cubic-bezier(.22, .61, .36, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  background-color: var(--c-paper);
  color: var(--c-char);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

.display-1 {
  font-size: clamp(2.75rem, 7vw, 6.5rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.display-2 {
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.display-3 {
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  font-weight: 400;
  line-height: 1.32;
}

.display-1 b,
.display-1 strong,
.display-2 b,
.display-2 strong { font-weight: 600; }

.index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ochre);
}

.lede {
  max-width: 34em;
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  line-height: 1.75;
  color: var(--c-green);
}

.prose p,
.prose li {
  max-width: 40ch;
  margin-bottom: 1.1em;
}

.prose p:last-child { margin-bottom: 0; }

.on-dark { color: var(--c-paper); }
.on-dark .display-1,
.on-dark .display-2,
.on-dark .display-3 { color: var(--c-paper); }

.hairline {
  height: 1px;
  border: 0;
  background: var(--c-rule);
}

/* ---------- 4. 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.container--wide { max-width: none; }

.section { padding-block: clamp(56px, 8vw, 120px); }
.section--tight { padding-block: clamp(32px, 4.5vw, 60px); }
.section--mist { background-color: var(--c-mist); }
.section--ink {
  background-color: var(--c-ink);
  color: var(--c-paper);
}
.section--ink .display-1,
.section--ink .display-2,
.section--ink .display-3 { color: var(--c-paper); }

.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)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 5. 切角面板 ---------- */
.panel {
  position: relative;
  padding: clamp(20px, 2.6vw, 34px);
  background-color: var(--c-paper);
  border: 1px solid var(--c-rule);
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% 100%,
    var(--cut) 100%,
    0 calc(100% - var(--cut))
  );
  transition: border-color var(--t-fast) linear, background-color var(--t-fast) linear;
}

.panel:hover { border-color: var(--c-green-mid); }

.panel--mist {
  background-color: var(--c-mist);
  border-color: transparent;
}

.panel--ink {
  background-color: var(--c-ink);
  border-color: transparent;
  color: var(--c-paper);
}
.panel--ink .display-1,
.panel--ink .display-2,
.panel--ink .display-3 { color: var(--c-paper); }

.panel--green {
  background-color: var(--c-green);
  border-color: transparent;
  color: var(--c-paper);
}
.panel--green .display-1,
.panel--green .display-2,
.panel--green .display-3 { color: var(--c-paper); }

/* ---------- 6. 图片容器（页面阶段放实景图） ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: var(--c-mist);
  isolation: isolate;
}

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

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 46, 39, 0) 52%, rgba(14, 46, 39, 0.45) 100%);
  pointer-events: none;
}

.media--plain::after { display: none; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--21x9 { aspect-ratio: 21 / 9; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--3x4 { aspect-ratio: 3 / 4; }

.media--fill {
  height: 100%;
  min-height: 220px;
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 19px;
  border: 0;
  border-left: 3px solid var(--c-copper);
  background-color: var(--c-green);
  color: var(--c-paper);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) linear,
              color var(--t-fast) linear,
              border-color var(--t-fast) linear;
}

.btn:hover { background-color: var(--c-green-mid); }

.btn--ghost {
  background-color: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-rule);
  border-left: 3px solid var(--c-green);
}

.btn--ghost:hover {
  background-color: rgba(46, 140, 114, 0.08);
  border-color: var(--c-green-mid);
  border-left-color: var(--c-green-mid);
  color: var(--c-green);
}

.btn--ink {
  background-color: var(--c-ink);
  color: var(--c-paper);
}

.btn--ink:hover { background-color: var(--c-green); }

.btn--sm {
  padding: 9px 16px 9px 14px;
  font-size: 12px;
}

/* ---------- 8. 标签 / 面包屑 / 索引条 / 卷轴 / 折叠 ---------- */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--c-ink);
  background-color: rgba(127, 191, 168, 0.3);
}

.tag--ochre {
  color: var(--c-ochre);
  background-color: rgba(142, 74, 34, 0.13);
}

.tag--copper {
  color: var(--c-ink);
  background-color: transparent;
  border: 1px solid var(--c-copper);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--c-green);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--c-copper);
}

.breadcrumbs a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast) linear;
}

.breadcrumbs a:hover { border-bottom-color: currentColor; }
.breadcrumbs [aria-current] { color: var(--c-ochre); }

.index-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-rule);
}

.index-strip__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--c-copper);
}

.index-strip__title {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

.index-strip__note {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--c-green);
}

.tape {
  display: flex;
  gap: clamp(14px, 2vw, 24px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
  scrollbar-width: thin;
}

.tape > * {
  flex: 0 0 clamp(238px, 28vw, 360px);
  scroll-snap-align: start;
}

.tape::-webkit-scrollbar { height: 6px; }
.tape::-webkit-scrollbar-track { background-color: var(--c-rule); }
.tape::-webkit-scrollbar-thumb { background-color: var(--c-green-mid); }

.fold { border-bottom: 1px solid var(--c-rule); }

.fold > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--c-ink);
}

.fold > summary::-webkit-details-marker { display: none; }

.fold > summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--c-ochre);
}

.fold[open] > summary::after { content: "–"; }

.fold__body { padding-bottom: 22px; }

/* ---------- 9. 等高线纹理 ---------- */
.contour {
  background-image:
    repeating-radial-gradient(circle at 28% 38%, rgba(127, 191, 168, 0.42) 0 1px, transparent 1px 26px),
    repeating-radial-gradient(circle at 28% 38%, rgba(127, 191, 168, 0.22) 0 1px, transparent 1px 44px);
}

/* ---------- 10. 跳转与进度 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 300;
  padding: 12px 18px;
  background-color: var(--c-green);
  color: var(--c-paper);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform var(--t-base) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--c-copper);
  outline-offset: 2px;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--c-green) 0%, var(--c-copper) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ==========================================================================
   11. 头部：侧边轨道
   ========================================================================== */
.rail {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: var(--rail-w);
  overflow: hidden;
  background-color: var(--c-ink);
  color: var(--c-paper);
  border-right: 1px solid rgba(185, 138, 75, 0.32);
  transition: width var(--t-base) var(--ease);
}

.rail:hover,
.rail:focus-within { width: var(--rail-w-open); }

.rail__brand {
  display: block;
  padding: 26px 0 22px 22px;
  border-bottom: 1px solid rgba(247, 244, 236, 0.14);
  color: var(--c-paper);
  text-decoration: none;
  white-space: nowrap;
}

.rail__brand-cn {
  display: block;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
}

.rail__brand-en {
  display: block;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--c-green-light);
  opacity: 0;
  transition: opacity var(--t-fast) linear;
}

.rail:hover .rail__brand-en,
.rail:focus-within .rail__brand-en { opacity: 1; }

.rail__nav {
  flex: 1 1 auto;
  padding: 12px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.rail__list {
  display: flex;
  flex-direction: column;
}

.rail__item { flex: 0 0 auto; }

.rail__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0 11px 22px;
  border-left: 3px solid transparent;
  color: rgba(247, 244, 236, 0.72);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) linear,
              background-color var(--t-fast) linear,
              border-color var(--t-fast) linear;
}

.rail__link:hover {
  color: var(--c-paper);
  background-color: rgba(46, 140, 114, 0.24);
}

.rail__link[aria-current="page"] {
  color: var(--c-paper);
  border-left-color: var(--c-copper);
  background-color: rgba(29, 107, 87, 0.5);
}

.rail__num {
  flex: 0 0 auto;
  min-width: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--c-green-light);
}

.rail__link[aria-current="page"] .rail__num { color: var(--c-copper); }

.rail__label {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.rail__quick {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px 0 20px;
  border-top: 1px solid rgba(247, 244, 236, 0.14);
}

.rail__quick-title {
  padding: 0 0 10px 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--c-copper);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-fast) linear;
}

.rail:hover .rail__quick-title,
.rail:focus-within .rail__quick-title { opacity: 1; }

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

.rail__quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0 9px 22px;
  color: rgba(247, 244, 236, 0.72);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) linear;
}

.rail__quick-link:hover { color: var(--c-copper); }

.rail__quick-glyph {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(185, 138, 75, 0.55);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-copper);
}

/* ---------- 移动端触发条与遮罩 ---------- */
.nav-trigger {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(185, 138, 75, 0.42);
  background-color: var(--c-ink);
  color: var(--c-paper);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.nav-trigger__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--c-copper);
  transition: background-color var(--t-fast) linear;
}

.nav-trigger__bars::before,
.nav-trigger__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background-color: var(--c-copper);
  transition: transform var(--t-fast) linear, top var(--t-fast) linear;
}

.nav-trigger__bars::before { top: -6px; }
.nav-trigger__bars::after { top: 6px; }

.nav-trigger[aria-expanded="true"] .nav-trigger__bars { background-color: transparent; }
.nav-trigger[aria-expanded="true"] .nav-trigger__bars::before { top: 0; transform: rotate(45deg); }
.nav-trigger[aria-expanded="true"] .nav-trigger__bars::after { top: 0; transform: rotate(-45deg); }

.rail-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background-color: rgba(14, 46, 39, 0.58);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}

.rail-scrim.is-on {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* ==========================================================================
   12. 页脚
   ========================================================================== */
.foot {
  position: relative;
  overflow: hidden;
  padding-top: clamp(52px, 7vw, 100px);
  background-color: var(--c-ink);
  color: var(--c-paper);
}

.foot::before {
  content: "";
  position: absolute;
  inset: -20% 0 auto auto;
  width: 60%;
  max-width: 760px;
  aspect-ratio: 1 / 1;
  background-image:
    repeating-radial-gradient(circle at 60% 40%, rgba(127, 191, 168, 0.22) 0 1px, transparent 1px 30px),
    repeating-radial-gradient(circle at 60% 40%, rgba(185, 138, 75, 0.16) 0 1px, transparent 1px 52px);
  pointer-events: none;
  opacity: 0.7;
}

.foot__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) 2fr;
  gap: clamp(32px, 5vw, 76px);
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.foot__logo {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--c-paper);
}

.foot__line {
  max-width: 30em;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(247, 244, 236, 0.7);
}

.foot__meta {
  display: grid;
  gap: 10px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(247, 244, 236, 0.16);
}

.foot__meta li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: baseline;
}

.foot__meta-key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--c-copper);
}

.foot__meta-val {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(247, 244, 236, 0.82);
  word-break: break-word;
}

.foot__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 24px;
}

.foot__col-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--c-copper);
}

.foot__list {
  display: grid;
  gap: 9px;
}

.foot__link {
  display: inline-block;
  font-size: 14px;
  color: rgba(247, 244, 236, 0.78);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast) linear, border-color var(--t-fast) linear;
}

.foot__link:hover {
  color: var(--c-copper);
  border-bottom-color: rgba(185, 138, 75, 0.6);
}

.foot__base {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  width: 100%;
  max-width: var(--shell-max);
  margin: clamp(40px, 6vw, 76px) auto 0;
  padding: 20px var(--gut) 26px;
  border-top: 1px solid rgba(247, 244, 236, 0.16);
}

.foot__copy {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(247, 244, 236, 0.6);
}

/* ==========================================================================
   13. 显现动效
   ========================================================================== */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   14. 焦点可见
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--c-ochre-bright);
  outline-offset: 2px;
}

.rail :focus-visible,
.foot :focus-visible,
.nav-trigger:focus-visible,
.section--ink :focus-visible,
.panel--ink :focus-visible,
.panel--green :focus-visible {
  outline: 2px solid var(--c-copper);
  outline-offset: 2px;
}

/* ==========================================================================
   15. 响应式
   ========================================================================== */
@media (max-width: 1120px) {
  .foot__inner { grid-template-columns: minmax(220px, 1fr) 2fr; }
  .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 24px; }
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --rail-w: min(84vw, 320px); }

  body {
    padding-left: 0;
    padding-top: 62px;
    font-size: 16.5px;
  }

  .rail {
    transform: translateX(-100%);
    transition: transform var(--t-base) var(--ease);
    box-shadow: 0 0 40px rgba(14, 46, 39, 0.4);
  }

  .rail:hover,
  .rail:focus-within { width: var(--rail-w); }

  .rail[data-open] { transform: translateX(0); }

  .rail__brand-en,
  .rail__quick-title { opacity: 1; }

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

  .foot__inner { grid-template-columns: 1fr; }

  .tape > * { flex: 0 0 min(78vw, 320px); }
}

@media (max-width: 680px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }

  .foot__cols { grid-template-columns: 1fr; }

  .foot__meta li { grid-template-columns: 68px 1fr; }

  .foot__base { flex-direction: column; }
}

/* ==========================================================================
   16. 减弱动效
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

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

  .tape { scroll-snap-type: none; }
}
