/* =========================================================
   BEPLAY中国 全站共享样式 /assets/site.css
   结构: Reset / 变量 / 排版 / 工具 / 布局 / 头部 / 轨道导航
         / 页脚 / 通用组件 / 响应式 / 动效
   ========================================================= */

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

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

body {
  min-height: 100vh;
}

main {
  display: block;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

p {
  overflow-wrap: break-word;
}

/* ---------- 变量 ---------- */
:root {
  --space: #0A1220;
  --space-deep: #060C16;
  --track: #0D182A;
  --panel: #F5F7FB;
  --line: #1F3B57;
  --muted: #63758F;
  --signal: #F26522;
  --signal-soft: #FFE4D1;
  --text: #0B1A2A;
  --white: #FFFFFF;
  --glass: rgba(255,255,255,0.06);

  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --header-h: 64px;
  --sidebar-w: 260px;
  --shadow: 4px 4px 0 rgba(10,18,32,0.12);
  --shadow-hover: 6px 6px 0 rgba(10,18,32,0.18);
  --ease: 180ms ease;
  --content-w: 1360px;
  --page-gutter: 28px;
}

@media (min-width: 1024px) {
  :root {
    --header-h: 72px;
    --page-gutter: 40px;
  }
}

/* ---------- 基础排版 ---------- */
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--text);
  background: var(--panel);
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

strong {
  font-weight: 700;
}

a {
  transition: color var(--ease);
}

::selection {
  background: var(--signal);
  color: var(--white);
}

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.display-xl {
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.display-lg {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- 工具 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--signal);
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  border: 2px solid var(--white);
  box-shadow: 4px 4px 0 var(--space);
  transform: translateY(-300%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- 布局 ---------- */
.site-main {
  padding-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

.page-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 48px var(--page-gutter) 96px;
}

@media (min-width: 1024px) {
  body {
    padding-left: var(--sidebar-w);
  }
}

/* ---------- 头部 ---------- */
.site-header {
  position: relative;
}

.header-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--page-gutter);
  background: var(--space);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--signal);
  border: 2px solid var(--signal);
  color: var(--white);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 3px 3px 0 rgba(255,255,255,0.16);
  transition: box-shadow var(--ease), transform var(--ease);
}

.brand:hover .brand-mark {
  box-shadow: 4px 4px 0 rgba(255,255,255,0.26);
  transform: translate(-1px, -1px);
}

.brand-text {
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: 0.03em;
  line-height: 1;
}

.brand-cn {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-left: 5px;
  letter-spacing: 0.14em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collect-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 2px solid var(--line);
  color: rgba(255,255,255,0.75);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.collect-btn:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.collect-btn[aria-pressed="true"] {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--white);
}

.collect-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--muted);
  transform: rotate(45deg);
  transition: background var(--ease);
}

.collect-btn:hover .collect-icon {
  background: var(--signal);
}

.collect-btn[aria-pressed="true"] .collect-icon {
  background: var(--white);
}

.member-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 2px solid var(--signal);
  color: var(--signal);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background var(--ease), color var(--ease);
}

.member-link:hover {
  background: var(--signal);
  color: var(--white);
}

.link-arrow {
  transition: transform var(--ease);
}

.member-link:hover .link-arrow {
  transform: translateX(3px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 2px solid var(--line);
  background: transparent;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  transition: transform var(--ease), opacity var(--ease);
}

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

/* ---------- 抽屉遮罩 ---------- */
.nav-backdrop {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 140;
  background: rgba(6, 12, 22, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

/* ---------- 侧边轨道导航 ---------- */
.site-nav {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  z-index: 150;
  width: var(--sidebar-w);
  background: var(--track);
  border-right: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-nav-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px 20px 24px;
}

.nav-meta {
  padding: 0 4px 20px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 22px;
}

.nav-kicker {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav-sub {
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.02em;
}

.nav-list {
  position: relative;
}

.nav-list::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line);
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 8px 11px 30px;
  border: 2px solid transparent;
  color: rgba(255,255,255,0.68);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  transition: color var(--ease);
}

.nav-label {
  flex: 1;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--track);
  border: 2px solid var(--line);
  transition: border-color var(--ease), background var(--ease);
}

.nav-link::after {
  content: "";
  width: 0;
  height: 18px;
  background: repeating-linear-gradient(90deg, var(--signal) 0 2px, transparent 2px 5px);
  opacity: 0;
  transition: width var(--ease), opacity var(--ease);
}

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

.nav-link:hover::before,
.nav-link:focus-visible::before,
.nav-link[aria-current="page"]::before {
  border-color: var(--signal);
  background: var(--signal);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  width: 24px;
  opacity: 1;
}

.nav-link:hover .nav-num,
.nav-link[aria-current="page"] .nav-num {
  color: var(--signal);
}

.nav-link[aria-current="page"] {
  color: var(--white);
  border-color: var(--line);
  background: var(--glass);
  font-weight: 700;
}

.nav-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 2px solid var(--line);
}

.sidebar-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.sidebar-progress-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.sidebar-progress-track {
  flex: 1;
  display: block;
  height: 4px;
  background: rgba(255,255,255,0.08);
}

.sidebar-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--signal);
}

.sidebar-progress-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--white);
  min-width: 40px;
  text-align: right;
}

.nav-actions {
  display: none;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--space);
  color: var(--white);
  border-top: 2px solid var(--line);
}

.footer-top {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 64px var(--page-gutter) 48px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
}

.brand--footer {
  margin-bottom: 18px;
}

.footer-trust {
  margin-top: 18px;
  max-width: 340px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-contact-col {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.col-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--signal);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  display: inline-block;
  color: var(--muted);
  font-size: 0.875rem;
  transition: color var(--ease), transform var(--ease);
}

.footer-col a:hover {
  color: var(--signal);
  transform: translateX(3px);
}

.footer-contact {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.footer-mailnote {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  margin-top: 12px;
}

.footer-bottom {
  background: var(--space-deep);
  border-top: 2px solid var(--line);
}

.footer-bottom-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 18px var(--page-gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-copy {
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}

.footer-bottom-links a {
  color: var(--muted);
  font-size: 0.8125rem;
  transition: color var(--ease);
}

.footer-bottom-links a:hover {
  color: var(--signal);
}

.footer-bottom-links .footer-v4 {
  color: var(--signal);
  font-weight: 500;
}

.footer-bottom-links .footer-v4:hover {
  color: var(--white);
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 130;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--signal);
  background: var(--white);
  color: var(--signal);
  font-size: 1.125rem;
  font-family: var(--font-mono);
  box-shadow: var(--shadow);
  transition: background var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.back-top:hover {
  background: var(--signal);
  color: var(--white);
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.back-top[hidden] {
  display: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow);
  transition: border-color var(--ease), background var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.btn:hover {
  border-color: var(--signal);
  color: var(--signal);
  box-shadow: var(--shadow-hover);
  transform: translate(-2px, -2px);
}

.btn--primary {
  background: var(--text);
  border-color: var(--text);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--white);
}

.btn--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--white);
  box-shadow: none;
}

.btn--signal:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.28);
  color: var(--white);
  box-shadow: none;
}

.btn--ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
  box-shadow: none;
}

.btn--ghost[aria-pressed="true"] {
  border-color: var(--signal);
  color: var(--signal);
}

.btn--download {
  border-color: var(--signal);
  color: var(--signal);
}

.btn--download:hover {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--white);
  animation: borderPulse 400ms ease;
}

.btn--block {
  display: flex;
  width: 100%;
}

@keyframes borderPulse {
  0%,
  100% {
    border-color: var(--signal);
  }

  50% {
    border-color: var(--white);
  }
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 28px;
  font-size: 0.8125rem;
  color: var(--muted);
}

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

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--line);
  font-family: var(--font-mono);
}

.breadcrumb li[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

/* ---------- 章节标题 ---------- */
.section-heading {
  margin-bottom: 40px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--signal);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-heading h2 {
  margin: 0;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--signal);
  margin-right: 4px;
}

/* ---------- 内容网格 ---------- */
.grid {
  display: grid;
  gap: 28px;
}

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

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

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

/* ---------- 入口卡片 ---------- */
.entry-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--white);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}

.entry-card:hover {
  border-color: var(--signal);
  box-shadow: var(--shadow-hover);
  transform: translate(-3px, -3px);
}

.entry-num {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.entry-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.entry-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.entry-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--signal);
  font-weight: 700;
  transition: transform var(--ease);
}

.entry-card:hover .entry-arrow {
  transform: translateX(3px);
}

/* ---------- 状态标签 ---------- */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.status-tag--signal {
  border-color: var(--signal);
  background: var(--signal-soft);
  color: var(--signal);
}

/* ---------- 图片容器 ---------- */
.img-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--line);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.10) 0 25%, transparent 25% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 18px);
}

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

.img-frame--wide {
  aspect-ratio: 21 / 9;
}

.img-frame--portrait {
  aspect-ratio: 3 / 4;
}

.img-frame--square {
  aspect-ratio: 1 / 1;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1023px) {
  .collect-btn,
  .member-link {
    display: none;
  }

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

  .nav-backdrop {
    display: block;
  }

  .nav-backdrop[data-open] {
    opacity: 1;
    visibility: visible;
  }

  .site-nav {
    top: var(--header-h);
    width: min(320px, 86vw);
    border-right: 2px solid var(--signal);
    transform: translateX(-105%);
    transition: transform 230ms ease;
    box-shadow: none;
  }

  .site-nav[data-open] {
    transform: translateX(0);
    box-shadow: 14px 0 36px rgba(0,0,0,0.35);
  }

  .site-nav-inner {
    padding: 24px 20px 28px;
  }

  .nav-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
  }

  body.nav-open {
    overflow: hidden;
  }

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

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

@media (max-width: 639px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 1024px) {
  .back-top {
    right: 32px;
    bottom: 32px;
  }
}

/* ---------- 动效与偏好 ---------- */
@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;
    transition-delay: 0ms !important;
  }
}
