/* ==========================================================================
   澳门第一娱乐 — 共享基础样式 /assets/site.css
   轨道导航 · 档案索引 · 霓虹墨蓝
   ========================================================================== */

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

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

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

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

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

a { color: inherit; }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink-950: #04060e;
  --ink-900: #070b16;
  --ink-800: #0c1324;
  --ink-700: #131c33;
  --ink-600: #1d2a47;

  --paper: #f3efe6;
  --text: #dbe3f2;
  --dim: #8895b1;
  --dim-2: #5f6b86;

  --gold: #d7b164;
  --gold-deep: #a9822f;
  --rose: #ff3f7e;
  --jade: #2ad9a8;

  --line: rgba(160, 185, 230, 0.14);
  --line-strong: rgba(160, 185, 230, 0.3);

  --rail-w: 272px;
  --wrap: 1220px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.22, 0.7, 0.28, 1);

  --scroll: 0;
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  letter-spacing: 0.01em;
  background-color: var(--ink-950);
  background-image:
    linear-gradient(rgba(160, 185, 230, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 185, 230, 0.032) 1px, transparent 1px),
    radial-gradient(760px 460px at 88% -6%, rgba(255, 63, 126, 0.1), transparent 62%),
    radial-gradient(700px 560px at 100% 88%, rgba(42, 217, 168, 0.07), transparent 62%),
    linear-gradient(180deg, #04060e 0%, #070b16 42%, #04060e 100%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}

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

p { text-wrap: pretty; }

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

code, kbd, samp { font-family: var(--mono); font-size: 0.92em; }

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

/* ---------- 4. 焦点与无障碍 ---------- */
:focus-visible {
  outline: 2px solid var(--jade);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 200;
  padding: 11px 18px;
  background: var(--gold);
  color: var(--ink-950);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}

.skip-link:focus {
  top: 14px;
}

#main-content:focus { outline: none; }

/* ---------- 5. 侧边轨道头部 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, #070c1a 0%, #0b1324 46%, #05080f 100%);
  border-right: 1px solid var(--line-strong);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.rail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: calc(var(--scroll) * 1%);
  max-height: 100%;
  background: linear-gradient(180deg, var(--jade), var(--gold) 55%, var(--rose));
  transition: height 0.08s linear;
  pointer-events: none;
}

.rail__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e6c77e 0%, var(--gold) 42%, var(--gold-deep) 100%);
  color: #06090f;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}

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

.brand__name {
  color: var(--paper);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.06em;
}

.brand__sub {
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.rail__toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  cursor: pointer;
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.rail__toggle:hover { border-color: var(--gold); color: var(--gold); }

.toggle-bars {
  display: grid;
  gap: 4px;
  width: 16px;
}

.toggle-bars i {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.rail[data-open] .toggle-bars i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.rail[data-open] .toggle-bars i:nth-child(2) { opacity: 0; }
.rail[data-open] .toggle-bars i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* 索引导航 */
.rail__nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.rail__nav-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--dim-2);
}

.nav-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.nav-list__item { border-bottom: 1px solid var(--line); }

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 8px 12px 14px;
  text-decoration: none;
  color: var(--dim);
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  background: var(--gold);
  opacity: 0;
  transform: scaleY(0.25);
  transform-origin: top center;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-link__num {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(215, 177, 100, 0.5);
  transition: color 0.16s var(--ease);
}

.nav-link__label {
  font-size: 15px;
  letter-spacing: 0.05em;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  background: linear-gradient(90deg, rgba(215, 177, 100, 0.09), transparent 78%);
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  opacity: 0.45;
  transform: scaleY(1);
}

.nav-link[aria-current="page"] {
  color: var(--paper);
  background: linear-gradient(90deg, rgba(255, 63, 126, 0.12), transparent 82%);
}

.nav-link[aria-current="page"]::before {
  opacity: 1;
  transform: scaleY(1);
  background: var(--rose);
}

.nav-link[aria-current="page"] .nav-link__num { color: var(--rose); }

/* 轨道底部 */
.rail__foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.rail__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.rail__dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  background: var(--jade);
  box-shadow: 0 0 10px rgba(42, 217, 168, 0.85);
  animation: railPulse 2.6s ease-in-out infinite;
}

@keyframes railPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

.rail__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--paper);
  border: 1px solid rgba(215, 177, 100, 0.45);
  background: linear-gradient(100deg, rgba(215, 177, 100, 0.16), rgba(255, 63, 126, 0.1));
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.rail__cta::after {
  content: "→";
  font-family: var(--mono);
  color: var(--gold);
  transition: color 0.2s var(--ease);
}

.rail__cta:hover,
.rail__cta:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-950);
}

.rail__cta:hover::after,
.rail__cta:focus-visible::after { color: var(--ink-950); }

/* ---------- 6. 页脚 ---------- */
.site-foot {
  position: relative;
  margin-top: 88px;
  padding: 56px 32px 26px;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(10, 17, 34, 0.86), rgba(4, 6, 14, 0.98));
}

.site-foot::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 36%;
  height: 1px;
  background: linear-gradient(90deg, var(--rose), var(--gold) 62%, transparent);
}

.site-foot__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.45fr 0.9fr 1fr 1.5fr;
  gap: 36px;
}

.foot-block { min-width: 0; }

.foot-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--paper);
}

.foot-desc {
  margin-top: 10px;
  max-width: 34ch;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--dim);
}

.foot-icp {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim-2);
}

.foot-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--gold);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.foot-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot-list a {
  display: inline-block;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.foot-list a:hover,
.foot-list a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.foot-data {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 14px;
  font-size: 13.5px;
}

.foot-data dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim-2);
  padding-top: 3px;
  white-space: nowrap;
}

.foot-data dd {
  color: var(--text);
  word-break: break-word;
}

.site-foot__base {
  max-width: var(--wrap);
  margin: 44px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.foot-copy,
.foot-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--dim-2);
}

/* ---------- 7. 通用布局 ---------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

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

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.lede {
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}

.prose {
  max-width: 68ch;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text);
}

.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 22px; margin-top: 1.8em; }
.prose h3 { font-size: 18px; margin-top: 1.6em; }
.prose ul,
.prose ol { padding-left: 1.3em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.5em; }
.prose a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(215, 177, 100, 0.5);
}
.prose a:hover { border-bottom-color: var(--gold); }

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------- 8. 章节标题 ---------- */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-strong);
}

.sec-head__kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold);
}

.sec-head__title {
  margin-top: 7px;
  font-size: clamp(22px, 2.6vw, 32px);
}

/* ---------- 9. 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim-2);
}

.crumbs li {
  display: flex;
  align-items: center;
}

.crumbs li::after {
  content: "/";
  margin: 0 10px;
  color: rgba(215, 177, 100, 0.42);
}

.crumbs li:last-child::after { display: none; }

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

.crumbs a:hover,
.crumbs a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

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

/* ---------- 10. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-950);
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- 11. 卡片 / 档案夹 / 面板 ---------- */
.card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(19, 28, 51, 0.9), rgba(8, 12, 24, 0.92));
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
  pointer-events: none;
}

.card:hover { border-color: rgba(215, 177, 100, 0.45); }

.folder {
  position: relative;
  margin-top: 24px;
  border: 1px solid var(--line);
  background: rgba(12, 19, 36, 0.76);
}

.folder__tab {
  position: absolute;
  top: -23px;
  left: -1px;
  padding: 4px 16px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: rgba(12, 19, 36, 0.96);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
}

.folder__body { padding: 24px; }

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 26, 0.7);
}

/* ---------- 12. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(215, 177, 100, 0.4);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--gold);
  white-space: nowrap;
}

.tag--rose { border-color: rgba(255, 63, 126, 0.45); color: var(--rose); }
.tag--jade { border-color: rgba(42, 217, 168, 0.45); color: var(--jade); }

/* ---------- 13. 筛选按钮 ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background-color 0.16s var(--ease);
}

.filter:hover,
.filter:focus-visible {
  color: var(--paper);
  border-color: var(--gold);
}

.filter[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-950);
}

/* ---------- 14. 图片容器 ---------- */
.media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #0d1striped, #0a1020);
  background-color: #0a1020;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(243, 239, 230, 0.05);
  pointer-events: none;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--wide { aspect-ratio: 21 / 9; }

.media__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 6, 14, 0.06) 40%, rgba(4, 6, 14, 0.86) 100%);
}

.media__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  padding: 14px 16px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--paper);
}

/* ---------- 15. 表格 ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: top;
}

.table tbody tr { transition: background-color 0.16s var(--ease); }
.table tbody tr:hover { background: rgba(215, 177, 100, 0.055); }
.table .num { color: var(--paper); }

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

html.js-on [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

/* ---------- 17. 响应式 ---------- */
@media (min-width: 1600px) {
  :root { --rail-w: 300px; }
}

@media (max-width: 1100px) {
  .site-foot__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  body { padding-left: 0; }

  .rail {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    gap: 0;
    padding: 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
    background: rgba(6, 10, 20, 0.97);
  }

  .rail::before {
    top: auto;
    bottom: 0;
    left: 0;
    width: calc(var(--scroll) * 1%);
    height: 2px;
    max-height: none;
    background: linear-gradient(90deg, var(--jade), var(--gold) 55%, var(--rose));
    transition: width 0.08s linear;
  }

  .rail__brand { padding: 12px 16px; }
  .rail__toggle { display: inline-flex; }

  .rail__nav {
    display: none;
    flex: 0 0 auto;
    padding: 14px 16px 6px;
    border-top: 1px solid var(--line);
    min-height: 0;
  }

  .rail[data-open] .rail__nav {
    display: flex;
    animation: navDrop 0.22s var(--ease);
  }

  .rail__foot {
    display: none;
    padding: 12px 16px 18px;
    border-top: 0;
  }

  .rail[data-open] .rail__foot { display: flex; }

  .nav-link { padding: 13px 6px 13px 12px; }
  .brand__mark { flex-basis: 38px; width: 38px; height: 38px; font-size: 20px; }

  .wrap { padding: 0 20px; }
  .site-foot { padding: 46px 20px 24px; margin-top: 64px; }

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

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .site-foot__inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .site-foot__base { flex-direction: column; align-items: flex-start; }
  .folder__body, .panel, .card { padding: 18px; }
  .sec-head { gap: 10px; }
}

/* ---------- 18. 动效偏好 ---------- */
@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;
  }

  html.js-on [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
