/* ===== 财神到游戏站 共享样式 ===== */

/* ---------- 重置与变量 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --gold: #D4AF37;
  --deep-red: #8B0000;
  --navy: #1A2A3A;
  --teal: #00A86B;
  --light: #FFF8E7;
  --dark: #0E1621;
  --cream: #F9F1E0;
  --text-ink: #1C1C1C;
  --text-gold: #D4AF37;
  --text-muted: #6B7280;
  --gold-gradient: linear-gradient(135deg, #F9F1E0 0%, #D4AF37 50%, #B8860B 100%);
  --red-gradient: linear-gradient(135deg, #8B0000 0%, #5C0000 100%);
  --font-headings: "Noto Serif SC", "STSong", "SimSun", serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --content-max: 1200px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-xxl: 64px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-soft: 0 4px 20px rgba(14, 22, 33, 0.08);
  --shadow-gold: 0 6px 24px rgba(212, 175, 55, 0.28);
  --shadow-red: 0 6px 20px rgba(139, 0, 0, 0.25);
}

/* ---------- 基础排版 ---------- */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-ink);
  background-color: var(--light);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  line-height: 1.25;
  color: var(--text-ink);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

a {
  color: var(--deep-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  margin: 0;
  padding-left: 1.25em;
}

#main-content {
  flex: 1 0 auto;
  outline: none;
  scroll-margin-top: 96px;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: var(--space-xxl);
}

.display-title {
  font-family: var(--font-headings);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--deep-red);
}

.section-number {
  font-family: var(--font-headings);
  font-size: clamp(2.75rem, 6vw, 4.75rem);
  font-weight: 900;
  line-height: 1;
  color: var(--gold);
  display: block;
}

@supports ((-webkit-text-stroke: 1px var(--gold)) or (text-stroke: 1px var(--gold))) {
  .section-number {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--gold);
    text-stroke: 1.5px var(--gold);
  }
}

/* ---------- 焦点状态 ---------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 屏幕阅读器专用 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 跳过链接 ---------- */
.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 2000;
  background: var(--deep-red);
  color: var(--light);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-red);
  text-decoration: none;
  transition: top 0.3s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn-primary {
  background: var(--deep-red);
  color: var(--light);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

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

.btn-outline:hover {
  background: rgba(212, 175, 55, 0.12);
  box-shadow: var(--shadow-gold);
}

.btn-success {
  background: var(--teal);
  color: var(--light);
  box-shadow: 0 4px 16px rgba(0, 168, 107, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 168, 107, 0.4);
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding-block: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb [aria-current="page"] {
  color: var(--text-muted);
}

/* ---------- 卡片与网格 ---------- */
.card {
  background: var(--light);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.18);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

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

.tag-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.1);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--deep-red);
}

/* ---------- 图片容器 ---------- */
.image-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--cream);
  border: 2px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
}

.image-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-frame[data-ratio="16/9"] { aspect-ratio: 16 / 9; }
.image-frame[data-ratio="4/3"] { aspect-ratio: 4 / 3; }
.image-frame[data-ratio="1/1"] { aspect-ratio: 1 / 1; }

.image-frame[data-placeholder] {
  background-image: radial-gradient(circle at 12px 12px, rgba(212, 175, 55, 0.2) 2px, transparent 3px);
  background-size: 28px 28px;
}

.image-frame[data-placeholder]::after {
  content: "图片占位";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  color: rgba(139, 0, 0, 0.55);
}

/* ---------- 装饰组件 ---------- */
.coin-deco {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-gradient);
  position: relative;
  margin-right: 8px;
  vertical-align: -2px;
  flex-shrink: 0;
}

.coin-deco::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border: 1px solid rgba(139, 0, 0, 0.75);
  background: transparent;
  border-radius: 1px;
}

.lantern-deco {
  display: inline-block;
  width: 40px;
  height: 48px;
  background: var(--red-gradient);
  border-radius: 46% 46% 44% 44%;
  position: relative;
  box-shadow: var(--shadow-red);
}

.lantern-deco::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 12px;
  background: var(--gold);
  border-radius: 3px 3px 2px 2px;
}

.lantern-deco::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.gold-line {
  display: block;
  height: 3px;
  border: 0;
  border-radius: 3px;
  background: var(--gold-gradient);
  margin: var(--space-xl) 0;
}

.cloud-pattern {
  background-image:
    radial-gradient(ellipse at 20% 65%, rgba(212, 175, 55, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse at 78% 32%, rgba(212, 175, 55, 0.12) 0%, transparent 42%),
    radial-gradient(ellipse at 52% 88%, rgba(139, 0, 0, 0.08) 0%, transparent 45%);
  background-size: 100% 100%;
}

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--cream);
  box-shadow: 0 2px 12px rgba(14, 22, 33, 0.08);
  transition: box-shadow 0.3s ease;
}

.site-header[data-scrolled] {
  box-shadow: 0 6px 24px rgba(14, 22, 33, 0.18);
}

.header-upper {
  background: var(--red-gradient);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}

.header-upper-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.header-tagline {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--light);
}

.header-icp {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(255, 248, 231, 0.75);
  white-space: nowrap;
}

.header-main {
  position: relative;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---------- 品牌标识 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-ink);
  flex-shrink: 0;
}

.brand-seal {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--deep-red);
  color: var(--gold);
  font-family: var(--font-headings);
  font-size: 26px;
  font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(212, 175, 55, 0.5), var(--shadow-red);
  flex-shrink: 0;
}

.brand-seal::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 248, 231, 0.35), transparent);
  transform: skewX(-20deg);
  animation: seal-glimmer 4.5s ease-in-out infinite;
}

@keyframes seal-glimmer {
  0% { left: -80%; }
  60%, 100% { left: 130%; }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--deep-red);
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* ---------- 头部装饰 ---------- */
.header-deco {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  animation: coin-pulse 4s ease-in-out infinite;
}

.header-deco::after {
  content: "福";
  font-family: var(--font-headings);
  font-size: 16px;
  font-weight: 700;
  color: var(--deep-red);
  line-height: 1;
}

@keyframes coin-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2), 0 4px 14px rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(212, 175, 55, 0.1), 0 6px 20px rgba(212, 175, 55, 0.45);
  }
}

/* ---------- 主导航 ---------- */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

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

.nav-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-ink);
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.nav-link:hover {
  background: rgba(212, 175, 55, 0.14);
  color: var(--deep-red);
}

.nav-link[aria-current="page"] {
  background: var(--deep-red);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(139, 0, 0, 0.25);
}

.nav-list-meta {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(212, 175, 55, 0.45);
}

.nav-link-meta {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
}

.nav-link-meta:hover {
  background: rgba(212, 175, 55, 0.08);
  color: var(--deep-red);
}

/* ---------- 移动导航按钮 ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  margin-left: auto;
}

.nav-toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ---------- 滚动进度 ---------- */
.header-progress {
  width: 100%;
  height: 3px;
  background: rgba(212, 175, 55, 0.15);
  overflow: hidden;
}

.header-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold-gradient);
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--dark);
  color: rgba(255, 248, 231, 0.75);
  position: relative;
  margin-top: var(--space-xxl);
}

.footer-gold-line {
  height: 4px;
  background: var(--gold-gradient);
}

.footer-top {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-xl) 24px var(--space-lg);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-xl);
}

.footer-brand .brand-name {
  color: var(--gold);
}

.footer-brand .brand-sub {
  color: rgba(255, 248, 231, 0.6);
}

.footer-description {
  margin-top: var(--space-md);
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 248, 231, 0.7);
}

.footer-trust {
  margin-top: var(--space-md);
  font-size: 0.82rem;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(212, 175, 55, 0.08);
  color: rgba(255, 248, 231, 0.8);
}

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

.footer-heading {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: var(--space-md);
  position: relative;
  padding-bottom: 8px;
}

.footer-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: var(--gold);
}

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

.footer-link {
  color: rgba(255, 248, 231, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-link:hover {
  color: var(--gold);
  padding-left: 6px;
}

.footer-contact {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.footer-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 248, 231, 0.7);
}

.footer-contact-item {
  line-height: 1.6;
}

.footer-bottom {
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.footer-bottom-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(255, 248, 231, 0.55);
}

.footer-copyright {
  margin: 0;
}

.footer-copyright [data-year] {
  color: var(--gold);
}

.footer-icp {
  margin: 0;
  color: rgba(255, 248, 231, 0.55);
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--deep-red);
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-red);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.back-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: #a50000;
}

/* ---------- 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal][data-revealed] {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式：平板与手机 ---------- */
@media (max-width: 1024px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: var(--deep-red);
    border-radius: 10px;
    box-shadow: var(--shadow-red);
  }

  .header-deco {
    display: none;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    background: var(--cream);
    border-top: 3px solid var(--gold);
    box-shadow: 0 20px 40px rgba(14, 22, 33, 0.25);
    padding: 8px 0 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }

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

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

  .nav-item + .nav-item {
    border-top: 1px solid rgba(212, 175, 55, 0.15);
  }

  .nav-link {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 0;
  }

  .nav-link[aria-current="page"] {
    border-radius: 0;
  }

  .nav-list-meta {
    flex-direction: row;
    flex-wrap: wrap;
    margin: 12px 16px 0;
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    gap: 8px;
  }

  .nav-list-meta .nav-item + .nav-item {
    border-top: 0;
  }

  .nav-link-meta {
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

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

@media (max-width: 640px) {
  .header-upper-inner {
    padding: 6px 16px;
  }

  .header-tagline {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .header-icp {
    display: none;
  }

  .header-main {
    padding: 8px 16px;
    gap: 10px;
  }

  .brand-seal {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-sub {
    font-size: 0.62rem;
  }

  .header-progress {
    height: 2px;
  }

  .container {
    padding-inline: 16px;
  }

  .section {
    padding-block: var(--space-xl);
  }

  .footer-top {
    grid-template-columns: 1fr;
    padding: var(--space-lg) 16px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .back-top {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* ---------- 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .brand-seal::before,
  .header-deco {
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
