/* ============================================
   LEYU 乐游手机端 · 共享样式
   文件：/assets/site.css
   ============================================ */

:root {
  --c-bg: #0B1026;
  --c-bg-deep: #070A18;
  --c-card: #1A2340;
  --c-card-2: #202A4A;
  --c-green: #00FF9D;
  --c-blue: #00E5FF;
  --c-red: #FF4757;
  --c-red-bg: #4A1520;
  --c-gray: #8A94A6;
  --c-white: #F2F6FF;
  --c-line: rgba(0, 229, 255, 0.14);
  --c-line-strong: rgba(0, 229, 255, 0.38);
  --c-green-glass: rgba(0, 255, 157, 0.12);
  --c-blue-glass: rgba(0, 229, 255, 0.08);
  --font-head: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Helvetica Neue", "Source Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Fira Code", Consolas, "Liberation Mono", monospace;
  --header-h: 64px;
  --content-w: 1200px;
  --radius: 16px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.65);
  --ease: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 34px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-white);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(rgba(242, 246, 255, 0.03) 1px, transparent 1.4px),
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 3px 3px, 44px 44px, 44px 44px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 58% 42% at 80% 14%, rgba(0, 255, 157, 0.09), transparent 62%),
    radial-gradient(ellipse 46% 40% at 10% 82%, rgba(0, 229, 255, 0.07), transparent 60%);
}

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

a {
  color: var(--c-green);
  text-decoration: none;
  transition: color var(--ease), background-color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

a:hover {
  color: var(--c-blue);
}

ul,
ol {
  list-style: none;
}

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

::selection {
  background: var(--c-green);
  color: #04120C;
}

:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 3px;
  border-radius: 4px;
}

#main-content {
  position: relative;
  flex: 1;
  padding: calc(var(--header-h) + 34px) 0 0;
  overflow: clip;
}

.container {
  width: min(var(--content-w), calc(100% - 40px));
  margin-inline: auto;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform var(--ease), background-color var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
}

.btn--primary {
  background: var(--c-green);
  color: #04120C;
  box-shadow: 0 6px 20px -6px rgba(0, 255, 157, 0.5);
}

.btn--primary:hover {
  background: var(--c-blue);
  color: #06121A;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(0, 229, 255, 0.6);
}

.btn--ghost {
  background: var(--c-blue-glass);
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--c-blue);
}

.btn--ghost:hover {
  background: rgba(0, 229, 255, 0.18);
  border-color: var(--c-blue);
  color: var(--c-white);
}

/* ---------- 跳转链接 ---------- */

.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 2000;
  background: var(--c-green);
  color: #04120C;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  transition: top 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
}

/* ---------- 滚动进度条 ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 2001;
  background: linear-gradient(90deg, var(--c-green), var(--c-blue));
  pointer-events: none;
}

/* ---------- 头部 ---------- */

.site-header {
  position: fixed;
  inset: 12px 12px auto;
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.site-header__inner {
  width: min(var(--content-w), 100%);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 12px 0 20px;
  background: rgba(11, 16, 38, 0.84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(0, 255, 157, 0.06);
}

/* ---------- 品牌 ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--c-green) 0%, var(--c-blue) 100%);
  clip-path: polygon(11% 4%, 89% 4%, 100% 50%, 89% 96%, 11% 96%, 0% 50%);
  box-shadow: 0 4px 18px rgba(0, 255, 157, 0.35);
}

.brand__text {
  display: grid;
  line-height: 1.25;
}

.brand__name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--c-white);
}

.brand__dot {
  color: var(--c-green);
}

.brand__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--c-gray);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- 导航 ---------- */

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-gray);
  border: 1px solid transparent;
  transition: color var(--ease), background-color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.site-nav__link:hover {
  color: var(--c-white);
  background: var(--c-green-glass);
  border-color: rgba(0, 255, 157, 0.18);
}

.site-nav__link[aria-current="page"] {
  color: var(--c-green);
  background: rgba(0, 255, 157, 0.1);
  border-color: rgba(0, 255, 157, 0.35);
  box-shadow: 0 0 16px rgba(0, 255, 157, 0.12);
}

.nav-cta {
  height: 38px;
  padding: 0 18px;
}

/* ---------- 移动导航按钮 ---------- */

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--c-line-strong);
  background: var(--c-blue-glass);
  place-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--c-white);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.2s ease;
}

.nav-toggle__line + .nav-toggle__line {
  margin-top: 4px;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
  opacity: 0;
}

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

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 90px;
  position: relative;
  background: linear-gradient(180deg, #0A0E1E 0%, var(--c-bg-deep) 100%);
  border-top: 1px solid var(--c-line);
  color: var(--c-gray);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--c-green) 14%, var(--c-blue) 58%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 1.2fr;
  gap: 48px;
  padding: 56px 0 44px;
}

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

.brand--footer .brand__meta {
  color: var(--c-blue);
}

.site-footer__statement {
  margin-top: 16px;
  max-width: 420px;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-gray);
  border-left: 2px solid var(--c-green);
}

.site-footer__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--c-white);
  padding-bottom: 12px;
  margin-bottom: 16px;
  position: relative;
}

.site-footer__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 24px;
  height: 2px;
  background: var(--c-green);
}

.site-footer__links {
  display: grid;
  gap: 8px;
}

.site-footer__links a {
  color: var(--c-gray);
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--c-green);
  padding-left: 6px;
}

.site-footer__col--contact {
  border-left: 1px solid var(--c-line);
  padding-left: 28px;
}

.contact-list {
  display: grid;
  gap: 12px;
}

.contact-list__row {
  display: grid;
  gap: 3px;
  font-size: 13px;
}

.contact-list__row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--c-blue);
  text-transform: uppercase;
}

.contact-list__row dd {
  color: var(--c-white);
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
}

.site-footer__bottom {
  border-top: 1px solid rgba(138, 148, 166, 0.14);
  padding: 18px 0;
}

.site-footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  font-size: 12px;
  color: var(--c-gray);
}

.site-footer__copy {
  margin-right: auto;
}

.site-footer__legal {
  display: flex;
  gap: 20px;
}

.site-footer__legal a {
  color: var(--c-gray);
  font-size: 12px;
}

.site-footer__legal a:hover {
  color: var(--c-blue);
}

.site-footer__icp {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* ---------- 返回顶部 ---------- */

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 990;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(11, 16, 38, 0.86);
  border: 1px solid rgba(0, 255, 157, 0.4);
  color: var(--c-green);
  font-size: 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--ease), transform var(--ease), background-color var(--ease), color var(--ease), border-color var(--ease);
}

.back-to-top[data-visible] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--c-green);
  color: var(--c-bg);
  border-color: var(--c-green);
}

/* ---------- 页面骨架 ---------- */

.page-hero {
  padding: 40px 0 20px;
}

.page-hero__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--c-white);
}

.page-hero__lede {
  max-width: 560px;
  margin-top: 14px;
  color: var(--c-gray);
  font-size: 15px;
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-gray);
}

.breadcrumb a {
  color: var(--c-gray);
}

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

.breadcrumb__sep::before {
  content: "//";
  color: var(--c-blue);
  opacity: 0.8;
  margin: 0 10px;
}

/* ---------- 章节与模块 ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 56px 0 24px;
}

.section-head__kicker {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-blue);
}

.section-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.2;
  color: var(--c-white);
}

.panel {
  background: linear-gradient(160deg, var(--c-card-2) 0%, var(--c-card) 65%);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  background: var(--c-green-glass);
  color: var(--c-green);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  border: 1px solid rgba(0, 255, 157, 0.25);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.tag--hot {
  background: var(--c-red-bg);
  color: #FF8A94;
  border-color: rgba(255, 71, 87, 0.35);
}

/* ---------- 网格 ---------- */

.grid {
  display: grid;
  gap: 24px;
}

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

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

/* ---------- 正文排版 ---------- */

.prose {
  max-width: 720px;
}

.prose h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.3;
  color: var(--c-white);
  margin: 40px 0 12px;
  padding-left: 14px;
  border-left: 3px solid var(--c-green);
}

.prose p {
  margin-bottom: 1em;
  color: #C5CDE0;
}

.prose strong {
  color: var(--c-white);
}

.prose a {
  color: var(--c-green);
  border-bottom: 1px solid rgba(0, 255, 157, 0.35);
}

.prose a:hover {
  color: var(--c-blue);
  border-bottom-color: var(--c-blue);
}

/* ---------- 图片占位容器 ---------- */

[data-media] {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(0, 229, 255, 0.05) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(0, 229, 255, 0.05) 0 1px, transparent 1px 24px),
    var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  min-height: 140px;
}

[data-media]::after {
  content: attr(data-caption);
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-blue);
}

[data-media="wide"] {
  aspect-ratio: 16 / 9;
}

[data-media="tall"] {
  aspect-ratio: 3 / 4;
}

[data-media="square"] {
  aspect-ratio: 1 / 1;
}

/* ---------- 显现动效 ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .nav-toggle {
    display: grid;
  }

  .site-nav {
    position: fixed;
    top: calc(var(--header-h) + 28px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px;
    margin-left: 0;
    background: rgba(11, 16, 38, 0.95);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 157, 0.25);
    border-radius: 20px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.8);
    display: none;
  }

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

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 2px;
  }

  .site-nav__link {
    justify-content: center;
    height: 44px;
  }

  .nav-cta {
    width: 100%;
    justify-content: center;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px 28px;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }

  .site-footer__col--contact {
    border-left: 0;
    padding-left: 0;
  }

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

@media (max-width: 640px) {
  #main-content {
    padding-top: calc(var(--header-h) + 22px);
  }

  .site-header {
    inset: 8px 8px auto;
  }

  .site-header__inner {
    padding: 0 8px 0 14px;
    gap: 8px;
  }

  .brand__meta {
    display: none;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 44px 0 36px;
  }

  .site-footer__bottom-inner {
    gap: 10px 18px;
  }

  .site-footer__legal {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

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

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

/* ---------- 减少动态偏好 ---------- */

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

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

  .back-to-top {
    transition: none;
  }
}
