/* ============================================================
   财神到官网 · 共享样式 /assets/site.css
   新中式财气美学 · 纵向叙事长卷
   ============================================================ */

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

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

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

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

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

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

button {
  border: 0;
  background: none;
}

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

[id] {
  scroll-margin-top: 6.5rem;
}

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 品牌色 */
  --red: #B5122B;
  --red-deep: #7A1021;
  --gold: #C99A3D;
  --gold-light: #E9C97A;
  --paper: #F8F3E7;
  --sand: #EFE5D0;
  --ink: #1E1A17;
  --jade: #2E7D6E;
  --indigo: #24476B;
  --mist: #D8D0C2;

  /* 字体 */
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Courier New", monospace;

  /* 尺寸与节奏 */
  --shell: 1240px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 2px;
  --line: 1px solid var(--mist);

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .22s;
}

/* ---------- 3. 中文排版基座 ---------- */
body {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(30, 26, 23, .055) .5px, transparent .5px);
  background-size: 5px 5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: .01em;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 6vw, 5.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 3rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.45rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { max-width: 68ch; }

a {
  color: var(--indigo);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: color var(--dur) var(--ease);
}

a:hover { color: var(--red); }

strong, b { font-weight: 700; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: .88em;
}

hr {
  border: 0;
  border-top: var(--line);
  margin-block: clamp(1.5rem, 4vw, 2.5rem);
}

::selection {
  background: var(--red);
  color: var(--paper);
}

/* ---------- 4. 焦点反馈 ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: inset 0 0 0 1px var(--ink);
  border-radius: var(--radius);
}

/* ---------- 5. 跳过导航 ---------- */
.skip-link {
  position: fixed;
  top: .75rem;
  left: 50%;
  z-index: 120;
  transform: translate(-50%, -180%);
  padding: .62rem 1.15rem;
  background: var(--red);
  color: var(--paper);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-decoration: none;
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  transition: transform .2s var(--ease);
}

.skip-link:focus {
  transform: translate(-50%, 0);
  color: var(--paper);
}

/* ---------- 6. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
  transition: box-shadow .24s var(--ease), background-color .24s var(--ease);
}

.site-header[data-scrolled] {
  background: rgba(248, 243, 231, .96);
  box-shadow: 0 12px 26px -24px rgba(30, 26, 23, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.header-rule {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--red) 0%,
    var(--red) 22%,
    var(--gold) 46%,
    var(--gold-light) 58%,
    var(--red-deep) 100%
  );
}

.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(.75rem, 3vw, 2.5rem);
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: .7rem var(--gutter);
  transition: padding .24s var(--ease);
}

.site-header[data-scrolled] .header-inner {
  padding-block: .45rem;
}

/* 品牌端 */
.header-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .68rem;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark:hover { color: var(--ink); }

.brand-seal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  background: var(--red);
  color: #FBF1DC;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 900;
  line-height: 1;
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 1px rgba(233, 201, 122, .65),
    0 8px 16px -14px rgba(122, 16, 33, .95);
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.brand-mark:hover .brand-seal {
  background: var(--red-deep);
  transform: translateY(-2px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.16;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-ver {
  margin-top: .18rem;
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .16em;
  color: var(--jade);
  white-space: nowrap;
}

/* 移动开关（桌面默认隐藏） */
.nav-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  order: 2;
  padding: .5rem .75rem;
  background: var(--paper);
  color: var(--red-deep);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

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

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
  height: 12px;
}

.nav-toggle-bars span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}

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

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

.nav-toggle-label {
  line-height: 1;
}

/* 导航端 */
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2vw, 1.8rem);
  order: 3;
  flex: 0 0 auto;
}

.header-utility {
  display: flex;
  align-items: center;
  gap: .3rem;
  max-width: none;
  font-family: var(--mono);
  font-size: .67rem;
  letter-spacing: .08em;
  color: var(--indigo);
  white-space: nowrap;
}

.header-utility kbd {
  padding: .06rem .3rem;
  font-size: .64rem;
  line-height: 1.5;
  color: var(--indigo);
  background: var(--sand);
  border: 1px solid var(--mist);
  border-bottom-width: 2px;
  border-radius: var(--radius);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 1.4vw, 1.15rem);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: .4rem .1rem .55rem;
  font-size: .93rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .18rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.nav-link:hover { color: var(--red); }

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

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

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

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .62rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn-primary {
  background: var(--red);
  color: #FBF1DC;
  box-shadow: inset 0 0 0 1px rgba(233, 201, 122, .45);
}

.btn-primary:hover {
  background: var(--red-deep);
  color: #FBF1DC;
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(233, 201, 122, .85),
    0 10px 20px -12px rgba(122, 16, 33, .8);
}

.btn-ghost {
  background: transparent;
  color: var(--red-deep);
  border-color: var(--gold);
}

.btn-ghost:hover {
  background: var(--gold-light);
  color: var(--ink);
  transform: translateY(-2px);
}

.nav-cta {
  padding: .55rem 1rem;
  white-space: nowrap;
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 8vw, 6rem);
  background: var(--red-deep);
  color: #F4E8D6;
  border-top: 3px solid var(--gold);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(233, 201, 122, .07) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, rgba(233, 201, 122, .07) 0 1px, transparent 1px 46px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 74%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 74%);
}

.footer-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.5fr .78fr .78fr 1.4fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(2.25rem, 5vw, 3.75rem) var(--gutter) clamp(1.5rem, 4vw, 2.25rem);
}

.footer-brand {
  min-width: 0;
}

.footer-seal {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--gold-light);
  color: var(--red-deep);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(122, 16, 33, .35);
}

.footer-brand-name {
  margin-top: .9rem;
  max-width: none;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: #FBF1DC;
}

.footer-summary {
  margin-top: .55rem;
  max-width: 30ch;
  font-size: .95rem;
  line-height: 1.7;
  color: rgba(248, 243, 231, .8);
}

.footer-note {
  margin-top: .75rem;
  max-width: 34ch;
  font-size: .78rem;
  line-height: 1.75;
  color: rgba(233, 201, 122, .72);
}

.footer-col {
  min-width: 0;
}

.footer-col-title {
  margin: 0 0 .9rem;
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .24em;
  color: var(--gold-light);
}

.footer-col-title::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-top: .6rem;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.footer-links {
  display: grid;
  gap: .55rem;
}

.footer-links a {
  display: inline-block;
  padding-block: .1rem;
  font-size: .92rem;
  color: rgba(248, 243, 231, .82);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
  transform: translateX(2px);
}

.footer-contact {
  min-width: 0;
}

.footer-contact-list {
  display: grid;
  gap: .85rem;
}

.footer-contact-item {
  display: grid;
  gap: .18rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid rgba(233, 201, 122, .16);
}

.contact-label {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .18em;
  color: rgba(233, 201, 122, .72);
}

.contact-value {
  font-size: .92rem;
  color: #FBF1DC;
  overflow-wrap: anywhere;
}

.footer-contact-note {
  margin-top: 1rem;
  max-width: 38ch;
  font-size: .78rem;
  line-height: 1.75;
  color: rgba(248, 243, 231, .6);
}

.footer-legal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 1.1rem var(--gutter) 1.6rem;
  border-top: 1px solid rgba(233, 201, 122, .28);
  font-size: .78rem;
  color: rgba(248, 243, 231, .66);
}

.footer-icp {
  max-width: none;
  font-family: var(--mono);
  letter-spacing: .04em;
  color: rgba(233, 201, 122, .88);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-legal-links a {
  color: rgba(248, 243, 231, .78);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

.footer-copy {
  margin-left: auto;
  max-width: none;
  font-family: var(--mono);
  letter-spacing: .03em;
}

/* ---------- 9. 通用布局组件 ---------- */
.wrap {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: 72ch;
}

.prose p + p,
.prose ul + p,
.prose p + ul {
  margin-top: 1.1em;
}

.prose h2,
.prose h3 {
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: .6em;
}

.grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

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

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

.breadcrumb {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .06em;
  color: var(--indigo);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.breadcrumb a {
  color: var(--indigo);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--red);
  text-decoration: underline;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: .5rem;
  color: var(--mist);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .62rem;
  background: var(--sand);
  color: var(--ink);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.6;
}

.tag--red {
  background: rgba(181, 18, 43, .09);
  border-color: rgba(181, 18, 43, .32);
  color: var(--red);
}

.tag--gold {
  background: rgba(201, 154, 61, .16);
  border-color: rgba(201, 154, 61, .42);
  color: #7E5D1C;
}

.tag--jade {
  background: rgba(46, 125, 110, .1);
  border-color: rgba(46, 125, 110, .34);
  color: var(--jade);
}

/* ---------- 10. 响应式图片容器 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--sand);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
}

.media-frame img,
.media-frame picture,
.media-frame svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .26s var(--ease);
}

.media-frame:hover img {
  transform: scale(1.03);
}

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

.media-frame__caption {
  margin-top: .5rem;
  font-size: .78rem;
  line-height: 1.65;
  color: rgba(30, 26, 23, .62);
}

/* ---------- 11. JS 注入的滚动进度丝线 ---------- */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

/* ---------- 12. 响应式：平板 ---------- */
@media (max-width: 1080px) {
  .header-utility {
    display: none;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.75rem, 4vw, 2.5rem);
  }

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

  .footer-contact-note {
    max-width: 60ch;
  }
}

/* ---------- 13. 响应式：移动端页头两段式 ---------- */
@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    row-gap: .55rem;
    padding-block: .6rem;
  }

  .header-brand {
    flex: 1 1 auto;
  }

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

  .site-nav {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
    display: none;
    margin-top: .55rem;
    padding-top: .8rem;
    border-top: 1px solid var(--mist);
  }

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

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

  .nav-link {
    display: block;
    padding: .72rem .2rem;
    border-bottom: 1px solid rgba(216, 208, 194, .78);
    white-space: normal;
  }

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

  .nav-link[aria-current="page"] {
    background: linear-gradient(90deg, rgba(181, 18, 43, .1), transparent 70%);
  }

  .nav-cta {
    width: 100%;
    margin-top: .35rem;
    padding-block: .72rem;
  }

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

  .footer-copy {
    margin-left: 0;
  }
}

/* ---------- 14. 响应式：小屏 ---------- */
@media (max-width: 640px) {
  body {
    font-size: 17px;
    line-height: 1.72;
  }

  .brand-seal {
    width: 38px;
    height: 38px;
    font-size: 1.18rem;
  }

  .brand-name {
    font-size: 1.08rem;
    letter-spacing: .12em;
  }

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

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
  }
}

/* ---------- 15. 动效降级 ---------- */
@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;
  }

  .btn:hover,
  .brand-mark:hover .brand-seal,
  .footer-links a:hover,
  .media-frame:hover img {
    transform: none;
  }
}
