/* ==========================================================================
   十八游戏站 — /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 命令栏 / 页脚 / 通用组件
   ========================================================================== */

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

html {
  background: #0A0D12;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, figcaption, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

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

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

a { color: inherit; }

/* --- 2. 变量 ------------------------------------------------------------- */
:root {
  /* 色板 */
  --ink: #0A0D12;          /* 曜石黑 */
  --hull: #131A24;         /* 深舱蓝黑 */
  --line: #2A3340;         /* 墨线灰 */
  --mist: #9BA7B6;         /* 雾银灰 */
  --paper: #F3F6F9;        /* 纸白 */
  --cyan: #2FE6E0;         /* 电光青 */
  --orange: #FF7A2F;       /* 霓虹橙 */
  --pulse: #3EF2A4;        /* 脉冲青绿 */
  --amber: #FFC24B;        /* 琥珀黄 */
  --deep: #0E4A57;         /* 深海青 */

  /* 尺度与节奏 */
  --header-h: 68px;
  --dur: 240ms;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --radius: 2px;

  /* 字体 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

/* --- 3. 基础排版 --------------------------------------------------------- */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(760px 460px at 8% -6%, rgba(47, 230, 224, .13), transparent 62%),
    radial-gradient(680px 430px at 96% 2%, rgba(255, 122, 47, .10), transparent 60%),
    repeating-linear-gradient(112deg, rgba(155, 167, 182, .05) 0 1px, transparent 1px 54px),
    repeating-linear-gradient(21deg, rgba(47, 230, 224, .035) 0 1px, transparent 1px 122px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.02em;
}

p { line-height: 1.85; }

a { text-decoration-color: rgba(47, 230, 224, .45); }
a:hover { text-decoration-color: var(--cyan); }

::selection { background: var(--cyan); color: #04171A; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 1px;
}

/* --- 4. 布局容器 --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 3rem);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem;
}

.stack > * + * { margin-top: var(--stack-gap, 1rem); }

/* --- 5. 文字工具 --------------------------------------------------------- */
.mono {
  font-family: var(--font-mono);
  letter-spacing: .04em;
}

.lede {
  max-width: 68ch;
  font-size: 1.0625rem;
  color: var(--mist);
}

.prose {
  max-width: 68ch;
  font-size: 1.0625rem;
}

.prose p + p { margin-top: 1.2em; }
.prose ul, .prose ol { margin-top: 1.2em; padding-left: 1.1rem; list-style: disc; }
.prose li + li { margin-top: .4em; }

/* --- 6. 面板 ------------------------------------------------------------- */
.panel {
  position: relative;
  padding: clamp(1.1rem, 2.6vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(19, 26, 36, .96), rgba(10, 13, 18, .92));
}

.panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  width: 52px;
  height: 2px;
  background: var(--cyan);
}

/* --- 7. 章节头 ----------------------------------------------------------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem 1rem;
  margin-bottom: 1.5rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.section-head__idx {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .16em;
  color: var(--cyan);
}

.section-head__title {
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -.02em;
}

.section-head__note {
  margin-left: auto;
  font-size: .8125rem;
  color: var(--mist);
}

/* --- 8. 按钮 ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--paper);
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--sm {
  padding: .48rem .85rem;
  font-size: .78125rem;
}

.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #1A0B02;
  font-weight: 700;
  box-shadow: 0 8px 22px -14px rgba(255, 122, 47, .95);
}

.btn--primary:hover {
  background: #FF9257;
  border-color: #FF9257;
}

.btn--ghost {
  color: var(--cyan);
  border-color: rgba(47, 230, 224, .42);
  background: rgba(47, 230, 224, .07);
}

.btn--ghost:hover {
  color: #B8FFFB;
  background: rgba(47, 230, 224, .15);
}

.btn--amber {
  background: var(--amber);
  border-color: var(--amber);
  color: #1A1204;
  font-weight: 700;
}

.btn--amber:hover { background: #FFD277; border-color: #FFD277; }

/* --- 9. 标签与状态灯 ----------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(19, 26, 36, .72);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--cyan { color: var(--cyan); border-color: rgba(47, 230, 224, .45); }
.tag--amber { color: var(--amber); border-color: rgba(255, 194, 75, .45); }
.tag--pulse { color: var(--pulse); border-color: rgba(62, 242, 164, .45); }

.led {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mist);
}

.led--pulse {
  background: var(--pulse);
  animation: led-pulse 2.4s var(--ease) infinite;
}

.led--amber { background: var(--amber); }

@keyframes led-pulse {
  0%, 100% { opacity: .6; box-shadow: 0 0 0 0 rgba(62, 242, 164, .5); }
  50%      { opacity: 1;  box-shadow: 0 0 0 6px rgba(62, 242, 164, 0); }
}

/* --- 10. 面包屑 ---------------------------------------------------------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--mist);
}

.crumbs a {
  color: var(--mist);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.crumbs a:hover { color: var(--cyan); }

.crumbs__sep { color: var(--line); }
.crumbs__current { color: var(--paper); }

/* --- 11. 图片容器（供页面阶段放占位图） --------------------------------- */
.img-frame {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(47, 230, 224, .12), rgba(14, 74, 87, .38) 48%, rgba(255, 122, 47, .14));
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, rgba(155, 167, 182, .06) 0 1px, transparent 1px 12px);
  pointer-events: none;
}

.img-frame > img,
.img-frame > .img-frame__slot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(10, 13, 18, .35);
}

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

.img-frame--phone > img,
.img-frame--phone > .img-frame__slot { aspect-ratio: 9 / 19; }

/* --- 12. 显现动效 -------------------------------------------------------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}

.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

/* --- 13. 命令栏 ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  background: var(--cyan);
  color: #04171A;
  font-size: .8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: top 180ms var(--ease);
}

.skip-link:focus { top: .75rem; }

.cmd-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(10, 13, 18, .9);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(42, 51, 64, .9);
  transition: box-shadow var(--dur) var(--ease);
}

.cmd-bar::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(47, 230, 224, .85),
    rgba(47, 230, 224, 0) 38%,
    rgba(255, 122, 47, 0) 62%,
    rgba(255, 122, 47, .8));
  opacity: .55;
}

.cmd-bar.is-condensed {
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, .95);
}

.cmd-bar.is-condensed .brand-text__tag { opacity: .45; }

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--pulse) 55%, var(--amber));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 120ms linear;
  pointer-events: none;
}

.cmd-bar__inner {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.75rem);
  min-height: var(--header-h);
}

/* 品牌 */
.cmd-bar__brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .7rem;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(47, 230, 224, .55);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(47, 230, 224, .2), rgba(255, 122, 47, .08));
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(155, 167, 182, .3);
  border-radius: 1px;
}

.brand-mark__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pulse);
  animation: led-pulse 2.4s var(--ease) infinite;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-decoration: none;
}

.brand-text__name {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--paper);
}

.brand-text__tag {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .1em;
  color: var(--mist);
  transition: opacity var(--dur) var(--ease);
}

/* 导航 */
.cmd-nav { margin-inline: auto; }

.cmd-nav__list {
  display: flex;
  align-items: center;
  gap: .1rem;
}

.cmd-nav__item--cta { display: none; }

.cmd-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .7rem .6rem;
  border-bottom: 2px solid transparent;
  color: var(--mist);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.cmd-nav__link:hover {
  color: var(--paper);
  background: rgba(47, 230, 224, .07);
}

.cmd-nav__link[aria-current="page"] {
  color: var(--paper);
  border-bottom-color: var(--cyan);
  background: linear-gradient(180deg, rgba(47, 230, 224, 0), rgba(47, 230, 224, .14));
}

.cmd-nav__idx {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .04em;
  color: var(--mist);
  opacity: .75;
}

.cmd-nav__link[aria-current="page"] .cmd-nav__idx {
  color: var(--cyan);
  opacity: 1;
}

.cmd-nav__gate {
  margin-left: .15rem;
  padding: .05rem .32rem;
  border-radius: var(--radius);
  background: var(--orange);
  color: #170B02;
  font-family: var(--font-mono);
  font-size: .625rem;
  letter-spacing: .1em;
}

/* 命令栏按钮组 */
.cmd-bar__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .5rem;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
  padding: .5rem .7rem;
  border: 1px solid rgba(47, 230, 224, .4);
  border-radius: var(--radius);
  background: rgba(47, 230, 224, .06);
  color: var(--cyan);
  font-family: inherit;
  font-size: .75rem;
  letter-spacing: .1em;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.nav-toggle:hover { background: rgba(47, 230, 224, .14); }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}

.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { bottom: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  transform: translateY(4.25px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* --- 14. 页脚 ------------------------------------------------------------ */
.site-foot {
  position: relative;
  margin-top: clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 26, 36, .35) 0%, rgba(19, 26, 36, .92) 42%, #080B10 100%);
}

.site-foot__aura {
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 420px;
  pointer-events: none;
  background:
    radial-gradient(620px 220px at 14% 0%, rgba(47, 230, 224, .16), transparent 70%),
    radial-gradient(520px 200px at 84% 8%, rgba(255, 122, 47, .12), transparent 70%);
}

.site-foot__top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2.1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  padding-block: clamp(2.25rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem);
}

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

.site-foot__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.site-foot__tag {
  font-size: .875rem;
  color: var(--mist);
}

.site-foot__meta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .35rem;
  padding: .3rem .6rem;
  border: 1px solid rgba(62, 242, 164, .32);
  border-radius: var(--radius);
  background: rgba(62, 242, 164, .07);
  color: var(--pulse);
  font-size: .6875rem;
  letter-spacing: .12em;
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.foot-nav__title {
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed rgba(42, 51, 64, .95);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.foot-nav__list li + li { margin-top: .5rem; }

.foot-nav__link {
  display: inline-block;
  color: var(--paper);
  font-size: .9375rem;
  text-decoration: none;
  opacity: .82;
  transition:
    opacity var(--dur) var(--ease),
    color var(--dur) var(--ease),
    padding-left var(--dur) var(--ease);
}

.foot-nav__link:hover {
  opacity: 1;
  padding-left: .25rem;
  color: var(--cyan);
}

.site-foot__contact {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  padding-block: 1.1rem;
  border-top: 1px dashed rgba(42, 51, 64, .95);
  font-size: .8125rem;
  color: var(--mist);
}

.site-foot__contact-line { color: rgba(243, 246, 249, .88); }
.site-foot__note { color: var(--mist); }

.site-foot__legal {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  padding-block: 1rem 1.75rem;
  border-top: 1px solid rgba(42, 51, 64, .7);
  font-size: .75rem;
  color: var(--mist);
}

.site-foot__legal-line {
  font-family: var(--font-mono);
  letter-spacing: .06em;
}

/* --- 15. 响应式 ---------------------------------------------------------- */
@media (max-width: 1180px) {
  .cmd-bar__actions .btn--ghost { display: none; }
}

@media (max-width: 1040px) {
  .site-foot__top { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  :root { --header-h: 62px; }

  .cmd-bar__actions { display: none; }

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

  .cmd-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: 70;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    margin-inline: 0;
    padding: 1rem clamp(1.1rem, 4vw, 2rem) 1.75rem;
    border-top: 1px solid rgba(47, 230, 224, .25);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(19, 26, 36, .99), rgba(8, 11, 16, .99));
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 220ms var(--ease),
      transform 260ms var(--ease),
      visibility 0s linear 260ms;
  }

  .cmd-nav[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition-delay: 0s, 0s, 0s;
  }

  .cmd-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
  }

  .cmd-nav__link {
    justify-content: flex-start;
    padding: .78rem .65rem;
    border-bottom: 1px solid rgba(42, 51, 64, .7);
    border-left: 2px solid transparent;
    font-size: .95rem;
  }

  .cmd-nav__link[aria-current="page"] {
    border-bottom-color: rgba(42, 51, 64, .7);
    border-left-color: var(--cyan);
    background: rgba(47, 230, 224, .1);
  }

  .cmd-nav__item--cta { display: block; margin-top: .85rem; }
  .cmd-nav__item--cta .btn { width: 100%; }

  .brand-text__tag { display: none; }
}

@media (max-width: 720px) {
  .foot-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-foot__contact { flex-direction: column; gap: .5rem; }
}

@media (max-width: 520px) {
  :root { --header-h: 58px; }
  body { font-size: 15.5px; line-height: 1.8; }
  .foot-nav { grid-template-columns: 1fr; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-text__name { font-size: 1rem; }
  .grid-12 { gap: 1rem; }
}

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

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

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

  .led--pulse,
  .brand-mark__dot {
    animation: none;
    box-shadow: 0 0 0 3px rgba(62, 242, 164, .2);
  }

  .scroll-progress { transition: none; }
}
