/* ==========================================================================
   梦想棋牌 · 共享样式 /assets/site.css
   ========================================================================== */

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

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

html.nav-open { overflow: hidden; }

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

ul, ol { padding: 0; list-style: none; }

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

button { font: inherit; color: inherit; background: none; border: 0; }

a { color: inherit; }

/* ---------------------------------------------------------------- 变量 */
:root {
  --abyss: #05161E;
  --abyss-deep: #031017;
  --abyss-soft: #04121A;
  --felt: #0E3B31;
  --felt-lift: #17594A;
  --gold: #E9B44C;
  --gold-pale: #F6DCA0;
  --volt: #37E2D2;
  --bone: #F4F1E6;
  --fog: #9BAFB2;
  --edge: #22424B;
  --coral: #FF8B6B;

  --rail: 72px;
  --bar: 56px;
  --gutter: 24px;
  --max: 1280px;

  --font-display: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: var(--font-display);
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --flip: 480ms;
}

/* ---------------------------------------------------------------- 基础排版 */
body {
  min-height: 100vh;
  background-color: var(--abyss);
  background-image:
    radial-gradient(ellipse 90% 60% at 8% -10%, rgba(14, 59, 49, 0.55), transparent 62%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(23, 89, 74, 0.28), transparent 60%);
  background-repeat: no-repeat;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.03em;
  color: var(--bone);
}

h1 { font-size: clamp(2.4rem, 5.2vw, 5.5rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }

strong { font-weight: 900; color: var(--gold-pale); }

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

::selection { background: var(--gold); color: var(--abyss); }

/* ---------------------------------------------------------------- 跳转链接 */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  display: inline-block;
  padding: 10px 18px;
  background: var(--gold);
  color: var(--abyss);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  transform: translateY(-220%);
  transition: transform 0.24s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--volt);
  outline-offset: -4px;
}

/* ---------------------------------------------------------------- 左侧索引条 */
.section-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 16px 0 18px;
  background-image: linear-gradient(180deg, #04121A 0%, #061A16 58%, #031017 100%);
  border-right: 1px solid var(--edge);
  overflow: hidden;
}

.rail__cap {
  flex: none;
  width: 12px;
  height: 12px;
  margin-inline: auto;
  background: var(--gold);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.rail__list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  overflow: hidden;
}

.rail__item { display: flex; }

.rail__link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 20px;
  cursor: pointer;
  color: var(--fog);
  opacity: 0.55;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: opacity 0.24s var(--ease), color 0.24s var(--ease);
}

.rail__link:hover { opacity: 0.95; color: var(--bone); }

.rail__dot {
  flex: none;
  width: 6px;
  height: 6px;
  background: currentColor;
  clip-path: polygon(2px 0, 100% 0, 100% calc(100% - 2px), calc(100% - 2px) 100%, 0 100%, 0 2px);
  transition: background 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.rail__num { font-variant-numeric: tabular-nums; }

.rail__link[aria-current="true"] {
  opacity: 1;
  color: var(--volt);
}

.rail__link[aria-current="true"] .rail__dot {
  background: var(--volt);
  box-shadow: 0 0 0 3px rgba(55, 226, 210, 0.18);
}

.rail__vert {
  flex: none;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  margin-inline: auto;
  max-height: 172px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.42em;
  color: rgba(155, 175, 178, 0.55);
}

/* ---------------------------------------------------------------- 头部 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background-image: linear-gradient(180deg, rgba(4, 18, 26, 0.98), rgba(5, 22, 30, 0.9));
  border-bottom: 1px solid var(--edge);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: var(--max);
  min-height: var(--bar);
  margin-inline: auto;
  padding: 10px var(--gutter);
}

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

.brand__glyph {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: var(--abyss);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: background 0.24s var(--ease);
}

.brand:hover .brand__glyph { background: var(--gold-pale); }

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}

.brand__mark {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand__descriptor {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--fog);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 8px 13px;
  border: 1px solid var(--edge);
  color: var(--bone);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%, 0 9px);
  transition: border-color 0.24s var(--ease), background 0.24s var(--ease);
}

.nav-toggle:hover { border-color: var(--gold); background: rgba(233, 180, 76, 0.08); }

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}

.nav-toggle__bars > span {
  display: block;
  height: 2px;
  background: var(--gold);
  transition: transform 0.26s var(--ease), opacity 0.26s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars > span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars > span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars > span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* 主导航 */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.primary-nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 10px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fog);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s var(--ease);
}

.primary-nav__link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  background: var(--volt);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s var(--ease), background 0.22s var(--ease);
}

.primary-nav__link:hover { color: var(--bone); }
.primary-nav__link:hover::after { transform: scaleX(1); }

.primary-nav__link[aria-current="page"] { color: var(--gold); font-weight: 700; }
.primary-nav__link[aria-current="page"]::after { transform: scaleX(1); background: var(--gold); }

.nav-extra { display: none; }

.nav-extra__link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--fog);
  text-decoration: none;
}

/* 头部右侧入口 */
.header-utility {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  padding-left: 14px;
  border-left: 1px solid var(--edge);
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fog);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s var(--ease);
}

.utility-link:hover { color: var(--bone); }

.utility-link--key {
  padding: 6px 12px;
  color: var(--abyss);
  background: var(--gold);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  transition: background 0.22s var(--ease);
}

.utility-link--key:hover { background: var(--gold-pale); color: var(--abyss); }

.ico { flex: none; }

/* 阅读进度条 */
.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.read-progress__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--volt);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
  box-shadow: 0 0 8px rgba(55, 226, 210, 0.6);
}

/* ---------------------------------------------------------------- 页脚 */
.site-footer {
  position: relative;
  z-index: 1;
  background-image: linear-gradient(180deg, #041319 0%, #061A16 64%, #031017 100%);
  border-top: 1px solid var(--edge);
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 48px 32px;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 72px var(--gutter) 40px;
}

.footer__brand { grid-column: span 1; }

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

.footer__tagline {
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--bone);
}

.footer__hint {
  margin-top: 10px;
  max-width: 32ch;
  font-size: 12px;
  line-height: 1.8;
  color: var(--fog);
}

.footer__col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer__link {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--fog);
  text-decoration: none;
  transition: color 0.22s var(--ease), transform 0.22s var(--ease);
}

.footer__link:hover {
  color: var(--bone);
  transform: translateX(6px);
}

.footer__contact {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  padding-top: 26px;
  border-top: 1px solid var(--edge);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--fog);
}

.footer__contact-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.footer__contact-item--wide { flex: 1 1 320px; }

.footer__contact-k {
  color: var(--felt-lift);
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.9;
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 18px var(--gutter) 26px;
  border-top: 1px solid var(--edge);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--fog);
}

/* ---------------------------------------------------------------- 通用组件 */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: 720px; }

.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--gold);
  text-transform: uppercase;
}

.lede {
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.8;
  color: var(--fog);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(246, 220, 160, 0.14);
  color: var(--gold-pale);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
}

.rule {
  height: 1px;
  border: 0;
  background: var(--edge);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gold);
  color: var(--abyss);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 0 100%, 0 11px);
  transition: background 0.24s var(--ease), color 0.24s var(--ease);
}

.btn:hover { background: var(--gold-pale); }

.btn--sm { padding: 9px 16px; font-size: 12.5px; letter-spacing: 0.1em; }

.btn--ghost {
  background: transparent;
  color: var(--bone);
  box-shadow: inset 0 0 0 1px var(--felt-lift);
}

.btn--ghost:hover {
  background: rgba(23, 89, 74, 0.5);
  color: var(--gold-pale);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.btn:focus-visible,
.card:focus-visible,
.media:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: -4px;
}

/* 切角面板 */
.card {
  position: relative;
  padding: 26px 24px;
  background: var(--felt);
  box-shadow: inset 0 0 0 1px var(--edge);
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  transition: background 0.28s var(--ease), transform 0.28s var(--ease);
}

.card:hover {
  background: var(--felt-lift);
  transform: translateY(-2px);
}

/* 筹码堆叠条目 */
.chip {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  background: var(--felt);
  box-shadow: inset 0 0 0 1px var(--edge);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
  transition: background 0.28s var(--ease), transform 0.28s var(--ease);
}

.chip:hover {
  background: var(--felt-lift);
  transform: translateY(-2px);
}

.chip__idx {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.chip__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 15px;
  line-height: 1.7;
}

/* 图片容器 */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  background-color: var(--felt);
  background-image:
    repeating-linear-gradient(135deg, rgba(34, 66, 75, 0.55) 0 1px, transparent 1px 18px),
    linear-gradient(160deg, rgba(23, 89, 74, 0.55), rgba(5, 22, 30, 0.9));
  box-shadow: inset 0 0 0 1px var(--edge);
  clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px);
}

.media > img,
.media > svg,
.media > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--wide { aspect-ratio: 16 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 3 / 4; }

.media__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--fog);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fog);
}

.breadcrumb a {
  color: var(--fog);
  text-decoration: none;
  transition: color 0.22s var(--ease);
}

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

.breadcrumb__sep { color: var(--edge); }

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

/* 显现动效 */
[data-reveal][data-reveal-ready] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* ---------------------------------------------------------------- 断点 */
@media (min-width: 1060px) {
  body { padding-left: var(--rail); }
}

@media (max-width: 1059px) {
  body { padding-bottom: 52px; }

  .section-rail {
    inset: auto 0 0 0;
    width: 100%;
    height: 52px;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0 14px;
    border-right: 0;
    border-top: 1px solid var(--edge);
    background-image: none;
    background-color: rgba(4, 18, 26, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .rail__cap { display: none; }

  .rail__list {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .rail__list::-webkit-scrollbar { display: none; }

  .rail__item { flex: none; }

  .rail__link { flex: none; padding: 6px 8px; gap: 4px; }

  .rail__vert {
    writing-mode: horizontal-tb;
    flex: none;
    margin-left: auto;
    padding-left: 10px;
    max-height: none;
    font-size: 9px;
    letter-spacing: 0.24em;
    white-space: nowrap;
  }

  .header-bar { gap: 10px; padding-inline: 16px; }

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

  .header-utility { display: none; }

  .primary-nav {
    position: fixed;
    inset: 0;
    z-index: 150;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    margin-left: 0;
    padding: 96px var(--gutter) 84px;
    overflow-y: auto;
    background-color: var(--abyss);
    background-image:
      radial-gradient(ellipse 78% 52% at 82% 12%, rgba(23, 89, 74, 0.85), transparent 62%),
      radial-gradient(ellipse 64% 48% at 6% 92%, rgba(14, 59, 49, 0.72), transparent 58%),
      repeating-linear-gradient(135deg, rgba(34, 66, 75, 0.35) 0 1px, transparent 1px 22px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }

  .primary-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
  }

  .primary-nav__link {
    display: block;
    padding: 15px 4px;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--bone);
    border-bottom: 1px solid var(--edge);
  }

  .primary-nav__link::after { display: none; }

  .primary-nav__link[aria-current="page"] {
    color: var(--gold);
    padding-left: 16px;
    border-left: 3px solid var(--gold);
  }

  .nav-extra {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
  }

  .footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 56px;
  }

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

@media (max-width: 640px) {
  :root { --gutter: 18px; }

  h1 { font-size: clamp(2rem, 9vw, 3rem); }

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

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

  .footer__contact-item--wide { flex: 1 1 100%; }

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

  .lede { font-size: 15.5px; }

  .primary-nav__link { font-size: 22px; padding: 13px 4px; }
}

/* ---------------------------------------------------------------- 减弱动效 */
@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;
  }

  [data-reveal][data-reveal-ready] { transform: none; }

  .card:hover,
  .chip:hover,
  .footer__link:hover { transform: none; }
}
