/* ==========================================================================
   SEE / 知识星图
   Ink-blue star atlas, ivory stars, vermilion accents, hairline instruments.
   ========================================================================== */

:root {
  --ink: #05070d;
  --ink-2: #080d17;
  --ink-3: #0c1320;
  --paper: #f2ead7;
  --paper-soft: rgba(242, 234, 215, 0.78);
  --paper-dim: rgba(242, 234, 215, 0.52);
  --muted: rgba(160, 174, 192, 0.62);
  --line: rgba(242, 234, 215, 0.13);
  --line-soft: rgba(242, 234, 215, 0.065);
  --accent: #ff5a3c;
  --accent-soft: rgba(255, 90, 60, 0.14);
  --jade: #6fe3c1;
  --gold: #d9b36c;

  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC",
    "Source Han Serif SC", "Times New Roman", serif;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas,
    "Liberation Mono", monospace;

  --panel-w: clamp(330px, 27vw, 404px);
  --stage-right: calc(var(--panel-w) + 64px);
  --sheet-h: 46vh;
  --topbar-h: 76px;
  --status-h: 34px;
}

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

html {
  height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(ellipse 62% 58% at 40% 44%, rgba(34, 52, 76, 0.34), transparent 70%),
    radial-gradient(ellipse 38% 42% at 78% 76%, rgba(78, 48, 36, 0.13), transparent 72%),
    radial-gradient(ellipse 50% 50% at 50% 52%, #080d17 0%, #05070d 62%, #03050a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--accent);
  color: #0b0d12;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font: 600 12px/1 var(--font-sans);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

/* --------------------------------------------------------------------------
   stage / WebGL
   -------------------------------------------------------------------------- */

.stage {
  position: fixed;
  inset: 0 var(--stage-right) 0 0;
  z-index: 1;
  overflow: hidden;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 72% 70% at 50% 48%, transparent 46%, rgba(3, 5, 10, 0.5) 100%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.55) 0%, transparent 16%, transparent 82%, rgba(5, 7, 13, 0.62) 100%);
}

.cluster-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.cluster-label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--paper-dim);
  opacity: 0;
  transform: translate3d(-999px, -999px, 0);
  transition: opacity 0.7s ease;
  text-shadow: 0 1px 10px rgba(5, 7, 13, 0.9);
  will-change: transform;
}

.cluster-label.is-visible {
  opacity: 0.72;
}

.cluster-label.is-dim {
  opacity: 0.08 !important;
}

.cluster-label i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cluster-color, var(--paper));
  box-shadow: 0 0 9px var(--cluster-color, var(--paper));
  flex: 0 0 4px;
}

.cluster-label .cluster-name {
  color: var(--paper-dim);
  font-weight: 400;
}

.cluster-label b {
  color: var(--cluster-color, var(--paper));
  font-weight: 400;
  letter-spacing: 0.06em;
}

.cluster-label b::before {
  content: "/ ";
  opacity: 0.4;
}

.cluster-layer.is-quiet .cluster-label.is-visible {
  opacity: 0.16;
}

.camera-readout {
  position: absolute;
  right: 22px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: rgba(242, 234, 215, 0.28);
  pointer-events: none;
}

.camera-readout b {
  color: rgba(242, 234, 215, 0.46);
  font-weight: 400;
}

.stage-note {
  position: absolute;
  left: 50%;
  top: 55%;
  z-index: 3;
  transform: translate(-50%, -50%);
  max-width: 320px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.1em;
  color: var(--muted);
  display: none;
}

body.no-webgl .stage-note {
  display: block;
}

.stage-calibrating {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 16px rgba(5, 7, 13, 0.95);
}

.stage-calibrating::before,
.stage-calibrating::after {
  content: "";
  width: 1px;
  height: 22px;
  background: linear-gradient(180deg, transparent, rgba(242, 234, 215, 0.22), transparent);
}

.stage-calibrating span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.stage-calibrating b {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   topbar
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 32px 0 40px;
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.9) 0%, rgba(5, 7, 13, 0.45) 68%, transparent 100%);
}

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

.seal-mark {
  display: block;
  width: 70%;
  height: 70%;
  overflow: visible;
  color: currentColor;
}

.seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  background: var(--accent);
  color: #fff4e4;
  border: 1px solid rgba(255, 244, 228, 0.45);
  box-shadow:
    inset 0 0 0 3px rgba(10, 6, 4, 0.18),
    0 0 24px rgba(255, 90, 60, 0.22);
  transform: rotate(-2deg);
  user-select: none;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--paper);
  white-space: nowrap;
}

.brand-text b {
  font-weight: 600;
}

.brand-text i {
  font-style: normal;
  color: var(--accent);
  margin: 0 1px;
}

.brand-text em {
  font-style: normal;
  color: var(--paper-soft);
}

.brand-meta {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--muted);
  white-space: nowrap;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav > a,
.nav summary {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 0;
  color: var(--paper-dim);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  transition: color 0.18s ease;
}

.nav > a span,
.nav summary span {
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.18s ease;
}

.nav > a::after,
.nav summary::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav > a:hover,
.nav summary:hover,
.nav details[open] summary {
  color: var(--paper);
}

.nav > a:hover::after,
.nav summary:hover::after,
.nav details[open] summary::after {
  transform: scaleX(1);
}

.nav summary::-webkit-details-marker {
  display: none;
}

.nav-docs {
  position: relative;
}

.nav-docs summary::before {
  content: "⌄";
  position: absolute;
  right: -10px;
  top: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.nav-docs[open] summary::before {
  content: "⌃";
}

.docs-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: -14px;
  z-index: 40;
  min-width: 148px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(6, 10, 18, 0.97);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.docs-menu a {
  padding: 9px 10px;
  color: var(--paper-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  border-left: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.docs-menu a:hover {
  background: rgba(242, 234, 215, 0.04);
  border-left-color: var(--accent);
  color: var(--paper);
}

.menu-btn {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.6);
  cursor: pointer;
  position: relative;
}

.menu-btn::before,
.menu-btn::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1px;
  background: var(--paper-dim);
  transition: transform 0.2s ease, top 0.2s ease;
}

.menu-btn::before {
  top: 16px;
}

.menu-btn::after {
  top: 23px;
}

body.menu-open .menu-btn::before {
  top: 19.5px;
  transform: rotate(45deg);
}

body.menu-open .menu-btn::after {
  top: 19.5px;
  transform: rotate(-45deg);
}

/* --------------------------------------------------------------------------
   hero
   -------------------------------------------------------------------------- */

.hero {
  position: fixed;
  left: 48px;
  top: 104px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
  max-height: calc(100vh - 270px);
}

.hero-mark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-mark::after {
  content: "";
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, var(--line), transparent);
}

.seal-lg {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  transform: rotate(-3deg);
}

.hero-title {
  margin: 10px 0 0 4px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-display);
  font-size: clamp(46px, 5.1vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.17em;
  color: var(--paper);
  text-shadow:
    0 0 60px rgba(242, 234, 215, 0.1),
    0 2px 30px rgba(5, 7, 13, 0.9);
}

.hero-meta {
  width: 296px;
  margin-top: 24px;
  margin-left: 4px;
  padding: 14px 14px 10px 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.56) 0%, rgba(5, 7, 13, 0.22) 70%, transparent 100%);
  text-shadow: 0 1px 14px rgba(5, 7, 13, 0.95);
}

.hero-kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.hero-kicker b {
  color: var(--paper-soft);
  font-weight: 400;
}

.hero-sub {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--paper-dim);
}

.hero-stats {
  display: flex;
  gap: 18px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hero-stats span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stats b {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--paper-soft);
}

#sync-count {
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.sync-pill {
  position: fixed;
  top: 88px;
  left: 50%;
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 8px 12px;
  transform: translateX(-50%);
  background: rgba(5, 8, 14, 0.86);
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--paper-dim);
}

.sync-pill[hidden] {
  display: none;
}

.sync-pill-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 90, 60, 0.7);
  animation: pulse-dot 1.4s ease-out infinite;
}

.sync-pill-label {
  white-space: nowrap;
}

.sync-pill b {
  color: var(--paper-soft);
  font-weight: 400;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sync-pill-track {
  position: relative;
  width: 84px;
  height: 2px;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(242, 234, 215, 0.12);
}

.sync-pill-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 90, 60, 0.55);
  transition: width 0.25s ease;
}

.sync-pill.is-indeterminate .sync-pill-track i {
  width: 32%;
  animation: sync-slide 1.15s ease-in-out infinite;
}

@keyframes sync-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(340%);
  }
}

/* --------------------------------------------------------------------------
   catalogue
   -------------------------------------------------------------------------- */

.catalogue {
  position: fixed;
  top: 92px;
  right: 28px;
  bottom: 58px;
  width: var(--panel-w);
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(9, 14, 24, 0.82) 0%, rgba(6, 10, 17, 0.76) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
  overflow: hidden;
}

.catalogue::before {
  content: var(--page-no, "01");
  position: absolute;
  top: -34px;
  right: 6px;
  z-index: 0;
  font-family: var(--font-display);
  font-size: 132px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 234, 215, 0.055);
  pointer-events: none;
  user-select: none;
}

.catalogue::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, transparent 70%, rgba(255, 90, 60, 0.025) 100%);
}

.catalogue-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.catalogue-title {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.catalogue-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--paper-dim);
}

.dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.is-live {
  background: var(--jade);
  box-shadow: 0 0 0 0 rgba(111, 227, 193, 0.5);
  animation: pulse-dot 2.6s ease-out infinite;
}

.dot.is-sync {
  background: var(--accent);
  animation: pulse-dot 1.4s ease-out infinite;
}

.dot.is-archive {
  background: var(--gold);
}

.dot.is-cache {
  background: var(--muted);
}

.dot.is-offline {
  background: var(--accent);
}

.sheet-toggle {
  display: none;
  padding: 6px 8px;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.catalogue-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 10px 10px;
}

.catalogue-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px 8px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  color: var(--muted);
}

#query-label {
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
}

.site-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 234, 215, 0.16) transparent;
}

.site-list::-webkit-scrollbar,
.detail-inner::-webkit-scrollbar {
  width: 4px;
}

.site-list::-webkit-scrollbar-track,
.detail-inner::-webkit-scrollbar-track {
  background: transparent;
}

.site-list::-webkit-scrollbar-thumb,
.detail-inner::-webkit-scrollbar-thumb {
  background: rgba(242, 234, 215, 0.14);
}

.site-item {
  margin: 0;
  padding: 0;
  animation: row-in 0.34s both;
  animation-delay: var(--row-delay, 0ms);
}

.site-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  background: none;
  border: 0;
  border-top: 1px solid var(--line-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease;
}

.site-item:first-child .site-row {
  border-top-color: transparent;
}

.site-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.18s ease;
}

.site-row:hover,
.site-row.is-hover {
  background: rgba(242, 234, 215, 0.035);
}

.site-row:hover::before,
.site-row.is-hover::before,
.site-row.is-active::before {
  transform: scaleY(1);
}

.site-row.is-active {
  background: var(--accent-soft);
}

.site-row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  background: rgba(255, 90, 60, 0.07);
}

.row-no {
  flex: 0 0 24px;
  width: 24px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.site-row.is-active .row-no {
  color: var(--accent);
}

.row-thumb {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  overflow: hidden;
  background: var(--ink-3);
  border: 1px solid var(--line);
}

.row-thumb::after {
  content: "✳";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

.row-thumb img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.35) brightness(0.62) contrast(1.12);
  transform: scale(1.01);
  transition: opacity 0.2s ease, filter 0.22s ease, transform 0.32s ease;
}

.row-thumb img.is-loaded {
  opacity: 0.78;
}

.site-row:hover .row-thumb img,
.site-row.is-hover .row-thumb img,
.site-row.is-active .row-thumb img {
  opacity: 1;
  filter: saturate(0.9) brightness(0.98);
  transform: scale(1.06);
}

.row-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 7, 13, 0.06), rgba(5, 7, 13, 0.34));
  transition: opacity 0.2s ease;
}

.site-row:hover .row-thumb::before,
.site-row.is-hover .row-thumb::before,
.site-row.is-active .row-thumb::before {
  opacity: 0;
}

.row-thumb.is-empty img {
  display: none;
}

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--paper-soft);
  transition: color 0.16s ease;
}

.site-row:hover .row-title,
.site-row.is-hover .row-title,
.site-row.is-active .row-title {
  color: var(--paper);
}

.row-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.row-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.site-row:hover .row-arrow,
.site-row.is-hover .row-arrow {
  opacity: 1;
  transform: none;
  color: var(--accent);
}

.catalogue-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--line);
}

.pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.page-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  background: none;
  border: 1px solid transparent;
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  color: var(--paper);
  border-color: var(--line);
}

.page-btn.is-current {
  color: #0b0d12;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.page-btn:disabled {
  opacity: 0.22;
  cursor: default;
}

.page-btn[aria-label="上一页"],
.page-btn[aria-label="下一页"] {
  font-size: 13px;
  color: var(--paper-soft);
}

.page-gap {
  padding: 0 1px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.page-meta label {
  color: var(--muted);
}

.page-meta select,
#page-jump {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  padding: 3px 4px;
  border-radius: 1px;
}

#page-jump {
  width: 32px;
  text-align: center;
  -moz-appearance: textfield;
}

#page-jump::-webkit-outer-spin-button,
#page-jump::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#page-label {
  margin-left: auto;
  color: var(--paper-dim);
}

.catalogue-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 24px;
  text-align: center;
}

.empty-star {
  font-size: 34px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.55;
  margin-bottom: 4px;
}

.catalogue-empty b {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--paper-dim);
  font-weight: 400;
}

.catalogue-empty p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.8;
  color: var(--paper-dim);
}

.catalogue-empty button {
  margin-top: 8px;
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.catalogue-empty button:hover {
  border-color: var(--accent);
  color: var(--paper);
}

.catalogue-loading {
  position: absolute;
  inset: 50px 0 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 18px 18px;
  background: rgba(7, 11, 19, 0.72);
  backdrop-filter: blur(4px);
}

.skeleton-row {
  height: 56px;
  background: linear-gradient(
    90deg,
    rgba(242, 234, 215, 0.025) 0%,
    rgba(242, 234, 215, 0.065) 50%,
    rgba(242, 234, 215, 0.025) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-top: 1px solid var(--line-soft);
}

.catalogue-loading .skeleton-row:first-child {
  border-top: 0;
}

body.is-loading .catalogue-summary {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   search dock
   -------------------------------------------------------------------------- */

.search-dock {
  position: fixed;
  left: 48px;
  bottom: 58px;
  z-index: 22;
  width: min(640px, calc(100vw - var(--stage-right) - 96px));
  height: 54px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  background: rgba(5, 8, 14, 0.74);
  border: 1px solid var(--line);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search-dock::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent) 82%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s ease;
}

body.search-focus .search-dock {
  border-color: rgba(255, 90, 60, 0.28);
  background: rgba(7, 10, 18, 0.86);
}

body.detail-open .hero,
body.detail-open .search-dock {
  opacity: 0.2;
  pointer-events: none;
}

body.detail-open .hero,
body.detail-open .search-dock {
  transition: opacity 0.26s ease;
}

body.search-focus .search-dock::after {
  transform: scaleX(1);
}

.search-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: var(--paper-dim);
  stroke-width: 1.4;
  stroke-linecap: round;
}

#search {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

#search::placeholder {
  color: var(--muted);
}

#search::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--paper-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  color: var(--accent);
}

.search-dock kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.search-perf {
  min-width: 36px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--jade);
  font-variant-numeric: tabular-nums;
}

.search-perf.is-over {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   star tooltip
   -------------------------------------------------------------------------- */

.star-tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 300px;
  padding: 9px 12px;
  background: rgba(5, 8, 14, 0.92);
  border: 1px solid rgba(242, 234, 215, 0.18);
  border-left: 2px solid var(--accent);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  will-change: transform;
}

.star-tip.is-visible {
  opacity: 1;
}

.star-tip b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--paper);
}

.star-tip span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   detail
   -------------------------------------------------------------------------- */

.detail-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: linear-gradient(90deg, rgba(3, 5, 10, 0) 26%, rgba(3, 5, 10, 0.58) 100%);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.detail-scrim.is-visible {
  opacity: 1;
}

.detail {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  width: min(480px, calc(100vw - 32px));
  background: rgba(7, 11, 19, 0.95);
  border: 1px solid rgba(242, 234, 215, 0.16);
  box-shadow: -34px 0 100px rgba(0, 0, 0, 0.52);
  opacity: 0;
  visibility: hidden;
  transform: translateX(26px);
  transition: transform 0.26s cubic-bezier(0.2, 0.72, 0.2, 1), opacity 0.26s ease, visibility 0.26s;
}

.detail.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.detail-inner {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 26px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 234, 215, 0.16) transparent;
}

.detail-top {
  position: sticky;
  top: -22px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -22px -26px 0;
  padding: 18px 26px 12px;
  background: linear-gradient(180deg, rgba(7, 11, 19, 0.99) 0%, rgba(7, 11, 19, 0.94) 68%, rgba(7, 11, 19, 0) 100%);
}

.detail-no {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.detail-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.detail-close span {
  font-size: 13px;
  line-height: 1;
}

.detail-close:hover {
  color: var(--paper);
  border-color: var(--accent);
}

.detail-figure {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 8px 0 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(34, 52, 76, 0.55), transparent 70%),
    var(--ink-3);
  border: 1px solid rgba(242, 234, 215, 0.12);
}

.detail-figure::before,
.detail-figure::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.detail-figure::before {
  top: 7px;
  left: 7px;
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}

.detail-figure::after {
  right: 7px;
  bottom: 7px;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.detail-thumb,
.detail-full {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumb {
  filter: blur(18px) saturate(0.7) brightness(0.55);
  transform: scale(1.09);
}

.detail-full {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.detail-figure.is-loaded .detail-full {
  opacity: 1;
}

.detail-figure.is-missing .detail-full {
  display: none;
}

.detail-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  place-items: center;
  font-family: var(--font-display);
  font-size: 46px;
  color: rgba(242, 234, 215, 0.16);
}

.detail-figure.is-missing .detail-placeholder {
  display: grid;
}

.detail-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 90, 60, 0.5), transparent);
  opacity: 0.55;
  animation: scan-line 7s linear infinite;
  pointer-events: none;
}

.detail-figure figcaption {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 3;
  padding: 3px 6px;
  background: rgba(5, 7, 13, 0.62);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: var(--paper-dim);
}

.detail h2 {
  margin: 0 0 7px;
  font-family: var(--font-display);
  font-size: clamp(27px, 2.7vw, 36px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.detail-domain {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-meta span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.detail-meta i {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.detail-meta b {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--paper-soft);
}

.detail-desc {
  max-height: 220px;
  margin: 0 0 18px;
  overflow-y: auto;
  white-space: pre-line;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.95;
  letter-spacing: 0.015em;
  color: var(--paper-soft);
  scrollbar-width: thin;
}

.detail-desc.is-empty {
  color: var(--muted);
  font-style: italic;
}

.detail-url {
  margin-bottom: 18px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.detail-actions {
  display: flex;
  gap: 9px;
  margin-bottom: 22px;
}

.btn-primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0b0d12;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.btn-primary span {
  font-size: 15px;
  font-weight: 400;
}

.btn-primary:hover {
  background: #ff765d;
  border-color: #ff765d;
}

.btn-primary.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.btn-ghost {
  padding: 14px 15px;
  background: none;
  border: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--paper);
}

.related {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.related h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--muted);
}

#related-count {
  color: var(--accent);
}

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

.related-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 8px;
  background: none;
  border: 0;
  border-top: 1px solid var(--line-soft);
  color: var(--paper-dim);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.related-item:hover {
  background: rgba(242, 234, 215, 0.04);
  color: var(--paper);
}

.related-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 11.5px;
}

.related-item-domain {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 128px;
  z-index: 60;
  padding: 10px 16px;
  background: rgba(7, 11, 19, 0.96);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  color: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   status bar
   -------------------------------------------------------------------------- */

.statusbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: var(--status-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 32px;
  background: linear-gradient(0deg, rgba(5, 7, 13, 0.97) 0%, rgba(5, 7, 13, 0.62) 70%, transparent 100%);
  border-top: 1px solid rgba(242, 234, 215, 0.08);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.status-left a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.status-left a:hover {
  color: var(--paper-soft);
}

.status-left .police {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-left .police img {
  opacity: 0.7;
}

.perf {
  display: flex;
  gap: 10px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.perf b {
  color: var(--jade);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.perf b.is-over {
  color: var(--accent);
}

.pv b {
  color: var(--paper-dim);
  font-weight: 400;
}

.powered {
  color: rgba(242, 234, 215, 0.26);
}

/* --------------------------------------------------------------------------
   info page
   -------------------------------------------------------------------------- */

body.info-page {
  --stage-right: 540px;
}

body.info-page .hero,
body.info-page .search-dock,
body.info-page .catalogue {
  display: none !important;
}

body.info-page .stage {
  inset: 0 var(--stage-right) 0 0;
}

.info-hero {
  position: fixed;
  left: 48px;
  top: 120px;
  z-index: 15;
  pointer-events: none;
  max-width: 440px;
}

.info-hero .eyebrow {
  display: block;
  margin-bottom: 10px;
}

.info-back {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--paper-dim);
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.16s ease;
}

.info-back:hover {
  color: var(--paper);
}

.info-hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--paper);
}

.info-hero p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.9;
  color: var(--paper-dim);
}

body.info-page .detail-scrim {
  display: none;
}

body.info-page .detail {
  box-shadow: -34px 0 100px rgba(0, 0, 0, 0.4);
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(5, 7, 13, 0.96);
  text-align: center;
}

.noscript div {
  max-width: 360px;
  padding: 28px;
  border: 1px solid var(--line);
}

.noscript h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
}

.noscript p {
  margin: 0 0 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.8;
  color: var(--paper-dim);
}

.noscript a {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

body.notfound-page {
  --stage-right: 0px;
}

.notfound {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}

.notfound::before {
  content: "404";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(220px, 38vw, 620px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 234, 215, 0.045);
  pointer-events: none;
  user-select: none;
}

.notfound-inner {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  padding: 34px 34px 30px;
  text-align: left;
  background: rgba(5, 8, 14, 0.6);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.notfound-inner h1 {
  margin: 12px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 82px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.14em;
  color: var(--paper);
}

.notfound-inner p {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.95;
  color: var(--paper-dim);
}

.notfound-actions {
  display: flex;
  gap: 9px;
}

.notfound-actions .btn-primary {
  flex: 0 1 auto;
  min-width: 150px;
}

.notfound-actions .btn-ghost {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (min-width: 901px) and (max-width: 1040px) {
  .sync-pill {
    left: calc((100vw - var(--stage-right)) / 2);
  }
}

@media (max-width: 900px) {
  .notfound-inner {
    padding: 26px 22px 22px;
  }

  .notfound-inner h1 {
    font-size: 54px;
  }
}

/* --------------------------------------------------------------------------
   animations
   -------------------------------------------------------------------------- */

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(111, 227, 193, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(111, 227, 193, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(111, 227, 193, 0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes scan-line {
  0% {
    top: 0;
    opacity: 0;
  }
  8% {
    opacity: 0.55;
  }
  50% {
    top: 100%;
    opacity: 0.2;
  }
  58% {
    opacity: 0;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1220px) {
  :root {
    --panel-w: 342px;
    --stage-right: calc(var(--panel-w) + 52px);
  }

  .hero-sub {
    display: none;
  }

  .hero-meta {
    margin-top: 18px;
  }

  .topbar {
    padding-right: 24px;
  }

  .nav {
    gap: 20px;
  }
}

@media (max-width: 1040px) {
  :root {
    --panel-w: 326px;
    --stage-right: calc(var(--panel-w) + 44px);
  }

  .brand-meta {
    display: none;
  }

  .hero-title {
    font-size: clamp(42px, 5.2vw, 60px);
  }

  .search-dock {
    left: 32px;
    width: min(560px, calc(100vw - var(--stage-right) - 64px));
  }

  .hero {
    left: 32px;
  }
}

@media (max-width: 900px) {
  :root {
    --panel-w: 0px;
    --stage-right: 0px;
    --sheet-h: 46vh;
    --topbar-h: 62px;
    --status-h: 28px;
  }

  body {
    overflow: hidden;
  }

  body[data-page="index"] .stage {
    inset: 0 0 calc(var(--sheet-h) + 10px) 0;
  }

  .catalogue,
  .search-dock,
  .detail,
  .nav,
  .notfound-inner {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .catalogue {
    background: rgba(7, 11, 19, 0.97);
  }

  .search-dock {
    background: rgba(5, 8, 14, 0.94);
  }

  .detail {
    background: rgba(7, 11, 19, 0.99);
  }

  .nav {
    background: rgba(5, 7, 13, 0.99);
  }

  body[data-page="info"] .stage,
  body.notfound-page .stage {
    inset: 0;
  }

  .topbar {
    height: var(--topbar-h);
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(5, 7, 13, 0.94) 0%, rgba(5, 7, 13, 0.55) 70%, transparent 100%);
  }

  .brand-text {
    font-size: 16px;
  }

  .seal {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 10px;
  }

  .nav {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 29;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 26px 22px 120px;
    background: rgba(5, 7, 13, 0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
    overflow-y: auto;
  }

  body.menu-open .nav {
    display: flex;
  }

  .nav > a,
  .nav summary {
    width: 100%;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: 0.1em;
  }

  .nav > a span,
  .nav summary span {
    font-size: 8px;
  }

  .nav > a::after,
  .nav summary::after {
    display: none;
  }

  .nav-docs {
    width: 100%;
  }

  .nav-docs summary::before {
    right: 8px;
    top: 17px;
  }

  .docs-menu {
    position: static;
    width: 100%;
    min-width: 0;
    padding: 2px 0 8px 12px;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .docs-menu a {
    font-size: 10px;
    padding: 8px 6px;
  }

  .menu-btn {
    display: block;
  }

  .hero,
  .info-hero {
    display: none;
  }

  .catalogue {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--sheet-h);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 13px 13px 0 0;
    background: rgba(7, 11, 19, 0.93);
    transition: height 0.28s cubic-bezier(0.2, 0.72, 0.2, 1);
  }

  .catalogue::before {
    font-size: 96px;
    top: -22px;
    right: 10px;
  }

  .catalogue-head {
    padding: 12px 16px 10px;
    align-items: center;
  }

  .catalogue-title {
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .sheet-toggle {
    display: block;
  }

  body.sheet-collapsed {
    --sheet-h: 122px;
  }

  body.sheet-collapsed .catalogue-body {
    display: none;
  }

  .catalogue-body {
    padding: 0 8px calc(var(--status-h) + 6px);
  }

  .catalogue-summary {
    padding: 8px 8px 6px;
  }

  .site-row {
    padding: 8px;
  }

  .row-thumb {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .catalogue-foot {
    padding: 8px 6px 4px;
  }

  .page-btn {
    min-width: 24px;
    height: 24px;
    font-size: 8.5px;
  }

  .search-dock {
    left: 12px;
    right: 12px;
    bottom: calc(var(--sheet-h) + 10px);
    width: auto;
    height: 50px;
    padding: 0 13px;
    transition: bottom 0.28s cubic-bezier(0.2, 0.72, 0.2, 1), border-color 0.2s ease;
  }

  #search {
    font-size: 16px;
  }

  .search-dock kbd {
    display: none;
  }

  .search-perf {
    min-width: 32px;
    font-size: 8px;
  }

  .camera-readout {
    display: none;
  }

  .sync-pill {
    top: 72px;
    gap: 7px;
    padding: 7px 10px;
    background: rgba(5, 8, 14, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 8px;
  }

  .sync-pill-track {
    width: 54px;
  }

  .sync-pill-label {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stage-calibrating {
    top: 48%;
  }

  .cluster-label {
    font-size: 8px;
    letter-spacing: 0.1em;
  }

  .cluster-label:nth-child(n + 7) {
    display: none;
  }

  .statusbar {
    height: var(--status-h);
    padding: 0 12px;
    font-size: 7px;
    gap: 8px;
  }

  .status-left {
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
  }

  .status-left .police,
  .status-left a[href*="beian"],
  .pv,
  .powered {
    display: none;
  }

  .perf {
    padding-right: 8px;
    gap: 7px;
  }

  .detail {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    border: 0;
    transform: translateY(22px);
    border-radius: 0;
  }

  .detail-inner {
    padding: 16px 18px calc(30px + env(safe-area-inset-bottom));
  }

  .detail-top {
    top: -16px;
    margin: -16px -18px 0;
    padding: 14px 18px 10px;
  }

  .detail-figure {
    aspect-ratio: 16 / 10;
    margin-top: 4px;
  }

  .detail h2 {
    font-size: 28px;
  }

  .detail-desc {
    max-height: none;
  }

  .toast {
    bottom: calc(var(--sheet-h) + 68px);
  }

  body.info-page {
    --stage-right: 0px;
  }
}

@media (max-width: 520px) {
  .brand-text {
    font-size: 15px;
  }

  .catalogue-title {
    gap: 10px;
  }

  .eyebrow {
    font-size: 8px;
  }

  .catalogue-status {
    font-size: 7.5px;
  }

  .page-meta {
    font-size: 7.5px;
  }

  .status-left > span:first-child {
    display: none;
  }

  .perf span:nth-child(2) {
    display: none;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 780px) and (min-width: 901px) {
  .hero-title {
    font-size: clamp(38px, 4.2vw, 56px);
  }

  .hero-sub {
    display: none;
  }

  .hero {
    top: 92px;
  }

  .catalogue {
    top: 82px;
    bottom: 50px;
  }

  .search-dock {
    bottom: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .detail-scan {
    display: none;
  }
}
