/* =========================================================
   乐赢品牌站 · 共享样式 /assets/site.css
   骨架：刊头 → 目录条 → 编号章节 → 旁注栏 → 档案封底
   ========================================================= */

:root {
  --gold: #D97A28;
  --gold-deep: #A65312;
  --amber: #F0B457;
  --ink: #17352B;
  --ink-2: #2C5747;
  --sage: #DDE6DC;
  --paper: #FBF7EF;
  --white: #FFFFFF;
  --graphite: #2A2A26;
  --grey: #6E6A61;
  --line: #E3DCCD;

  --shadow: 0 1px 2px rgba(23, 53, 43, .06);
  --shadow-lift: 0 6px 18px rgba(23, 53, 43, .09);

  --radius: 4px;
  --wrap: 1180px;
  --narrow: 680px;

  --font-display: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", SimSun, serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 180ms;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

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

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

a { color: inherit; }

button { font: inherit; color: inherit; }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

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

#main-content { scroll-margin-top: 150px; }

/* ---------- 中文排版基线 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: -.01em;
  margin-top: .6em;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p { margin-top: .8em; }
p:first-child { margin-top: 0; }

.tabular,
time,
td { font-variant-numeric: tabular-nums; }

/* ---------- 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.prose {
  max-width: var(--narrow);
}

.section {
  padding: 56px 0;
}

.grid {
  display: grid;
  gap: 20px;
}

.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)); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

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

.btn--ink {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn--ink:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.btn--ghost {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: .04em;
  white-space: nowrap;
}

.tag--amber {
  background: var(--amber);
  color: var(--ink);
}

.tag--line {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--grey);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  padding: 24px 0 0;
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--grey);
}

.breadcrumb__list li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--line);
}

.breadcrumb__link {
  color: var(--grey);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.breadcrumb__link:hover { color: var(--gold-deep); }

.breadcrumb__current { color: var(--ink); }

/* ---------- 卡片 ---------- */
.card {
  display: block;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

/* ---------- 编号章节标题组 ---------- */
.section-head {
  margin-bottom: 28px;
}

.section-head__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 96px;
  line-height: .9;
  letter-spacing: -.03em;
  color: rgba(23, 53, 43, .2);
  font-variant-numeric: tabular-nums;
}

.section-head__title {
  margin-top: 8px;
  font-size: 32px;
  line-height: 1.4;
  color: var(--ink);
}

.section-head__lead {
  margin-top: 8px;
  max-width: var(--narrow);
  font-size: 16px;
  line-height: 1.8;
  color: var(--grey);
}

/* ---------- 旁注 ---------- */
.annotation {
  padding: 4px 0 4px 14px;
  border-left: 2px solid var(--sage);
  color: var(--grey);
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- 目录高亮状态（data-chapter-link） ---------- */
[data-chapter-link] {
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

[data-chapter-link].is-active {
  color: var(--gold-deep);
  border-left-color: var(--gold);
}

/* ---------- 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage);
}

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

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3  { aspect-ratio: 4 / 3; }
.media--1x1  { aspect-ratio: 1 / 1; }
.media--21x9 { aspect-ratio: 21 / 9; }

.media__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  letter-spacing: .18em;
  background-image: repeating-linear-gradient(
    135deg,
    var(--sage) 0 12px,
    rgba(221, 230, 220, .55) 12px 24px
  );
}

.media__caption {
  margin-top: 8px;
  padding-left: 14px;
  border-left: 2px solid var(--sage);
  font-size: 14px;
  line-height: 1.8;
  color: var(--grey);
}

/* =========================================================
   页头
   ========================================================= */
.skip-link {
  position: absolute;
  left: 16px;
  top: 0;
  z-index: 120;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transform: translateY(-130%);
  transition: transform 160ms var(--ease);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 53, 43, .04);
}

.site-header__utility {
  background: var(--ink);
  color: var(--sage);
}

.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--wrap);
  min-height: 34px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 14px;
  line-height: 1.4;
}

.utility-text {
  margin: 0;
  letter-spacing: .06em;
  color: var(--sage);
}

.utility-text--right {
  color: rgba(221, 230, 220, .72);
}

.utility-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.utility-link:hover {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.site-header__masthead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 24px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
}

.brand__tag {
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .16em;
  color: var(--grey);
}

.nav-toggle {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

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

.nav-toggle__label {
  letter-spacing: .1em;
}

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-6px) rotate(-45deg); }

.nav-bar {
  display: block;
  background: var(--paper);
}

.nav-bar__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: var(--wrap);
  min-height: 54px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-bar__mark {
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .3em;
  color: var(--grey);
  white-space: nowrap;
}

.nav-list {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--graphite);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 4px;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 160ms var(--ease);
}

.nav-link:hover { color: var(--gold-deep); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-link[aria-current="page"] {
  color: var(--gold-deep);
  font-weight: 700;
}

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-search {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--grey);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.nav-search:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
  background: var(--paper);
}

.nav-search__dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

/* =========================================================
   页脚 · 档案封底
   ========================================================= */
.site-footer {
  margin-top: 64px;
  padding-bottom: 28px;
  background: var(--ink);
  color: var(--sage);
  border-top: 2px solid var(--gold);
}

.site-footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 24px 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, .85fr);
  gap: 40px 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(221, 230, 220, .18);
}

.footer-brand__name {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--paper);
}

.footer-brand__tag {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .1em;
  color: var(--amber);
}

.footer-brand__note {
  margin: 0;
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(221, 230, 220, .78);
}

.footer-col__title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(221, 230, 220, .16);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  color: var(--paper);
}

.footer-list {
  display: grid;
  gap: 10px;
}

.footer-link {
  position: relative;
  display: inline-block;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(221, 230, 220, .9);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 160ms var(--ease);
}

.footer-link:hover { color: var(--amber); }
.footer-link:hover::after { transform: scaleX(1); }

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 40px;
  padding: 26px 0 0;
}

.footer-contact__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.footer-contact__label {
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .18em;
  color: rgba(221, 230, 220, .55);
}

.footer-contact__value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.footer-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: transparent;
  border: 1px solid rgba(221, 230, 220, .32);
  border-radius: 999px;
  color: var(--sage);
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

.footer-copy:hover {
  background: rgba(240, 180, 87, .14);
  border-color: var(--amber);
  color: var(--amber);
}

.footer-copy[data-copied] {
  background: rgba(240, 180, 87, .18);
  border-color: var(--gold);
  color: var(--amber);
}

.footer-archive {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 26px;
  padding: 18px 0;
  border-top: 1px solid rgba(221, 230, 220, .16);
  border-bottom: 1px solid rgba(221, 230, 220, .16);
}

.footer-archive__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(221, 230, 220, .72);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: 20px 0 0;
}

.footer-base__meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(221, 230, 220, .6);
}

/* =========================================================
   返回页首（由 JS 注入）
   ========================================================= */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--ink);
  border: 1px solid rgba(251, 247, 239, .22);
  border-radius: 50%;
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(23, 53, 43, .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 200ms var(--ease),
              transform 200ms var(--ease),
              visibility 200ms var(--ease),
              background var(--dur) var(--ease);
}

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

.to-top:hover {
  background: var(--gold-deep);
  border-color: var(--gold);
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1060px) {
  .site-header__utility { display: none; }

  .site-header__masthead {
    padding: 14px 72px 12px;
  }

  .brand__name { font-size: 26px; }
  .brand__tag { font-size: 12px; letter-spacing: .1em; }

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

  .nav-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 26px rgba(23, 53, 43, .12);
  }

  .nav-bar[data-open] {
    display: block;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  .nav-bar__inner {
    display: block;
    min-height: 0;
    padding: 8px 20px 20px;
  }

  .nav-bar__mark { display: none; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list > li {
    border-bottom: 1px solid var(--line);
  }

  .nav-list > li:last-child { border-bottom: 0; }

  .nav-link {
    display: block;
    padding: 14px 12px;
    font-size: 16px;
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] {
    padding-left: 14px;
    background: var(--sage);
    box-shadow: inset 3px 0 0 var(--gold);
  }

  .nav-search {
    justify-self: auto;
    display: flex;
    width: 100%;
    margin-top: 16px;
    padding: 12px 16px;
    justify-content: center;
  }

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

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

  #main-content { scroll-margin-top: 110px; }
}

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

  .section-head__num { font-size: 64px; }
  .section-head__title { font-size: 24px; }

  .section { padding: 44px 0; }
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }

  .site-footer__inner {
    padding: 40px 20px 0;
  }

  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
  }

  .footer-contact {
    gap: 18px 24px;
  }

  .footer-contact__item { flex: 1 1 100%; }

  .footer-copy { align-self: flex-start; }

  .footer-archive { flex-direction: column; }

  .site-footer { margin-top: 48px; }

  .to-top { right: 14px; bottom: 14px; }
}

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

  h1 { font-size: 28px; }
  h2 { font-size: 22px; }

  .section-head__num { font-size: 56px; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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