* { margin: 0; padding: 0; box-sizing: border-box; }
/* Keyboard focus: hidden by default, visible only when navigating by keyboard */
*:focus { outline: none; }
*:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; border-radius: 2px; }

/* ========== THEME VARIABLES ========== */

/* Dark theme — deep navy with 3D depth */
body.theme-b {
  --body-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --body-bg-attachment: fixed;
  --body-overlay: none;
  --text-main: #e8e8f0;
  --text-dim: #8892b0;
  --panel-bg: rgba(26,26,46,0.7);
  --panel-blur: blur(20px);
  --panel-border: rgba(255,255,255,0.08);
  --input-bg: rgba(255,255,255,0.04);
  --input-border: rgba(255,255,255,0.1);
  --btn-bg: rgba(255,255,255,0.04);
  --btn-hover-bg: rgba(255,255,255,0.1);
  --btn-border: rgba(255,255,255,0.08);
  --favicon-bg: rgba(255,255,255,0.06);
  --card-hover-bg: rgba(255,255,255,0.06);
  --context-bg: rgba(26,26,46,0.95);
  --context-border: rgba(129,140,248,0.2);
  --scrollbar-color: rgba(129,140,248,0.15);
  --scrollbar-hover: rgba(129,140,248,0.3);
  --scrollbar-bg: transparent;
  --text-mid: rgba(232,228,216,0.55);
  --sep-color: rgba(255,255,255,0.08);
  --card-bg: rgba(255,255,255,0.04);
  --context-item-hover: rgba(255,255,255,0.08);
  --badge-color: rgba(148,163,184,0.3);
  --banner-bg: rgba(26,26,46,0.9);
  --banner-text: #e8e8f0;
  --engine-baidu: rgba(59,130,246,0.12);
  --engine-google: rgba(16,185,129,0.12);
  --engine-bing: rgba(99,102,241,0.12);
  --engine-github: rgba(148,163,184,0.12);
}

/* Eye-care theme — warm dark with reduced blue light */
body.theme-c {
  --body-bg: linear-gradient(135deg, #1c1c16 0%, #2a2418 50%, #1a1c10 100%);
  --body-bg-attachment: fixed;
  --body-overlay: none;
  --text-main: #e8e4d8;
  --text-dim: rgba(232,228,216,0.5);
  --text-mid: rgba(232,228,216,0.7);
  --panel-bg: rgba(40,38,28,0.75);
  --panel-blur: blur(20px);
  --panel-border: rgba(180,160,120,0.12);
  --card-bg: rgba(60,56,40,0.4);
  --card-hover-bg: rgba(80,76,56,0.5);
  --favicon-bg: rgba(60,56,40,0.35);
  --input-bg: rgba(40,38,28,0.5);
  --input-border: rgba(180,160,120,0.15);
  --btn-bg: rgba(40,38,28,0.45);
  --btn-hover-bg: rgba(60,56,40,0.55);
  --btn-border: rgba(180,160,120,0.12);
  --context-bg: rgba(28,26,18,0.96);
  --context-border: rgba(180,160,120,0.15);
  --sep-color: rgba(180,160,120,0.15);
  --scrollbar-color: rgba(180,160,120,0.2);
  --scrollbar-hover: rgba(180,160,120,0.4);
  --scrollbar-bg: transparent;
}

/* Warm theme — soft cream/parchment, easy on the eyes (no harsh white) */
body.theme-w {
  --body-bg: #f5ede0;
  --body-bg-attachment: scroll;
  --body-overlay: none;
  --text-main: #3d2f1f;
  --text-dim: #8b7355;
  --text-mid: #6b5a44;
  --panel-bg: #faf3e6;
  --panel-blur: none;
  --panel-border: #d9c9a8;
  --card-bg: #f9f1e0;
  --card-hover-bg: #f0e4ce;
  --favicon-bg: #ede0c4;
  --input-bg: #f9f1e0;
  --input-border: #d9c9a8;
  --btn-bg: #faf3e6;
  --btn-hover-bg: #f0e4ce;
  --btn-border: #d9c9a8;
  --context-bg: #faf3e6;
  --context-border: #d9c9a8;
  --sep-color: #d9c9a8;
  --scrollbar-color: #d9c9a8;
  --scrollbar-hover: #b8a484;
  --scrollbar-bg: #f5ede0;
}


/* ========== BASE ========== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  height: 100vh;
  overflow: hidden;
  background: var(--body-bg);
  background-attachment: var(--body-bg-attachment);
  color: var(--text-main);
  position: relative;
  transition: background 0.4s, color 0.3s;
}
/* Transitions only on interactive elements — not all children */
.interactive-element, .link-card, .link-card *,
.engine-btn, .engine-btn *,
.setting-btn, .setting-btn *,
.quick-link-item, .quick-link-item *,
.recent-item, .recent-item *,
.context-menu-item, .context-menu-item *,
.category-title, .category-title *,
.favicon-box, .favicon-box *,
.favicon-circle, .favicon-circle *,
.search-box, .search-box *,
.modal-btn, .modal-btn *,
.bg-preset, .bg-preset *,
.color-swatch, .color-swatch *,
.cat-list-item, .cat-list-item *,
input[type="range"], input[type="range"] * {
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s, color 0.2s;
}





body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--body-overlay);
  pointer-events: none;
  z-index: 0;
}

/* Tech scan line effect */

/* ========== INLINE TOP-BAR THEME + LANGUAGE ========== */
.tb-theme-dot {
  display: inline-block;
  width: 13px; height: 13px;
  border-radius: 50%;
  cursor: pointer;
  border: 1.5px solid transparent;
  vertical-align: middle;
  margin: 0 2px;
  transition: transform 0.2s, border-color 0.2s;
}
.tb-theme-dot:hover { transform: scale(1.25); }
.tb-theme-dot.active { border-color: var(--text-main); transform: scale(1.2); }
#langToggle { transition: opacity 0.15s; }
#langToggle:hover { opacity: 0.85 !important; }

/* ========== DESIGN BADGE ========== */
.design-badge {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 100px;
  font-weight: 900;
  color: var(--badge-color);
  pointer-events: none;
  z-index: 0;
  letter-spacing: 20px;
  white-space: nowrap;
  font-family: sans-serif;
}

/* ========== PREVIEW BANNER ========== */
.preview-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--banner-bg);
  backdrop-filter: blur(10px);
  color: var(--banner-text);
  text-align: center;
  padding: 3px;
  font-size: 10px;
  font-weight: 500;
  z-index: 999;
  letter-spacing: 1px;
}

/* ========== TOP INFO BAR ========== */
.top-info-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border-bottom: 0.5px solid var(--panel-border);
  padding: 8px 0;
  font-size: 14px;
  z-index: 100;
  white-space: nowrap;
  overflow: hidden;
}
.top-info-bar-inner {
  width: 92vw; max-width: 1600px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  min-height: 36px;
}
.top-info-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.08) 50%, transparent 80%);
}


.top-info-bar .weather-group {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
  transition: background 0.2s;
}
.top-info-bar .weather-group:hover { background: var(--card-hover-bg); }
.top-info-bar .weather-text { font-weight: 500; }
.top-info-bar .weather-edit { font-size: 10px; opacity: 0.4; }
.top-info-bar .sep { width: 1px; height: 16px; background: var(--sep-color); border-radius: 1px; }
.top-info-bar .time-display { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.top-info-bar .date-display { opacity: 0.65; font-size: 13px; }


/* ========== NEW WINDOW HINT ========== */
.new-window-hint {
  position: fixed;
  top: 44px; left: 50%; transform: translateX(-50%);
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 10px;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-mid);
  z-index: 998;
  display: flex; align-items: center; gap: 8px;
}

/* ========== SEARCH MODULE ========== */
.search-module {
  display: flex; align-items: center; justify-content: center;
  margin: 12vh auto 32px;
  width: min(92vw, 1000px);
  min-width: 360px; max-width: 1000px; gap: 12px;
}

.search-box {
  position: relative;
  flex: 1; min-width: 0; flex-shrink: 1;
  display: flex; align-items: center;
  background: var(--input-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--input-border);
  border-radius: 18px; padding: 10px 20px; gap: 10px;
  height: 44px; max-height: 44px;
  overflow: visible;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search-box:focus-within {
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}


.search-box .search-icon { font-size: 22px; opacity: 0.5; }
.search-box .search-input-placeholder {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-dim); font-size: 17px; font-family: inherit;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Auto-fill: main area expands when side panels hidden */
.content-area.auto-fill .main-area { flex: 1; }
.search-box .search-input-placeholder[data-empty="1"]::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  opacity: 0.5;
  pointer-events: none;
}

.engine-btns { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

.engine-btn {
  padding: 10px 18px; border-radius: 12px;
  border: 0.5px solid var(--btn-border);
  background: var(--btn-bg); color: var(--text-main);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s; white-space: nowrap;
}
/* Active/default engine button */
.engine-btn:has(span) { border-color: #818cf8 !important; background: rgba(129,140,248,0.18) !important; box-shadow: 0 0 8px rgba(129,140,248,0.15); }

.engine-btn:hover { background: var(--btn-hover-bg); border-color: var(--text-dim); transform: translateY(-1px); }
.engine-btn.engine-baidu { background: var(--engine-baidu); border-color: rgba(59,130,246,0.3); }
.engine-btn.engine-google { background: var(--engine-google); border-color: rgba(16,185,129,0.3); }
.engine-btn.engine-bing { background: var(--engine-bing); border-color: rgba(99,102,241,0.3); }
.engine-btn.engine-github { background: var(--engine-github); border-color: rgba(156,163,175,0.3); }


.engine-add {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px dashed var(--btn-border);
  background: transparent; color: var(--text-dim);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.engine-add:hover { background: var(--btn-hover-bg); color: var(--text-main); }


/* ========== CONTENT AREA ========== */
/* Content area - wider to reduce edge gap */
.content-area {
  display: flex; gap: 0;
  width: 92vw; max-width: 1600px; margin: 0 auto;
  min-height: auto;
  min-width: 600px;
  overflow: visible;
  align-items: flex-start;
}
.left-panel { margin-right: 12px; display: flex; flex-direction: column; }
.right-panel { margin-left: 12px; }
.main-area { margin: 0 12px; }
.main-area::-webkit-scrollbar { width: 6px; }
.main-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.main-area::-webkit-scrollbar-track { background: transparent; }
.content-area.panel-right { flex-direction: row-reverse; }

/* Right panel - recent visits */
.right-panel {
  width: 170px; flex-shrink: 0; min-height: 200px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--panel-border);
  border-radius: 16px; padding: 16px 12px;
  position: sticky; top: 0;
  max-height: calc(100vh - 12vh - 130px);
  overflow-y: auto;
  scrollbar-width: none;
}
.right-panel::-webkit-scrollbar { display: none; }
.right-panel .panel-title { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 8px; padding: 6px 10px; background: var(--card-hover-bg); border-radius: 8px; }
.right-panel .recent-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px;
  cursor: pointer; font-size: 12px; color: var(--text-dim);
  transition: all 0.15s;
}
.right-panel .recent-item:hover { background: var(--card-hover-bg); color: var(--text-main); }
.right-panel .recent-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }


.left-panel {
  width: 170px; flex-shrink: 0;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--panel-border);
  border-radius: 16px; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0;
  max-height: calc(100vh - 12vh - 130px);
  overflow-y: auto;
  scrollbar-width: none;
}
.left-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  border-radius: 1px;
}
.left-panel::-webkit-scrollbar { display: none; }


.left-panel .panel-title { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 8px; padding: 6px 10px; background: var(--card-hover-bg); border-radius: 8px; }

.quick-link-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: grab; transition: all 0.15s; position: relative;
}
.quick-link-item:active { cursor: grabbing; }
.quick-link-item:hover { background: var(--card-hover-bg); }
.quick-link-item:hover .favicon-circle { background: var(--card-bg) !important; transform: scale(1.15); }
.quick-link-item:active { transform: scale(0.97); }

.quick-link-item .favicon-circle { background: var(--card-bg) !important;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--favicon-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  transition: transform 0.2s;
  overflow: hidden;
}
.quick-link-item .favicon-circle img {
  width: 28px; height: 28px; object-fit: contain; border-radius: 7px;
}

.quick-link-item .link-name { font-size: 13px; color: var(--text-main); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-link-item .link-action { opacity: 0; font-size: 14px; color: var(--text-dim); transition: opacity 0.15s; cursor: pointer; }
.quick-link-item:hover .link-action { opacity: 1; }

.quick-link-add {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 8px 8px 8px; border-radius: 10px;
  border: 1px dashed var(--panel-border);
  color: var(--text-dim); font-size: 11px;
  cursor: pointer; margin-top: auto; transition: all 0.2s;
}
.quick-link-add:hover { background: var(--btn-hover-bg); color: var(--text-main); }

.main-area { flex: 1; min-width: 0; background: var(--panel-bg); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur); border: 0.5px solid var(--panel-border); border-radius: 16px; padding: 18px 16px; position: relative; z-index: 1; overflow-y: auto; max-height: calc(100vh - 12vh - 130px); }
.left-panel, .right-panel { position: relative; z-index: 310; }
.category-section {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  overflow: hidden;
}
.category-section.hidden-cat { opacity: 0; max-height: 0; margin-bottom: 0; pointer-events: none; visibility: hidden; overflow: hidden !important; }
.category-section.hidden-cat::before { display: none; }

.category-title {
  display: block; width: var(--cat-title-width, 65px); flex-shrink: 0;
  transition: width 0.2s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  height: 36px; line-height: 36px; font-size: 15px; font-weight: 700;
  color: var(--text-main); padding: 0 12px; border-radius: 8px;
  background: transparent;
  border: none;
  border-left: 4px solid rgba(129,140,248,0.4);
  flex-shrink: 0;
  cursor: context-menu; user-select: none;
  letter-spacing: 0.5px;
  transition: background 0.2s;
  /* Use a pseudo-element tooltip instead of overflowing the element */
  position: relative;
}
.category-title:hover {
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border-radius: 8px;
  z-index: 10;
}
body.theme-b .category-title {
  border-left-color: rgba(129,140,248,0.7);
  box-shadow: 0 2px 12px rgba(129,140,248,0.1);
}

.link-cards { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; border-radius: 8px; transition: background 0.15s, box-shadow 0.15s; }
.link-cards:empty { min-height: 44px; }
.link-cards.drag-over-empty { background: rgba(99,102,241,0.1); box-shadow: inset 0 0 0 2px dashed rgba(99,102,241,0.4); }

.link-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 68px; padding: 8px 4px 6px; border-radius: 14px;
  background: var(--card-bg);
  cursor: pointer; transition: all 0.2s; position: relative;
}
.link-card:hover {
  background: var(--card-hover-bg);
  transform: translateY(-2px);
}
.link-card.dragging { opacity: 0.4; transform: scale(0.95); }
.link-card { transition: transform 0.2s, margin 0.2s, border-color 0.15s; }

/* ========== THEME: 3D 立体 ========== */
body.theme-b .link-card { perspective: 600px; }
body.theme-b .link-card:hover { transform: translateY(-4px) rotateX(3deg) rotateY(-2deg); }
body.theme-b .link-card:hover .link-label { transform: translateZ(4px); }
body.theme-b .quick-link-item { perspective: 400px; }
body.theme-b .quick-link-item.dragging { opacity: 0.4; transform: scale(0.96); }
body.theme-b .quick-link-item:hover { transform: translateX(4px) rotateY(-1deg); }
body.theme-b .search-box { box-shadow: 0 4px 16px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.04); }
body.theme-b .search-box:focus-within { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.12), inset 0 0 0 1px rgba(255,255,255,0.06); }
body.theme-b .engine-btn { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
body.theme-b .engine-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
body.theme-b .left-panel, body.theme-b .top-info-bar { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
body.theme-b .setting-btn:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.14); }
body.theme-b .category-title { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* ========== Favicon Box (base styles) ========== */
.favicon-box { background: var(--card-bg) !important;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--favicon-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; transition: all 0.2s;
  overflow: hidden;
}
.link-card .favicon-box img {
  width: 46px; height: 46px; object-fit: contain; border-radius: 12px;
}


.link-card .link-label {
  font-size: 12px; color: var(--text-mid);
  text-align: center; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62px;
}

/* ========== CONTEXT MENU ========== */
.context-menu {
  position: fixed;
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 12px; padding: 6px; min-width: 190px;
  z-index: 1000; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.context-menu.show { display: block; }

.context-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 8px;
  font-size: 13px; cursor: pointer;
  color: var(--text-main); transition: all 0.15s;
}
.context-menu-item:hover { background: var(--context-item-hover); }
.context-menu-item .menu-icon { font-size: 14px; width: 18px; text-align: center; }
.context-menu-item .menu-shortcut { color: var(--text-dim); font-size: 11px; margin-left: auto; }
.menu-check { color: #10b981; font-weight: bold; margin-left: auto; font-size: 12px; }
.context-menu .menu-divider { height: 1px; background: var(--context-border); margin: 4px 8px; }

/* ========== SETTINGS PANEL ========== */
.settings-panel {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; gap: 8px; z-index: 100;
  max-width: calc(100vw - 40px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.setting-btn {
  width: auto; min-width: 56px; height: 38px; border-radius: 10px;
  padding: 6px 14px;
  border: 0.5px solid var(--btn-border);
  background: var(--btn-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  display: flex; flex-direction: row; align-items: center;
  justify-content: center; gap: 6px;
  cursor: pointer; transition: all 0.2s;
  color: var(--text-main);
  white-space: nowrap;
  position: relative;
}
.setting-btn:hover { background: var(--btn-hover-bg); border-color: var(--text-dim); transform: translateY(-2px); }
.setting-btn:hover .btn-tooltip { display: block; }
.setting-btn.panel-active .btn-tooltip { display: none !important; }
.setting-btn:active { transform: translateY(0) scale(0.95); }
.setting-btn .btn-icon { font-size: 15px; }
.setting-btn .btn-label { font-size: 12px; opacity: 0.8; }

/* Button hover tooltips */
.btn-tooltip {
  display: none;
  position: absolute;
  bottom: 110%;
  right: 0;
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 240px;
  z-index: 250;
  white-space: normal;
  pointer-events: none;
}
.btn-tooltip h4 {
  font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-main);
}
.btn-tooltip ul {
  list-style: none; padding: 0; margin: 0;
}
.btn-tooltip ul li {
  font-size: 11px; color: var(--text-dim);
  padding: 2px 0;
  display: flex; align-items: center; gap: 6px;
}
.btn-tooltip ul li::before {
  content: '•'; color: var(--text-mid); font-size: 14px;
}


/* ========== OPACITY PANEL ========== */
.opacity-panel {
  position: fixed; bottom: 90px; right: 20px;
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 16px; padding: 12px 16px;
  min-width: 260px; z-index: 400; display: none;
  max-height: none; overflow-y: visible;
}
.opacity-panel.show { display: block !important; }

.opacity-panel h3 { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 10px; }

/* One-line layout: label + range + value on same row */
.opacity-inline {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: nowrap;
}
.opacity-inline .op-inline-label {
  width: 130px; font-size: 12px; color: var(--text-dim);
  white-space: nowrap; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis;
}
.opacity-inline .op-inline-range {
  flex: 1; min-width: 0;
}
.opacity-inline .op-inline-val {
  width: 45px; text-align: right; font-size: 12px; color: var(--text-mid);
  white-space: nowrap; flex-shrink: 0;
}

.opacity-group { margin-bottom: 10px; }
.opacity-group:last-child { margin-bottom: 0; }

.opacity-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-dim); margin-bottom: 6px;
  white-space: nowrap; flex-wrap: nowrap;
}
.opacity-group label .val, .opacity-panel .val { color: var(--text-main); font-weight: 500; font-size: 11px; }

.opacity-group input[type="range"] {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: var(--sep-color); border-radius: 2px; outline: none; cursor: pointer;
}
.opacity-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-main); cursor: pointer;
  border: 2px solid var(--panel-border);
}

/* ========== BG COLOR PALETTE ========== */
.bg-color-palette {
  position: fixed;
  bottom: 90px;
  right: 20px;
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 260px;
  z-index: 200;
  display: none;
}
.bg-color-palette.show { display: block; }

.bg-color-palette h3 {
  font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 4px;
}
.bg-color-palette .subtitle { font-size: 10px; color: var(--text-dim); margin-bottom: 12px; }

.color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}

.color-swatch {
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  opacity: 1 !important;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--text-main); box-shadow: 0 0 0 2px var(--panel-border); }

.color-swatch.gradient-purple { background: linear-gradient(135deg, #667eea, #764ba2, #f093fb); }
.color-swatch.gradient-ocean { background: linear-gradient(135deg, #0ea5e9, #06b6d4, #14b8a6); }
.color-swatch.gradient-sunset { background: linear-gradient(135deg, #f97316, #ef4444, #ec4899); }
.color-swatch.gradient-forest { background: linear-gradient(135deg, #166534, #15803d, #22c55e); }
.color-swatch.gradient-midnight { background: linear-gradient(135deg, #0f172a, #1e293b, #334155); }
.color-swatch.gradient-sakura { background: linear-gradient(135deg, #fdf2f8, #fbcfe8, #f9a8d4); }
.color-swatch.gradient-neon { background: linear-gradient(135deg, #0a0e17, #00e5ff, #0a0e17); }
.color-swatch.solid-black { background: #0a0a0a; }
.color-swatch.solid-white { background: #f5f5f5; border: 1px solid #ddd; }
.color-swatch.solid-navy { background: #1a1a2e; }
.color-swatch.solid-warm { background: #fdf6e8; border: 1px solid #e0d5c1; }
.color-swatch.solid-gray { background: #f0ede6; border: 1px solid #d4d0c4; }

.custom-color-row {
  display: flex; align-items: center; gap: 10px; margin-top: 6px;
}
.custom-color-row span { font-size: 11px; color: var(--text-dim); }
.custom-color-row input[type="color"] {
  width: 32px; height: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 2px;
}
.custom-color-row input[type="text"] {
  flex: 1;
  background: var(--input-bg);
  border: 0.5px solid var(--input-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
}

.reset-color-btn {
  display: inline-block; margin-top: 10px;
  padding: 5px 12px; border-radius: 6px;
  border: 1.5px solid #818cf8;
  background: rgba(129,140,248,0.15);
  font-size: 11px; color: #c7d2fe; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
  text-align: center;
}
.reset-color-btn:hover { background: rgba(129,140,248,0.3); color: #e0e7ff; border-color: #a5b4fc; transform: translateY(-1px); }

/* Highlighted context menu items (恢复/恢复默认/恢复默认设置) */
.context-menu-item.highlight-reset {
  color: #c7d2fe !important;
  border: 1px solid rgba(129,140,248,0.3);
  background: rgba(129,140,248,0.1);
  border-radius: 8px;
  margin: 2px 0;
}
.context-menu-item.highlight-reset:hover {
  background: rgba(129,140,248,0.25) !important;
  border-color: #818cf8;
}

/* Background active indicator — shows ✅ 当前 badge before reset button */
.opacity-group.bg-active > div:first-child::after {
  content: "✅ 当前";
  font-size: 9px;
  color: #4ade80;
  background: rgba(74,222,128,0.12);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 4px;
  order: 1;
}

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
/* Fade in after content is populated (50ms delay avoids white flash) */
.modal-dialog { animation: modalFadeIn 0.05s ease-in; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-dialog {
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 16px;
  padding: 24px;
  min-width: 400px;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-dialog h3 {
  font-size: 15px; font-weight: 600;
  color: var(--text-main); margin-bottom: 20px;
}

.modal-dialog label {
  display: block;
  font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}

.modal-dialog input[type="text"],
.modal-dialog input[type="url"],
.modal-dialog select {
  width: 100%;
  background: var(--input-bg);
  border: 0.5px solid var(--input-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px; color: var(--text-main);
  font-family: inherit; outline: none;
  margin-bottom: 16px;
}
.modal-dialog input:focus,
.modal-dialog select:focus {
  border-color: var(--text-mid);
}

.modal-dialog .form-row {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.modal-dialog .form-row > * { flex: 1; margin-bottom: 0; }

.modal-dialog .favicon-preview {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--favicon-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-dialog .favicon-preview img {
  width: 32px; height: 32px; border-radius: 6px;
}

.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
}

.modal-btn {
  padding: 8px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
  border: 0.5px solid var(--btn-border);
  background: var(--btn-bg); color: var(--text-main);
}
.modal-btn:hover { background: var(--btn-hover-bg); }
.modal-btn.primary {
  background: rgba(99,102,241,0.3);
  border-color: rgba(99,102,241,0.4);
}

.section-label {
  display: block; font-size: 13px; font-weight: 700;
  color: #818cf8; margin: 12px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(129,140,248,0.2);
  letter-spacing: 0.3px;
}

.modal-btn.danger { color: #f87171; border-color: rgba(248,113,113,0.3); }
.modal-btn.danger:hover { background: rgba(248,113,113,0.1); }

/* Category list in modal */
.cat-list { margin-bottom: 16px; }
.cat-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--favicon-bg);
  margin-bottom: 6px;
}
.cat-list-item .cat-drag { cursor: grab; color: var(--text-dim); font-size: 14px; }
.cat-list-item .cat-name { flex: 1; font-size: 13px; color: var(--text-main); }
.cat-list-item .cat-actions { display: flex; gap: 6px; }
.cat-list-item .cat-act-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 0.5px solid var(--btn-border);
  background: transparent; color: var(--text-dim);
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.cat-list-item .cat-act-btn:hover { background: var(--btn-hover-bg); }
.cat-list-item .cat-check { width: 16px; height: 16px; accent-color: #6366f1; cursor: pointer; flex-shrink: 0; }
.cat-list-item.dragging { opacity: 0.4; transform: scale(0.96); }
.cat-list-item.drag-over { border: 1px dashed var(--text-mid); background: var(--card-hover-bg); }

/* Category section drag (dragging entire category block) */
.category-section.cat-section-dragging { opacity: 0.4; transform: scale(0.97); }
.category-title[draggable="true"]:hover { opacity: 0.7; }
.cat-list-item .cat-add-btn { width: 26px; height: 26px; border-radius: 6px; border: 0.5px dashed var(--btn-border); background: transparent; color: var(--text-dim); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.cat-list-item .cat-add-btn:hover { background: var(--btn-hover-bg); color: var(--text-main); }

/* Background presets in modal */
.bg-presets {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.bg-preset {
  width: 60px; height: 40px; border-radius: 8px;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s;
  background-size: cover;
  background-position: center;
}
.bg-preset:hover { transform: scale(1.08); }
.bg-preset.active { border-color: var(--text-main); }

/* Engine edit hint on context menu for engines */
.engine-btns .engine-btn { position: relative; }

/* Favicon error fallback */
.favicon-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-weight: 700; color: var(--text-mid);
}

/* ========== FONT COLOR PALETTE ========== */
.font-color-palette {
  position: fixed;
  bottom: 90px;
  right: 80px;
  background: var(--context-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--context-border);
  border-radius: 16px;
  padding: 16px 20px;
  min-width: 260px;
  z-index: 200;
  display: none;
}
.font-color-palette.show { display: block; }

.font-color-palette h3 {
  font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 4px;
}
.font-color-palette .subtitle { font-size: 10px; color: var(--text-dim); margin-bottom: 12px; }

/* ========== FAVICON COLORS PER THEME ========== */

/* Element opacity from appearance panel — multiplied by global block opacity */
.link-card .link-label { opacity: calc(var(--op-link-label, 1) * var(--global-block-opacity, 1)); }
.category-section { opacity: calc(var(--op-category-section, 1) * var(--global-block-opacity, 1)); }
.category-title { opacity: calc(var(--op-category-title, 1) * var(--global-block-opacity, 1)); }
.category-section .link-cards { opacity: calc(var(--op-link-cards-area, 1) * var(--global-block-opacity, 1)); }
.quick-link-item { opacity: calc(var(--op-quick-link-item, 1) * var(--global-block-opacity, 1)); }
.recent-item { opacity: calc(var(--op-recent-item, 1) * var(--global-block-opacity, 1)); }
/* Block-level panel opacity */
.left-panel { opacity: calc(var(--op-qa-panel-bg, 1) * var(--global-block-opacity, 1)); }
#recentVisitsPanel { opacity: calc(var(--op-recent-panel-bg, 1) * var(--global-block-opacity, 1)); }
/* Main area opacity */
.main-area { opacity: calc(var(--op-main-area, 1) * var(--global-block-opacity, 1)); }
/* Settings panel opacity */
.settings-panel { opacity: calc(var(--op-settings-panel, 1) * var(--global-block-opacity, 1)); }
.setting-btn { opacity: calc(var(--op-setting-btn, 1) * var(--global-block-opacity, 1)); }
/* Top bar opacity — all top bar elements multiplied by global */
.top-info-bar { opacity: calc(var(--op-top-info-bar, 1) * var(--global-block-opacity, 1)); }
.top-info-bar-inner { opacity: var(--global-block-opacity, 1); }
#siteTitle { opacity: calc(var(--op-top-title, 1) * var(--global-block-opacity, 1)); }
.top-info-bar .weather-group { opacity: calc(var(--op-top-weather, 1) * var(--global-block-opacity, 1)); }
.top-info-bar .time-display,
.top-info-bar .date-display,
.top-info-bar .sep { opacity: calc(var(--op-top-time, 1) * var(--global-block-opacity, 1)); }
span[id^="siteLink"] { opacity: calc(var(--op-top-nav-links, 1) * var(--global-block-opacity, 1)) !important; }
#dailyQuote { opacity: calc(var(--op-top-quote, 1) * var(--global-block-opacity, 1)); }
/* Theme switcher */

/* Search area */
.search-box { opacity: var(--global-block-opacity, 1); }
.search-module { opacity: calc(var(--op-search-box, 1) * var(--global-block-opacity, 1)); }
.engine-btns { opacity: var(--global-block-opacity, 1); }
/* Search area text opacity */
.search-input-placeholder, .engine-btn { opacity: calc(var(--op-search-placeholder, 1) * var(--global-block-opacity, 1)); }
/* Weather/time/date with individual opacity sliders */
.weather-group { opacity: calc(var(--op-top-weather, 1) * var(--global-block-opacity, 1)); }
.time-display { opacity: calc(var(--op-top-time, 1) * var(--global-block-opacity, 1)); }
.date-display { opacity: calc(var(--op-top-time, 1) * var(--global-block-opacity, 1)); }


.back-to-top { position: fixed; bottom: 60px; right: 20px; width: 36px; height: 36px; border-radius: 50%; border: 0.5px solid var(--panel-border); background: var(--panel-bg); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur); color: var(--text-dim); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 90; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.back-to-top.show { opacity: 0.7; pointer-events: auto; }
.back-to-top:hover { opacity: 1; color: var(--text-main); }

/* Toast notifications */
.toast-container { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; align-items: center; }
.toast { background: var(--panel-bg); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur); border: 0.5px solid var(--panel-border); border-radius: 10px; padding: 8px 16px; font-size: 12px; color: var(--text-main); opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }
.drag-indicator { height:28px; margin:2px 0; border-radius:6px; background:rgba(129,140,248,0.15); border:1px dashed #818cf8; transition:all 0.15s; pointer-events:none; display:none; }

/* ===== Language popover ===== */
.lang-popover {
  position: fixed; z-index: 9999; min-width: 120px;
  background: var(--panel-bg); backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  border: 0.5px solid var(--panel-border); border-radius: 10px;
  padding: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.lang-popover-grid { display: flex; flex-direction: column; gap: 2px; }
.lang-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 8px; cursor: pointer; transition: background 0.1s;
  font-size: 12px; color: var(--text-main); white-space: nowrap;
}
.lang-item:hover { background: var(--card-hover-bg); }
.lang-item.lang-active { background: rgba(129,140,248,0.15); color: #818cf8; }
.lang-flag { font-size: 14px; line-height: 1; }
.lang-name { font-size: 12px; }

/* Custom dialog */
.custom-dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: none; align-items: center; justify-content: center; }
.custom-dialog-overlay.show { display: flex !important; }
.custom-dialog { background: var(--panel-bg); backdrop-filter: var(--panel-blur); -webkit-backdrop-filter: var(--panel-blur); border: 0.5px solid var(--panel-border); border-radius: 14px; padding: 20px; min-width: 320px; max-width: 420px; box-shadow: 0 16px 48px rgba(0,0,0,0.4); }
.custom-dialog-title { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 14px; }
.custom-dialog-body { display: flex; flex-direction: column; gap: 10px; }
.custom-dialog-body label { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.custom-dialog-body input { background: var(--input-bg); border: 0.5px solid var(--input-border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text-main); font-family: inherit; outline: none; }
.custom-dialog-body input:focus { border-color: #818cf8; }
/* Select dropdown styling - prevent white flash */
select {
  color: var(--text-main) !important;
  background: var(--input-bg) !important;
  border-color: var(--panel-border) !important;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px !important;
  transition: none !important;
}
select option {
  color: #e0e0e0;
  background: #1e1e30 !important;
}
select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 var(--text-main);
}
select:focus { border-color: #818cf8 !important; outline: none; }
select option:hover,
select option:checked {
  background: #818cf8 !important;
  color: #fff !important;
}
select:active, select:focus-within {
  background: var(--input-bg) !important;
  color: var(--text-main) !important;
}
.custom-dialog-body select {
  color: var(--text-main) !important;
  background: var(--input-bg) !important;
  border-color: var(--panel-border) !important;
}
/* Custom div-based select dropdown (replaces native <select>) */
.custom-select { user-select: none; }
.custom-select:focus { border-color: #818cf8 !important; }
.custom-select-option { padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text-main, #e0e0e0); }
.custom-select-option:hover { background: rgba(129,140,248,0.2); }
.custom-select-option[data-selected] { color: #818cf8; font-weight: 600; }
select:-internal-list-box {
  background-color: #1e1e30 !important;
  color: #e0e0e0 !important;
}


/* addCategory dialog theme matching */
#addCategoryDialog input,
#addCategoryDialog select,
#addCategoryDialog textarea {
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Glass panel effect via ::before — opacity controllable via --panel-alpha */
:root {
  --panel-alpha: 1;
  --cat-title-width: 80px;
  --fav-def-opacity: 0.9;
  --fav-hov-opacity: 1;
  /* Individual element opacity CSS variables (default 1 = fully visible) */
  --global-block-opacity: 1;
  --op-search-box: 1;
  --op-search-placeholder: 1;
  --op-qa-panel-bg: 1;
  --op-quick-link-item: 1;
  --op-main-area: 1;
  --op-category-section: 1;
  --op-category-title: 1;
  --op-link-label: 1;
  --op-link-cards-area: 1;
  --op-recent-panel-bg: 1;
  --op-recent-item: 1;
  --op-top-info-bar: 1;
  --op-top-title: 1;
  --op-top-nav-links: 1;
  --op-top-weather: 1;
  --op-top-time: 1;
  --op-top-quote: 1;
  --op-settings-panel: 1;
  --op-setting-btn: 1;
}
/* When glass is off, remove panel backgrounds so ::before handles everything */
body.glass-off .left-panel, body.glass-off .right-panel, body.glass-off .search-box, body.glass-off .top-info-bar,
body.glass-off .category-section, body.glass-off .search-module, body.glass-off .engine-btns,
body.glass-off .category-title { background: transparent !important; }
/* Ensure panels can contain ::before */
.category-section, .search-module, .engine-btns { position: relative; }
/* Ensure panel content stays above glass ::before layer */
.left-panel > *, .right-panel > *, .search-box > *, .top-info-bar > *,
.category-section > *, .search-module > *, .engine-btns > * {
  position: relative; z-index: 1;
}
/* Prevent overflow clipping on glass panels: the ::before extends 1px outward to hide backdrop-filter edge glow */
.left-panel, .right-panel, .search-box, .top-info-bar,
.category-section, .search-module, .engine-btns,
.category-title { overflow: visible !important; }

.left-panel::before, .right-panel::before, .search-box::before, .top-info-bar::before,
.category-section::before, .search-module::before, .engine-btns::before,
.category-title::before {
  content: '';
  position: absolute; top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: inherit;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: var(--panel-blur);
  opacity: var(--panel-alpha);
  z-index: -1; pointer-events: none;
}
.custom-dialog-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* ===== Daily quote marquee ===== */
@keyframes quote-scroll {
  0% { transform: translateX(100%); opacity: 0; }
  5% { opacity: 1; }
  15% { transform: translateX(0); }
  80% { transform: translateX(0); }
  95% { transform: translateX(-100%); opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}
#dailyQuote.marquee-active {
  text-overflow: clip !important;
  overflow: hidden;
  white-space: nowrap;
}
#dailyQuote .mq-inner {
  display: inline-block;
  white-space: nowrap;
  padding-right: 40px;
  animation: quote-scroll 15s ease-in-out infinite;
}

/* ========== Apple Theme — clean, light, premium ========== */
body.theme-a {
  --body-bg: #f5f5f7;
  --body-bg-attachment: scroll;
  --body-overlay: none;
  --text-main: #1d1d1f;
  --text-dim: #86868b;
  --text-mid: #6e6e73;
  --panel-bg: rgba(255,255,255,0.80);
  --panel-blur: blur(20px);
  --panel-border: rgba(0,0,0,0.06);
  --card-bg: rgba(255,255,255,0.95);
  --card-hover-bg: rgba(255,255,255,1);
  --favicon-bg: rgba(255,255,255,0.80);
  --input-bg: rgba(255,255,255,0.95);
  --input-border: rgba(0,0,0,0.08);
  --btn-bg: rgba(255,255,255,0.90);
  --btn-hover-bg: rgba(255,255,255,1);
  --btn-border: rgba(0,0,0,0.06);
  --context-bg: rgba(255,255,255,0.97);
  --context-border: rgba(0,0,0,0.08);
  --sep-color: rgba(0,0,0,0.06);
  --scrollbar-color: rgba(0,0,0,0.10);
  --scrollbar-hover: rgba(0,0,0,0.20);
  --scrollbar-bg: transparent;
  --badge-color: rgba(0,0,0,0.03);
  --banner-bg: rgba(255,255,255,0.90);
  --banner-text: #1d1d1f;
  --engine-baidu: rgba(59,130,246,0.08);
  --engine-google: rgba(16,185,129,0.08);
  --engine-bing: rgba(99,102,241,0.08);
  --engine-github: rgba(0,0,0,0.04);
  --context-item-hover: rgba(0,0,0,0.04);
}
/* Apple: pill search box — signature rounded pill shape */
body.theme-a .search-box {
  border-radius: 9999px;
  border: 0.5px solid rgba(0,0,0,0.08);
  padding: 10px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
body.theme-a .search-box:focus-within {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}
body.theme-a .search-box .search-icon { opacity: 0.35; }
body.theme-a .search-input-placeholder { color: #86868b; font-size: 16px; }
body.theme-a .search-clear { color: #86868b; }
/* Apple: engine buttons — pill or rounded rect, no shadow */
body.theme-a .engine-btn {
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  border: 0.5px solid rgba(0,0,0,0.06);
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
}
body.theme-a .engine-btn:hover {
  transform: none;
  background: rgba(255,255,255,1);
  border-color: rgba(0,0,0,0.12);
}
body.theme-a .engine-btn:active {
  transform: scale(0.96);
}
body.theme-a .engine-add {
  border-radius: 9999px;
  border: 1px dashed rgba(0,0,0,0.10);
}
/* Apple: panels — clean frosted glass, 16px radius */
body.theme-a .left-panel,
body.theme-a .right-panel,
body.theme-a .main-area {
  border-radius: 16px;
}
body.theme-a .main-area {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,0.06);
  padding: 20px 18px;
}
body.theme-a .left-panel,
body.theme-a .right-panel {
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,0.06);
}
/* Apple: link cards — clean, larger radius, no 3D */
body.theme-a .link-card {
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 0.5px solid rgba(0,0,0,0.04);
  transition: background 0.2s, transform 0.2s;
}
body.theme-a .link-card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,1);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
body.theme-a .link-card:active {
  transform: scale(0.95);
}
body.theme-a .favicon-box {
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  width: 48px; height: 48px;
  transition: transform 0.15s;
}
body.theme-a .link-card:hover .favicon-box {
  transform: scale(1.02);
}
body.theme-a .link-card .link-label {
  color: #6e6e73;
  font-size: 11px;
  letter-spacing: -0.01em;
}
/* Apple: category titles — clean left border in Apple blue */
body.theme-a .category-title {
  border-left: 3px solid #0071e3;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0 10px;
}
body.theme-a .category-title:hover {
  background: rgba(255,255,255,0.95);
}
/* Apple: quick links — clean, softer interaction */
body.theme-a .quick-link-item {
  border-radius: 10px;
}
body.theme-a .quick-link-item:hover {
  background: rgba(255,255,255,0.85);
  transform: none;
}
body.theme-a .quick-link-item .favicon-circle {
  border-radius: 8px;
}
/* Apple: recent visits panel */
body.theme-a .right-panel .recent-item {
  border-radius: 8px;
  font-size: 12px;
  color: #6e6e73;
  padding: 5px 8px;
}
body.theme-a .right-panel .recent-item:hover {
  background: rgba(255,255,255,0.85);
  color: #1d1d1f;
}
/* Apple: top bar — clean frosted glass */
body.theme-a .top-info-bar {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}
body.theme-a .top-info-bar-inner {
  font-weight: 400;
}
/* Apple: setting buttons — clean, no shadow, Apple blue accent */
body.theme-a .setting-btn {
  border-radius: 9999px;
  border: 0.5px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 400;
}
body.theme-a .setting-btn:hover {
  transform: none;
  background: rgba(255,255,255,1);
  border-color: rgba(0,0,0,0.12);
}
body.theme-a .setting-btn:active {
  transform: scale(0.95);
}
body.theme-a .setting-btn .btn-icon { font-size: 14px; }
body.theme-a .setting-btn .btn-label { font-size: 11px; }
/* Apple: modals */
body.theme-a .modal-dialog {
  border-radius: 18px;
  background: rgba(255,255,255,0.97);
}
body.theme-a .modal-btn.primary {
  background: #0071e3;
  border-color: #0071e3;
  color: #fff;
  border-radius: 9999px;
}
body.theme-a .modal-btn.primary:hover {
  background: #0066cc;
}
body.theme-a .modal-btn {
  border-radius: 9999px;
}
/* Apple: context menu */
body.theme-a .context-menu {
  border-radius: 14px;
  background: rgba(255,255,255,0.97);
  border: 0.5px solid rgba(0,0,0,0.06);
}
body.theme-a .context-menu-item {
  border-radius: 8px;
}
/* Apple: opacity/layout panels */
body.theme-a .opacity-panel {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,0.06);
  border-radius: 16px;
}
/* Apple: category section in modal */
body.theme-a .cat-list-item {
  background: rgba(255,255,255,0.80);
  border-radius: 10px;
  border: 0.5px solid rgba(0,0,0,0.04);
}
/* Apple: theme dots — silver accent */
body.theme-a .tb-theme-dot.active {
  border-color: #0071e3;
}
/* Apple: toast */
body.theme-a .toast {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,0.06);
}

/* ========== RTL (Arabic) minimal support ========== */
body.rtl .content-area { direction: rtl; }
body.rtl .left-panel { margin-right: 0; margin-left: 12px; }
body.rtl .right-panel { margin-left: 0; margin-right: 12px; }
body.rtl .category-title { border-left: none; border-right: 3px solid #0071e3; text-align: right; }
body.rtl .main-area .category-section { flex-direction: row-reverse; }
body.rtl .top-info-bar-inner { direction: rtl; }
body.rtl .search-box { direction: rtl; }
body.rtl .settings-panel { right: auto; left: 20px; flex-direction: row-reverse; }
body.rtl .opacity-panel { right: auto; left: 20px; }