/* =========================================================================
   M6娱乐中心 · 全站共享样式
   文件：/assets/site.css
   ========================================================================= */

/* ---------- CSS 变量 ---------- */
:root {
  --color-bg: #030514;
  --color-bg-dark: #0a1128;
  --color-black: #000000;
  --color-white: #f5f5f5;
  --color-gold: #d4af37;
  --color-gold-light: #f0e68c;
  --color-gray: #8a94a6;
  --color-card: #1c2333;
  --color-gold-glow: rgba(212, 175, 55, 0.2);
  --color-gold-line: rgba(212, 175, 55, 0.35);

  --font-heading: "Noto Sans SC", "PingFang SC", sans-serif;
  --font-body: "Source Serif SC", "Noto Serif SC", "Songti SC", serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  --brand-width: 96px;
  --nav-rail: 72px;
  --container-max: 1180px;
  --content-padding: clamp(20px, 4vw, 48px);
  --section-gap: clamp(64px, 10vw, 120px);
  --radius: 6px;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-white);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

@media (min-width: 768px) {
  body {
    padding-left: var(--brand-width);
    padding-right: calc(var(--nav-rail) + 12px);
  }
}

@media (max-width: 767px) {
  body {
    padding-top: 60px;
  }
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- 焦点可见 ---------- */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- 文字排版 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--color-white);
}

h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: 1.4rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }

p {
  color: rgba(245, 245, 245, 0.86);
}

/* 等宽索引元素 */
.section-index,
.footer-index,
.header-icp,
.breadcrumb,
.tag,
.nav-index {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* =========================================================================
   头部
   ========================================================================= */

.site-header {
  position: relative;
  z-index: 1000;
}

/* 跳过链接 */
.skip-link {
  position: fixed;
  top: -56px;
  left: 20px;
  z-index: 2000;
  padding: 10px 18px;
  background: var(--color-bg);
  color: var(--color-gold);
  border: 1px solid var(--color-gold-line);
  border-radius: 0 0 8px 8px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-decoration: none;
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--color-gold-light);
  border-color: var(--color-gold);
}

/* 左侧品牌柱 */
.brand-logo {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--brand-width);
  height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--color-black) 0%, var(--color-bg-dark) 100%);
  border-right: 1px solid rgba(212, 175, 55, 0.18);
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease;
  z-index: 1000;
}

.brand-logo:hover,
.brand-logo:focus-visible {
  border-right-color: rgba(212, 175, 55, 0.55);
  background: linear-gradient(180deg, #020308 0%, #0d1530 100%);
}

.brand-en,
.brand-cn {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-gold);
  letter-spacing: 0.12em;
}

.brand-cn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.24em;
}

/* 右侧悬浮导航 */
.site-nav {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 100;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--color-gray);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--color-gold-glow);
  color: var(--color-white);
}

.nav-link[aria-current="page"] {
  color: var(--color-gold);
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.08);
}

.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-gold);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
}

.nav-index {
  font-size: 0.72rem;
  color: var(--color-gold);
  opacity: 0.7;
}

.nav-label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  padding: 4px 12px;
  background: rgba(3, 5, 20, 0.92);
  color: var(--color-white);
  border: 1px solid var(--color-gold-line);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-link:hover .nav-label,
.nav-link:focus-visible .nav-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* 移动菜单按钮：桌面端隐藏 */
.nav-toggle {
  display: none;
}

/* 页眉备案 */
.header-icp {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: var(--brand-width);
  text-align: center;
  font-size: 0.6rem;
  color: var(--color-gray);
  opacity: 0.6;
  z-index: 100;
}

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  z-index: 2000;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* =========================================================================
   页脚
   ========================================================================= */

.site-footer {
  position: relative;
  margin-top: var(--section-gap);
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-dark) 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  padding: 0 var(--content-padding) 32px;
}

.footer-rule {
  height: 2px;
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 40%, transparent 100%);
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 48px;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-top: 56px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-index {
  font-size: 0.72rem;
  color: var(--color-gold);
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: -0.01em;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--color-gray);
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.footer-links a {
  display: inline-block;
  width: fit-content;
  font-size: 0.92rem;
  color: var(--color-gray);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

.footer-contact p {
  font-size: 0.92rem;
  color: var(--color-gray);
  line-height: 1.5;
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 56px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(138, 148, 166, 0.15);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.footer-bottom p {
  color: var(--color-gray);
  font-size: 0.8rem;
  line-height: 1.5;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer-icp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.8;
}

.footer-note {
  width: 100%;
  margin-top: 8px;
  opacity: 0.7;
}

/* =========================================================================
   通用组件
   ========================================================================= */

/* 内容容器 */
.content-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--content-padding);
}

/* 区块 */
.section {
  position: relative;
  padding-block: calc(var(--section-gap) / 2);
}

.section-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
  padding-top: 12px;
}

.section-head::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 3px;
  background: var(--color-gold);
  border-radius: 2px;
}

.section-index {
  font-size: 0.85rem;
  color: var(--color-gold);
  opacity: 0.8;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

.section-desc {
  margin-top: 12px;
  max-width: 640px;
  color: var(--color-gray);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-white);
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.35);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--color-gold-glow);
  border-color: rgba(212, 175, 55, 0.65);
  color: var(--color-white);
}

.btn-gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, #141a2e 100%);
  border-color: rgba(212, 175, 55, 0.55);
  color: var(--color-white);
}

.btn-gold:hover,
.btn-gold:focus-visible {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35) 0%, var(--color-bg-dark) 100%);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(138, 148, 166, 0.35);
  color: var(--color-gray);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--color-gold);
  color: var(--color-white);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 0.78rem;
  margin-bottom: 24px;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-gray);
}

.breadcrumb-item::after {
  content: "›";
  color: var(--color-gold);
  opacity: 0.5;
}

.breadcrumb-item:last-child::after {
  display: none;
}

.breadcrumb-item a {
  color: var(--color-gray);
  text-decoration: none;
  transition: color 0.25s ease;
}

.breadcrumb-item a:hover,
.breadcrumb-item a:focus-visible {
  color: var(--color-gold);
}

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

/* 卡片 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--color-card);
  border: 1px solid rgba(138, 148, 166, 0.12);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.08), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-text {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--color-gray);
}

.card-highlight {
  border-left: 3px solid var(--color-gold);
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  background: rgba(138, 148, 166, 0.08);
  border: 1px solid rgba(138, 148, 166, 0.25);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--color-gray);
}

.tag-gold {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  color: var(--color-gold);
}

/* 图片占位容器（页面阶段放置实际图片或 SVG） */
.image-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, #050815 100%);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius);
}

.image-frame::before {
  content: "";
  display: block;
  padding-top: 75%;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-gray);
  letter-spacing: 0.08em;
}

.image-placeholder::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  pointer-events: none;
}

/* 滚动显现（页面阶段配合 data-reveal 使用） */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* =========================================================================
   响应式
   ========================================================================= */

/* 平板 768–1023 */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --brand-width: 72px;
    --nav-rail: 64px;
  }

  .brand-logo {
    gap: 4px;
  }

  .brand-en {
    font-size: 1.2rem;
  }

  .brand-cn {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }

  .nav-link {
    width: 40px;
    height: 40px;
  }

  .site-nav {
    right: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* 移动端 ≤767 */
@media (max-width: 767px) {
  /* 品牌改顶部水平条 */
  .brand-logo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 16px;
    background: rgba(3, 5, 20, 0.96);
    border-right: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  }

  .brand-en,
  .brand-cn {
    writing-mode: horizontal-tb;
    text-orientation: initial;
  }

  .brand-en {
    font-size: 1.2rem;
  }

  .brand-cn {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
  }

  .header-icp {
    display: none;
  }

  /* 移动菜单按钮 */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 1200;
    width: 40px;
    height: 36px;
    padding: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    background: rgba(3, 5, 20, 0.9);
  }

  .toggle-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-gold);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-toggle.is-active .toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle.is-active .toggle-line:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-active .toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* 移动导航面板 */
  .site-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(3, 5, 20, 0.98);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 8px 16px 16px;
    z-index: 1100;
    display: none;
  }

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

  .nav-link {
    width: 100%;
    height: auto;
    padding: 12px 16px;
    border-radius: var(--radius);
    gap: 12px;
    justify-content: flex-start;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    background: var(--color-gold-glow);
  }

  .nav-link[aria-current="page"]::before {
    left: 4px;
  }

  .nav-label {
    position: static;
    transform: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9rem;
    opacity: 1;
  }

  .nav-link:hover .nav-label,
  .nav-link:focus-visible .nav-label,
  .nav-link[aria-current="page"] .nav-label {
    transform: none;
    opacity: 1;
  }

  .nav-link[aria-current="page"] {
    background: rgba(212, 175, 55, 0.08);
    box-shadow: none;
  }

  /* 页脚单列 */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* 跳过链接避让头部 */
  .skip-link:focus {
    top: 60px;
  }
}

/* ---------- 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  html {
    scroll-behavior: auto;
  }

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