:root {
  --bg: #02070a;
  --bg-soft: #061116;
  --panel: rgba(5, 18, 24, 0.9);
  --panel-strong: rgba(3, 12, 18, 0.96);
  --line: rgba(32, 217, 255, 0.34);
  --line-soft: rgba(32, 217, 255, 0.16);
  --cyan: #20d9ff;
  --cyan-bright: #8cf1ff;
  --cyan-dim: rgba(32, 217, 255, 0.66);
  --text: #e8fbff;
  --muted: rgba(232, 251, 255, 0.62);
  --faint: rgba(232, 251, 255, 0.38);
  --danger: #ff4f6d;
  --warning: #ffc857;
  --ok: #63f7a1;
  --violet: #b28cff;
  --shadow: 0 0 24px rgba(32, 217, 255, 0.16);
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(rgba(32, 217, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 217, 255, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(32, 217, 255, 0.11), transparent 34rem),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
  color: var(--text);
  font-family: "JetBrains Mono", "Noto Sans TC", "Microsoft JhengHei", Consolas, monospace;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
  opacity: 0.28;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 49;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent, rgba(32, 217, 255, 0.08), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 16%, transparent 84%, rgba(255, 255, 255, 0.02));
  animation: scanSweep 8s linear infinite;
  opacity: 0.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

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

::selection {
  background: var(--cyan);
  color: #001014;
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  isolation: isolate;
}

.star-map {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.star-point {
  position: absolute;
  width: var(--star-size, 2px);
  height: var(--star-size, 2px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 7px rgba(255, 255, 255, 0.78),
    0 0 13px rgba(32, 217, 255, 0.34);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75);
  animation: starScanReveal 8s linear infinite;
  animation-delay: var(--scan-delay, 0s);
}

.star-map.is-resetting .star-point {
  animation: none;
}

.star-point.is-bright {
  background: #ffffff;
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.95),
    0 0 18px rgba(32, 217, 255, 0.5);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(2, 7, 10, 0.88);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(32, 217, 255, 0.05);
  filter: drop-shadow(0 0 12px rgba(32, 217, 255, 0.32));
}

.brand-copy {
  display: grid;
  gap: 0;
}

.brand-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--cyan-dim);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}

.nav-link,
.terminal-btn,
.module-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(3, 15, 20, 0.58);
  color: var(--cyan-bright);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-link {
  min-height: 34px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.terminal-btn:hover,
.module-btn:hover,
.nav-link:hover,
.archive-card:hover {
  border-color: var(--cyan-bright);
  background: rgba(32, 217, 255, 0.11);
  box-shadow: var(--shadow);
  color: var(--text);
  transform: translateY(-1px);
}

.terminal-btn.primary {
  background: var(--cyan);
  color: #001014;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
}

.topbar-control-group {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.clock-readout {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.topbar-control {
  width: 124px;
  min-width: 124px;
  min-height: 38px;
  padding-inline: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: none;
}

.search-shell {
  position: relative;
  width: min(240px, 22vw);
}

.search-shell::before,
.search-shell::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.search-shell::before {
  top: 50%;
  left: 12px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--cyan-dim);
  border-radius: 50%;
  transform: translateY(-58%);
}

.search-shell::after {
  top: 23px;
  left: 23px;
  width: 8px;
  height: 2px;
  background: var(--cyan-dim);
  transform: rotate(45deg);
  transform-origin: left center;
}

.terminal-input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: none;
  background: rgba(2, 7, 10, 0.74);
  color: var(--text);
  caret-color: var(--cyan);
}

.terminal-input::placeholder {
  color: var(--faint);
}

.terminal-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(32, 217, 255, 0.08);
}

.icon-action {
  min-width: 40px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(2, 7, 10, 0.74);
  color: var(--cyan-bright);
  cursor: pointer;
}

.hero-section,
.home-console-grid,
.section-wrap,
.entry-wrap,
.damaged-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(40px, 8vw, 96px) 0;
}

.home-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.72fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  padding: clamp(38px, 6vw, 72px) 0;
}

.home-main-stack,
.home-side-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero-card {
  min-height: 374px;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(90deg, rgba(32, 217, 255, 0.055), transparent 58%),
    rgba(3, 12, 18, 0.76);
  box-shadow: inset 0 0 28px rgba(32, 217, 255, 0.035);
}

.hero-copy {
  display: grid;
  gap: 28px;
}

.eyebrow {
  color: var(--cyan-dim);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-title {
  margin-bottom: 6px;
  color: var(--text);
  font-size: clamp(46px, 8vw, 92px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(32, 217, 255, 0.24);
}

.hero-title span {
  display: inline-block;
  margin-left: 0.12em;
  color: rgba(232, 251, 255, 0.88);
  font-size: 0.72em;
  letter-spacing: 0.04em;
  line-height: 1;
  vertical-align: baseline;
  transform: translateY(0.035em);
}

.hero-version {
  margin-bottom: 28px;
  color: var(--cyan-dim);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-welcome {
  margin-bottom: 10px;
  color: var(--cyan-bright);
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 800;
}

.hero-subtitle {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
}

.hero-subtitle strong {
  color: var(--cyan-bright);
  font-weight: 700;
}

.home-side-stack .status-panel {
  min-height: 374px;
}

.home-entry-panel {
  display: grid;
  gap: 12px;
}

.home-entry-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 16px 56px;
  border: 1px solid var(--line);
  background: rgba(3, 18, 23, 0.92);
  color: var(--cyan-bright);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  box-shadow: inset 0 0 18px rgba(32, 217, 255, 0.04), var(--shadow);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.home-entry-btn span {
  position: absolute;
  left: 20px;
  top: 50%;
  color: var(--text);
  font-size: 0.92em;
  letter-spacing: 0.02em;
  transform: translateY(-50%);
}

.home-entry-btn:hover {
  border-color: var(--cyan-bright);
  background: rgba(32, 217, 255, 0.16);
  color: var(--text);
  transform: translateY(-1px);
}

.home-entry-btn.primary {
  background: rgba(3, 18, 23, 0.92);
  color: var(--cyan-bright);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.terminal-panel,
.status-panel,
.archive-card,
.entry-main,
.infobox,
.damaged-card,
.module-strip,
.system-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 0 18px rgba(32, 217, 255, 0.04), var(--shadow);
}

.terminal-panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(32, 217, 255, 0.06);
  color: var(--cyan-bright);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.terminal-body {
  min-height: 172px;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.home-main-stack .terminal-body {
  min-height: 250px;
}

.terminal-line {
  min-height: 1.6em;
  margin: 0 0 8px;
}

.prompt {
  color: var(--cyan);
  font-weight: 800;
}

.typing-cursor::after {
  content: "_";
  color: var(--cyan);
  animation: blink 900ms steps(2, end) infinite;
}

.command-panel .panel-header,
.compact-command-panel .panel-header {
  border-bottom-color: var(--line);
}

.command-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 72px;
  padding: 18px;
}

.command-prompt {
  color: var(--cyan-bright);
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.command-prompt::after {
  content: "_";
  color: var(--cyan);
  animation: blink 900ms steps(2, end) infinite;
}

.command-input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--cyan);
  opacity: 0;
  transition: opacity 160ms ease;
}

.command-form.is-ready .command-input {
  opacity: 1;
}

.command-input:focus {
  text-shadow: 0 0 10px rgba(32, 217, 255, 0.32);
}

.terminal-idle-line {
  color: var(--cyan-bright);
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.72;
}

.idle-cursor {
  color: var(--cyan);
  animation: blink 900ms steps(2, end) infinite;
}

.status-panel {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 32px);
}

.status-panel-title {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--cyan-bright);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.status-panel-title::before {
  width: 10px;
  height: 10px;
  border: 1px solid var(--cyan);
  content: "";
  box-shadow: 0 0 12px rgba(32, 217, 255, 0.5);
}

.status-grid {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(2, 7, 10, 0.4);
}

.stat-label {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-value {
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.stat-value.status-ok {
  color: var(--ok);
}

.stat-value.status-warning {
  color: var(--warning);
}

.stat-value.status-danger {
  color: var(--danger);
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(2, 7, 10, 0.74);
}

.progress-fill {
  width: 37%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright));
  box-shadow: 0 0 16px rgba(32, 217, 255, 0.55);
}

.module-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 26px;
  overflow: hidden;
  background: var(--line-soft);
}

.module-btn {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-height: 82px;
  padding: 16px;
  border: 0;
  background: rgba(3, 12, 18, 0.96);
  text-align: left;
}

.module-btn span:first-child {
  color: var(--cyan-bright);
  font-size: 12px;
}

.module-btn span:last-child {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.section-wrap,
.entry-wrap,
.damaged-wrap {
  padding: clamp(42px, 8vw, 84px) 0;
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
  text-transform: uppercase;
}

.section-heading p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.archive-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 20px;
  color: var(--text);
  text-decoration: none;
}

.archive-card::after {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: var(--line);
  content: "開啟 //";
  font-size: 10px;
  letter-spacing: 0.18em;
}

.archive-card.is-damaged::after {
  content: "修復 //";
}

.archive-card-title {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.archive-card-meta {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.archive-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.035);
  color: var(--cyan-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-available {
  color: var(--ok);
}

.status-partial {
  color: var(--cyan-bright);
}

.status-damaged {
  color: var(--danger);
}

.status-locked {
  color: var(--warning);
}

.status-classified {
  color: var(--violet);
}

.status-rebuilding {
  color: var(--cyan);
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
  align-items: start;
}

.entry-main,
.infobox {
  padding: clamp(20px, 4vw, 34px);
}

.entry-kicker {
  margin-bottom: 10px;
  color: var(--cyan-dim);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.entry-title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
}

.entry-description {
  max-width: 760px;
  color: var(--muted);
}

.entry-section {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}

.entry-section h2 {
  margin-bottom: 12px;
  color: var(--cyan-bright);
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-section p {
  color: var(--muted);
}

.corrupted-block {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px dashed rgba(255, 79, 109, 0.6);
  background: rgba(255, 79, 109, 0.045);
  color: var(--danger);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.glitch-text {
  display: inline-block;
  color: var(--danger);
  text-shadow: 2px 0 rgba(32, 217, 255, 0.7), -2px 0 rgba(255, 79, 109, 0.5);
  animation: glitch 1.4s steps(2, end) infinite;
}

.infobox {
  position: sticky;
  top: 92px;
}

.infobox-title {
  margin: 0 0 16px;
  color: var(--cyan-bright);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.infobox-row {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.infobox-label {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.infobox-value {
  color: var(--text);
  font-size: 13px;
}

.related-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.related-list a {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  text-decoration: none;
}

.related-list a:hover {
  border-color: var(--line);
  color: var(--cyan-bright);
}

.write-channel {
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(2, 7, 10, 0.45);
}

.write-channel p {
  margin: 0 0 12px;
  color: var(--faint);
  font-size: 13px;
}

.damaged-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
}

.damaged-card {
  width: min(760px, 100%);
  padding: clamp(24px, 6vw, 48px);
}

.damaged-code {
  color: var(--danger);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.damaged-title {
  margin: 12px 0;
  color: var(--text);
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1;
  text-transform: uppercase;
}

.integrity-readout {
  display: grid;
  gap: 8px;
  margin: 24px 0;
}

.integrity-readout .progress-fill {
  width: 18%;
  background: linear-gradient(90deg, var(--danger), var(--warning));
}

.footer {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(420px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid rgba(255, 79, 109, 0.76);
  background: rgba(16, 4, 8, 0.94);
  box-shadow: 0 0 30px rgba(255, 79, 109, 0.18);
  color: var(--text);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-title {
  margin-bottom: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toast-message {
  color: var(--muted);
  font-size: 13px;
}

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

@keyframes blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0.25;
  }
}

@keyframes scanSweep {
  0% {
    background-position: -120vw 0, 0 0;
  }
  100% {
    background-position: 120vw 0, 0 0;
  }
}

@keyframes starScanReveal {
  0%,
  18%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.72);
  }
  5% {
    opacity: calc(var(--star-peak, 0.7) * 0.42);
  }
  8% {
    opacity: var(--star-peak, 0.7);
    transform: translate(-50%, -50%) scale(1);
  }
  12% {
    opacity: calc(var(--star-peak, 0.7) * 0.36);
  }
}

@keyframes glitch {
  0%,
  82%,
  100% {
    transform: translate(0, 0);
  }
  84% {
    transform: translate(1px, -1px);
  }
  86% {
    transform: translate(-1px, 1px);
  }
}

@media (max-width: 900px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nav-links {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-content: flex-start;
    justify-self: stretch;
  }

  .search-shell {
    width: 100%;
  }

  .topbar-control-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .topbar-control {
    width: auto;
    min-width: 0;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .home-console-grid {
    grid-template-columns: 1fr;
    padding: 28px 0 52px;
  }

  .hero-card {
    min-height: auto;
  }

  .home-side-stack .status-panel {
    min-height: 0;
  }

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

  .entry-layout {
    grid-template-columns: 1fr;
  }

  .infobox {
    position: static;
    order: -1;
  }
}

@media (max-width: 1180px) {
  .topbar-control {
    width: 116px;
    min-width: 116px;
  }

  .search-shell {
    width: min(210px, 28vw);
  }
}

@media (max-width: 900px) {
  .search-shell {
    width: 100%;
  }

  .topbar-control-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar-control {
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .hero-section,
  .home-console-grid,
  .section-wrap,
  .entry-wrap,
  .damaged-wrap,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .brand-title {
    font-size: 11px;
  }

  .brand-subtitle {
    font-size: 9px;
  }

  .home-entry-btn {
    min-height: 64px;
  }

  .command-form {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .module-strip {
    grid-template-columns: 1fr;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    display: grid;
  }
}
