.settings-container {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  align-items: start;
  min-height: 0;
}

@media (min-width: 1024px) {
  .settings-container {
    grid-template-columns: 260px 1fr;
  }
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  align-self: flex-start;
  pointer-events: auto;
  z-index: 10;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

@media (max-width: 640px) {
  .settings-nav {
    display: none;
  }
}

/* 全域動畫優化 */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* 主題切換動畫 - 優化版 */
body.theme-transitioning {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.theme-transitioning .app,
body.theme-transitioning .search-card,
body.theme-transitioning .bookmark-card,
body.theme-transitioning .bookmark-item,
body.theme-transitioning .modal-panel,
body.theme-transitioning .quick-btn,
body.theme-transitioning .settings-toggle,
body.theme-transitioning input,
body.theme-transitioning button,
body.theme-transitioning .category-bookmarks {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.search-card,
.bookmark-card,
.modal-panel,
.bookmark-item,
.category-bookmarks,
.settings-toggle,
.quick-btn,
.fab-button {
  transition: all 0.3s ease;
}

.bookmark-item:hover,
.quick-btn:hover,
.settings-nav__item:hover {
  transform: translateY(-2px);
}

.bookmark-item:active,
.quick-btn:active {
  transform: translateY(0);
}

/* 淡入動畫 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.app {
  animation: fadeIn 0.5s ease;
}

.search-card {
  animation: fadeInUp 0.6s ease 0.1s both;
}

.bookmark-card {
  animation: fadeInUp 0.6s ease 0.2s both;
}

.bookmark-item {
  animation: scaleIn 0.4s ease both;
}

.bookmark-item:nth-child(1) { animation-delay: 0.05s; }
.bookmark-item:nth-child(2) { animation-delay: 0.1s; }
.bookmark-item:nth-child(3) { animation-delay: 0.15s; }
.bookmark-item:nth-child(4) { animation-delay: 0.2s; }
.bookmark-item:nth-child(5) { animation-delay: 0.25s; }
.bookmark-item:nth-child(6) { animation-delay: 0.3s; }
.bookmark-item:nth-child(7) { animation-delay: 0.35s; }
.bookmark-item:nth-child(8) { animation-delay: 0.4s; }

.modal-panel {
  animation: scaleIn 0.3s ease;
}

/* 平滑滾動 */
html {
  scroll-behavior: smooth;
}

/* 搜尋載入動畫 - 增強版 */
.search-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
  backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.search-loading-spinner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: floatIn 0.5s ease-out;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.spinner-ring {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  border: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 50%, transparent));
}

.spinner-ring:nth-child(1) {
  border-top-color: #4a90e2;
  border-right-color: color-mix(in srgb, var(--primary) 30%, transparent);
  animation-delay: 0s;
  width: 100px;
  height: 100px;
}

.spinner-ring:nth-child(2) {
  border-top-color: #64b5f6;
  border-right-color: color-mix(in srgb, var(--primary) 30%, transparent);
  animation-delay: -0.5s;
  width: 80px;
  height: 80px;
  top: 10px;
}

.spinner-ring:nth-child(3) {
  border-top-color: #90caf9;
  border-right-color: color-mix(in srgb, var(--primary) 30%, transparent);
  animation-delay: -1s;
  width: 60px;
  height: 60px;
  top: 20px;
}

@keyframes spin {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }
  100% {
    transform: translateX(-50%) rotate(360deg);
  }
}

.spinner-text {
  margin-top: 120px;
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
  animation: pulse 2s ease-in-out infinite;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

/* 夜間模式下的搜尋載入動畫 */
body.dark-mode .search-loading-overlay {
  background: linear-gradient(135deg, rgba(22, 24, 28, 0.9) 0%, rgba(32, 34, 40, 0.8) 100%);
}

body.dark-mode .spinner-ring:nth-child(1) {
  border-top-color: var(--primary);
  filter: drop-shadow(0 0 15px color-mix(in srgb, var(--primary) 60%, transparent));
}

body.dark-mode .spinner-ring:nth-child(2) {
  border-top-color: color-mix(in srgb, var(--primary) 80%, white);
}

body.dark-mode .spinner-ring:nth-child(3) {
  border-top-color: color-mix(in srgb, var(--primary) 60%, white);
}

/* 夜間模式選項樣式 */
.dark-mode-options {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.dark-mode-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-subtle);
  font-size: 13px;
  font-weight: 500;
  min-width: 70px;
}

.dark-mode-option i {
  width: 20px;
  height: 20px;
}

.dark-mode-option:hover {
  background: var(--hover);
  color: var(--text);
}

.dark-mode-option.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}

.dark-mode-option.active:hover {
  background: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent);
}

body.dark-mode .dark-mode-option.active {
  background: var(--primary);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 40%, transparent);
}

body.dark-mode .dark-mode-option.active:hover {
  background: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 50%, transparent);
}

/* 啟動網頁設定已移除，現在由 manifest.json 的 chrome_settings_overrides 控制 */

/* 主題色設定樣式 */
.theme-color-field {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-color-field .settings-field__header {
  margin-bottom: 8px;
}

.theme-color-field label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.theme-color-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 12px;
}

.theme-color-preset {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.theme-color-preset i {
  opacity: 0;
  transition: opacity 0.2s ease;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.theme-color-preset.active {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.theme-color-preset.active i {
  opacity: 1;
}

.theme-color-preset:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .theme-color-preset.active {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

.theme-color-custom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-color-custom label {
  font-size: 14px;
  color: var(--text-subtle);
}

.color-picker-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.color-picker-wrapper input[type="color"] {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  background: transparent;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.color-input {
  flex: 1;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  text-transform: uppercase;
}

.btn-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--surface-muted);
  color: var(--text);
  transform: rotate(-90deg);
}

.btn-icon i {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .settings-nav {
    display: none;
  }
  
  .theme-color-presets {
    grid-template-columns: repeat(4, 1fr);
  }
}

.settings-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.settings-nav__item:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}

.settings-nav__item.is-active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.settings-nav__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-nav__label {
  flex: 1;
  min-width: 0;
}

body.dark-mode .settings-nav__item {
  color: rgba(232, 236, 255, 0.7);
}

body.dark-mode .settings-nav__item:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: rgba(232, 236, 255, 0.95);
}

body.dark-mode .settings-nav__item.is-active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: rgba(232, 236, 255, 1);
}

@media (max-width: 1023px) {
  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    position: relative;
    gap: 4px;
    padding: 6px;
    z-index: 20;
    justify-content: center;
  }
  
  .settings-nav__item {
    width: auto;
    flex: 0 1 auto;
    min-width: 50px;
    max-width: 70px;
    padding: 8px 4px;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    position: relative;
    z-index: 21;
    pointer-events: auto;
    touch-action: manipulation;
  }
  
  .settings-nav__label {
    display: none;
  }
  
  .settings-nav__icon {
    margin: 0 auto;
    width: 24px;
    height: 24px;
    pointer-events: none;
  }
}

.settings-panels {
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px;
  position: relative;
}

@media (max-width: 1023px) {
  .settings-panels {
    max-height: none;
  }
}

.settings-panels::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.settings-panels.is-scrolled::before {
  opacity: 1;
  background: linear-gradient(180deg, rgba(18, 20, 24, 0.12), transparent 35%);
}

body.dark-mode .settings-panels {
  background: rgba(26, 28, 32, 0.92);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
  box-shadow: 0 32px 64px rgba(2, 4, 12, 0.7);
}

body.dark-mode .settings-panels.is-scrolled::before {
  background: linear-gradient(180deg, rgba(8, 10, 12, 0.45), transparent 40%);
}

@media (max-width: 720px) {
  .settings-nav {
    padding: 14px;
    gap: 10px;
  }

  .settings-panels {
    padding: 18px;
  }
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
  box-shadow: 0 22px 40px rgba(18, 20, 24, 0.1);
  animation: settingsCardPop 0.35s ease both;
  position: relative;
  z-index: 1;
}

/* 天氣設定區塊需要更高的 z-index 以顯示搜索建議 */
.settings-section[data-settings-area="weather"] {
  z-index: 100;
  overflow: visible;
}

.settings-section__header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-section__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.settings-section__icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.settings-section__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
}

.settings-section__block {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
}

.settings-section__block--grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 720px) {
  .settings-section__block--grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.settings-section__block--stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.settings-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(18, 20, 24, 0.16);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

.settings-action-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  flex-shrink: 0;
}

.settings-action-card__icon--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.settings-action-card__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-action-card__content h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.settings-action-card__content p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-subtle);
}

body.dark-mode .settings-section {
  background: rgba(32, 34, 40, 0.92);
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  box-shadow: 0 30px 58px rgba(2, 4, 12, 0.68);
}

body.dark-mode .settings-section__icon {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: #d6dcff;
}

body.dark-mode .settings-action-card {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}

body.dark-mode .settings-action-card:hover {
  box-shadow: 0 26px 48px rgba(5, 8, 24, 0.48);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

body.dark-mode .settings-action-card__icon {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: #d6dcff;
}

body.dark-mode .settings-action-card__icon--danger {
  background: rgba(248, 113, 113, 0.16);
  color: #fda4af;
}

body.dark-mode .settings-action-card__content h5 {
  color: rgba(232, 236, 255, 0.95);
}

body.dark-mode .settings-action-card__content p {
  color: rgba(208, 214, 255, 0.72);
}

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4c6ef5;
  --primary-dark: #364fc7;
  --backdrop-blur: 0px;
  --overlay-color: transparent; /* default: no overlay */
  --accent: #f59f00;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-muted: rgba(255, 255, 255, 0.75);
  --text: #1f2933;
  --text-subtle: #66717c;
  --border: rgba(255, 255, 255, 0.4);
  --shadow: 0 18px 45px rgba(18, 20, 24, 0.18);
  --transition: 200ms ease;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

body.dark-mode {
  /* --primary 由 JavaScript 動態設置，不在這裡硬編碼 */
  --primary-dark: var(--primary-dark);
  --surface: rgba(28, 30, 35, 0.92);
  --surface-muted: rgba(35, 37, 42, 0.75);
  --text: #e8ecff;
  --text-subtle: rgba(208, 214, 255, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 26px 60px rgba(5, 9, 28, 0.55);
  background-color: #1a1c23;
}

.dark-mode .background-layer {
  background: linear-gradient(160deg, rgba(20, 22, 28, 0.75), rgba(20, 22, 28, 0.45));
}

.dark-mode .background-overlay {
  background: var(--overlay-color, rgba(10, 12, 14, 0.35));
}

html, body { height: 100%; }

body {
  font-family: 'Poppins', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: url('assets/default-background.webp') center/cover fixed no-repeat;
  background-color: #f3f4ff;
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.modal-open {
  overflow: hidden;
}

.background-layer { position: fixed; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06)); backdrop-filter: blur(var(--backdrop-blur)); z-index: -1; pointer-events: none; transition: background 0.4s ease; }

/* Overlay that can be white/black with adjustable opacity */
.background-overlay { position: fixed; inset: 0; pointer-events: none; background: var(--overlay-color, transparent); z-index: 0; transition: background 0.3s ease; }

/* remove muted styling - show icons clearly */

/* small icon used inside pills */
.pill-icon { width: 20px; height: 20px; display:inline-grid; place-items:center; }
.pill-icon svg { width: 18px; height: 18px; display:block; }

.app { max-width: 1120px; margin: 0 auto; padding: 72px 24px 56px; display: flex; flex-direction: column; gap: 32px; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.hero-layout {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: inherit;
}


@media (max-width: 959px) {
  .hero-aside .weather-widget {
    margin: 0 auto;
  }
}

@media (min-width: 960px) {
  .hero-layout {
    max-width: 760px;
    margin: 0 auto;
  }

  .hero-main {
    max-width: 720px;
  }

  .hero-header {
    align-items: center;
    text-align: center;
  }
}

.hero-title { font-size: clamp(40px, 6vw, 56px); font-weight: 700; color: #fff; text-shadow: 0 10px 30px rgba(0,0,0,.35); }
.hero-subtitle { color: rgba(255,255,255,.85); font-size: 18px; }
.weather-widget {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.weather-widget--tile {
  gap: 16px;
}

.weather-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.weather-widget__heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.weather-widget__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  transition: background var(--transition), color var(--transition);
}

.weather-widget__icon i {
  width: 28px;
  height: 28px;
}

.weather-widget__icon.is-rotating i {
  animation: spin 1s linear infinite;
}

.weather-widget__label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
}

.weather-widget__location {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.weather-widget__refresh {
  border: none;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.weather-widget__refresh:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  transform: translateY(-1px);
}

.weather-widget__refresh.is-busy {
  pointer-events: none;
  opacity: 0.6;
}

.weather-widget__refresh.is-busy i {
  animation: spin 0.9s linear infinite;
}

.weather-widget__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weather-widget__status {
  font-size: 14px;
  color: var(--text-subtle);
  min-height: 20px;
}

.weather-widget__metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.weather-widget__temp {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.weather-widget__meta {
  font-size: 12px;
  color: var(--text-subtle);
  display: flex;

.weather-widget--tile .weather-widget__header {
  align-items: center;
  gap: 14px;
}

.weather-widget--tile .weather-widget__icon {
  width: 48px;
  height: 48px;
}

.weather-widget--tile .weather-widget__refresh {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.weather-widget--tile .weather-widget__metrics {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.weather-widget--tile .weather-widget__status {
  font-size: 13px;
}

body.dark-mode .weather-widget--tile .weather-widget__refresh {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: #d6dcff;
}
  gap: 10px;
  flex-wrap: wrap;
}

.weather-widget__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.weather-widget.is-loading .weather-widget__icon {
  animation: pulseGlow 1.2s ease-in-out infinite;
}

.dark-mode .weather-widget__icon {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: #d6dcff;
}

.dark-mode .weather-widget__label {
  color: rgba(208, 214, 255, 0.72);
}

.dark-mode .weather-widget__location,
.dark-mode .weather-widget__temp {
  color: rgba(232, 236, 255, 0.95);
}

.dark-mode .weather-widget__status,
.dark-mode .weather-widget__meta {
  color: rgba(208, 214, 255, 0.7);
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0.12); }
}

/* Search Card */
.search-card { width: min(680px, 100%); margin: 0 auto; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: var(--radius-lg); padding: 24px; box-shadow: 0 24px 60px rgba(18, 20, 24, 0.16); display: flex; flex-direction: column; gap: 16px; transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease; position: relative; z-index: 10; backdrop-filter: blur(18px); }
.search-card:hover { transform: translateY(-2px); box-shadow: 0 28px 64px rgba(18, 20, 24, 0.18); }
.dark-mode .search-card { background: rgba(22, 24, 28, 0.9); border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); box-shadow: 0 32px 70px rgba(4, 6, 18, 0.68); }
.search-header { position: relative; display: flex; justify-content: flex-end; }
.engine-selector { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); background: #fff; color: var(--text); font-weight: 600; cursor: pointer; box-shadow: 0 10px 20px rgba(18,20,24,.12); transition: transform var(--transition), box-shadow var(--transition), background var(--transition); }
.engine-selector:hover { transform: translateY(-1px); box-shadow: 0 16px 28px color-mix(in srgb, var(--primary) 18%, transparent); }
.engine-selector:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.engine-selector__icon { display: grid; place-items: center; width: 24px; height: 24px; }
.engine-selector__label { font-size: 14px; }
.engine-selector__chevron { opacity: 0.6; display: grid; place-items: center; }

.engine-selector--inline { padding: 6px 12px 6px 6px; border: none; background: transparent; box-shadow: none; border-radius: var(--radius-sm); gap: 6px; align-self: stretch; position: relative; }
.engine-selector--inline::after { 
  content: ''; 
  position: absolute; 
  top: 8px; 
  right: -6px; 
  width: 1px; 
  height: calc(100% - 16px); 
  background: color-mix(in srgb, var(--primary) 28%, transparent);
  border-radius: 999px;
  transition: background 0.3s ease;
}
.search-input-wrapper .engine-selector--inline { margin-right: 12px; }
.engine-selector--inline:hover { 
  transform: none; 
  box-shadow: none; 
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.engine-selector--inline:focus-visible { 
  outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}
.engine-selector--inline .engine-selector__icon { 
  width: 30px; 
  height: 30px; 
  border-radius: var(--radius-sm); 
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  display: flex; 
  align-items: center; 
  justify-content: center; 
  flex-shrink: 0;
  transition: background 0.3s ease;
}
.engine-selector--inline .engine-selector__label { display: none; font-size: 13px; color: var(--text-subtle); }
.engine-selector--inline .engine-selector__chevron { width: 18px; height: 18px; opacity: 0.45; flex-shrink: 0; }
.engine-selector--inline .engine-selector__icon img,
.engine-selector--inline .engine-selector__icon svg,
.engine-selector--inline .engine-selector__icon i {
  width: var(--selector-icon-size, 24px);
  height: var(--selector-icon-size, 24px);
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

/* 為 SVG 圖標添加主題色濾鏡效果 - 日間模式 */
.engine-selector--inline .engine-selector__icon svg,
.engine-selector--inline .engine-selector__icon img[src$=".svg"] {
  filter: brightness(0) saturate(100%) 
          invert(36%) sepia(89%) saturate(2477%) 
          hue-rotate(var(--primary-hue, 223deg)) 
          brightness(96%) contrast(92%);
  opacity: 0.85;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* 夜間模式：使用主題色但不反色，採用淺色疊加 */
body.dark-mode .engine-selector--inline .engine-selector__icon svg,
body.dark-mode .engine-selector--inline .engine-selector__icon img[src$=".svg"] {
  filter: brightness(1.2) saturate(1.3)
          sepia(0.3) saturate(1.5)
          hue-rotate(calc(var(--primary-hue, 223deg) - 200deg))
          brightness(1.1);
  opacity: 0.9;
}

@media (min-width: 640px) {
  .engine-selector--inline .engine-selector__label { display: inline; }
}

.engine-dropdown { 
  position: absolute; 
  top: calc(100% + 8px); 
  left: 12px; 
  right: auto; 
  width: 240px; 
  max-width: calc(100% - 24px); 
  max-height: 260px; 
  overflow-y: auto; 
  background: #fff; 
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); 
  border-radius: var(--radius-md); 
  box-shadow: 0 24px 50px rgba(18,20,24,.18); 
  padding: 8px; 
  display: none; 
  z-index: 100000;
}

.engine-dropdown.show { 
  display: block; 
}

body.dark-mode .engine-dropdown { 
  background: rgba(35, 37, 42, 0.98); 
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); 
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.75); 
}

@media (max-width: 640px) {
  .engine-dropdown {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    margin: 0 12px;
  }
}
.engine-option { width: 100%; border: none; background: transparent; padding: 10px 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-weight: 600; transition: background var(--transition), transform var(--transition); }
.engine-option:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); transform: translateY(-1px); }
.engine-option.active { background: color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent); }
.engine-option__icon { width: 24px; height: 24px; display: grid; place-items: center; }
.engine-option__icon img,
.engine-option__icon svg,
.engine-option__icon i {
  width: var(--engine-option-icon-size, 22px);
  height: var(--engine-option-icon-size, 22px);
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.engine-option__name { font-size: 14px; text-align: left; }

.search-input-group { display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1000; }
.search-input-wrapper { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: rgba(255,255,255,0.96); padding: 12px 18px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); box-shadow: 0 18px 36px color-mix(in srgb, var(--primary) 14%, transparent); transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition); z-index: 1001; }
.dark-mode .search-input-wrapper { background: rgba(35, 37, 42, 0.9); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55); }
.search-input-wrapper:hover { border-color: color-mix(in srgb, var(--primary) 30%, transparent); box-shadow: 0 24px 48px color-mix(in srgb, var(--primary) 18%, transparent); }
.search-input-wrapper:focus-within { box-shadow: 0 20px 40px color-mix(in srgb, var(--primary) 25%, transparent); transform: translateY(-1px); animation: searchExpand 0.3s ease-out; }

@keyframes searchExpand {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 0 color-mix(in srgb, var(--primary) 25%, transparent);
  }
  50% {
    transform: scale(1.01);
  }
  100% {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 20px 40px color-mix(in srgb, var(--primary) 25%, transparent);
  }
}

.search-icon { font-size: 22px; display: grid; place-items: center; color: var(--primary); }
#searchInput { border: none; outline: none; font-size: 16px; background: transparent; color: var(--text); }
#searchInput::placeholder { color: rgba(32,34,38,.4); }
.dark-mode #searchInput::placeholder { color: rgba(232, 236, 255, 0.35); }
.search-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.search-action { border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; padding: 10px 16px; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); white-space: nowrap; }
.search-action.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.search-action.secondary { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.search-action:hover { transform: translateY(-1px); box-shadow: 0 12px 20px color-mix(in srgb, var(--primary) 25%, transparent); }

.custom-engine { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent); background: color-mix(in srgb, var(--primary) 5%, transparent); }
.custom-engine input { margin-bottom: 4px; }

.search-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  width: 100%;
  padding-top: 6px;
  margin-top: 16px;
  z-index: 10;
  animation: suggestionsSlideIn 0.3s ease-out;
}

.search-suggestions.is-loading .suggestion-list {
  opacity: 0.6;
  filter: saturate(0.85);
}

.search-suggestions.is-loading::after {
  content: '';
  position: absolute;
  inset: 0 16px auto 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 45%, transparent), transparent);
  animation: suggestionLoading 1.1s ease-in-out infinite;
}

body.dark-mode .search-suggestions.is-loading::after {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 55%, transparent), transparent);
}

@keyframes suggestionLoading {
  0% {
    transform: translateX(-40%);
    opacity: 0;
  }
  50% {
    transform: translateX(0%);
    opacity: 0.8;
  }
  100% {
    transform: translateX(40%);
    opacity: 0;
  }
}

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

.suggestions-title { font-size: 12px; font-weight: 700; color: var(--text-subtle); text-align: left; }
.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  transition: opacity 0.2s ease;
}
.suggestion-item { border: none; border-radius: 999px; padding: 8px 14px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary-dark); font-weight: 600; font-size: 13px; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.suggestion-item--skeleton {
  pointer-events: none;
  color: transparent;
  min-width: 88px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 8%, transparent), color-mix(in srgb, var(--primary) 24%, transparent), color-mix(in srgb, var(--primary) 8%, transparent));
  background-size: 200% 100%;
  animation: suggestionShimmer 1.2s linear infinite;
}
.suggestion-item:hover,
.suggestion-item:focus-visible { transform: translateY(-1px); box-shadow: 0 10px 18px color-mix(in srgb, var(--primary) 25%, transparent); outline: none; }
body.dark-mode .suggestion-item { background: rgba(255,255,255,0.12); color: #fff; }
body.dark-mode .suggestion-item:hover,
body.dark-mode .suggestion-item:focus-visible { box-shadow: 0 10px 18px rgba(0,0,0,0.4); }
body.dark-mode .suggestion-item--skeleton {
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--primary) 32%, transparent), color-mix(in srgb, var(--primary) 12%, transparent));
}

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

/* Toolbar */
.toolbar { display: flex; justify-content: center; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 12px; background: var(--surface-muted); padding: 12px 16px; border-radius: var(--radius-lg); box-shadow: 0 12px 22px rgba(18,20,24,.18); border: 1px solid var(--border); }
.toolbar-btn { border: none; background: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 700; color: var(--text-subtle); cursor: pointer; transition: var(--transition); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); }
.toolbar-btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.toolbar-btn:hover { transform: translateY(-1px); }

/* Bookmarks */
.bookmark-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.bookmark-card__header { padding: 20px 24px 8px; }
.bookmark-card__header h2 { font-size: 20px; color: var(--text); }
.bookmark-card__header p { color: var(--text-subtle); font-size: 14px; }
.bookmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 16px; }
.bookmark-item { position: relative; background: rgba(255,255,255,0.96); border: 1px solid rgba(18, 20, 24, 0.08); border-radius: var(--radius-md); padding: 16px 12px 14px; text-align: center; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 16px 34px rgba(18, 20, 24, 0.12); }
.dark-mode .bookmark-item { background: rgba(30, 32, 38, 0.95); border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6); backdrop-filter: blur(12px); }
.bookmark-item:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(18,20,24,.12); }
.dark-mode .bookmark-item:hover { box-shadow: 0 24px 48px rgba(0,0,0,0.7); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.bookmark-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity var(--transition); }
.bookmark-item:hover .bookmark-actions { opacity: 1; }
.bookmark-actions button { border: none; background: color-mix(in srgb, var(--primary) 12%, transparent); border-radius: 6px; padding: 4px 6px; cursor: pointer; color: var(--primary-dark); transition: background var(--transition), color var(--transition); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 18%, transparent); }
.bookmark-actions button:hover { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.bookmark-actions--pinned { opacity: 1; }

.bookmark-item--weather {
  position: relative;
  cursor: pointer;
}

.bookmark-item--weather:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(18,20,24,.12);
}

.bookmark-item--weather.is-inactive {
  opacity: 0.6;
}

.bookmark-item--weather.is-hidden {
  display: none !important;
}

.weather-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  cursor: pointer;
  width: 100%;
}

.weather-tile__icon {
  width: 36px;
  height: 36px;
  margin: 10px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-tile__icon [data-weather-icon] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 32px;
}

.weather-tile__icon [data-weather-icon] .weather-emoji {
  font-size: 32px;
  line-height: 1;
  display: block;
}

.weather-tile__icon [data-weather-icon] .weather-icon-img {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
  animation: weatherFloat 3s ease-in-out infinite;
  transform-origin: center center;
}

/* Floating animation for weather icons */
@keyframes weatherFloat {
  0%, 100% { 
    transform: translateY(0px) scale(1);
  }
  50% { 
    transform: translateY(-3px) scale(1.02);
  }
}

/* Sun rotating animation */
.weather-tile__icon [data-weather-icon] .weather-icon-img[src*="sun.png"] {
  animation: weatherFloat 3s ease-in-out infinite, sunRotate 20s linear infinite;
}

@keyframes sunRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Cloud drifting animation */
.weather-tile__icon [data-weather-icon] .weather-icon-img[src*="cloud"] {
  animation: cloudDrift 4s ease-in-out infinite;
}

@keyframes cloudDrift {
  0%, 100% { 
    transform: translateX(0px);
  }
  50% { 
    transform: translateX(3px);
  }
}

/* Rain/Snow animation - subtle bounce */
.weather-tile__icon [data-weather-icon] .weather-icon-img[src*="rain"],
.weather-tile__icon [data-weather-icon] .weather-icon-img[src*="snow"] {
  animation: weatherBounce 2.5s ease-in-out infinite;
}

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

/* Lightning animation - pulse effect */
.weather-tile__icon [data-weather-icon] .weather-icon-img[src*="lightning"] {
  animation: lightningPulse 2s ease-in-out infinite;
}

@keyframes lightningPulse {
  0%, 100% { 
    filter: brightness(1);
    transform: scale(1);
  }
  50% { 
    filter: brightness(1.15);
    transform: scale(1.03);
  }
}

/* Fog animation - fade in/out */
.weather-tile__icon [data-weather-icon] .weather-icon-img[src*="fog"] {
  animation: fogFade 3s ease-in-out infinite;
}

@keyframes fogFade {
  0%, 100% { 
    opacity: 0.95;
  }
  50% { 
    opacity: 0.85;
  }
}

.weather-tile__icon [data-weather-icon] i {
  width: 32px;
  height: 32px;
  color: #3B82F6;
  filter: drop-shadow(0 2px 5px rgba(59, 130, 246, 0.35));
  transition: all 0.3s ease;
}

/* Only style loader and error icons (not weather condition icons - we use emoji now) */
.weather-tile__icon [data-weather-icon] i[data-lucide="loader-2"] {
  color: #3B82F6;
}

.weather-tile__icon [data-weather-icon] i[data-lucide="help-circle"],
.weather-tile__icon [data-weather-icon] i[data-lucide="alert-triangle"] {
  color: #F97316;
}

.weather-tile__icon [data-weather-icon].is-rotating {
  animation: weatherSpin 2s linear infinite;
}

@keyframes weatherSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.weather-tile__temp {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}

.weather-tile__location {
  display: none;
}

.weather-tile__condition {
  display: none;
}

.bookmark-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 18px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--text-subtle);
  font-weight: 600;
}

body.dark-mode .bookmark-item--weather:hover {
  box-shadow: 0 24px 48px rgba(0,0,0,0.7);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

body.dark-mode .bookmark-item--weather .bookmark-actions__btn {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

body.dark-mode .bookmark-item--weather .bookmark-actions__btn:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 80%, transparent), color-mix(in srgb, var(--primary) 60%, transparent));
  color: #fff;
}

/* Dark mode: only style loader and error icons (emoji already colorful) */
body.dark-mode .weather-tile__icon [data-weather-icon] i[data-lucide="loader-2"] {
  color: var(--primary);
}

body.dark-mode .weather-tile__icon [data-weather-icon] i[data-lucide="help-circle"],
body.dark-mode .weather-tile__icon [data-weather-icon] i[data-lucide="alert-triangle"] {
  color: #FB923C;
}

body.dark-mode .bookmark-empty {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: rgba(235, 238, 255, 0.85);
}
.bookmark-icon { font-size: 32px; line-height: 1; margin: 10px auto 10px; }
.bookmark-icon img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.bookmark-name { font-weight: 700; color: var(--text); font-size: 14px; word-break: break-word; }

/* Category sections */
#categorySection {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 28px;
}
.category-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.category-header__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.category-header__icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 24px;
}
.category-header__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.category-header__title {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  margin: 0;
}
.category-header__count {
  font-size: 13px;
  color: var(--text-subtle);
}
.category-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.category-header__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.category-header__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 18%, transparent);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #fff;
}
.category-header__btn--ghost {
  background: transparent;
  color: var(--text-subtle);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}
.category-header__btn--ghost:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  box-shadow: none;
}
.category-header__btn i {
  width: 16px;
  height: 16px;
}
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.dark-mode .category-section {
  background: rgba(22, 24, 28, 0.9);
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
  box-shadow: 0 28px 60px rgba(3, 5, 18, 0.7);
}
.dark-mode .category-header__icon {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: #d6dcff;
}
.dark-mode .category-header__count {
  color: rgba(208, 214, 255, 0.72);
}
.dark-mode .category-header__btn {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  color: #d6dcff;
}
.dark-mode .category-header__btn:hover {
  box-shadow: 0 16px 34px color-mix(in srgb, var(--primary-dark) 32%, transparent);
}
.dark-mode .category-header__btn--ghost {
  background: transparent;
  color: rgba(208, 214, 255, 0.82);
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
}
.dark-mode .category-header__btn--ghost:hover {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: #fff;
}

@media (max-width: 640px) {
  .category-header {
    align-items: flex-start;
  }
  .category-header__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Modal */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.36); padding: 20px; z-index: 10000; }
.modal.show { display: flex; }
.modal-panel { width: min(560px, 100%); max-height: 85vh; background: #fff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.3); overflow: hidden; display: flex; flex-direction: column; }
.modal-panel--settings {
  width: min(960px, calc(100vw - 64px));
  max-height: min(88vh, 860px);
}
.modal-panel--settings .modal-header,
.modal-panel--settings .modal-footer {
  padding-left: 32px;
  padding-right: 32px;
}
.modal-panel--settings .modal-footer {
  border-top: 1px solid color-mix(in srgb, var(--primary) 8%, transparent);
}

.modal-panel--settings .modal-body.settings-body {
  padding: 28px 32px 32px;
}

.modal-panel--settings .settings-container {
  align-items: stretch;
}

.modal-panel--settings .settings-nav {
  top: 0;
}

.modal-panel--settings .settings-panels {
  max-height: calc(88vh - 180px);
  overflow-y: auto;
}

@media (max-width: 1023px) {
  .modal-panel--settings {
    width: min(800px, calc(100vw - 40px));
    max-height: 90vh;
  }

  .modal-panel--settings .modal-header,
  .modal-panel--settings .modal-footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .modal-panel--settings .modal-body.settings-body {
    padding: 24px;
    overflow-y: auto;
  }

  .modal-panel--settings .settings-panels {
    max-height: none;
    padding: 20px;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .modal-panel--settings {
    width: calc(100vw - 24px);
  }

  .modal-panel--settings .modal-body.settings-body {
    padding: 20px 18px 24px;
  }
}

@media (max-width: 640px) {
  .modal-panel--settings .settings-panels {
    padding: 18px;
    border-radius: 16px;
  }
}
.dark-mode .modal-panel { background: rgba(28, 30, 35, 0.96); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 36px 80px rgba(0,0,0,0.65); backdrop-filter: blur(18px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,.06); flex-shrink: 0; }
.dark-mode .modal-header { border-bottom: 1px solid rgba(255,255,255,0.08); }
.modal-header h3 { font-size: 18px; }
.modal-close { border: none; background: transparent; font-size: 26px; cursor: pointer; z-index: 1; position: relative; color: rgba(18, 20, 24, 0.6); line-height: 1; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all 0.2s ease; }
.modal-close:hover { background: rgba(0, 0, 0, 0.06); color: rgba(18, 20, 24, 0.9); }
.dark-mode .modal-close { color: rgba(232, 236, 255, 0.95); background: transparent; }
.dark-mode .modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.15); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid rgba(0,0,0,.06); flex-shrink: 0; }
.dark-mode .modal-footer { border-top: 1px solid rgba(255,255,255,0.08); }

/* Weather Modal */
.modal-panel--weather {
  width: min(520px, calc(100vw - 40px));
}

.modal-panel--weather .modal-header h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-panel--weather .modal-header [data-weather-icon] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.modal-panel--weather .modal-header [data-weather-icon].is-rotating {
  animation: weatherSpin 2s linear infinite;
}

.weather-modal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px;
}

.weather-modal-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}

body.dark-mode .weather-modal-info {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border-color: color-mix(in srgb, var(--primary) 15%, transparent);
}

.weather-modal-location {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.weather-modal-condition {
  font-size: 16px;
  color: var(--text-subtle);
  text-align: center;
}

.weather-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text-subtle);
}

.weather-modal-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.weather-modal-controls label {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.weather-field__body {
  position: relative;
  z-index: 200;
  overflow: visible;
}

.weather-location-search {
  position: relative;
  width: 100%;
  z-index: 300;
  overflow: visible;
}

.weather-location-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(18, 20, 24, 0.25), 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent);
  max-height: 280px;
  overflow-y: auto;
  z-index: 99999;
  min-width: 280px;
  display: none;
}

.weather-location-suggestions.show {
  display: block;
}

.weather-location-suggestions[hidden] {
  display: none;
}

/* 修復手機端天氣搜索被遮擋問題 */
@media (max-width: 1023px) {
  .weather-location-search {
    position: relative;
    z-index: 1000;
  }
  
  .weather-location-suggestions {
    position: fixed;
    top: auto;
    bottom: auto;
    left: 16px;
    right: 16px;
    max-height: 60vh;
    z-index: 999999;
    margin-top: 8px;
  }
}

body.dark-mode .weather-location-suggestions {
  background: rgba(35, 37, 42, 0.98);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

.weather-suggestion-item {
  width: 100%;
  padding: 12px 16px;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 8%, transparent);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--text);
  font-size: 14px;
}

.weather-suggestion-item:last-child {
  border-bottom: none;
}

.weather-suggestion-item:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.weather-suggestion-item i {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

body.dark-mode .weather-suggestion-item:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.weather-location-suggestion {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 8%, transparent);
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-location-suggestion:last-child {
  border-bottom: none;
}

.weather-location-suggestion:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.weather-location-suggestion__name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.weather-location-suggestion__details {
  font-size: 12px;
  color: var(--text-subtle);
}

body.dark-mode .weather-location-suggestion {
  border-bottom-color: color-mix(in srgb, var(--primary) 12%, transparent);
}

body.dark-mode .weather-location-suggestion:hover {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

.weather-modal-status {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-subtle);
}

.modal-panel--weather .modal-footer {
  flex-wrap: wrap;
  gap: 8px;
}

.modal-panel--weather .modal-footer .btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Category Management */
.category-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.category-modal-body { display: flex; flex-direction: column; gap: 24px; }
.category-modal-intro { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, transparent), color-mix(in srgb, var(--primary) 2%, transparent)); border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); }
.category-modal-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-dark); }
.category-modal-icon i { width: 24px; height: 24px; }
.category-modal-copy { flex: 1; min-width: 0; }
.category-modal-copy h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--text); }
.category-modal-copy p { margin: 0; color: var(--text-subtle); line-height: 1.45; font-size: 13px; }
.category-list--panel { padding: 6px 0; }
.category-empty { text-align: center; padding: 32px 18px; border-radius: 20px; border: 1px dashed color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--text-subtle); font-weight: 600; }
.category-item { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); background: rgba(255,255,255,0.95); box-shadow: 0 18px 40px rgba(18, 20, 24, 0.12); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition); }
.category-item:hover { transform: translateY(-2px); background: rgba(255,255,255,0.98); border-color: color-mix(in srgb, var(--primary) 32%, transparent); box-shadow: 0 22px 48px rgba(18, 20, 24, 0.16); }
.category-item__meta { display: flex; align-items: center; gap: 14px; min-width: 0; }
.category-item__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.category-item__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.category-item__name { font-weight: 700; font-size: 16px; color: var(--text); word-break: break-word; }
.category-item__count { font-size: 13px; color: var(--text-subtle); }
.category-item__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.category-item__action { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); background: color-mix(in srgb, var(--primary) 6%, transparent); font-size: 13px; font-weight: 600; color: var(--primary-dark); cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition); }
.category-item__action i { width: 16px; height: 16px; }
.category-item__action:hover { transform: translateY(-1px); background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; box-shadow: 0 14px 32px color-mix(in srgb, var(--primary) 24%, transparent); }
.category-item__action--danger { border-color: rgba(239,68,68,0.32); background: rgba(239,68,68,0.12); color: #d93025; }
.category-item__action--danger:hover { background: linear-gradient(135deg, #f87171, #ef4444); color: #fff; border-color: transparent; box-shadow: 0 14px 32px rgba(239,68,68,0.28); }
.category-item.is-highlighted { border-color: color-mix(in srgb, var(--primary) 42%, transparent); box-shadow: 0 22px 52px color-mix(in srgb, var(--primary) 28%, transparent); }
.category-form { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 8%, transparent); border: 1px dashed color-mix(in srgb, var(--primary) 32%, transparent); }
.category-form__row { display: flex; gap: 12px; flex-wrap: wrap; }
.category-form__row input { flex: 1 1 220px; }
.category-form__row .btn { flex: 0 0 auto; border-radius: 999px; padding: 10px 20px; }

body.dark-mode .category-item { background: rgba(30, 32, 38, 0.92); border-color: color-mix(in srgb, var(--primary) 22%, transparent); box-shadow: 0 22px 46px rgba(3, 5, 18, 0.65); }
body.dark-mode .category-item:hover { background: rgba(38, 40, 48, 0.95); border-color: color-mix(in srgb, var(--primary) 35%, transparent); box-shadow: 0 24px 52px rgba(8, 10, 12, 0.72); }
body.dark-mode .category-item__icon { background: color-mix(in srgb, var(--primary) 18%, transparent); color: #d6dcff; }
body.dark-mode .category-item__count { color: rgba(208, 214, 255, 0.72); }
body.dark-mode .category-item__action { border-color: color-mix(in srgb, var(--primary) 28%, transparent); background: color-mix(in srgb, var(--primary) 12%, transparent); color: #d6dcff; }
body.dark-mode .category-item__action:hover { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 16px 40px color-mix(in srgb, var(--primary-dark) 32%, transparent); }
body.dark-mode .category-item__action--danger { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.18); color: #ff9d9d; }
body.dark-mode .category-item__action--danger:hover { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; box-shadow: 0 16px 40px rgba(220, 38, 38, 0.35); }
body.dark-mode .category-item.is-highlighted { border-color: color-mix(in srgb, var(--primary) 45%, transparent); box-shadow: 0 26px 58px rgba(8, 13, 38, 0.7); }
body.dark-mode .category-modal-intro { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 26%, transparent), color-mix(in srgb, var(--primary) 8%, transparent)); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
body.dark-mode .category-modal-icon { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #fff; }
body.dark-mode .category-modal-copy p { color: rgba(235, 238, 255, 0.75); }
body.dark-mode .category-form { background: color-mix(in srgb, var(--primary) 22%, transparent); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
body.dark-mode .category-empty { border-color: color-mix(in srgb, var(--primary) 35%, transparent); background: color-mix(in srgb, var(--primary) 18%, transparent); color: rgba(235, 238, 255, 0.8); }


/* Form */
label { font-weight: 700; font-size: 13px; color: var(--text-subtle); }
input[type="text"], input[type="url"], input[type="color"], select { width: 100%; margin-top: 6px; margin-bottom: 10px; padding: 10px 12px; font-size: 14px; border-radius: 10px; border: 1px solid rgba(0,0,0,.12); outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.icon-row { display: flex; gap: 8px; align-items: center; }
.icon-row--with-preview { align-items: stretch; }
.bookmark-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.bookmark-form-main, .bookmark-form-side { display: flex; flex-direction: column; gap: 12px; }
.bookmark-form-side { padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 8%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.bookmark-form-side .icon-row { flex-direction: column; align-items: stretch; }
.bookmark-form-side .btn { align-self: stretch; }
.bookmark-icon-preview { width: 46px; height: 46px; border-radius: 14px; border: 1px dashed rgba(0,0,0,0.12); background: rgba(0,0,0,0.03); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color var(--transition), background var(--transition); position: relative; overflow: hidden; }
.bookmark-icon-preview.is-empty { border-style: solid; border-color: rgba(0,0,0,0.08); }
.bookmark-icon-preview img { width: 70%; height: 70%; object-fit: contain; display: block; border-radius: 10px; }
.bookmark-icon-preview .bookmark-emoji { font-size: 26px; line-height: 1; }
.bookmark-icon-preview svg { width: 70%; height: 70%; }
.bookmark-icon-preview i[data-lucide] { width: 24px; height: 24px; color: var(--primary-dark); opacity: 0.8; }
.bookmark-icon .bookmark-emoji { font-size: 24px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
body.dark-mode .bookmark-icon-preview { border-color: rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); }
body.dark-mode .bookmark-icon-preview.is-empty { border-color: rgba(255,255,255,0.15); }
body.dark-mode .bookmark-form-side { background: rgba(42, 44, 50, 0.58); border-color: color-mix(in srgb, var(--primary) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); }
.hint { font-size: 12px; color: var(--text-subtle); }
.icon-library-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; margin-bottom: 16px; }
.icon-library-link::after { content: '\2197'; font-size: 11px; }
.icon-library-link:hover { text-decoration: underline; }
body.dark-mode .icon-library-link { color: var(--primary); }
.btn { border: none; border-radius: 10px; padding: 8px 14px; font-weight: 700; cursor: pointer; background: #f3f4f6; color: var(--text); transition: all 0.2s ease; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }

/* Radio List - Background Type Buttons */
.radio-list { 
  display: flex; 
  gap: 10px;
  flex-wrap: wrap;
}

.radio-list label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--primary) 20%, transparent);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.radio-list label:hover {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  transform: translateY(-1px);
}

.radio-list input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-list input[type="radio"]:checked + span {
  color: #fff;
}

.radio-list label:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 25%, transparent);
}

.radio-list label:has(input[type="radio"]:checked):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent);
}

.radio-list label::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.radio-list label:has(input[type="radio"]:checked)::before {
  background: #fff;
  border-color: #fff;
  box-shadow: inset 0 0 0 3px var(--primary-dark);
}

body.dark-mode .radio-list label {
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: rgba(232, 236, 255, 0.9);
}

body.dark-mode .radio-list label:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
}

body.dark-mode .radio-list label:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 95%, transparent), color-mix(in srgb, var(--primary-dark) 95%, transparent));
  border-color: transparent;
  color: #fff;
}

@media (max-width: 640px) {
  .radio-list {
    gap: 8px;
  }
  
  .radio-list label {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1 1 auto;
    justify-content: center;
  }
  
  .radio-list label::before {
    width: 14px;
    height: 14px;
  }
}
.settings-field { margin-top: 8px; }
.settings-card__content > .settings-field:first-child { margin-top: 0; }
.settings-field.is-inactive { opacity: 0.55; }
.settings-field.is-inactive .settings-field__header,
.settings-field.is-inactive .settings-toggle { opacity: 1; }
.settings-field--row { display: grid; grid-template-columns: 1fr; gap: 16px; }
.settings-field__left { display: flex; align-items: center; gap: 12px; }
.settings-field__left label { font-weight: 700; font-size: 14px; color: var(--text); margin: 0; }
.settings-field__right { display: flex; flex-direction: column; gap: 8px; }
.settings-field__right label { font-weight: 600; font-size: 13px; color: var(--text-subtle); margin: 0; }
.settings-range-group { display: flex; align-items: center; gap: 12px; }
.settings-range-group .settings-range { flex: 1; }
.settings-range-group .range-value { flex: 0 0 auto; min-width: 45px; text-align: right; }

@media (min-width: 720px) {
  .settings-field--row { grid-template-columns: 1fr 1fr; align-items: start; }
}

.hidden { display: none !important; }

@media (min-width: 720px) {
  .bookmark-form-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
}

/* Settings modal */
.settings-body {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 8%, transparent) 0%, color-mix(in srgb, var(--primary) 4%, transparent) 45%, transparent 100%);
  border-radius: 0 0 16px 16px;
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  z-index: 1;
}


.settings-field__header { 
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between; 
  gap: 12px; 
  flex-wrap: wrap;
}

.dark-mode-panel { 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
  padding: 20px 22px; 
  border-radius: 18px; 
  background: color-mix(in srgb, var(--primary) 8%, transparent); 
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); 
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); 
  backdrop-filter: blur(12px); 
}

.dark-mode-panel__toggle { 
  display: flex; 
  align-items: flex-start; 
  justify-content: space-between; 
  gap: 18px; 
  flex-wrap: wrap;
}

.dark-mode-panel__text { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  max-width: clamp(220px, 60%, 340px); 
  min-width: 0;
  flex: 1 1 200px;
}

.dark-mode-panel__label { 
  font-size: 15px; 
  font-weight: 700; 
  color: var(--text); 
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.dark-mode-panel__hint { 
  margin: 0; 
  font-size: 12px; 
  line-height: 1.6; 
  color: var(--text-subtle); 
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.dark-mode-panel__actions { 
  display: flex; 
  align-items: center; 
  justify-content: flex-end; 
  gap: 14px; 
  flex-shrink: 0;
}
.dark-mode-toggle__status,
.weather-toggle__status,
.debug-toggle__status { 
  font-size: 12px; 
  font-weight: 700; 
  letter-spacing: 0.02em; 
  text-transform: uppercase; 
  color: var(--primary-dark); 
  padding: 6px 12px; 
  border-radius: 999px; 
  background: color-mix(in srgb, var(--primary) 12%, transparent); 
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .dark-mode-toggle__status,
  .weather-toggle__status,
  .debug-toggle__status {
    font-size: 10px;
    padding: 5px 9px;
    letter-spacing: 0.01em;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .dark-mode-toggle__status,
  .weather-toggle__status,
  .debug-toggle__status {
    font-size: 11px;
    padding: 6px 10px;
  }
}
.dark-mode-panel__slider { display: flex; flex-direction: column; gap: 12px; }
.dark-mode-panel__slider label { font-weight: 600; color: var(--text-subtle); }
.dark-mode-panel__slider .settings-range-group { display: flex; align-items: center; gap: 12px; }
.dark-mode-panel__slider .range-value { font-size: 13px; }
.appearance-field { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 6%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); min-height: 190px; }
.appearance-field__meta { display: flex; flex-direction: column; gap: 6px; }
.appearance-field__hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-subtle); }
.appearance-field--filter .settings-select { max-width: 180px; }
.appearance-field .hint { font-size: 12px; color: var(--text-subtle); }
.appearance-field .hint span { font-weight: 600; color: var(--primary-dark); }
.weather-field,
.developer-field { 
  display: flex; 
  flex-direction: column; 
  gap: 18px; 
  padding: 20px 22px; 
  border-radius: 18px; 
  background: color-mix(in srgb, var(--primary) 6%, transparent); 
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); 
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); 
  position: relative;
  overflow: visible;
}

.weather-field__meta,
.developer-field__meta { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  min-width: 0;
  flex: 1 1 200px;
}

.weather-field__hint,
.developer-field__hint { 
  margin: 0; 
  font-size: 12px; 
  line-height: 1.6; 
  color: var(--text-subtle); 
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.weather-field__controls,
.developer-field__controls { 
  display: flex; 
  align-items: center; 
  justify-content: flex-end; 
  gap: 14px; 
  flex-wrap: wrap; 
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 640px) {
  .weather-field__controls,
  .developer-field__controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
}
.weather-field__body { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  position: relative;
  z-index: 200;
  overflow: visible;
}
.weather-location-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.weather-location-controls .settings-input { flex: 1 1 220px; min-width: 200px; }
.weather-field__hint-text { color: var(--text-subtle); min-height: 16px; }
.weather-field.is-disabled { opacity: 0.6; }
.developer-field__hint { color: var(--text-subtle); }

@media (max-width: 640px) {
  .dark-mode-panel { padding: 18px; gap: 16px; }
  .dark-mode-panel__toggle { flex-direction: column; align-items: stretch; gap: 12px; }
  .dark-mode-panel__text { max-width: 100%; flex: 1 1 auto; }
  .dark-mode-panel__actions { justify-content: space-between; width: 100%; flex-wrap: nowrap; }
  .settings-toggle { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .weather-field__controls { justify-content: space-between; }
  .weather-location-controls { flex-direction: column; align-items: stretch; }
  .weather-location-controls .settings-input { min-width: 100%; }
}
.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  overflow: hidden;
  min-width: 0;
  flex-shrink: 1;
  max-width: 280px;
  box-shadow: none;
}

@media (max-width: 640px) {
  .settings-toggle {
    padding: 8px 12px;
    font-size: 11px;
    gap: 6px;
    max-width: 100%;
    width: 100%;
  }
  .settings-toggle__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .settings-toggle__icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  .settings-toggle__icon i {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .settings-toggle {
    padding: 8px 14px;
    font-size: 12px;
    gap: 8px;
    max-width: 220px;
  }
  .settings-toggle__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.settings-toggle:hover {
  transform: translateY(-1px);
  box-shadow: none;
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}

.settings-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 2px;
}

.settings-toggle__icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary-dark);
  transition: background var(--transition), color var(--transition);
}

.settings-toggle__icon i {
  width: 18px;
  height: 18px;
}

.settings-toggle__label {
  display: inline-block;
  white-space: nowrap;
}

.settings-toggle.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.settings-toggle.is-active .settings-toggle__icon {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.settings-toggle__icon.is-rotating i {
  animation: spin 1s linear infinite;
}

.settings-toggle--compact {
  padding: 8px 14px;
  font-size: 12px;
}

.settings-toggle--compact .settings-toggle__icon {
  width: 28px;
  height: 28px;
}

.dark-mode .settings-toggle {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  border-color: color-mix(in srgb, var(--primary) 26%, transparent);
  color: rgba(232, 236, 255, 0.9);
}

.dark-mode .settings-toggle:hover {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  box-shadow: none;
}

.dark-mode .settings-toggle__icon {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: #d6dcff;
}

.dark-mode .settings-toggle.is-active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 92%, transparent), color-mix(in srgb, var(--primary-dark) 92%, transparent));
  box-shadow: none;
}

.dark-mode .settings-toggle.is-active:hover {
  box-shadow: none;
}

.dark-mode .settings-toggle.is-active .settings-toggle__icon {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.settings-action-block { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-md); border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent); background: color-mix(in srgb, var(--primary) 6%, transparent); box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 8%, transparent); }
.settings-action-block__icon { width: 40px; height: 40px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.settings-action-block__icon i { width: 20px; height: 20px; }
.settings-action-block__body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.settings-action-block__body h5 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.settings-action-block__body p { margin: 0; color: var(--text-subtle); line-height: 1.5; font-size: 13px; }
.settings-action-block .btn { width: 100%; }

@media (min-width: 720px) {
  .settings-card__content--split { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .settings-card--background .settings-card__content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-card--appearance .settings-card__content { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

.settings-input,
.settings-select,
.settings-range,
.settings-file,
.settings-color { width: 100%; }

.settings-select,
.settings-input { background: rgba(255, 255, 255, 0.9); border-radius: 12px; border: 1px solid rgba(18, 20, 24, 0.08); padding: 10px 14px; transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
.settings-select:focus,
.settings-input:focus { border-color: color-mix(in srgb, var(--primary) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); background: #fff; }

.settings-sublabel { display: block; margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.settings-file { margin-top: 8px; border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); border-radius: 12px; padding: 10px 12px; background: color-mix(in srgb, var(--primary) 6%, transparent); cursor: pointer; transition: border-color var(--transition), background var(--transition); }
.settings-file:hover { border-color: color-mix(in srgb, var(--primary) 65%, transparent); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.settings-color { height: 44px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); padding: 6px; background: rgba(255, 255, 255, 0.9); }

.settings-inline { display: inline-flex; align-items: center; gap: 10px; }
.settings-inline input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.settings-inline__label { font-size: 13px; font-weight: 600; color: var(--text); }

.settings-range { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 20%, transparent); outline: none; transition: background var(--transition); }
.settings-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); cursor: pointer; box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 35%, transparent); transition: transform 0.2s ease; }
.settings-range::-webkit-slider-thumb:hover { transform: scale(1.08); }
.settings-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); cursor: pointer; box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 35%, transparent); }
.settings-range:focus { background: color-mix(in srgb, var(--primary) 32%, transparent); }

.range-value { font-size: 12px; font-weight: 600; color: var(--primary-dark); }

.settings-reset-section { margin-top: 24px; animation: settingsFadeIn 0.5s ease 0.2s both; }

.settings-reset-card { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; border-radius: var(--radius-md); border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent); box-shadow: 0 16px 32px rgba(18, 20, 24, 0.08); }

.settings-reset-card--combined { padding: 24px; gap: 0; }

.settings-reset-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid color-mix(in srgb, var(--primary) 15%, transparent); }
.settings-reset-header i { width: 22px; height: 22px; color: var(--primary); }
.settings-reset-header h4 { font-size: 17px; font-weight: 700; color: var(--text); }

.settings-reset-content { display: flex; flex-direction: column; gap: 0; }

.settings-reset-item { display: flex; flex-direction: column; gap: 14px; padding: 18px 0; }
@media (min-width: 640px) {
  .settings-reset-item { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }
}

.settings-reset-item__text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.settings-reset-item__text h5 { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-reset-item__text p { font-size: 13px; line-height: 1.6; color: var(--text-subtle); }

.settings-reset-divider { height: 1px; background: color-mix(in srgb, var(--primary) 12%, transparent); margin: 0; }

.settings-cache-info { display: flex; align-items: center; gap: 14px; padding: 18px 16px; background: color-mix(in srgb, var(--primary) 6%, transparent); border-radius: 10px; margin-top: 16px; }
.settings-cache-info__icon { width: 36px; height: 36px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 15%, transparent); border-radius: 8px; }
.settings-cache-info__icon i { width: 18px; height: 18px; color: var(--primary); }
.settings-cache-info__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.settings-cache-label { font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.settings-cache-size { font-size: 15px; font-weight: 700; color: var(--primary-dark); }

.settings-reset-card__text { display: flex; flex-direction: column; gap: 4px; }
.settings-reset-card__text h5 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.settings-reset-card__text p { font-size: 13px; line-height: 1.6; color: var(--text-subtle); }

@media (min-width: 540px) {
  .settings-reset-card:not(.settings-reset-card--combined) { flex-direction: row; align-items: center; justify-content: space-between; }
  .settings-reset-card__text { max-width: 480px; }
}

.btn.ghost { background: transparent; color: var(--primary-dark); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); padding: 10px 18px; transition: background var(--transition), border-color var(--transition), color var(--transition); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); border-color: color-mix(in srgb, var(--primary) 55%, transparent); color: var(--primary); }
.btn.ghost.btn-danger { color: #dc2626; border-color: rgba(220, 38, 38, 0.35); }
.btn.ghost.btn-danger:hover { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.55); color: #b91c1c; }

.btn.is-busy { position: relative; pointer-events: none; padding-left: 40px; }
.btn.is-busy::before { content: ''; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-bottom-color: transparent; border-right-color: transparent; transform: translateY(-50%); animation: spin 0.7s linear infinite; }

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

@keyframes settingsFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes settingsCardPop {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body.dark-mode .settings-card { background: rgba(25, 27, 32, 0.94); border: 1px solid rgba(255, 255, 255, 0.06); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45); }
body.dark-mode .settings-card--dark { background: linear-gradient(160deg, rgba(38, 40, 48, 0.92), rgba(28, 30, 36, 0.88)); border-color: color-mix(in srgb, var(--primary) 24%, transparent); box-shadow: 0 24px 44px rgba(0, 0, 0, 0.6); }
body.dark-mode .settings-card__header h4 { color: #f5f7ff; }
body.dark-mode .settings-card__header i { color: var(--primary); }
body.dark-mode .dark-mode-panel { background: color-mix(in srgb, var(--primary) 3%, rgba(40, 42, 50, 0.65)); border-color: color-mix(in srgb, var(--primary) 30%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); }
body.dark-mode .dark-mode-panel__label { color: #f5f7ff; }
body.dark-mode .dark-mode-panel__hint { color: rgba(235, 238, 255, 0.72); }
body.dark-mode .dark-mode-toggle__status,
body.dark-mode .weather-toggle__status,
body.dark-mode .debug-toggle__status { background: color-mix(in srgb, var(--primary) 18%, transparent); border-color: color-mix(in srgb, var(--primary) 34%, transparent); color: #e8ecff; }
body.dark-mode .dark-mode-panel__slider label { color: rgba(235, 238, 255, 0.75); }
body.dark-mode .appearance-field,
body.dark-mode .weather-field,
body.dark-mode .developer-field { background: color-mix(in srgb, var(--primary) 3%, rgba(40, 42, 50, 0.55)); border-color: color-mix(in srgb, var(--primary) 28%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent); }
body.dark-mode .appearance-field__hint,
body.dark-mode .weather-field__hint,
body.dark-mode .developer-field__hint { color: rgba(235, 238, 255, 0.72); }
body.dark-mode .appearance-field .hint,
body.dark-mode .weather-field__hint-text,
body.dark-mode .developer-field__hint { color: rgba(235, 238, 255, 0.68); }
body.dark-mode .appearance-field .hint span { color: var(--primary); }
body.dark-mode .settings-card__content label,
body.dark-mode .settings-card__content .hint { color: rgba(235, 238, 255, 0.72); }
body.dark-mode .settings-action-block { background: color-mix(in srgb, var(--primary) 8%, rgba(40, 42, 50, 0.5)); border-color: color-mix(in srgb, var(--primary) 24%, transparent); box-shadow: 0 18px 34px rgba(0, 0, 0, 0.55); }
body.dark-mode .settings-action-block__body h5 { color: #f5f7ff; }
body.dark-mode .settings-action-block__body p { color: rgba(235, 238, 255, 0.78); }
body.dark-mode .settings-select,
body.dark-mode .settings-input,
body.dark-mode .settings-file,
body.dark-mode .settings-color { background: rgba(28, 30, 35, 0.94); border: 1px solid rgba(255, 255, 255, 0.08); color: #f5f7ff; }
body.dark-mode .settings-select:focus,
body.dark-mode .settings-input:focus { border-color: color-mix(in srgb, var(--primary) 65%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
body.dark-mode .settings-inline__label { color: #f5f7ff; }
body.dark-mode .settings-range { background: color-mix(in srgb, var(--primary) 35%, transparent); }
body.dark-mode .settings-reset-card { border-color: color-mix(in srgb, var(--primary) 35%, transparent); background: color-mix(in srgb, var(--primary) 3%, rgba(40, 42, 50, 0.55)); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55); }
body.dark-mode .settings-reset-header { border-bottom-color: color-mix(in srgb, var(--primary) 20%, transparent); }
body.dark-mode .settings-reset-header h4 { color: #f5f7ff; }
body.dark-mode .settings-reset-header i { color: var(--primary); }
body.dark-mode .settings-reset-item__text h5 { color: #f5f7ff; }
body.dark-mode .settings-reset-item__text p { color: rgba(235, 238, 255, 0.7); }
body.dark-mode .settings-reset-divider { background: color-mix(in srgb, var(--primary) 15%, transparent); }
body.dark-mode .settings-cache-info { background: color-mix(in srgb, var(--primary) 3%, rgba(40, 42, 50, 0.6)); }
body.dark-mode .settings-cache-info__icon { background: color-mix(in srgb, var(--primary) 20%, transparent); }
body.dark-mode .settings-cache-label { color: rgba(235, 238, 255, 0.7); }
body.dark-mode .settings-cache-size { color: var(--primary); }
body.dark-mode .settings-reset-card__text h5 { color: #f5f7ff; }
body.dark-mode .settings-reset-card__text p { color: rgba(235, 238, 255, 0.7); }
body.dark-mode .btn.ghost { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: color-mix(in srgb, var(--primary) 6%, transparent); }
body.dark-mode .btn.ghost:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: color-mix(in srgb, var(--primary) 60%, transparent); }

.modal.show .modal-panel { animation: modalPop 0.32s cubic-bezier(0.33, 1, 0.68, 1) both; }

@keyframes modalPop {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Quick Settings */
.quick-settings {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
  align-items: flex-start;
}

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

.quick-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transition: all 0.3s ease;
  color: var(--text);
}

.quick-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}

.quick-btn i {
  width: 20px;
  height: 20px;
}

.quick-btn.active {
  background: var(--primary);
  color: white;
}

.quick-btn.active svg {
  stroke: white;
}

/* FAB (Floating Action Button) - Mobile */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
}

.fab-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 24, 0.32);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  pointer-events: none;
}

.fab-backdrop.show {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(4px);
  z-index: 1;
  pointer-events: auto;
}

.fab-button {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 45%, transparent), 0 0 0 0 color-mix(in srgb, var(--primary) 30%, transparent);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 3;
}

.fab-button::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 30%, transparent), rgba(54, 79, 199, 0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.fab-button:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 14px 40px color-mix(in srgb, var(--primary) 60%, transparent), 0 0 0 6px color-mix(in srgb, var(--primary) 15%, transparent);
}

.fab-button:hover::before {
  opacity: 1;
}

.fab-button:active {
  transform: scale(1.05);
}

.fab-button.active {
  transform: rotate(135deg) scale(1.05);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--primary) 50%, transparent);
}

.fab-button.active i {
  transform: rotate(-135deg);
}

.fab-button i {
  width: 26px;
  height: 26px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-menu {
  position: absolute;
  bottom: 78px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transform-origin: right bottom;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.fab-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.fab-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border: none;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(18px) saturate(180%);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(18, 20, 24, 0.12), 0 0 0 1px color-mix(in srgb, var(--primary) 8%, transparent);
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: right center;
  animation: fabSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  position: relative;
  overflow: hidden;
}

.fab-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fab-option:nth-child(1) { animation-delay: 0.06s; }
.fab-option:nth-child(2) { animation-delay: 0.12s; }
.fab-option:nth-child(3) { animation-delay: 0.18s; }
.fab-option:nth-child(4) { animation-delay: 0.24s; }
.fab-option:nth-child(5) { animation-delay: 0.30s; }

@keyframes fabSlideIn {
  from {
    opacity: 0;
    transform: translateX(30px) translateY(10px) scale(0.7);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
}

.fab-option:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateX(-6px) translateY(-3px) scale(1.03);
  box-shadow: 0 16px 48px rgba(18, 20, 24, 0.2), 0 0 0 1px color-mix(in srgb, var(--primary) 15%, transparent);
}

.fab-option:hover::before {
  opacity: 1;
}

.fab-option:active {
  transform: translateX(-4px) translateY(-1px) scale(0.98);
}

.fab-option i {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 1;
}

.fab-option:hover i {
  transform: scale(1.1) rotate(5deg);
}

.fab-option span {
  font-size: 15px;
  font-weight: 600;
  z-index: 1;
}

body.dark-mode .fab-button {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 95%, transparent), color-mix(in srgb, var(--primary-dark) 95%, transparent));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 0 color-mix(in srgb, var(--primary) 30%, transparent);
}

body.dark-mode .fab-button::before {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 40%, transparent), color-mix(in srgb, var(--primary-dark) 40%, transparent));
}

body.dark-mode .fab-button:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 0 6px color-mix(in srgb, var(--primary) 20%, transparent);
}

body.dark-mode .fab-option {
  background: rgba(30, 32, 38, 0.98);
  backdrop-filter: blur(18px) saturate(150%);
  color: rgba(232, 236, 255, 0.95);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

body.dark-mode .fab-option::before {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 15%, transparent), transparent);
}

body.dark-mode .fab-option:hover {
  background: rgba(38, 40, 45, 1);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.7), 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

body.dark-mode .fab-option i {
  color: color-mix(in srgb, var(--primary) 90%, transparent);
}

body.dark-mode .fab-option:hover i {
  color: rgba(200, 210, 255, 1);
}

body.dark-mode .fab-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

body.dark-mode .fab-backdrop.show {
  backdrop-filter: blur(6px);
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 8px;
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
}

.lang-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: background var(--transition);
}

.lang-option:hover {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.lang-option.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

body.dark-mode .lang-menu {
  background: rgba(30, 30, 40, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .lang-option:hover {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Dark Mode */
body {
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease;
}

body.dark-mode {
  --surface: rgba(30, 30, 40, 0.92);
  --surface-muted: rgba(30, 30, 40, 0.75);
  --text: #e8eaed;
  --text-subtle: #b8bdc3;
  --border: rgba(255, 255, 255, 0.15);
}

/* body.dark-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, var(--dark-overlay-opacity, 0.35));
  pointer-events: none;
  z-index: -1;
  animation: fadeInOverlay 0.5s ease;
} */

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.dark-mode .hero-title {
  color: #fff;
  text-shadow: 0 10px 30px rgba(0,0,0,.6);
}

body.dark-mode .hero-subtitle {
  color: rgba(255,255,255,.85);
}

body.dark-mode .quick-btn {
  background: rgba(30, 30, 40, 0.92);
  color: #e8eaed;
}

body.dark-mode .quick-btn:hover {
  background: rgba(40, 40, 50, 1);
}

body.dark-mode input[type="text"],
body.dark-mode input[type="url"],
body.dark-mode select,
body.dark-mode textarea {
  background: rgba(40, 40, 50, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

body.dark-mode .btn {
  background: rgba(60, 60, 65, 0.9);
  color: #e8eaed;
}

body.dark-mode .btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

body.dark-mode .modal-panel {
  background: rgba(25, 25, 35, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .bookmark-item {
  background: rgba(24, 28, 46, 0.92);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  color: rgba(232, 236, 255, 0.95);
}

body.dark-mode .bookmark-card {
  background: rgba(22, 24, 28, 0.9);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  box-shadow: 0 28px 64px rgba(3, 5, 15, 0.75);
  backdrop-filter: blur(18px);
}

body.dark-mode .bookmark-card__header h2 {
  color: rgba(232, 236, 255, 0.95);
}

body.dark-mode .bookmark-card__header p {
  color: rgba(232, 236, 255, 0.65);
}

body.dark-mode .bookmark-name {
  color: rgba(232, 236, 255, 0.92);
  font-weight: 700;
}

body.dark-mode .search-bar {
  background: rgba(45, 45, 55, 0.95);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .search-bar input {
  background: transparent;
  color: var(--text);
}

body.dark-mode .search-card {
  background: rgba(22, 24, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .engine-selector {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .engine-selector.engine-selector--inline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

body.dark-mode .engine-selector.engine-selector--inline:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

body.dark-mode .engine-selector.engine-selector--inline .engine-selector__icon {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

body.dark-mode .engine-selector__chevron {
  color: rgba(255, 255, 255, 0.8);
}

body.dark-mode .engine-dropdown {
  background: rgba(22, 24, 28, 0.98);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.5);
}

body.dark-mode .engine-option {
  color: rgba(255, 255, 255, 0.85);
}

body.dark-mode .engine-option:hover {
  background: color-mix(in srgb, var(--primary) 25%, transparent);
}

body.dark-mode .engine-option.active {
  background: color-mix(in srgb, var(--primary) 35%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

body.dark-mode .search-input-wrapper {
  background: rgba(22, 24, 28, 0.88);
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
  box-shadow: 0 26px 52px rgba(0, 0, 0, 0.55);
}

body.dark-mode #searchInput {
  color: #fff;
}

body.dark-mode #searchInput::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

body.dark-mode .weather-widget {
  background: rgba(34, 36, 40, 0.78);
  border-color: color-mix(in srgb, var(--primary) 24%, transparent);
  color: #f5f7ff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

body.dark-mode .weather-widget__icon {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

body.dark-mode .weather-widget__icon i {
  color: #f5f7ff;
}

body.dark-mode .weather-widget__status {
  opacity: 0.9;
}

body.dark-mode .weather-widget__meta {
  opacity: 0.8;
}

body.dark-mode .search-action:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

body.dark-mode .engine-selector--inline::after {
  background: color-mix(in srgb, var(--primary) 40%, transparent);
}

body.dark-mode .custom-engine {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode .suggestion-item {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

body.dark-mode .suggestion-item:hover {
  background: color-mix(in srgb, var(--primary) 42%, transparent);
}

body.dark-mode .bookmark-actions button {
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .bookmark-actions button:hover {
  background: color-mix(in srgb, var(--primary) 50%, transparent);
  border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .bookmark-item:hover .bookmark-actions {
  opacity: 1;
}

body.dark-mode .toolbar-btn {
  background: rgba(35, 35, 45, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

body.dark-mode .toolbar-btn:hover {
  background: rgba(45, 45, 55, 1);
}

body.dark-mode .toolbar-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  
  .app { padding: 60px 16px 100px; gap: 24px; }
  .hero-title { font-size: clamp(32px, 8vw, 48px); }
  .hero-subtitle { font-size: 16px; }
  .search-card { padding: 20px; }
  .engine-selector { padding: 8px 12px; }
  .engine-selector__label { font-size: 13px; }
  .engine-dropdown { width: 200px; }
  .search-input-wrapper { padding: 12px; }
  .search-action { padding: 8px 12px; font-size: 13px; }
  .modal-panel { width: calc(100% - 32px); max-height: 90vh; }
  .icon-row { flex-direction: column; }
  .bookmark-form-side { padding: 14px; }
  .category-modal-intro { flex-direction: row; align-items: flex-start; gap: 12px; }
  .category-modal-icon { width: 40px; height: 40px; }
  .category-modal-icon i { width: 22px; height: 22px; }
  .category-modal-copy h4 { font-size: 15px; }
  .category-modal-copy p { font-size: 12px; }
  .category-form__row { flex-direction: column; }
  .category-form__row .btn { width: 100%; }
}

@media (max-width: 640px) {
  .search-card {
    padding: 18px 16px;
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.78) 60%, rgba(255,255,255,0.72) 100%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 18px 44px color-mix(in srgb, var(--primary) 18%, transparent);
    gap: 18px;
    backdrop-filter: blur(22px);
  }
  .search-input-wrapper {
    background: rgba(255,255,255,0.96);
    border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
    box-shadow: 0 18px 40px color-mix(in srgb, var(--primary) 22%, transparent);
    border-radius: 20px;
    padding: 14px;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    gap: 8px;
  }
  .search-input-wrapper .engine-selector--inline {
    margin-right: 0;
  }
  .engine-selector--inline::after {
    display: none;
  }
  .engine-selector--inline {
    padding: 4px;
  }
  .engine-selector--inline .engine-selector__icon {
    width: 40px;
    height: 40px;
  }
  .engine-selector--inline .engine-selector__icon img,
  .engine-selector--inline .engine-selector__icon svg,
  .engine-selector--inline .engine-selector__icon i {
    width: 28px;
    height: 28px;
  }
  .engine-selector--inline .engine-selector__chevron {
    display: none;
  }
  .search-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }
  .search-action {
    flex: 1 1 auto;
    width: auto;
    text-align: center;
    border-radius: 14px;
  }
  .search-action.secondary {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary-dark);
  }
  .search-action.primary {
    box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 30%, transparent);
  }
  #searchInput {
    font-size: 15px;
  }
  .search-suggestions {
    background: rgba(255,255,255,0.9);
    border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 20px 40px color-mix(in srgb, var(--primary) 18%, transparent);
    backdrop-filter: blur(18px);
  }
  .bookmark-grid, .bookmarks-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
  .bookmark-item__name { font-size: 12px; }
  .fab-button { width: 52px; height: 52px; }
  .fab-container { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 14px; }
  .app { padding: 50px 12px 90px; }
  .fab-button { width: 48px; height: 48px; }
  .fab-option { padding: 10px 16px; font-size: 13px; }
}

/* range input minimal styling */
input[type="range"] { appearance: none; -webkit-appearance: none; height: 6px; background: rgba(0,0,0,0.08); border-radius: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
input[type="range"]:focus { outline: none; }

body.dark-mode input[type="range"] { background: rgba(255,255,255,0.12); }

/* Range value display */
.range-value {
  display: inline-block;
  margin-left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
  vertical-align: middle;
}

/* Icon Search Grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.icon-grid-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 12px;
  font-size: 14px;
  color: var(--text-subtle);
}

.icon-grid-loading {
  animation: icon-pulse 1.2s ease-in-out infinite;
}

.icon-load-more {
  grid-column: 1 / -1;
  margin: 8px auto 0;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 12px color-mix(in srgb, var(--primary) 25%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-load-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}

.icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  width: 100%;
  font: inherit;
}

.icon-grid-item:hover,
.icon-grid-item:focus-visible {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  transform: translateY(-2px);
  outline: none;
}

.icon-grid-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.icon-grid-item span {
  font-size: 11px;
  text-align: center;
  color: var(--text-subtle);
  word-break: break-word;
}

.icon-subtitle {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

body.dark-mode .icon-grid-item {
  background: rgba(255,255,255,0.05);
}

body.dark-mode .icon-grid-item:hover,
body.dark-mode .icon-grid-item:focus-visible {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
}
  body.dark-mode .search-card {
    background: linear-gradient(160deg, rgba(22,24,28,0.94) 0%, rgba(22,24,28,0.86) 60%, rgba(22,24,28,0.82) 100%);
    border-color: color-mix(in srgb, var(--primary) 24%, transparent);
    box-shadow: 0 20px 48px rgba(0,0,0,0.65);
  }
  body.dark-mode .search-input-wrapper {
    background: rgba(22,24,28,0.95);
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
    box-shadow: 0 20px 46px rgba(0,0,0,0.7);
  }
  body.dark-mode .search-suggestions {
    background: rgba(22,24,28,0.92);
    border-color: color-mix(in srgb, var(--primary) 26%, transparent);
    box-shadow: 0 22px 48px rgba(0,0,0,0.68);
  }

body.dark-mode .icon-load-more {
  box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

@keyframes icon-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}
