/* =========================================================
   A8 棋牌娱乐 · 共享样式表 /assets/site.css
   夜场编辑部：墨蓝底 + 暖纸层 + 霓虹青交互 + 切角面板
   ========================================================= */

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

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol, fieldset {
  margin: 0;
}

ul, ol { padding: 0; }

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

img { height: auto; }

button { font: inherit; }

/* ---------- 2. 设计变量 ---------- */
:root {
  --ink-900: #07111F;
  --ink-800: #0D1B2E;
  --ink-700: #102A45;
  --paper: #F4E8D0;
  --cyan: #3DE1D6;
  --violet: #8B5CF6;
  --jade: #E8C86A;
  --chip: #E45757;
  --mist: #8FA3B8;
  --white: #FFFFFF;

  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --rail: 88px;
  --header-h: 72px;
  --shell-max: 1280px;
  --radius: 2px;
  --cut: 18px;

  --line-soft: rgba(143, 163, 184, 0.22);
  --line-strong: rgba(61, 225, 214, 0.45);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. 中文排版与页面底色 ---------- */
body {
  padding-left: var(--rail);
  padding-top: var(--header-h);
  background-color: var(--ink-900);
  background-image:
    radial-gradient(1100px 520px at 88% -12%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(820px 480px at -6% 96%, rgba(61, 225, 214, 0.09), transparent 66%);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: 1.28;
  letter-spacing: 0.02em;
  font-weight: 800;
  color: var(--paper);
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  letter-spacing: 0.01em;
}

h2 {
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  padding-left: 14px;
  border-left: 3px solid var(--jade);
}

h3 {
  font-size: 1.0625rem;
  letter-spacing: 0.03em;
}

p { line-height: 1.75; }

a { color: var(--cyan); }

strong { font-weight: 700; color: var(--white); }

::selection {
  background: rgba(61, 225, 214, 0.3);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(244, 232, 208, 0.75);
}

.mono,
code, samp, kbd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

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

/* ---------- 4. 跳至主内容 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: calc(var(--rail) + 14px);
  z-index: 200;
  padding: 10px 18px;
  background: var(--paper);
  color: var(--ink-900);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  transform: translateY(-220%);
  transition: transform 160ms var(--ease);
}

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

/* ---------- 5. 头部外壳 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: var(--rail);
  right: 0;
  z-index: 120;
  background: transparent;
}

/* ---------- 6. 左侧品牌轨道 ---------- */
.brand-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 140;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px 0 24px;
  background: linear-gradient(180deg, #07111F 0%, #0A1526 52%, #050C16 100%);
  border-right: 1px solid var(--line-soft);
}

.brand-rail__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(61, 225, 214, 0.2), rgba(139, 92, 246, 0.32));
  border: 1px solid rgba(61, 225, 214, 0.55);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), calc(100% - 11px) 100%, 0 100%);
}

.brand-rail__text {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.42em;
  color: rgba(143, 163, 184, 0.9);
}

.brand-rail__ticks {
  width: 1px;
  flex: 1 1 auto;
  margin-top: auto;
  background: repeating-linear-gradient(180deg, rgba(143, 163, 184, 0.55) 0 6px, transparent 6px 15px);
  opacity: 0.6;
}

/* ---------- 7. 顶部导航条 ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  padding: 14px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease),
              box-shadow 180ms var(--ease), backdrop-filter 180ms var(--ease);
}

.site-header[data-scrolled="false"] .topbar {
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.94), rgba(7, 17, 31, 0.32));
  backdrop-filter: blur(6px);
}

.site-header[data-scrolled="true"] .topbar {
  background: rgba(7, 17, 31, 0.97);
  border-bottom-color: rgba(61, 225, 214, 0.3);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
}

/* 品牌块 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--paper);
}

.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.brand:hover .brand__mark {
  background: var(--cyan);
  color: var(--ink-900);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand__name {
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--paper);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--mist);
}

/* 主导航 */
.nav {
  display: block;
  position: relative;
}

.nav__list {
  counter-reset: navidx;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 22px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__item { counter-increment: navidx; }

.nav__item > a {
  position: relative;
  display: inline-block;
  padding: 10px 2px;
  color: rgba(244, 232, 208, 0.84);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms var(--ease);
}

.nav__item > a::before {
  content: "0" counter(navidx);
  margin-right: 7px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--violet);
  opacity: 0.85;
  transition: color 160ms var(--ease);
}

.nav__item > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms var(--ease);
}

.nav__item > a:hover,
.nav__item > a:focus-visible {
  color: var(--white);
}

.nav__item > a:hover::before,
.nav__item > a:focus-visible::before {
  color: var(--cyan);
}

.nav__item > a:hover::after,
.nav__item > a:focus-visible::after {
  transform: scaleX(1);
}

.nav__item > a[aria-current="page"] {
  color: var(--cyan);
}

.nav__item > a[aria-current="page"]::before {
  color: var(--jade);
}

.nav__item > a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* 头部动作区 */
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(13, 27, 46, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--paper);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}

.nav-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-toggle__bars {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: background-color 160ms var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 180ms var(--ease), top 180ms var(--ease);
}

.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.nav-toggle__label { line-height: 1; }

/* 阅读进度线 */
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 90ms linear;
  pointer-events: none;
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(143, 163, 184, 0.42);
  border-radius: var(--radius);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease),
              border-color 160ms var(--ease), color 160ms var(--ease),
              box-shadow 160ms var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #62C8E8 48%, var(--violet) 100%);
  border-color: transparent;
  color: #061420;
}

.btn--primary:hover {
  box-shadow: 0 12px 26px rgba(61, 225, 214, 0.3);
}

.btn--ghost {
  border-color: rgba(244, 232, 208, 0.34);
  color: rgba(244, 232, 208, 0.9);
}

.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(61, 225, 214, 0.08);
}

/* ---------- 9. 容器 / 面包屑 / 正文 ---------- */
.shell {
  width: min(100%, var(--shell-max));
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 40px);
}

.crumbs {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.crumbs li + li::before {
  content: "/";
  color: rgba(143, 163, 184, 0.5);
}

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

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

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

.prose p {
  max-width: 42ch;
  margin-bottom: 1em;
  color: rgba(244, 232, 208, 0.86);
}

.prose p:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--violet);
}

/* ---------- 10. 卡片与标签 ---------- */
.card {
  position: relative;
  padding: clamp(16px, 2vw, 24px);
  background: linear-gradient(180deg, var(--ink-800) 0%, #0A1526 100%);
  border: 1px solid var(--line-soft);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: transform 160ms var(--ease), border-color 160ms var(--ease),
              box-shadow 160ms var(--ease);
}

.card:hover,
.card:focus-within {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.42);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.6;
  color: var(--cyan);
}

.tag--jade { color: var(--jade); }
.tag--violet { color: var(--violet); }
.tag--chip { color: var(--chip); }

/* ---------- 11. 可复用图片容器（页面阶段使用） ---------- */
.figure {
  position: relative;
  display: block;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(150deg, var(--ink-800) 0%, #132238 58%, #0B1A2B 100%);
  border: 1px solid var(--line-soft);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.figure img,
.figure > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure--wide { aspect-ratio: 21 / 9; }
.figure--tall { aspect-ratio: 4 / 5; }

.figure__ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(135deg, rgba(143, 163, 184, 0.12) 0 2px, transparent 2px 12px);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
}

.figure__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--mist);
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  padding: clamp(36px, 5vw, 64px) clamp(18px, 4vw, 44px) 26px;
  background: linear-gradient(180deg, #050C16 0%, #071120 68%, #04090F 100%);
  border-top: 1px solid rgba(61, 225, 214, 0.22);
  color: rgba(244, 232, 208, 0.8);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 18px, transparent 18px 36px);
  opacity: 0.34;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.15fr;
  gap: clamp(20px, 3vw, 44px);
  width: min(100%, var(--shell-max));
  margin-inline: auto;
}

/* 品牌栏 */
.footer-brand__mark { margin-bottom: 12px; }

.footer-brand__chip {
  display: inline-block;
  padding: 4px 12px;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.footer-brand__name {
  margin-bottom: 8px;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--paper);
}

.footer-brand__desc {
  max-width: 30ch;
  margin-bottom: 12px;
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(244, 232, 208, 0.7);
}

.footer-brand__meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--mist);
}

/* 目录栏 */
.footer-col__title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(143, 163, 184, 0.2);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  color: var(--jade);
}

.footer-col__list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col__list a {
  display: inline-block;
  padding-bottom: 1px;
  color: rgba(244, 232, 208, 0.78);
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.footer-col__list a:hover,
.footer-col__list a:focus-visible {
  color: var(--cyan);
  border-bottom-color: rgba(61, 225, 214, 0.55);
}

/* 联络栏 */
.footer-contact {
  display: grid;
  gap: 2px;
  margin: 0;
}

.footer-contact dt {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  color: var(--mist);
}

.footer-contact dd {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(244, 232, 208, 0.88);
  word-break: break-word;
}

.footer-contact dd:last-child { margin-bottom: 0; }

/* 版权条 */
.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: min(100%, var(--shell-max));
  margin: clamp(28px, 4vw, 44px) auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(143, 163, 184, 0.2);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--mist);
}

.footer-base__copy { margin: 0; }

.footer-base__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-base__links a {
  color: var(--mist);
  text-decoration: none;
  transition: color 160ms var(--ease);
}

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

/* ---------- 13. 滚动显现钩子 ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 420ms var(--ease), transform 420ms var(--ease);
  }

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

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1180px) {
  .nav__item > a { font-size: 0.8125rem; }
  .nav__item > a::before { display: none; }
}

@media (max-width: 1080px) {
  .topbar__actions .btn--ghost { display: none; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

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

  .brand-rail { display: none; }

  body {
    padding-left: 0;
  }

  .site-header { left: 0; }

  .skip-link { left: 14px; }

  .topbar {
    padding: 12px clamp(14px, 4vw, 24px);
  }

  .brand__sub { display: none; }

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

  .nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    padding: 8px clamp(14px, 4vw, 24px) 18px;
    background: rgba(7, 17, 31, 0.985);
    border-bottom: 1px solid rgba(61, 225, 214, 0.26);
    box-shadow: 0 26px 48px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease),
                visibility 180ms var(--ease);
  }

  .nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__item > a {
    display: block;
    padding: 13px 4px;
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(143, 163, 184, 0.14);
  }

  .nav__item > a::before {
    display: inline;
    font-size: 0.625rem;
  }

  .nav__item > a::after { display: none; }

  .nav__item > a[aria-current="page"] {
    border-bottom-color: rgba(61, 225, 214, 0.4);
  }

  .topbar__actions { margin-left: auto; }
}

@media (max-width: 860px) {
  body { font-size: 15.5px; }

  .btn { padding: 9px 14px; font-size: 0.8125rem; }
}

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

  .footer-brand__desc { max-width: none; }

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

  .topbar__actions .btn--primary { display: none; }

  h2 { padding-left: 11px; }
}

@media (max-width: 420px) {
  .brand__name { font-size: 0.875rem; }
  .nav-toggle__label { display: none; }
}

/* ---------- 15. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  .btn:hover,
  .card:hover,
  .card:focus-within {
    transform: none;
  }

  .read-progress { transition: none; }
}
