/* =========================================================================
   鸿禾官方主站 · 共享样式 /assets/site.css
   分屏系统 / 锐利直角 / 精密网格 / 青绿→暖金渐变
   ========================================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 色板 */
  --ink: #0E2A22;
  --ink-2: #16382E;
  --green: #1F6F52;
  --green-lit: #2E8C67;
  --green-pale: #7FBF9B;
  --gold: #C9A227;
  --gold-lit: #E8C86A;
  --gold-deep: #8F6F0E;
  --paper: #F4F1E8;
  --white: #FFFFFF;
  --text: #41564C;
  --muted: #8A9691;
  --warn: #B8651F;

  /* 线条 */
  --line: rgba(14, 42, 34, .14);
  --line-strong: rgba(14, 42, 34, .30);
  --line-invert: rgba(244, 241, 232, .18);

  /* 字体 */
  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;

  /* 度量 */
  --container: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  /* 头部主题（浅色实色态会覆盖） */
  --hdr-border: rgba(244, 241, 232, .30);
  --badge-fg: #E8C86A;
  --badge-bd: rgba(232, 200, 106, .45);
  --badge-bg: rgba(232, 200, 106, .12);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

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

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

/* ---------- 3. 排版基线 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: clamp(32px, 4.6vw, 54px); }
h2 { font-size: clamp(26px, 3vw, 38px); }
h3 { font-size: clamp(20px, 2vw, 24px); font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; letter-spacing: 0; }

p { text-wrap: pretty; }

strong { color: var(--ink); font-weight: 700; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .92em;
  letter-spacing: .02em;
}

/* ---------- 4. 可访问性工具 ---------- */
.visually-hidden {
  position: absolute !important;
  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;
}

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

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold-lit);
}

.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 400;
  display: inline-block;
  padding: 12px 22px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: top .22s var(--ease);
}

.skip-link:focus {
  top: 14px;
}

/* ---------- 5. 容器与基础布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

#main-content {
  display: block;
  padding-top: var(--header-h);
}

#main-content.main--flush {
  padding-top: 0;
}

/* 区块渐变分隔线：长度不超过容器 1/3，左对齐 */
.divider-grad {
  height: 2px;
  width: min(33%, 320px);
  background: linear-gradient(90deg, var(--green) 0%, var(--green-lit) 38%, var(--gold) 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  color: var(--green);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--gold);
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .01em;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s var(--ease),
              border-color .2s var(--ease),
              color .2s var(--ease);
}

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: var(--gold-lit);
  border-color: var(--gold-lit);
}

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

.btn--solid:hover,
.btn--solid:focus-visible {
  background: var(--green-lit);
  border-color: var(--green-lit);
}

.btn--outline {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background: rgba(31, 111, 82, .08);
}

/* ---------- 7. 头部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  color: var(--paper);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease),
              color .3s var(--ease),
              border-color .3s var(--ease);
}

/* 首屏叠加态：深墨绿向下渐隐，保证任何页面首屏文字都可读 */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 124px;
  background: linear-gradient(180deg,
      rgba(14, 42, 34, .94) 0%,
      rgba(14, 42, 34, .62) 54%,
      rgba(14, 42, 34, 0) 100%);
  pointer-events: none;
  transition: opacity .3s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(244, 241, 232, .97);
  color: var(--ink);
  border-bottom-color: var(--line);
  --hdr-border: var(--line-strong);
  --badge-fg: var(--gold-deep);
  --badge-bd: rgba(201, 162, 39, .55);
  --badge-bg: rgba(201, 162, 39, .10);
}

.site-header.is-scrolled::before {
  opacity: 0;
}

.site-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: var(--header-h);
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: inherit;
}

.brand__mark {
  position: relative;
  display: block;
  width: 22px;
  height: 30px;
  flex: none;
  color: var(--gold);
}

.brand__mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  bottom: 0;
  width: 1px;
  margin-left: -.5px;
  background: currentColor;
}

.brand__mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 5px;
  height: 1px;
  margin-left: -8px;
  background: currentColor;
  box-shadow:
    11px 0 0 currentColor,
    0 6px 0 currentColor,
    11px 6px 0 currentColor,
    0 12px 0 currentColor,
    11px 12px 0 currentColor;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand__suffix {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: .06em;
  opacity: .66;
  margin-top: 2px;
}

/* 版本徽标 */
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--badge-bd);
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 1.5;
  white-space: nowrap;
  transition: color .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease);
}

.version-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.version-badge__text {
  font-feature-settings: "tnum" 1;
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 9px 13px;
  border: 1px solid var(--hdr-border);
  color: inherit;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}

.nav-toggle__bars {
  display: block;
  width: 16px;
  flex: none;
}

.nav-toggle__bars span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform .26s var(--ease), opacity .18s var(--ease);
}

.nav-toggle__bars span + span {
  margin-top: 4px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 34px);
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.8vw, 28px);
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 6px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  color: inherit;
  white-space: nowrap;
  transition: color .2s var(--ease);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after {
  transform: scaleX(1);
}

.site-nav__link[aria-current="page"]::after {
  height: 2px;
  background: var(--gold);
  transform: scaleX(1);
}

.site-nav__cta {
  flex: none;
  padding: 9px 16px;
  font-size: 14px;
}

/* ---------- 8. 阅读进度条（JS 注入） ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  z-index: 300;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-lit) 48%, var(--gold) 82%, var(--gold-lit) 100%);
  pointer-events: none;
  transition: width .12s linear;
}

/* ---------- 9. 长页章节轨 ---------- */
.section-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-self: start;
  border-left: 1px solid var(--line);
  position: sticky;
  top: calc(var(--header-h) + 32px);
}

.section-rail__link {
  position: relative;
  display: block;
  padding: 8px 0 8px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  transition: color .2s var(--ease);
}

.section-rail__link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--green);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform .45s var(--ease);
}

.section-rail__link:hover {
  color: var(--green);
}

.section-rail__link[aria-current="true"] {
  color: var(--ink);
}

.section-rail__link[aria-current="true"]::before {
  transform: scaleY(1);
}

/* ---------- 10. 面包屑 ---------- */
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  font-family: var(--font-mono);
  color: var(--line-strong);
}

.breadcrumb__list a {
  color: var(--text);
  transition: color .2s var(--ease);
}

.breadcrumb__list a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.breadcrumb__list [aria-current="page"] {
  color: var(--ink);
}

/* ---------- 11. 图片容器基础规则 ---------- */
.img-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--ink-2);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}

.img-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

/* 无图阶段占位：青绿→暖金多层渐变 + 稻田竖纹 */
.img-frame--placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(142deg,
      rgba(31, 111, 82, .92) 0%,
      rgba(46, 140, 103, .62) 44%,
      rgba(201, 162, 39, .38) 100%),
    repeating-linear-gradient(90deg,
      rgba(244, 241, 232, .16) 0 1px,
      transparent 1px 18px);
}

.img-frame__caption {
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

.site-footer__rule {
  height: 2px;
  background: linear-gradient(90deg,
    var(--green) 0%,
    var(--green-lit) 30%,
    var(--gold) 72%,
    var(--gold-lit) 100%);
}

/* 精密网格底纹 */
.site-footer::after {
  content: "";
  position: absolute;
  inset: 2px 0 0 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(244, 241, 232, .055) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg,  rgba(244, 241, 232, .035) 0 1px, transparent 1px 72px);
  pointer-events: none;
  z-index: 0;
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr) minmax(0, .9fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(40px, 5.5vw, 72px) var(--gutter) clamp(28px, 4vw, 48px);
}

.footer-brand__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.footer-brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.footer-brand__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--green-pale);
  margin-bottom: 18px;
}

.footer-brand__note {
  max-width: 32ch;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.85;
  color: rgba(244, 241, 232, .74);
  margin-bottom: 24px;
}

.footer-contact {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-invert);
}

.footer-contact__row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: rgba(244, 241, 232, .46);
  padding-top: 4px;
}

.footer-contact__val {
  color: rgba(244, 241, 232, .88);
  word-break: break-word;
}

.footer-col__title {
  display: flex;
  align-items: baseline;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--paper);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-invert);
}

.footer-col__index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--gold);
  margin-right: 10px;
}

.footer-col__list {
  display: grid;
  gap: 1px;
}

.footer-col__list a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
  font-family: var(--font-sans);
  font-size: 14.5px;
  color: rgba(244, 241, 232, .82);
  transition: color .2s var(--ease);
}

.footer-col__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 1px;
  background: var(--gold-lit);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}

.footer-col__list a:hover {
  color: var(--paper);
}

.footer-col__list a:hover::after,
.footer-col__list a:focus-visible::after {
  transform: scaleX(1);
}

.site-footer__base {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(24px, 3vw, 36px);
}

.site-footer__base-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-invert);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(244, 241, 232, .58);
}

.site-footer__legal {
  font-family: var(--font-mono);
  letter-spacing: .03em;
}

.site-footer__note {
  font-family: var(--font-serif);
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1080px) {
  .brand__suffix { display: none; }
  .site-nav { gap: 16px; }
  .site-nav__list { gap: 14px; }
  .site-nav__link { font-size: 14px; }
  .site-nav__cta { padding: 8px 13px; font-size: 13px; }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }

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

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 130;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 6px var(--gutter) 28px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: var(--ink);
    color: var(--paper);
    border-top: 1px solid var(--line-invert);
  }

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

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

  .site-nav__list li {
    border-bottom: 1px solid var(--line-invert);
  }

  .site-nav__link {
    padding: 14px 0 14px 16px;
    font-size: 16px;
  }

  .site-nav__link::after {
    display: none;
  }

  .site-nav__link[aria-current="page"] {
    color: var(--gold-lit);
  }

  .site-nav__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 16px;
    margin-top: -8px;
    background: var(--gold);
  }

  .site-nav__cta {
    width: 100%;
    margin-top: 22px;
    padding: 13px 20px;
    font-size: 15px;
  }
}

@media (max-width: 900px) {
  .section-rail {
    position: static;
    flex-direction: row;
    gap: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .section-rail::-webkit-scrollbar { display: none; }

  .section-rail__link {
    padding: 12px 16px;
    white-space: nowrap;
  }

  .section-rail__link::before {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 2px;
    transform: scaleX(0);
    transform-origin: left center;
  }

  .section-rail__link[aria-current="true"]::before {
    transform: scaleX(1);
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  body { font-size: 16px; }

  .site-header__inner { gap: 12px; }
  .brand__name { font-size: 18px; }
  .brand__mark { width: 20px; height: 27px; }
  .version-badge { padding: 2px 7px 2px 6px; font-size: 11px; }
  .nav-toggle { padding: 8px 11px; }
  .nav-toggle__label { display: none; }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .footer-brand__note { max-width: none; }

  .site-footer__base-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 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;
  }

  .reading-progress { transition: none; }

  .site-nav__link::after,
  .footer-col__list a::after,
  .section-rail__link::before {
    transition: none;
  }
}
