/* ==========================================================================
   事件视界 / Black Hole Lab
   ========================================================================== */

:root {
  --bg: #030609;
  --text: #eae7df;
  --text-bright: #faf7ef;
  --muted: #949ca2;
  --line: rgba(235, 240, 242, .12);
  --line-soft: rgba(235, 240, 242, .065);
  --accent: #d9c3a0;
  --hot: #f1b26d;
  --sans: "Avenir Next", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { color: inherit; font: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 1px solid rgba(217,195,160,.9); outline-offset: 4px; }
::selection { color: #16120b; background: var(--accent); }
svg { display: block; }

/* Loading ------------------------------------------------------------------ */

.bh-loading {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: #030609; transition: opacity .7s var(--ease), visibility .7s;
}
.bh-loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.bh-loading-mark { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.bh-loading-mark i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 16px rgba(241,178,109,.8); }
.bh-loading-mark i:nth-child(1) { animation: bh-orbit 2.5s linear infinite; }
.bh-loading-mark i:nth-child(2) { animation: bh-orbit 2.5s linear infinite reverse; animation-delay: -.9s; opacity: .65; }
.bh-loading-mark i:nth-child(3) { width: 3px; height: 3px; opacity: .45; }
@keyframes bh-orbit { 0% { transform: rotate(0) translateX(23px); } 100% { transform: rotate(360deg) translateX(23px); } }
.bh-loading > span { font-family: var(--mono); font-size: 8px; letter-spacing: .18em; color: rgba(190,186,172,.7); }
.bh-loading > b { font-family: var(--mono); font-size: 7px; font-weight: 400; color: rgba(241,178,109,.65); }

/* Scene -------------------------------------------------------------------- */

.bh-scene { position: fixed; inset: 0; z-index: 0; background: #030609; }
.bh-scene canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.bh-vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 34%, rgba(3,6,9,.22) 100%),
    linear-gradient(90deg, rgba(3,6,9,.68) 0%, transparent 30%, transparent 66%, rgba(3,6,9,.6) 100%),
    linear-gradient(0deg, rgba(3,6,9,.8) 0%, transparent 23%);
}

/* Topbar ------------------------------------------------------------------- */

.bh-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 82px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 34px; pointer-events: none;
}
.bh-brand { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.bh-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(241,178,109,.36); border-radius: 50%;
  color: #efc087;
}
.bh-mark svg { width: 30px; height: 30px; }
.bh-brand-copy { display: flex; flex-direction: column; gap: 4px; }
.bh-brand-copy > span { font-size: 15px; font-weight: 500; letter-spacing: .09em; color: rgba(244,239,228,.95); }
.bh-brand-copy small { font-family: var(--mono); font-size: 6px; letter-spacing: .2em; color: rgba(155,149,137,.8); }
.bh-status {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 7px; letter-spacing: .1em;
  color: rgba(167,164,153,.75); white-space: nowrap;
}
.bh-status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 10px rgba(241,178,109,.8); }
.bh-status i { width: 26px; height: 1px; background: rgba(235,240,242,.15); }
.bh-status span:last-child { color: rgba(237,209,169,.86); }
.bh-actions { display: flex; align-items: center; gap: 5px; pointer-events: auto; }
.bh-actions a {
  display: flex; align-items: center; gap: 6px; height: 33px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(5,9,13,.52);
  font-family: var(--mono); font-size: 7.5px; color: rgba(211,205,193,.8);
  backdrop-filter: blur(13px); transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.bh-actions a span { opacity: .55; }
.bh-actions a:hover { border-color: rgba(241,178,109,.44); color: var(--text-bright); background: rgba(20,16,12,.7); }

/* Copy --------------------------------------------------------------------- */

.bh-copy { position: fixed; left: 44px; top: 132px; z-index: 8; width: 390px; max-width: 40vw; pointer-events: none; }
.bh-kicker { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 7px; letter-spacing: .16em; color: rgba(238,184,122,.8); }
.bh-kicker i { width: 5px; height: 5px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 11px rgba(241,178,109,.8); }
.bh-copy h1 {
  margin: 16px 0 0; font-family: var(--serif); font-size: clamp(50px, 5.2vw, 78px);
  font-weight: 400; line-height: 1.02; letter-spacing: .035em; color: rgba(247,243,232,.97);
}
.bh-copy h1 em { font-style: normal; color: #f0bd7a; }
.bh-copy > p { margin: 18px 0 0; max-width: 330px; font-size: 11.5px; line-height: 1.8; color: rgba(153,159,160,.92); }
.bh-readout { margin-top: 22px; display: flex; flex-direction: column; gap: 5px; width: 208px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.bh-readout span { font-family: var(--mono); font-size: 6.5px; letter-spacing: .1em; color: rgba(120,127,127,.85); }
.bh-readout b { font-family: var(--mono); font-size: 9px; font-weight: 400; color: rgba(237,213,178,.92); }
.bh-hint { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-family: var(--mono); font-size: 6.5px; letter-spacing: .05em; color: rgba(118,124,124,.7); }
.bh-hint i { width: 18px; height: 1px; background: rgba(241,178,109,.4); }

/* Panel -------------------------------------------------------------------- */

.bh-panel {
  position: fixed; top: 104px; right: 32px; bottom: 62px; z-index: 20;
  width: 356px; padding: 18px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 3px;
  background: rgba(7,9,12,.78);
  box-shadow: 0 22px 70px rgba(0,0,0,.32);
  backdrop-filter: blur(22px) saturate(.9); -webkit-backdrop-filter: blur(22px) saturate(.9);
  scrollbar-width: thin; scrollbar-color: rgba(184,154,120,.3) transparent;
  pointer-events: auto;
}
.bh-panel-head { display: flex; justify-content: space-between; gap: 10px; font-family: var(--mono); font-size: 6.5px; letter-spacing: .12em; color: rgba(145,142,133,.7); }
.bh-panel h2 { margin: 13px 0 0; font-family: var(--serif); font-size: 30px; font-weight: 400; line-height: 1.16; color: rgba(247,241,229,.97); }
.bh-panel-en { display: block; margin-top: 5px; font-family: var(--mono); font-size: 7px; letter-spacing: .15em; color: rgba(227,170,104,.72); }
.bh-panel-copy { margin: 13px 0 0; font-size: 10.5px; line-height: 1.7; color: rgba(149,154,154,.9); }
.bh-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 16px;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.bh-stats div { display: flex; flex-direction: column; gap: 4px; padding: 9px 6px; border-bottom: 1px solid rgba(235,240,242,.035); }
.bh-stats div:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line-soft); }
.bh-stats div:nth-last-child(-n+2) { border-bottom: 0; }
.bh-stats span { font-family: var(--mono); font-size: 6px; letter-spacing: .05em; color: rgba(115,122,123,.86); }
.bh-stats strong { font-family: var(--mono); font-size: 8.5px; font-weight: 400; color: rgba(226,218,204,.92); }

.bh-presets { display: flex; gap: 5px; margin-top: 14px; }
.bh-presets button {
  flex: 1; min-height: 32px; padding: 0 4px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 2px;
  background: rgba(255,255,255,.02); font-family: var(--mono); font-size: 7.5px;
  color: rgba(190,185,174,.82); transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.bh-presets button:hover, .bh-presets button.is-active {
  border-color: rgba(241,178,109,.4); background: rgba(241,178,109,.09); color: rgba(249,219,178,.96);
}

.bh-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 17px; }
.bh-control { display: flex; flex-direction: column; gap: 5px; }
.bh-control > span { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 6.5px; color: rgba(135,140,139,.8); }
.bh-control b { font-weight: 400; }
.bh-control em { font-style: normal; color: rgba(230,193,146,.86); }
.bh-control input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 15px; margin: 0; background: transparent; cursor: pointer;
}
.bh-control input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: rgba(226,179,117,.35); }
.bh-control input[type="range"]::-moz-range-track { height: 1px; background: rgba(226,179,117,.35); }
.bh-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 9px; height: 9px; margin-top: -4px;
  border-radius: 50%; background: #e4bd8c; box-shadow: 0 0 0 3px rgba(241,178,109,.12);
}
.bh-control input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: #e4bd8c; box-shadow: 0 0 0 3px rgba(241,178,109,.12); }

.bh-toggles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; }
.bh-toggles button {
  min-height: 30px; padding: 0 8px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 2px;
  background: rgba(255,255,255,.015);
  font-family: var(--mono); font-size: 6.5px; color: rgba(145,148,143,.8);
}
.bh-toggles button.is-active { border-color: rgba(241,178,109,.4); background: rgba(241,178,109,.08); color: rgba(241,216,177,.95); }
.bh-note { margin: 13px 0 0; font-size: 8px; line-height: 1.6; color: rgba(107,112,110,.7); }

/* Footer ------------------------------------------------------------------- */

.bh-footer {
  position: fixed; left: 34px; right: 34px; bottom: 18px; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  pointer-events: none;
}
.bh-legend { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 6px; letter-spacing: .03em; color: rgba(137,136,127,.65); }
.bh-legend i { width: 4px; height: 4px; border-radius: 50%; background: rgba(241,178,109,.7); }
.bh-legend i:nth-of-type(2) { background: rgba(184,204,221,.65); }
.bh-legend i:nth-of-type(3) { background: rgba(164,153,129,.65); }
.bh-footer-note { font-family: var(--mono); font-size: 5.8px; letter-spacing: .12em; color: rgba(91,97,98,.5); }

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1120px) {
  .bh-copy { left: 28px; width: 330px; }
  .bh-panel { right: 20px; width: 330px; }
  .bh-topbar { padding: 0 24px; }
  .bh-footer { left: 24px; right: 24px; }
}

@media (max-width: 900px) {
  .bh-topbar { height: 66px; padding: 0 14px; }
  .bh-mark { width: 35px; height: 35px; }
  .bh-mark svg { width: 25px; height: 25px; }
  .bh-brand-copy > span { font-size: 13px; }
  .bh-brand-copy small { font-size: 5px; }
  .bh-status { display: none; }
  .bh-actions a { height: 30px; padding: 0 8px; font-size: 6.5px; }
  .bh-actions a span { display: none; }
  .bh-copy { top: 86px; left: 17px; width: min(310px, 84vw); max-width: none; }
  .bh-copy h1 { font-size: 43px; margin-top: 12px; }
  .bh-copy > p { max-width: 290px; font-size: 10px; line-height: 1.7; }
  .bh-readout { width: 175px; margin-top: 14px; }
  .bh-hint { margin-top: 12px; }
  .bh-panel {
    top: auto; left: 8px; right: 8px; bottom: 46px;
    width: auto; max-height: min(48vh, 390px); padding: 15px;
  }
  .bh-panel h2 { font-size: 25px; }
  .bh-footer { left: 14px; right: 14px; bottom: 10px; }
  .bh-legend { display: none; }
  .bh-footer-note { font-size: 5px; }
}

@media (max-width: 560px) {
  .bh-copy { top: 78px; width: min(275px, 82vw); }
  .bh-copy h1 { font-size: 37px; }
  .bh-copy > p { font-size: 9.5px; max-width: 260px; }
  .bh-panel { bottom: 35px; max-height: min(48vh, 380px); padding: 14px; }
  .bh-panel-copy { font-size: 9.5px; }
  .bh-stats strong { font-size: 8px; }
  .bh-actions a { font-size: 6.2px; padding: 0 7px; }
  .bh-brand-copy > span { font-size: 12px; }
  .bh-footer { bottom: 7px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .bh-topbar { height: 51px; }
  .bh-copy { top: 60px; left: 14px; width: 250px; }
  .bh-copy h1 { font-size: 31px; }
  .bh-copy > p, .bh-hint { display: none; }
  .bh-panel { top: 52px; right: 8px; left: auto; bottom: auto; width: 280px; max-height: 66vh; }
  .bh-footer { display: none; }
}

.bh-panel { background: rgba(6, 9, 12, .86); }
@media (max-width: 900px) {
  .bh-panel { background: rgba(5, 8, 11, .94); }
  .bh-control > span { font-size: 7px; }
}
