/* ============================================================
   魔方娱乐CN — /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 页头 / 页脚 / 基础组件
   ============================================================ */

/* ---------- 1. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: #04060E;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #080A1C;
  background-image:
    radial-gradient(880px 620px at 86% -8%, rgba(255, 46, 136, .22), transparent 62%),
    radial-gradient(720px 540px at -10% 14%, rgba(43, 91, 255, .24), transparent 62%),
    radial-gradient(680px 520px at 76% 98%, rgba(22, 217, 227, .14), transparent 66%),
    linear-gradient(175deg, #0B1030 0%, #080A1C 55%, #04060E 100%);
  background-attachment: fixed;
  color: var(--fog);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: .01em;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -.01em;
}

a { color: inherit; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0B1030;
  --ink-deep: #05060F;
  --panel: #14161F;
  --panel-2: #0A0D20;
  --fog: #F2F4FF;
  --graphite: #9AA3C0;

  --magenta: #FF2E88;
  --cobalt: #2B5BFF;
  --lime: #4FF08A;
  --amber: #FFB020;
  --cyan: #16D9E3;
  --wine: #7A1F4B;

  --face: var(--magenta);
  --rail-hue: var(--magenta);
  --rail-w: 14px;

  --edge: rgba(242, 244, 255, .16);
  --edge-soft: rgba(242, 244, 255, .08);
  --edge-strong: rgba(242, 244, 255, .34);

  --font-display: "Archivo Black", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Source Han Mono", "Noto Sans Mono CJK SC", monospace;

  --shadow-hard: 8px 8px 0 0 rgba(0, 0, 0, .55);
  --shadow-hard-sm: 4px 4px 0 0 rgba(0, 0, 0, .55);
  --shadow-soft: 0 22px 46px -26px rgba(0, 0, 0, .95);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* 色相绑定协议 */
[data-face="magenta"] { --face: var(--magenta); }
[data-face="cobalt"]  { --face: var(--cobalt); }
[data-face="amber"]   { --face: var(--amber); }
[data-face="lime"]    { --face: var(--lime); }
[data-face="cyan"]    { --face: var(--cyan); }
[data-face="wine"]    { --face: var(--wine); }

/* ---------- 3. 可访问性基础 ---------- */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--lime);
  color: #04150A;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid #04150A;
  box-shadow: var(--shadow-hard-sm);
  transform: translateY(-220%);
  transition: transform .2s var(--ease);
}

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

/* ---------- 4. 中文排版与通用文字 ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: .88em;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  width: fit-content;
  margin-bottom: 1.1em;
  transform: rotate(-1.6deg);
  transform-origin: left bottom;
  text-wrap: balance;
}

.display-title em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 2px currentColor;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--graphite);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 4px;
  background: var(--face);
  flex: none;
}

.prose {
  max-width: 46ch;
  color: var(--fog);
}

.prose p { margin-bottom: 1.1em; }

.prose a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(22, 217, 227, .45);
}

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

/* ---------- 5. 布局容器与网格 ---------- */
.container {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding-block: clamp(36px, 6vw, 84px); }
.section--tight { padding-block: clamp(22px, 4vw, 48px); }

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

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

#main-content { scroll-margin-top: 140px; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  padding: .62em 1.05em;
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  border-radius: 1px;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease),
              background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease);
}

.btn--primary {
  background: var(--magenta);
  color: #16030C;
  box-shadow: var(--shadow-hard-sm), 0 0 24px -8px rgba(255, 46, 136, .95);
}

.btn--primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 rgba(0, 0, 0, .6), 0 0 32px -4px rgba(255, 46, 136, 1);
}

.btn--ghost {
  background: transparent;
  color: var(--fog);
  border-color: var(--edge-strong);
}

.btn--ghost:hover {
  transform: translate(-2px, -2px);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 4px 4px 0 0 rgba(22, 217, 227, .28);
}

.btn--cobalt { background: var(--cobalt); color: #F2F4FF; }
.btn--lime { background: var(--lime); color: #04150A; }

/* ---------- 7. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: rgba(9, 12, 34, .97);
  border-bottom: 1px solid var(--edge-soft);
}

/* 框架式导航：贯通视口的竖向边框轨道 */
.frame-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 80;
  pointer-events: none;
  background: var(--rail-hue);
  transition: background-color .3s var(--ease);
}

.frame-rail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      transparent 0 16%,
      rgba(5, 6, 15, .55) 42%,
      #05060F 72%,
      #05060F 100%);
}

.frame-rail--left { left: 0; box-shadow: inset -1px 0 0 rgba(0, 0, 0, .5); }
.frame-rail--right { right: 0; box-shadow: inset 1px 0 0 rgba(0, 0, 0, .5); }

.header__bar {
  max-width: 1320px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fog);
  min-width: 0;
}

.brand__mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border: 2px solid var(--cyan);
  box-shadow: 3px 3px 0 0 rgba(255, 46, 136, .85);
  animation: cube-spin 16s linear infinite;
}

.brand__mark::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid var(--magenta);
}

@keyframes cube-spin {
  to { transform: rotate(360deg); }
}

.brand__text { display: block; min-width: 0; }

.brand__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.06rem;
  line-height: 1.2;
  letter-spacing: .01em;
}

.brand__tag {
  display: block;
  font-size: .7rem;
  letter-spacing: .18em;
  color: var(--graphite);
}

.header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 移动导航按钮（桌面隐藏） */
.nav-toggle { display: none; }

/* 主导航 */
.site-nav {
  border-top: 1px solid var(--edge-soft);
}

.site-nav__list {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 22px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav__list::-webkit-scrollbar { display: none; }

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px 13px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--graphite);
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--ease);
}

.site-nav__face {
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--face);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .45);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: var(--face);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s var(--ease);
}

.site-nav__link:hover { color: var(--fog); }
.site-nav__link:hover .site-nav__face { transform: rotate(45deg); }
.site-nav__link:hover::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] { color: var(--fog); }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] .site-nav__face {
  transform: rotate(45deg);
  box-shadow: 0 0 14px 1px var(--face);
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(40px, 7vw, 96px);
  padding-block: 52px 24px;
  background: linear-gradient(180deg, #0A0D20 0%, #05060F 100%);
  color: var(--fog);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
      var(--magenta) 0 16.66%,
      var(--cobalt) 16.66% 33.33%,
      var(--amber) 33.33% 50%,
      var(--lime) 50% 66.66%,
      var(--cyan) 66.66% 83.33%,
      var(--wine) 83.33% 100%);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 34px 28px;
}

.footer__brand {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--fog);
  border-bottom: 3px solid var(--magenta);
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.footer__tagline {
  font-size: .92rem;
  color: var(--graphite);
  max-width: 34ch;
  margin-bottom: 14px;
}

.footer__badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: .74rem;
  color: var(--amber);
  border: 1px solid rgba(255, 176, 32, .45);
  background: rgba(255, 176, 32, .08);
}

.footer__title {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 14px;
}

.footer__list,
.footer__face-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer__face {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: .94rem;
  color: var(--fog);
  text-decoration: none;
  transition: transform .18s var(--ease), color .18s var(--ease);
}

.footer__dot {
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--face);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, .7);
}

.footer__face:hover {
  transform: translateX(4px);
  color: var(--face);
}

.footer__link {
  display: inline-block;
  padding: 5px 0;
  font-size: .94rem;
  color: var(--graphite);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.footer__link:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.footer__addr {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--graphite);
  padding: 4px 0;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--edge-soft);
}

.footer__note,
.footer__copy {
  margin: 0;
  font-size: .8rem;
  color: var(--graphite);
}

.footer__note { color: var(--amber); }

/* ---------- 9. 基础组件 ---------- */
.card {
  position: relative;
  padding: 20px;
  background: var(--panel);
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-hard);
}

.card--hue {
  border-color: var(--face);
  box-shadow: 8px 8px 0 0 rgba(0, 0, 0, .6), 0 0 30px -22px var(--face);
}

.panel {
  padding: clamp(18px, 3vw, 30px);
  background: rgba(20, 22, 31, .78);
  border: 2px solid var(--edge-soft);
  box-shadow: var(--shadow-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .05em;
  color: var(--fog);
  background: rgba(242, 244, 255, .07);
  border: 1px solid var(--edge);
}

.chip--hue {
  color: var(--face);
  border-color: var(--face);
  background: transparent;
}

.breadcrumb {
  padding-top: 18px;
  font-size: .82rem;
  color: var(--graphite);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.breadcrumb li + li::before {
  content: "/";
  color: var(--edge-strong);
}

.breadcrumb a {
  color: var(--graphite);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.breadcrumb a:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

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

/* 可复用响应式图片容器（页面阶段放入图片） */
.media-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-hard);
  background:
    linear-gradient(140deg,
      rgba(43, 91, 255, .22) 0%,
      rgba(255, 46, 136, .18) 46%,
      rgba(20, 22, 31, .9) 100%);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(242, 244, 255, .1);
  pointer-events: none;
}

.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame__img,
.media-frame > img,
.media-frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  font-size: .78rem;
  color: var(--fog);
  background: linear-gradient(180deg, transparent 0%, rgba(5, 6, 15, .94) 100%);
}

/* 入场显现 */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

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

/* 顶部滚动进度条（由 JS 注入） */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 90;
  pointer-events: none;
  background: linear-gradient(90deg,
      var(--magenta), var(--amber), var(--lime), var(--cyan), var(--cobalt));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- 10. 响应式 ---------- */
@media (min-width: 1024px) {
  .container,
  .header__bar,
  .site-nav__list {
    padding-inline: calc(var(--rail-w) + 26px);
  }
}

@media (max-width: 1023px) {
  .frame-rail { display: none; }
  .grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  body {
    background-attachment: scroll;
    padding-bottom: 64px;
    font-size: 15px;
  }

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

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__col--brand { grid-column: 1 / -1; }

  /* 页头 */
  .header__bar { padding: 10px 16px; gap: 10px; }
  .brand__mark { width: 28px; height: 28px; box-shadow: 2px 2px 0 0 rgba(255, 46, 136, .85); }
  .brand__tag { display: none; }
  .brand__name { font-size: .98rem; }
  .btn--ghost { display: none; }
  .btn--primary { padding: .5em .85em; font-size: .82rem; }

  /* 底部六面色条作为移动导航按钮 */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 56px;
    padding: 0 16px;
    z-index: 88;
    background: rgba(10, 13, 32, .98);
    border: 0;
    border-top: 2px solid var(--edge-strong);
    color: var(--fog);
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
  }

  .nav-toggle__stripes { display: flex; gap: 3px; }

  .nav-toggle__stripes i {
    display: block;
    width: 14px;
    height: 14px;
  }

  .nav-toggle__stripes i:nth-child(1) { background: var(--magenta); }
  .nav-toggle__stripes i:nth-child(2) { background: var(--cobalt); }
  .nav-toggle__stripes i:nth-child(3) { background: var(--amber); }
  .nav-toggle__stripes i:nth-child(4) { background: var(--lime); }
  .nav-toggle__stripes i:nth-child(5) { background: var(--cyan); }
  .nav-toggle__stripes i:nth-child(6) { background: var(--wine); }

  .nav-toggle[aria-expanded="true"] {
    border-top-color: var(--magenta);
    background: rgba(20, 22, 31, .99);
  }

  /* 向上展开的栏目面板 */
  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 56px;
    z-index: 87;
    max-height: 72vh;
    overflow-y: auto;
    background: #0A0D20;
    border-top: 3px solid var(--magenta);
    border-bottom: 1px solid var(--edge-soft);
    box-shadow: 0 -26px 50px -30px rgba(0, 0, 0, 1);
    transform: translateY(115%);
    visibility: hidden;
    transition: transform .3s var(--ease), visibility .3s var(--ease);
  }

  .site-nav[data-open] {
    transform: translateY(0);
    visibility: visible;
  }

  .site-nav__list {
    flex-direction: column;
    padding: 10px 14px 20px;
    gap: 0;
    overflow: visible;
  }

  .site-nav__item { border-bottom: 1px solid var(--edge-soft); }

  .site-nav__link {
    width: 100%;
    padding: 15px 12px 15px 18px;
    font-size: 1rem;
    color: var(--fog);
  }

  .site-nav__link::after {
    left: 0;
    right: auto;
    top: 9px;
    bottom: 9px;
    width: 4px;
    height: auto;
    transform: scaleY(0);
    transform-origin: top center;
  }

  .site-nav__link:hover::after,
  .site-nav__link[aria-current="page"]::after { transform: scaleY(1); }

  .site-nav__link[aria-current="page"] { background: rgba(242, 244, 255, .05); }
}

@media (max-width: 599px) {
  .container { padding-inline: 16px; }
  .grid--2,
  .grid--3,
  .grid--6 { grid-template-columns: minmax(0, 1fr); }
  .footer__grid { grid-template-columns: minmax(0, 1fr); }
  .display-title { transform: rotate(-1.2deg); }
  .card { box-shadow: 5px 5px 0 0 rgba(0, 0, 0, .55); }
}

/* ---------- 11. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .brand__mark { animation: none; }

  .scroll-progress { transition: none; }
}
