/* ==========================================================================
   百利宫新站 · 共享站点样式 /assets/site.css
   冰原坐标站：深空黑 + 极夜蓝 + 冰蓝细线 + 赤金印章 + 朱红主操作
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --ink: #0B0F14;
  --night: #12202E;
  --frost: #F4F7FB;
  --silver: #C9D6E2;
  --ice: #5FC8F0;
  --ice-deep: #1E6C8C;
  --ice-soft: rgba(95, 200, 240, 0.72);
  --gold: #D9A441;
  --cinnabar: #C43B2E;
  --cinnabar-deep: #A32C21;
  --graphite: #3A4754;
  --mint: #63E0C4;

  --line: rgba(95, 200, 240, 0.16);
  --line-strong: rgba(95, 200, 240, 0.38);
  --line-gold: rgba(217, 164, 65, 0.55);

  --rail-w: 264px;
  --coordbar-h: 34px;
  --railhead-h: 58px;

  --measure: 44em;
  --shell-max: 1320px;

  --sans: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --radius-sharp: 2px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-panel: 0 24px 60px -32px rgba(0, 0, 0, 0.9);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  padding-left: var(--rail-w);
  padding-top: var(--coordbar-h);
  background: var(--ink);
  color: var(--silver);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  transition: padding-left 0.28s var(--ease);
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sharp);
  color: var(--ice);
}

h1, h2, h3, h4 {
  color: var(--frost);
  line-height: 1.16;
  letter-spacing: -0.01em;
  font-weight: 800;
}
h1 { font-size: clamp(40px, 7vw, 112px); font-weight: 900; letter-spacing: -0.02em; line-height: 1.02; }
h2 { font-size: clamp(26px, 3.4vw, 46px); font-weight: 800; }
h3 { font-size: clamp(19px, 2vw, 27px); font-weight: 700; }
h4 { font-size: 17px; font-weight: 600; letter-spacing: 0.01em; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

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

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

/* ---------- 3. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 400;
  padding: 10px 18px;
  background: var(--gold);
  color: #16120A;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sharp);
  transform: translateY(-180%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 4. Coordinate bar ---------- */
.coordbar {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  height: var(--coordbar-h);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.4vw, 30px);
  padding: 0 clamp(14px, 3vw, 32px);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  white-space: nowrap;
  overflow: hidden;
}

.coordbar__geo { color: var(--ice); }
.coordbar__place { color: var(--silver); opacity: 0.8; }
.coordbar__stamp {
  color: var(--gold);
  padding: 2px 8px;
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-sharp);
  letter-spacing: 0.16em;
}
.coordbar__rule { flex: 1 1 auto; min-width: 16px; height: 1px; background: var(--line); }
.coordbar__updated { color: var(--graphite); letter-spacing: 0.14em; }
.coordbar__updated time {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.coordbar__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--ice), var(--gold) 72%, var(--cinnabar));
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.coordbar__geo,
.coordbar__place,
.coordbar__stamp { transition: opacity 0.24s var(--ease); }
.coordbar[data-scrolled] .coordbar__geo,
.coordbar[data-scrolled] .coordbar__place,
.coordbar[data-scrolled] .coordbar__stamp { opacity: 0.3; }

/* ---------- 5. Rail / header ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--rail-w);
  height: 100vh;
  z-index: 55;
  display: flex;
  flex-direction: column;
  background: var(--night);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand__seal {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  background: rgba(217, 164, 65, 0.09);
  box-shadow: inset 0 0 0 1px rgba(217, 164, 65, 0.18);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand__name {
  color: var(--frost);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
}
.brand__plate {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ice-soft);
  line-height: 1.2;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sharp);
  color: var(--silver);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-toggle:hover { border-color: var(--ice); color: var(--frost); }
.nav-toggle__bars { display: grid; gap: 4px; width: 18px; }
.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  background: var(--ice);
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.rail[data-open] .nav-toggle__bars i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.rail[data-open] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.rail[data-open] .nav-toggle__bars i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.rail__nav {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.navlist { display: grid; gap: 1px; }
.navlist__item { margin: 0; }
.navlist__link {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 11px 16px;
  color: var(--silver);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.navlist__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: var(--ice);
  transform: translateY(-50%);
  transition: width 0.22s var(--ease);
}
.navlist__link:hover { color: var(--frost); background: rgba(95, 200, 240, 0.07); }
.navlist__link:hover::before { width: 12px; }
.navlist__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--graphite);
  transition: color 0.18s var(--ease);
}
.navlist__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.navlist__link[aria-current="page"] {
  color: var(--frost);
  background: linear-gradient(90deg, rgba(95, 200, 240, 0.16), rgba(95, 200, 240, 0) 72%);
}
.navlist__link[aria-current="page"] .navlist__num { color: var(--gold); }
.navlist__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--gold);
}

.rail__tools {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.tool {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sharp);
  color: var(--silver);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.tool__num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ice);
}
.tool:hover { border-color: var(--ice); color: var(--frost); background: rgba(95, 200, 240, 0.08); }
.tool--key {
  border-color: rgba(196, 59, 46, 0.65);
  background: rgba(196, 59, 46, 0.16);
  color: #F6DCD8;
}
.tool--key .tool__num { color: #F2B0A6; }
.tool--key:hover { background: var(--cinnabar); border-color: var(--cinnabar); color: #FFFFFF; }

/* ---------- 6. Footer ---------- */
.foot {
  position: relative;
  margin-top: clamp(56px, 9vw, 128px);
  background: linear-gradient(180deg, var(--night), var(--ink));
  border-top: 1px solid var(--line);
}

.foot__band {
  padding: clamp(28px, 4vw, 52px) clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
}
.foot__band:last-child { border-bottom: 0; }

.foot__title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  color: var(--ice);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.foot__index { display: flex; flex-wrap: wrap; gap: 10px; }
.foot__index a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sharp);
  color: var(--silver);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.foot__index a:hover {
  border-color: var(--ice);
  color: var(--frost);
  background: rgba(95, 200, 240, 0.08);
}
.foot__index b {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ice);
}

.foot__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(22px, 3vw, 44px);
}
.foot__item { min-width: 0; }
.foot__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--graphite);
  margin-bottom: 8px;
}
.foot__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--frost);
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  margin: 0;
}
.foot__note {
  color: var(--silver);
  opacity: 0.8;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

.foot__band--legal { background: rgba(11, 15, 20, 0.6); }
.foot__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}
.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--silver);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.foot__brand .brand__seal {
  width: 26px;
  height: 26px;
  font-size: 10px;
  border-width: 1px;
  border-radius: 3px;
}
.foot__links { display: flex; flex-wrap: wrap; gap: 20px; }
.foot__links a {
  color: var(--silver);
  font-size: 13px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.foot__links a:hover { color: var(--ice); border-bottom-color: var(--ice); }
.foot__copy {
  margin: 0;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.copy {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sharp);
  color: var(--ice);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.copy:hover { border-color: var(--ice); background: rgba(95, 200, 240, 0.1); }
.copy[data-copied] { color: var(--mint); border-color: var(--mint); background: rgba(99, 224, 196, 0.12); }

/* ---------- 7. Layout helpers ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.sec { padding: clamp(48px, 7vw, 104px) clamp(20px, 4vw, 56px); }
.sec--tight { padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(28px, 4vw, 56px); }
.sec--tint { background: var(--night); }
.sec--dark { background: var(--ink); }
.sec--light { background: var(--frost); color: #16202B; }
.sec--light h2, .sec--light h3, .sec--light h4 { color: #0B0F14; }

.grid { display: grid; gap: clamp(20px, 2.6vw, 36px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.prose { max-width: var(--measure); }
.prose p { max-width: var(--measure); }

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sharp);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--silver);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.tag--gold { border-color: var(--line-gold); color: var(--gold); }
.tag--mint { border-color: rgba(99, 224, 196, 0.5); color: var(--mint); }
.tag--red { border-color: rgba(196, 59, 46, 0.7); background: var(--cinnabar); color: #FFFFFF; }

.stat { display: grid; gap: 8px; align-content: start; }
.stat__num {
  font-family: var(--mono);
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ice-soft);
  text-transform: uppercase;
}

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 12px 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sharp);
  background: transparent;
  color: var(--frost);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover { background: rgba(95, 200, 240, 0.12); border-color: var(--ice); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--cinnabar); border-color: var(--cinnabar); color: #FFFFFF; }
.btn--primary:hover { background: var(--cinnabar-deep); border-color: var(--cinnabar-deep); color: #FFFFFF; }

.btn--gold { border-color: var(--gold); color: var(--gold); }
.btn--gold:hover { background: rgba(217, 164, 65, 0.14); border-color: var(--gold); color: var(--gold); }

.btn--ghost { border-color: var(--line); color: var(--silver); }
.btn--ghost:hover { color: var(--frost); }

/* ---------- 9. Image frames ---------- */
.frame {
  position: relative;
  overflow: hidden;
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: var(--radius-sharp);
  box-shadow: var(--shadow-panel);
}
.frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
}
.frame--16x9 { aspect-ratio: 16 / 9; }
.frame--4x3 { aspect-ratio: 4 / 3; }
.frame--1x1 { aspect-ratio: 1 / 1; }
.frame--banner { aspect-ratio: 21 / 9; }

/* ---------- 10. Reveal & back-to-top ---------- */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.52s var(--ease), transform 0.52s var(--ease);
}
.reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sharp);
  background: rgba(18, 32, 46, 0.92);
  color: var(--ice);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s var(--ease), border-color 0.18s var(--ease);
}
.to-top[data-visible] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--ice); color: var(--frost); }

/* ---------- 11. Responsive ---------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --rail-w: 216px; }
  .brand__plate { display: none; }
}

@media (max-width: 1023px) {
  :root { --rail-w: 0px; }

  body { padding-left: 0; padding-top: calc(var(--coordbar-h) + var(--railhead-h)); }

  .coordbar { left: 0; }

  .rail {
    top: var(--coordbar-h);
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    height: var(--railhead-h);
    flex-direction: row;
    align-items: center;
    padding: 0 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .rail__head {
    width: 100%;
    padding: 0;
    border-bottom: 0;
    gap: 12px;
  }

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

  .rail__nav {
    position: fixed;
    top: calc(var(--coordbar-h) + var(--railhead-h));
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--coordbar-h) - var(--railhead-h));
    padding: 12px 0 20px;
    background: var(--ink);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s var(--ease);
  }

  .rail[data-open] .rail__nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .navlist__link { padding: 13px 20px; font-size: 16px; }
  .rail__tools { margin-top: 0; padding: 16px 20px 0; border-top: 1px solid var(--line); }

  .brand__seal { width: 34px; height: 34px; font-size: 11px; }
  .brand__name { font-size: 15px; }
  .brand__plate { font-size: 9px; letter-spacing: 0.16em; }
}

@media (max-width: 720px) {
  .foot__index {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
  }
  .foot__index li { flex: 0 0 auto; }
  .foot__legal { flex-direction: column; align-items: flex-start; }
  .coordbar__place,
  .coordbar__stamp { display: none; }
  .foot__value { font-size: 13px; }
  .to-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}

@media (max-width: 420px) {
  .nav-toggle__text { display: none; }
  .coordbar { letter-spacing: 0.12em; }
}

/* ---------- 12. Reduced motion ---------- */
@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;
  }
  .reveal-ready [data-reveal] { opacity: 1 !important; transform: none !important; }
  .btn:hover { transform: none; }
}
