/* ============================================================
   利记指南 · 共享样式表 /assets/site.css
   骨架：深墨绿命令栏 + 纸色正文 + 铜金编号
   ============================================================ */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--char);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-serif); font-weight: 600; line-height: 1.34; letter-spacing: .01em; color: var(--ink); }
p { margin: 0 0 1.05em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

a {
  color: var(--pine);
  text-decoration: underline;
  text-decoration-color: rgba(31, 122, 104, .38);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.lg-header :focus-visible, .lg-footer :focus-visible { outline-color: var(--copper-lt); }

/* ---------- 变量 ---------- */
:root {
  --ink: #0E3B33;
  --ink-2: #14574A;
  --pine: #1F7A68;
  --copper: #C08A3E;
  --copper-lt: #E0B26A;
  --paper: #F5F1E8;
  --card: #E8E3D6;
  --mist: #D7DEE3;
  --char: #2B2A26;
  --ash: #8A8676;
  --red: #B4472F;

  --shell: 1240px;
  --radius: 3px;
  --line: rgba(43, 42, 38, .15);
  --line-soft: rgba(43, 42, 38, .09);

  --font-serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 通用容器与工具类 ---------- */
.lg-shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.lg-main { display: block; }
#main-content, .lg-main { scroll-margin-top: 112px; }

.lg-mono { font-family: var(--font-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.lg-muted { color: var(--ash); }
.lg-hr { height: 1px; border: 0; background: var(--line); margin: 28px 0; }
.lg-lead { font-size: 17px; line-height: 1.9; color: #3B3933; max-width: 34em; margin-bottom: 1.2em; }

.lg-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--copper); margin-right: 7px; vertical-align: middle;
}

/* ---------- 跳至正文 ---------- */
.lg-skip {
  position: absolute; left: 12px; top: -60px; z-index: 90;
  background: var(--copper); color: #221D14; text-decoration: none;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  padding: 9px 14px; border-radius: 0 0 var(--radius) var(--radius);
  transition: top .16s ease;
}
.lg-skip:focus { top: 0; }

/* ---------- 头部 ---------- */
.lg-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(224, 178, 106, .28);
}
.lg-header__bar {
  position: relative;
  max-width: var(--shell); margin: 0 auto;
  padding: 11px 24px;
  display: flex; align-items: center; gap: 22px;
}

.lg-brand {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px;
  text-decoration: none; padding: 2px 0;
}
.lg-brand__name {
  font-family: var(--font-serif); font-weight: 700; font-size: 21px;
  letter-spacing: .12em; color: var(--paper); line-height: 1.2;
}
.lg-brand__sub {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .22em;
  color: var(--copper-lt); line-height: 1.4;
}
.lg-brand:hover .lg-brand__name { color: var(--copper-lt); }

.lg-nav { margin-left: auto; z-index: 6; }
.lg-nav__list { display: flex; align-items: center; gap: 2px; }
.lg-nav__item { position: relative; }
.lg-nav__link {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 9px 11px 11px; border-radius: var(--radius) var(--radius) 0 0;
  font-size: 14px; line-height: 1.3; text-decoration: none;
  color: rgba(245, 241, 232, .78);
  transition: background .16s ease, color .16s ease;
}
.lg-nav__num {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em;
  color: var(--copper); flex: 0 0 auto;
}
.lg-nav__label { white-space: nowrap; }
.lg-nav__link:hover { background: var(--ink-2); color: #FFFFFF; }
.lg-nav__link[aria-current="page"] { color: var(--paper); background: rgba(224, 178, 106, .14); }
.lg-nav__link[aria-current="page"]::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px;
  height: 2px; background: var(--copper);
}
.lg-nav__link[aria-current="page"] .lg-nav__num { color: var(--copper-lt); }
.lg-nav__foot { display: none; }

.lg-navtoggle {
  display: none; margin-left: auto; align-items: center; gap: 9px;
  background: transparent; border: 1px solid rgba(224, 178, 106, .45);
  border-radius: var(--radius); padding: 8px 12px; cursor: pointer;
  color: var(--copper-lt); font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .12em;
}
.lg-navtoggle:hover { background: rgba(224, 178, 106, .14); }
.lg-navtoggle__bars { display: inline-flex; flex-direction: column; gap: 3px; width: 15px; }
.lg-navtoggle__bars i { display: block; height: 1.5px; background: currentColor; }
.lg-navtoggle__bars i:nth-child(2) { width: 72%; }

/* ---------- 状态条 ---------- */
.lg-statusbar {
  position: relative;
  background: var(--ink-2);
  border-top: 1px solid rgba(224, 178, 106, .2);
}
.lg-statusbar__inner {
  max-width: var(--shell); margin: 0 auto;
  padding: 7px 24px 9px;
  display: flex; align-items: center; gap: 18px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  color: rgba(245, 241, 232, .68);
}
.lg-statusbar__tag { color: rgba(245, 241, 232, .82); white-space: nowrap; }
.lg-statusbar__chapter {
  color: var(--copper-lt);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw;
}
.lg-statusbar__meta { margin-left: auto; white-space: nowrap; }
.lg-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(245, 241, 232, .1);
}
.lg-progress__bar {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--copper), var(--copper-lt));
  transition: width .12s linear;
}

/* ---------- 按钮 ---------- */
.lg-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  padding: 9px 15px; border-radius: var(--radius);
  border: 1px solid var(--copper); background: transparent;
  color: #8A6021; text-decoration: none; cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.lg-btn:hover { background: var(--copper); color: #221D14; border-color: var(--copper); }
.lg-btn--solid { background: var(--copper); color: #221D14; }
.lg-btn--solid:hover { background: var(--copper-lt); border-color: var(--copper-lt); }
.lg-btn--ghost { border-color: rgba(224, 178, 106, .5); color: var(--copper-lt); }
.lg-btn--ghost:hover { background: rgba(224, 178, 106, .16); color: var(--paper); border-color: var(--copper-lt); }

/* ---------- 页脚 ---------- */
.lg-footer {
  margin-top: 76px;
  background: var(--ink);
  color: rgba(245, 241, 232, .78);
  border-top: 3px solid var(--copper);
}
.lg-footer__inner {
  max-width: var(--shell); margin: 0 auto;
  padding: 44px 24px 0;
  display: grid; grid-template-columns: 1.15fr 1fr 1.15fr; gap: 36px;
}
.lg-footer__col { min-width: 0; }
.lg-footer__title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: .2em; color: var(--copper);
  padding-bottom: 9px; margin-bottom: 14px;
  border-bottom: 1px solid rgba(224, 178, 106, .28);
}
.lg-footer__idx { color: rgba(224, 178, 106, .6); }
.lg-footer__list { display: grid; gap: 1px; }
.lg-footer__list--split { grid-template-columns: 1fr 1fr; column-gap: 18px; }
.lg-footer__link {
  display: inline-block; padding: 6px 0;
  font-size: 14px; color: rgba(245, 241, 232, .8); text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .16s ease, border-color .16s ease;
}
.lg-footer__link:hover { color: var(--copper-lt); border-bottom-color: rgba(224, 178, 106, .5); }
.lg-footer__note {
  margin: 16px 0 0; font-size: 12.5px; line-height: 1.8;
  color: rgba(245, 241, 232, .52); max-width: 30em;
}
.lg-footer__contact { display: grid; }
.lg-footer__contactrow {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px;
  margin: 0; padding: 8px 0;
  border-bottom: 1px dashed rgba(245, 241, 232, .16);
  font-size: 13.5px; line-height: 1.7;
}
.lg-footer__contactlabel {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--ash); padding-top: 3px;
}
.lg-footer__contactvalue { color: rgba(245, 241, 232, .9); word-break: break-word; }
.lg-footer__cta { margin-top: 18px; }
.lg-footer__bottom {
  max-width: var(--shell); margin: 34px auto 0;
  padding: 15px 24px 26px;
  border-top: 1px solid rgba(245, 241, 232, .16);
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
}
.lg-footer__brand {
  font-family: var(--font-serif); font-weight: 700; font-size: 15px;
  letter-spacing: .12em; color: var(--paper);
}
.lg-footer__legal {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  color: var(--ash);
}
.lg-footer__sep { margin: 0 8px; color: rgba(224, 178, 106, .6); }
.lg-footer__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 面包屑 ---------- */
.lg-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 18px 0 4px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  color: var(--ash);
}
.lg-crumbs__link { color: var(--ash); text-decoration: none; border-bottom: 1px solid transparent; }
.lg-crumbs__link:hover { color: var(--pine); border-bottom-color: currentColor; }
.lg-crumbs__sep { color: var(--copper); }
.lg-crumbs__now { color: var(--ink); }

/* ---------- 章节头 ---------- */
.lg-section { padding: 32px 0 8px; margin-top: 28px; border-top: 1px solid var(--line); }
.lg-section:first-of-type { border-top: 0; margin-top: 8px; }
.lg-section__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.lg-section__num {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em;
  color: var(--copper); flex: 0 0 auto;
}
.lg-section__title { font-size: clamp(24px, 3vw, 32px); }
.lg-section__desc { max-width: 34em; margin: 0 0 18px; font-size: 15.5px; color: #4E4A43; }

/* ---------- 索引卡网格 ---------- */
.lg-index {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
}
.lg-index__card {
  position: relative; display: block; padding: 16px 16px 14px 18px;
  background: var(--card); border: 1px solid rgba(14, 59, 51, .12);
  border-radius: var(--radius); color: inherit; text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.lg-index__card::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: var(--copper); opacity: .5; transition: opacity .18s ease, top .18s ease, bottom .18s ease;
}
.lg-index__card:hover { transform: translateY(-2px); background: #EFE9DB; border-color: rgba(192, 138, 62, .6); }
.lg-index__card:hover::before { opacity: 1; top: 0; bottom: 0; }
.lg-index__num {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .16em; color: var(--copper);
}
.lg-index__title {
  display: block; margin: 6px 0 4px;
  font-family: var(--font-serif); font-size: 19px; font-weight: 600; color: var(--ink);
}
.lg-index__text { display: block; font-size: 13.5px; line-height: 1.75; color: #5B5750; }
.lg-index__meta {
  display: block; margin-top: 10px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; color: var(--ash);
}

/* ---------- 横向对照条 ---------- */
.lg-compare {
  position: relative; border: 1px solid rgba(14, 59, 51, .14); border-radius: var(--radius);
  background: #FBF8F1; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scroll-snap-type: x proximity;
}
.lg-compare__head, .lg-compare__row { min-width: 560px; }
.lg-compare__head {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  background: var(--ink-2); color: var(--copper-lt);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
}
.lg-compare__head > span { padding: 9px 12px; border-right: 1px solid rgba(224, 178, 106, .2); }
.lg-compare__row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr;
  border-top: 1px solid var(--line-soft); font-size: 14px; scroll-snap-align: start;
}
.lg-compare__row--tint { background: rgba(215, 222, 227, .55); }
.lg-compare__key {
  padding: 10px 12px; border-right: 1px dashed var(--line-soft);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em; color: var(--ink);
}
.lg-compare__val {
  padding: 10px 12px; border-right: 1px dashed var(--line-soft);
  font-size: 13.5px; line-height: 1.7; color: #4A4740;
}
.lg-compare__val--alt { background: rgba(224, 178, 106, .16); }

/* ---------- 编号阶梯带 ---------- */
.lg-steps { margin: 6px 0 0 9px; border-left: 2px solid rgba(192, 138, 62, .38); }
.lg-steps__item { position: relative; padding: 0 0 24px 26px; }
.lg-steps__item::before {
  content: ""; position: absolute; left: -8px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--copper);
}
.lg-steps__item:last-child { padding-bottom: 4px; }
.lg-steps__num { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; color: var(--copper); }
.lg-steps__title { margin: 2px 0 4px; font-size: 17px; font-weight: 600; color: var(--ink); }
.lg-steps__body { font-size: 14.5px; line-height: 1.8; color: #4A4740; max-width: 34em; }

/* ---------- 折叠问答 ---------- */
.lg-fold { border-top: 1px solid var(--line); }
.lg-fold__item { border-bottom: 1px solid var(--line); }
.lg-fold__head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; padding: 15px 4px; text-align: left;
  background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--ink);
  transition: color .16s ease;
}
.lg-fold__head:hover { color: var(--pine); }
.lg-fold__icon {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 22px; height: 22px; border: 1px solid var(--copper); border-radius: 2px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1; color: var(--copper);
  transition: transform .22s ease, background .16s ease;
}
.lg-fold__item[data-open="true"] .lg-fold__icon { transform: rotate(45deg); background: rgba(224, 178, 106, .18); }
.lg-fold__body { overflow: hidden; max-height: 0; transition: max-height .22s ease; }
.lg-fold__item[data-open="true"] .lg-fold__body { max-height: 48em; }
.lg-fold__body > * { padding: 0 4px; }
.lg-fold__body > :last-child { padding-bottom: 18px; }

/* ---------- 标签筛选 ---------- */
.lg-tagbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 18px; }
.lg-tag {
  padding: 6px 12px; border: 1px solid rgba(14, 59, 51, .22); border-radius: 999px;
  background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; color: var(--ink);
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.lg-tag:hover { border-color: var(--copper); color: var(--pine); }
.lg-tag[aria-pressed="true"] { background: var(--ink); color: var(--copper-lt); border-color: var(--ink); }

/* ---------- 图片容器 ---------- */
.lg-figure { margin: 0 0 24px; }
.lg-figure__frame {
  position: relative; overflow: hidden; border: 1px solid var(--line);
  border-radius: var(--radius); background-color: var(--card);
  background-image: repeating-linear-gradient(135deg, rgba(14, 59, 51, .05) 0 6px, transparent 6px 13px);
  aspect-ratio: 16 / 10;
}
.lg-figure__frame--wide { aspect-ratio: 21 / 9; }
.lg-figure__frame--tall { aspect-ratio: 4 / 5; }
.lg-figure__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 40%;
}
.lg-figure__cap {
  margin-top: 8px; padding-left: 11px; border-left: 2px solid var(--copper);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7;
  letter-spacing: .06em; color: var(--ash);
}

/* ---------- 批注块 ---------- */
.lg-note {
  margin: 20px 0; padding: 14px 16px;
  background: rgba(215, 222, 227, .5);
  border-left: 3px solid var(--copper);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14.5px; line-height: 1.8; color: #3F443F;
}
.lg-note > :last-child { margin-bottom: 0; }
.lg-note--warn { background: rgba(180, 71, 47, .08); border-left-color: var(--red); }

/* ---------- 显现 ---------- */
.lg-reveal { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.lg-reveal.is-in { opacity: 1; transform: none; }
.lg-reveal[data-delay="1"] { transition-delay: .06s; }
.lg-reveal[data-delay="2"] { transition-delay: .12s; }
.lg-reveal[data-delay="3"] { transition-delay: .18s; }

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .lg-footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .lg-footer__col:last-child { grid-column: 1 / -1; }
  .lg-index { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

/* ---------- 移动导航断点 ---------- */
@media (max-width: 900px) {
  .lg-header__bar { padding: 10px 18px; gap: 14px; }
  .lg-navtoggle { display: inline-flex; }
  .lg-nav {
    position: absolute; left: 0; right: 0; top: 100%; margin-left: 0;
    background: var(--ink);
    border-top: 1px solid rgba(224, 178, 106, .28);
    box-shadow: 0 20px 32px rgba(8, 30, 25, .38);
    max-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
    transition: max-height .26s ease, opacity .2s ease, visibility .26s ease;
  }
  .lg-nav[data-open="true"] {
    max-height: 78vh; overflow-y: auto; visibility: visible; opacity: 1;
  }
  .lg-nav__list { display: block; padding: 8px 0; }
  .lg-nav__item { border-bottom: 1px solid rgba(245, 241, 232, .1); }
  .lg-nav__link { padding: 13px 20px 14px; border-radius: 0; font-size: 15px; }
  .lg-nav__link[aria-current="page"] { background: rgba(224, 178, 106, .1); }
  .lg-nav__link[aria-current="page"]::after { left: 20px; right: auto; width: 44px; bottom: 8px; }
  .lg-nav__foot {
    display: block; margin: 0; padding: 12px 20px 16px;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
    color: rgba(245, 241, 232, .5);
  }
  .lg-statusbar__inner { padding: 6px 18px 8px; gap: 12px; font-size: 11px; }
  .lg-statusbar__chapter { max-width: 44vw; }
  #main-content, .lg-main { scroll-margin-top: 104px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
  body { font-size: 15.5px; line-height: 1.8; }
  .lg-shell { padding: 0 18px; }
  .lg-brand__name { font-size: 19px; letter-spacing: .1em; }
  .lg-brand__sub { font-size: 10px; letter-spacing: .16em; }
  .lg-statusbar__meta { display: none; }
  .lg-statusbar__chapter { max-width: 62vw; }
  .lg-footer { margin-top: 56px; }
  .lg-footer__inner { grid-template-columns: 1fr; padding: 34px 18px 0; gap: 26px; }
  .lg-footer__col:last-child { grid-column: auto; }
  .lg-footer__list--split { grid-template-columns: 1fr 1fr; }
  .lg-footer__bottom { padding: 14px 18px 22px; }
  .lg-footer__actions { margin-left: 0; width: 100%; }
  .lg-footer__actions .lg-btn { flex: 1 1 auto; justify-content: center; }
  .lg-index { grid-template-columns: 1fr; }
  .lg-section__head { flex-direction: column; gap: 4px; }
  .lg-section__title { font-size: 26px; }
  .lg-figure__frame { aspect-ratio: 4 / 3; }
  .lg-figure__frame--wide { aspect-ratio: 16 / 9; }
  .lg-steps { margin-left: 6px; }
  .lg-steps__item { padding-left: 22px; }
}

/* ---------- 打印 ---------- */
@media print {
  .lg-header, .lg-footer__actions, .lg-skip { display: none !important; }
  .lg-footer { margin: 0; border-top: 1px solid #999; background: #fff; color: #000; }
  body { background: #fff; }
  .lg-reveal { opacity: 1 !important; transform: none !important; }
  .lg-fold__body { max-height: none !important; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .lg-reveal { opacity: 1; transform: none; }
  .lg-progress__bar { transition: none; }
}
