/* ===========================================================
   财神档案馆 · 共享站点样式
   路径：/assets/site.css
   作用：reset、变量、中文排版、头部、页脚、按钮、面包屑、
        正文容器、网格与基础组件
   =========================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --paper: #F7EFDF;
  --ink: #1E1A16;
  --gold: #C8962E;
  --cinnabar: #A6322A;
  --patina: #3F6F62;
  --brown: #4A3224;
  --gold-soft: #E8C77A;
  --jade: #FFFDF7;
  --taupe: #8A7A68;
  --darkred: #6E1F1A;

  --line: rgba(74, 50, 36, 0.18);
  --line-strong: rgba(74, 50, 36, 0.34);
  --gold-line: rgba(200, 150, 46, 0.55);

  --font-heading: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", "Menlo", "Consolas", ui-monospace, monospace;

  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-44: 2.75rem;
  --fs-64: clamp(2.75rem, 5.6vw, 4rem);

  --w-shell: 1240px;
  --pad-x: 24px;
  --radius: 6px;
  --shadow-card: 0 18px 34px -26px rgba(30, 26, 22, 0.6);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

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

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

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

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

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

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

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

::selection {
  background: rgba(200, 150, 46, 0.35);
  color: var(--ink);
}

/* ---------- 3. 基础排版 ---------- */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% -6%, rgba(200, 150, 46, 0.13), transparent 44%),
    radial-gradient(circle at 102% 12%, rgba(166, 50, 42, 0.07), transparent 46%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

h1 { font-size: var(--fs-64); line-height: 1.14; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.125rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.625rem); }
h4 { font-size: var(--fs-18); }

.lead {
  font-size: var(--fs-18);
  line-height: 1.85;
  color: var(--brown);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.2em;
  color: var(--cinnabar);
}

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

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

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.1em; }
.prose p { line-height: 1.9; }
.prose h2 { margin-top: 1.9em; font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.prose h3 { margin-top: 1.6em; }
.prose ul,
.prose ol {
  display: grid;
  gap: 0.45em;
  padding-left: 1.3em;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose a {
  color: var(--cinnabar);
  border-bottom: 1px solid rgba(166, 50, 42, 0.35);
}
.prose a:hover { border-bottom-color: var(--cinnabar); }
.prose strong { color: var(--darkred); }

/* ---------- 4. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--w-shell);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: clamp(32px, 5vw, 64px); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.split__aside,
.split__main { min-width: 0; }

.stack > * + * { margin-top: 18px; }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--gold-line), rgba(200, 150, 46, 0));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 5. 按钮与标签 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 9px 22px;
  font-family: var(--font-body);
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s var(--ease-out);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--cinnabar);
  color: var(--jade);
  border-color: var(--darkred);
  box-shadow: 0 2px 0 rgba(110, 31, 26, 0.4);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--darkred);
  box-shadow: 0 3px 0 rgba(110, 31, 26, 0.35);
}

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

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: rgba(200, 150, 46, 0.13);
  border-color: var(--gold);
  color: var(--brown);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  font-size: var(--fs-12);
  letter-spacing: 0.09em;
  line-height: 1.7;
  border: 1px solid;
  border-radius: 999px;
  white-space: nowrap;
}

.tag--red {
  color: var(--cinnabar);
  border-color: rgba(166, 50, 42, 0.45);
  background: rgba(166, 50, 42, 0.08);
}

.tag--gold {
  color: #7a5a12;
  border-color: var(--gold-line);
  background: rgba(200, 150, 46, 0.16);
}

.tag--green {
  color: var(--patina);
  border-color: rgba(63, 111, 98, 0.45);
  background: rgba(63, 111, 98, 0.09);
}

/* ---------- 6. 卡片、面板、提示 ---------- */
.card {
  position: relative;
  padding: 20px 22px;
  background: var(--jade);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.card__title {
  font-size: var(--fs-24);
  line-height: 1.32;
  margin-bottom: 6px;
}

.card__body {
  font-size: var(--fs-16);
  line-height: 1.8;
  color: rgba(30, 26, 22, 0.86);
}

.panel {
  padding: 18px 20px;
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.note {
  padding: 12px 16px;
  font-size: var(--fs-14);
  line-height: 1.8;
  color: var(--brown);
  background: rgba(200, 150, 46, 0.11);
  border-left: 3px solid var(--gold);
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumb { margin-block: 20px 0; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-14);
  color: var(--taupe);
}

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

.breadcrumb__item + .breadcrumb__item::before {
  content: "›";
  color: var(--gold);
}

.breadcrumb__link {
  color: var(--brown);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.breadcrumb__link:hover {
  color: var(--cinnabar);
  border-bottom-color: var(--gold);
}

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

/* ---------- 8. 图片容器基础规则 ---------- */
.media { margin: 0; }

.media__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(74, 50, 36, 0.18);
  border-radius: var(--radius);
  background-color: #ece0c9;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(74, 50, 36, 0.06) 0 10px,
    transparent 10px 20px
  );
  aspect-ratio: 16 / 9;
}

.media__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.media__caption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--taupe);
}

/* ---------- 9. 跳转链接 ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 10px 18px;
  font-size: var(--fs-14);
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  background: var(--brown);
  border-radius: 0 0 4px 4px;
  transition: top 0.22s var(--ease-out);
}

.skip-link:focus { top: 0; }

/* ---------- 10. 站点头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  isolation: isolate;
}

/* 10.1 上层：品牌线索与同步时间戳 */
.header-utility {
  background: var(--brown);
  color: var(--gold-soft);
}

.header-utility__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: var(--w-shell);
  margin-inline: auto;
  padding: 7px var(--pad-x);
  font-size: 13px;
  line-height: 1.6;
}

.header-utility__brandline {
  letter-spacing: 0.06em;
  color: var(--gold-soft);
}

.header-utility__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-utility__stamp {
  font-size: 12.5px;
  color: rgba(232, 199, 122, 0.92);
}

.header-utility__link {
  color: var(--gold-soft);
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(232, 199, 122, 0.45);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.header-utility__link:hover,
.header-utility__link:focus-visible {
  color: var(--jade);
  border-bottom-color: var(--jade);
}

/* 10.2 下层：品牌、导航、行动按钮 */
.header-main {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.header-main__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--w-shell);
  margin-inline: auto;
  padding: 12px var(--pad-x);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand__seal {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--jade);
  background: var(--cinnabar);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 2px rgba(255, 253, 247, 0.42),
    inset 0 0 0 4px var(--cinnabar),
    inset 0 0 0 5px rgba(255, 253, 247, 0.22);
  transition: background-color 0.5s ease, transform 0.6s var(--ease-out);
}

.brand:hover .brand__seal,
.brand:focus-visible .brand__seal {
  background: var(--darkred);
  transform: rotate(-4deg);
}

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

.brand__name {
  font-family: var(--font-heading);
  font-size: var(--fs-24);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.brand__sub {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--taupe);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 44px;
  padding: 8px 12px;
  font-size: var(--fs-14);
  letter-spacing: 0.12em;
  color: var(--brown);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(200, 150, 46, 0.12);
  border-color: var(--gold);
}

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), opacity 0.24s ease;
}

.site-header[data-open] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(6px) 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(-6px) rotate(-45deg);
}

.nav-toggle__label { line-height: 1; }

/* 小屏默认：折叠导航 */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 5;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 8px 20px 20px;
  background: var(--jade);
  border-top: 1px solid var(--gold-line);
  border-bottom: 3px solid var(--brown);
  box-shadow: 0 22px 34px -24px rgba(30, 26, 22, 0.65);
}

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

.site-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-nav__link {
  position: relative;
  display: block;
  padding: 12px 4px;
  font-size: var(--fs-16);
  letter-spacing: 0.05em;
  color: var(--brown);
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, padding-left 0.25s var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--cinnabar);
  padding-left: 8px;
}

.site-nav__link[aria-current="page"] {
  color: var(--cinnabar);
  font-weight: 700;
}

.site-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 20px;
  height: 2px;
  background: var(--gold);
}

.header-cta { display: none; flex-shrink: 0; }

/* 10.3 滚动进度线 */
.scroll-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  background: transparent;
}

.scroll-meter__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--cinnabar));
}

/* ---------- 11. 站点页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 7vw, 96px);
  background: var(--brown);
  color: rgba(255, 253, 247, 0.82);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0 18px,
    transparent 18px 36px
  );
  opacity: 0.6;
}

.footer__inner {
  max-width: var(--w-shell);
  margin-inline: auto;
  padding: clamp(36px, 5vw, 64px) var(--pad-x) 26px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.footer__name {
  font-family: var(--font-heading);
  font-size: var(--fs-24);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold-soft);
}

.footer__summary {
  margin-top: 10px;
  max-width: 42ch;
  font-size: var(--fs-14);
  line-height: 1.9;
  color: rgba(255, 253, 247, 0.72);
}

.footer__mono {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: rgba(232, 199, 122, 0.72);
}

.footer__title {
  padding-bottom: 10px;
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  border-bottom: 1px solid rgba(232, 199, 122, 0.28);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer__link {
  font-size: var(--fs-14);
  color: rgba(255, 253, 247, 0.82);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer__link:hover,
.footer__link:focus-visible {
  color: var(--gold-soft);
  border-bottom-color: var(--gold-soft);
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.footer__contact-item {
  display: grid;
  gap: 2px;
}

.footer__label {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(232, 199, 122, 0.75);
}

.footer__value {
  font-size: var(--fs-14);
  line-height: 1.7;
  color: var(--jade);
  word-break: break-word;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: 18px;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255, 253, 247, 0.6);
  border-top: 1px solid rgba(232, 199, 122, 0.22);
}

.footer__legal { color: rgba(255, 253, 247, 0.72); }
.footer__note { max-width: 56ch; }

/* ---------- 12. 响应式 ---------- */
@media (max-width: 760px) {
  :root { --pad-x: 18px; }

  .header-utility__brandline { display: none; }

  .header-utility__inner {
    justify-content: space-between;
    padding-block: 6px;
  }

  .brand__seal { width: 40px; height: 40px; font-size: 22px; }
  .brand__name { font-size: var(--fs-18); }
  .brand__sub { letter-spacing: 0.1em; }

  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 760px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 40px; }
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }

  .header-main__inner { padding: 16px var(--pad-x); gap: 28px; }

  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    display: block;
    margin-left: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .site-nav__list {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .site-nav__link {
    padding: 8px 12px;
    font-size: 15px;
    border-bottom: 0;
  }

  .site-nav__link:hover,
  .site-nav__link:focus-visible { padding-left: 12px; }

  .site-nav__link[aria-current="page"]::after {
    left: 12px;
    bottom: 2px;
    width: calc(100% - 24px);
  }

  .header-cta { display: inline-flex; }

  .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.5fr; gap: 44px; }
}

@media (min-width: 1200px) {
  .header-main__inner { gap: 36px; }
  .site-nav__link { padding: 8px 14px; }
}

/* ---------- 13. 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover,
  .brand:hover .brand__seal { transform: none; }
}
