/* ============================================================
   顺发会馆 · 共享样式表  /assets/site.css
   深墨绿打底 · 暖米白阅读 · 铜金索引 · 朱砂点睛
   ============================================================ */

/* ---------- 01 变量 ---------- */
:root {
  --ink-deep: #0C2A24;
  --ink-green: #173F35;
  --paper: #F5EEE2;
  --paper-2: #E8DCC7;
  --copper: #B8894E;
  --copper-bright: #D8AE68;
  --cinnabar: #B23A2A;
  --ink-black: #131A17;
  --muted: #4F665D;
  --hairline: #8C683B;

  --line: rgba(140, 104, 59, 0.45);
  --line-soft: rgba(140, 104, 59, 0.22);

  --text-base: #F5EEE2;
  --text-dim: rgba(245, 238, 226, 0.72);
  --text-faint: rgba(245, 238, 226, 0.54);

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

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;

  --dur: 200ms;
  --dur-slow: 280ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-base);
  background-color: var(--ink-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, picture, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---------- 03 中文排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 0.6em;
  color: inherit;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }

::selection { background: var(--copper-bright); color: var(--ink-deep); }

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

#main-content { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- 04 通用工具类 ---------- */
.page-shell {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.page-shell--narrow { max-width: 880px; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.85;
  color: var(--text-dim);
  max-width: 64ch;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: clamp(24px, 4vw, 48px) 0;
}

/* ---------- 05 章节头 ---------- */
.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 34px);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--copper-bright);
  text-transform: none;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: inherit;
}

/* ---------- 06 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.btn--primary {
  background-color: var(--copper-bright);
  color: var(--ink-deep);
  border-color: var(--copper-bright);
}
.btn--primary:hover { background-color: var(--paper); border-color: var(--paper); }

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

/* ---------- 07 标签与面板 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  color: var(--copper-bright);
  border: 1px solid var(--line);
  border-radius: 2px;
  background-color: rgba(184, 137, 78, 0.08);
}

.tag--seal {
  background-color: var(--cinnabar);
  border-color: var(--cinnabar);
  color: var(--paper);
}

.panel {
  background-color: var(--paper);
  color: var(--ink-black);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(20px, 3vw, 36px);
}

/* ---------- 08 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb-item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--hairline);
  opacity: 0.7;
}

.breadcrumb-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.breadcrumb-link:hover { color: var(--copper-bright); }

.breadcrumb-current { color: var(--copper-bright); }

/* ---------- 09 图片容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--ink-green);
  background-image: linear-gradient(150deg, #173F35 0%, #0C2A24 100%);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.26);
}

.media-frame img,
.media-frame picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) sepia(0.08) contrast(1.02);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(216, 174, 104, 0.2);
}

.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ---------- 10 侧栏索引 ---------- */
.index-rail { position: sticky; top: calc(var(--header-h) + 24px); }

.rail-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line-soft);
}

.rail-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-left: -1px;
  padding: 9px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.rail-link:hover { color: var(--copper-bright); background-color: rgba(184, 137, 78, 0.07); }

.rail-link[aria-current="true"] {
  color: var(--copper-bright);
  border-left-color: var(--copper-bright);
  background-color: rgba(184, 137, 78, 0.1);
}

/* ---------- 11 显现与进度线 ---------- */
[data-reveal] { opacity: 1; }

[data-reveal].is-visible { animation: sf-rise 520ms var(--ease) both; }

@keyframes sf-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--copper) 0%, var(--copper-bright) 55%, var(--cinnabar) 100%);
  pointer-events: none;
}

/* ============================================================
   12 头部命令栏
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background-color: var(--ink-deep);
  background-image: linear-gradient(180deg, rgba(12, 42, 36, 0.99) 0%, rgba(10, 34, 29, 0.96) 100%);
  color: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--copper) 18%, var(--copper-bright) 50%, var(--copper) 82%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(10px, 1.8vw, 26px);
  width: 100%;
  max-width: var(--wrap);
  min-height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- 印章标识 --- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--paper);
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  background-color: var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(245, 238, 226, 0.42);
  transform: rotate(-2deg);
  transition: transform var(--dur) var(--ease);
}

.brand:hover .brand-seal { transform: rotate(0deg) scale(1.04); }

.brand-text { display: grid; gap: 1px; }

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.1em;
  color: var(--paper);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.3;
  letter-spacing: 0.18em;
  color: var(--copper-bright);
  opacity: 0.82;
}

/* --- 导航 --- */
.nav-command {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item { display: block; }

.nav-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  transition:
    color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--copper);
  transition: color var(--dur) var(--ease);
}

.nav-link:hover {
  color: var(--copper-bright);
  background-color: rgba(184, 137, 78, 0.1);
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--copper-bright);
}

.nav-link[aria-current="page"] .nav-index { color: var(--copper-bright); }

/* --- 右侧工具 --- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  white-space: nowrap;
  color: rgba(232, 220, 199, 0.75);
  background-color: rgba(23, 63, 53, 0.62);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.status-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background-color: var(--cinnabar);
  box-shadow: 0 0 0 3px rgba(178, 58, 42, 0.18);
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink-deep);
  background-color: var(--copper-bright);
  border: 1px solid var(--copper-bright);
  border-radius: 2px;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.quick-link:hover {
  background-color: var(--paper);
  border-color: var(--paper);
  color: var(--ink-deep);
}

/* --- 移动抽屉按钮 --- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 11px;
  appearance: none;
  cursor: pointer;
  color: var(--paper);
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1.4;
  transition:
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

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

.nav-toggle-bars {
  display: grid;
  gap: 3px;
  width: 14px;
}

.nav-toggle-bars span {
  display: block;
  height: 1.5px;
  background-color: currentColor;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.site-header[data-open] .nav-toggle-bars span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-bars span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* --- 跳至主内容 --- */
.skip-link {
  position: absolute;
  left: 14px;
  top: -72px;
  z-index: 120;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-deep);
  background-color: var(--copper-bright);
  border-radius: 2px;
  transition: top var(--dur) var(--ease);
}

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

/* ============================================================
   13 页脚
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: 0;
  background-color: var(--ink-deep);
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--copper) 20%, var(--copper-bright) 50%, var(--copper) 80%, transparent 100%);
  opacity: 0.6;
  pointer-events: none;
}

.footer-inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr 0.85fr 1.1fr;
  gap: clamp(20px, 3vw, 48px);
  align-items: start;
}

.footer-col {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.footer-col--brand { border-top-color: var(--copper); }

.footer-col-title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.6;
  color: var(--copper-bright);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
}

.footer-seal {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  background-color: var(--cinnabar);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(245, 238, 226, 0.4);
  transform: rotate(-2deg);
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  color: var(--paper);
}

.footer-note {
  margin: 16px 0 0;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(245, 238, 226, 0.62);
}

.footer-icp {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(232, 220, 199, 0.5);
}

.footer-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-link {
  font-size: 14px;
  line-height: 1.7;
  text-decoration: none;
  color: rgba(245, 238, 226, 0.82);
  transition: color var(--dur) var(--ease);
}

.footer-link:hover { color: var(--copper-bright); }

.footer-contact-item {
  display: grid;
  gap: 2px;
  border: 0;
}

.footer-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.6;
  color: rgba(216, 174, 104, 0.78);
}

.copy-chip {
  appearance: none;
  margin: 0;
  padding: 0 0 1px;
  text-align: left;
  background-color: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(140, 104, 59, 0.55);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: rgba(245, 238, 226, 0.86);
  overflow-wrap: anywhere;
  transition:
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.copy-chip:hover { color: var(--copper-bright); border-bottom-color: var(--copper-bright); }

.copy-chip[data-copied="true"] {
  color: var(--copper-bright);
  border-bottom-style: solid;
  border-bottom-color: var(--copper-bright);
}

.footer-address {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(245, 238, 226, 0.7);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.footer-copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  line-height: 1.7;
  color: rgba(232, 220, 199, 0.5);
}

/* ============================================================
   14 响应式
   ============================================================ */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
  .footer-col--brand { grid-column: 1 / -1; }
}

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

  .header-tools { display: none; }

  .nav-command {
    order: 3;
    flex: 1 1 100%;
    display: none;
    justify-content: flex-start;
    padding: 6px 0 4px;
    border-top: 1px solid var(--line-soft);
  }

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

  .nav-item { border-bottom: 1px solid var(--line-soft); }
  .nav-item:last-child { border-bottom: 0; }

  .nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 13px 4px;
    font-size: 15px;
    border-bottom: 0;
  }

  .nav-link:hover { background-color: rgba(184, 137, 78, 0.08); }

  .nav-link[aria-current="page"] {
    color: var(--copper-bright);
    box-shadow: inset 2px 0 0 var(--copper-bright);
    padding-left: 12px;
  }

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

  .site-header[data-open] .header-tools {
    order: 4;
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    margin-left: 0;
    padding: 12px 0 16px;
  }

  .index-rail { position: static; }
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer-col--brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  :root { --header-h: 62px; }

  .brand-name { font-size: 16.5px; letter-spacing: 0.08em; }
  .brand-sub { font-size: 9px; letter-spacing: 0.14em; }
  .brand-seal { width: 32px; height: 32px; font-size: 18px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; justify-content: center; }
}

/* ---------- 15 减少动态 ---------- */
@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;
  }

  [data-reveal],
  [data-reveal].is-visible {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .brand-seal,
  .footer-seal { transform: none; }
}

/* ---------- 16 打印 ---------- */
@media print {
  .site-header,
  .site-footer,
  .scroll-progress,
  .nav-toggle { display: none !important; }

  body { background: #fff; color: #131A17; }
  .panel { border: 1px solid #8C683B; }
}
