:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-dark: #000000;
  --surface: #ffffff;
  --surface-alt: #fbfbfd;
  --surface-dark: #1d1d1f;
  --line: rgba(29, 29, 31, 0.1);
  --line-strong: rgba(29, 29, 31, 0.16);
  --text: #1d1d1f;
  --text-secondary: rgba(29, 29, 31, 0.8);
  --text-tertiary: rgba(29, 29, 31, 0.56);
  --text-inverse: #ffffff;
  --blue: #0071e3;
  --blue-link: #0066cc;
  --blue-bright: #2997ff;
  --success: #2f7d32;
  --success-bg: rgba(47, 125, 50, 0.08);
  --warning-bg: rgba(0, 113, 227, 0.08);
  --error: #b3261e;
  --error-bg: rgba(179, 38, 30, 0.08);
  --shadow-soft: rgba(0, 0, 0, 0.08) 0 10px 30px;
  --shadow-card: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 11px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --max-width: 1120px;
  --nav-height: 49px;
  --app-vh: 100vh;
  --workbench-height: min(720px, calc(100svh - var(--nav-height) - 88px));
  --pulse-shadow: rgba(0, 113, 227, 0.24);
  --pulse-shadow-fade: rgba(0, 113, 227, 0);
  --settle-shadow: rgba(47, 125, 50, 0.24);
  --settle-shadow-fade: rgba(47, 125, 50, 0);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #111111;
  --surface: #1c1c1e;
  --surface-alt: #2c2c2e;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.72);
  --text-tertiary: rgba(245, 245, 247, 0.44);
  --text-inverse: #000000;
  --blue: #2997ff;
  --blue-link: #2997ff;
  --blue-bright: #2997ff;
  --success: #4caf50;
  --success-bg: rgba(76, 175, 80, 0.12);
  --warning-bg: rgba(41, 151, 255, 0.12);
  --error: #ef5350;
  --error-bg: rgba(239, 83, 80, 0.12);
  --shadow-soft: rgba(0, 0, 0, 0.4) 0 10px 30px;
  --shadow-card: rgba(0, 0, 0, 0.6) 3px 5px 30px 0;
  --pulse-shadow: rgba(41, 151, 255, 0.36);
  --pulse-shadow-fade: rgba(41, 151, 255, 0);
  --settle-shadow: rgba(76, 175, 80, 0.36);
  --settle-shadow-fade: rgba(76, 175, 80, 0);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(245, 245, 247, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-nav-inner {
  width: min(calc(100vw - 32px), var(--max-width));
  min-height: 48px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

.site-nav-mark {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.site-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.site-nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible {
  color: var(--text);
}

.page-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}

.home-stage {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.hero {
  min-height: calc(var(--app-vh) - var(--nav-height));
  display: grid;
  justify-items: center;
  align-items: center;
  padding: 72px 0 88px;
  background: var(--bg-alt);
  cursor: pointer;
}

.hero-dark {
  color: var(--text);
}

.hero-copy-block {
  width: min(calc(100vw - 48px), var(--max-width));
  padding: 0;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0;
}

.hero-kicker,
.panel-kicker,
.query-plan-eyebrow,
.mobile-filter-picker-kicker {
  margin: 0 0 18px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-brand {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.hero-mark {
  width: clamp(34px, 4vw, 46px);
  height: clamp(34px, 4vw, 46px);
  object-fit: contain;
}

.hero-title-block {
  min-width: 0;
  max-width: 980px;
}

.hero h1 {
  margin: 0;
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(3.4rem, 8.5vw, 6.4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-summary {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.hero-action,
.search-row button,
.action-button,
.link-button,
.drawer-close-button,
.mobile-filter-option,
.mobile-filter-trigger,
.filters-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.hero-action {
  padding: 0 18px;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -0.022em;
}

.hero-action-primary,
.search-row button,
.action-button.primary {
  background: var(--blue);
  color: var(--text-inverse);
  border: 1px solid transparent;
}

.hero-action-secondary {
  background: var(--surface);
  color: var(--blue-link);
  border: 1px solid var(--blue-link);
}

.hero-action:hover,
.hero-action:focus-visible,
.search-row button:hover,
.search-row button:focus-visible,
.action-button.primary:hover,
.action-button.primary:focus-visible {
  transform: translateY(-1px);
}

.hero-action-primary:active,
.search-row button:active,
.action-button.primary:active {
  transform: scale(0.95);
}

.hero-action-secondary:active {
  transform: scale(0.95);
}

.content-stage {
  background: var(--bg-alt);
  min-height: calc(var(--app-vh) - var(--nav-height));
  padding-bottom: 32px;
  scroll-margin-top: var(--nav-height);
}

.search-form,
.results-panel,
.control-block,
.group-tree,
.group-children,
.mobile-filter-picker-copy,
.mobile-filter-picker-options {
  display: grid;
  gap: 16px;
}

.search-form {
  gap: 14px;
  width: 100%;
  padding: 0;
}

.search-stage {
  width: min(calc(100vw - 48px), var(--max-width));
  margin: 0 auto;
  padding: 32px 0 18px;
}

#search-stage {
  scroll-margin-top: calc(var(--nav-height) + 8px);
}

#content-stage {
  scroll-margin-top: var(--nav-height);
}

.source-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 2px;
}

.source-pill {
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.source-pill:hover,
.source-pill:focus-visible {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.source-pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--text-inverse);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-row > * {
  min-width: 0;
}

.search-row input,
.control-block select {
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 18px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-row input {
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  font-weight: 500;
}

.search-row input:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
  outline: none;
}

#submit-button {
  width: 64px;
  min-width: 64px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: var(--radius-pill);
  box-shadow: none;
  --smooth-corners: 5;
  -webkit-mask-image: paint(smooth-corners);
  mask-image: paint(smooth-corners);
}

.search-button-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
}

.search-button-icon::before,
.search-button-icon::after {
  content: "";
  position: absolute;
}

.search-button-icon::before {
  inset: 1px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-button-icon::after {
  width: 8px;
  height: 2px;
  right: -2px;
  bottom: 1px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(45deg);
  transform-origin: center;
}

#query-input,
#search-form,
.source-switch {
  scroll-margin-top: calc(var(--nav-height) + 8px);
}

.control-block {
  position: relative;
}

.control-block label,
.query-plan-stage-label,
.group-meta {
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

.control-block select {
  padding-right: 48px;
  color: var(--text-secondary);
}

.control-block::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 22px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-tertiary);
  border-bottom: 1.5px solid var(--text-tertiary);
  transform: rotate(45deg);
  pointer-events: none;
}

.search-row input:focus-visible,
.control-block select:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
  outline: none;
}

.source-pill:focus-visible,
.filters-toggle:focus-visible,
.drawer-close-button:focus-visible,
.link-button:focus-visible,
.action-button:focus-visible,
.mobile-filter-option:focus-visible,
.mobile-filter-trigger:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.sort-row {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.sort-row .control-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-row .control-block label {
  margin-bottom: 0;
  font-size: 13px;
  white-space: nowrap;
}

.sort-row .control-block select {
  min-height: 36px;
  padding: 0 36px 0 14px;
  font-size: 13px;
  border-radius: var(--radius-md);
  width: auto;
  min-width: 150px;
}

.sort-row .control-block::after {
  bottom: 12px;
}

.workspace {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  width: min(calc(100vw - 48px), var(--max-width));
  margin: 0 auto;
  margin-top: 0;
  padding: 20px;
  min-height: var(--workbench-height);
  align-items: start;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 24px;
  backdrop-filter: saturate(180%) blur(18px);
}

.results-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.workspace.is-source-sukebei {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.is-source-sukebei .sidebar,
.workspace.is-source-sukebei .filters-toggle {
  display: none !important;
}

.filters-toggle {
  display: none;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  z-index: 12;
}

.filters-toggle-dots {
  display: inline-flex;
  gap: 4px;
}

.filters-toggle-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.filters-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  display: grid;
  gap: 14px;
  padding: 0 12px 10px 0;
  border-right: 1px solid rgba(29, 29, 31, 0.06);
  height: calc(var(--workbench-height) - 40px);
  max-height: calc(100svh - var(--nav-height) - 80px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 29, 31, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(29, 29, 31, 0.18);
  border-radius: var(--radius-pill);
}

.sidebar::after {
  content: "";
  position: sticky;
  bottom: -10px;
  display: block;
  height: 28px;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.82));
  pointer-events: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-head h2,
.query-plan-head h2,
.mobile-filter-picker-head h2 {
  margin: 0;
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 21px;
  line-height: 1.19;
  letter-spacing: -0.02em;
}

.sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-button,
.action-button.secondary,
.drawer-close-button,
.mobile-filter-option,
.mobile-filter-trigger {
  padding: 0 16px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

.link-button,
.action-button,
.drawer-close-button {
  min-height: 44px;
}

.drawer-close-button {
  display: none;
}

.results-panel > * {
  min-width: 0;
}

.source-note,
.helper-banner,
.status,
.query-plan-panel,
.result-card,
.group-node,
.pagination-note {
  border-radius: var(--radius-lg);
}

.source-note,
.helper-banner,
.status {
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: -0.224px;
  border: 1px solid rgba(29, 29, 31, 0.05);
}

.source-note {
  background: rgba(0, 113, 227, 0.05);
  color: var(--blue-link);
}

.helper-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-secondary);
}

.helper-banner.is-ready {
  background: var(--success-bg);
  color: var(--success);
}

.helper-banner.is-warning {
  background: var(--warning-bg);
  color: var(--blue-link);
}

.helper-banner a {
  color: inherit;
  white-space: nowrap;
}

.status {
  min-height: 56px;
  display: flex;
  align-items: center;
  background: rgba(29, 29, 31, 0.03);
  color: var(--text-secondary);
}

.status.error {
  background: var(--error-bg);
  color: var(--error);
}

.hidden {
  display: none !important;
}

.query-plan-panel {
  padding: 20px;
  border: 1px solid rgba(29, 29, 31, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(250, 250, 252, 0.76));
}

.query-plan-panel.is-complete {
  background: linear-gradient(180deg, #ffffff, #f6fbf6);
}

.query-plan-panel.is-fading {
  animation: panelFadeOut 900ms ease forwards;
}

.query-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.query-plan-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.26);
  animation: pulse 1.8s infinite;
}

.query-plan-panel.is-complete .query-plan-pulse {
  background: var(--success);
  animation: settlePulse 520ms ease forwards;
}

.query-plan-stage {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.query-plan-current {
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: rgba(29, 29, 31, 0.05);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.query-plan-current.is-animating {
  animation: swapWord 480ms ease;
}

.query-plan-panel.is-complete .query-plan-current {
  background: var(--success-bg);
}

.query-plan-caption {
  margin: 12px 0 0;
  min-height: 20px;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.43;
}

.query-plan-caption.is-done {
  color: var(--success);
}

.query-plan-track,
.meta-list,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.query-plan-track {
  margin-top: 16px;
}

.query-plan-chip,
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.05);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
  overflow-wrap: anywhere;
}

.query-plan-chip.active {
  background: var(--blue);
  color: var(--text-inverse);
}

.query-plan-chip.done {
  background: var(--success-bg);
  color: var(--success);
}

.query-plan-chip .reason {
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.results {
  display: grid;
  gap: 16px;
  border-top: none;
}

.result-card,
.group-node {
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 240ms ease forwards;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.result-head {
  display: grid;
  gap: 12px;
}

.result-title {
  margin: 0;
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 21px;
  line-height: 1.24;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.action-row {
  margin-top: 16px;
}

.action-row > * {
  min-width: 0;
  max-width: 100%;
}

.action-button,
.link-button {
  padding: 0 16px;
}

.action-button.is-copied,
.action-button.helper-115-button.is-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(47, 125, 50, 0.18);
}

.action-button.helper-115-button.is-working {
  background: var(--warning-bg);
  color: var(--blue-link);
  border: 1px solid rgba(0, 113, 227, 0.18);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  margin-top: 4px;
  overflow-anchor: none;
}

.pagination-note {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

.pagination.is-empty .pagination-note {
  opacity: 0;
  pointer-events: none;
}

.pagination.is-loading .pagination-note {
  background: var(--warning-bg);
  color: var(--blue-link);
  border-radius: var(--radius-pill);
}

.pagination.is-complete .pagination-note {
  background: transparent;
  color: var(--success);
}

.group-node summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
}

.group-children {
  margin-top: 18px;
}

code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  background: rgba(29, 29, 31, 0.05);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.29;
}

.install-stage {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 247, 0.98));
  padding-bottom: 96px;
}

.install-hero,
.install-section {
  padding: 56px 0;
}

.install-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  justify-items: center;
  background: linear-gradient(180deg, #f5f5f7, #fbfbfd);
}

.install-hero-copy {
  width: min(calc(100vw - 48px), 760px);
  max-width: 760px;
  text-align: center;
}

.install-hero-copy .hero-actions {
  justify-content: center;
}

.install-hero h1,
.install-section h2 {
  margin: 0;
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.04em;
  color: var(--text);
}

.install-hero h1 {
  font-size: clamp(2.9rem, 6vw, 4.5rem);
}

.install-summary,
.install-section-summary,
.install-step-item p,
.install-info-item p {
  margin: 14px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
}

.install-hero-visual {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(calc(100vw - 48px), var(--max-width));
  padding-top: 8px;
}

.install-hero-mark {
  width: clamp(180px, 20vw, 248px);
  max-width: 248px;
  height: auto;
  object-fit: contain;
}

.install-hero-device {
  width: min(100%, 420px);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.install-hero-device p,
.install-section-copy .panel-kicker,
.install-code-line {
  margin-top: 0;
}

.install-hero-device p {
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.install-hero-device strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
}

.install-section {
  border-top: 1px solid rgba(29, 29, 31, 0.08);
  background: #ffffff;
}

.install-section-alt {
  background: #f5f5f7;
}

.install-section-copy {
  width: min(calc(100vw - 48px), var(--max-width));
  max-width: 720px;
  margin-bottom: 28px;
  margin-left: auto;
  margin-right: auto;
}

.install-section h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.install-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(calc(100vw - 48px), var(--max-width));
  margin-left: auto;
  margin-right: auto;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(29, 29, 31, 0.08);
}

.install-step-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
}

.install-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.08);
  color: var(--blue-link);
  font-size: 17px;
  line-height: 1;
}

.install-step-item h3,
.install-info-item h3 {
  margin: 0;
  font-family: "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.01em;
}

.install-code-line {
  margin-bottom: 0;
}

.install-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: min(calc(100vw - 48px), var(--max-width));
  margin: 0 auto;
}

.install-info-item {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: rgba(0, 0, 0, 0.08) 0 4px 24px;
}

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

.mobile-filter-picker {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.mobile-filter-picker-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
}

.mobile-filter-picker-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: min(76vh, 640px);
  min-height: 320px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.mobile-filter-picker-grip {
  width: 40px;
  height: 4px;
  margin: 4px auto 0;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.16);
}

.mobile-filter-picker-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.mobile-filter-picker-options {
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.mobile-filter-option {
  justify-content: flex-start;
  width: 100%;
}

.mobile-filter-option.is-selected,
.mobile-filter-trigger.is-active,
.control-block.is-active select {
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(0, 113, 227, 0.06);
  color: var(--blue-link);
}

.mobile-filter-trigger {
  display: none;
  justify-content: flex-start;
  width: 100%;
  padding-right: 40px;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-shadow, rgba(0, 113, 227, 0.24));
  }
  70% {
    box-shadow: 0 0 0 16px var(--pulse-shadow-fade, rgba(0, 113, 227, 0));
  }
  100% {
    box-shadow: 0 0 0 0 var(--pulse-shadow-fade, rgba(0, 113, 227, 0));
  }
}

@keyframes swapWord {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes settlePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--settle-shadow, rgba(47, 125, 50, 0.24));
  }
  70% {
    transform: scale(1.18);
    box-shadow: 0 0 0 12px var(--settle-shadow-fade, rgba(47, 125, 50, 0));
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--settle-shadow-fade, rgba(47, 125, 50, 0));
  }
}

@keyframes panelFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

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

  .workspace,
  .results-panel {
    min-height: 0;
  }

  .hero-brand {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 18px 18px 20px;
    border-radius: 20px;
    min-height: 0;
  }

  .sidebar {
    position: static;
    top: auto;
    height: auto;
    max-height: none;
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(29, 29, 31, 0.08);
    padding-bottom: 18px;
  }
}

@media (max-width: 720px) {
  html.filters-drawer-open,
  body.filters-drawer-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .site-nav-links {
    display: none;
  }

  .page-shell {
    padding-top: 0;
    padding-bottom: 0;
  }

  .install-stage {
    padding-bottom: 56px;
  }

  .install-hero,
  .install-section {
    padding: 32px 0;
  }

  .install-hero {
    gap: 22px;
  }

  .install-hero-copy {
    text-align: left;
  }

  .install-hero-copy .hero-actions {
    justify-content: flex-start;
  }

  .install-hero-visual {
    justify-items: start;
  }

  .install-hero-device {
    width: 100%;
  }

  .install-step-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero {
    min-height: calc(var(--app-vh) - var(--nav-height));
    padding: 0;
    margin-top: -1px;
  }

  .content-stage {
    min-height: calc(var(--app-vh) - var(--nav-height));
  }

  .hero-copy-block {
    min-height: calc(var(--app-vh) - var(--nav-height));
    align-content: center;
    justify-items: start;
    text-align: left;
    padding: 28px 0 24px;
  }

  .hero-brand {
    justify-items: start;
  }

  .hero-actions {
    justify-content: flex-start;
  }

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

  .search-toolbar {
    display: grid;
    gap: 12px;
  }

  .source-pill {
    width: 100%;
    justify-content: center;
    padding: 0 12px;
  }

  .search-form {
    padding: 0;
  }

  .search-stage {
    width: min(calc(100vw - 32px), var(--max-width));
    padding: 12px 0 16px;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .search-row input {
    font-size: 16px;
    letter-spacing: -0.018em;
  }

  #submit-button {
    width: 58px;
    min-width: 58px;
    height: 52px;
    min-height: 52px;
    border-radius: var(--radius-pill);
  }

  .search-button-icon {
    width: 18px;
    height: 18px;
  }

  .workspace {
    position: relative;
    isolation: auto;
    gap: 16px;
    width: min(calc(100vw - 32px), var(--max-width));
    padding: 16px 14px 18px;
    min-height: 0;
    border-radius: 20px;
  }

  .results-panel {
    min-height: 0;
  }

  .sort-row {
    justify-content: flex-start;
  }

  .sort-row .control-block {
    width: 100%;
  }

  .sort-row .control-block select {
    min-width: 0;
    width: 100%;
  }

  .filters-toggle {
    display: flex;
    position: fixed;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    min-height: 40px;
    gap: 6px;
    padding: 0 14px;
    font-size: 15px;
    line-height: 1;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 30;
  }

  .workspace.is-filter-toggle-visible .filters-toggle {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .workspace.is-filters-open .filters-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .sidebar {
    position: fixed;
    top: 12px;
    left: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    width: min(84vw, 320px);
    max-width: calc(100vw - 56px);
    max-height: none;
    padding: 18px 14px;
    border-right: 0;
    border-bottom: 0;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: rgba(0, 0, 0, 0.12) 0 24px 60px;
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
    z-index: 21;
  }

  .sidebar::after {
    display: none;
  }

  .sidebar-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .drawer-close-button {
    display: inline-flex;
  }

  .sidebar .control-block select {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
  }

  .sidebar .mobile-filter-trigger {
    display: inline-flex;
  }

  .sidebar .control-block::after {
    right: 16px;
    bottom: 19px;
  }

  .filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 20;
  }

  .workspace.is-filters-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .workspace.is-filters-open .filters-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .action-row > * {
    flex: 1 1 calc(50% - 10px);
  }

  .helper-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .source-note,
  .helper-banner,
  .status,
  .query-plan-panel {
    padding: 14px 16px;
  }

  .helper-banner {
    gap: 10px;
  }

  .helper-banner a {
    white-space: normal;
  }

  .query-plan-head {
    align-items: flex-start;
  }

  .query-plan-current {
    min-height: 52px;
    padding: 0 14px;
    font-size: 16px;
  }

  .query-plan-track,
  .meta-list,
  .action-row {
    gap: 8px;
  }

  .query-plan-chip,
  .meta-chip {
    min-height: 32px;
    padding: 0 10px;
  }

  .result-card,
  .group-node {
    padding: 18px 0;
  }

  .result-head {
    gap: 10px;
  }

  .result-title {
    font-size: 19px;
    line-height: 1.3;
  }

  .pagination {
    margin-top: 18px;
  }
}

@media (max-width: 520px) {
  .hero-kicker,
  .panel-kicker,
  .query-plan-eyebrow,
  .mobile-filter-picker-kicker {
    margin-bottom: 14px;
  }

  .hero h1 {
    font-size: 38px;
    line-height: 1.05;
  }

  .hero-summary {
    max-width: 100%;
    font-size: 16px;
  }

  #submit-button {
    width: 52px;
    min-width: 52px;
  }

  .search-row input,
  .control-block select {
    min-height: 50px;
    padding: 0 16px;
  }

  .source-pill {
    font-size: 13px;
    letter-spacing: -0.016em;
  }

  .search-row input {
    font-size: 15px;
    line-height: 1.4;
  }

  .search-stage,
  .workspace,
  .hero-copy-block,
  .install-hero-copy,
  .install-hero-visual {
    width: min(calc(100vw - 24px), var(--max-width));
  }

  .hero-copy-block {
    min-height: calc(var(--app-vh) - var(--nav-height));
    padding: 24px 0 20px;
  }

  .install-hero h1 {
    font-size: 40px;
  }

  .install-step-item h3,
  .install-info-item h3 {
    font-size: 24px;
  }

  .hero-summary,
  .panel-summary {
    font-size: 15px;
  }

  .source-note,
  .helper-banner,
  .status,
  .query-plan-panel {
    padding: 13px 14px;
  }

  .query-plan-panel {
    border-radius: 18px;
  }

  .query-plan-head h2 {
    font-size: 18px;
    line-height: 1.25;
  }

  .query-plan-current {
    min-height: 48px;
    font-size: 15px;
  }

  .query-plan-caption {
    margin-top: 10px;
    font-size: 13px;
  }

  .query-plan-chip,
  .meta-chip {
    min-height: 30px;
    font-size: 11px;
  }

  .result-title {
    font-size: 18px;
  }

  .filters-toggle {
    min-height: 38px;
    min-width: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  .filters-toggle-text {
    display: none;
  }

  .filters-toggle-dots {
    gap: 3px;
  }

  .result-card,
  .group-node,
  .query-plan-panel,
  .source-note,
  .helper-banner,
  .status {
    border-radius: var(--radius-lg);
  }

  .result-card,
  .group-node {
    border-radius: 0;
  }

  .action-row > * {
    flex: 1 1 100%;
  }

  .filters-toggle {
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }
}

/* ── Theme toggle button ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  outline: none;
}

.theme-icon { display: none; }
.theme-icon-moon { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }

/* ── Dark mode overrides for hardcoded colors ── */
[data-theme="dark"] .workspace {
  background: rgba(28, 28, 30, 0.82);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .query-plan-current {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .site-nav {
  background: rgba(28, 28, 30, 0.82);
}

[data-theme="dark"] .filters-toggle {
  background: rgba(28, 28, 30, 0.92);
}

[data-theme="dark"] .sidebar {
  border-right-color: rgba(255, 255, 255, 0.06);
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .sidebar::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(17, 17, 17, 0.82));
}

[data-theme="dark"] .source-note,
[data-theme="dark"] .helper-banner,
[data-theme="dark"] .status {
  border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .helper-banner {
  background: rgba(28, 28, 30, 0.62);
}

[data-theme="dark"] .status {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .query-plan-panel {
  border-color: rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(28, 28, 30, 0.88), rgba(36, 36, 38, 0.88));
}

[data-theme="dark"] .query-plan-panel.is-complete {
  background: linear-gradient(180deg, #1c1c1e, #1a2e1a);
}

[data-theme="dark"] .search-row input,
[data-theme="dark"] .control-block select {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .query-plan-chip,
[data-theme="dark"] .meta-chip {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] code {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .install-stage {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(17, 17, 17, 0.98));
}

[data-theme="dark"] .install-hero {
  background: linear-gradient(180deg, #111111, #1c1c1e);
}

[data-theme="dark"] .install-hero-device {
  background: var(--surface);
}

[data-theme="dark"] .install-section {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: var(--surface);
}

[data-theme="dark"] .install-section-alt {
  background: var(--bg-alt);
}

[data-theme="dark"] .install-step-list {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .install-step-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .mobile-filter-picker-grip {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .sidebar-inner-backdrop {
  background: rgba(28, 28, 30, 0.88);
}

@media (max-width: 720px) {
  [data-theme="dark"] .sidebar {
    background: rgba(28, 28, 30, 0.98);
  }
}
