/* ============================================================
   /assets/site.css — 皇冠现金CN 共享样式
   1. Reset  2. Tokens  3. Base typography  4. Header
   5. Footer  6. Shared components  7. Media  8. Motion
   ============================================================ */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Tokens ---------- */
:root {
  --gold: #D4AF37;
  --gold-light: #F0DCA0;
  --ink: #0B3D2E;
  --ink-2: #14503C;
  --ink-3: #062A20;
  --paper: #F7F2E7;
  --paper-2: #E8E0CF;
  --charcoal: #1A1A1A;
  --graphite: #5E6B62;
  --brick: #B5482F;
  --white: #FFFFFF;

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

  --max: 1240px;
  --gutter: clamp(20px, 4.5vw, 72px);
  --radius: 28px;
  --radius-sm: 16px;
  --radius-pill: 999px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-soft: 0 18px 44px -34px rgba(6, 42, 32, .85);
}

/* ---------- 3. Base typography ---------- */
body {
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: clamp(16px, 0.55vw + 13.4px, 17px);
  line-height: 1.75;
  letter-spacing: .012em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: .01em;
  color: var(--ink);
}
h1 { font-size: clamp(32px, 4.4vw, 52px); }
h2 { font-size: clamp(25px, 3vw, 36px); }
h3 { font-size: clamp(19px, 1.6vw, 24px); }
p { text-wrap: pretty; }
strong { font-weight: 600; }
::selection { background: var(--gold); color: var(--ink-3); }

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

/* ---------- 4. Header ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -180%);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  pointer-events: auto;
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 14px var(--gutter) 12px;
  pointer-events: none;
}

.header-shell {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--max);
  margin-inline: auto;
  padding: 10px 12px 10px 18px;
  background: rgba(11, 61, 46, .93);
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 34px -20px rgba(6, 42, 32, .95);
  transition: padding .24s var(--ease), background .24s var(--ease),
              border-color .24s var(--ease), box-shadow .24s var(--ease);
}
.site-header[data-scrolled] .header-shell {
  padding: 6px 10px 6px 16px;
  background: rgba(6, 42, 32, .97);
  border-color: rgba(212, 175, 55, .46);
  box-shadow: 0 20px 44px -24px rgba(0, 0, 0, .9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  border-radius: var(--radius-pill);
}
.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .07em;
  color: var(--gold-light);
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.brand:hover .brand-name { color: var(--white); }

/* 纯 CSS 皇冠线稿：三个三角尖 + 一条底座 */
.brand-crown {
  position: relative;
  display: inline-block;
  font-size: 26px;
  width: 1em;
  height: .78em;
  flex: none;
}
.brand-crown i {
  position: absolute;
  bottom: .09em;
  width: .25em;
  height: .55em;
  background: var(--gold);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.brand-crown i:nth-child(1) { left: 0; }
.brand-crown i:nth-child(2) { left: 50%; transform: translateX(-50%); height: .64em; width: .27em; }
.brand-crown i:nth-child(3) { right: 0; }
.brand-crown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: .09em;
  border-radius: 2px;
  background: var(--gold);
}
.brand-crown--lg { font-size: 44px; }

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--gold-light);
  background: rgba(212, 175, 55, .12);
  border: 1px solid rgba(212, 175, 55, .42);
  white-space: nowrap;
}
.version-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}

.site-nav { flex: 1 1 auto; display: flex; justify-content: flex-end; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-item { display: block; }
.nav-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  letter-spacing: .02em;
  color: #DCE7DF;
  white-space: nowrap;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-link:hover { color: var(--gold-light); background: rgba(212, 175, 55, .14); }
.nav-link[aria-current="page"] {
  color: var(--ink-3);
  background: var(--gold);
  font-weight: 600;
}
.nav-link[aria-current="page"]:hover { color: var(--ink-3); background: var(--gold-light); }

.header-chapter {
  display: none;
  max-width: 9em;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: rgba(240, 220, 160, .82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-chapter:empty { display: none !important; }

.header-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .07em;
  white-space: nowrap;
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.header-cta:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -12px rgba(212, 175, 55, .95);
}

.nav-toggle {
  display: none;
  flex: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, .42);
  background: rgba(212, 175, 55, .08);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.nav-toggle:hover { background: rgba(212, 175, 55, .18); border-color: rgba(212, 175, 55, .7); }
.nav-toggle-bar {
  display: block;
  width: 17px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--gold-light);
  transition: transform .24s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.read-progress {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 2px;
  max-width: var(--max);
  margin-inline: auto;
  height: 3px;
  border-radius: 3px;
  background: rgba(6, 42, 32, .45);
  overflow: hidden;
  pointer-events: none;
}
.read-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width .15s linear;
}

/* ---------- 5. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 8vw, 112px);
  padding-block: clamp(48px, 7vw, 88px) 28px;
  background: var(--ink-3);
  color: #D7E2DA;
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .68), transparent);
}
.footer-shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.footer-crest { min-width: 0; }
.footer-brand {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: clamp(25px, 2.8vw, 34px);
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--paper);
  line-height: 1.2;
}
.footer-intro {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14.5px;
  line-height: 1.85;
  color: rgba(232, 224, 207, .66);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}
.footer-col { min-width: 0; }
.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--gold);
  line-height: 1.4;
}
.footer-list li + li { margin-top: 10px; }
.footer-link {
  display: inline-block;
  font-size: 14.5px;
  color: rgba(232, 224, 207, .82);
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.footer-link:hover { color: var(--gold-light); border-bottom-color: rgba(212, 175, 55, .55); }

.footer-contact {
  margin-top: clamp(34px, 5vw, 56px);
  padding-top: 26px;
  border-top: 1px solid rgba(212, 175, 55, .18);
}
.footer-contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 32px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: rgba(212, 175, 55, .78);
}
.contact-value {
  font-size: 15px;
  line-height: 1.6;
  color: #EDF3EE;
  word-break: break-word;
}
.contact-value--mono { font-family: var(--font-mono); letter-spacing: .05em; }
.copy-btn {
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(212, 175, 55, .42);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--gold-light);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.copy-btn:hover { background: rgba(212, 175, 55, .18); }
.copy-btn[data-copied] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-3);
  font-weight: 700;
}
.footer-note {
  margin-top: 20px;
  max-width: 72ch;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(232, 224, 207, .52);
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
  margin-top: clamp(30px, 4vw, 46px);
  padding-top: 20px;
  border-top: 1px solid rgba(232, 224, 207, .12);
  font-size: 12.5px;
  color: rgba(232, 224, 207, .5);
}
.footer-legal { font-family: var(--font-mono); letter-spacing: .07em; }

/* ---------- 6. Shared components ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(46px, 7vw, 96px); }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink); color: rgba(247, 242, 231, .88); }
.section--ink h1,
.section--ink h2,
.section--ink h3 { color: var(--paper); }
.section--edge {
  background: var(--paper-2);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(11, 61, 46, .035) 0 1px,
    transparent 1px 9px
  );
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.section--ink .section-title { color: var(--paper); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--graphite);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}
.section--ink .eyebrow { color: var(--gold-light); }

.grid { display: grid; gap: clamp(20px, 3vw, 36px); }
.grid--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid rgba(11, 61, 46, .14);
  border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 32px);
  box-shadow: var(--shadow-soft);
  min-width: 0;
}
.section--ink .card {
  background: var(--ink-2);
  border-color: rgba(212, 175, 55, .28);
  color: rgba(247, 242, 231, .86);
}
.card-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--graphite);
}
.section--ink .card-body { color: rgba(232, 224, 207, .74); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .05em;
  line-height: 1.2;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
}
.btn--gold { background: var(--gold); color: var(--ink-3); }
.btn--gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn--ghost { color: var(--ink); border-color: rgba(11, 61, 46, .3); }
.btn--ghost:hover { border-color: var(--gold); color: var(--ink); background: rgba(212, 175, 55, .1); }
.section--ink .btn--ghost { color: var(--paper); border-color: rgba(240, 220, 160, .42); }
.section--ink .btn--ghost:hover { color: var(--gold-light); border-color: var(--gold); }

.breadcrumb { margin-bottom: clamp(18px, 3vw, 30px); }
.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--graphite);
}
.breadcrumb-item { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: rgba(212, 175, 55, .85);
}
.breadcrumb-item a { color: inherit; transition: color .2s var(--ease); }
.breadcrumb-item a:hover { color: var(--ink); }
.breadcrumb-item[aria-current="page"] { color: var(--ink); font-weight: 500; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(11, 61, 46, .16);
  background: rgba(11, 61, 46, .06);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--ink);
}
.section--ink .tag {
  border-color: rgba(212, 175, 55, .38);
  background: rgba(212, 175, 55, .12);
  color: var(--gold-light);
}

.h-display {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(64px, 11vw, 152px);
  line-height: .92;
  letter-spacing: -.02em;
  color: var(--ink);
}
.mono { font-family: var(--font-mono); letter-spacing: .05em; }

.divider {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, rgba(11, 61, 46, .16), rgba(212, 175, 55, .55), rgba(11, 61, 46, .16));
}

.prose {
  max-width: 66ch;
  font-size: clamp(16px, 0.5vw + 14px, 17.5px);
  line-height: 1.85;
  color: var(--charcoal);
}
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-size: clamp(24px, 2.6vw, 32px); }
.prose h3 { margin-top: 1.8em; font-size: 20px; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .45em; }
.prose a { color: var(--ink); border-bottom: 1px solid rgba(212, 175, 55, .6); }
.prose a:hover { color: var(--brick); }
.prose strong { color: var(--ink); }
.section--ink .prose { color: rgba(247, 242, 231, .84); }
.section--ink .prose h2,
.section--ink .prose h3,
.section--ink .prose strong { color: var(--paper); }

/* 图片容器基础规则（页面阶段放置 img 或 CSS 几何插画） */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(11, 61, 46, .14);
  background:
    linear-gradient(135deg, rgba(212, 175, 55, .18), rgba(11, 61, 46, .06) 62%),
    var(--paper-2);
  aspect-ratio: 16 / 10;
}
.media-frame > img,
.media-frame > picture,
.media-frame > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--ink {
  border-color: rgba(212, 175, 55, .34);
  background:
    linear-gradient(140deg, rgba(212, 175, 55, .16), transparent 55%),
    var(--ink-2);
}

/* ---------- 7. Media queries ---------- */
@media (min-width: 1100px) {
  .site-header[data-scrolled] .header-chapter { display: block; }
}

@media (max-width: 1080px) {
  .nav-link { padding: 8px 10px; font-size: 14px; }
  .header-shell { gap: 10px; }
}

@media (max-width: 900px) {
  .site-header { padding: 10px 14px 8px; }
  .header-shell { padding: 8px 10px 8px 14px; gap: 10px; }
  .brand-name { font-size: 17px; }
  .brand-crown { font-size: 23px; }
  .version-pill { font-size: 11px; padding: 3px 9px; }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .header-chapter { display: none !important; }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    display: block;
    flex: none;
    padding: 12px;
    background: rgba(6, 42, 32, .985);
    border: 1px solid rgba(212, 175, 55, .3);
    border-radius: 24px;
    box-shadow: 0 26px 54px -26px rgba(0, 0, 0, .95);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(.99);
    transform-origin: top center;
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link { display: block; padding: 12px 16px; border-radius: 14px; font-size: 16px; }
  .nav-link[aria-current="page"] { border-radius: 14px; }

  .read-progress { left: 14px; right: 14px; }

  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--split, .grid--thirds { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-contact-list { grid-template-columns: minmax(0, 1fr); }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .brand-crown--lg { font-size: 36px; }
  .card { border-radius: 22px; }
}

/* ---------- 8. Motion ---------- */
html[data-js="true"] [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s ease-out, transform .32s ease-out;
}
html[data-js="true"] [data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html[data-js="true"] [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .header-cta:hover,
  .btn--gold:hover { transform: none; }
}

@media print {
  .site-header, .read-progress, .nav-toggle { display: none !important; }
  .site-footer { background: none; color: #000; }
  body { background: #fff; }
}
