/* ==========================================================
   彩娱殿堂 Site Kit · CAIYULE PLAY
   深紫 × 金色 · 皇家长卷叙事
   ========================================================== */

/* ---------- 1. 变量与重置 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-900: #1A0B2E;
  --primary-700: #3B1D5E;
  --primary-500: #6B4FA0;
  --gold-400: #D4AF37;
  --gold-600: #B8860B;
  --neutral-100: #F5F1E8;
  --neutral-400: #B0A8A0;
  --neutral-900: #0C0712;
  --background: #0C0712;
  --surface: #1A0B2E;
  --accent: #D4AF37;
  --text-high: #F5F1E8;
  --text-low: #B0A8A0;

  --font-headline: Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 88px;
  --radius: 2px;
  --container-max: 1240px;
  --container-wide-max: 1320px;
  --gold-line: 1px solid rgba(212,175,55,0.28);
  --purple-line: 1px solid rgba(107,79,160,0.35);
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-high);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

ul, ol {
  list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-high);
  letter-spacing: 0.02em;
}

hr {
  border: none;
}

::selection {
  background: rgba(212,175,55,0.3);
  color: var(--text-high);
}

/* ---------- 2. 通用排版与正文 ---------- */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, rgba(212,175,55,0.6) 0%, transparent 85%);
  margin: 2rem 0;
}

.prose {
  max-width: 68ch;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-low);
}

.prose > * + * {
  margin-top: 1.2em;
}

.prose h2,
.prose h3 {
  margin-top: 2.2em;
  color: var(--text-high);
}

.prose strong {
  color: var(--text-high);
  font-weight: 700;
}

.prose a {
  color: var(--gold-400);
  border-bottom: 1px solid rgba(212,175,55,0.35);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.prose a:hover {
  color: var(--gold-400);
  border-bottom-color: rgba(212,175,55,0.8);
}

/* ---------- 3. 布局容器 ---------- */
.container,
.container-wide {
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.container {
  max-width: var(--container-max);
}

.container-wide {
  max-width: var(--container-wide-max);
}

.page-wrap {
  padding-top: var(--header-h);
}

/* ---------- 4. 章节原语 ---------- */
.section {
  position: relative;
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 0.25rem 1.25rem;
  margin-bottom: 2.5rem;
}

.section-no {
  grid-row: span 2;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1px rgba(212,175,55,0.55);
  user-select: none;
}

.section-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.section-subtitle {
  margin: 0;
  color: var(--text-low);
  font-size: 1rem;
}

.section-rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, rgba(212,175,55,0.6) 0%, rgba(212,175,55,0.05) 70%, transparent 100%);
  margin: 1rem 0 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-400);
  border: 1px solid rgba(212,175,55,0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  color: var(--text-high);
  background: transparent;
  text-decoration: none;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.15s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-gold {
  background: linear-gradient(120deg, var(--gold-400), var(--gold-600));
  color: var(--neutral-900);
  border-color: transparent;
  font-weight: 700;
}

.btn-gold:hover {
  filter: brightness(1.08);
  color: var(--neutral-900);
}

.btn-outline {
  border-color: rgba(212,175,55,0.5);
  color: var(--gold-400);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(212,175,55,0.08);
  color: var(--gold-400);
}

/* ---------- 6. 卡片与网格 ---------- */
.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

.card {
  position: relative;
  background: var(--surface);
  border: var(--purple-line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.card-gold {
  background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
  border-color: rgba(212,175,55,0.35);
}

.card-title {
  font-family: var(--font-headline);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--text-low);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 1.5rem 0 0;
  font-size: 0.95rem;
  color: var(--text-low);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li + li::before {
  content: "／";
  margin-right: 0.45rem;
  color: var(--neutral-400);
}

.breadcrumbs a {
  color: var(--text-low);
  transition: color 0.3s var(--ease);
}

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

.breadcrumbs [aria-current="page"] {
  color: var(--gold-400);
}

/* ---------- 8. 媒体容器（页面阶段放图占位） ---------- */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(107,79,160,0.35), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(212,175,55,0.12), transparent 50%),
    var(--primary-700);
  border: 1px solid rgba(212,175,55,0.2);
}

.media::before {
  content: "";
  display: block;
}

.media-16-9::before {
  padding-top: 56.25%;
}

.media-4-3::before {
  padding-top: 75%;
}

.media-square::before {
  padding-top: 100%;
}

.media > img,
.media-asset {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-size: 2.5rem;
  color: rgba(212,175,55,0.45);
  background:
    linear-gradient(135deg, rgba(212,175,55,0.12) 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(315deg, rgba(212,175,55,0.12) 25%, transparent 25%) 0 0 / 24px 24px;
}

/* ---------- 9. 版本轨道 ---------- */
.track {
  position: relative;
  padding: 0;
}

.track-item {
  position: relative;
  padding: 0 0 2rem 2rem;
  border-left: 1px solid rgba(212,175,55,0.3);
  margin-left: 0.5rem;
}

.track-item::before {
  content: attr(data-index);
  position: absolute;
  left: -1.1rem;
  top: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-size: 0.75rem;
  color: var(--gold-400);
  background: var(--background);
  border: 1px solid var(--gold-400);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(212,175,55,0.06);
}

.track-item:last-child {
  border-left-color: transparent;
}

.track-title {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  color: var(--text-high);
  margin-bottom: 0.35rem;
}

.track-text {
  color: var(--text-low);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- 10. 站点头部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(12,7,18,0.55) 0%, transparent 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(12, 7, 18, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(212,175,55,0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.site-header.is-scrolled::before {
  opacity: 0;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: var(--header-h);
}

.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  z-index: 102;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ---------- 11. 品牌单元 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text-high);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  font-family: var(--font-headline);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--neutral-900);
  background: linear-gradient(135deg, #e8c55a 0%, var(--gold-400) 45%, var(--gold-600) 100%);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,215,90,0.4), 0 0 24px rgba(212,175,55,0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-name {
  font-family: var(--font-headline);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-low);
  line-height: 1;
}

/* ---------- 12. 导航 ---------- */
.site-nav {
  position: static;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-link {
  display: block;
  position: relative;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-high);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.9rem;
  bottom: 0.18rem;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-600));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

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

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

.nav-link[aria-current="page"] {
  color: var(--gold-400);
}

/* ---------- 13. 移动导航开关 ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 3px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  color: var(--text-high);
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  line-height: 1;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav-toggle:hover {
  border-color: var(--gold-400);
  background: rgba(212,175,55,0.07);
}

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

.nav-toggle-line {
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.35s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line-top {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line-mid {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line-bottom {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- 14. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--primary-900);
  color: var(--text-low);
  border-top: 1px solid var(--gold-400);
  line-height: 1.7;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(12,7,18,0.4) 0%, transparent 30%),
    radial-gradient(ellipse at 15% 0%, rgba(107,79,160,0.35), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(212,175,55,0.08), transparent 50%);
}

.site-footer::after {
  content: "彩";
  position: absolute;
  right: -1.5rem;
  bottom: -3.5rem;
  font-family: var(--font-headline);
  font-size: 12rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(212,175,55,0.05);
  pointer-events: none;
  user-select: none;
}

.footer-top {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding: 4rem 0 3rem;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.site-footer .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 1.2rem;
}

.site-footer .brand-name {
  font-size: 1.2rem;
}

.footer-slogan {
  font-family: var(--font-headline);
  font-size: 1.2rem;
  color: var(--text-high);
  letter-spacing: 0.05em;
}

.footer-note {
  max-width: 44ch;
  color: var(--text-low);
  font-size: 0.9rem;
}

.footer-col {
  position: relative;
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-headline);
  font-size: 1.1rem;
  color: var(--neutral-100);
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.footer-heading-no {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--gold-400);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 2px;
  padding: 0.12rem 0.4rem;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
}

.footer-list a {
  color: var(--text-low);
  text-decoration: none;
  transition: color 0.3s var(--ease), padding-left 0.3s var(--ease);
}

.footer-list a:hover {
  color: var(--gold-400);
  padding-left: 4px;
}

.footer-contact {
  color: var(--text-low);
  font-size: 0.95rem;
}

.footer-contact a {
  color: var(--gold-400);
}

.footer-support {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-low);
  line-height: 1.75;
}

.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  border-top: 1px solid rgba(212,175,55,0.15);
  font-size: 0.85rem;
  color: var(--text-low);
}

.footer-copyright {
  margin: 0;
}

.footer-icp {
  margin: 0;
  letter-spacing: 0.06em;
}

/* ---------- 15. 辅助与可访问性 ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  background: var(--gold-400);
  color: var(--neutral-900);
  font-weight: 700;
  padding: 0.7rem 1.2rem;
  border-radius: 2px;
  text-decoration: none;
  transition: top 0.3s var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: 2px;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

[data-reveal-delay="1"] {
  transition-delay: 0.1s;
}

[data-reveal-delay="2"] {
  transition-delay: 0.2s;
}

[data-reveal-delay="3"] {
  transition-delay: 0.3s;
}

@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;
    scroll-behavior: auto !important;
  }

  .scroll-progress {
    display: none;
  }

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

/* ---------- 16. 响应式断点 ---------- */
@media (max-width: 1100px) {
  .nav-links {
    gap: 0.1rem;
  }

  .nav-link {
    padding: 0.5rem 0.6rem;
  }
}

@media (max-width: 960px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

@media (max-width: 920px) {
  :root {
    --header-h: 76px;
  }

  .site-nav {
    position: absolute;
    top: calc(100% - 4px);
    left: clamp(1.25rem, 5vw, 3rem);
    right: clamp(1.25rem, 5vw, 3rem);
    background: var(--primary-900);
    border: 1px solid rgba(212,175,55,0.22);
    border-top: 2px solid var(--gold-400);
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    padding: 0 0.75rem;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0s 0.5s;
  }

  .site-nav[data-open] {
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0s 0s;
  }

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

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
  }

  .nav-link-item {
    border-bottom: 1px solid rgba(107,79,160,0.2);
  }

  .nav-link-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    padding: 0.9rem 0.5rem;
    font-size: 1.05rem;
  }

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

  .nav-link:hover {
    color: var(--gold-400);
    background: rgba(107,79,160,0.12);
  }
}

@media (max-width: 640px) {
  .brand-name {
    font-size: 1.1rem;
  }

  .brand-sub {
    letter-spacing: 0.3em;
  }

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

  .footer-heading {
    font-size: 1rem;
  }
}
