:root {
  color-scheme: dark;
  --ink-900: #0b0c10;
  --ink-800: #121418;
  --ink-700: #1a1d23;
  --ink-600: #222630;
  --gold-300: #d59a52;
  --gold-200: #f2bf6d;
  --crimson-300: #a8403b;
  --crimson-200: #e26a5f;
  --crimson-100: #f28d7e;
  --mist-100: #f3efe7;
  --mist-200: #c7c1b5;
  --border: rgba(203, 178, 122, 0.18);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  height: auto;
  overflow-y: auto;
  overflow-x: clip;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: transparent;
}

body {
  min-height: 100vh;
  height: auto;
  overflow: visible;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  background-color: transparent;
  background-image: none;
  background-attachment: fixed;
  color: var(--mist-100);
  line-height: 1.6;
  position: relative;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    url("https://www.transparenttextures.com/patterns/cracked-concrete.png"),
    radial-gradient(circle at 30% 20%, rgba(242, 191, 109, 0.12), transparent 50%),
    radial-gradient(circle at 75% 80%, rgba(198, 84, 70, 0.08), transparent 55%);
  opacity: 0.05;
  mix-blend-mode: overlay;
  filter: blur(8px);
  animation: mist-flow 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow: visible;
  isolation: isolate;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  background: rgba(12, 13, 18, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-200);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

.brand-subtitle {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--mist-200);
}

.topbar-nav {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  font-size: 13px;
  color: var(--mist-200);
}

.topbar-nav::-webkit-scrollbar {
  height: 6px;
}

.topbar-nav::-webkit-scrollbar-thumb {
  background: rgba(176, 138, 83, 0.35);
  border-radius: 999px;
}

.topbar-nav a,
.sidebar-nav a,
.command-card,
.command-item {
  will-change: transform;
}

.topbar-nav a {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  border-color: var(--border);
  color: var(--gold-200);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mist-200);
}

.prefix-label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
}

.prefix-value {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink-600);
  color: var(--gold-200);
  border: 1px solid var(--border);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  padding: 24px 28px 40px;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: clip;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E"), linear-gradient(135deg, rgba(20, 22, 28, 0.9), rgba(10, 12, 16, 0.95));
  background-repeat: repeat;
  background-size: 200px 200px, cover;
  border-radius: var(--radius-md);
  padding: 12px;
}

.sidebar-search {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(12, 14, 20, 0.95);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(215, 180, 106, 0.35);
  background: rgba(7, 8, 12, 0.9);
  color: var(--gold-200);
  font-size: 13px;
  letter-spacing: 0.5px;
  outline: none;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-search input::placeholder {
  color: rgba(225, 200, 137, 0.6);
}

.sidebar-search input:focus {
  border-color: #d7b46a;
  box-shadow: 0 0 15px rgba(215, 180, 106, 0.3);
}

.sidebar-section {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 17, 23, 0.78);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--gold-200);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--mist-200);
}

.sidebar-nav a {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  border-left: 4px solid #d7b46a;
  background: linear-gradient(90deg, rgba(215, 180, 106, 0.2) 0%, transparent 90%);
  color: #d7b46a;
  font-weight: bold;
  padding-left: 12px;
  box-shadow: 0 0 15px rgba(215, 180, 106, 0.1);
}



.easter-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.easter-shuffle {
  border: 1px solid rgba(242, 191, 109, 0.6);
  background: linear-gradient(135deg, rgba(242, 191, 109, 0.22), rgba(168, 64, 59, 0.2));
  color: var(--mist-100);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.easter-shuffle:hover {
  color: var(--gold-200);
}

.truth-audit-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--mist-100);
}

.truth-audit-list li::marker {
  color: var(--gold-200);
}

.daily-template {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Noto Serif SC", "Songti SC", serif;
  line-height: 1.8;
  color: var(--mist-100);
}

.sidebar-note {
  font-size: 12px;
  color: var(--mist-200);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  overflow-x: visible;
}

.main-content {
  width: 100%;
  overflow-x: visible;
}

table {
  width: 100%;
  max-width: 100%;
  display: table;
  table-layout: fixed;
  overflow-x: visible;
}

body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
  background: #14151b;
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #d7b46a, #8f6b35);
  border-radius: 999px;
  border: 2px solid #14151b;
}

body::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #f2bf6d, #b87a36);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-image:
    linear-gradient(to bottom, rgba(11, 13, 19, 0.9) 0%, rgba(11, 13, 19, 0.7) 60%, rgba(11, 13, 19, 0.95) 100%),
    url("https://images.unsplash.com/photo-1605628150266-199e00bb209c?q=80&w=2070&auto=format&fit=crop");
  background-size: cover;
  background-position: center 30%;
  border-bottom: 1px solid rgba(215, 180, 106, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  animation: hero-breathe 20s ease-in-out infinite alternate;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgba(215, 180, 106, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(215, 180, 106, 0.8);
  animation: float-qi 10s ease-in-out infinite;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.portal-actions {
  flex-wrap: wrap;
}

.hero-text h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--gold-200);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  letter-spacing: 2px;
  background-image: linear-gradient(120deg, #f2bf6d, #d59a52, #f7e0a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 25px rgba(215, 180, 106, 0.3);
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
}

.hero-text p {
  margin: 0;
  color: var(--mist-200);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 800px;
}

.hero-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--mist-200);
}


.npc-whisper {
  margin: 10px 0 6px;
  min-height: 24px;
  color: #f2cf91;
  font-size: 14px;
  letter-spacing: 0.3px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.npc-whisper.show {
  opacity: 1;
  transform: translateY(0);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--gold-200);
  background: var(--ink-700);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--ink-700);
  border: 1px solid var(--border);
}

.panel-title {
  font-size: 13px;
  color: var(--gold-200);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

.panel-content {
  font-size: 12px;
  color: var(--mist-200);
  display: grid;
  gap: 8px;
}

.section-header h2 {
  margin: 0 0 0.9rem;
  color: var(--gold-200);
  font-size: 22px;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  letter-spacing: 2px;
  background-image: linear-gradient(120deg, #f2bf6d, #d59a52, #f7e0a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-header p {
  margin: 0;
  color: var(--mist-200);
}

.section-header {
  display: grid;
  gap: 6px;
}


.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(213, 154, 82, 0.6);
  background: rgba(13, 15, 20, 0.8);
  color: var(--gold-100);
  font-size: 14px;
  vertical-align: middle;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--mist-100);
  display: grid;
  gap: 6px;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(12, 14, 20, 0.55);
  border: 1px solid rgba(215, 180, 106, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  height: 100%;
  justify-content: space-between;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45), 0 0 24px rgba(215, 180, 106, 0.1);
  animation: glow 8s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  color: var(--gold-200);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  white-space: normal;
  overflow-wrap: anywhere;
  text-shadow: 0 0 16px rgba(242, 191, 109, 0.35);
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  filter: brightness(1.08);
}

.card .card-meta {
  font-size: 12px;
  color: var(--mist-200);
  text-shadow: 0 0 12px rgba(226, 106, 95, 0.15);
}

.card code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--ink-600);
  color: var(--gold-200);
}

#overlord-foundation .card,
#overlord-foundation .command-card {
  border-color: rgba(242, 191, 109, 0.75);
  box-shadow: 0 0 18px rgba(242, 191, 109, 0.35), 0 0 45px rgba(242, 191, 109, 0.15);
}

#heavenly-devil .card,
#heavenly-devil .command-card {
  border-color: rgba(226, 106, 95, 0.7);
  box-shadow: 0 0 18px rgba(226, 106, 95, 0.35), 0 0 45px rgba(226, 106, 95, 0.2);
}

.category-overlord {
  border-color: rgba(242, 191, 109, 0.8);
  box-shadow: 0 0 18px rgba(242, 191, 109, 0.35), 0 0 40px rgba(242, 191, 109, 0.2);
  animation: float 8s ease-in-out infinite, glow 6s ease-in-out infinite, breathe-gold 4.5s ease-in-out infinite;
}

.category-devil {
  border-color: rgba(226, 106, 95, 0.8);
  box-shadow: 0 0 16px rgba(226, 106, 95, 0.35), 0 0 36px rgba(226, 106, 95, 0.25);
  animation: float 8s ease-in-out infinite, glow 6s ease-in-out infinite, flicker 2.6s ease-in-out infinite;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(215, 180, 106, 0.6);
  background: rgba(10, 12, 18, 0.75);
  color: var(--gold-200);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.tag-pill .cmd-code {
  background: none;
  border: none;
  padding: 0;
}

.cmd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.props-list {
  display: grid;
  gap: 8px;
}

.props-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr);
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(215, 180, 106, 0.2);
}

.props-key {
  color: var(--mist-200);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.props-value {
  color: var(--mist-100);
  font-size: 13px;
}

.item-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 6px rgba(213, 154, 82, 0.45));
}

.item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item-tier {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(213, 154, 82, 0.6);
  color: var(--gold-200);
  font-size: 12px;
  letter-spacing: 0.5px;
  background: rgba(13, 15, 20, 0.7);
  box-shadow: 0 0 12px rgba(213, 154, 82, 0.25);
}

.item-description {
  margin: 0;
  color: var(--mist-100);
  font-size: 13px;
}

.item-effect {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(213, 154, 82, 0.35);
  background: rgba(12, 14, 18, 0.7);
  color: var(--mist-200);
  font-size: 12px;
}

.item-footer {
  display: flex;
  justify-content: flex-end;
}

.ancient-seal-container {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-top: 12px;
  font-size: 1.4rem;
}

.seal-icon {
  position: relative;
  opacity: 0.6;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 2px var(--color-overlord-gold, gold));
}

.seal-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--color-overlord-gold, gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: blur(5px);
  animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.2;
    scale: 1;
  }
  50% {
    opacity: 0.5;
    scale: 1.5;
  }
}

.ancient-seal-container:hover .seal-icon {
  opacity: 1;
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px var(--color-overlord-gold, gold));
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 300px;
  background: linear-gradient(to bottom, #1a1a1a, #0d0d0d);
  color: #e0d6b4;
  text-align: left;
  border-radius: 2px;
  padding: 15px 20px;
  position: absolute;
  z-index: 20;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid #3a3a3a;
  border-top: 2px solid var(--color-overlord-gold, gold);
  border-bottom: 2px solid var(--color-overlord-gold, gold);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.1) inset;
  font-family: "Noto Serif SC", serif;
  font-size: 0.95rem;
  line-height: 1.6;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.lore-note {
  display: block;
  margin-top: 8px;
  font-size: 0.85em;
  color: #a8a085;
  font-style: italic;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: var(--color-overlord-gold, gold) transparent transparent transparent;
}

.glass-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.error-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--mist-200);
}

.command-library {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(14px);
}

.command-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.command-controls input,
.command-controls select {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--ink-700);
  border: 1px solid var(--border);
  color: var(--mist-100);
}

.command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}

.command-list {
  display: grid;
  gap: 12px;
  max-height: 350px;
  overflow-y: auto;
  overflow-x: clip;
  padding-right: 6px;
}

.command-list::-webkit-scrollbar {
  width: 6px;
}

.command-list::-webkit-scrollbar-track {
  background: transparent;
}

.command-list::-webkit-scrollbar-thumb {
  background: rgba(213, 154, 82, 0.5);
  border-radius: 999px;
  box-shadow: 0 0 6px rgba(213, 154, 82, 0.4);
}

.command-list::-webkit-scrollbar-thumb:hover {
  background: rgba(213, 154, 82, 0.8);
}

.command-item {
  padding: 12px;
  min-height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--ink-700);
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.command-item:hover,
.command-item.active {
  border-color: var(--gold-200);
  transform: translateY(-1px);
}

.command-item h4 {
  margin: 0 0 6px;
  line-height: 1.35;
  color: var(--gold-200);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

img,
pre {
  max-width: 100%;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
    padding: 20px;
  }

  .sidebar {
    gap: 16px;
    padding: 10px;
  }

  .sidebar-section,
  .sidebar-search {
    padding: 12px;
  }

  .sidebar-nav {
    font-size: 12px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    margin-bottom: 20px;
    border-right: none;
    border-bottom: 1px solid #d7b46a;
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-nav {
    justify-content: flex-start;
  }

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

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

  .command-card:hover {
    transform: none;
    box-shadow: var(--shadow);
    filter: none;
  }
}

@media (max-width: 600px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (hover: none) {
  .command-card::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


.section-header {
  position: relative;
}

.section-header::after {
  content: "✦";
  position: absolute;
  right: 0;
  top: 0;
  color: rgba(242, 191, 109, 0.75);
  text-shadow: 0 0 12px rgba(242, 191, 109, 0.35);
  animation: rune-breathe 3.6s ease-in-out infinite;
}

@keyframes rune-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 1; }
}

.command-item p {
  margin: 0;
  line-height: 1.4;
  font-size: 12px;
  color: var(--mist-200);
}

.issues-toggle {
  margin-top: 10px;
  min-height: 40px;
  width: 100%;
  border-radius: var(--radius-10);
  border: 1px solid rgba(215, 180, 106, 0.45);
  background: linear-gradient(120deg, rgba(24, 28, 38, 0.88), rgba(14, 18, 28, 0.92));
  color: var(--gold-200);
  font-size: 13px;
  cursor: pointer;
}

.issues-toggle:hover,
.issues-toggle:focus-visible {
  border-color: rgba(242, 191, 109, 0.72);
}

.command-card,
.glass-card {
  gap: 12px;
  background: linear-gradient(145deg, rgba(20, 22, 32, 0.65), rgba(10, 12, 18, 0.75));
  border: 1px solid rgba(215, 180, 106, 0.25);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(215, 180, 106, 0.12);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: slideUpFade 0.6s ease-out both, glow 8s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.command-card::before,
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(215, 180, 106, 0.08),
    transparent 40%
  );
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.command-card:hover::before,
.glass-card:hover::before {
  opacity: 1;
}

.command-card > *,
.glass-card > * {
  position: relative;
  z-index: 1;
}

.command-card:hover {
  border-color: #d7b46a;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(215, 180, 106, 0.05);
  transform: translateY(-4px) scale(1.02);
  filter: brightness(1.08);
}

.card:hover,
.command-card:hover,
.glass-card:hover {
  animation-play-state: paused;
}

.glass-card {
  animation: slideUpFade 0.6s ease-out both, glow 8s ease-in-out infinite;
}

.section {
  animation: slideUpFade 0.6s ease-out both;
}

.section-grid .command-card:nth-child(1) {
  animation-delay: 0.1s;
}

.section-grid .command-card:nth-child(2) {
  animation-delay: 0.2s;
}

.section-grid .command-card:nth-child(3) {
  animation-delay: 0.3s;
}

.section-grid .command-card:nth-child(4) {
  animation-delay: 0.4s;
}

.card-field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mist-200);
}

.cmd-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cmd-code {
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(10, 12, 18, 0.85);
  border: 1px solid rgba(215, 180, 106, 0.4);
  font-family: "SFMono-Regular", "Consolas", "Menlo", monospace;
  font-size: 12px;
  color: var(--gold-200);
}

.detail-text {
  font-size: 12px;
  color: var(--mist-200);
}

.click-ripple {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 180, 106, 0.6) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-burst 0.5s ease-out;
  pointer-events: none;
  z-index: 9999;
}

.command-detail {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--ink-700);
  min-height: 200px;
}

.detail-empty {
  color: var(--mist-200);
  font-size: 13px;
}

.detail-block {
  margin-bottom: 12px;
}

.detail-block h5 {
  margin: 0 0 6px;
  color: var(--gold-200);
  font-size: 13px;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  background-image: linear-gradient(120deg, #ffffff, #f2bf6d, #fff1d2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-footer {
  text-align: center;
  font-size: 12px;
  color: #d7b46a;
  opacity: 0.6;
  padding: 24px 12px 32px;
  letter-spacing: 1px;
}

.detail-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--mist-200);
  font-size: 12px;
}

.detail-inline {
  font-size: 12px;
  color: var(--mist-200);
}

.detail-inline code {
  background: var(--ink-600);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--gold-200);
}


@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.45), 0 0 20px rgba(215, 180, 106, 0.12);
  }
  50% {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 0 35px rgba(226, 106, 95, 0.18);
  }
}

@keyframes breathe-gold {
  0%,
  100% {
    box-shadow: 0 0 16px rgba(242, 191, 109, 0.25), 0 0 32px rgba(242, 191, 109, 0.15);
  }
  50% {
    box-shadow: 0 0 24px rgba(242, 191, 109, 0.45), 0 0 45px rgba(242, 191, 109, 0.25);
  }
}

@keyframes flicker {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(226, 106, 95, 0.2), 0 0 28px rgba(226, 106, 95, 0.15);
  }
  20% {
    box-shadow: 0 0 22px rgba(226, 106, 95, 0.5), 0 0 40px rgba(226, 106, 95, 0.35);
  }
  40% {
    box-shadow: 0 0 10px rgba(226, 106, 95, 0.25), 0 0 20px rgba(226, 106, 95, 0.2);
  }
  60% {
    box-shadow: 0 0 26px rgba(226, 106, 95, 0.55), 0 0 44px rgba(226, 106, 95, 0.4);
  }
  80% {
    box-shadow: 0 0 14px rgba(226, 106, 95, 0.3), 0 0 30px rgba(226, 106, 95, 0.2);
  }
}

@keyframes dark-breath {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes hero-breathe {
  0% {
    background-size: 100% auto;
  }
  100% {
    background-size: 105% auto;
  }
}

@keyframes ripple-burst {
  to {
    transform: translate(-50%, -50%) scale(3);
    opacity: 0;
  }
}

@keyframes mist-flow {
  0% {
    opacity: 0.45;
    transform: translate3d(-2%, -1%, 0);
  }
  50% {
    opacity: 0.65;
    transform: translate3d(2%, 1%, 0);
  }
  100% {
    opacity: 0.45;
    transform: translate3d(-2%, -1%, 0);
  }
}

@keyframes float-qi {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: translate(-50px, -100px) scale(1.2);
    opacity: 0;
  }
}

h1,
h2,
.brand-title {
  background: linear-gradient(120deg, #ffffff 0%, #f2bf6d 35%, #fff1d2 65%, #d59a52 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: liquid-gold 6s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(242, 191, 109, 0.15);
}

.command-card,
.glass-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.command-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(215, 180, 106, 0.05);
  filter: brightness(1.08);
  border-color: #d7b46a;
  z-index: 10;
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 35px rgba(215, 180, 106, 0.3);
  border-color: #d7b46a;
  z-index: 10;
}

.page {
  position: relative;
}

.page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(to bottom, rgba(8, 9, 12, 0.45), transparent);
  opacity: 0.35;
  transform: scaleY(-1);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #050608;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #d7b46a, #8f6b35);
  border-radius: 999px;
}

.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  background: linear-gradient(135deg, #d7b46a 0%, #f4e2b0 100%);
  animation: pulse-gold 2s infinite;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.btn-portal:active {
  transform: scale(0.96);
}

.btn-portal-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid #d7b46a;
  color: #d7b46a;
  background: transparent;
  font-weight: bold;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(215, 180, 106, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(215, 180, 106, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(215, 180, 106, 0);
  }
}

@keyframes liquid-gold {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.topbar-nav a:focus-visible,
.sidebar-nav a:focus-visible,
.command-item:focus-visible,
.btn-portal:focus-visible,
.btn-portal-ghost:focus-visible,
.sidebar-search input:focus-visible,
.command-controls select:focus-visible {
  outline: 2px solid #f2bf6d;
  outline-offset: 2px;
}

/* === Mushenji UI polish: ruins + yankan ceremonial style === */
.topbar {
  background:
    linear-gradient(90deg, rgba(14, 10, 8, 0.88), rgba(18, 16, 24, 0.9) 45%, rgba(10, 15, 22, 0.9)),
    radial-gradient(circle at 15% 0%, rgba(242, 191, 109, 0.12), transparent 35%);
  border-bottom: 1px solid rgba(215, 180, 106, 0.34);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.brand-title {
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(242, 191, 109, 0.18);
}

.layout {
  gap: 30px;
}

.sidebar {
  border: 1px solid rgba(215, 180, 106, 0.18);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.sidebar-section {
  background:
    linear-gradient(150deg, rgba(19, 17, 22, 0.82), rgba(12, 14, 21, 0.78)),
    repeating-linear-gradient(90deg, rgba(215, 180, 106, 0.03) 0 1px, transparent 1px 9px);
}

.hero {
  border: 1px solid rgba(215, 180, 106, 0.28);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.58), inset 0 0 80px rgba(19, 10, 8, 0.22);
}

.hero-panel {
  background:
    linear-gradient(165deg, rgba(21, 16, 14, 0.88), rgba(18, 20, 28, 0.86));
  border: 1px solid rgba(215, 180, 106, 0.3);
  position: relative;
  overflow: hidden;
}

/* Signature effect (single): lantern soul flame */
.hero-panel::before {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -24px;
  top: -32px;
  background: radial-gradient(circle, rgba(242, 191, 109, 0.38) 0%, rgba(242, 191, 109, 0.08) 48%, transparent 72%);
  filter: blur(2px);
  pointer-events: none;
  animation: lantern-sway 6.8s ease-in-out infinite;
}

@keyframes lantern-sway {
  0%, 100% { transform: translateY(0) translateX(0) scale(0.95); opacity: 0.74; }
  50% { transform: translateY(6px) translateX(-8px) scale(1.08); opacity: 1; }
}

.section {
  background: linear-gradient(180deg, rgba(16, 16, 21, 0.62), rgba(9, 11, 16, 0.52));
  border-radius: 14px;
  padding: 10px 12px 14px;
  border: 1px solid rgba(215, 180, 106, 0.12);
}

.section-header h2 {
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(242, 191, 109, 0.15);
}

.command-item,
.command-card,
.glass-card,
.item-card {
  border-color: rgba(215, 180, 106, 0.22);
}

.command-item.active {
  border-color: rgba(242, 191, 109, 0.7);
  box-shadow: 0 0 0 1px rgba(242, 191, 109, 0.38), 0 10px 22px rgba(0, 0, 0, 0.35);
}

.section-banner {
  height: 18px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(215, 180, 106, 0.4) 50%, transparent 100%);
  opacity: 0.36;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .section {
    padding: 6px 8px 10px;
  }

  .hero-panel::before {
    width: 96px;
    height: 96px;
    right: -20px;
    top: -18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-panel::before {
    animation: none !important;
  }
}

/* === Incremental UI revamp: 《牧神记》大墟/延康秩序冲突视觉系统 === */
:root {
  --msj-bg-void: #08090d;
  --msj-bg-ruins: #101117;
  --msj-bg-panel: #151821;
  --msj-bg-panel-2: #11141b;
  --msj-bronze: #8f7347;
  --msj-dark-gold: #c3a06a;
  --msj-rune: #6f7f99;
  --msj-iron: #2d3440;
  --msj-ink: #d9d3c8;
  --msj-muted: #a6a096;
  --msj-border: rgba(195, 160, 106, 0.26);
  --msj-border-strong: rgba(195, 160, 106, 0.42);
  --msj-shadow-deep: 0 18px 40px rgba(0, 0, 0, 0.56);
  --msj-shadow-float: 0 14px 28px rgba(0, 0, 0, 0.42);
  --msj-radius: 12px;
  --msj-space-1: 8px;
  --msj-space-2: 16px;
  --msj-space-3: 24px;
  --msj-space-4: 32px;
}

body.mushenji-theme {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  color: var(--msj-ink);
  background: radial-gradient(circle at 14% 16%, rgba(110, 136, 168, 0.1), transparent 42%), var(--msj-bg-void);
}

body.mushenji-theme::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgba(14, 15, 20, 0.7), rgba(9, 10, 14, 0.92)),
    repeating-linear-gradient(100deg, rgba(195, 160, 106, 0.035) 0 1px, transparent 1px 14px),
    radial-gradient(circle at 70% 76%, rgba(90, 122, 162, 0.08), transparent 52%);
}

.page {
  z-index: 2;
}

.mist-parallax {
  position: relative;
  overflow: hidden;
}

.mist-parallax::before,
.mist-parallax::after {
  content: "";
  position: absolute;
  inset: -10% -8%;
  pointer-events: none;
  z-index: 0;
}

.mist-parallax::before {
  background: radial-gradient(circle at 24% 40%, rgba(220, 231, 255, 0.09), transparent 44%),
    radial-gradient(circle at 78% 62%, rgba(195, 160, 106, 0.11), transparent 41%);
  animation: msj-mist-drift 22s ease-in-out infinite alternate;
}

.mist-parallax::after {
  background: linear-gradient(120deg, transparent 20%, rgba(195, 160, 106, 0.08) 50%, transparent 82%);
  mix-blend-mode: screen;
  animation: msj-parallax-far 18s ease-in-out infinite alternate;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.brand-title,
.hero h1,
.section-header h2 {
  font-family: "Ma Shan Zheng", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  letter-spacing: 1px;
  position: relative;
}

.hero h1 {
  animation: msj-title-reveal 900ms ease-out both;
}

.hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 120%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(195, 160, 106, 0.85) 45%, transparent 100%);
  animation: msj-title-sweep 2.8s 0.4s ease-in-out both;
}

.topbar,
.sidebar,
.sidebar-section,
.hero,
.hero-panel,
.command-library,
.command-detail,
.command-item,
.command-card,
.glass-card,
.section {
  border-radius: var(--msj-radius);
  border-color: var(--msj-border);
  box-shadow: var(--msj-shadow-deep);
}

.command-card,
.glass-card,
.command-item,
.hero-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(21, 24, 32, 0.9), rgba(13, 15, 22, 0.88));
}

.command-item {
  overflow: visible;
}

.command-card::after,
.glass-card::after,
.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-image: linear-gradient(120deg, transparent 16%, rgba(195, 160, 106, 0.45), transparent 82%) 1;
  pointer-events: none;
  opacity: 0.7;
}

.command-card:hover,
.glass-card:hover,
.command-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--msj-shadow-float);
  border-color: var(--msj-border-strong);
}

.section-grid > .command-card,
.section-grid > .glass-card {
  animation: msj-stagger-rise 560ms ease both;
}

.section-grid > :nth-child(2) { animation-delay: 90ms; }
.section-grid > :nth-child(3) { animation-delay: 170ms; }
.section-grid > :nth-child(4) { animation-delay: 240ms; }
.section-grid > :nth-child(5) { animation-delay: 320ms; }

/* 长行局部滚动：命令/价格等不会撑破布局 */
.cmd-lines,
.detail-inline,
.props-value,
.command-card .detail-text,
.command-detail pre,
.command-detail code {
  max-width: 100%;
  overflow-x: visible;
  scrollbar-width: thin;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cmd-lines,
.detail-inline,
.props-value {
  display: block;
  padding-bottom: 2px;
}

.cmd-code,
.detail-inline code {
  white-space: nowrap;
}

.content,
.command-layout,
.command-detail,
.section-grid,
.hero,
.layout {
  min-width: 0;
}

@media (max-width: 768px) {
  .layout {
    padding: var(--msj-space-2);
    gap: var(--msj-space-2);
  }

  .content {
    gap: var(--msj-space-3);
  }

  .topbar,
  .section,
  .command-library {
    padding: var(--msj-space-2);
  }
}

@media (max-width: 380px) {
  .topbar,
  .layout {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mist-parallax::before,
  .mist-parallax::after,
  .hero h1,
  .hero h1::after,
  .section-grid > .command-card,
  .section-grid > .glass-card {
    animation: none !important;
  }
}

@keyframes msj-title-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes msj-title-sweep {
  from { transform: translateX(-36%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes msj-mist-drift {
  0% { transform: translate3d(-1.5%, 0, 0); opacity: 0.48; }
  100% { transform: translate3d(1.8%, -1.2%, 0); opacity: 0.72; }
}

@keyframes msj-parallax-far {
  0% { transform: translate3d(0, 0, 0); opacity: 0.22; }
  100% { transform: translate3d(-2.2%, 1.4%, 0); opacity: 0.44; }
}

@keyframes msj-stagger-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== High-intensity UI upgrade: sacred epic layer system ====== */
:root {
  --tone-bg-0: #07080b;
  --tone-bg-1: #0d1016;
  --tone-bg-2: #161b24;
  --tone-gold: #b08a53;
  --tone-gold-strong: #d6b37a;
  --tone-accent: #5fa4a5;
  --tone-text: #e5dccd;
  --tone-muted: #a69b8a;
  --radius-10: 10px;
  --radius-14: 14px;
  --motion-fast: 280ms;
  --motion-mid: 480ms;
  --motion-slow: 1200ms;
  --motion-ease: cubic-bezier(.22,.61,.36,1);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.28);
  --shadow-lift: 0 20px 40px rgba(0, 0, 0, 0.28);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
}

body {
  background: linear-gradient(180deg, var(--tone-bg-0), var(--tone-bg-1) 35%, #090b10 100%);
}

body::before { opacity: 0.03; }

.bronze-rail {
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.15), rgba(8, 9, 12, 0.05));
  border-bottom: 1px solid rgba(176, 138, 83, 0.12);
  transition: background var(--motion-mid) var(--motion-ease), border-color var(--motion-mid) var(--motion-ease), box-shadow var(--motion-mid) var(--motion-ease);
}

.bronze-rail.is-scrolled {
  background: linear-gradient(180deg, rgba(20, 23, 30, 0.88), rgba(14, 17, 23, 0.72));
  border-bottom-color: rgba(176, 138, 83, 0.3);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.topbar-nav a {
  position: relative;
  border-radius: var(--radius-10);
}

.topbar-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tone-gold-strong), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--motion-fast) var(--motion-ease);
}

.topbar-nav a.active::after,
.topbar-nav a:hover::after { transform: scaleX(1); }

.hero {
  min-height: 420px;
  border-radius: var(--radius-14);
  border: 1px solid rgba(176, 138, 83, 0.22);
  background: linear-gradient(120deg, rgba(18, 21, 28, 0.84), rgba(10, 13, 18, 0.7));
  box-shadow: var(--shadow-soft);
}

.hero-celestial,
.celestial-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-celestial { z-index: 0; }

.celestial-layer.ruins {
  background:
    linear-gradient(to top, rgba(6, 8, 10, 0.9) 0%, rgba(6, 8, 10, 0.2) 48%, transparent 100%),
    radial-gradient(ellipse at 18% 88%, rgba(18, 22, 30, 0.9), transparent 56%),
    radial-gradient(ellipse at 78% 94%, rgba(20, 24, 34, 0.86), transparent 54%);
  transform: translate3d(0, 0, 0);
  animation: ruins-drift 24s linear infinite;
}

.celestial-layer.mist {
  background: radial-gradient(circle at 28% 38%, rgba(110, 123, 142, 0.18), transparent 44%),
    radial-gradient(circle at 72% 60%, rgba(95, 164, 165, 0.15), transparent 42%);
  mix-blend-mode: screen;
  animation: mist-drift var(--motion-slow) var(--motion-ease) infinite alternate;
}

.celestial-layer.sigils {
  background-image: radial-gradient(circle, rgba(176, 138, 83, 0.22) 0 1px, transparent 1.5px);
  background-size: 36px 36px;
  opacity: 0.18;
  animation: sigil-float 18s linear infinite;
}

.inscription-title {
  position: relative;
  animation: inscription-rise var(--motion-mid) var(--motion-ease) both;
}

.inscription-title::before {
  content: "";
  position: absolute;
  inset: auto -2% -4px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214, 179, 122, 0.78), transparent);
  animation: inscription-sweep var(--motion-slow) var(--motion-ease) both;
}

.inscription-sub {
  opacity: 0;
  transform: translateY(6px);
  animation: inscription-sub var(--motion-mid) var(--motion-ease) 120ms forwards;
}

.card,
.command-item,
.glass-card,
.hero-panel,
.command-detail {
  border-radius: var(--radius-14);
  border: 1px solid rgba(101, 112, 130, 0.45);
  box-shadow: var(--shadow-soft);
}

.card::before,
.command-item::before,
.glass-card::before,
.hero-panel::before,
.command-detail::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--radius-14) - 2px);
  border: 1px solid rgba(176, 138, 83, 0.28);
  pointer-events: none;
}

.card::after,
.glass-card::after,
.command-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 36%, rgba(214, 179, 122, 0.14) 48%, transparent 60%);
  transform: translateX(-140%);
  transition: transform var(--motion-slow) var(--motion-ease);
  pointer-events: none;
}

.card:hover,
.command-item:hover,
.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.card:hover::after,
.command-item:hover::after,
.glass-card:hover::after {
  transform: translateX(140%);
}

.card h3::before {
  content: "✶";
  color: rgba(214, 179, 122, 0.62);
  margin-right: 8px;
}

.snapshot-sigils {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sigil-metric {
  position: relative;
  padding: 10px;
  border: 1px solid rgba(176, 138, 83, 0.25);
  border-radius: var(--radius-10);
  background: rgba(9, 12, 18, 0.62);
}

.sigil-ring {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 1px solid rgba(176, 138, 83, 0.34);
  display: grid;
  place-items: center;
}

.sigil-ring::before,
.sigil-ring::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(95, 164, 165, 0.26);
  animation: ring-spin 26s linear infinite;
}

.sigil-ring::after {
  inset: -10px;
  border-style: solid;
  border-color: rgba(176, 138, 83, 0.2) transparent;
  animation-duration: 34s;
  animation-direction: reverse;
}

.sigil-value { font-size: 18px; color: var(--tone-gold-strong); }
.sigil-label { display: block; text-align: center; font-size: 12px; color: var(--tone-muted); }

.command-layout,
.command-detail,
.command-list,
.detail-inline,
.cmd-lines,
.props-value {
  min-width: 0;
}

.command-detail,
.command-list,
.detail-inline,
.props-value {
  overflow-x: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(176, 138, 83, 0.8) rgba(14, 17, 24, 0.7);
}

.command-detail::-webkit-scrollbar,
.command-list::-webkit-scrollbar,
.detail-inline::-webkit-scrollbar,
.props-value::-webkit-scrollbar {
  height: 6px;
}

.command-detail::-webkit-scrollbar-thumb,
.command-list::-webkit-scrollbar-thumb,
.detail-inline::-webkit-scrollbar-thumb,
.props-value::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(176, 138, 83, 0.94), rgba(132, 100, 56, 0.9));
}

.section,
.hero,
.site-footer {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--motion-mid) var(--motion-ease), transform var(--motion-mid) var(--motion-ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.section.is-revealed,
.hero.is-revealed,
.site-footer.is-revealed { opacity: 1; transform: translateY(0); }

.btn-portal,
.btn-portal-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-10);
  text-decoration: none;
}

.btn-portal {
  color: #111;
  background: linear-gradient(120deg, #d6b37a, #a67f48);
}

.btn-portal-ghost {
  color: var(--tone-gold-strong);
  border: 1px solid rgba(176, 138, 83, 0.62);
}

@media (max-width: 900px) {
  .snapshot-sigils { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .section,
  .hero,
  .site-footer,
  .inscription-title,
  .inscription-sub,
  .inscription-title::before,
  .celestial-layer,
  .sigil-ring::before,
  .sigil-ring::after,
  .card::after,
  .command-item::after,
  .glass-card::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .section,
  .hero,
  .site-footer { opacity: 1; }
}

@keyframes ruins-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-1.6%, 0.8%, 0); }
}

@keyframes mist-drift {
  from { transform: translate3d(-0.8%, 0, 0); }
  to { transform: translate3d(1.1%, -0.8%, 0); }
}

@keyframes sigil-float {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-12px, -8px, 0); }
}

@keyframes inscription-rise {
  from { opacity: 0; letter-spacing: 3px; }
  to { opacity: 1; letter-spacing: 1px; }
}

@keyframes inscription-sweep {
  from { opacity: 0; transform: translateX(-18%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes inscription-sub {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ====== Background FX enhancement (readability-safe) ====== */
:root {
  --fx-intensity: 0.72;
  --fx-speed-multiplier: 1;
  --fx-text-safe-alpha: 0.34;
  --fx-parallax-x: 0px;
  --fx-parallax-y: 0px;
}

.bg-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translate3d(var(--fx-parallax-x), var(--fx-parallax-y), 0);
  transition: transform var(--motion-mid) var(--motion-ease);
}

.bg-layer {
  position: absolute;
  inset: -4%;
  pointer-events: none;
  opacity: calc(var(--fx-intensity) * 0.55);
  will-change: transform, opacity;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0.08) 35%, rgba(0, 0, 0, 0.85) 70%, #000 100%);
}

.bg-stars {
  opacity: calc(var(--fx-intensity) * 0.22);
  background:
    radial-gradient(circle at 8% 16%, rgba(176, 138, 83, 0.2) 0 1px, transparent 1.7px),
    radial-gradient(circle at 74% 20%, rgba(95, 164, 165, 0.14) 0 1px, transparent 1.6px),
    radial-gradient(circle at 45% 75%, rgba(176, 138, 83, 0.14) 0 1px, transparent 1.6px),
    radial-gradient(circle at 88% 60%, rgba(95, 164, 165, 0.12) 0 1px, transparent 1.5px);
  background-size: 320px 220px, 380px 260px, 300px 260px, 360px 240px;
  animation: bg-stars-drift calc(34s / var(--fx-speed-multiplier)) linear infinite,
    bg-stars-twinkle calc(18s / var(--fx-speed-multiplier)) var(--motion-ease) infinite;
}

.bg-fog {
  opacity: calc(var(--fx-intensity) * 0.18);
  background:
    radial-gradient(ellipse at 12% 32%, rgba(95, 164, 165, 0.26), transparent 52%),
    radial-gradient(ellipse at 88% 64%, rgba(176, 138, 83, 0.28), transparent 56%),
    radial-gradient(ellipse at 40% 78%, rgba(92, 102, 124, 0.26), transparent 60%);
  animation: bg-fog-flow calc(40s / var(--fx-speed-multiplier)) linear infinite;
}

.bg-runes {
  opacity: calc(var(--fx-intensity) * 0.15);
  background:
    linear-gradient(108deg, transparent 8%, rgba(176, 138, 83, 0.12) 12%, transparent 14%),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(95, 164, 165, 0.11) 26px 27px, transparent 27px 60px);
  animation: bg-runes-breathe calc(24s / var(--fx-speed-multiplier)) var(--motion-ease) infinite alternate;
}

.bg-glow {
  opacity: calc(var(--fx-intensity) * 0.13);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.9) 22%, rgba(0, 0, 0, 0.9) 78%, transparent 100%);
}

.bg-glow::before,
.bg-glow::after {
  content: "";
  position: absolute;
  inset: 12% -35%;
  background: linear-gradient(104deg, transparent 44%, rgba(214, 179, 122, 0.26) 50%, transparent 56%);
  transform: translateX(-80%);
  animation: bg-glow-sweep calc(28s / var(--fx-speed-multiplier)) linear infinite;
}

.bg-glow::after {
  animation-delay: 12s;
  opacity: 0.58;
}

.content {
  position: relative;
  isolation: isolate;
  z-index: 2;
}

.reading-shield {
  position: absolute;
  inset: -8px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(8, 10, 14, var(--fx-text-safe-alpha)) 0%, rgba(8, 10, 14, calc(var(--fx-text-safe-alpha) + 0.1)) 48%, rgba(8, 10, 14, calc(var(--fx-text-safe-alpha) + 0.18)) 100%),
    linear-gradient(180deg, rgba(9, 10, 14, 0.26), rgba(8, 10, 14, 0.12) 20%, rgba(8, 10, 14, 0.26));
  border-radius: var(--radius-14);
}

.content > *:not(.reading-shield) {
  position: relative;
  z-index: 1;
}

.hero,
.section,
.command-library,
.glass-card {
  backdrop-filter: saturate(105%);
}

@media (max-width: 900px) {
  :root {
    --fx-intensity: 0.5;
  }

  .bg-stars,
  .bg-glow {
    animation: none;
    opacity: 0.08;
  }

  .bg-fog {
    animation-duration: 48s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-effects {
    transform: none !important;
  }

  .bg-stars,
  .bg-fog,
  .bg-runes,
  .bg-glow,
  .bg-glow::before,
  .bg-glow::after {
    animation: none !important;
  }

  .bg-stars,
  .bg-glow {
    opacity: 0;
  }

  .bg-fog,
  .bg-runes {
    opacity: 0.08;
  }
}

@keyframes bg-stars-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-3%, 2%, 0); }
}

@keyframes bg-stars-twinkle {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.2; }
}

@keyframes bg-fog-flow {
  from { transform: translate3d(-2%, 0, 0); }
  to { transform: translate3d(2.5%, -1.2%, 0); }
}

@keyframes bg-runes-breathe {
  from { transform: translate3d(0, 0, 0); opacity: 0.1; }
  to { transform: translate3d(-1.4%, 1%, 0); opacity: 0.18; }
}

@keyframes bg-glow-sweep {
  0%, 12% { transform: translateX(-80%); opacity: 0; }
  24% { opacity: 0.42; }
  40%, 100% { transform: translateX(86%); opacity: 0; }
}

/* ====== FX framework + full extension layers ====== */
:root {
  --fx-speed: 1;
  --fx-density: 1;
  --fx-glow-alpha: 0.22;
}

body[data-fx="lite"] .bg-runes,
body[data-fx="lite"] .bg-glow {
  opacity: 0.06;
}

body[data-fx="full"] .bg-layer {
  opacity: calc(var(--fx-intensity) * 0.64);
}

.bg-effects::before {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background: radial-gradient(circle at 20% 26%, rgba(176, 138, 83, 0.06), transparent 50%), radial-gradient(circle at 80% 74%, rgba(95, 164, 165, 0.06), transparent 48%);
  animation: deepspace-breathe calc(26s / var(--fx-speed)) var(--motion-ease) infinite alternate;
}

.bg-effects::after {
  content: "";
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  border: 1px solid rgba(176, 138, 83, 0.12);
  opacity: 0.14;
  transform: translate(-10%, -6%);
  animation: arc-rotate calc(38s / var(--fx-speed)) linear infinite;
}

.bg-stars {
  background-size:
    calc(320px / var(--fx-density)) calc(220px / var(--fx-density)),
    calc(380px / var(--fx-density)) calc(260px / var(--fx-density)),
    calc(300px / var(--fx-density)) calc(260px / var(--fx-density)),
    calc(360px / var(--fx-density)) calc(240px / var(--fx-density));
  animation-duration: calc(34s / var(--fx-speed)), calc(18s / var(--fx-speed));
}

.bg-fog { animation-duration: calc(40s / var(--fx-speed)); }
.bg-runes { animation-duration: calc(24s / var(--fx-speed)); }

.bg-glow::before,
.bg-glow::after {
  background: linear-gradient(104deg, transparent 44%, rgba(214, 179, 122, var(--fx-glow-alpha)) 50%, transparent 56%);
  animation-duration: calc(28s / var(--fx-speed));
}

.hero,
.section,
.command-library,
.glass-card,
.command-item,
.command-detail {
  position: relative;
}


.card::before,
.command-item::before,
.glass-card::before {
  background:
    linear-gradient(90deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) left 8px top 8px / 10px 1px no-repeat,
    linear-gradient(180deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) left 8px top 8px / 1px 10px no-repeat,
    linear-gradient(90deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) right 8px top 8px / 10px 1px no-repeat,
    linear-gradient(180deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) right 8px top 8px / 1px 10px no-repeat,
    linear-gradient(90deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) left 8px bottom 8px / 10px 1px no-repeat,
    linear-gradient(180deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) left 8px bottom 8px / 1px 10px no-repeat,
    linear-gradient(90deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) right 8px bottom 8px / 10px 1px no-repeat,
    linear-gradient(180deg, rgba(176, 138, 83, 0.24), rgba(176, 138, 83, 0.24)) right 8px bottom 8px / 1px 10px no-repeat;
}

.card:hover,
.command-item:hover,
.glass-card:hover {
  transform: translateY(-4px) perspective(900px) rotateX(1.6deg);
}

.sigil-pulse::after {
  animation: nav-sigil-pulse 1200ms var(--motion-ease) infinite;
}

.scroll-sigil {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  background: rgba(10, 12, 18, 0.4);
  overflow: hidden;
}

.scroll-sigil span {
  display: block;
  height: 100%;
  width: calc(var(--scroll-progress, 0) * 100%);
  background: linear-gradient(90deg, rgba(95, 164, 165, 0.55), rgba(176, 138, 83, 0.85));
  box-shadow: 0 0 10px rgba(176, 138, 83, 0.24);
  transition: width 280ms var(--motion-ease);
}

.fog-gate {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
}

.fog-gate.is-active {
  animation: fog-gate-pass 480ms var(--motion-ease) 1;
}

@media (hover: hover) and (pointer: fine) {
  .btn-portal:hover,
  .btn-portal-ghost:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  }
}

@media (max-width: 900px) {
  body[data-fx="full"] { --fx-speed: 0.92; }
  .bg-effects::after,
  .bg-glow,
  .fog-gate { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-effects::before,
  .bg-effects::after,
  .sigil-pulse::after,
  .fog-gate,
  .scroll-sigil span {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes deepspace-breathe {
  from { opacity: 0.1; transform: translate3d(0,0,0); }
  to { opacity: 0.2; transform: translate3d(1.2%, -0.8%, 0); }
}

@keyframes arc-rotate {
  from { transform: translate(-10%, -6%) rotate(0deg); }
  to { transform: translate(-10%, -6%) rotate(360deg); }
}

@keyframes nav-sigil-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

@keyframes fog-gate-pass {
  0% { opacity: 0; }
  35% { opacity: 1; background: linear-gradient(120deg, transparent 28%, rgba(95, 164, 165, 0.16) 50%, transparent 72%); }
  100% { opacity: 0; }
}


/* final closeout fixes: particle layer visibility + nav text stability */
#ruins-bg {
  display: none;
}

.ruins-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 34px;
  line-height: 1.35;
}


.section,
.hero {
  scroll-margin-top: 132px;
}


.command-item h4 {
  display: block;
  line-height: 1.4 !important;
  padding-block: 2px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
}
