/* DeepSeek 搜索 — local start page, styled after www.deepseek.com */

@font-face {
  font-family: "DM Sans";
  src: url("vendor/dm-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("vendor/dm-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("vendor/dm-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --font-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: var(--font-ui);
  --font-mono: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --bg: #f9f8f8;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.35);
  --surface-muted: rgba(21, 36, 67, 0.07);
  --surface-glass: rgba(255, 255, 255, 0.36);
  --topbar-bg: rgba(249, 248, 248, 0.76);
  --reader-bg: #f9f8f8;
  --text: #1e232c;
  --text-secondary: rgba(0, 0, 0, 0.66);
  --text-tertiary: rgba(0, 0, 0, 0.48);
  --text-faint: rgba(0, 0, 0, 0.3);
  --line: rgba(9, 45, 78, 0.1);
  --line-strong: rgba(9, 45, 78, 0.18);
  --dot: rgba(65, 118, 230, 0.55);

  --brand: #4d6bfe;
  --brand-medium: #4176e6;
  --brand-strong: #3157b8;
  --brand-soft: rgba(77, 107, 254, 0.1);
  --brand-soft-strong: rgba(77, 107, 254, 0.19);
  --link: #234792;
  --url: #3a65c2;
  --teal: #4176e6;
  --violet: #4d6bfe;
  --amber: #3a65c2;
  --amber-soft: rgba(255, 255, 255, 0.32);
  --amber-line: rgba(255, 255, 255, 0.66);
  --success: #2f6b55;
  --success-soft: rgba(58, 123, 96, 0.1);
  --danger: #b5433f;
  --danger-soft: #fff4f3;
  --danger-line: #f0cbc8;
  --wordmark-1: #234792;
  --wordmark-2: #3157b8;
  --wordmark-3: #4176e6;

  --sky-top: #9cc1e7;
  --sky-fade: rgba(249, 248, 248, 0);
  --hero-title: #152443;
  --hero-muted: rgba(21, 36, 67, 0.64);
  --header-logo-filter: none;

  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-bg-strong: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-border-strong: rgba(255, 255, 255, 0.95);
  --glass-blur: 12px;
  --panel-bg: rgba(255, 255, 255, 0.56);
  --panel-border: rgba(255, 255, 255, 0.75);
  --chrome-bg: rgba(255, 255, 255, 0.3);
  --chrome-bg-hover: rgba(255, 255, 255, 0.5);
  --chrome-border: rgba(255, 255, 255, 0.6);
  --chrome-text: rgba(21, 36, 67, 0.68);
  --chrome-text-strong: #1e232c;
  --input-bg: rgba(255, 255, 255, 0.36);
  --input-border: rgba(9, 45, 78, 0.12);
  --input-focus-bg: rgba(255, 255, 255, 0.74);
  --result-hover: rgba(255, 255, 255, 0.44);
  --primary-btn-bg: #4176e6;
  --primary-btn-hover: #3157b8;
  --primary-btn-text: #ffffff;

  --focus-ring: rgba(65, 118, 230, 0.2);
  --shadow-xs: 0 1px 2px rgba(16, 32, 55, 0.04);
  --shadow-sm: 0 2px 4px rgba(16, 32, 55, 0.04), 0 10px 24px rgba(16, 32, 55, 0.05);
  --shadow-md: 0 18px 50px -28px rgba(26, 51, 86, 0.28);
  --shadow-lg: 0 28px 90px -30px rgba(20, 40, 70, 0.34);
  --toast-bg: #152443;
  --toast-text: #f9f8f8;
  --skeleton-a: rgba(255, 255, 255, 0.3);
  --skeleton-b: rgba(255, 255, 255, 0.7);
  --selection: rgba(77, 107, 254, 0.18);
}


@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1220;
    --surface: #131d2e;
    --surface-soft: rgba(255, 255, 255, 0.06);
    --surface-muted: rgba(255, 255, 255, 0.08);
    --surface-glass: rgba(18, 28, 46, 0.64);
    --topbar-bg: rgba(11, 18, 32, 0.78);
    --reader-bg: #0e1623;
    --text: #f2f5ff;
    --text-secondary: rgba(242, 245, 255, 0.72);
    --text-tertiary: rgba(242, 245, 255, 0.5);
    --text-faint: rgba(242, 245, 255, 0.32);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --dot: rgba(135, 160, 255, 0.6);

    --brand: #87a0ff;
    --brand-medium: #6f92ff;
    --brand-strong: #c1ceff;
    --brand-soft: rgba(135, 160, 255, 0.13);
    --brand-soft-strong: rgba(135, 160, 255, 0.25);
    --link: #bfd0ff;
    --url: #8fb8ea;
    --teal: #87a0ff;
    --violet: #87a0ff;
    --amber: #bcd0ff;
    --amber-soft: rgba(255, 255, 255, 0.06);
    --amber-line: rgba(255, 255, 255, 0.14);
    --success: #8ad9c8;
    --success-soft: rgba(86, 190, 166, 0.12);
    --danger: #ff9ca4;
    --danger-soft: #311d24;
    --danger-line: #5a303a;
    --wordmark-1: #9db6ff;
    --wordmark-2: #6f92ff;
    --wordmark-3: #c1ceff;

    --sky-top: #1b3354;
    --sky-fade: rgba(11, 18, 32, 0);
    --hero-title: #f2f5ff;
    --hero-muted: rgba(242, 245, 255, 0.66);
    --header-logo-filter: brightness(1.45) saturate(1.1);

    --glass-bg: rgba(16, 26, 44, 0.36);
    --glass-bg-strong: rgba(20, 31, 52, 0.58);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-strong: rgba(255, 255, 255, 0.2);
    --panel-bg: rgba(18, 28, 47, 0.68);
    --panel-border: rgba(255, 255, 255, 0.13);
    --chrome-bg: rgba(17, 27, 45, 0.56);
    --chrome-bg-hover: rgba(29, 43, 68, 0.8);
    --chrome-border: rgba(255, 255, 255, 0.12);
    --chrome-text: rgba(242, 245, 255, 0.7);
    --chrome-text-strong: #f2f5ff;
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus-bg: rgba(255, 255, 255, 0.09);
    --result-hover: rgba(255, 255, 255, 0.055);
    --primary-btn-bg: #6f92ff;
    --primary-btn-hover: #8aa6ff;
    --primary-btn-text: #0b1220;

    --focus-ring: rgba(111, 146, 255, 0.25);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 8px 26px -18px rgba(0, 0, 0, 0.7);
    --shadow-md: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 34px 110px -30px rgba(0, 0, 0, 0.9);
    --toast-bg: #eaf0ff;
    --toast-text: #0b1220;
    --skeleton-a: rgba(255, 255, 255, 0.05);
    --skeleton-b: rgba(255, 255, 255, 0.1);
    --selection: rgba(135, 160, 255, 0.3);
  }

}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #131d2e;
  --surface-soft: rgba(255, 255, 255, 0.06);
  --surface-muted: rgba(255, 255, 255, 0.08);
  --surface-glass: rgba(18, 28, 46, 0.64);
  --topbar-bg: rgba(11, 18, 32, 0.78);
  --reader-bg: #0e1623;
  --text: #f2f5ff;
  --text-secondary: rgba(242, 245, 255, 0.72);
  --text-tertiary: rgba(242, 245, 255, 0.5);
  --text-faint: rgba(242, 245, 255, 0.32);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --dot: rgba(135, 160, 255, 0.6);

  --brand: #87a0ff;
  --brand-medium: #6f92ff;
  --brand-strong: #c1ceff;
  --brand-soft: rgba(135, 160, 255, 0.13);
  --brand-soft-strong: rgba(135, 160, 255, 0.25);
  --link: #bfd0ff;
  --url: #8fb8ea;
  --teal: #87a0ff;
  --violet: #87a0ff;
  --amber: #bcd0ff;
  --amber-soft: rgba(255, 255, 255, 0.06);
  --amber-line: rgba(255, 255, 255, 0.14);
  --success: #8ad9c8;
  --success-soft: rgba(86, 190, 166, 0.12);
  --danger: #ff9ca4;
  --danger-soft: #311d24;
  --danger-line: #5a303a;
  --wordmark-1: #9db6ff;
  --wordmark-2: #6f92ff;
  --wordmark-3: #c1ceff;

  --sky-top: #1b3354;
  --sky-fade: rgba(11, 18, 32, 0);
  --hero-title: #f2f5ff;
  --hero-muted: rgba(242, 245, 255, 0.66);
  --header-logo-filter: brightness(1.45) saturate(1.1);

  --glass-bg: rgba(16, 26, 44, 0.36);
  --glass-bg-strong: rgba(20, 31, 52, 0.58);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.2);
  --panel-bg: rgba(18, 28, 47, 0.68);
  --panel-border: rgba(255, 255, 255, 0.13);
  --chrome-bg: rgba(17, 27, 45, 0.56);
  --chrome-bg-hover: rgba(29, 43, 68, 0.8);
  --chrome-border: rgba(255, 255, 255, 0.12);
  --chrome-text: rgba(242, 245, 255, 0.7);
  --chrome-text-strong: #f2f5ff;
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-focus-bg: rgba(255, 255, 255, 0.09);
  --result-hover: rgba(255, 255, 255, 0.055);
  --primary-btn-bg: #6f92ff;
  --primary-btn-hover: #8aa6ff;
  --primary-btn-text: #0b1220;

  --focus-ring: rgba(111, 146, 255, 0.25);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 8px 26px -18px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 34px 110px -30px rgba(0, 0, 0, 0.9);
  --toast-bg: #eaf0ff;
  --toast-text: #0b1220;
  --skeleton-a: rgba(255, 255, 255, 0.05);
  --skeleton-b: rgba(255, 255, 255, 0.1);
  --selection: rgba(135, 160, 255, 0.3);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--link);
}

img,
svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-small {
  width: 14px;
  height: 14px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* DeepSeek homepage sky + moving cloud shader */
body {
  position: relative;
}

.ambient {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 0;
  height: min(100svh, 1020px);
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-fade) 100%);
}

.cloud-canvas,
.grid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.99) 0%,
    rgba(0, 0, 0, 0.91) 8.98%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.99) 0%,
    rgba(0, 0, 0, 0.91) 8.98%,
    transparent 100%
  );
}

.cloud-canvas {
  z-index: 0;
}

.grid-canvas {
  z-index: 1;
}

.app-main,
.app-footer {
  position: relative;
  z-index: 1;
}

.orb {
  display: none;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.topbar-inner {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}


.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-medium);
  text-decoration: none;
  border-radius: 10px;
}

.brand {
  color: var(--brand-medium);
}

.deepseek-wordmark {
  width: 143px;
  height: 23px;
  filter: var(--header-logo-filter);
  transition: opacity 0.2s ease;
}

.brand:hover .deepseek-wordmark {
  opacity: 0.82;
}

.brand:hover .brand-mark {
  transform: none;
}

.brand-rule {
  width: 1px;
  height: 15px;
  margin: 0 2px 0 5px;
  background: rgba(21, 36, 67, 0.22);
}

.brand-suffix {
  color: var(--hero-title);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  white-space: nowrap;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(145deg, #5c7bff 0%, #3157eb 48%, #2441c8 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.27),
    0 7px 17px -9px rgba(34, 63, 190, 0.75);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
}

.brand:hover .brand-mark {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.27),
    0 10px 20px -8px rgba(34, 63, 190, 0.75);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-text {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.brand-text em {
  margin-left: 2px;
  color: var(--text-secondary);
  font-style: normal;
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.local-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 6px;
  padding: 5px 10px;
  border: 1px solid var(--chrome-border);
  border-radius: 999px;
  color: var(--chrome-text);
  background: var(--chrome-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.local-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-medium);
  box-shadow: 0 0 0 3px rgba(65, 118, 230, 0.13);
}

.local-state.is-warning .local-dot {
  background: var(--brand-deep, #3157b8);
  box-shadow: 0 0 0 3px rgba(49, 87, 184, 0.12);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--chrome-text);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
  color: var(--chrome-text-strong);
  background: var(--chrome-bg-hover);
}

.settings-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--chrome-border);
  border-radius: 999px;
  color: var(--chrome-text);
  background: var(--chrome-bg);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.settings-button:hover {
  border-color: var(--glass-border-strong);
  color: var(--chrome-text-strong);
  background: var(--chrome-bg-hover);
  transform: translateY(-1px);
}

.settings-button .icon {
  width: 16px;
  height: 16px;
}

.theme-icon-dark {
  display: none;
}

:root[data-theme="dark"] .theme-icon-light {
  display: none;
}

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

/* Main stage */
.app-main {
  width: 100%;
  flex: 1 0 auto;
}

.search-stage {
  width: min(calc(100% - 48px), 880px);
  margin: 0 auto;
  padding: clamp(64px, 13vh, 136px) 0 36px;
  transition: padding 0.35s ease;
}

.hero {
  margin: 0 auto 29px;
  text-align: center;
  animation: rise-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-emblem {
  position: relative;
  width: max-content;
  margin: 0 auto 13px;
  filter: drop-shadow(0 8px 16px rgba(49, 87, 184, 0.12));
}

.hero-whale {
  width: 54px;
  height: auto;
  filter: var(--header-logo-filter);
}

.hero-sparkle {
  position: absolute;
  top: -5px;
  right: -10px;
  width: 15px;
  height: 15px;
  opacity: 0.92;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.135em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hero-eyebrow span + span {
  opacity: 0.55;
}

.eyebrow-star {
  color: var(--brand);
  font-size: 11px;
  letter-spacing: 0;
}

.hero-title {
  margin: 0 0 12px;
  padding-left: 0.28em;
  color: var(--hero-title);
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 400;
  letter-spacing: 0.28em;
  line-height: 1.42;
}

.hero-subtitle {
  margin: 0;
  color: var(--hero-muted);
  font-size: 14px;
  letter-spacing: 0.005em;
  line-height: 1.75;
}

.hero-subtitle em {
  display: inline-block;
  margin: 0 1px;
  padding: 1px 6px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--link);
  background: var(--glass-bg);
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-style: normal;
  line-height: 1.45;
}

.search-zone {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0 auto;
  animation: rise-in 0.7s 0.07s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.search-form {
  margin: 0;
}

.search-field {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 18px 0 22px;
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  background: var(--glass-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 32px -24px rgba(24, 54, 91, 0.32);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    height 0.3s ease,
    border-radius 0.3s ease;
}

.search-field:hover {
  border-color: var(--glass-border-strong);
  background: var(--glass-bg-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 14px 38px -25px rgba(24, 54, 91, 0.36);
}

.search-field:focus-within {
  border-color: var(--glass-border-strong);
  background: var(--input-focus-bg);
  box-shadow:
    0 0 0 3px var(--focus-ring),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 16px 42px -26px rgba(24, 54, 91, 0.34);
}

.search-leading-icon {
  width: 21px;
  height: 21px;
  margin-right: 13px;
  color: var(--hero-muted);
  stroke-width: 1.9;
  transition: color 0.2s ease;
}

.search-field:focus-within .search-leading-icon {
  color: var(--brand-medium);
}

.search-field input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.5;
}

.search-field input[type="search"]::placeholder {
  color: rgba(45, 55, 72, 0.58);
  opacity: 1;
}

:root[data-theme="dark"] .search-field input[type="search"]::placeholder {
  color: rgba(242, 245, 255, 0.48);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .search-field input[type="search"]::placeholder {
    color: rgba(242, 245, 255, 0.48);
  }
}

.search-field input[type="search"]::-webkit-search-decoration,
.search-field input[type="search"]::-webkit-search-cancel-button,
.search-field input[type="search"]::-webkit-search-results-button,
.search-field input[type="search"]::-webkit-search-results-decoration {
  display: none;
}

.search-field-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.keyboard-hint {
  padding: 4px 7px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--chrome-text);
  background: var(--chrome-bg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}

.clear-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--text-tertiary);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.clear-button:hover {
  color: var(--chrome-text-strong);
  background: var(--chrome-bg);
}

.clear-button .icon {
  width: 15px;
  height: 15px;
}

.search-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.btn-primary {
  color: var(--primary-btn-text);
  background: var(--primary-btn-bg);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 7px 18px -10px rgba(49, 87, 184, 0.55);
}

.btn-primary:hover {
  background: var(--primary-btn-hover);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 24px -11px rgba(49, 87, 184, 0.55);
}

.btn-secondary {
  color: var(--chrome-text-strong);
  background: var(--chrome-bg);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
  border-color: var(--glass-border-strong);
  background: var(--glass-bg-strong);
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-leading-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.submit-enter {
  margin-left: 1px;
  padding-left: 8px;
  border-left: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  color: currentColor;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.68;
}

.advanced-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chevron {
  width: 15px;
  height: 15px;
  margin-left: 1px;
  color: var(--text-tertiary);
  transition: transform 0.25s ease;
}

#advancedToggle[aria-expanded="true"] {
  color: var(--brand-medium);
  border-color: var(--brand-soft-strong);
  background: var(--glass-bg-strong);
}

#advancedToggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
  color: var(--brand);
}

.operator-hint {
  margin-left: 8px;
  color: var(--hero-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.operator-hint code {
  padding: 1px 4px;
  border-radius: 4px;
  color: rgba(21, 36, 67, 0.7);
  background: rgba(255, 255, 255, 0.24);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

:root[data-theme="dark"] .operator-hint code {
  color: rgba(242, 245, 255, 0.7);
  background: rgba(255, 255, 255, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .operator-hint code {
    color: rgba(242, 245, 255, 0.7);
    background: rgba(255, 255, 255, 0.07);
  }
}

/* Advanced panel */
.advanced-panel {
  margin-top: 17px;
  padding: 26px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel-bg);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  backdrop-filter: blur(20px) saturate(120%);
  text-align: left;
  animation: panel-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.advanced-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.kicker {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.advanced-head h2 {
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.advanced-intro {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.text-button:hover {
  color: var(--brand);
}

.text-button .icon {
  width: 14px;
  height: 14px;
}

.text-button.danger {
  color: var(--danger);
}

.text-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.advanced-head .text-button {
  flex: 0 0 auto;
  margin-top: 4px;
}

.advanced-head .text-button:hover,
.query-preview .text-button:hover {
  color: var(--brand-medium);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 16px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.field-label small {
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 400;
}

.field input,
.key-field input,
.custom-dates input {
  width: 100%;
  min-width: 0;
  height: 41px;
  padding: 0 12px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: var(--input-bg);
  font-family: var(--font-ui);
  font-size: 13.5px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder,
.key-field input::placeholder {
  color: var(--text-faint);
}

.field input:hover,
.key-field input:hover,
.custom-dates input:hover {
  border-color: var(--glass-border);
}

.field input:focus,
.key-field input:focus,
.custom-dates input:focus {
  border-color: var(--brand-medium);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.advanced-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.advanced-block {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.advanced-block legend {
  margin: 0;
  padding: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.choice-chip {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--chrome-text);
  background: rgba(255, 255, 255, 0.22);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.choice-chip:hover {
  border-color: var(--glass-border-strong);
  color: var(--chrome-text-strong);
  background: rgba(255, 255, 255, 0.4);
}

.choice-chip[aria-pressed="true"] {
  color: var(--brand-medium);
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
  font-weight: 500;
}

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .choice-chip {
    background: rgba(255, 255, 255, 0.04);
  }
}

.custom-dates {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.custom-dates label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-tertiary);
  font-size: 10.5px;
}

.custom-dates input {
  height: 34px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.custom-dates input::-webkit-date-and-time-value {
  text-align: left;
}

.date-separator {
  color: var(--text-tertiary);
  font-size: 10.5px;
}

.advanced-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.count-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}

.count-field-head output {
  color: var(--brand-medium);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  margin: 15px 0 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  outline: 0;
  background: linear-gradient(
    to right,
    var(--brand-medium) 0%,
    var(--brand-medium) var(--range-fill, 18%),
    rgba(21, 36, 67, 0.13) var(--range-fill, 18%),
    rgba(21, 36, 67, 0.13) 100%
  );
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--brand-medium);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(26, 48, 120, 0.16);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.07);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 12px 15px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.switch-copy strong {
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
}

.switch-copy small {
  color: var(--text-tertiary);
  font-size: 10.5px;
  line-height: 1.4;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.switch-ui {
  position: relative;
  width: 39px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(21, 36, 67, 0.18);
  transition: background 0.22s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 31, 55, 0.28);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.switch-row input:checked + .switch-ui {
  background: var(--brand-medium);
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(16px);
}

.switch-row input:focus-visible + .switch-ui {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.query-preview {
  margin-top: 19px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}

.query-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--text-tertiary);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.query-length {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.query-length.is-over {
  color: var(--danger);
  font-weight: 600;
}

.query-preview code {
  display: block;
  max-height: 72px;
  overflow-y: auto;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.query-warning {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
}

.filter-chip {
  padding: 4px 9px;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.key-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 19px auto 0;
  padding: 10px 13px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.27);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  font-size: 12px;
}

.key-notice p {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.key-notice strong {
  color: var(--text);
  font-weight: 650;
}

.key-notice-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--brand-medium);
  background: var(--brand-soft);
}

.key-notice-icon .icon {
  width: 14px;
  height: 14px;
}

.key-notice .key-notice-action {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 8px;
  color: var(--brand-medium);
  background: var(--glass-bg);
}

.key-notice .key-notice-action:hover {
  color: var(--brand-strong);
  background: var(--glass-bg-strong);
}

.hero-footer {
  margin-top: 37px;
  text-align: center;
  animation: rise-in 0.7s 0.13s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.suggestion-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.suggestion-label {
  margin-right: 3px;
  color: var(--hero-muted);
  font-size: 10.5px;
}

.suggestion-chip {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: rgba(21, 36, 67, 0.62);
  background: rgba(255, 255, 255, 0.16);
  font-family: var(--font-ui);
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.suggestion-chip:hover {
  border-color: rgba(255, 255, 255, 0.78);
  color: var(--hero-title);
  background: rgba(255, 255, 255, 0.34);
}

.hero-shortcuts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 22px 0 0;
  color: rgba(21, 36, 67, 0.38);
  font-size: 10.5px;
}

.hero-shortcuts kbd,
.setup-steps kbd,
.safari-row kbd {
  margin: 0 1px;
  padding: 1px 4px;
  border: 1px solid var(--glass-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--chrome-text);
  background: var(--chrome-bg);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.5;
}

.shortcut-dot {
  color: var(--line-strong);
}

/* Results */
body.results-mode .search-stage {
  padding-top: 24px;
  padding-bottom: 10px;
}

body.results-mode .hero,
body.results-mode .hero-footer {
  display: none;
}

body.results-mode .search-field {
  height: 58px;
  border-radius: 20px;
}

body.results-mode .search-field input[type="search"] {
  font-size: 16px;
}

body.results-mode .search-controls {
  margin-top: 12px;
}

body.results-mode .btn {
  height: 39px;
  font-size: 12.5px;
}

body.results-mode .operator-hint {
  display: none;
}

body.results-mode .search-zone {
  animation: none;
}

body.results-mode .advanced-panel {
  margin-top: 13px;
}

body.results-mode .key-notice {
  display: none;
}

.results-section {
  width: min(calc(100% - 48px), 820px);
  margin: 0 auto;
  padding: 6px 0 56px;
  animation: fade-in 0.4s ease both;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.results-summary-wrap {
  min-width: 0;
}

.results-summary {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.55;
}

.results-summary strong {
  color: var(--text);
  font-weight: 600;
}

.results-summary .search-time {
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 10.5px;
}

.sort-control select {
  height: 32px;
  padding: 0 25px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  color: var(--text-secondary);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c879a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9.5 5 5 5-5'/%3E%3C/svg%3E");
  background-position: right 8px center;
  background-repeat: no-repeat;
  font-family: var(--font-ui);
  font-size: 11.5px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.sort-control select:hover {
  border-color: var(--line-strong);
}

.sort-control select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.results-list {
  display: flex;
  flex-direction: column;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.result {
  position: relative;
  margin: 0 -18px;
  padding: 20px 18px 18px;
  border-radius: 16px;
  transition: background 0.2s ease;
}

.result + .result::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--line);
}

.result:hover {
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.result:hover + .result::before,
.result:hover::before {
  opacity: 0;
}

.result::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.2s ease;
}

.result:hover::after {
  background: var(--brand);
}

.result-source {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.4;
}

.site-favicon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.site-favicon img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.site-favicon-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.site-name {
  max-width: 36%;
  overflow: hidden;
  color: var(--text-secondary);
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-dot {
  width: 2px;
  height: 2px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-faint);
}

.result-date {
  color: var(--text-tertiary);
  font-size: 10.5px;
  white-space: nowrap;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid var(--success-soft);
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.45;
  white-space: nowrap;
}

.quality-badge .icon {
  width: 9px;
  height: 9px;
  fill: currentColor;
  stroke: none;
}

.result-title {
  max-width: 760px;
  margin: 8px 0 3px;
  font-size: 19.5px;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.38;
}

.result-title a {
  color: var(--link);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.result-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.result-url {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--url);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.88;
}

.result-snippet {
  display: -webkit-box;
  max-width: 715px;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.result-snippet.is-empty {
  color: var(--text-tertiary);
  font-style: italic;
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  color: var(--text-tertiary);
  font-size: 10.5px;
}

.result-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.result-meta .icon {
  width: 11px;
  height: 11px;
  color: var(--text-faint);
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.fetch-button {
  height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 11px;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.fetch-button:hover {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .fetch-button:hover {
  color: #0b101c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fetch-button:hover {
    color: #0b101c;
  }
}

.fetch-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.fetch-button .icon {
  width: 12px;
  height: 12px;
}

.fetch-button.is-loading .icon {
  display: none;
}

.button-spinner {
  width: 10px;
  height: 10px;
  border: 1.6px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.result-icon-button {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-tertiary);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.result-icon-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.result-icon-button .icon {
  width: 14px;
  height: 14px;
}

/* Loading, empty and error states */
.loading-state {
  padding: 7px 0;
}

.skeleton-result {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 23px 0 25px;
  border-bottom: 1px solid var(--line);
}

.skeleton-result:last-child {
  border-bottom: 0;
}

.skeleton {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--skeleton-a) 20%, var(--skeleton-b) 40%, var(--skeleton-a) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-site {
  width: 112px;
  height: 14px;
  margin-bottom: 4px;
}

.skeleton-title {
  width: min(77%, 520px);
  height: 20px;
  border-radius: 6px;
}

.skeleton-url {
  width: 41%;
  height: 9px;
}

.skeleton-line {
  width: 93%;
  height: 11px;
}

.skeleton-line.short {
  width: 61%;
}

.state-panel {
  margin-top: 10px;
  padding: 58px 24px 54px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
  text-align: center;
}

.state-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.state-icon .icon {
  width: 21px;
  height: 21px;
}

.state-icon.error {
  color: var(--danger);
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.state-panel h2 {
  margin: 10px 0 7px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.state-copy {
  max-width: 460px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}

.state-actions .btn {
  height: 39px;
  font-size: 12.5px;
}

.results-end {
  padding: 38px 0 13px;
  text-align: center;
}

.results-end-rule {
  display: block;
  width: 44px;
  height: 2px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.results-end p {
  margin: 0 0 11px;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.7;
}

.results-end strong {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.results-end .text-button {
  margin: 0 auto;
  justify-content: center;
  color: var(--brand);
}

/* Footer */
.app-footer {
  flex: 0 0 auto;
  padding: 10px 32px max(23px, env(safe-area-inset-bottom));
}

.footer-inner {
  width: min(100%, 880px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 10.5px;
}

.footer-inner p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.footer-mark {
  color: var(--brand);
  font-size: 10px;
}

.footer-inner nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.footer-inner a,
.footer-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  color: var(--text-tertiary);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 10.5px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.footer-inner a:hover,
.footer-button:hover {
  color: var(--text);
}

.footer-button .icon {
  width: 12px;
  height: 12px;
}

/* Dialogs */
dialog {
  color: var(--text);
}

dialog::backdrop {
  background: rgba(8, 13, 25, 0.46);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: backdrop-in 0.25s ease both;
}

.modal {
  width: min(calc(100% - 32px), 670px);
  max-width: 670px;
  max-height: min(90vh, 880px);
  max-height: min(90dvh, 880px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: var(--shadow-lg);
  overflow: visible;
}

.modal[open] {
  animation: modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.safari-dialog {
  width: min(calc(100% - 32px), 620px);
  max-width: 620px;
}

.modal-card {
  max-height: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 0 0 auto;
  padding: 22px 25px 19px;
  border-bottom: 1px solid var(--line);
}

.modal-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}

.modal-icon.safari {
  color: var(--violet);
  border-color: color-mix(in srgb, var(--violet) 22%, transparent);
  background: color-mix(in srgb, var(--violet) 10%, transparent);
}

.modal-icon .icon {
  width: 18px;
  height: 18px;
}

.modal-titles {
  flex: 1;
  min-width: 0;
}

.modal-titles h2 {
  margin: 4px 0 0;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.modal-close {
  align-self: flex-start;
  margin: -5px -7px 0 0;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 25px 24px;
  overscroll-behavior: contain;
}

.setting-section + .setting-section {
  margin-top: 23px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.6;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-tertiary);
  background: var(--surface-soft);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.status-badge.is-configured {
  color: var(--success);
  border-color: var(--success-soft);
  background: var(--success-soft);
}

.status-badge.is-env {
  color: var(--brand);
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
}

.key-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 17px;
}

.key-input-wrap {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.key-input-wrap:hover {
  border-color: var(--line-strong);
}

.key-input-wrap:focus-within {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.key-field input {
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.key-field input:focus,
.key-field input:hover {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.key-visibility {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  color: var(--text-tertiary);
  background: transparent;
  cursor: pointer;
}

.key-visibility:hover {
  color: var(--text);
}

.key-visibility .icon {
  width: 16px;
  height: 16px;
}

.key-visibility .eye-closed {
  display: none;
}

.key-visibility.is-visible .eye-open {
  display: none;
}

.key-visibility.is-visible .eye-closed {
  display: block;
}

.masked-key {
  margin: 9px 0 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.5;
}

.masked-key code {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
}

.form-note {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 11.5px;
  line-height: 1.55;
}

.form-note.is-error {
  color: var(--danger);
}

.form-note.is-success {
  color: var(--success);
}

.form-note.is-loading {
  color: var(--brand);
}

.key-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.key-links a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand);
  font-size: 11.5px;
  text-decoration: none;
  font-weight: 550;
}

.key-links a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.key-links .text-button {
  color: var(--brand);
  font-size: 11.5px;
}

.key-links .text-button.danger {
  color: var(--danger);
}

.link-divider {
  width: 1px;
  height: 10px;
  background: var(--line);
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 17px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-tertiary);
  background: var(--surface-soft);
}

.security-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--text-tertiary);
}

.security-note p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.65;
}

.security-note code {
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.safari-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.safari-glyph {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--violet);
  background: color-mix(in srgb, var(--violet) 10%, transparent);
}

.safari-glyph .icon {
  width: 15px;
  height: 15px;
}

.safari-row p {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11.5px;
  line-height: 1.6;
}

.safari-row kbd {
  margin: 0 1px;
}

.safari-row .text-button {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 10.5px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  padding: 14px 25px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 44%, var(--surface));
}

.modal-note {
  min-width: 0;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.5;
}

.modal-action-buttons {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.modal-actions .btn {
  height: 38px;
  padding: 0 15px;
  font-size: 12px;
}

.modal-actions .btn-ghost {
  padding: 0 11px;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-steps li {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 22px;
}

.setup-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 3px;
  left: 13px;
  width: 1px;
  background: var(--line);
}

.step-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 650;
  line-height: 1;
}

.setup-steps strong {
  display: block;
  margin: 3px 0 5px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

.setup-steps p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.7;
}

.setup-steps code {
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.safari-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 12px;
  color: var(--text-secondary);
  background: var(--brand-soft);
}

.safari-tip .icon {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--brand);
  fill: currentColor;
  stroke: none;
}

.safari-tip p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.7;
}

/* Fetch reader */
.reader-dialog {
  width: min(calc(100% - 56px), 860px);
  max-width: 860px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 24px 0 0 24px;
  background: var(--reader-bg);
  box-shadow: -24px 0 90px rgba(6, 13, 29, 0.3);
  overflow: hidden;
}

.reader-dialog[open] {
  animation: drawer-in 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reader-dialog::backdrop {
  background: rgba(7, 12, 24, 0.52);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: backdrop-in 0.28s ease both;
}

.reader {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--reader-bg);
}

.reader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
  min-height: 62px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--reader-bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.reader-source {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.reader-fetch-badge {
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  background: var(--brand);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

:root[data-theme="dark"] .reader-fetch-badge {
  color: #0b101c;
}

.reader-site {
  max-width: 260px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.reader-action {
  height: 33px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-secondary);
  background: transparent;
  font-family: var(--font-ui);
  font-size: 10.5px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.reader-action:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-soft);
}

.reader-action .icon {
  width: 13px;
  height: 13px;
}

.reader-close {
  width: 34px;
  height: 34px;
  margin-left: 3px;
}

.reader-close .icon {
  width: 17px;
  height: 17px;
}

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.reader-heading {
  width: min(calc(100% - 92px), 700px);
  margin: 46px auto 0;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.reader-overline {
  margin: 0 0 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-heading h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(29px, 3.3vw, 42px);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.reader-url {
  margin: 13px 0 0;
  color: var(--url);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reader-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 14px;
  color: var(--text-tertiary);
  font-family: var(--font-ui);
  font-size: 10px;
}

.reader-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reader-meta .meta-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--text-faint);
}

.reader-body {
  width: min(calc(100% - 92px), 700px);
  margin: 0 auto;
  padding: 29px 0 90px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.86;
  overflow-wrap: anywhere;
}

.reader-loading {
  padding: 45px 0;
  color: var(--text-tertiary);
  font-family: var(--font-ui);
  font-size: 12px;
  text-align: center;
}

.reader-loading p {
  margin: 13px 0 0;
}

.reader-loading-spinner {
  width: 22px;
  height: 22px;
  display: inline-block;
  border: 2px solid var(--brand-soft-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.reader-error {
  padding: 42px 0;
  font-family: var(--font-ui);
  text-align: center;
}

.reader-error .state-icon {
  margin-bottom: 16px;
}

.reader-error h2 {
  margin: 0 0 7px;
  font-size: 20px;
  font-weight: 650;
}

.reader-error p {
  margin: 0 auto 18px;
  max-width: 420px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.7;
}

.reader-empty {
  padding: 42px 0;
  color: var(--text-tertiary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  text-align: center;
}

/* Rendered markdown */
.markdown {
  font-family: var(--font-serif);
}

.markdown > :first-child {
  margin-top: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.markdown h1 {
  margin: 1.5em 0 0.55em;
  font-size: 1.6em;
}

.markdown h2 {
  margin: 1.7em 0 0.55em;
  padding-bottom: 0.28em;
  border-bottom: 1px solid var(--line);
  font-size: 1.34em;
}

.markdown h3 {
  margin: 1.55em 0 0.5em;
  font-size: 1.14em;
}

.markdown h4,
.markdown h5,
.markdown h6 {
  margin: 1.4em 0 0.5em;
  font-size: 1em;
}

.markdown p {
  margin: 0 0 1.05em;
}

.markdown a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.markdown a:hover {
  text-decoration-thickness: 2px;
}

.markdown strong {
  color: var(--text);
  font-weight: 700;
}

.markdown em {
  color: var(--text-secondary);
}

.markdown ul,
.markdown ol {
  margin: 0.5em 0 1.2em;
  padding-left: 1.35em;
}

.markdown li {
  margin: 0.28em 0;
  padding-left: 0.15em;
}

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

.markdown blockquote {
  margin: 1.45em 0;
  padding: 3px 0 3px 19px;
  border-left: 3px solid var(--brand);
  color: var(--text-secondary);
}

.markdown blockquote p:last-child {
  margin-bottom: 0;
}

.markdown img {
  max-width: 100%;
  height: auto;
  margin: 1.3em auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.markdown figure {
  margin: 1.4em 0;
}

.markdown figcaption {
  margin-top: 7px;
  color: var(--text-tertiary);
  font-family: var(--font-ui);
  font-size: 0.72em;
  line-height: 1.6;
  text-align: center;
}

.markdown code {
  padding: 0.12em 0.34em;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text-secondary);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 0.79em;
  overflow-wrap: anywhere;
}

.markdown pre {
  margin: 1.35em 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  color: #e8edf9;
  background: #101827;
  font-size: 0.76em;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

:root[data-theme="dark"] .markdown pre {
  border-color: var(--line);
  background: #0a111e;
}

.markdown pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  overflow-wrap: normal;
}

.markdown hr {
  margin: 2.2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.markdown table {
  width: 100%;
  display: block;
  margin: 1.35em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.78em;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}

.markdown th,
.markdown td {
  padding: 8px 11px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.markdown th {
  color: var(--text);
  background: var(--surface-soft);
  font-weight: 600;
}

.markdown td {
  color: var(--text-secondary);
}

.markdown details {
  margin: 1em 0;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.markdown summary {
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.86em;
}

/* Toast */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: var(--toast-text);
  background: var(--toast-bg);
  box-shadow: 0 12px 35px -12px rgba(9, 17, 37, 0.55);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  animation: toast-in 0.25s ease both;
}

.toast.is-error {
  color: #fff;
  background: #8f2934;
  border-color: rgba(255, 255, 255, 0.1);
}

.toast.is-leaving {
  animation: toast-out 0.25s ease both;
}

.noscript-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  padding: 14px 18px;
  border: 1px solid var(--amber-line);
  border-radius: 12px;
  color: var(--text);
  background: var(--amber-soft);
  font-size: 13px;
  text-align: center;
}

/* Loading states on the search button */
.btn.is-loading .btn-leading-icon {
  display: none;
}

.btn.is-loading::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 1.8px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .submit-enter {
  display: none;
}

/* Animations */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(13px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-7px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawer-in {
  from {
    opacity: 0.7;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Responsive */
@media (max-width: 760px) {
  .topbar-inner {
    padding: 13px 18px;
    gap: 12px;
  }

  .local-state {
    display: none;
  }

  .search-stage {
    width: calc(100% - 32px);
    padding-top: clamp(48px, 10vh, 84px);
    padding-bottom: 28px;
  }

  .hero {
    margin-bottom: 25px;
  }

  .hero-title {
    margin-top: 13px;
    font-size: clamp(40px, 11vw, 52px);
  }

  .hero-subtitle {
    padding: 0 12px;
    font-size: 13px;
    line-height: 1.65;
  }

  .search-field {
    height: 58px;
    padding: 0 12px 0 16px;
    border-radius: 20px;
  }

  .search-leading-icon {
    width: 19px;
    height: 19px;
    margin-right: 10px;
  }

  .search-field input[type="search"] {
    font-size: 16px;
  }

  .keyboard-hint {
    display: none;
  }

  .search-controls {
    gap: 8px;
    margin-top: 14px;
  }

  .btn {
    height: 42px;
    padding: 0 16px;
    font-size: 12.5px;
  }

  .search-controls .btn-primary {
    min-width: 104px;
  }

  .operator-hint {
    display: none;
  }

  .advanced-panel {
    padding: 19px;
    border-radius: 20px;
  }

  .advanced-head {
    gap: 12px;
  }

  .advanced-head h2 {
    font-size: 19px;
  }

  .advanced-intro {
    font-size: 11px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
  }

  .field-wide {
    grid-column: auto;
  }

  .advanced-row {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 19px;
    padding-top: 17px;
  }

  .advanced-bottom {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 19px;
    padding-top: 17px;
  }

  .hero-footer {
    margin-top: 31px;
  }

  .hero-shortcuts {
    display: none;
  }

  .suggestion-row {
    gap: 6px;
  }

  .suggestion-label {
    flex-basis: 100%;
    margin-bottom: 2px;
  }

  .suggestion-chip {
    font-size: 10.5px;
  }

  .key-notice {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 11px 12px;
    font-size: 11px;
  }

  .key-notice p {
    flex-basis: calc(100% - 42px);
  }

  .key-notice-action {
    margin-left: 37px;
  }

  .active-filters {
    justify-content: flex-start;
  }

  body.results-mode .search-stage {
    padding-top: 13px;
  }

  body.results-mode .hero {
    display: none;
  }

  body.results-mode .search-field {
    height: 54px;
  }

  body.results-mode .search-controls {
    margin-top: 9px;
  }

  body.results-mode .btn {
    height: 36px;
    font-size: 12px;
  }

  .results-section {
    width: calc(100% - 32px);
    padding-top: 2px;
    padding-bottom: 36px;
  }

  .results-head {
    align-items: flex-start;
    gap: 12px;
    padding-top: 16px;
  }

  .results-summary {
    font-size: 11.5px;
  }

  .sort-control {
    margin-top: 2px;
  }

  .sort-control > span {
    display: none;
  }

  .sort-control select {
    height: 30px;
    font-size: 10.5px;
  }

  .result {
    margin: 0 -10px;
    padding: 17px 10px 16px;
  }

  .result + .result::before {
    left: 10px;
    right: 10px;
  }

  .result::after {
    left: 0;
  }

  .result-title {
    font-size: 17.5px;
    letter-spacing: -0.012em;
  }

  .result-snippet {
    font-size: 12.5px;
    line-height: 1.68;
    -webkit-line-clamp: 3;
  }

  .site-name {
    max-width: 42%;
  }

  .quality-badge {
    font-size: 8.5px;
  }

  .result-footer {
    margin-top: 11px;
  }

  .fetch-button {
    height: 30px;
  }

  .result-meta {
    font-size: 10px;
  }

  .state-panel {
    padding: 43px 18px 40px;
  }

  .state-panel h2 {
    font-size: 19px;
  }

  .app-footer {
    padding: 3px 18px max(18px, env(safe-area-inset-bottom));
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
  }

  .footer-inner nav {
    justify-content: flex-start;
    gap: 14px;
  }

  .settings-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .settings-button span {
    display: none;
  }

  .modal {
    width: calc(100% - 20px);
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px;
  }

  .modal-card {
    border-radius: 20px;
  }

  .modal-head {
    padding: 17px 18px 15px;
  }

  .modal-titles h2 {
    font-size: 21px;
  }

  .modal-body {
    padding: 18px;
  }

  .modal-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 13px 18px;
  }

  .modal-action-buttons {
    width: 100%;
    justify-content: flex-end;
  }

  .modal-actions .btn {
    height: 37px;
  }

  .modal-note {
    font-size: 9px;
  }

  .safari-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .safari-row p {
    flex: 1 1 calc(100% - 42px);
  }

  .safari-row .text-button {
    margin-left: 38px;
  }

  .reader-dialog {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .reader-top {
    min-height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .reader-site {
    max-width: 34vw;
    font-size: 10.5px;
  }

  .reader-action {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .reader-action span {
    display: none;
  }

  .reader-heading {
    width: calc(100% - 36px);
    margin-top: 27px;
    padding-bottom: 19px;
  }

  .reader-heading h1 {
    font-size: 28px;
  }

  .reader-body {
    width: calc(100% - 36px);
    padding: 23px 0 64px;
    font-size: 16px;
    line-height: 1.82;
  }

  .reader-url {
    font-size: 9px;
  }

  .reader-meta {
    font-size: 9.5px;
  }

  .markdown h1 {
    font-size: 1.45em;
  }

  .markdown h2 {
    font-size: 1.24em;
  }

  .markdown pre {
    margin-right: -4px;
    margin-left: -4px;
    border-radius: 9px;
    font-size: 0.72em;
  }

  .markdown table {
    margin-right: -4px;
    margin-left: -4px;
  }
}

@media (max-width: 390px) {
  .topbar-inner {
    padding-right: 13px;
    padding-left: 13px;
  }

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

  .top-actions {
    gap: 4px;
  }

  .search-stage {
    width: calc(100% - 24px);
  }

  .search-controls .btn-primary {
    min-width: 92px;
    padding: 0 13px;
  }

  .search-controls .btn-secondary {
    padding: 0 12px;
  }

  .advanced-count {
    display: none;
  }

  .modal-titles h2 {
    font-size: 19px;
  }

  .modal-icon {
    width: 35px;
    height: 35px;
  }

  .modal-actions .modal-note {
    display: none;
  }

  .modal-action-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .search-stage {
    padding-top: 32px;
    padding-bottom: 20px;
  }

  .hero {
    margin-bottom: 22px;
  }

  .hero-title {
    margin-top: 10px;
    font-size: 48px;
  }

  .hero-footer {
    margin-top: 22px;
  }

  .hero-shortcuts {
    margin-top: 14px;
  }
}

/* Small runtime state helpers */
html.modal-open {
  overflow: hidden;
}

body.results-mode .active-filters {
  display: none;
}

.reader-action:disabled {
  cursor: wait;
  opacity: 0.42;
}

.reader-action:disabled:hover {
  border-color: transparent;
  color: var(--text-secondary);
  background: transparent;
}

.result-footer.is-actions-only {
  justify-content: flex-end;
}

.query-preview code.is-placeholder {
  color: var(--text-faint);
  font-family: var(--font-ui);
  font-style: italic;
}

#advancedToggle.has-invalid-query {
  border-color: var(--danger-line);
  color: var(--danger);
}

/* ============================================================
   DeepSeek brand surfaces, results and reader
   ============================================================ */

.topbar.is-scrolled {
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.results-head {
  border-top-color: rgba(9, 45, 78, 0.12);
}

.results-summary {
  color: rgba(21, 36, 67, 0.66);
}

.results-summary strong {
  color: var(--hero-title);
  font-weight: 500;
}

.results-summary .search-time {
  color: rgba(21, 36, 67, 0.42);
}

.sort-control {
  color: rgba(21, 36, 67, 0.5);
}

.sort-control select {
  border-color: var(--glass-border);
  color: var(--chrome-text-strong);
  background-color: var(--chrome-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.sort-control select:hover {
  border-color: var(--glass-border-strong);
  background-color: var(--chrome-bg-hover);
}

.result {
  transition: background 0.18s ease;
}

.result:hover {
  background: var(--result-hover);
}

.result + .result::before {
  background: rgba(9, 45, 78, 0.1);
}

.result:hover::after {
  background: var(--brand-medium);
}

.site-favicon {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.48);
}

.site-favicon-fallback {
  color: var(--brand-medium);
  background: var(--brand-soft);
}

.site-name {
  color: rgba(21, 36, 67, 0.7);
  font-weight: 500;
}

.result-date {
  color: rgba(21, 36, 67, 0.44);
}

.quality-badge {
  color: var(--brand-medium);
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
}

.result-title {
  font-weight: 500;
}

.result-title a {
  color: var(--link);
}

.result-url {
  color: var(--url);
}

.result-snippet {
  color: rgba(21, 36, 67, 0.68);
}

.result-meta {
  color: rgba(21, 36, 67, 0.42);
}

.result-meta .icon {
  color: rgba(21, 36, 67, 0.35);
}

.fetch-button {
  color: var(--brand-medium);
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.3);
  font-weight: 500;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.fetch-button:hover {
  color: #ffffff;
  border-color: var(--brand-medium);
  background: var(--brand-medium);
}

.result-icon-button {
  color: rgba(21, 36, 67, 0.45);
}

.result-icon-button:hover {
  color: var(--hero-title);
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.32);
}

.state-panel {
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.24);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.state-icon {
  border-color: var(--glass-border);
  color: var(--brand-medium);
  background: rgba(255, 255, 255, 0.38);
}

.state-icon.error {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-soft);
}

.state-copy {
  color: rgba(21, 36, 67, 0.62);
}

.results-end p {
  color: rgba(21, 36, 67, 0.45);
}

.results-end .text-button {
  color: var(--brand-medium);
}

.filter-chip {
  border-color: var(--glass-border);
  color: var(--brand-medium);
  background: rgba(255, 255, 255, 0.26);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.skeleton {
  background: linear-gradient(90deg, var(--skeleton-a) 20%, var(--skeleton-b) 40%, var(--skeleton-a) 60%);
  background-size: 300% 100%;
}

.app-footer {
  color: var(--text-faint);
}

.footer-inner {
  border-top-color: rgba(9, 45, 78, 0.1);
}

.footer-whale {
  width: 17px;
  height: auto;
  filter: var(--header-logo-filter);
}

.footer-inner a,
.footer-button {
  color: rgba(21, 36, 67, 0.5);
}

.footer-inner a:hover,
.footer-button:hover {
  color: var(--hero-title);
}

/* Dialog and key surfaces */
.modal-card {
  border-color: var(--glass-border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-head {
  border-bottom-color: var(--line);
}

.modal-icon {
  border-color: var(--brand-soft-strong);
  color: var(--brand-medium);
  background: var(--brand-soft);
}

.modal-icon.safari {
  color: var(--brand-medium);
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
}

.modal-actions {
  background: rgba(249, 248, 248, 0.82);
}

.key-input-wrap {
  border-color: var(--input-border);
  background: var(--input-bg);
}

.key-input-wrap:hover {
  border-color: var(--glass-border);
}

.key-input-wrap:focus-within {
  border-color: var(--brand-medium);
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.key-field input {
  border: 0;
  background: transparent;
}

.key-field input:focus,
.key-field input:hover {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.key-links a,
.key-links .text-button {
  color: var(--brand-medium);
}

.security-note {
  border-color: var(--line);
  background: rgba(21, 36, 67, 0.035);
}

.safari-row {
  border-color: var(--line);
  background: rgba(21, 36, 67, 0.035);
}

.safari-glyph {
  color: var(--brand-medium);
  background: var(--brand-soft);
}

.safari-tip {
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
}

.safari-tip .icon {
  color: var(--brand-medium);
}

.setup-steps .step-number {
  border-color: var(--brand-soft-strong);
  color: var(--brand-medium);
  background: var(--brand-soft);
}

.modal-actions .btn-primary {
  box-shadow: 0 7px 18px -11px rgba(49, 87, 184, 0.5);
}

/* Reader */
.reader-dialog {
  border-radius: 20px 0 0 20px;
  background: var(--reader-bg);
}

.reader-dialog::backdrop {
  background: rgba(10, 22, 38, 0.5);
}

.reader-top {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--reader-bg) 86%, transparent);
}

.reader-fetch-badge {
  background: var(--brand-medium);
}

.reader-overline {
  color: rgba(21, 36, 67, 0.36);
}

.reader-heading {
  border-bottom-color: var(--line);
}

.reader-heading h1 {
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.reader-body,
.markdown {
  font-family: var(--font-ui);
}

.reader-body {
  font-size: 16.5px;
  line-height: 1.82;
}

.reader-url {
  color: var(--url);
}

.reader-meta {
  color: rgba(21, 36, 67, 0.42);
}

.reader-action {
  color: rgba(21, 36, 67, 0.58);
}

.reader-action:hover {
  border-color: var(--line);
  color: var(--hero-title);
  background: rgba(21, 36, 67, 0.04);
}

.reader-loading-spinner {
  border-color: rgba(65, 118, 230, 0.18);
  border-top-color: var(--brand-medium);
}

.markdown a {
  color: var(--link);
}

.markdown code {
  border-color: var(--line);
  background: rgba(21, 36, 67, 0.045);
}

.markdown th {
  background: rgba(21, 36, 67, 0.045);
}

.markdown blockquote {
  border-left-color: var(--brand-medium);
}

/* Dark-mode translations of the light glass surfaces */
:root[data-theme="dark"] .local-state,
:root[data-theme="dark"] .settings-button {
  color: var(--chrome-text);
}

:root[data-theme="dark"] .operator-hint code {
  background: rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] .results-head,
:root[data-theme="dark"] .footer-inner,
:root[data-theme="dark"] .reader-heading,
:root[data-theme="dark"] .reader-top {
  border-color: var(--line);
}

:root[data-theme="dark"] .results-summary,
:root[data-theme="dark"] .result-snippet,
:root[data-theme="dark"] .state-copy,
:root[data-theme="dark"] .result-meta,
:root[data-theme="dark"] .result-date,
:root[data-theme="dark"] .site-name,
:root[data-theme="dark"] .reader-meta {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .result:hover {
  background: var(--result-hover);
}

:root[data-theme="dark"] .result + .result::before {
  background: var(--line);
}

:root[data-theme="dark"] .sort-control select,
:root[data-theme="dark"] .fetch-button,
:root[data-theme="dark"] .suggestion-chip,
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .choice-chip,
:root[data-theme="dark"] .state-panel,
:root[data-theme="dark"] .state-icon,
:root[data-theme="dark"] .site-favicon,
:root[data-theme="dark"] .key-notice,
:root[data-theme="dark"] .keyboard-hint {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--glass-border);
}

:root[data-theme="dark"] .fetch-button:hover {
  color: var(--primary-btn-text);
  background: var(--brand-medium);
  border-color: var(--brand-medium);
}

:root[data-theme="dark"] .fetch-button,
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .key-notice-action {
  color: var(--brand-medium);
}

:root[data-theme="dark"] .suggestion-chip {
  color: var(--hero-muted);
}

:root[data-theme="dark"] .suggestion-chip:hover {
  color: var(--hero-title);
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .hero-subtitle em {
  color: var(--link);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .search-field input[type="search"] {
  color: var(--text);
}

:root[data-theme="dark"] .operator-hint code,
:root[data-theme="dark"] .hero-shortcuts {
  color: var(--hero-muted);
}

:root[data-theme="dark"] .modal-actions {
  background: rgba(255, 255, 255, 0.025);
}

:root[data-theme="dark"] .modal-card {
  background: var(--surface);
}

:root[data-theme="dark"] .security-note,
:root[data-theme="dark"] .safari-row {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
}

:root[data-theme="dark"] .sort-control select option {
  color: var(--text);
  background: var(--surface);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .results-summary,
  :root:not([data-theme="light"]) .result-snippet,
  :root:not([data-theme="light"]) .state-copy,
  :root:not([data-theme="light"]) .result-meta,
  :root:not([data-theme="light"]) .result-date,
  :root:not([data-theme="light"]) .site-name,
  :root:not([data-theme="light"]) .reader-meta {
    color: var(--text-secondary);
  }

  :root:not([data-theme="light"]) .result + .result::before {
    background: var(--line);
  }

  :root:not([data-theme="light"]) .sort-control select,
  :root:not([data-theme="light"]) .fetch-button,
  :root:not([data-theme="light"]) .suggestion-chip,
  :root:not([data-theme="light"]) .filter-chip,
  :root:not([data-theme="light"]) .choice-chip,
  :root:not([data-theme="light"]) .state-panel,
  :root:not([data-theme="light"]) .state-icon,
  :root:not([data-theme="light"]) .site-favicon,
  :root:not([data-theme="light"]) .key-notice,
  :root:not([data-theme="light"]) .keyboard-hint {
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--glass-border);
  }

  :root:not([data-theme="light"]) .fetch-button:hover {
    color: var(--primary-btn-text);
    background: var(--brand-medium);
    border-color: var(--brand-medium);
  }

  :root:not([data-theme="light"]) .fetch-button,
  :root:not([data-theme="light"]) .filter-chip,
  :root:not([data-theme="light"]) .key-notice-action {
    color: var(--brand-medium);
  }

  :root:not([data-theme="light"]) .suggestion-chip {
    color: var(--hero-muted);
  }

  :root:not([data-theme="light"]) .suggestion-chip:hover {
    color: var(--hero-title);
    background: rgba(255, 255, 255, 0.08);
  }

  :root:not([data-theme="light"]) .hero-subtitle em {
    color: var(--link);
    background: rgba(255, 255, 255, 0.06);
  }

  :root:not([data-theme="light"]) .reader-heading h1,
  :root:not([data-theme="light"]) .reader-action:hover {
    color: var(--hero-title);
  }

  :root:not([data-theme="light"]) .reader-action {
    color: var(--text-secondary);
  }

  :root:not([data-theme="light"]) .reader-overline {
    color: var(--text-faint);
  }

  :root:not([data-theme="light"]) .reader-url {
    color: var(--url);
  }

  :root:not([data-theme="light"]) .markdown code,
  :root:not([data-theme="light"]) .markdown th {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line);
  }

  :root:not([data-theme="light"]) .modal-actions {
    background: rgba(255, 255, 255, 0.025);
  }

  :root:not([data-theme="light"]) .security-note,
  :root:not([data-theme="light"]) .safari-row {
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--line);
  }

  :root:not([data-theme="light"]) .sort-control select option {
    color: var(--text);
    background: var(--surface);
  }

  :root:not([data-theme="light"]) .footer-inner a,
  :root:not([data-theme="light"]) .footer-button {
    color: var(--text-tertiary);
  }
}

/* ============================================================
   DeepSeek-brand responsive adjustments
   ============================================================ */
@media (max-width: 760px) {
  .deepseek-wordmark {
    width: 124px;
    height: 20px;
  }

  .brand {
    gap: 8px;
  }

  .brand-rule {
    height: 13px;
    margin-right: 1px;
    margin-left: 3px;
  }

  .brand-suffix {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .hero {
    margin-bottom: 24px;
  }

  .hero-emblem {
    margin-bottom: 11px;
  }

  .hero-whale {
    width: 46px;
  }

  .hero-sparkle {
    width: 13px;
    height: 13px;
    top: -3px;
    right: -8px;
  }

  .hero-title {
    margin: 0 0 9px;
    padding-left: 0.22em;
    font-size: clamp(29px, 8.6vw, 34px);
    letter-spacing: 0.22em;
    line-height: 1.5;
  }

  .hero-subtitle {
    padding: 0 10px;
    font-size: 12.5px;
    line-height: 1.7;
  }

  .search-stage {
    padding-top: clamp(46px, 9vh, 76px);
  }

  .search-field {
    border-radius: 22px;
  }

  .key-notice {
    background: rgba(255, 255, 255, 0.32);
  }
}

@media (max-width: 390px) {
  .deepseek-wordmark {
    width: 116px;
    height: 18.6px;
  }

  .brand-rule {
    display: none;
  }

  .brand-suffix {
    font-size: 10.5px;
    letter-spacing: 0.1em;
  }

  .hero-title {
    font-size: 28px;
    letter-spacing: 0.18em;
    padding-left: 0.18em;
  }

  .hero-whale {
    width: 42px;
  }
}


/* Explicit dark-mode (manual toggle) surface corrections */
:root[data-theme="dark"] .results-head,
:root[data-theme="dark"] .footer-inner {
  border-color: var(--line);
}

:root[data-theme="dark"] .results-summary,
:root[data-theme="dark"] .results-summary strong,
:root[data-theme="dark"] .results-summary .search-time,
:root[data-theme="dark"] .sort-control,
:root[data-theme="dark"] .results-end p {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .results-summary strong {
  color: var(--text);
}

:root[data-theme="dark"] .sort-control select {
  color: var(--chrome-text-strong);
  background-color: var(--chrome-bg);
}

:root[data-theme="dark"] .footer-inner a,
:root[data-theme="dark"] .footer-button {
  color: var(--text-tertiary);
}

:root[data-theme="dark"] .footer-inner a:hover,
:root[data-theme="dark"] .footer-button:hover {
  color: var(--text);
}

:root[data-theme="dark"] .brand-rule {
  background: rgba(242, 245, 255, 0.22);
}

:root[data-theme="dark"] .reader-overline {
  color: var(--text-faint);
}

:root[data-theme="dark"] .reader-action {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .reader-action:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .reader-url,
:root[data-theme="dark"] .reader-meta {
  color: var(--text-tertiary);
}

:root[data-theme="dark"] .reader-heading h1,
:root[data-theme="dark"] .reader-site {
  color: var(--text);
}

:root[data-theme="dark"] .reader-close,
:root[data-theme="dark"] .result-icon-button {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .result-icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

:root[data-theme="dark"] .switch-row,
:root[data-theme="dark"] .query-preview {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--glass-border);
}

:root[data-theme="dark"] .advanced-head .text-button:hover,
:root[data-theme="dark"] .query-preview .text-button:hover {
  color: var(--brand-medium);
}

:root[data-theme="dark"] .result-title a {
  color: var(--link);
}

:root[data-theme="dark"] .result-url {
  color: var(--url);
}

:root[data-theme="dark"] .quality-badge {
  color: var(--brand-medium);
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
}

:root[data-theme="dark"] .site-name {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .result-date,
:root[data-theme="dark"] .result-meta {
  color: var(--text-tertiary);
}

:root[data-theme="dark"] .footer-inner {
  color: var(--text-faint);
}


:root[data-theme="dark"] .topbar.is-scrolled {
  border-bottom-color: var(--line);
}

/* ============================================================
   DeepSeek typography scale
   DS tokens: 13 / 14 / 15 / 16 / 18 / 22 / 36 / display 46
   ============================================================ */

@font-face {
  font-family: "Fragment Mono";
  src: url("vendor/fragment-mono-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --type-xs: 13px;
  --type-caption: 14px;
  --type-sm: 15px;
  --type-body: 16px;
  --type-title: 18px;
  --type-heading2: 22px;
  --type-heading1: 36px;
  --type-display: 46px;
  --leading-caption: 1.5;
  --leading-body: 1.6;
  --leading-title: 1.5;
  --leading-display: 1.55;
}

body {
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Header */
.brand-suffix {
  font-size: var(--type-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.local-state {
  font-size: var(--type-xs);
  line-height: 1.5;
}

.settings-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: var(--type-sm);
  font-weight: 500;
}

.icon-button {
  width: 40px;
  height: 40px;
}

/* Hero */
.hero {
  margin-bottom: 36px;
}

.hero-emblem {
  margin-bottom: 16px;
}

.hero-title {
  margin: 0 0 16px;
  padding-left: 0.2em;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: var(--leading-display);
}

.hero-subtitle {
  font-size: var(--type-sm);
  line-height: var(--leading-body);
}

.hero-subtitle em {
  padding: 1px 7px;
  font-size: 0.86em;
}

/* Primary search controls */
.search-field {
  height: 68px;
  padding: 0 20px 0 22px;
  border-width: 2px;
  border-radius: 24px;
}

.search-field input[type="search"] {
  font-size: var(--type-body);
  line-height: 1.4;
}

.search-leading-icon {
  width: 18px;
  height: 18px;
  margin-right: 12px;
}

.keyboard-hint {
  padding: 4px 8px;
  font-size: 12px;
}

.clear-button {
  width: 30px;
  height: 30px;
}

.clear-button .icon {
  width: 16px;
  height: 16px;
}

.search-controls {
  gap: 12px;
  margin-top: 20px;
}

.btn {
  height: 44px;
  padding: 0 20px;
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: 1.2;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.submit-enter {
  font-size: 13px;
}

.advanced-count {
  min-width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: 500;
}

.operator-hint {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.operator-hint code {
  font-size: var(--type-xs);
}

.suggestion-label {
  font-size: var(--type-xs);
}

.suggestion-chip {
  min-height: 32px;
  padding: 0 12px;
  font-size: var(--type-caption);
}

.hero-shortcuts {
  gap: 10px;
  margin-top: 24px;
  font-size: 12px;
}

.hero-shortcuts kbd {
  font-size: 11px;
}

.key-notice {
  padding: 12px 14px;
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.key-notice .key-notice-action {
  padding: 5px 10px;
  font-size: var(--type-caption);
}

/* Advanced panel */
.kicker {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.advanced-head h2 {
  margin-top: 9px;
  font-size: var(--type-heading2);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--leading-title);
}

.advanced-intro {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.text-button {
  gap: 6px;
  font-size: var(--type-xs);
  font-weight: 500;
}

.text-button .icon {
  width: 15px;
  height: 15px;
}

.field-label {
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: 1.2;
}

.field-label small {
  font-size: 12px;
}

.field input,
.key-field input,
.custom-dates input {
  height: 44px;
  font-size: var(--type-sm);
}

.advanced-block legend {
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: 1.2;
}

.choice-chip {
  height: 32px;
  padding: 0 12px;
  font-size: var(--type-xs);
}

.custom-dates label {
  font-size: 12px;
}

.custom-dates input {
  height: 36px;
  font-size: 12px;
}

.count-field-head {
  font-size: var(--type-sm);
  font-weight: 500;
}

.count-field-head output {
  font-size: var(--type-sm);
}

.switch-copy strong {
  font-size: var(--type-sm);
  font-weight: 500;
}

.switch-copy small {
  font-size: 12px;
  line-height: 1.5;
}

.query-preview-head {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 500;
}

.query-preview code {
  font-size: var(--type-xs);
  line-height: 1.6;
}

.query-warning {
  font-size: var(--type-xs);
  line-height: 1.5;
}

.filter-chip {
  padding: 4px 10px;
  font-size: var(--type-xs);
  font-weight: 400;
}

/* Results */
.results-summary {
  margin-top: 9px;
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.results-summary strong {
  font-weight: 500;
}

.sort-control {
  font-size: var(--type-xs);
}

.sort-control select {
  height: 34px;
  padding-right: 27px;
  font-size: var(--type-caption);
}

.result-source {
  gap: 8px;
  font-size: var(--type-caption);
  line-height: 1.5;
}

.site-name {
  font-weight: 500;
}

.result-date {
  font-size: var(--type-xs);
}

.quality-badge {
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 500;
}

.quality-badge .icon {
  width: 10px;
  height: 10px;
}

.result {
  padding: 22px 18px 20px;
}

.result-title {
  margin: 10px 0 4px;
  font-size: var(--type-title);
  font-weight: 500;
  line-height: var(--leading-title);
}

.result-url {
  font-size: var(--type-xs);
  line-height: 1.5;
}

.result-snippet {
  margin-top: 8px;
  font-size: var(--type-sm);
  line-height: var(--leading-body);
}

.result-footer {
  margin-top: 14px;
}

.result-meta {
  gap: 8px;
  font-size: var(--type-xs);
  line-height: 1.5;
}

.result-meta .icon {
  width: 13px;
  height: 13px;
}

.fetch-button {
  height: 32px;
  padding: 0 12px;
  font-size: var(--type-xs);
  font-weight: 500;
}

.fetch-button .icon {
  width: 13px;
  height: 13px;
}

.result-icon-button {
  width: 32px;
  height: 32px;
}

.result-icon-button .icon {
  width: 15px;
  height: 15px;
}

.result-chips {
  margin-top: 13px;
}

.results-end p {
  margin-bottom: 12px;
  font-size: var(--type-xs);
  line-height: 1.6;
}

.results-end strong {
  font-size: 12px;
}

.results-end .text-button {
  font-size: var(--type-xs);
}

.state-panel h2 {
  margin: 11px 0 8px;
  font-size: var(--type-heading2);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--leading-title);
}

.state-copy {
  font-size: var(--type-sm);
  line-height: var(--leading-body);
}

.state-actions .btn {
  height: 42px;
  font-size: var(--type-sm);
}

/* Footer */
.app-footer {
  padding-top: 12px;
}

.footer-inner {
  gap: 20px;
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.footer-inner a,
.footer-button {
  font-size: var(--type-caption);
}

.footer-button .icon {
  width: 14px;
  height: 14px;
}

/* Settings and Safari dialogs */
.modal-titles h2 {
  font-size: var(--type-heading2);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--leading-title);
}

.section-heading h3 {
  font-size: var(--type-title);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: var(--leading-title);
}

.section-heading p {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.status-badge {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 500;
}

.key-field .field-label {
  font-size: var(--type-sm);
}

.key-field input {
  font-size: var(--type-sm);
}

.masked-key {
  font-size: var(--type-xs);
}

.masked-key code {
  font-size: 12px;
}

.form-note {
  font-size: var(--type-xs);
  line-height: var(--leading-caption);
}

.key-links,
.key-links a,
.key-links .text-button {
  font-size: var(--type-caption);
}

.security-note p {
  font-size: var(--type-xs);
  line-height: 1.6;
}

.security-note code {
  font-size: 12px;
}

.safari-row p {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.safari-row .text-button {
  font-size: var(--type-caption);
}

.safari-row kbd,
.setup-steps kbd {
  font-size: 12px;
}

.modal-actions .btn {
  height: 42px;
  padding: 0 18px;
  font-size: var(--type-sm);
}

.modal-note {
  font-size: 12px;
  line-height: var(--leading-caption);
}

.setup-steps strong {
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: var(--leading-title);
}

.setup-steps p {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.setup-steps code {
  font-size: 12px;
}

.step-number {
  font-size: 12px;
  font-weight: 500;
}

.safari-tip p {
  font-size: var(--type-xs);
  line-height: var(--leading-caption);
}

/* Fetch reader */
.reader-site {
  font-size: var(--type-xs);
}

.reader-fetch-badge {
  font-size: 12px;
  font-weight: 500;
}

.reader-action {
  height: 34px;
  padding: 0 10px;
  font-size: var(--type-xs);
}

.reader-action .icon {
  width: 14px;
  height: 14px;
}

.reader-overline {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.reader-heading h1 {
  font-size: var(--type-heading1);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: var(--leading-title);
}

.reader-url {
  font-size: var(--type-xs);
  line-height: 1.5;
}

.reader-meta {
  font-size: var(--type-xs);
  line-height: 1.5;
}

.reader-body {
  font-size: var(--type-body);
  line-height: 1.6;
}

.reader-empty,
.reader-error p {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
}

.reader-error h2 {
  font-size: var(--type-heading2);
  font-weight: 500;
}

.markdown h1 {
  font-size: 1.55em;
}

.markdown h2 {
  font-size: 1.32em;
}

.markdown h3 {
  font-size: 1.15em;
}

.markdown p {
  margin-bottom: 1.05em;
}

.markdown code {
  font-size: 0.8em;
}

.markdown pre {
  font-size: 0.8em;
  line-height: 1.65;
}

.markdown table {
  font-size: 0.82em;
}

/* Toasts */
.toast {
  font-size: var(--type-xs);
  line-height: var(--leading-caption);
}

/* Keep the responsive headline ratio identical to DeepSeek's homepage. */
@media (min-width: 768px) {
  .hero-title {
    padding-left: 0.2em;
    font-size: 42px;
    letter-spacing: 0.2em;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    padding-left: 0.4em;
    font-size: var(--type-display);
    letter-spacing: 0.4em;
  }
}

@media (max-width: 760px) {
  .brand-suffix {
    font-size: var(--type-caption);
    letter-spacing: 0.06em;
  }

  .hero {
    margin-bottom: 28px;
  }

  .hero-whale {
    width: 48px;
  }

  .hero-title {
    margin-bottom: 12px;
    padding-left: 0.2em;
    font-size: 38px;
    letter-spacing: 0.2em;
    line-height: var(--leading-display);
  }

  .hero-subtitle {
    font-size: var(--type-sm);
    line-height: var(--leading-body);
  }

  .search-field {
    height: 62px;
    padding-right: 14px;
    padding-left: 18px;
    border-radius: 22px;
  }

  .search-controls {
    gap: 10px;
    margin-top: 16px;
  }

  .btn {
    height: 44px;
    font-size: var(--type-sm);
  }

  .suggestion-chip {
    font-size: var(--type-xs);
    min-height: 32px;
  }

  .field input,
  .key-field input {
    font-size: var(--type-sm);
  }

  .result-title {
    font-size: var(--type-title);
    line-height: var(--leading-title);
  }

  .result-snippet {
    font-size: var(--type-sm);
    line-height: var(--leading-body);
  }

  .reader-heading h1 {
    font-size: 28px;
    line-height: var(--leading-title);
  }

  .reader-body {
    font-size: var(--type-body);
    line-height: var(--leading-body);
  }

  .footer-inner {
    font-size: var(--type-caption);
  }

  body.results-mode .btn {
    height: 42px;
    font-size: var(--type-caption);
  }

  body.results-mode .search-controls {
    margin-top: 12px;
  }
}

@media (max-width: 390px) {
  .brand-suffix {
    font-size: var(--type-xs);
  }
}

@media (max-width: 640px) {
  .copy-result-link,
  .result-score {
    display: none;
  }

  .result-source {
    flex-wrap: nowrap;
  }

  .site-name {
    max-width: 56%;
  }

  .result-actions {
    gap: 2px;
  }
}

/* ============================================================
   DeepSeek surface corrections — search field & function buttons
   Values mirror the official homepage tokens:
   input bg .2 / .36, border 2px white .8, button glass .4,
   border rgba(9,45,78,.18), radius 100px, DM Sans 15px.
   ============================================================ */

:root {
  --search-bg: rgba(255, 255, 255, 0.2);
  --search-bg-hover: rgba(255, 255, 255, 0.36);
  --search-border: rgba(255, 255, 255, 0.8);
  --search-border-hover: rgba(255, 255, 255, 0.25);
  --search-placeholder: rgba(45, 55, 72, 0.7);
  --btn-glass-bg: rgba(255, 255, 255, 0.4);
  --btn-glass-text: #1e232c;
  --btn-glass-border: rgba(9, 45, 78, 0.18);
  --btn-glass-hover-bg: rgba(0, 0, 0, 0.05);
  --btn-glass-hover-border: rgba(9, 45, 78, 0.36);
}

:root[data-theme="dark"] {
  --search-bg: rgba(255, 255, 255, 0.06);
  --search-bg-hover: rgba(255, 255, 255, 0.12);
  --search-border: rgba(255, 255, 255, 0.16);
  --search-border-hover: rgba(255, 255, 255, 0.26);
  --search-placeholder: rgba(242, 245, 255, 0.5);
  --btn-glass-bg: rgba(255, 255, 255, 0.08);
  --btn-glass-text: #f2f5ff;
  --btn-glass-border: rgba(255, 255, 255, 0.16);
  --btn-glass-hover-bg: rgba(255, 255, 255, 0.12);
  --btn-glass-hover-border: rgba(255, 255, 255, 0.26);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --search-bg: rgba(255, 255, 255, 0.06);
    --search-bg-hover: rgba(255, 255, 255, 0.12);
    --search-border: rgba(255, 255, 255, 0.16);
    --search-border-hover: rgba(255, 255, 255, 0.26);
    --search-placeholder: rgba(242, 245, 255, 0.5);
    --btn-glass-bg: rgba(255, 255, 255, 0.08);
    --btn-glass-text: #f2f5ff;
    --btn-glass-border: rgba(255, 255, 255, 0.16);
    --btn-glass-hover-bg: rgba(255, 255, 255, 0.12);
    --btn-glass-hover-border: rgba(255, 255, 255, 0.26);
  }
}

.search-field {
  border-width: 2px;
  border-color: var(--search-border);
  background: var(--search-bg);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.search-field:hover {
  border-color: var(--search-border-hover);
  background: var(--search-bg-hover);
  box-shadow: none;
}

.search-field:focus-within {
  border-color: var(--search-border-hover);
  background: var(--search-bg-hover);
  box-shadow: none;
}

.search-field input[type="search"]::placeholder {
  color: var(--search-placeholder);
  opacity: 1;
}

:root[data-theme="dark"] .search-field input[type="search"]::placeholder {
  color: var(--search-placeholder);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .search-field input[type="search"]::placeholder {
    color: var(--search-placeholder);
  }
}

.search-leading-icon {
  color: rgba(30, 35, 44, 0.68);
}

.search-field:focus-within .search-leading-icon {
  color: rgba(30, 35, 44, 0.82);
}

:root[data-theme="dark"] .search-leading-icon {
  color: rgba(242, 245, 255, 0.6);
}

.search-controls .btn-primary,
.btn-secondary {
  color: var(--btn-glass-text);
  background: var(--btn-glass-bg);
  border: 1px solid var(--btn-glass-border);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.search-controls .btn-primary:hover,
.btn-secondary:hover {
  color: var(--btn-glass-text);
  background: var(--btn-glass-hover-bg);
  border-color: var(--btn-glass-hover-border);
  box-shadow: none;
}

.search-controls .btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}

#searchSubmit .submit-enter {
  display: none;
}

#searchSubmit .icon {
  color: var(--btn-glass-text);
}

#advancedToggle[aria-expanded="true"] {
  color: var(--brand-medium);
  background: var(--brand-soft);
  border-color: var(--brand-soft-strong);
}

/* More legible supporting copy under the search field */
.operator-hint {
  color: rgba(21, 36, 67, 0.62);
  font-size: var(--type-sm);
  line-height: var(--leading-body);
}

.operator-hint code {
  color: rgba(21, 36, 67, 0.7);
  font-size: var(--type-xs);
}

:root[data-theme="dark"] .operator-hint {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .operator-hint code {
  color: var(--text-secondary);
}

.suggestion-label {
  font-size: var(--type-caption);
}

.suggestion-chip {
  min-height: 34px;
  padding: 0 14px;
  color: var(--btn-glass-text);
  border-color: var(--btn-glass-border);
  background: var(--btn-glass-bg);
  font-size: var(--type-caption);
  font-weight: 400;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.suggestion-chip:hover {
  color: var(--btn-glass-text);
  border-color: var(--btn-glass-hover-border);
  background: var(--btn-glass-hover-bg);
}

.hero-shortcuts {
  font-size: var(--type-xs);
}

.hero-shortcuts kbd {
  font-size: 12px;
}

.keyboard-hint {
  font-size: var(--type-xs);
}

/* Function buttons inside result cards use the same glass button language */
.fetch-button {
  color: var(--btn-glass-text);
  background: var(--btn-glass-bg);
  border: 1px solid var(--btn-glass-border);
  box-shadow: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.fetch-button:hover {
  color: var(--btn-glass-text);
  background: var(--btn-glass-hover-bg);
  border-color: var(--btn-glass-hover-border);
}

:root[data-theme="dark"] .fetch-button:hover {
  color: var(--btn-glass-text);
  background: var(--btn-glass-hover-bg);
  border-color: var(--btn-glass-hover-border);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fetch-button:hover {
    color: var(--btn-glass-text);
    background: var(--btn-glass-hover-bg);
    border-color: var(--btn-glass-hover-border);
  }

  :root:not([data-theme="light"]) .search-leading-icon {
    color: rgba(242, 245, 255, 0.6);
  }
}

.sort-control select {
  color: var(--btn-glass-text);
  background-color: var(--btn-glass-bg);
  border-color: var(--btn-glass-border);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.sort-control select:hover {
  border-color: var(--btn-glass-hover-border);
  background-color: var(--btn-glass-hover-bg);
}

/* Keep the WebGL cloud readable in both appearances. */
:root[data-theme="dark"] .cloud-canvas {
  opacity: 0.58;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cloud-canvas {
    opacity: 0.58;
  }
}

/* Header controls use the same official glass-button surface. */
.settings-button {
  color: var(--btn-glass-text);
  background: var(--btn-glass-bg);
  border-color: var(--btn-glass-border);
}

.settings-button:hover {
  color: var(--btn-glass-text);
  background: var(--btn-glass-hover-bg);
  border-color: var(--btn-glass-hover-border);
}

.local-state {
  color: var(--btn-glass-text);
  background: var(--btn-glass-bg);
  border-color: var(--btn-glass-border);
}

:root[data-theme="dark"] .settings-button,
:root[data-theme="dark"] .local-state {
  color: var(--btn-glass-text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .settings-button,
  :root:not([data-theme="light"]) .local-state {
    color: var(--btn-glass-text);
  }
}

/* DeepSeek homepage native CTA row */
.home-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.home-cta {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid var(--btn-glass-border);
  border-radius: 100px;
  color: var(--btn-glass-text);
  background: var(--btn-glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--font-ui);
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.18s ease;
}

.home-cta:hover {
  color: var(--btn-glass-text);
  border-color: var(--btn-glass-hover-border);
  background: var(--btn-glass-hover-bg);
  transform: translateY(-1px);
}

.home-cta:active {
  transform: translateY(0);
}

.home-cta.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.home-cta-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: currentColor;
  stroke: none;
}

@media (max-width: 760px) {
  .home-ctas {
    gap: 8px;
    margin-top: 22px;
    padding: 0 8px;
  }

  .home-cta {
    min-height: 40px;
    padding: 0 15px;
    font-size: var(--type-caption);
  }

  .home-cta-icon {
    width: 15px;
    height: 15px;
  }
}

/* Search and advanced controls: DeepSeek-blue border/type on a very pale blue fill. */
:root {
  --control-pale-bg: rgba(232, 240, 255, 0.64);
  --control-pale-bg-hover: rgba(220, 233, 255, 0.78);
  --control-blue-border: var(--brand-medium);
  --control-blue-text: var(--brand-medium);
}

:root[data-theme="dark"] {
  --control-pale-bg: rgba(65, 118, 230, 0.2);
  --control-pale-bg-hover: rgba(65, 118, 230, 0.3);
  --control-blue-border: #83a0ff;
  --control-blue-text: #a9bdff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --control-pale-bg: rgba(65, 118, 230, 0.2);
    --control-pale-bg-hover: rgba(65, 118, 230, 0.3);
    --control-blue-border: #83a0ff;
    --control-blue-text: #a9bdff;
  }
}

.search-controls .btn-primary,
.search-controls .btn-secondary {
  color: var(--control-blue-text);
  background: var(--control-pale-bg);
  border-color: var(--control-blue-border);
  box-shadow: none;
}

.search-controls .btn-primary:hover,
.search-controls .btn-secondary:hover {
  color: var(--control-blue-text);
  background: var(--control-pale-bg-hover);
  border-color: var(--control-blue-border);
  box-shadow: none;
}

#searchSubmit .btn-leading-icon,
.search-controls #advancedToggle .icon,
.search-controls #advancedToggle .chevron {
  color: var(--control-blue-text);
}

#advancedToggle[aria-expanded="true"] {
  color: var(--control-blue-text);
  background: var(--control-pale-bg-hover);
  border-color: var(--control-blue-border);
}

#advancedToggle[aria-expanded="true"] .chevron {
  color: var(--control-blue-text);
}

@media (max-width: 760px) {
  .search-controls .btn-primary,
  .search-controls .btn-secondary {
    border-color: var(--control-blue-border);
    background: var(--control-pale-bg);
  }
}
