/* ==========================================================================
   亿百主站 · 共享样式表 /assets/site.css
   骨架：双层档案导航 + 编号索引带 + 堆叠面板 + 档案封底页脚
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  --ink: #17181A;
  --panel: #1F2124;
  --rule: #0C0D0E;
  --paper: #F2EDE4;
  --paper-2: #FBF7EF;
  --index: #A8A29A;
  --red: #C0462C;
  --red-lit: #E0704F;
  --jade: #3FA79F;
  --saffron: #E0A92B;

  --line: rgba(242, 237, 228, .14);
  --line-2: rgba(242, 237, 228, .28);
  --ink-line: rgba(12, 13, 14, .16);

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --nav-h: 62px;

  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-read: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-ui: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "Oswald", "DIN Alternate", "Arial Narrow", "Helvetica Neue", sans-serif;

  --shadow-panel: 0 24px 46px -32px rgba(0, 0, 0, .92);
  --shadow-lift: 0 34px 60px -34px rgba(0, 0, 0, .98);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 240ms;
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image: repeating-linear-gradient(
    0deg,
    rgba(242, 237, 228, .012) 0 1px,
    transparent 1px 4px
  );
  color: var(--paper);
  font-family: var(--font-read);
  font-size: clamp(16px, 1.02vw, 17.5px);
  line-height: 1.85;
  font-weight: 400;
  letter-spacing: .01em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

::selection {
  background: var(--red);
  color: var(--paper-2);
}

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

[id] { scroll-margin-top: 104px; }

/* ---------- 3. 中文排版工具类 ---------- */
.t-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 7vw, 128px);
  line-height: .98;
  letter-spacing: -.015em;
}

.t-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.28;
  letter-spacing: -.01em;
}

.t-sub {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.7;
}

.t-idx {
  font-family: var(--font-num);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--index);
}

.t-num {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(96px, 14vw, 240px);
  line-height: .82;
  letter-spacing: -.03em;
}

.t-paper { color: var(--rule); }

/* ---------- 4. 布局容器 ---------- */
.shell {
  width: min(var(--maxw), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.wrap { display: block; }

.section {
  position: relative;
  padding-block: clamp(48px, 7vw, 104px);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
  padding-bottom: 14px;
  margin-bottom: clamp(22px, 3vw, 40px);
  border-bottom: 1px solid var(--line-2);
}

.grid {
  display: grid;
  gap: clamp(20px, 3vw, 44px);
}

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

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .74em 1.3em;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn--solid {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper-2);
}

.btn--solid:hover {
  background: var(--red-lit);
  border-color: var(--red-lit);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -18px var(--red-lit);
}

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

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

.btn--line {
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--red);
  color: var(--paper);
  padding-inline: 0;
}

.btn--line:hover { color: var(--red-lit); border-bottom-color: var(--red-lit); }

/* ---------- 6. 头部 ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 120;
  padding: 10px 18px;
  background: var(--red);
  color: var(--paper-2);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: .06em;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform .18s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ink);
  border-bottom: 1px solid var(--line-2);
}

.header-inner {
  position: relative;
  padding-block: 0;
}

/* 上层：档案状态条 */
.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.4;
  color: var(--index);
  text-transform: uppercase;
}

.header-meta__id { color: var(--saffron); }

.header-meta__dot {
  flex: none;
  width: 5px;
  height: 5px;
  background: var(--red);
}

.header-meta__rev { color: var(--index); }

.header-meta__rule {
  flex: 1 1 auto;
  height: 1px;
  min-width: 20px;
  background: var(--line);
}

.header-meta__note {
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  letter-spacing: .06em;
}

/* 下层：品牌 + 栏目带 */
.header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-h);
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: none;
  margin-right: auto;
  padding-right: 18px;
  text-decoration: none;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(19px, 1.7vw, 24px);
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--paper-2);
  transition: color var(--dur) var(--ease);
}

.brand:hover .brand__name { color: var(--red-lit); }

.brand__tag {
  font-family: var(--font-num);
  font-size: 10px;
  letter-spacing: .22em;
  line-height: 1.5;
  color: var(--index);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.site-nav__list > li + li { border-left: 1px solid var(--line); }

.site-nav__list a {
  display: block;
  padding: 12px clamp(10px, 1.25vw, 20px);
  font-family: var(--font-ui);
  font-size: clamp(13px, 1vw, 15px);
  letter-spacing: .05em;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--paper);
  border-bottom: 2px solid transparent;
  transition:
    color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.site-nav__list a:hover {
  color: var(--red-lit);
  background: rgba(192, 70, 44, .08);
}

.site-nav__list a[aria-current="page"] {
  color: var(--paper-2);
  border-bottom-color: var(--red);
  background: rgba(192, 70, 44, .12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-left: 12px;
}

.header-cta { font-size: 13px; padding: .68em 1.1em; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: .08em;
  line-height: 1.2;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

.nav-toggle__icon {
  display: grid;
  gap: 4px;
  width: 16px;
  flex: none;
}

.nav-toggle__icon i {
  display: block;
  height: 1px;
  width: 100%;
  background: currentColor;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

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

.nav-toggle__label { text-transform: none; }

/* 进度轨 */
.header-rail {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--red) 0%, var(--red-lit) 58%, var(--saffron) 100%);
  transition: width .12s linear;
}

/* ---------- 7. 编号索引带 ---------- */
.index-strip {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  background: rgba(31, 33, 36, .72);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.index-strip::-webkit-scrollbar { height: 4px; }
.index-strip::-webkit-scrollbar-thumb { background: var(--line-2); }

.index-strip__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px clamp(14px, 1.8vw, 26px);
  border-right: 1px solid var(--line);
  scroll-snap-align: start;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: .07em;
  white-space: nowrap;
  color: var(--index);
  text-decoration: none;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.index-strip__item:hover { color: var(--paper); background: rgba(242, 237, 228, .05); }

[data-index-link][aria-current="true"] {
  color: var(--paper-2);
  background: rgba(192, 70, 44, .16);
  box-shadow: inset 0 -2px 0 var(--red);
}

/* ---------- 8. 堆叠面板 ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(22px, 3vw, 44px);
}

.panel--stack { isolation: isolate; }

.panel--stack::before {
  content: "";
  position: absolute;
  inset: 10px -10px -10px 10px;
  z-index: -1;
  background: rgba(12, 13, 14, .55);
  border: 1px solid var(--line);
  pointer-events: none;
}

.panel--paper {
  background: var(--paper-2);
  border-color: var(--ink-line);
  color: var(--rule);
}

.panel--paper .t-idx,
.panel--paper .t-sub { color: rgba(12, 13, 14, .58); }

/* ---------- 9. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--index);
}

.breadcrumb a { color: var(--index); transition: color var(--dur) var(--ease); }
.breadcrumb a:hover { color: var(--red-lit); }
.breadcrumb__sep { opacity: .5; }

/* ---------- 10. 图片容器基础件 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: #101113;
  border: 1px solid var(--line);
}

.media img,
.media > svg,
.media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.86) contrast(1.06);
}

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

.media__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--saffron);
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.media__caption {
  display: block;
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: .04em;
  color: var(--index);
}

/* ---------- 11. 页脚（档案封底） ---------- */
.site-footer {
  margin-top: clamp(64px, 9vw, 132px);
  padding-block: clamp(40px, 6vw, 80px) clamp(22px, 3vw, 34px);
  background: var(--ink);
  border-top: 1px solid var(--line-2);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr .85fr .85fr 1.35fr;
  gap: clamp(26px, 4vw, 64px);
  padding-bottom: clamp(30px, 4.5vw, 56px);
  border-bottom: 1px solid var(--line);
}

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

.footer-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--paper-2);
}

.footer-desc {
  margin-top: 12px;
  max-width: 34em;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--index);
}

.footer-code {
  margin-top: 16px;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--index);
}

.footer-code__label {
  color: var(--saffron);
  margin-right: 6px;
}

.footer-title {
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .16em;
  line-height: 1.5;
  color: var(--index);
  text-transform: uppercase;
}

.footer-links { display: grid; gap: 9px; }

.footer-links a {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: .03em;
  line-height: 1.6;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer-links a:hover {
  color: var(--red-lit);
  border-bottom-color: var(--red-lit);
}

.contact-list { display: grid; gap: 11px; }

.contact-list li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.contact-list__k {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--index);
}

.contact-list__v {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: .02em;
  line-height: 1.6;
  color: var(--paper);
  word-break: break-word;
}

.contact-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--index);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 26px;
  padding-top: clamp(16px, 2vw, 24px);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .07em;
  line-height: 1.7;
  color: var(--index);
}

.footer-legal__links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-legal__links a {
  color: var(--index);
  transition: color var(--dur) var(--ease);
}

.footer-legal__links a:hover { color: var(--red-lit); }

.footer-legal__icp { color: var(--index); }

.footer-legal__copy { margin-left: auto; color: var(--index); }

/* ---------- 12. 返回顶部（JS 注入） ---------- */
.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: .08em;
  line-height: 1.2;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    visibility var(--dur),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover { border-color: var(--red-lit); color: var(--red-lit); }

.to-top__arrow {
  font-family: var(--font-num);
  font-size: 15px;
  line-height: 1;
  color: var(--red-lit);
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1180px) {
  .header-meta__note { display: none; }
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-col--contact { grid-column: 1 / -1; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border-top: 1px solid var(--line-2);
    border-bottom: 1px solid var(--line-2);
    box-shadow: 0 30px 44px -28px rgba(0, 0, 0, .95);
    padding: 0 var(--gutter);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

  .site-nav[data-open] { display: block; }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav__list > li + li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .site-nav__list a {
    padding: 15px 12px;
    font-size: 15px;
    border-bottom: 0;
    border-left: 2px solid transparent;
  }

  .site-nav__list a[aria-current="page"] {
    border-bottom-color: transparent;
    border-left-color: var(--red);
  }

  .header-rail { bottom: -1px; }
}

@media (max-width: 860px) {
  .header-meta { gap: 9px; font-size: 11px; }
  .header-meta__rule { display: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col--brand { grid-column: 1 / -1; }
  .footer-col--contact { grid-column: 1 / -1; }

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

@media (max-width: 640px) {
  :root { --nav-h: 58px; --gutter: 18px; }

  .header-cta { display: none; }

  .brand__name { font-size: 19px; }
  .brand__tag { font-size: 9px; letter-spacing: .18em; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-legal__copy { margin-left: 0; }

  .contact-list li { grid-template-columns: minmax(0, 1fr); gap: 3px; }

  .to-top { padding: 9px 12px; font-size: 12px; }
  .to-top__label { display: none; }

  .t-display { font-size: clamp(38px, 12vw, 64px); }
}

/* ---------- 14. 降级动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  .btn--solid:hover,
  .to-top[data-visible] { transform: none; }
}
