/* =========================================================
   沙巴看台 · 全站共享样式  /assets/site.css
   视觉取景：夜场转播席 + 数据看台（蓝图网格 / 6° 斜切 / 荧光青柠）
   ========================================================= */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Tokens ---------- */
:root {
  --ink: #050F0C;
  --stand: #0B1F19;
  --blueprint: #12332A;
  --line: #1E4A3C;
  --chalk: #E8F3EC;
  --index: #9DB3A7;
  --lime: #C6FF3D;
  --amber: #FF8A2B;
  --warn: #F5C451;
  --shade: #2C6B57;
  --line-soft: rgba(30, 74, 60, .40);
  --line-faint: rgba(30, 74, 60, .22);

  --font-display: "Barlow Condensed", "Oswald", "Roboto Condensed", "Arial Narrow",
                  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC",
               "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas,
               "Courier New", monospace;

  --cut: 22px;
  --gap: 24px;
  --radius: 2px;
  --speed: 180ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 3. Base ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, var(--line-soft) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px);
  background-size: 76px 76px;
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.32; letter-spacing: .01em; }
h1 { font-size: clamp(30px, 4.4vw, 54px); }
h2 { font-size: clamp(22px, 2.6vw, 32px); }
h3 { font-size: clamp(18px, 1.6vw, 22px); }
strong { font-weight: 600; color: var(--chalk); }

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

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

/* ---------- 4. Utilities ---------- */
.shell { width: min(1240px, 88vw); margin-inline: auto; }
.section { padding: clamp(40px, 6vw, 84px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line-faint); }
.rule { height: 1px; background: var(--line-soft); border: 0; margin: 0; }

.display {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: .1em;
  line-height: .98;
  text-transform: uppercase;
}
.mono { font-family: var(--font-mono); font-size: .84em; letter-spacing: .06em; }
.idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--index);
}
.muted { color: var(--index); }
.lime { color: var(--lime); }
.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;
}
.prose { max-width: 78ch; }
.prose p + p { margin-top: 1.1em; }

/* ---------- 5. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translate(-50%, -160%);
  z-index: 200;
  padding: 10px 18px;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .1em;
  border-radius: var(--radius);
  transition: transform var(--speed) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------- 6. Progress ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 90;
  pointer-events: none;
}

/* ---------- 7. Header ---------- */
.site-header {
  position: relative;
  z-index: 40;
  background: linear-gradient(180deg, #071510 0%, var(--ink) 100%);
  border-bottom: 1px solid var(--line);
}

.masthead {
  padding: clamp(22px, 3.2vw, 34px) 0 clamp(16px, 2.2vw, 22px);
  border-bottom: 1px dashed var(--line-soft);
}
.masthead__inner { display: flex; justify-content: center; }
.masthead__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.masthead__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(34px, 5.4vw, 64px);
  letter-spacing: .18em;
  line-height: 1;
  color: var(--chalk);
  transition: color var(--speed) var(--ease);
}
.masthead__brand:hover .masthead__name,
.masthead__brand:focus-visible .masthead__name { color: var(--lime); }
.masthead__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--index);
}

.statusbar {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 31, 25, .62);
}
.statusbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 9px 0;
}
.statusbar__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--lime);
  color: var(--ink);
}
.statusbar__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--index);
}
.statusbar__meta + .statusbar__meta::before {
  content: "/";
  margin-right: 16px;
  color: var(--line);
}
.statusbar__cta { margin-left: auto; }

.navbar {
  border-bottom: 1px solid var(--line);
  background: rgba(5, 15, 12, .88);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.standnav { display: flex; align-items: center; gap: 2px; }
.standnav > li:nth-child(1) { --d: 0ms; }
.standnav > li:nth-child(2) { --d: 40ms; }
.standnav > li:nth-child(3) { --d: 80ms; }
.standnav > li:nth-child(4) { --d: 120ms; }
.standnav > li:nth-child(5) { --d: 160ms; }
.standnav > li:nth-child(6) { --d: 200ms; }
.standnav a {
  position: relative;
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--index);
  transition: color var(--speed) var(--ease);
}
.standnav a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--speed) var(--ease);
  transition-delay: var(--d, 0ms);
}
.standnav a:hover,
.standnav a:focus-visible { color: var(--chalk); }
.standnav a:hover::after,
.standnav a:focus-visible::after,
.standnav a[aria-current="page"]::after { transform: scaleX(1); }
.standnav a[aria-current="page"] { color: var(--chalk); }

.navtoggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--chalk);
  transition: border-color var(--speed) var(--ease);
}
.navtoggle:hover { border-color: var(--shade); }
.navtoggle__bars {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--lime);
  transition: background-color var(--speed) var(--ease);
}
.navtoggle__bars::before,
.navtoggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--lime);
  transition: transform var(--speed) var(--ease);
}
.navtoggle__bars::before { top: -6px; }
.navtoggle__bars::after { top: 6px; }
.navtoggle[aria-expanded="true"] .navtoggle__bars { background: transparent; }
.navtoggle[aria-expanded="true"] .navtoggle__bars::before { transform: translateY(6px) rotate(45deg); }
.navtoggle[aria-expanded="true"] .navtoggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 880px) {
  .navbar__inner { display: block; padding: 10px 0; }
  .navtoggle { display: flex; }
  .standnav { display: none; }
  .standnav[data-open] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 10px;
    border-top: 1px solid var(--line);
  }
  .standnav[data-open] > li { border-bottom: 1px solid var(--line-faint); }
  .standnav[data-open] > li:last-child { border-bottom: 0; }
  .standnav a { padding: 15px 2px; font-size: 16px; }
  .standnav a::after { left: 2px; right: auto; width: 22px; bottom: 10px; }
}

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--chalk);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease),
              border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.btn:hover { background: var(--lime); border-color: var(--lime); color: var(--ink); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--lime { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn--lime:hover { background: #d8ff70; border-color: #d8ff70; color: var(--ink); }
.btn--ghost { border-color: var(--line-faint); color: var(--index); }
.btn--ghost:hover { background: transparent; border-color: var(--lime); color: var(--lime); }
.btn--sm {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
}

/* ---------- 9. Tags & chips ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--stand);
  color: var(--index);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
}
.tag--lime { background: var(--lime); border-color: var(--lime); color: var(--ink); font-weight: 700; }
.tag--amber { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 700; }
.tag--warn { background: var(--warn); border-color: var(--warn); color: var(--ink); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--index);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease),
              border-color var(--speed) var(--ease);
}
.chip:hover { color: var(--chalk); border-color: var(--shade); }
.chip[aria-pressed="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
  font-weight: 700;
}

/* ---------- 10. Layout helpers ---------- */
.grid { display: grid; gap: var(--gap); }
.grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 900px) {
  .grid--12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .col-3, .col-4 { grid-column: span 3; }
  .col-6, .col-8 { grid-column: span 6; }
  .col-12 { grid-column: span 6; }
}
@media (max-width: 560px) {
  .grid--12 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-3, .col-4, .col-6, .col-8, .col-12 { grid-column: span 2; }
}

/* ---------- 11. Slanted card ---------- */
.slant {
  position: relative;
  padding: 24px;
  background: var(--blueprint);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  transition: transform var(--speed) var(--ease), background-color var(--speed) var(--ease),
              box-shadow var(--speed) var(--ease);
}
.slant--alt {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
}
.slant:hover {
  transform: translateY(-4px);
  background: #164034;
  box-shadow: inset 0 0 0 1px var(--lime);
}

/* ---------- 12. Panel ---------- */
.panel {
  padding: 24px;
  background: var(--blueprint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel--stand { background: var(--stand); }

/* ---------- 13. Frame (image container) ---------- */
.frame {
  position: relative;
  overflow: hidden;
  background-color: var(--stand);
  background-image:
    linear-gradient(to right, var(--line-soft) 0 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px);
  background-size: 48px 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 15, 12, 0) 42%, rgba(5, 15, 12, .58) 100%);
}
.frame--plain::after { background: none; }
.frame--16x9 { aspect-ratio: 16 / 9; }
.frame--4x3 { aspect-ratio: 4 / 3; }
.frame--3x2 { aspect-ratio: 3 / 2; }
.frame--5x4 { aspect-ratio: 5 / 4; }
.frame--1x1 { aspect-ratio: 1 / 1; }
.frame--portrait { aspect-ratio: 3 / 4; }
.frame--wide { aspect-ratio: 21 / 9; }

/* ---------- 14. Favorite pin ---------- */
.pin {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 30px;
  height: 38px;
  display: grid;
  place-items: center;
  z-index: 5;
}
.pin__shape {
  position: absolute;
  inset: 0;
  background: var(--stand);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.pin__dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--index);
  transition: background-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.pin:hover .pin__shape { border-color: var(--shade); }
.pin[aria-pressed="true"] .pin__shape { background: var(--ink); border-color: var(--lime); }
.pin[aria-pressed="true"] .pin__dot { background: var(--lime); box-shadow: 0 0 0 4px rgba(198, 255, 61, .18); }
@keyframes pinPulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 255, 61, .55); }
  100% { box-shadow: 0 0 0 14px rgba(198, 255, 61, 0); }
}
.pin.is-pulsing .pin__dot { animation: pinPulse 1.2s var(--ease) 1; }

/* ---------- 15. Breadcrumbs ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--index);
}
.crumbs a { color: var(--index); transition: color var(--speed) var(--ease); }
.crumbs a:hover { color: var(--lime); }
.crumbs__sep { color: var(--line); }
.crumbs [aria-current="page"] { color: var(--chalk); }

/* ---------- 16. TOC ---------- */
.toc {
  position: sticky;
  top: 24px;
  padding: 20px;
  background: var(--stand);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toc__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--lime);
  margin-bottom: 14px;
}
.toc__list { display: flex; flex-direction: column; gap: 2px; }
.toc__link {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  font-size: 13px;
  color: var(--index);
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease),
              background-color var(--speed) var(--ease);
}
.toc__link:hover { color: var(--chalk); background: rgba(30, 74, 60, .28); }
.toc__link.is-current {
  color: var(--chalk);
  border-left-color: var(--lime);
  background: rgba(30, 74, 60, .34);
}
@media (max-width: 900px) { .toc { position: static; } }

/* ---------- 17. Accordion ---------- */
.accordion { border-top: 1px solid var(--line); }
.accordion__item { border-bottom: 1px solid var(--line); }
.accordion__trigger {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 18px 0;
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  color: var(--chalk);
  transition: color var(--speed) var(--ease);
}
.accordion__trigger:hover { color: var(--lime); }
.accordion__no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--index);
  flex: none;
}
.accordion__panel {
  display: none;
  padding: 0 0 20px 36px;
  border-left: 2px solid transparent;
  color: var(--index);
}
.accordion__item[data-open] > .accordion__panel {
  display: block;
  border-left-color: var(--lime);
}
.accordion__item[data-open] > .accordion__trigger { color: var(--lime); }

/* ---------- 18. Recovery strip ---------- */
.recovery {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--stand);
}
.recovery__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 16px 0;
}
.recovery__tag {
  flex: none;
  padding: 3px 8px;
  border: 1px solid rgba(255, 138, 43, .5);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--amber);
}
.recovery__text {
  flex: 1 1 260px;
  font-size: 14px;
  color: var(--index);
  max-width: 70ch;
}

/* ---------- 19. Footer ---------- */
.site-footer {
  margin-top: clamp(48px, 7vw, 96px);
  background: linear-gradient(180deg, #071510 0%, var(--ink) 62%);
  border-top: 1px solid var(--line);
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: clamp(36px, 5vw, 56px) 0 clamp(24px, 3vw, 36px);
}
.footer__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lime);
}
.footer__list > li + li { margin-top: 8px; }
.footer__list a {
  font-size: 14px;
  color: var(--index);
  transition: color var(--speed) var(--ease);
}
.footer__list a:hover { color: var(--chalk); }
.footer__plain {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  line-height: 1.9;
  color: var(--index);
  max-width: 34ch;
}
.footer__list > li.footer__plain + li.footer__plain { margin-top: 6px; }
.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 18px 0 30px;
  border-top: 1px solid var(--line-faint);
}
.footer__brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: .2em;
  color: var(--chalk);
}
.footer__legal { font-size: 12px; letter-spacing: .12em; color: var(--index); }

@media (max-width: 960px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .footer__base { flex-direction: column; align-items: flex-start; }
}

/* ---------- 20. Reveal ---------- */
[data-enhanced] [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 460ms var(--ease), transform 460ms var(--ease);
}
[data-enhanced] [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 21. Responsive shell ---------- */
@media (max-width: 900px) {
  body { background-size: 56px 56px; }
}
@media (max-width: 720px) {
  .shell { width: calc(100% - 36px); }
  body { font-size: 16px; }
  .statusbar__cta { margin-left: 0; }
  .masthead__sub { font-size: 10px; letter-spacing: .14em; }
}

/* ---------- 22. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-enhanced] [data-reveal] { opacity: 1; transform: none; }
  .progress { transition: none; }
}
