:root {
  color-scheme: dark;
  --background: #0b1326;
  --surface: #0b1326;
  --surface-container-lowest: #060e20;
  --surface-container-low: #131b2e;
  --surface-container: #171f33;
  --surface-container-high: #222a3d;
  --surface-container-highest: #2d3449;
  --on-surface: #dae2fd;
  --on-surface-variant: #c2c6d6;
  --outline: #8c909f;
  --outline-variant: #424754;
  --primary: #adc6ff;
  --primary-container: #4d8eff;
  --on-primary-container: #00285d;
  --secondary: #b1c6f9;
  --secondary-container: #304671;
  --on-secondary-container: #d8e2ff;
  --tertiary: #ffb786;
  --tertiary-container: #df7412;
  --on-tertiary-container: #461f00;
  --error: #ffb4ab;
  --error-container: #93000a;
  --on-error: #690005;
  --shadow: rgba(0, 0, 0, 0.24);
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-cjk: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgba(77, 142, 255, 0.08), transparent 28rem),
    linear-gradient(180deg, #0b1326 0%, #071024 100%);
  color: var(--on-surface);
  font-family: var(--font-ui);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

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

.material-symbols-outlined[data-fill="true"] {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.page-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 28px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  min-width: 220px;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(173, 198, 255, 0.18);
  border-radius: 8px;
  background: rgba(77, 142, 255, 0.14);
  color: var(--primary);
}

.brand-title {
  color: #f0f4ff;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-subtitle {
  margin-top: 2px;
  color: rgba(194, 198, 214, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.command-search input {
  border: 1px solid rgba(66, 71, 84, 0.48);
  outline: none;
  color: var(--on-surface);
  background: rgba(45, 52, 73, 0.86);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.command-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(77, 142, 255, 0.22);
}

.section-kicker {
  margin: 0 0 8px;
  color: rgba(194, 198, 214, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.main-canvas {
  width: 100%;
  margin-left: 0;
  padding: 24px 40px 64px;
}

.hero-panel {
  position: relative;
  display: grid;
  min-height: 390px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(11, 19, 38, 0.08), var(--background)),
    var(--surface);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(to right, rgba(66, 71, 84, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(66, 71, 84, 0.22) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, transparent, black 24%, transparent 90%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 860px);
  gap: 28px;
  padding: 42px 20px;
  text-align: center;
}

.hero-copy h1 {
  margin: 0;
  background: linear-gradient(135deg, #d8e2ff 0%, #4d8eff 100%);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.35rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.02;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.command-search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 760px);
  margin: 0 auto;
}

.command-search::before {
  position: absolute;
  inset: -5px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(173, 198, 255, 0.18), rgba(77, 142, 255, 0.22));
  content: "";
  filter: blur(12px);
  opacity: 0.45;
  transition: opacity 220ms ease;
}

.command-search:focus-within::before {
  opacity: 0.76;
}

.command-search .material-symbols-outlined {
  position: absolute;
  left: 22px;
  z-index: 1;
  color: var(--primary);
}

.command-search input {
  position: relative;
  width: 100%;
  border-radius: 12px;
  padding: 22px 28px 22px 60px;
  background: rgba(45, 52, 73, 0.62);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  backdrop-filter: blur(15px);
}

.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid rgba(66, 71, 84, 0.55);
  border-radius: 8px;
  background: rgba(23, 31, 51, 0.72);
  color: var(--on-surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  padding: 0 14px;
  text-transform: uppercase;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.filter-trigger:hover,
.filter-trigger:focus-visible {
  border-color: rgba(173, 198, 255, 0.55);
  background: rgba(77, 142, 255, 0.12);
  color: var(--primary);
  outline: none;
}

.filter-trigger .material-symbols-outlined {
  font-size: 19px;
}

.filter-trigger strong {
  border-left: 1px solid rgba(66, 71, 84, 0.7);
  color: var(--on-surface-variant);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  padding-left: 10px;
  text-transform: none;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 0;
}

.stats-row div {
  min-width: 170px;
  border-right: 1px solid rgba(66, 71, 84, 0.55);
  padding: 0 28px;
}

.stats-row div:last-child {
  border-right: 0;
}

.stats-row strong {
  display: block;
  color: var(--on-surface);
  font-size: 2rem;
  font-weight: 850;
}

.stats-row div:nth-child(2) strong {
  color: var(--primary);
}

.stats-row div:nth-child(3) strong {
  color: var(--tertiary);
}

.stats-row span {
  display: block;
  margin-top: 4px;
  color: rgba(194, 198, 214, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace {
  margin-top: 34px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-bottom: 14px;
}

.workspace-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.data-panel {
  overflow: hidden;
  border: 1px solid rgba(66, 71, 84, 0.4);
  border-radius: 10px;
  background: var(--surface-container);
  box-shadow: 0 24px 60px var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(66, 71, 84, 0.36);
  background: rgba(45, 52, 73, 0.5);
  padding: 15px 24px;
  color: var(--on-surface);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.text-tertiary {
  color: var(--tertiary);
}

#context-count {
  border: 1px solid rgba(66, 71, 84, 0.58);
  border-radius: 5px;
  background: rgba(23, 31, 51, 0.86);
  color: rgba(194, 198, 214, 0.9);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  padding: 3px 8px;
  text-transform: none;
}

.validation-banner {
  border-bottom: 1px solid rgba(147, 0, 10, 0.5);
  background: rgba(147, 0, 10, 0.16);
  color: #ffdad6;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 12px 24px;
}

.technical-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.technical-table th {
  border-bottom: 1px solid rgba(66, 71, 84, 0.42);
  background: var(--surface-container-low);
  color: rgba(194, 198, 214, 0.9);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  padding: 13px 12px;
  text-transform: uppercase;
}

.technical-table th:first-child,
.technical-table td:first-child {
  padding-left: 24px;
}

.technical-table th:last-child,
.technical-table td:last-child {
  padding-right: 24px;
}

.technical-table tbody tr {
  border-bottom: 1px solid rgba(66, 71, 84, 0.18);
  transition: background-color 180ms ease;
}

.technical-table tbody tr:hover {
  background: var(--surface-container-highest);
}

.technical-table td {
  padding: 10px 12px;
  vertical-align: top;
  font-size: 0.91rem;
  line-height: 1.5;
}

.extension-cell {
  width: 150px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 800;
  white-space: nowrap;
}

.extension-value {
  display: block;
}

.extension-source {
  display: block;
  margin-top: 4px;
  color: rgba(194, 198, 214, 0.58);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
}

.extension-variant {
  display: inline-flex;
  width: max-content;
  border: 1px solid rgba(255, 183, 134, 0.25);
  border-radius: 5px;
  background: rgba(255, 183, 134, 0.08);
  color: var(--tertiary);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  text-transform: uppercase;
}

.name-cell {
  width: 25%;
  color: var(--on-surface);
  font-family: var(--font-cjk);
  font-weight: 700;
}

.description-cell {
  color: rgba(194, 198, 214, 0.96);
  font-family: var(--font-cjk);
}

.status-cell {
  width: 140px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.normal {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.status-badge.legacy {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}

.status-badge.deprecated {
  border: 1px solid rgba(255, 180, 171, 0.22);
  background: rgba(147, 0, 10, 0.32);
  color: var(--error);
}

.status-badge.temporary {
  border: 1px solid rgba(140, 144, 159, 0.6);
  color: var(--on-surface-variant);
}

.status-badge.questionable,
.status-badge.unknown {
  background: var(--error);
  color: var(--on-error);
}

.loading-cell,
.empty-cell {
  color: var(--on-surface-variant);
  padding: 28px 24px !important;
  text-align: center;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  color: var(--on-surface-variant);
  font-size: 0.88rem;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pager-controls button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  padding: 7px 8px;
  transition: color 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.pager-controls button:hover:not(:disabled) {
  background: rgba(173, 198, 255, 0.06);
  color: var(--primary);
}

.pager-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

#page-indicator {
  min-width: 68px;
  color: rgba(194, 198, 214, 0.8);
  font-family: var(--font-mono);
  text-align: center;
}

.filter-overlay[hidden] {
  display: none;
}

.filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.filter-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 8, 20, 0.68);
  cursor: default;
  backdrop-filter: blur(8px);
}

.filter-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  overflow: hidden;
  border: 1px solid rgba(66, 71, 84, 0.62);
  border-radius: 10px;
  background: rgba(23, 31, 51, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.filter-dialog-header,
.filter-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.filter-dialog-header {
  border-bottom: 1px solid rgba(66, 71, 84, 0.42);
  background: rgba(45, 52, 73, 0.5);
}

.filter-dialog-header h2 {
  margin: 0;
  color: var(--on-surface);
  font-size: 1.18rem;
  font-weight: 850;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(173, 198, 255, 0.08);
  color: var(--primary);
  outline: none;
}

.status-filter {
  display: grid;
  gap: 10px;
  padding: 18px 20px 10px;
}

.status-filter label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid rgba(66, 71, 84, 0.42);
  border-radius: 8px;
  background: rgba(19, 27, 46, 0.72);
  color: rgba(218, 226, 253, 0.92);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0 14px;
}

.status-filter label:hover {
  border-color: rgba(173, 198, 255, 0.35);
  background: rgba(34, 42, 61, 0.9);
}

.status-filter input {
  order: 2;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-container);
}

.filter-help {
  margin: 0;
  color: rgba(194, 198, 214, 0.75);
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 0 20px 4px;
}

.filter-dialog-footer {
  border-top: 1px solid rgba(66, 71, 84, 0.34);
}

.ghost-button,
.primary-button {
  min-height: 38px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  padding: 0 14px;
  text-transform: uppercase;
}

.ghost-button {
  border: 0;
  background: transparent;
  color: var(--primary);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: rgba(173, 198, 255, 0.08);
  outline: none;
}

.primary-button {
  border: 0;
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.primary-button:hover,
.primary-button:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.legend-section {
  margin-top: 78px;
  border-top: 1px solid rgba(66, 71, 84, 0.35);
  padding-top: 38px;
}

.legend-section h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  color: var(--on-surface);
  font-size: 1.35rem;
}

.legend-section h2 .material-symbols-outlined {
  color: var(--primary);
}

.legend-section > div > p:last-child {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--on-surface-variant);
  line-height: 1.6;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.legend-card {
  min-height: 155px;
  border: 1px solid rgba(66, 71, 84, 0.42);
  border-radius: 8px;
  background: var(--surface-container-low);
  padding: 22px;
  transition: background-color 180ms ease;
}

.legend-card:hover {
  background: var(--surface-container);
}

.legend-card.wide {
  grid-column: span 2;
}

.legend-card h3 {
  margin: 22px 0 8px;
  color: var(--on-surface);
  font-size: 1rem;
}

.legend-card p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .main-canvas {
    padding-right: 24px;
    padding-left: 24px;
  }

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

@media (max-width: 900px) {
  .brand-wrap {
    min-width: 0;
  }

  .brand-subtitle {
    display: none;
  }

  .main-canvas {
    width: 100%;
    margin-left: 0;
  }

  .hero-panel {
    min-height: 330px;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .main-canvas {
    padding-right: 14px;
    padding-left: 14px;
    padding-top: 18px;
  }

  .hero-content {
    padding: 32px 14px;
  }

  .command-search input {
    padding-right: 22px;
  }

  .stats-row {
    flex-direction: column;
    gap: 16px;
  }

  .stats-row div {
    border-right: 0;
    border-bottom: 1px solid rgba(66, 71, 84, 0.42);
    padding: 0 0 16px;
  }

  .stats-row div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .panel-header,
  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .technical-table,
  .technical-table tbody,
  .technical-table tr,
  .technical-table td {
    display: block;
    width: 100%;
  }

  .technical-table thead {
    display: none;
  }

  .technical-table tbody tr {
    padding: 14px 16px;
  }

  .technical-table tbody tr:hover {
    background: transparent;
  }

  .technical-table td,
  .technical-table th:first-child,
  .technical-table td:first-child,
  .technical-table th:last-child,
  .technical-table td:last-child {
    padding: 5px 0;
  }

  .technical-table td::before {
    display: block;
    margin-bottom: 2px;
    color: rgba(194, 198, 214, 0.62);
    content: attr(data-label);
    font-family: var(--font-ui);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .extension-cell,
  .name-cell,
  .status-cell {
    width: 100%;
  }

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

  .legend-card.wide {
    grid-column: span 1;
  }
}
