/* =============================================================
   云开赛场 · 云开娱乐 — 全站共享 Site Kit
   /assets/site.css
   深空蓝 × 金色权威线 × 暗红地缘点缀 · 数据叙事型布局
   ============================================================= */

/* ---------- 设计变量 ---------- */
:root {
  --color-primary: #1a1a2e;
  --color-accent: #d4af37;
  --color-secondary: #8b0000;
  --color-bg-dark: #0f0f1a;
  --color-bg-light: #f5f5f7;
  --color-text: #e0e0e0;
  --color-text-dark: #1a1a2e;
  --color-border: #2e2e4a;
  --color-highlight: #ffd700;
  --color-muted: #a0a0b0;

  --font-display: "Playfair Display", "Songti SC", "SimSun", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-max: 1240px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 4.5rem;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
  }
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--color-text-dark);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

img {
  object-fit: cover;
}

::selection {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* ---------- 基础链接 ---------- */
a {
  color: var(--color-secondary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

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

.section--dark a,
.section--darker a,
.site-footer a {
  color: var(--color-accent);
}

.section--dark a:hover,
.section--darker a:hover,
.site-footer a:hover {
  color: var(--color-highlight);
}

/* ---------- 中文排版 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-text-dark);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.5rem + 4vw, 3.5rem); }
h2 { font-size: clamp(1.875rem, 1.25rem + 2.5vw, 2.5rem); }
h3 { font-size: clamp(1.375rem, 1.125rem + 1vw, 1.75rem); }
h4 { font-size: 1.125rem; }

p,
li,
td,
th {
  line-break: strict;
  hyphens: none;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--darker h1,
.section--darker h2,
.section--darker h3 {
  color: var(--color-text);
}

small,
.caption {
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ---------- 布局工具 ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 880px;
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section--hero {
  padding-block: clamp(7.5rem, 16vh, 11rem) clamp(3.5rem, 9vh, 6.5rem);
}

.section--dark {
  background: var(--color-primary);
  color: var(--color-text);
}

.section--darker {
  background: var(--color-bg-dark);
  color: var(--color-text);
}

.section--light {
  background: #ffffff;
  color: var(--color-text-dark);
}

.split-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--color-accent);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 2px;
  background: var(--color-accent);
}

.eyebrow--red {
  color: var(--color-secondary);
}

.eyebrow--red::before {
  background: var(--color-secondary);
}

#main-content {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* ---------- 按钮体系 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.625rem 1.375rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  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 ease;
}

.btn::before,
.btn::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: currentColor;
  opacity: 0.5;
  pointer-events: none;
}

.btn::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.btn::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.btn--gold {
  background: linear-gradient(135deg, var(--color-accent) 0%, #f0d86b 100%);
  color: var(--color-primary);
  border-color: var(--color-accent);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.22);
}

.btn--gold:hover {
  background: linear-gradient(135deg, var(--color-highlight) 0%, #ffe880 100%);
  color: var(--color-primary);
  box-shadow: 0 7px 20px rgba(212, 175, 55, 0.35);
  transform: translateY(-1px);
}

.btn--dark {
  background: var(--color-primary);
  color: var(--color-bg-light);
  border-color: var(--color-primary);
}

.btn--dark:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-bg-light);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: rgba(224, 224, 224, 0.45);
}

.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(212, 175, 55, 0.08);
}

/* ---------- 页头 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-h);
  background: linear-gradient(180deg, rgba(15, 15, 26, 0.72) 0%, rgba(15, 15, 26, 0.38) 55%, rgba(15, 15, 26, 0) 100%);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.site-header[data-scrolled] {
  background: rgba(15, 15, 26, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(212, 175, 55, 0.28), 0 12px 32px rgba(0, 0, 0, 0.3);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 100%;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

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

.brand__mark {
  width: 40px;
  height: 40px;
  display: block;
}

.brand__mark svg {
  width: 100%;
  height: 100%;
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
}

.brand__text-accent {
  color: var(--color-accent);
}

/* 主导航 */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
  list-style: none;
}

.site-nav__list a {
  position: relative;
  display: inline-block;
  padding: 0.375rem 0.125rem 0.5rem;
  color: rgba(224, 224, 224, 0.9);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.125rem;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-highlight));
  transform: scaleX(0) skewX(-35deg);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.site-nav__list a:hover {
  color: var(--color-highlight);
}

.site-nav__list a:hover::after,
.site-nav__list a[aria-current="page"]::after {
  transform: scaleX(1) skewX(-35deg);
}

.site-nav__list a[aria-current="page"] {
  color: var(--color-highlight);
}

.site-nav__cta {
  flex-shrink: 0;
  min-height: 2.5rem;
  padding: 0.5rem 1.125rem;
  font-size: 0.875rem;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 1400;
  color: var(--color-text);
  background: rgba(15, 15, 26, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 2px;
  padding: 0;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 跳转链接 */
.skip-link {
  position: fixed;
  top: -4rem;
  left: 1rem;
  z-index: 1400;
  padding: 0.625rem 1.25rem;
  background: var(--color-accent);
  color: var(--color-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: 2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--color-primary);
}

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--color-bg-dark);
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 45%, transparent 100%);
  z-index: 3;
}

.site-footer__landmark {
  position: absolute;
  inset: auto 0 0 0;
  height: 220px;
  pointer-events: none;
  overflow: hidden;
}

.site-footer__landmark-svg {
  width: 100%;
  height: 100%;
}

.site-footer__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(3.5rem, 7vw, 6rem) var(--gutter) 2rem;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.brand--footer .brand__mark {
  width: 46px;
  height: 46px;
}

.brand--footer .brand__text {
  font-size: 1.625rem;
}

.site-footer__tagline {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.site-footer__trust {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.site-footer__heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0.875rem;
  padding-left: 0.875rem;
  position: relative;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-accent);
}

.site-footer__heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 3px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-secondary));
}

.site-footer__list {
  list-style: none;
  display: grid;
  gap: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.site-footer__list a {
  color: var(--color-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-footer__list a:hover {
  color: var(--color-highlight);
  border-color: rgba(212, 175, 55, 0.5);
}

.site-footer__bottom {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 1.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(46, 46, 74, 0.8);
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ---------- 面包屑 ---------- */
.breadcrumbs {
  font-size: 0.875rem;
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.breadcrumbs__list li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-muted);
}

.breadcrumbs__list li:not(:last-child)::after {
  content: "/";
  color: var(--color-accent);
  font-weight: 600;
}

.breadcrumbs__list a {
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs__list a:hover {
  color: var(--color-accent);
}

.breadcrumbs__list [aria-current="page"] {
  color: var(--color-text-dark);
  font-weight: 600;
}

/* ---------- 面板 / 卡片 / 标签 ---------- */
.panel {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: 0 1px 0 rgba(15, 15, 26, 0.05);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.panel--dark {
  background: var(--color-primary);
  color: var(--color-text);
  border-color: var(--color-primary);
}

.panel--outline {
  background: transparent;
  box-shadow: none;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.data-card {
  position: relative;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 1.75rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.data-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-highlight));
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.data-card:hover {
  border-color: rgba(212, 175, 55, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 15, 26, 0.14);
}

.data-card:hover::before {
  transform: scaleX(1);
}

.data-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text-dark);
  background: rgba(15, 15, 26, 0.06);
  border: 1px solid transparent;
  border-left: 2px solid var(--color-accent);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

a.tag:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

.tag--red {
  border-left-color: var(--color-secondary);
}

/* ---------- 图片容器 ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 240px;
  background: linear-gradient(145deg, var(--color-primary) 0%, #23233c 100%);
}

.img-frame::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 22px 22px 0;
  border-color: transparent var(--color-accent) transparent transparent;
  opacity: 0.9;
  pointer-events: none;
}

.img-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-frame[data-placeholder] {
  background:
    linear-gradient(135deg, transparent 48.5%, rgba(212, 175, 55, 0.32) 49%, rgba(212, 175, 55, 0.32) 51%, transparent 51.5%),
    linear-gradient(145deg, var(--color-primary) 0%, #23233c 100%);
}

.img-frame--16x9 { aspect-ratio: 16 / 9; }
.img-frame--4x3 { aspect-ratio: 4 / 3; }
.img-frame--1x1 { aspect-ratio: 1 / 1; }

/* ---------- 数据表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--color-bg-light);
}

.data-table th {
  text-align: left;
  background: var(--color-primary);
  color: var(--color-text);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--color-accent);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-dark);
}

.data-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.08);
}

/* ---------- 正文排版 ---------- */
.prose p + p {
  margin-top: 1.25em;
}

.prose h2,
.prose h3 {
  margin-top: 1.75em;
  margin-bottom: 0.6em;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  display: grid;
  gap: 0.375rem;
}

/* ---------- 阅读进度 / 返回顶部 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1300;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-highlight));
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 26, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s, border-color 0.2s ease, background 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.back-to-top:hover {
  border-color: var(--color-accent);
  background: var(--color-primary);
  color: var(--color-highlight);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- 显现交互 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    width: 46px;
    height: 46px;
  }

  .nav-toggle__bar {
    width: 20px;
    height: 2px;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) 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(-7px) rotate(-45deg);
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 1005;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    margin-left: 0;
    padding: 1.5rem var(--gutter) 2rem;
    background: var(--color-bg-dark);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-14px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .site-nav[data-open] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .site-nav__list a {
    display: block;
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid rgba(46, 46, 74, 0.7);
    font-size: 1.0625rem;
  }

  .site-nav__list a::after {
    bottom: 0.4rem;
  }

  .site-nav__cta {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 1rem;
  }

  .split-hero {
    grid-template-columns: 1fr;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ---------- 焦点与弱动效 ---------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@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;
  }

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

  .site-nav {
    transition: opacity 0.15s ease;
  }

  .site-nav[data-open] {
    transform: none;
  }

  .back-to-top {
    transition: opacity 0.15s ease, visibility 0s;
  }
}
