:root {
  --bg: oklch(0.985 0.006 255);
  --surface: oklch(1 0 0);
  --surface-soft: oklch(0.965 0.012 255);
  --surface-blue: oklch(0.955 0.032 255);
  --text: oklch(0.235 0.064 260);
  --muted: oklch(0.48 0.052 260);
  --muted-strong: oklch(0.38 0.06 260);
  --line: oklch(0.88 0.025 255);
  --line-strong: oklch(0.82 0.04 255);
  --blue: oklch(0.57 0.21 255);
  --blue-deep: oklch(0.43 0.18 255);
  --blue-soft: oklch(0.94 0.04 255);
  --icon-blue-bg: oklch(0.94 0.045 255);
  --icon-cyan-bg: oklch(0.94 0.045 205);
  --icon-teal-bg: oklch(0.94 0.04 188);
  --icon-indigo-bg: oklch(0.94 0.035 278);
  --icon-orange-bg: oklch(0.94 0.055 55);
  --icon-pink-bg: oklch(0.94 0.045 355);
  --icon-green-bg: oklch(0.94 0.045 155);
  --icon-red-bg: oklch(0.94 0.045 15);
  --icon-amber-bg: oklch(0.95 0.055 75);
  --icon-yellow-bg: oklch(0.95 0.05 85);
  --icon-sky-bg: oklch(0.94 0.04 245);
  --icon-emerald-bg: oklch(0.94 0.04 155);
  --icon-purple-bg: oklch(0.94 0.04 292);
  --floating-surface: oklch(1 0 0 / 0.86);
  --bottom-bar-surface: oklch(1 0 0 / 0.92);
  --wallpaper-panel-opacity: 0.82;
  --wallpaper-overlay-top: 0.88;
  --wallpaper-overlay-mid: 0.62;
  --wallpaper-overlay-bottom: 0.74;
  --wallpaper-top-fade-opacity: 0.72;
  --wallpaper-action-opacity: 0.76;
  --wallpaper-text-shadow-opacity: 0.82;
  --wallpaper-scrim-opacity: 0.28;
  --switch-bg: oklch(0.88 0.012 255);
  --cyan: oklch(0.65 0.15 205);
  --green: oklch(0.62 0.16 155);
  --amber: oklch(0.72 0.16 75);
  --rose: oklch(0.62 0.19 15);
  --violet: oklch(0.58 0.18 292);
  --shadow-sm: 0 4px 10px oklch(0.42 0.09 255 / 0.08);
  --shadow-md: 0 10px 24px oklch(0.42 0.09 255 / 0.11);
  --shadow-lg: 0 18px 38px oklch(0.42 0.09 255 / 0.14);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  --bg: oklch(0.16 0.026 260);
  --surface: oklch(0.22 0.032 260);
  --surface-soft: oklch(0.27 0.034 260);
  --surface-blue: oklch(0.29 0.06 255);
  --text: oklch(0.94 0.012 255);
  --muted: oklch(0.72 0.035 255);
  --muted-strong: oklch(0.82 0.028 255);
  --line: oklch(0.36 0.036 255);
  --line-strong: oklch(0.48 0.06 255);
  --blue-soft: oklch(0.31 0.075 255);
  --icon-blue-bg: oklch(0.3 0.075 255);
  --icon-cyan-bg: oklch(0.3 0.07 205);
  --icon-teal-bg: oklch(0.3 0.065 188);
  --icon-indigo-bg: oklch(0.31 0.075 278);
  --icon-orange-bg: oklch(0.31 0.065 55);
  --icon-pink-bg: oklch(0.31 0.075 355);
  --icon-green-bg: oklch(0.3 0.065 155);
  --icon-red-bg: oklch(0.31 0.07 15);
  --icon-amber-bg: oklch(0.32 0.065 75);
  --icon-yellow-bg: oklch(0.32 0.06 85);
  --icon-sky-bg: oklch(0.3 0.07 245);
  --icon-emerald-bg: oklch(0.3 0.065 155);
  --icon-purple-bg: oklch(0.31 0.075 292);
  --floating-surface: oklch(0.24 0.034 260 / 0.9);
  --bottom-bar-surface: oklch(0.22 0.032 260 / 0.94);
  --wallpaper-panel-opacity: 0.86;
  --wallpaper-overlay-top: 0.9;
  --wallpaper-overlay-mid: 0.66;
  --wallpaper-overlay-bottom: 0.82;
  --wallpaper-top-fade-opacity: 0.72;
  --wallpaper-action-opacity: 0.78;
  --wallpaper-text-shadow-opacity: 0.72;
  --wallpaper-scrim-opacity: 0.34;
  --switch-bg: oklch(0.36 0.036 255);
  --shadow-sm: 0 4px 10px oklch(0 0 0 / 0.2);
  --shadow-md: 0 10px 24px oklch(0 0 0 / 0.26);
  --shadow-lg: 0 18px 38px oklch(0 0 0 / 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    "LXGW WenKai",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 47% 3%, oklch(0.83 0.08 252 / 0.52), transparent 23rem),
    radial-gradient(circle at 83% 33%, oklch(0.9 0.04 238 / 0.82), transparent 27rem),
    linear-gradient(110deg, oklch(1 0 0) 0%, var(--bg) 48%, oklch(0.955 0.018 250) 100%);
  background-attachment: fixed;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 47% 3%, oklch(0.34 0.09 252 / 0.35), transparent 23rem),
    linear-gradient(110deg, oklch(0.13 0.018 260) 0%, var(--bg) 100%);
}

body.has-wallpaper {
  background:
    linear-gradient(180deg, oklch(0.98 0.01 255 / var(--wallpaper-overlay-top)), oklch(0.98 0.01 255 / var(--wallpaper-overlay-mid)) 28rem, oklch(0.98 0.01 255 / var(--wallpaper-overlay-bottom))),
    var(--wallpaper-url) center / cover fixed no-repeat;
}

:root[data-theme="dark"] body.has-wallpaper {
  background:
    radial-gradient(circle at 50% 0%, oklch(0.33 0.08 255 / 0.18), transparent 22rem),
    linear-gradient(180deg, oklch(0.1 0.018 260 / var(--wallpaper-overlay-top)), oklch(0.14 0.022 260 / var(--wallpaper-overlay-mid)) 28rem, oklch(0.1 0.018 260 / var(--wallpaper-overlay-bottom))),
    var(--wallpaper-url) center / cover fixed no-repeat;
}

body.has-wallpaper::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 0;
  height: 170px;
  background: linear-gradient(180deg, oklch(1 0 0 / var(--wallpaper-top-fade-opacity)), oklch(1 0 0 / 0));
  pointer-events: none;
}

:root[data-theme="dark"] body.has-wallpaper::before {
  height: 220px;
  background: linear-gradient(180deg, oklch(0.09 0.018 260 / var(--wallpaper-top-fade-opacity)), oklch(0.09 0.018 260 / 0));
}

body.has-wallpaper .sidebar,
body.has-wallpaper .search-bar,
body.has-wallpaper .engine-menu,
body.has-wallpaper .local-search-results,
body.has-wallpaper .site-card,
body.has-wallpaper .category-title-link,
body.has-wallpaper .category-link-panel,
body.has-wallpaper .category-link-panel-full,
body.has-wallpaper .mobile-header,
body.has-wallpaper .mobile-drawer,
body.has-wallpaper .site-dialog,
body.has-wallpaper .engine-dialog,
body.has-wallpaper .settings-panel {
  background: oklch(1 0 0 / var(--wallpaper-panel-opacity));
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] body.has-wallpaper .sidebar,
:root[data-theme="dark"] body.has-wallpaper .search-bar,
:root[data-theme="dark"] body.has-wallpaper .engine-menu,
:root[data-theme="dark"] body.has-wallpaper .local-search-results,
:root[data-theme="dark"] body.has-wallpaper .site-card,
:root[data-theme="dark"] body.has-wallpaper .category-title-link,
:root[data-theme="dark"] body.has-wallpaper .category-link-panel,
:root[data-theme="dark"] body.has-wallpaper .category-link-panel-full,
:root[data-theme="dark"] body.has-wallpaper .mobile-header,
:root[data-theme="dark"] body.has-wallpaper .mobile-drawer,
:root[data-theme="dark"] body.has-wallpaper .site-dialog,
:root[data-theme="dark"] body.has-wallpaper .engine-dialog,
:root[data-theme="dark"] body.has-wallpaper .settings-panel {
  border-color: oklch(0.62 0.05 255 / 0.28);
  background: oklch(0.17 0.028 260 / var(--wallpaper-panel-opacity));
  box-shadow: 0 8px 18px oklch(0 0 0 / 0.2);
}

:root[data-theme="dark"] body.has-wallpaper .search-bar,
:root[data-theme="dark"] body.has-wallpaper .engine-menu,
:root[data-theme="dark"] body.has-wallpaper .local-search-results,
:root[data-theme="dark"] body.has-wallpaper .site-dialog,
:root[data-theme="dark"] body.has-wallpaper .engine-dialog {
  background: oklch(0.14 0.026 260 / var(--wallpaper-panel-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .engine-menu {
  border-color: oklch(0.62 0.05 255 / 0.3);
  box-shadow: 0 16px 34px oklch(0 0 0 / 0.26);
}

:root[data-theme="dark"] body.has-wallpaper .engine-menu-list-default button[role="option"],
:root[data-theme="dark"] body.has-wallpaper .engine-menu button[role="option"],
:root[data-theme="dark"] body.has-wallpaper .engine-menu-icon {
  border-color: oklch(0.62 0.05 255 / 0.24);
  background: oklch(0.2 0.032 260 / var(--wallpaper-panel-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .site-card,
:root[data-theme="dark"] body.has-wallpaper .tool-card,
:root[data-theme="dark"] body.has-wallpaper .category-title-link,
:root[data-theme="dark"] body.has-wallpaper .category-link-panel,
:root[data-theme="dark"] body.has-wallpaper .category-link-panel-full,
:root[data-theme="dark"] body.has-wallpaper .settings-number-field,
:root[data-theme="dark"] body.has-wallpaper .settings-option-row {
  border-color: oklch(0.62 0.05 255 / 0.24);
  background: oklch(0.18 0.03 260 / var(--wallpaper-panel-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .site-card:hover,
:root[data-theme="dark"] body.has-wallpaper .tool-card:hover,
:root[data-theme="dark"] body.has-wallpaper .category-title-link:hover,
:root[data-theme="dark"] body.has-wallpaper .category-title-link.active,
:root[data-theme="dark"] body.has-wallpaper .category-link-panel.is-active {
  border-color: oklch(0.7 0.1 255 / 0.42);
  background: oklch(0.22 0.052 255 / var(--wallpaper-panel-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .site-icon.has-favicon.is-loaded,
:root[data-theme="dark"] body.has-wallpaper .category-link-icon,
:root[data-theme="dark"] body.has-wallpaper .edit-site,
:root[data-theme="dark"] body.has-wallpaper .delete-site {
  background: oklch(0.24 0.036 260 / 0.88);
}

body.has-wallpaper .round-action {
  background: oklch(1 0 0 / var(--wallpaper-action-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .round-action {
  border-color: oklch(0.62 0.05 255 / 0.3);
  background: oklch(0.16 0.028 260 / var(--wallpaper-action-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .hero small,
:root[data-theme="dark"] body.has-wallpaper .tool-card small,
:root[data-theme="dark"] body.has-wallpaper .category-link small,
:root[data-theme="dark"] body.has-wallpaper .settings-panel p,
:root[data-theme="dark"] body.has-wallpaper .settings-option-row small {
  color: oklch(0.83 0.03 255);
  text-shadow: 0 1px 10px oklch(0 0 0 / var(--wallpaper-text-shadow-opacity));
}

body.has-wallpaper .hero p {
  text-shadow: 0 1px 12px oklch(1 0 0 / var(--wallpaper-text-shadow-opacity));
}

:root[data-theme="dark"] body.has-wallpaper .hero p {
  text-shadow: 0 1px 14px oklch(0 0 0 / var(--wallpaper-text-shadow-opacity));
}

button,
input {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:where(a, button, input):focus-visible {
  outline: 3px solid oklch(0.72 0.15 255 / 0.42);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(620px, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.22s var(--ease-out);
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.18s;
  animation-timing-function: var(--ease-out);
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation-name: page-fade-out;
}

::view-transition-new(root) {
  animation-name: page-fade-in;
}

@keyframes page-fade-out {
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.998);
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.998);
  }
}

.mobile-header,
.mobile-drawer,
.mobile-scrim,
.section-title-row > a,
.section-title-row > button {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 22px 28px;
  border-right: 1px solid var(--line);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bottom-bar-surface);
  backdrop-filter: blur(18px);
  transition:
    padding 0.22s var(--ease-out),
    width 0.22s var(--ease-out);
  scrollbar-gutter: stable;
}

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

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: oklch(0.57 0.06 255 / 0.28);
  background-clip: content-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: oklch(0.57 0.06 255 / 0.42);
  background-clip: content-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 28px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 19px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--blue-deep), oklch(0.68 0.17 246));
  box-shadow: 0 8px 14px oklch(0.52 0.2 255 / 0.25);
}

.brand-dot {
  color: var(--blue);
}

.menu-button {
  justify-content: flex-start;
  line-height: 1;
}

.menu-button [data-lucide] {
  display: block;
  flex: 0 0 20px;
  overflow: visible;
  width: 20px;
  height: 20px;
  stroke-width: 2.15;
  transition:
    color 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.menu-button:hover {
  color: var(--blue);
  background: var(--surface-blue);
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 15px;
  border-radius: 12px;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 600;
  transition:
    color 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.nav-item:is(button) {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--blue);
  background: var(--surface-blue);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px oklch(0.57 0.21 255 / 0.06);
}

.sidebar-theme-action[aria-pressed="true"] {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px oklch(0.57 0.21 255 / 0.08);
}

.nav-subtree,
.drawer-subtree {
  display: grid;
}

.nav-subtree summary,
.drawer-subtree summary {
  list-style: none;
  cursor: pointer;
}

.nav-subtree summary::-webkit-details-marker,
.drawer-subtree summary::-webkit-details-marker {
  display: none;
}

.nav-subtree-chevron {
  margin-left: auto;
  transition: transform 0.18s var(--ease-out);
}

.nav-subtree[open] .nav-subtree-chevron,
.drawer-subtree[open] .nav-subtree-chevron {
  transform: rotate(180deg);
}

.nav-submenu,
.drawer-submenu {
  display: grid;
  gap: 4px;
  margin: 6px 0 4px 18px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.nav-subtree:not([open]) .nav-submenu,
.drawer-subtree:not([open]) .drawer-submenu {
  display: none;
}

.category-menu-link {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
  transition:
    color 0.18s var(--ease-out),
    background 0.18s var(--ease-out);
}

.category-menu-link:hover,
.category-menu-link.active {
  color: var(--blue);
  background: var(--surface-blue);
}

.category-menu-link .mini-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.category-menu-link .mini-icon [data-lucide] {
  width: 15px;
  height: 15px;
}

[data-lucide] {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  overflow: visible;
  stroke-width: 2.1;
  vertical-align: middle;
  transform: translateZ(0);
}

.lucide {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
}

.menu-button,
.mobile-search-action,
.top-search-action,
.page-refresh-action {
  appearance: none;
  -webkit-appearance: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.menu-button svg,
.mobile-search-action svg,
.top-search-action svg,
.page-refresh-action svg {
  display: block;
  flex: 0 0 auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
  transform: translateZ(0);
}

.sidebar .menu-button {
  justify-content: flex-start;
}

@supports not (color: oklch(0.57 0.21 255)) {
  .menu-button,
  .mobile-search-action,
  .top-search-action,
  .page-refresh-action {
    color: #2f4f7f;
  }
}

.nav-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 8px 10px;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
}

.chevron {
  color: var(--muted);
}

.category-list {
  overflow: auto;
  padding-right: 4px;
}

.category-list::-webkit-scrollbar {
  width: 0;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(620px, 1fr);
}

body[data-page="categories"] .app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

body[data-page="category"] .app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

body[data-page="tools"] .app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

body[data-page="settings"] .app-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

body[data-page="categories"].sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body[data-page="category"].sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body[data-page="tools"].sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body[data-page="settings"].sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-inline: 14px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand > span,
body.sidebar-collapsed .nav-heading span:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.sidebar-collapsed .menu-button {
  margin-left: 0;
  justify-content: center;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding-inline: 0;
  font-size: 0;
}

body.sidebar-collapsed .menu-button span,
body.sidebar-collapsed .sidebar-theme-action span,
body.sidebar-collapsed .settings-action {
  font-size: 0;
}

body.sidebar-collapsed .nav-subtree {
  justify-items: stretch;
}

body.sidebar-collapsed .nav-subtree summary span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.sidebar-collapsed .nav-item [data-lucide] {
  width: 20px;
  height: 20px;
}

body.sidebar-collapsed .nav-heading {
  justify-content: center;
  margin-inline: 0;
}

body.sidebar-collapsed .chevron {
  display: none;
}

body.sidebar-collapsed .nav-submenu {
  display: none;
}

body.sidebar-collapsed .nav-subtree-chevron {
  display: none;
}

.main-content {
  position: relative;
  min-width: 0;
  padding: 30px 52px 28px;
}

.main-content.is-switching {
  opacity: 0.82;
  transform: translateY(4px);
  transition:
    opacity 0.1s var(--ease-out),
    transform 0.1s var(--ease-out);
}

.main-content.is-switched {
  animation: content-swap-in 0.18s var(--ease-out) both;
}

@keyframes content-swap-in {
  from {
    opacity: 0.88;
    transform: translateY(6px);
  }

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

body[data-page="home"] .main-content {
  padding-top: 24px;
}

.top-actions {
  position: absolute;
  top: 8px;
  right: 32px;
  z-index: 14;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
}

.round-action {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--floating-surface);
  line-height: 1;
  box-shadow: 0 5px 14px oklch(0.42 0.09 255 / 0.1);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out),
    color 0.18s var(--ease-out),
    background 0.18s var(--ease-out);
}

.round-action [data-lucide] {
  display: block;
  flex: 0 0 18px;
  overflow: visible;
  width: 18px;
  height: 18px;
}

.round-action:hover {
  color: var(--blue);
  border-color: var(--line-strong);
  background: var(--surface-blue);
  transform: translateY(-2px);
}

.hero {
  max-width: min(820px, calc(100% - 260px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin: 0 auto 22px;
  padding: 8px 0 2px;
  text-align: center;
}

body[data-page="home"] .hero {
  padding-top: 0;
}

.hero p {
  justify-self: center;
  max-width: 100%;
  min-width: 0;
  display: block;
  margin: 0;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  font-size: 20px;
  line-height: 1.55;
  font-weight: 850;
  text-align: center;
  text-wrap: pretty;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero small {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 750;
}

.quote-mark {
  color: oklch(0.72 0.12 252);
  font-size: 26px;
  font-weight: 900;
  vertical-align: -0.1em;
}

.search-section {
  position: relative;
  z-index: 6;
  max-width: 980px;
  margin: 0 auto 38px;
}

.search-bar {
  position: relative;
  z-index: 1;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: 32px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow-md);
  transition:
    box-shadow 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.search-bar.is-engine-open {
  z-index: 40;
}

.engine-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 41;
  width: calc(100% - 44px);
  max-height: min(400px, calc(100vh - 220px));
  padding: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 28px oklch(0.35 0.08 255 / 0.14);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.58 0.08 255 / 0.45) transparent;
  transform: translateX(-50%);
}

.engine-menu::-webkit-scrollbar {
  width: 10px;
}

.engine-menu::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: oklch(0.58 0.08 255 / 0.42);
  background-clip: content-box;
}

.engine-menu-section {
  display: grid;
  gap: 8px;
}

.engine-menu-label {
  padding: 0 3px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.engine-menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  grid-auto-flow: row;
  gap: 6px;
}

.engine-menu-list-default {
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
}

.engine-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.16s var(--ease-out),
    border-color 0.16s var(--ease-out),
    color 0.16s var(--ease-out),
    transform 0.16s var(--ease-out);
}

.engine-menu button[role="option"],
.engine-menu-manage {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  padding: 0 7px;
}

.engine-menu-list-default button[role="option"] {
  min-height: 38px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.engine-menu-list:not(.engine-menu-list-default) {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.engine-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.engine-menu-row > button[role="option"] {
  min-width: 0;
}

.engine-menu button[role="option"] span:last-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.engine-menu-icon {
  width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted-strong);
  background: var(--surface-soft);
}

.engine-menu-icon [data-lucide],
.engine-menu-manage [data-lucide],
.custom-engine-item [data-lucide] {
  width: 15px;
  height: 15px;
}

.engine-menu-icon.danger,
.custom-engine-item button.danger {
  color: oklch(0.56 0.19 28);
}

.engine-menu-logo {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: white;
  background: linear-gradient(145deg, var(--blue), var(--violet));
  font-size: 11px;
  font-weight: 900;
}

.engine-menu-divider {
  height: 1px;
  margin: 10px 2px;
  background: var(--line);
}

.engine-menu button:hover,
.engine-menu button[aria-selected="true"] {
  color: var(--blue);
  background: var(--blue-soft);
  transform: translateY(-1px);
}

.engine-menu button[role="option"] {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.engine-menu button[role="option"]:hover,
.engine-menu button[role="option"][aria-selected="true"] {
  border-color: oklch(0.57 0.21 255 / 0.3);
}

.engine-menu button[role="option"][aria-selected="true"] {
  box-shadow: inset 0 0 0 1px oklch(0.57 0.21 255 / 0.18);
}

.engine-menu-manage {
  min-height: 34px;
  color: var(--blue);
  background: var(--surface-blue);
}

.local-search-results {
  position: absolute;
  top: calc(100% + 12px);
  right: 18px;
  left: 18px;
  z-index: 35;
  display: grid;
  gap: 6px;
  max-height: min(420px, calc(100vh - 260px));
  padding: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.local-search-results[hidden] {
  display: none;
}

.local-search-result {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.local-search-result:hover,
.local-search-result.is-active {
  background: var(--surface-blue);
}

.local-search-result-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 900;
}

.local-search-result-icon .site-favicon {
  width: 64%;
  height: 64%;
}

.local-search-result-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.local-search-result strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 850;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.local-search-result small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.local-search-result-kbd {
  color: var(--muted);
}

.search-bar:focus-within {
  box-shadow:
    0 0 0 3px oklch(0.72 0.15 255 / 0.28),
    var(--shadow-lg);
  transform: translateY(-1px);
}

.engine-select {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 116px;
  border: 0;
  color: var(--text);
  font-weight: 700;
  background: transparent;
  cursor: pointer;
}

.engine-logo {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: var(--blue);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.engine-logo.google {
  color: oklch(0.55 0.22 255);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.engine-logo.bing {
  background: oklch(0.58 0.14 190);
}

.engine-logo.duckduckgo {
  background: oklch(0.62 0.19 35);
}

.down {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.input-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.search-bar input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.search-submit {
  appearance: none;
  -webkit-appearance: none;
  min-width: 78px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  color: var(--blue);
  background: var(--surface-blue);
  box-shadow: none;
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out),
    color 0.18s var(--ease-out),
    transform 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out);
}

.search-submit:hover {
  border-color: var(--line-strong);
  color: var(--blue-deep);
  background: var(--blue-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.search-submit [data-lucide] {
  display: block;
  flex: none;
  overflow: visible;
  width: 17px;
  height: 17px;
  stroke-width: 2.4;
}

.content-block {
  max-width: 1220px;
  margin: 0 auto 32px;
}

.content-block h1,
.content-block h2 {
  margin: 0 0 15px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.page-title-row {
  max-width: 1220px;
  margin: 24px auto 24px;
}

.page-title-row h1 {
  max-width: 12em;
  margin: 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
  text-wrap: balance;
}

.content-block .page-title-row h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
}

.category-page-head {
  max-width: 1220px;
  margin: 24px auto 24px;
}

.category-page-head p {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
}

.category-page-head h1 {
  max-width: 12em;
}

.category-page-block {
  margin-bottom: 48px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 15px;
}

.section-title-row.page-title-row {
  margin: 24px auto 24px;
}

.section-title-row h1,
.section-title-row h2 {
  flex: 0 0 auto;
  width: max-content;
  margin: 0;
}

.view-all-action {
  text-decoration: none;
}

.common-page-grid {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.favorite-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  gap: 12px;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  vertical-align: middle;
}

.section-actions button,
.section-actions .view-all-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  padding: 0;
  color: var(--muted-strong);
  background: transparent;
  cursor: pointer;
  transition:
    color 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.section-actions button:hover,
.section-actions .view-all-action:hover {
  color: var(--blue);
  background: var(--surface-blue);
}

.section-actions button.is-active {
  color: white;
  background: var(--blue);
}

.section-actions button:active,
.section-actions .view-all-action:active {
  transform: translateY(1px);
}

.section-actions [data-lucide] {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.mobile-favorite-only {
  display: none;
}

.site-card {
  position: relative;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out);
}

.logo.custom {
  border-radius: 12px;
  color: white;
  font-size: 20px;
  background: linear-gradient(145deg, var(--blue), var(--violet));
}

.site-icon {
  position: relative;
  overflow: hidden;
}

.site-icon.has-favicon {
  color: white;
  background: linear-gradient(145deg, var(--blue), var(--violet));
}

.site-favicon {
  position: relative;
  z-index: 1;
  width: 70%;
  height: 70%;
  border-radius: 6px;
  object-fit: contain;
  opacity: 0;
}

.site-icon-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  text-align: center;
  font-size: inherit;
  font-weight: 900;
}

.site-icon.has-favicon.is-loaded {
  color: var(--text);
  background: var(--surface-soft);
}

.site-icon.has-favicon.is-loaded .site-favicon {
  opacity: 1;
}

.site-icon.has-favicon.is-loaded .site-icon-fallback {
  display: none;
}

.site-icon.has-favicon.is-fallback {
  color: white;
  background: linear-gradient(145deg, var(--blue), var(--violet));
}

.site-icon.has-favicon.is-fallback .site-favicon {
  display: none;
}

.site-icon.has-favicon.is-fallback .site-icon-fallback {
  display: grid;
}

.site-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  gap: 6px;
}

.edit-site,
.delete-site {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.edit-site [data-lucide],
.delete-site [data-lucide] {
  width: 15px;
  height: 15px;
}

.site-card-actions .delete-site {
  color: oklch(0.56 0.19 28);
}

body:has([data-site-list="common"] .site-card-actions) .common-grid .site-card {
  outline: 2px dashed oklch(0.72 0.15 255 / 0.38);
  outline-offset: -6px;
}

.site-card:hover,
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

[data-sortable-list] .site-card[draggable="true"] {
  cursor: grab;
}

[data-sortable-list] .site-card[draggable="true"]:active {
  cursor: grabbing;
}

.site-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.site-card.is-drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.logo.google {
  color: oklch(0.55 0.22 255);
}

.logo.youtube {
  width: 40px;
  height: 32px;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  background: oklch(0.6 0.22 28);
}

.logo.github {
  border-radius: 50%;
  color: white;
  background: oklch(0.18 0 0);
}

.logo.notion {
  border: 3px solid oklch(0.18 0 0);
  border-radius: 6px;
  color: oklch(0.18 0 0);
  background: white;
}

.logo.gmail {
  color: oklch(0.58 0.21 30);
}

.logo.twitter {
  color: oklch(0.62 0.18 238);
}

.site-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.site-card small,
.tool-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.site-card small {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.plus {
  color: var(--muted-strong);
  width: 28px;
  height: 28px;
  stroke-width: 1.9;
}

.category-links {
  display: grid;
  gap: 16px;
}

.category-title-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.category-title-link {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.category-title-link:hover,
.category-title-link.active {
  border-color: var(--line-strong);
  color: var(--blue);
  background: var(--surface-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-title-link strong {
  font-size: 18px;
}

.category-panel-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.category-link-panel {
  scroll-margin-top: 24px;
  display: none;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.18s var(--ease-out),
    background 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out);
}

.category-link-panel.is-active {
  display: grid;
  border-color: oklch(0.57 0.21 255 / 0.46);
  background: var(--surface-blue);
  box-shadow: var(--shadow-md);
}

.category-link-panel header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-link-panel-single {
  display: grid;
}

.category-link-panel-full {
  display: grid;
  background: var(--surface);
}

.category-back-link {
  margin-left: auto;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 800;
}

.category-back-link:hover {
  color: var(--blue);
}

.category-link-panel h3 {
  margin: 0;
  font-size: 15px;
}

.category-link-panel > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.category-link {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 800;
  transition:
    background 0.18s var(--ease-out),
    color 0.18s var(--ease-out);
}

.category-link:hover {
  color: var(--blue);
  background: var(--surface-soft);
}

.category-link-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 900;
}

.category-link:hover .category-link-icon {
  background: var(--blue-soft);
}

.category-link > span:not(.category-link-icon) {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.category-link small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.category-link [data-lucide] {
  grid-row: 1 / span 2;
  grid-column: 3;
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out);
}

.tool-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.tool-card strong {
  font-size: 16px;
  line-height: 1.15;
}

.tile-icon,
.mini-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 900;
}

.tile-icon {
  width: 38px;
  height: 38px;
}

.tile-icon [data-lucide] {
  width: 20px;
  height: 20px;
}

.mini-icon {
  width: 33px;
  height: 33px;
}

.mini-icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.blue {
  color: var(--blue);
  background: var(--icon-blue-bg);
}

.cyan {
  color: var(--cyan);
  background: var(--icon-cyan-bg);
}

.teal {
  color: oklch(0.58 0.14 188);
  background: var(--icon-teal-bg);
}

.indigo {
  color: oklch(0.54 0.18 278);
  background: var(--icon-indigo-bg);
}

.orange {
  color: oklch(0.62 0.17 55);
  background: var(--icon-orange-bg);
}

.pink {
  color: oklch(0.61 0.2 355);
  background: var(--icon-pink-bg);
}

.green {
  color: var(--green);
  background: var(--icon-green-bg);
}

.red {
  color: var(--rose);
  background: var(--icon-red-bg);
}

.amber {
  color: var(--amber);
  background: var(--icon-amber-bg);
}

.yellow {
  color: oklch(0.68 0.15 85);
  background: var(--icon-yellow-bg);
}

.sky {
  color: oklch(0.6 0.18 245);
  background: var(--icon-sky-bg);
}

.emerald {
  color: oklch(0.62 0.16 155);
  background: var(--icon-emerald-bg);
}

.slate {
  color: var(--muted-strong);
  background: var(--surface-soft);
}

.purple {
  color: var(--violet);
  background: var(--icon-purple-bg);
}

.tools-block {
  margin-bottom: 24px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 12px;
}

.tool-grid .site-card {
  min-height: 78px;
  gap: 8px;
  padding: 13px 10px;
}

.tool-grid .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 20px;
}

.tool-grid .site-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tool-grid .site-card small {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tool-card {
  min-height: 72px;
  gap: 12px;
  padding: 14px 16px;
}

.tool-card strong {
  font-size: 14px;
}

.tool-card small {
  font-size: 12px;
}

.page-footer {
  margin-top: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

:root[data-theme="dark"] .logo.notion {
  border-color: var(--muted-strong);
  color: var(--text);
  background: var(--surface-soft);
}

@media (max-width: 1440px) {
  .app-shell {
    grid-template-columns: 218px minmax(560px, 1fr);
  }

  body[data-page="categories"] .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  body[data-page="category"] .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  body[data-page="tools"] .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  body[data-page="settings"] .app-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .main-content {
    padding-inline: 34px;
  }

  .favorite-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .category-links {
    gap: 14px;
  }

  .category-title-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .category-panel-list {
    grid-template-columns: 1fr;
  }

  .category-link-panel > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  body[data-page="categories"] .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  body[data-page="category"] .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  body[data-page="tools"] .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  body[data-page="settings"] .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .engine-menu {
    width: calc(100% - 44px);
  }

  .engine-menu-list-default {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }

  .engine-menu-list:not(.engine-menu-list-default) {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .sidebar {
    padding-inline: 14px;
  }

  .brand span,
  .nav-item,
  .nav-heading span:first-child,
  .sidebar-footer .nav-item {
    font-size: 0;
  }

  .brand {
    justify-content: space-between;
  }

  .menu-button {
    margin-left: 0;
  }

  .nav-item {
    justify-content: center;
    padding-inline: 0;
  }

  .nav-subtree summary span,
  .nav-subtree-chevron {
    display: none;
  }

}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 72px;
  }

  body.drawer-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  body.sidebar-collapsed .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 0 16px 42px;
  }

  body[data-page="home"] .main-content {
    padding-top: 0;
  }

  .category-page-head {
    margin: 10px 0 18px;
  }

  .page-title-row,
  .category-page-head {
    margin: 10px 0 18px;
  }

  .page-title-row h1,
  .content-block .page-title-row h1,
  .category-page-head h1 {
    max-width: 11em;
    font-size: 26px;
    line-height: 1.22;
  }

  .settings-page-view {
    max-width: none;
  }

  .settings-page-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-panel,
  .settings-panel:first-child {
    grid-row: auto;
  }

  .settings-panel {
    gap: 15px;
    padding: 14px;
    border-radius: 12px;
    box-shadow: none;
  }

  .settings-panel h2 {
    font-size: 17px;
  }

  .settings-panel p {
    font-size: 12px;
  }

  .settings-option-row {
    min-height: 56px;
    padding: 10px;
  }

  .settings-number-grid {
    grid-template-columns: 1fr;
  }

  .settings-number-field {
    padding: 10px;
  }

  .settings-toggle span {
    display: none;
  }

  .settings-toggle {
    width: 40px;
    padding: 0;
  }

  .settings-page-actions {
    justify-content: stretch;
  }

  .settings-page-actions button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 8px;
  }

  .top-actions {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 54px;
    margin: 0 -6px 6px;
    padding: 4px 6px 5px;
    border-bottom: 1px solid oklch(0.9 0.018 255 / 0.68);
    background: oklch(0.985 0.006 255 / 0.78);
    backdrop-filter: blur(12px);
  }

  :root[data-theme="dark"] .mobile-header {
    border-bottom-color: oklch(0.38 0.034 260 / 0.58);
    background: oklch(0.19 0.028 260 / 0.74);
  }

  body.has-wallpaper .mobile-header {
    background: oklch(1 0 0 / 0.68);
  }

  :root[data-theme="dark"] body.has-wallpaper .mobile-header {
    background: oklch(0.22 0.032 260 / 0.68);
  }

  .mobile-brand {
    justify-self: center;
    color: var(--text);
    font-size: 23px;
    font-weight: 900;
  }

  .mobile-brand span {
    color: var(--blue);
  }

  .mobile-header-actions {
    display: flex;
    justify-content: end;
    gap: 6px;
  }

  .mobile-icon-button {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: var(--floating-surface);
    box-shadow: none;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-icon-button:active {
    transform: translateY(1px);
  }

  .mobile-icon-button [data-lucide] {
    display: block;
    flex: 0 0 20px;
    overflow: visible;
    width: 20px;
    height: 20px;
  }

  .menu-open {
    justify-self: start;
  }

  .hero {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin-bottom: 12px;
    padding-top: 0;
    text-align: left;
  }

  .hero p {
    justify-self: stretch;
    margin: 0;
    padding: 7px 12px 1px;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    text-overflow: clip;
  }

  .hero small {
    display: block;
    padding-inline: 12px;
    font-size: 12px;
    line-height: 1.25;
    text-align: right;
  }

  .search-section {
    margin-bottom: 24px;
  }

  .search-bar {
    height: auto;
    min-height: 56px;
    grid-template-columns: auto 1fr auto;
    gap: 7px;
    padding: 7px 8px 7px 10px;
    border-color: var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 22px oklch(0.42 0.09 255 / 0.09);
  }

  .engine-select {
    display: inline-flex;
    min-width: 70px;
    gap: 6px;
    padding-right: 6px;
    border-right: 1px solid var(--line);
  }

  .engine-logo {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .engine-name {
    max-width: 42px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
  }

  .search-input-wrap {
    min-width: 0;
  }

  .search-input-wrap input {
    min-width: 0;
    font-size: 15px;
  }

  .search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    color: var(--blue);
    font-size: 0;
    border-radius: 14px;
    background: var(--surface-blue);
    box-shadow: none;
  }

  .search-submit:hover,
  .search-submit:active {
    color: var(--blue-deep);
    background: var(--blue-soft);
    transform: none;
    box-shadow: none;
  }

  .search-submit .search-submit-label {
    display: none;
  }

  .search-submit [data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 2.25;
  }

  .engine-menu {
    top: calc(100% + 8px);
    left: 50%;
    right: auto;
    width: calc(100% - 14px);
    max-height: min(54vh, 380px);
    padding: 8px;
    border-radius: 14px;
    box-shadow: 0 8px 20px oklch(0.35 0.08 255 / 0.12);
    transform: translateX(-50%);
  }

  .engine-menu-section {
    gap: 7px;
  }

  .engine-menu-label {
    padding-inline: 2px;
    font-size: 12px;
  }

  .engine-menu-list-default {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .engine-menu-list:not(.engine-menu-list-default) {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .engine-menu-list-default button[role="option"] {
    min-height: 36px;
    padding: 0 5px;
    border-radius: 10px;
  }

  .engine-menu button[role="option"],
  .engine-menu-manage {
    gap: 5px;
    padding-inline: 6px;
  }

  .engine-menu button[role="option"] span:last-child {
    font-size: 11px;
  }

  .engine-menu-logo {
    width: 20px;
    height: 20px;
    border-radius: 7px;
  }

  .engine-menu-divider {
    margin: 8px 2px;
  }

  .engine-menu-row {
    grid-template-columns: minmax(0, 1fr) 28px 28px;
  }

  .engine-menu-icon {
    width: 28px;
    min-height: 28px;
  }

  .engine-menu-manage {
    min-height: 34px;
  }

  .local-search-results {
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    max-height: min(52vh, 360px);
    padding: 8px;
    border-radius: 16px;
  }

  .local-search-result {
    min-height: 54px;
    padding: 8px 10px;
  }

  .content-block {
    margin-bottom: 26px;
  }

  .section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }

  .section-title-row h1,
  .section-title-row h2,
  .content-block h1,
  .content-block h2 {
    margin: 0;
    font-size: 18px;
  }

  .section-title-row.page-title-row h1,
  .content-block .section-title-row.page-title-row h1 {
    font-size: 26px;
    line-height: 1.22;
  }

  .section-title-row > a,
  .section-title-row > button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    color: var(--muted-strong);
    background: transparent;
    font-weight: 700;
  }

  .section-title-row [data-lucide] {
    width: 16px;
    height: 16px;
  }

  .favorite-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }

  .mobile-favorite-only {
    display: flex;
  }

  .favorite-google {
    order: 1;
  }

  .favorite-youtube {
    order: 2;
  }

  .favorite-twitter {
    order: 3;
  }

  .favorite-github {
    order: 4;
  }

  .favorite-notion {
    order: 5;
  }

  .favorite-gmail {
    order: 6;
  }

  .favorite-bilibili {
    order: 7;
  }

  .category-links {
    gap: 10px;
    margin-top: 10px;
  }

  .category-title-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .category-title-link {
    min-height: 58px;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }

  .category-title-link strong {
    font-size: 14px;
  }

  .category-panel-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category-link-panel > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-link-panel {
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    box-shadow: none;
  }

  .category-link-panel header .mini-icon {
    width: 32px;
    height: 32px;
  }

  .category-link {
    min-height: 44px;
    padding: 8px 9px;
    border-radius: 9px;
  }

  .category-link span {
    font-size: 14px;
  }

  .category-link small {
    font-size: 12px;
  }

  .common-page-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  [data-sortable-list] .site-card[draggable="true"] {
    cursor: default;
  }

  .tool-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-inline: -16px;
    padding: 1px 16px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .tool-grid::-webkit-scrollbar {
    display: none;
  }

  .site-card {
    min-height: 78px;
    gap: 6px;
    padding: 8px 4px;
    border-radius: 12px;
    box-shadow: 0 3px 8px oklch(0.42 0.09 255 / 0.05);
  }

  .logo {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .logo.youtube {
    width: 38px;
    height: 30px;
    font-size: 16px;
  }

  .logo.bilibili {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: white;
    background: oklch(0.64 0.19 355);
  }

  .logo.bilibili [data-lucide] {
    width: 20px;
    height: 20px;
  }

  .site-card strong {
    max-width: 100%;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .site-card small {
    display: none;
  }

  .tool-card {
    min-height: 78px;
    padding: 10px;
    gap: 10px;
    border-radius: 12px;
    box-shadow: none;
  }

  .tool-card small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
  }

  .tool-card strong {
    font-size: 15px;
  }

  .tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .tool-card {
    flex: 0 0 88px;
    min-height: 90px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    scroll-snap-align: start;
  }

  .mobile-tool-extra {
    display: none;
  }

  .tool-card small {
    display: none;
  }

  .mini-icon {
    width: 36px;
    height: 36px;
  }

  .page-footer {
    display: none;
  }

  .mobile-scrim {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    background: oklch(0.2 0.02 260 / var(--wallpaper-scrim-opacity));
    backdrop-filter: blur(3px);
  }

  .mobile-scrim[hidden] {
    display: none;
  }

  .mobile-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 22;
    display: flex;
    width: min(62vw, 244px);
    min-width: 218px;
    max-width: 244px;
    flex-direction: column;
    padding: 24px 14px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
    box-shadow: 20px 0 50px oklch(0.24 0.06 260 / 0.18);
    transform: translateX(-105%);
    transition: transform 0.24s var(--ease-out);
  }

  .mobile-drawer.is-open {
    transform: translateX(0);
  }

  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }

  .mobile-drawer .mobile-brand {
    justify-self: auto;
  }

  .drawer-nav {
    display: grid;
    gap: 6px;
  }

  .drawer-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-radius: 13px;
    color: var(--muted-strong);
    font-size: 14px;
    font-weight: 700;
  }

.drawer-link.active {
    color: var(--blue);
    background: var(--blue-soft);
  }

  .drawer-submenu {
    margin: 6px 0 4px 14px;
  }

  .drawer-secondary {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }

  .drawer-theme {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 18px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 700;
  }

  .drawer-theme span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
  }

  .drawer-theme button {
    width: 52px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: var(--switch-bg);
    position: relative;
  }

.drawer-theme button::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  :root[data-theme="dark"] .drawer-theme button::after {
    transform: translateX(22px);
  }
}

.site-dialog,
.engine-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.site-dialog::backdrop,
.engine-dialog::backdrop {
  background: oklch(0.2 0.02 260 / 0.34);
  backdrop-filter: blur(4px);
}

.site-form,
.engine-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.site-form header,
.engine-form header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-form h2,
.engine-form h2 {
  margin: 0;
  font-size: 20px;
}

.dialog-close,
.engine-dialog-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted-strong);
  background: var(--surface-soft);
  cursor: pointer;
}

.site-form label,
.engine-form label,
.settings-page-form label {
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 800;
}

.site-form input,
.engine-form input,
.settings-page-form input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-soft);
  outline: 0;
}

.site-form input:focus,
.engine-form input:focus,
.settings-page-form input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px oklch(0.72 0.15 255 / 0.22);
}

.settings-page-view {
  max-width: 760px;
  margin-inline: auto;
}

.settings-page-block {
  margin-bottom: 22px;
}

.settings-page-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.settings-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-panel:first-child {
  grid-row: auto;
}

.settings-panel-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.settings-panel-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-panel h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.settings-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
}

.settings-range-label > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-range-label output {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.settings-page-form input[type="range"] {
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--blue);
  cursor: pointer;
}

.settings-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-number-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.settings-number-field span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 850;
}

.settings-number-field input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
  font-weight: 900;
}

.settings-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.settings-option-row > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-option-row strong,
.settings-option-row small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.settings-option-row strong {
  font-size: 14px;
}

.settings-option-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.settings-toggle,
.settings-page-actions button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 11px;
  padding: 0 13px;
  font-weight: 850;
  cursor: pointer;
}

.settings-toggle {
  flex: 0 0 auto;
  color: var(--blue);
  background: var(--blue-soft);
}

.settings-toggle [data-lucide] {
  width: 16px;
  height: 16px;
}

.settings-page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-page-actions .secondary {
  color: var(--muted-strong);
  background: var(--surface-soft);
}

.settings-page-actions .primary {
  color: white;
  background: var(--blue);
}

.wallpaper-preview {
  min-height: 132px;
  display: grid;
  place-items: end start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, oklch(0 0 0 / 0), oklch(0 0 0 / 0.28)),
    var(--wallpaper-preview-url) center / cover no-repeat,
    var(--surface-soft);
}

.wallpaper-preview[hidden] {
  display: none;
}

.wallpaper-preview span {
  padding: 5px 9px;
  border-radius: 999px;
  color: white;
  background: oklch(0.18 0.02 260 / 0.52);
  font-size: 12px;
  font-weight: 800;
}

.custom-engine-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow-y: auto;
}

.empty-custom-engines {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
}

.custom-engine-item {
  display: grid;
  grid-template-columns: auto 1fr 34px 34px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.custom-engine-item > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.custom-engine-item strong,
.custom-engine-item small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.custom-engine-item strong {
  font-size: 14px;
}

.custom-engine-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.custom-engine-item button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--muted-strong);
  background: transparent;
  cursor: pointer;
}

.custom-engine-item button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.dialog-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.dialog-actions .secondary {
  color: var(--muted-strong);
  background: var(--surface-soft);
}

.dialog-actions .primary {
  color: white;
  background: var(--blue);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  min-width: 160px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 29;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.18s var(--ease-out),
    transform 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.back-to-top [data-lucide] {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

@media (max-width: 760px) {
  .back-to-top {
    right: 18px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 420px) {
  .favorite-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .site-card strong {
    font-size: 13px;
  }

  .main-content {
    padding-inline: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

  .main-content.is-switching,
  .main-content.is-switched {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
