@tailwind base;
@tailwind components;
@tailwind utilities;

/* 在文件顶部添加 */
:root {
  --primary-color: #4A9FE8;
  --primary-color-rgb: 74, 159, 232;
  --primary-color-light: #7BB8F0;
  /* Global glass panel opacity (overridden by Appearance slider) */
  --glass-rgb: 255, 255, 255;
  --glass-rgb-dark: 22, 22, 24;
  --glass-rgb-dark-card: 48, 48, 52;
  --glass-opacity: 0.48;
  --glass-opacity-soft: 0.35;
  --glass-opacity-card: 0.42;
  --glass-opacity-elevated: 0.94;
}

html.loading-wallpaper {
  background: none !important;
}

html.loading-wallpaper body,
html.loading-wallpaper main {
  opacity: 0;
  z-index: 2;
}

body,
main {
  opacity: 1;
  transition: opacity 0.3s ease-out;
  will-change: background-image;
  background-color: transparent !important;
}

/* 修改现有的背景渐变类，增加特异性 */
html:not(.loading-wallpaper)[class*="gradient-background"] {
  transition: background 0.3s ease-out;
  z-index: 1;
}

/* 确保主容器的背景样式优先级 */
main.flex-1 {
  background-color: transparent !important;
  z-index: 1;
}

/* 侧边栏 logo 和标题样式 */
#sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto 1rem 0.5rem;
    gap: 0.5rem; /* 调整 logo 和文字之间的间距 */
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

#sidebar-logo:hover {
    opacity: 0.88;
}

#sidebar-logo:focus-visible {
    outline: 2px solid rgba(var(--primary-color-rgb, 74, 159, 232), 0.45);
    outline-offset: 2px;
}

#logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
#logo-title {
    font-size: 26px;
    /* 调整字体大小 */
    font-weight: bold;
    color: #333;
    /* 调整文字颜色 */
}

/* 侧边栏：顶部根目录切换按钮 + 下方文件夹树 */
.custom-width {
  width: 16rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#sidebar-logo {
  flex-shrink: 0;
  padding: 0 1rem;
  box-sizing: border-box;
  width: 100%;
}

/* 侧边栏开关：仅 aside 做滑动动画，主内容/按钮等立刻到位 */
:root {
  --side-panel-margin: 8px;
  --side-panel-radius: 20px;
  --sidebar-panel-width: 16rem;
}

#sidebar-container {
  position: relative;
  margin-left: 0 !important;
  transition: none !important;
}

#sidebar-container > aside.custom-width {
  position: fixed;
  left: var(--side-panel-margin);
  top: var(--side-panel-margin);
  bottom: var(--side-panel-margin);
  height: calc(100vh - (var(--side-panel-margin) * 2));
  width: var(--sidebar-panel-width);
  z-index: 40;
  transform: translate3d(0, 0, 0);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  backface-visibility: hidden;
  /* Apple-like liquid glass */
  background: rgba(var(--glass-rgb), var(--glass-opacity));
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--side-panel-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 1px 0 0 rgba(255, 255, 255, 0.35),
    0 12px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

#sidebar-container.collapsed > aside.custom-width {
  transform: translate3d(calc(-100% - var(--side-panel-margin) * 2), 0, 0);
  pointer-events: none;
}

#sidebar-container > main.flex-1 {
  margin-left: calc(var(--sidebar-panel-width) + var(--side-panel-margin) * 2);
  transition: none !important;
}

#sidebar-container.collapsed > main.flex-1 {
  margin-left: 0;
}

#toggle-sidebar {
  left: calc(var(--side-panel-margin) + var(--sidebar-panel-width) - 1.25rem);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s !important;
}

html.no-sidebar-open-animation #sidebar-container > aside.custom-width {
  transition: none !important;
}

.bookmark-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.sidebar-bookmark-search {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.5rem;
  margin: 0.15rem 1rem 0.75rem;
  min-height: 0;
}

.bookmark-sidebar-nav.is-sidebar-searching .sidebar-bookmark-search {
  flex: 1;
  min-height: 0;
  margin-top: 0;
}

.bookmark-sidebar-nav.is-sidebar-searching .sidebar-bookmark-search-input-wrap {
  flex-shrink: 0;
}

.bookmark-sidebar-nav.is-sidebar-searching .sidebar-bookmark-search-results {
  flex: 1;
  min-height: 0;
}

.sidebar-bookmark-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  background: rgba(var(--glass-rgb), var(--glass-opacity-soft));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0.65rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  box-sizing: border-box;
}

.sidebar-bookmark-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #9ca3af;
}

.sidebar-bookmark-search-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.sidebar-bookmark-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #111827;
  font-size: 12px;
  line-height: 1.3;
  padding: 0.2rem 0;
}

.sidebar-bookmark-search-input::placeholder {
  color: #9ca3af;
}

.sidebar-bookmark-search-input::-webkit-search-cancel-button {
  display: none;
}

.sidebar-bookmark-search-clear {
  appearance: none;
  border: none;
  background: transparent;
  color: #9ca3af;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-bookmark-search-clear[hidden] {
  display: none !important;
}

.sidebar-bookmark-search-clear:hover {
  color: #4b5563;
  background: rgba(0, 0, 0, 0.06);
}

.sidebar-bookmark-search-results {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.15rem 0;
  margin: 0 -0.15rem;
  scrollbar-width: thin;
}

.sidebar-bookmark-search-empty {
  padding: 1rem 0.5rem;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

.sidebar-bookmark-search-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}

.sidebar-bookmark-search-item:hover,
.sidebar-bookmark-search-item:focus-visible {
  background: rgba(var(--primary-color-rgb), 0.12);
  outline: none;
}

.sidebar-bookmark-search-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.sidebar-bookmark-search-item-icon img,
.sidebar-bookmark-search-item-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}

.sidebar-bookmark-search-item-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-bookmark-search-item-title {
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-bookmark-search-item-meta {
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-sidebar-nav.is-sidebar-searching .bookmark-root-toggles,
.bookmark-sidebar-nav.is-sidebar-searching .bookmark-tree-column {
  display: none;
}

.bookmark-root-toggles {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  flex-shrink: 0;
  margin: 0 1rem;
  padding: 0.2rem;
  background: rgba(var(--glass-rgb), var(--glass-opacity-soft));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0.65rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
  box-sizing: border-box;
}

.bookmark-root-toggle {
  appearance: none;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.45rem 0.4rem;
  border-radius: 0.5rem;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bookmark-root-toggle:hover {
  color: #111827;
}

.bookmark-root-toggle.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

body.is-dragging-sidebar-folder .bookmark-root-toggle {
  outline: 1px dashed transparent;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
}

body.is-dragging-sidebar-folder .bookmark-root-toggle:not(.active) {
  outline-color: #d1d5db;
}

.bookmark-root-toggle.drop-target {
  background: rgba(var(--primary-color-rgb), 0.18) !important;
  color: #3A8FD4 !important;
  outline: 1px solid var(--primary-color, #4A9FE8) !important;
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.sidebar-folder-placement-ghost {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  display: none;
  max-width: 200px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  opacity: 0.92;
}

.sidebar-folder-drop-indicator {
  position: fixed;
  z-index: 9999;
  display: none;
  height: 2px;
  pointer-events: none;
  background: var(--primary-color, #4A9FE8);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(var(--primary-color-rgb), 0.25);
}

#categories-list li.folder-item.drop-into-target {
  background-color: rgba(var(--primary-color-rgb), 0.18) !important;
  outline: 1px dashed var(--primary-color, #4A9FE8);
  border-radius: 8px;
}

body.is-dragging-sidebar-folder .sidebar-folder-drag-fallback,
body.is-dragging-sidebar-folder .sidebar-folder-drag-active,
body.is-dragging-sidebar-folder .sortable-drag,
body.is-dragging-sidebar-folder .sortable-fallback {
  pointer-events: none !important;
  opacity: 0.85;
  z-index: 10001 !important;
}

body.is-dragging-sidebar-folder .sidebar-folder-drag-ghost,
body.is-dragging-sidebar-folder .sortable-ghost {
  opacity: 0.35;
}

body.is-sidebar-folder-placing #categories-list {
  outline: 1px dashed rgba(var(--primary-color-rgb), 0.45);
  border-radius: 8px;
}

.bookmark-tree-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.bookmark-tree-toolbar {
  display: none;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0 1rem;
  box-sizing: border-box;
  width: 100%;
}

body.bookmarks-edit-mode .bookmark-tree-toolbar {
  display: flex;
}

#categories-list {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  box-sizing: border-box;
}

#categories-list > li.folder-item {
  width: 100%;
  box-sizing: border-box;
}

.bookmark-tree-action-icon,
.bookmark-tree-action-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bookmark-tree-action-icon {
  font-size: 15px;
  font-weight: 600;
  transform: translateY(-0.5px);
}

.bookmark-tree-action-label {
  font-size: 13px;
  font-weight: 500;
}

[data-theme="dark"] .bookmark-root-toggles {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-bookmark-search-input-wrap {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-bookmark-search-input {
  color: #f3f4f6;
}

[data-theme="dark"] .sidebar-bookmark-search-input::placeholder,
[data-theme="dark"] .sidebar-bookmark-search-icon,
[data-theme="dark"] .sidebar-bookmark-search-clear,
[data-theme="dark"] .sidebar-bookmark-search-empty,
[data-theme="dark"] .sidebar-bookmark-search-item-meta {
  color: #9ca3af;
}

[data-theme="dark"] .sidebar-bookmark-search-clear:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-bookmark-search-item:hover,
[data-theme="dark"] .sidebar-bookmark-search-item:focus-visible {
  background: rgba(var(--primary-color-rgb), 0.18);
}

[data-theme="dark"] .sidebar-bookmark-search-item-title {
  color: #f3f4f6;
}

[data-theme="dark"] .sidebar-bookmark-search-item-icon {
  color: #9ca3af;
}

[data-theme="dark"] .bookmark-root-toggle {
  color: #9ca3af;
}

[data-theme="dark"] .bookmark-root-toggle:hover {
  color: #f3f4f6;
}

[data-theme="dark"] .bookmark-root-toggle.active {
  background: #1f2937;
  color: #f9fafb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] body.is-dragging-sidebar-folder .bookmark-root-toggle:not(.active) {
  outline-color: #4b5563;
}

[data-theme="dark"] .bookmark-root-toggle.drop-target {
  background: rgba(var(--primary-color-rgb), 0.22) !important;
  color: var(--primary-color-light, #7BB8F0) !important;
  outline-color: var(--primary-color-light, #7BB8F0) !important;
}

[data-theme="dark"] .sidebar-folder-placement-ghost {
  background: #f3f4f6;
  color: #111827;
}

[data-theme="dark"] #categories-list li.folder-item.drop-into-target {
  background-color: rgba(var(--primary-color-rgb), 0.22) !important;
}

/* 其他原有的样式 */
/* ... */

.folder-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 2px 0;
}

.breadcrumb-item {
  cursor: pointer;
  color: #717882;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background-color: transparent;
  box-shadow: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.breadcrumb-item:not(:last-child):hover {
  background-color: rgba(15, 23, 42, 0.06);
  color: var(--primary-color, #4A9FE8);
  border-color: rgba(15, 23, 42, 0.04);
}

.breadcrumb-separator {
  margin: 0 2px;
  color: #999;
  user-select: none;
}

.breadcrumb-item:last-child {
  color: #374151;
  font-weight: 600;
  cursor: default;
  background-color: transparent;
}

.breadcrumb-item:last-child:hover {
  background-color: transparent;
  color: #374151;
  border-color: transparent;
}

#categories-list li {
  user-select: none;
}

#categories-list li.sortable-ghost {
  opacity: 0.5;
  background-color: #f0f0f0;
}

#categories-list li.sortable-chosen {
  background-color: #e0e0e0;
}



/* 暗色模式样式 */
[data-theme="dark"] {
  color-scheme: dark;
}

/* 暗黑模式下的背景渐变类 */
[data-theme="dark"] html[class*="gradient-background"],
[data-theme="dark"] html.custom-theme-background {
  background: transparent !important;
}

/* 暗黑模式下的背景样式优先级顺序 */
[data-theme="dark"] body:not(.has-wallpaper) {
  background-color: #1c1c1c;
}

[data-theme="dark"] body:not(.has-wallpaper)[class*="gradient-background"] {
  background-color: #1c1c1c !important;
}

[data-theme="dark"] body.has-wallpaper {
  background-color: transparent !important;
  background-image: var(--wallpaper-image) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

/* 暗黑模式下的壁纸容器样式 */
[data-theme="dark"] .wallpaper-option {
  border: 2px solid #404040;
  background-color: #242424;
}

[data-theme="dark"] body {
  background-color: #1c1c1c;
}
[data-theme="dark"] .bg-gray-50 text-center p-4 border-t border-gray-200 mt-4 {
  background-color: transparent;
}



[data-theme="dark"] .custom-width,
[data-theme="dark"] #sidebar-container > aside.custom-width,
[data-theme="dark"] aside {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] #sidebar-container > aside.custom-width {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] #logo-title {
  border-color: #ffffff;
  color: #ffffff;
}

[data-theme="dark"] aside ul li {
  color: #e5e7eb;
}

[data-theme="dark"] aside ul li:hover {
  background-color: rgba(var(--primary-color-rgb), 0.22);
  color: #f9fafb;
}

[data-theme="dark"] aside ul li.bg-gray-200 {
  background-color: #374151;
  color: #f9fafb;
}

[data-theme="dark"] aside ul li.bg-emerald-500 {
  background-color: rgb(74 159 232);
  color: #ffffff;
}

[data-theme="dark"] #categories-list li.sortable-ghost {
  background-color: #374151;
}

[data-theme="dark"] #categories-list li.sortable-chosen {
  background-color: #4b5563;
}

[data-theme="dark"] #categories-list::-webkit-scrollbar-track {
  background: #2d2d2d;
}

[data-theme="dark"] #categories-list::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 4px;
}

[data-theme="dark"] #categories-list::-webkit-scrollbar-thumb:hover {
  background: #888;
}

[data-theme="dark"] aside .icon-svg,
[data-theme="dark"] aside .material-icons {
  color: #d1d5db;
}

[data-theme="dark"] aside ul li:hover .icon-svg,
[data-theme="dark"] aside ul li:hover .material-icons,
[data-theme="dark"] aside ul li.bg-emerald-500 .icon-svg,
[data-theme="dark"] aside ul li.bg-emerald-500 .material-icons {
  color: #ffffff;
}

[data-theme="dark"] .bookmark-folder.card-title:hover {
  color: #ffffff;
}

[data-theme="dark"] .bookmark-card {
  background-color: transparent;
  border: none;
  color: #ffffff;
  box-shadow: 0 0 8px rgb(0 0 0 / 0.45), 0 0 2px rgb(0 0 0 / 0.35);
}

[data-theme="dark"] .bookmark-folder {
  background-color: #404040;
  border: 1px solid transparent;
  color: #ffffff;
}

[data-theme="dark"] .bookmark-card:hover {
  background-color: transparent;
  border: none;
  box-shadow: 0 0 12px rgb(0 0 0 / 0.55), 0 0 3px rgb(0 0 0 / 0.4);
  color: #ffffff;
}

[data-theme="dark"] .bookmark-folder:hover,
[data-theme="dark"] .bookmark-folder:hover .card-title,
[data-theme="dark"] .card-title:hover {
  background-color: #404040;
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* 书签区头部 — Apple Liquid Glass 背景 */
.bookmarks-header {
  --bh-radius: 20px;
  --bh-control-radius: 999px;
  --bh-control-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  min-height: 48px;
  padding: 0.4rem 0.45rem 0.4rem 0.55rem;
  box-sizing: border-box;
  border-radius: var(--bh-radius);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* 液态玻璃：高透明 + 强模糊 + 高饱和，让壁纸色彩透出 */
  background: rgba(var(--glass-rgb), calc(var(--glass-opacity) * 0.42));
  backdrop-filter: blur(56px) saturate(220%) brightness(1.06);
  -webkit-backdrop-filter: blur(56px) saturate(220%) brightness(1.06);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.28),
    inset -1px 0 0 rgba(255, 255, 255, 0.1),
    0 1px 1px rgba(15, 23, 42, 0.03),
    0 8px 28px rgba(15, 23, 42, 0.08);
}

/* 顶部镜面高光（liquid specular） */
.bookmarks-header::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0.12) 28%,
      rgba(255, 255, 255, 0) 55%
    ),
    radial-gradient(
      120% 80% at 12% -10%,
      rgba(255, 255, 255, 0.55) 0%,
      rgba(255, 255, 255, 0) 55%
    ),
    radial-gradient(
      90% 60% at 88% 110%,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0) 60%
    );
  opacity: 0.95;
}

/* 边缘折射 / 柔边光晕 */
.bookmarks-header::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0) 36%,
      rgba(255, 255, 255, 0.08) 68%,
      rgba(255, 255, 255, 0.2) 100%
    );
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.35),
    inset 0 12px 24px rgba(255, 255, 255, 0.08);
  mix-blend-mode: soft-light;
}

.bookmarks-header > * {
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .bookmarks-header {
  background: rgba(var(--glass-rgb-dark), calc(var(--glass-opacity) * 0.55));
  backdrop-filter: blur(56px) saturate(200%) brightness(1.08);
  -webkit-backdrop-filter: blur(56px) saturate(200%) brightness(1.08);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    inset 1px 0 0 rgba(255, 255, 255, 0.08),
    0 1px 1px rgba(0, 0, 0, 0.2),
    0 10px 32px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .bookmarks-header::before {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.04) 30%,
      rgba(255, 255, 255, 0) 58%
    ),
    radial-gradient(
      120% 80% at 12% -10%,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0) 55%
    ),
    radial-gradient(
      90% 60% at 88% 110%,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0) 60%
    );
  opacity: 1;
}

[data-theme="dark"] .bookmarks-header::after {
  background:
    linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.12) 0%,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.05) 70%,
      rgba(255, 255, 255, 0.1) 100%
    );
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.12),
    inset 0 12px 24px rgba(255, 255, 255, 0.03);
  mix-blend-mode: screen;
  opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .bookmarks-header {
    background: rgba(var(--glass-rgb-dark), calc(var(--glass-opacity) * 0.55));
    backdrop-filter: blur(56px) saturate(200%) brightness(1.08);
    -webkit-backdrop-filter: blur(56px) saturate(200%) brightness(1.08);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      inset 0 -1px 0 rgba(255, 255, 255, 0.04),
      inset 1px 0 0 rgba(255, 255, 255, 0.08),
      0 1px 1px rgba(0, 0, 0, 0.2),
      0 10px 32px rgba(0, 0, 0, 0.32);
  }

  html[data-theme="auto"] .bookmarks-header::before {
    background:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(255, 255, 255, 0.04) 30%,
        rgba(255, 255, 255, 0) 58%
      ),
      radial-gradient(
        120% 80% at 12% -10%,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0) 55%
      ),
      radial-gradient(
        90% 60% at 88% 110%,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0) 60%
      );
  }

  html[data-theme="auto"] .bookmarks-header::after {
    background:
      linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.05) 70%,
        rgba(255, 255, 255, 0.1) 100%
      );
    box-shadow:
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.12),
      inset 0 12px 24px rgba(255, 255, 255, 0.03);
    mix-blend-mode: screen;
    opacity: 0.85;
  }
}

/* 中间主内容区域：透明以透出壁纸/主题色 */
main.main-content-glass,
main.flex-1 {
  background: transparent !important;
}

[data-theme="dark"] .search-icon-container:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.bookmarks-header .folder-name {
  margin: 0;
  flex: 1;
  min-width: 0;
  padding-left: 0.15rem;
}

.bookmarks-header .breadcrumb-item {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.bookmarks-header .breadcrumb-item:not(:last-child):hover {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.35);
  color: #1d1d1f;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.bookmarks-header .breadcrumb-item:last-child {
  color: #1d1d1f;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.bookmarks-header .breadcrumb-separator {
  color: rgba(29, 29, 31, 0.28);
  margin: 0 0.1rem;
}

[data-theme="dark"] .bookmarks-header .breadcrumb-item:not(:last-child):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
}

[data-theme="dark"] .bookmarks-header .breadcrumb-item:last-child {
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .bookmarks-header .breadcrumb-separator {
  color: rgba(245, 245, 247, 0.28);
}

.bookmarks-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.bookmarks-ai-organize-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 240px;
  height: calc(var(--bh-control-height, 32px) - 6px);
  margin-block: 3px;
  padding: 0 0.85rem 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--bh-control-radius, 999px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.22) 100%),
    rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 2px rgba(15, 23, 42, 0.05);
  color: #3a3a3c;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.bookmarks-ai-organize-btn:hover:not(:disabled) {
  color: #1d1d1f;
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.36) 100%),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-0.5px);
}

.bookmarks-ai-organize-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.bookmarks-ai-organize-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.bookmarks-ai-organize-icon,
.bookmarks-ai-recommend-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.9;
}

.bookmarks-ai-organize-icon svg,
.bookmarks-ai-recommend-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.bookmarks-ai-organize-label,
.bookmarks-ai-recommend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmarks-clear-404-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 200px;
  height: calc(var(--bh-control-height, 32px) - 6px);
  margin-block: 3px;
  padding: 0 0.85rem 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--bh-control-radius, 999px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.22) 100%),
    rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 2px rgba(15, 23, 42, 0.05);
  color: #3a3a3c;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.bookmarks-clear-404-btn:hover:not(:disabled) {
  color: #1d1d1f;
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.36) 100%),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-0.5px);
}

.bookmarks-clear-404-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.bookmarks-clear-404-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.bookmarks-clear-404-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.9;
}

.bookmarks-clear-404-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.bookmarks-clear-404-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmarks-ai-restore-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 220px;
  height: calc(var(--bh-control-height, 32px) - 6px);
  margin-block: 3px;
  padding: 0 0.85rem 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--bh-control-radius, 999px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.22) 100%),
    rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 2px rgba(15, 23, 42, 0.05);
  color: #3a3a3c;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.bookmarks-ai-restore-btn[hidden] {
  display: none !important;
}

.bookmarks-ai-restore-btn:hover:not(:disabled) {
  color: #1d1d1f;
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.36) 100%),
    rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-0.5px);
}

.bookmarks-ai-restore-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(15, 23, 42, 0.06);
}

.bookmarks-ai-restore-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.bookmarks-ai-restore-icon {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.9;
}

.bookmarks-ai-restore-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.bookmarks-ai-restore-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="dark"] .bookmarks-ai-organize-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.18);
  color: #e8e8ed;
}

[data-theme="dark"] .bookmarks-ai-organize-btn:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.1) 100%),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 16px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .bookmarks-clear-404-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.18);
  color: #e8e8ed;
}

[data-theme="dark"] .bookmarks-clear-404-btn:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.1) 100%),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 16px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .bookmarks-ai-restore-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(0, 0, 0, 0.18);
  color: #e8e8ed;
}

[data-theme="dark"] .bookmarks-ai-restore-btn:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.1) 100%),
    rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 6px 16px rgba(0, 0, 0, 0.28);
}

.ai-organize-restore-modal-content {
  max-width: 440px;
}

.ai-organize-progress-modal {
  z-index: 1150;
}

.ai-organize-progress-content {
  max-width: 360px;
  width: min(92vw, 360px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1.6rem 1.35rem 1.45rem;
  text-align: center;
  animation: clear-404-progress-enter 0.28s ease-out;
}

.ai-organize-progress-orb {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: 0.15rem;
}

.ai-organize-progress-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--primary-color, #4A9FE8);
  border-right-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.35);
  animation: ai-introduce-spin 1.1s linear infinite;
}

.ai-organize-progress-orb-ring:nth-child(2) {
  inset: 8px;
  border-top-color: var(--primary-color-light, #7BB8F0);
  border-right-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.22);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.ai-organize-progress-orb-core {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff 0%,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.18) 48%,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.42) 100%
  );
  box-shadow: 0 0 14px rgba(var(--primary-color-rgb, 74, 159, 232), 0.35);
  animation: ai-introduce-pulse 1.4s ease-in-out infinite;
}

.ai-organize-progress-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ai-organize-progress-status {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: #52525b;
  min-height: 1.35em;
}

.ai-organize-progress-status::after {
  content: '';
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: ai-introduce-ellipsis 1.2s steps(4, end) infinite;
}

.ai-organize-progress-skeleton {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.ai-organize-progress-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.1) 45%,
    rgba(0, 0, 0, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: ai-introduce-shimmer 1.35s ease-in-out infinite;
}

.ai-organize-progress-skeleton-line:nth-child(2) {
  animation-delay: 0.12s;
}

.ai-organize-progress-skeleton-line.is-short {
  width: 62%;
  align-self: center;
  animation-delay: 0.22s;
}

.bookmarks-ai-organize-btn.is-busy {
  pointer-events: none;
  opacity: 0.72;
}

.bookmarks-ai-organize-btn.is-busy .bookmarks-ai-organize-icon {
  animation: ai-introduce-spin 1.1s linear infinite;
}

[data-theme="dark"] .ai-organize-progress-status {
  color: #a1a1aa;
}

[data-theme="dark"] .ai-organize-progress-skeleton-line {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.14) 45%,
    rgba(255, 255, 255, 0.06) 90%
  );
  background-size: 200% 100%;
}

.clear-404-modal-content {
  max-width: 580px;
}

#clear-404-dialog.modal {
  z-index: 1100;
}

#edit-dialog.clear-404-edit-elevated {
  z-index: 1300 !important;
}

#clear-404-dialog.clear-404-dialog-behind-edit {
  pointer-events: none;
}

.clear-404-preview-list {
  flex: 1;
  min-height: 0;
  max-height: 42vh;
  overflow: auto;
  margin: 0 0 1rem;
  padding: 0.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.clear-404-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.clear-404-item.is-removing {
  opacity: 0;
  transform: translateX(6px);
}

.clear-404-item-empty {
  justify-content: center;
  color: #6b7280;
  font-size: 13px;
}

.clear-404-item-body {
  min-width: 0;
  flex: 1;
}

.clear-404-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.35;
  word-break: break-word;
}

.clear-404-item-meta {
  margin-top: 0.2rem;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.35;
  word-break: break-all;
}

.clear-404-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding-top: 0.05rem;
}

.clear-404-item-btn {
  appearance: none;
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 7px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.clear-404-item-btn:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.2);
  color: #111827;
}

.clear-404-item-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.clear-404-item-btn-visit:hover:not(:disabled) {
  border-color: rgba(74, 159, 232, 0.45);
  color: #1d4ed8;
  background: rgba(74, 159, 232, 0.08);
}

.clear-404-item-btn-edit:hover:not(:disabled) {
  border-color: rgba(16, 185, 129, 0.45);
  color: #047857;
  background: rgba(16, 185, 129, 0.08);
}

.clear-404-item-btn-delete:hover:not(:disabled) {
  border-color: rgba(239, 68, 68, 0.4);
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .clear-404-item {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .clear-404-item-title {
  color: #f3f4f6;
}

[data-theme="dark"] .clear-404-item-meta,
[data-theme="dark"] .clear-404-item-empty {
  color: #9ca3af;
}

[data-theme="dark"] .clear-404-item-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

[data-theme="dark"] .clear-404-item-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

[data-theme="dark"] .clear-404-item-btn-visit:hover:not(:disabled) {
  border-color: rgba(96, 165, 250, 0.45);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .clear-404-item-btn-edit:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .clear-404-item-btn-delete:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.clear-404-progress-modal {
  z-index: 1100;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.28);
}

.clear-404-progress-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 2rem));
  margin: 0;
  padding: 1.6rem 1.5rem 1.35rem;
  border-radius: 18px;
  text-align: center;
  box-sizing: border-box;
  max-height: none;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: clear-404-progress-enter 0.28s ease-out;
}

[data-theme="dark"] .clear-404-progress-content {
  background:
    linear-gradient(180deg, rgba(36, 40, 48, 0.96) 0%, rgba(24, 27, 34, 0.98) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes clear-404-progress-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.clear-404-progress-orb {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
}

.clear-404-progress-orb[hidden] {
  display: none !important;
}

.clear-404-progress-success {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  color: #10b981;
}

.clear-404-progress-success[hidden] {
  display: none !important;
}

.clear-404-progress-success svg {
  display: block;
  width: 56px;
  height: 56px;
}

.clear-404-success-circle {
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  opacity: 0.9;
}

.clear-404-success-check {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
}

.clear-404-progress-success.is-animating .clear-404-success-circle {
  animation: clear-404-success-circle 0.55s ease-out forwards;
}

.clear-404-progress-success.is-animating .clear-404-success-check {
  animation: clear-404-success-check 0.35s 0.35s ease-out forwards;
}

@keyframes clear-404-success-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes clear-404-success-check {
  to { stroke-dashoffset: 0; }
}

.clear-404-progress-content.is-success .clear-404-progress-heading {
  color: #047857;
}

[data-theme="dark"] .clear-404-progress-content.is-success .clear-404-progress-heading {
  color: #6ee7b7;
}

[data-theme="dark"] .clear-404-progress-success {
  color: #34d399;
}

.clear-404-progress-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #4a9fe8;
  border-right-color: rgba(74, 159, 232, 0.35);
  animation: clear-404-spin 1.1s linear infinite;
}

.clear-404-progress-orb-ring:nth-child(2) {
  inset: 8px;
  border-top-color: #34d399;
  border-right-color: rgba(52, 211, 153, 0.3);
  animation-duration: 1.6s;
  animation-direction: reverse;
}

.clear-404-progress-orb-core {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0%, #dbeafe 45%, #93c5fd 100%);
  box-shadow: 0 0 16px rgba(74, 159, 232, 0.45);
  animation: clear-404-pulse 1.4s ease-in-out infinite;
}

[data-theme="dark"] .clear-404-progress-orb-core {
  background:
    radial-gradient(circle at 35% 30%, #e0f2fe 0%, #38bdf8 50%, #0284c7 100%);
}

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

@keyframes clear-404-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1); opacity: 1; }
}

.clear-404-progress-heading {
  margin: 0 0 0.4rem;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

[data-theme="dark"] .clear-404-progress-heading {
  color: #f3f4f6;
}

.clear-404-progress-status {
  margin: 0 0 0.35rem;
  font-size: 13.5px;
  color: #4b5563;
  min-height: 1.3em;
}

[data-theme="dark"] .clear-404-progress-status {
  color: #d1d5db;
}

.clear-404-progress-detail {
  margin: 0 0 1rem;
  font-size: 12px;
  color: #9ca3af;
  min-height: 1.2em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clear-404-progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .clear-404-progress-track {
  background: rgba(255, 255, 255, 0.1);
}

.clear-404-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa 0%, #34d399 50%, #4a9fe8 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(74, 159, 232, 0.45);
  transition: width 0.25s ease;
  animation: clear-404-bar-shimmer 1.8s linear infinite;
}

.clear-404-progress-bar.is-indeterminate {
  width: 36% !important;
  animation:
    clear-404-bar-shimmer 1.8s linear infinite,
    clear-404-bar-slide 1.35s ease-in-out infinite;
}

@keyframes clear-404-bar-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes clear-404-bar-slide {
  0% { transform: translateX(-20%); }
  50% { transform: translateX(160%); }
  100% { transform: translateX(-20%); }
}

.clear-404-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 12.5px;
  color: #6b7280;
}

[data-theme="dark"] .clear-404-progress-meta {
  color: #9ca3af;
}

.clear-404-progress-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #374151;
}

[data-theme="dark"] .clear-404-progress-count {
  color: #e5e7eb;
}

.clear-404-progress-found {
  text-align: right;
}

.clear-404-progress-stop {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 1rem auto 0;
  padding: 0.45rem 1.1rem;
  min-width: 96px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.clear-404-progress-stop:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

.clear-404-progress-stop:disabled {
  opacity: 0.55;
  cursor: default;
}

.clear-404-progress-stop[hidden] {
  display: none !important;
}

.clear-404-progress-close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 1rem auto 0;
  padding: 0.5rem 1.25rem;
  min-width: 108px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: #047857;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.clear-404-progress-close:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.24) 0%, rgba(16, 185, 129, 0.12) 100%);
  border-color: rgba(16, 185, 129, 0.5);
  color: #065f46;
  transform: translateY(-0.5px);
}

.clear-404-progress-close:disabled {
  opacity: 0.55;
  cursor: default;
}

.clear-404-progress-close[hidden] {
  display: none !important;
}

[data-theme="dark"] .clear-404-progress-stop {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
}

[data-theme="dark"] .clear-404-progress-stop:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

[data-theme="dark"] .clear-404-progress-close {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-color: rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

[data-theme="dark"] .clear-404-progress-close:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.28) 0%, rgba(16, 185, 129, 0.16) 100%);
  border-color: rgba(52, 211, 153, 0.5);
  color: #a7f3d0;
}

.bookmarks-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  height: var(--bh-control-height, 32px);
  padding: 3px;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.12) 100%),
    rgba(120, 120, 128, 0.12);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--bh-control-radius, 999px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 0.5px rgba(0, 0, 0, 0.02);
}

.bookmarks-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(60, 60, 67, 0.72);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  height: calc(var(--bh-control-height, 32px) - 6px);
  padding: 0 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.bookmarks-mode-btn:hover {
  color: #1d1d1f;
}

.bookmarks-mode-btn.active {
  background: var(--primary-color, #4A9FE8);
  color: #ffffff;
  box-shadow:
    0 1px 2px rgba(var(--primary-color-rgb), 0.25),
    0 3px 8px rgba(var(--primary-color-rgb), 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* 分组列表：纵向分区，每区内独立网格 */
#bookmarks-list.bookmarks-list-grouped,
#bookmarks-list {
  display: flex !important;
  flex-direction: column;
  gap: 1.5rem;
  grid-template-columns: none !important;
  align-content: start;
}

.bookmark-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  padding: 0 0.75rem;
  box-sizing: border-box;
}

.bookmark-section-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
  padding: 0.15rem 0;
}

.bookmark-section-icon {
  font-size: 1.05rem;
  opacity: 0.7;
  color: #6b7280;
}

.bookmark-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-section-highlight {
  animation: bookmark-section-flash 1.2s ease;
}

@keyframes bookmark-section-flash {
  0% {
    background-color: rgba(var(--primary-color-rgb), 0.12);
  }
  100% {
    background-color: transparent;
  }
}

.bookmark-section-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--bookmark-width, 150px), 1fr));
  gap: 1rem;
  width: 100%;
}

.bookmark-card {
  position: relative;
  background: transparent;
  border: none;
  box-shadow: 0 0 8px rgb(0 0 0 / 0.1), 0 0 2px rgb(0 0 0 / 0.06);
  box-sizing: border-box;
}

.bookmark-card:hover {
  background: transparent;
  border: none;
  box-shadow: 0 0 12px rgb(0 0 0 / 0.14), 0 0 3px rgb(0 0 0 / 0.08);
}

.bookmarks-edit-mode .bookmark-card .card-content {
  flex: 1;
  min-width: 0;
}

.bookmark-card-actions {
  display: none;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  flex-shrink: 0;
}

.bookmarks-edit-mode .bookmark-card-actions {
  display: inline-flex;
}

.bookmark-card-action-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #9ca3af;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.bookmark-card-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #374151;
}

.bookmark-card-action-delete:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.bookmark-card-action-btn .material-icons,
.bookmark-card-action-btn svg {
  width: 16px;
  height: 16px;
}

.bookmark-add-card,
.bookmark-tree-action-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: var(--bookmark-card-height, 36px);
  min-height: var(--bookmark-card-height, 36px);
  padding: 0.75rem;
  border: 1.5px dashed rgba(113, 120, 130, 0.45);
  border-radius: 10px;
  background: rgba(var(--glass-rgb), 0.18);
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.bookmark-add-card:hover,
.bookmark-tree-action-btn:hover {
  border-color: rgba(var(--primary-color-rgb), 0.65);
  border-style: dashed;
  color: var(--primary-color, #4A9FE8);
  background: rgba(var(--primary-color-rgb), 0.08);
  box-shadow: none;
}

[data-theme="dark"] .bookmark-add-card,
[data-theme="dark"] .bookmark-tree-action-btn {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #9ca3af;
  box-shadow: none;
}

[data-theme="dark"] .bookmark-add-card:hover,
[data-theme="dark"] .bookmark-tree-action-btn:hover {
  border-color: rgba(var(--primary-color-rgb), 0.7);
  color: var(--primary-color-light, #7BB8F0);
  background: rgba(var(--primary-color-rgb), 0.14);
}

.bookmark-add-icon,
.bookmark-add-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bookmark-add-icon {
  font-size: 15px;
  font-weight: 600;
  /* “+” 字形视觉中心偏下，轻微上移与文字对齐 */
  transform: translateY(-0.5px);
}

.bookmark-add-label {
  font-size: 13px;
  font-weight: 500;
}

[data-theme="dark"] .bookmarks-mode-toggle {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .bookmarks-mode-btn {
  color: rgba(235, 235, 245, 0.6);
}

[data-theme="dark"] .bookmarks-mode-btn:hover {
  color: #f5f5f7;
}

[data-theme="dark"] .bookmarks-mode-btn.active {
  background: var(--primary-color, #4A9FE8);
  color: #ffffff;
  box-shadow:
    0 1px 3px rgba(var(--primary-color-rgb), 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .bookmark-section-title {
  color: #f3f4f6;
}

[data-theme="dark"] .bookmark-section-icon {
  color: #9ca3af;
}

[data-theme="dark"] .bookmark-card-action-btn {
  color: #9ca3af;
}

[data-theme="dark"] .bookmark-card-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .search-form,
[data-theme="dark"] .search-suggestions {
  background: transparent;
  color: #ffffff;
}

[data-theme="dark"] .search-form {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .bookmarks-container {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e0e0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] footer,
[data-theme="dark"] footer.footer-glass {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .folder-stats-text {
  color: #9ca3af;
}
[data-theme="dark"] .breadcrumb-item {
  background-color: transparent;
  color: #9ca3af;
  border-color: transparent;
  box-shadow: none;
}
[data-theme="dark"] .breadcrumb-item:not(:last-child):hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary-color-light, #7BB8F0);
  border-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .breadcrumb-item:last-child {
  color: #f3f4f6;
  background-color: transparent;
}
[data-theme="dark"] .breadcrumb-item:last-child:hover {
  background-color: transparent;
  color: #f3f4f6;
}
[data-theme="dark"] #welcome-message {
  color: #ffffff;
}
[data-theme="dark"] .custom-hr {
  border-top: 1px solid #373737;
}
[data-theme="dark"] .search-suggestions-wrapper {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity-elevated));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .search-suggestions li {
  color: #ffffff;
}
[data-theme="dark"] .tab {
  color: #ffffff;
  background-color: #7a7a7a;
}
[data-theme="dark"] #tabs-container {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .search-suggestions li {
  color: #ffffff;
}
[data-theme="dark"] .search-suggestions li:hover {
  color: #242424;
}
[data-theme="dark"] .suggestion-icon path {
  fill: #e0e0e0;
}
[data-theme="dark"] li:hover .suggestion-icon path {
  fill: #242424;
}
[data-theme="dark"] .chrome-quick-icons {
  background-color: #404040;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}
[data-theme="dark"] .chrome-quick-icons a {
  color: #ffffff;
}
[data-theme="dark"] .chrome-quick-icons a:hover {
  color: var(--primary-color, #4A9FE8);
  background: #2d2d2d;
}
[data-theme="dark"] .settings-icon {
  background-color: #404040;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}
[data-theme="dark"] .settings-icon a {
  color: #ffffff;
}
[data-theme="dark"] .settings-icon a:hover {
  color: var(--primary-color, #4A9FE8);
  background: #2d2d2d;
}
[data-theme="dark"] .quick-link-item {
  background-color: #404040;
}
[data-theme="dark"] #toggle-sidebar {
  background-color: #404040;
  border-color: #525252;
  color: #e5e7eb;
}
[data-theme="dark"] #toggle-sidebar:hover {
  background-color: #525252;
  border-color: #737373;
  color: #ffffff;
}
[data-theme="dark"] .custom-context-menu {
  background-color: #404040;
  border-color: #404040;
  color: #ffffff;
}
[data-theme="dark"] .custom-context-menu-divider {
  background-color: #373737;
}
[data-theme="dark"] .custom-context-menu-item {
  color: #ffffff;
}
[data-theme="dark"] .custom-context-menu-item:hover {
  background-color: #ffffff;
  color: #242424;
}
[data-theme="dark"] #confirm-dialog p,
#edit-dialog p,
#edit-category-dialog p{
  color: #ffffff;
}
[data-theme="dark"] #confirm-dialog .modal-content,
[data-theme="dark"] #edit-dialog .modal-content,
[data-theme="dark"] #edit-category-dialog .modal-content {
  background-color: #242424;
  color: #ffffff;
  border-color: #242424;
}
[data-theme="dark"] #edit-dialog input[type="text"],
[data-theme="dark"] #edit-dialog input[type="url"],
[data-theme="dark"] #edit-category-dialog input[type="text"] {
  background-color: #404040;
  color: #ffffff;
  border-color: #404040;
}
[data-theme="dark"] .close-button {
  color: #ffffff;
}
[data-theme="dark"] .close-category-button {
  color: #ffffff;
}
[data-theme="dark"] .close-button:hover {
  color: #ffffff;
}
[data-theme="dark"] .close-category-button:hover {
  color: #ffffff;
}
[data-theme="dark"] .settings-modal-content {
  background-color: #242424;
  border-color: #242424;
  color: #ffffff;
}
[data-theme="dark"] .settings-modal-title {
  color: #ffffff;
}
[data-theme="dark"] .settings-tab-button {
  color: #ffffff;
}
[data-theme="dark"] .settings-modal-subtitle {
  color: #ffffff;
}


.welcome-guide {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.welcome-content {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.folder-selector {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-tips {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.wallpaper-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding: 10px 0;
  /* margin-bottom: 16px; */
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

.wallpaper-option {
    border: 2px solid #242424;
    width: 70px;
    height: 70px;
    background-size: cover;
    cursor: pointer;
    transition: border-color 0.3s;
    flex: 0 0 auto;
    border-radius: 8px;
}

.wallpaper-option:hover {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wallpaper-option.active {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
}

/* 暗色模式适配 */
[data-theme="dark"] .wallpaper-option {
  border-color: #404040;
}

[data-theme="dark"] .wallpaper-option:hover {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .wallpaper-option.active {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
}

.wallpaper-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
}

body, main {
    transition: none;
}

main {
    min-height: 100vh;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    will-change: background-image;
}

.page-loading {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.page-loaded {
    opacity: 1;
}

.wallpaper-actions {  
    margin-top: 12px;
    gap: 12px;
    align-items: center;
}

.wallpaper-actions button,
.wallpaper-actions label {
  height: 40px;
  width: 180px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
}

.wallpaper-actions button:hover,
.wallpaper-actions label:hover {
  background-color: #e5e7eb;
  color: var(--primary-color, #4A9FE8);
}

.wallpaper-actions .material-icons {
  font-size: 18px;
  margin-right: 4px;
}

/* 暗色模式适配 */
[data-theme="dark"] .wallpaper-actions button,
[data-theme="dark"] .wallpaper-actions label {
  background-color: #404040;
  border-color: #4b5563;
  color: #ffffff;
}

[data-theme="dark"] .wallpaper-actions button:hover,
[data-theme="dark"] .wallpaper-actions label:hover {
  background-color: #4b5563;
}

.settings-background-options,
.settings-accent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.settings-bg-option,
.settings-accent-option {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  background-size: 200% 200%;
  background-position: center;
  border: 2px solid transparent;
  transition: border-color 0.3s, transform 0.15s ease;
}

.settings-bg-option.active,
.settings-accent-option.active {
  border-color: var(--primary-color, #4A9FE8);
}

.settings-custom-color-option {
  position: relative;
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  border: 2px solid transparent;
  transition: border-color 0.3s, transform 0.15s ease;
  --custom-swatch-color: #4A9FE8;
  background:
    conic-gradient(
      from 0deg,
      #ff5a5a,
      #ffb84d,
      #ffe566,
      #6dd48a,
      #4A9FE8,
      #9b6bff,
      #ff5a5a
    );
}

.settings-custom-color-option:hover,
.settings-custom-color-option.active {
  transform: scale(1.05);
  border-color: var(--primary-color, #4A9FE8);
}

.settings-custom-color-option input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.settings-custom-color-ring {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--custom-swatch-color, #4A9FE8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

[data-theme="dark"] .settings-custom-color-option.active {
  border-color: var(--primary-color-light, #7BB8F0);
}


.upload-wallpaper-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-wallpaper-label:hover {
  background-color: #e5e7eb;
}

#upload-wallpaper {
  display: none;
}

/* Material Icons 字体声明 */


.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;  /* 统一图标大小 */
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 暗黑模式下的背景渐变类 */
[data-theme="dark"] html[class*="gradient-background"] {
  background: transparent !important;  /* 移除 html 的背景，让 body 的背景显示 */
}

/* 暗黑模式下确保 body 背景色优先级 */
[data-theme="dark"] body {
  background-color: #1c1c1c !important;
}

/* 当有壁纸时，移除暗色背景 */
[data-theme="dark"] body.has-wallpaper {
  background-color: transparent !important;
}

/* 暗黑模式下的壁纸容器样式 */
[data-theme="dark"] .wallpaper-option {
  border: 2px solid #404040;
  background-color: #242424;
}

/* 暗黑模式下的背景颜色选项样式 */
[data-theme="dark"] .settings-bg-option,
[data-theme="dark"] .settings-accent-option {
  opacity: 0.8;  /* 降低亮色背景的不透明度 */
}

[data-theme="dark"] .settings-bg-option.active,
[data-theme="dark"] .settings-accent-option.active {
  border-color: var(--primary-color, #4A9FE8);
    opacity: 1;
}


.wallpaper-options::-webkit-scrollbar {
    width: 8px;
}

.wallpaper-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wallpaper-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.wallpaper-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

[data-theme="dark"] .wallpaper-options::-webkit-scrollbar-track {
    background: #2d2d2d;
}

[data-theme="dark"] .wallpaper-options::-webkit-scrollbar-thumb {
    background: #666;
}

[data-theme="dark"] .wallpaper-options::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* 设置区域小标题样式 */
.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 12px;
    margin-top: 12px;
}

/* 暗色模式适配 */
[data-theme="dark"] .settings-section-title {
    color: #e5e7eb;
}

/* 修改标识样式 */
.uploaded-wallpaper-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: rgba(55, 65, 81, 0.85);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

/* 暗色模式适配 */
[data-theme="dark"] .uploaded-wallpaper-badge {
    background-color: rgba(229, 231, 235, 0.85);
    color: #1f2937;
}

/* 确保壁纸选项可以正确显示标识 */
.wallpaper-option {
    position: relative;
    overflow: visible;
}

[data-theme="dark"] .about-description {
  color: #e5e7eb;
  /* 使用较亮的颜色以提高在暗色背景下的可读性 */
}

[data-theme="dark"] .about-author {
  color: #e5e7eb;
}

[data-theme="dark"] .settings-sidebar {
  background-color: #1c1c1c;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  border: 1px solid #404040;
}
/* 暗色模式适配 */
[data-theme="dark"] .official-website a {
  color: #e5e7eb;
}

[data-theme="dark"] .official-website a span {
  color: #60a5fa;
}

[data-theme="dark"] .official-website a:hover {
  color: #60a5fa;
}
/* 添加到您的 styles.css 文件中 */
[data-theme="dark"] #theme-toggle-btn {
  background: #404040;
  border-color: #404040;
  padding: 8px;
  /* 添加内边距 */
  border-radius: 8px;
  /* 添加圆角 */
  transition: background-color 0.2s;
  /* 添加过渡效果 */
}

[data-theme="dark"] #theme-toggle-btn:hover {
  background-color: #404040;
  /* hover 时的背景色 */
}

/* 确保图标在 hover 时颜色变化 */
[data-theme="dark"] #theme-toggle-btn:hover svg {
  fill: #242424;
  /* hover 时图标颜色变深 */
}
/* 暗色模式下的样式 */
[data-theme="dark"] #theme-toggle-btn svg {
  fill: #ffffff;
  /* 暗色模式下的默认颜色 */
}

[data-theme="dark"] #theme-toggle-btn:hover svg {
  fill: #1c1c1c;
  /* 暗色模式下 hover 时的颜色 */
}
.bookmark-cleanup-actions {
  margin-top: 20px;
}

.primary-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--primary-color, #4A9FE8);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.primary-button:hover {
  background-color: var(--primary-color, #4A9FE8);
}

.primary-button .material-icons {
  font-size: 20px;
}

/* 系统主题自动切换相关样式 */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    background-color: #1c1c1c;
  }

  html[data-theme="auto"] body {
    background-color: #1c1c1c;
    color: #ffffff;
  }

  html[data-theme="auto"] .custom-width,
  html[data-theme="auto"] #sidebar-container > aside.custom-width,
  html[data-theme="auto"] aside {
    background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
    border-color: rgba(255, 255, 255, 0.1);
  }

  html[data-theme="auto"] #sidebar-container > aside.custom-width {
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 12px 40px rgba(0, 0, 0, 0.35);
  }

  html[data-theme="auto"] #logo-title {
    color: #ffffff;
  }

  html[data-theme="auto"] aside ul li {
    color: #e5e7eb;
  }

  html[data-theme="auto"] aside ul li:hover {
    background-color: rgba(var(--primary-color-rgb), 0.22);
    color: #f9fafb;
  }

  html[data-theme="auto"] aside ul li.bg-gray-200 {
    background-color: #374151;
    color: #f9fafb;
  }

  /* 继承现有的暗色模式样式 */
  html[data-theme="auto"] .search-input,
  html[data-theme="auto"] .search-form,
  html[data-theme="auto"] .search-suggestions {
    background: transparent;
    color: #ffffff;
  }

  html[data-theme="auto"] .search-form {
    background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 12px 40px rgba(0, 0, 0, 0.28);
  }

  html[data-theme="auto"] .search-suggestions-wrapper {
    background: rgba(var(--glass-rgb-dark), var(--glass-opacity-elevated));
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 16px 40px rgba(0, 0, 0, 0.4);
  }

  html[data-theme="auto"] .bookmarks-container {
    background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e0e0e0;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.1),
      0 12px 40px rgba(0, 0, 0, 0.28);
  }

  html[data-theme="auto"] .chrome-quick-icons,
  html[data-theme="auto"] .settings-icon,
  html[data-theme="auto"] #toggle-sidebar {
    background-color: #404040;
  }

  html[data-theme="auto"] .chrome-quick-icons a,
  html[data-theme="auto"] .settings-icon a {
    color: #ffffff;
  }

  html[data-theme="auto"] .chrome-quick-icons a:hover,
  html[data-theme="auto"] .settings-icon a:hover {
    color: var(--primary-color, #4A9FE8);
    background: #2d2d2d;
  }
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    background-color: #ffffff;
  }

  html[data-theme="auto"] body {
    background-color: #ffffff;
    color: #333333;
  }

  /* 继承其他亮色模式样式 */
  html[data-theme="auto"] [class*="light-mode-style"] {
    /* 应用对应的亮色模式样式 */
  }
}

/* 布局设置页面样式 */
.layout-settings-container {
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.layout-settings-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 1rem;
}

.layout-settings-description {
  font-size: 0.875rem;
  color: #4a5568;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.bookmark-width-settings {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.width-slider-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.width-value-display {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4a5568;
  padding: 0.25rem 0.75rem;
  background: #e2e8f0;
  border-radius: 4px;
  min-width: 60px;
  text-align: right;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color, #4A9FE8);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 6px rgba(var(--primary-color-rgb), 0.1);
}

.width-preview {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: right;
  margin-top: 0.5rem;
}

#width-preview-count {
  font-weight: 600;
  color: var(--primary-color, #4A9FE8);
}

/* 暗色模式适配 */
[data-theme="dark"] .layout-settings-container {
  background: #1f2937;
}

[data-theme="dark"] .layout-settings-title {
  color: #e5e7eb;
}

[data-theme="dark"] .layout-settings-description {
  color: #9ca3af;
}

[data-theme="dark"] .bookmark-width-settings {
  background: #374151;
}

[data-theme="dark"] .width-slider {
  background: #374151;
}

[data-theme="dark"] .width-value-display {
  color: #e5e7eb;
  background: #4b5563;
}

[data-theme="dark"] input[type="range"] {
  background: #ffffff;
}

[data-theme="dark"] .width-preview {
  color: #9ca3af;
}

/* 暗色模式适配 */
[data-theme="dark"] .floating-width-settings {
  background: #1f2937;
  color: #e5e7eb;
}

/* 当显示浮动卡片时移除模糊效果 */
.settings-modal-content.no-blur {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* 设置模态框的基础样式 */
.settings-modal {
  display: none;
  position: fixed;
  z-index: 1002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* transition: all 0.3s ease; */
}

/* 当滑块被拖动时，移除模糊效果 */
.settings-modal.no-blur {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: transparent;
  transition: all 0.3s ease;
}

/* 当显示浮动卡片时的样式 */
.settings-modal-content.no-blur {
  background-color: transparent !important;
  transition: all 0.3s ease;
}

/* 当显示浮动卡片时，其他内容的样式 */
.settings-modal-content.no-blur > *:not(#floating-width-settings) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 搜索引擎对话框暗色模式样式 */
[data-theme="dark"] .modal .modal-content {
  background-color: #242424;
  border-color: #404040;
  color: #e5e7eb;
}

[data-theme="dark"] .search-engines-title {
  color: #e5e7eb;
}

[data-theme="dark"] .category-title {
  color: #e5e7eb;
}

[data-theme="dark"] .search-engine-item {
  background-color: #333333;
}

[data-theme="dark"] .search-engine-item:hover {
  background-color: #404040;
}

[data-theme="dark"] .search-engine-name {
  color: #e5e7eb;
}

[data-theme="dark"] .custom-engine-form {
  background-color: #333333;
}

[data-theme="dark"] .custom-input {
  background-color: #242424;
  border-color: #404040;
  color: #e5e7eb;
}

[data-theme="dark"] .custom-input:focus {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

[data-theme="dark"] .custom-input::placeholder {
  color: #9ca3af;
}

[data-theme="dark"] .settings-modal-close {
  color: #e5e7eb;
}

[data-theme="dark"] .settings-modal-close:hover {
  color: #ffffff;
}

/* 暗色模式下的滚动条样式 */
[data-theme="dark"] .modal .modal-content::-webkit-scrollbar-track {
  background: #333333;
}

[data-theme="dark"] .modal .modal-content::-webkit-scrollbar-thumb {
  background-color: #4a4a4a;
  border: 2px solid #333333;
}

/* 暗色模式下的加载动画样式 */
[data-theme="dark"] .icon-loading-spinner {
  border-color: #404040;
  border-top-color: var(--primary-color, #4A9FE8);
}

/* 暗色模式下的复选框样式 */
[data-theme="dark"] .custom-checkbox input:checked + .checkmark {
  background-color: var(--primary-color, #4A9FE8);
  border-color: var(--primary-color, #4A9FE8);
}

[data-theme="dark"] .custom-checkbox .checkmark {
  border-color: #404040;
  background-color: #242424;
}

[data-theme="dark"] .custom-checkbox:hover input ~ .checkmark {
  background-color: #333333;
}

/* 暗色模式下的删除按钮样式 */
[data-theme="dark"] .delete-custom-engine {
  color: #e5e7eb;
}

[data-theme="dark"] .delete-custom-engine:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

#search-engines-dialog .custom-engine-add-card.bookmark-add-card {
  height: 40px;
  min-height: 40px;
  padding: 0 0.75rem;
}

#search-engines-dialog .search-engine-item {
  align-items: center;
  min-height: 40px;
  height: 40px;
  padding: 8px;
  box-sizing: border-box;
}

#search-engines-dialog .search-engine-info {
  min-width: 0;
}

#search-engines-dialog .search-engine-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#search-engines-dialog .delete-custom-engine {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 4px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

#search-engines-dialog .delete-custom-engine:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
  border-radius: 4px;
}

#search-engines-dialog .search-engine-item .search-engine-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
}

#add-custom-engine-dialog {
  z-index: 1003;
  overflow: auto;
}

#add-custom-engine-dialog .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
  max-width: 440px;
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 2rem;
  border-radius: 10px;
  overflow-y: auto;
}

#add-custom-engine-dialog h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
}

#add-custom-engine-dialog label {
  display: block;
  margin: 16px 0 6px 0;
  font-weight: 600;
}

#add-custom-engine-dialog label:first-of-type {
  margin-top: 0;
}

#add-custom-engine-dialog input[type="text"],
#add-custom-engine-dialog input[type="url"] {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border-radius: 4px;
  background-color: #f8f9fa;
  color: #333333;
  border: 1px solid #eeeeee;
  box-sizing: border-box;
}

#add-custom-engine-dialog input[type="text"]:focus,
#add-custom-engine-dialog input[type="url"]:focus {
  outline: none;
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb, 74, 159, 232), 0.1);
}

#add-custom-engine-dialog .custom-engine-url-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 400;
  color: #9ca3af;
}

#add-custom-engine-dialog .form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 2rem;
}

#add-custom-engine-dialog button {
  padding: 0.5rem 2rem;
  border-radius: 8px;
  cursor: pointer;
}

#add-custom-engine-dialog button[type="submit"] {
  background-color: var(--primary-color, #4A9FE8);
  color: #ffffff;
  border: none;
}

#add-custom-engine-dialog button[type="submit"]:hover {
  background-color: #3A8FD4;
}

#add-custom-engine-dialog .close-button {
  position: absolute;
  right: 20px;
  top: 20px;
  float: none;
  margin: 0;
  background: transparent;
  padding: 0;
}

[data-theme="dark"] #add-custom-engine-dialog .modal-content {
  background-color: #242424;
  color: #ffffff;
  border-color: #242424;
}

[data-theme="dark"] #add-custom-engine-dialog input[type="text"],
[data-theme="dark"] #add-custom-engine-dialog input[type="url"] {
  background-color: #404040;
  color: #ffffff;
  border-color: #404040;
}

[data-theme="dark"] #add-custom-engine-dialog .custom-engine-url-hint {
  color: #9ca3af;
}

/* 关闭按钮暗色模式样式 */
[data-theme="dark"] .close-button.settings-modal-close {
  color: #9ca3af;  /* 默认颜色 */
  background-color: #242424;  /* 与模态框背景色相同 */
}

[data-theme="dark"] .close-button.settings-modal-close:hover {
  color: #e5e7eb;  /* 悬停时颜色变亮 */
}

[data-theme="dark"] .close-button.settings-modal-close:focus {
  color: #e5e7eb;
  outline: none;
}

/* 确保暗色模式下关闭按钮的背景色与模态框一致 */
[data-theme="dark"] .modal .close-button.settings-modal-close {
  background-color: #242424;
  border-color: #404040;
}

/* 搜索引擎下拉框暗色模式样式 */
[data-theme="dark"] .search-engine-dropdown {
  background-color: #242424;
  border-color: #404040;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .search-engine-option {
  color: #e5e7eb;
}

[data-theme="dark"] .search-engine-option:hover {
  background-color: #333333;
}

[data-theme="dark"] .search-engine-option-content {
  color: #e5e7eb;
}

[data-theme="dark"] .search-engine-option-label {
  color: #e5e7eb;
}

/* 添加搜索引擎按钮的暗色模式 */
[data-theme="dark"] .search-engine-option:has(.add-engine) {
  border-color: #404040;
  background-color: #333333;
}

[data-theme="dark"] .search-engine-option:has(.add-engine):hover {
  background-color: #404040;
  border-color: var(--primary-color, #4A9FE8);
}

[data-theme="dark"] .add-engine {
  color: #9ca3af;
}

[data-theme="dark"] .search-engine-option:has(.add-engine):hover .add-engine {
  color: #e5e7eb;
}

/* 下拉框分隔线暗色模式 */
[data-theme="dark"] .search-engine-dropdown .divider {
  border-color: #404040;
}

/* 下拉框图标暗色模式 */
[data-theme="dark"] .search-engine-option-icon {
  background-color: #ffffff;
  padding: 2px;
  border-radius: 4px;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
}

/* 确保图标在暗色模式下有更好的可见度 */
[data-theme="dark"] .material-icons {
  color: #e5e7eb;
}

/* 全局滚动条样式 */
.global-range-slider {
  position: fixed;
  display: none;
  opacity: 0;
  z-index: 1003;
  background-color: rgba(254, 254, 254, 0.9);
  padding: 0px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.06), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  /* transition: opacity 0.3s ease; */
}

.global-range-slider.visible {
  opacity: 1;
}

/* 暗色模式下的全局滚动条样式 */
[data-theme="dark"] .global-range-slider {
  background-color: #242424;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.2);
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 12px;
  border: none;
  transition: background-color 0.2s;
  min-height: 60px;  /* 设置滚动条滑块的最小高度 */
  max-height: 120px; /* 设置滚动条滑块的最大高度 */
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.8);
}

/* Firefox 全局滚动条样式 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

/* 暗色模式全局滚动条样式 */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: rgba(229, 231, 235, 0.2);
  min-height: 60px;
  max-height: 120px; /* 确保暗色模式下也有相同的最大高度 */
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(229, 231, 235, 0.3);
}

[data-theme="dark"] * {
  scrollbar-color: rgba(229, 231, 235, 0.2) transparent;
}


/* 主题设置区域样式 */
.theme-setting-section {
    margin-bottom: 20px;
}

/* 主题选择下拉菜单样式 */
.theme-select {
    width: 140px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none; /* 移除默认的下拉箭头 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center; /* 调整箭头位置 */
    background-size: 16px; /* 调整箭头大小 */
}

.language-select {
    width: 220px;
}

.theme-select:hover {
    border-color: var(--primary-color, #4A9FE8);
}

.theme-select:focus {
    outline: none;
    border-color: var(--primary-color, #4A9FE8);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

/* 暗色模式下的箭头颜色 */
[data-theme="dark"] .theme-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23E5E7EB'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-color: #404040;
    border-color: #4b5563;
    color: #e5e7eb;
}

/* 暗色模式适配 */
[data-theme="dark"] .settings-section-title {
    color: #e5e7eb;
}

[data-theme="dark"] .theme-select {
    background-color: #404040;
    border-color: #4b5563;
    color: #e5e7eb;
}

[data-theme="dark"] .theme-select:hover {
    border-color: var(--primary-color, #4A9FE8);
}

[data-theme="dark"] .theme-select:focus {
    border-color: var(--primary-color, #4A9FE8);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}
/* 修改默认文件夹切换区域样式 */
.default-folders-tabs {
  position: fixed;
  top: 40%;  /* 垂直居中 */
  transform: translateY(-50%);  /* 垂直居中偏移 */
  left: 16rem;  /* 与侧边栏宽度对应 */
  padding: 8px 2px;  /* 调整内边距 */
  display: none; /* 默认隐藏 */
  flex-direction: column;  /* 改为垂直布局 */
  justify-content: center;
  z-index: 10;
  transition: none;  /* 随侧边栏状态立刻到位，不参与滑动动画 */
  background: rgba(255, 255, 255, 0.9);  /* 添加半透明背景 */
  border-radius: 0 12px 12px 0;  /* 右侧圆角 */
  box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.06),
    0 2px 4px -2px rgb(0 0 0 / 0.06);  /* 添加阴影 */
}

/* 显示类 */
.default-folders-tabs.show {
  display: flex;
}

/* 当侧边栏收起时调整位置 */
body .default-folders-tabs.sidebar-collapsed {
  left: 0;
  border-radius: 0px 12px 12px 0px;
    /* 右侧圆角 */
}
/* 当侧边栏收起时调整位置 */
body .default-folders-tabs.sidebar-expanded {
  display: none;
  /* 右侧圆角 */
}

/* 优化 tabs-container 样式 */
.tabs-container {
  display: flex;
  flex-direction: column;  /* 改为垂直布局 */
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
}

/* 暗色模式适配 tabs-container */
[data-theme="dark"] .default-folders-tabs {
  background: rgba(28, 28, 28, 0.9);
}

/* Homepage folder: left icon switches to Home (no trailing pin) */
#categories-list li.is-homepage-folder .folder-type-icon {
  color: var(--primary-color, #4A9FE8);
}

#categories-list li.is-homepage-folder .folder-type-icon svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] #categories-list li.is-homepage-folder .folder-type-icon {
  color: var(--primary-color-light, #7BB8F0);
}

/* Selected homepage folder keeps white icon on blue row */
#categories-list li.is-homepage-folder.bg-emerald-500 .folder-type-icon {
  color: #ffffff;
}

/* 点状分页符样式 */
.folder-tab {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #e5e7eb;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  will-change: transform;
}

/* 文件夹名称提示基础样式 */
.folder-tab::after {
  content: attr(data-name);
  position: absolute;
  left: 100%;  /* 改为显示在右侧 */
  top: 50%;  /* 垂直居中 */
  transform: translateY(-50%);  /* 垂直居中偏移 */
  padding: 4px 8px;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  margin-left: 8px;  /* 添加左边距 */
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  background-color: rgba(0, 0, 0, 0.8);
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
  .default-folders-tabs {
    display: none !important;  /* 在小屏幕上隐藏 */
  }
}

/* 暗色模式适配 */
[data-theme="dark"] .folder-tab {
  background-color: #4b5563;
}

[data-theme="dark"] .folder-tab:hover {
  background-color: #6b7280;
}

[data-theme="dark"] .folder-tab.active {
  background-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3); /* 暗色模式下调整光晕效果 */
}

/* Links 设置页：分组与其他设置页统一全宽，不再单独缩进 */
.interface-elements-settings {
  margin-top: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.interface-elements-settings .setting-option {
  margin-bottom: 1rem;
}

/* 暗色模式：所有设置页 toggle / setting-option */
[data-theme="dark"] .setting-option {
  background-color: #2d2d2d;
  color: #e5e5e5;
}

[data-theme="dark"] .setting-option:hover {
  background-color: #363636;
}

[data-theme="dark"] .switch-label {
  color: #e5e5e5;
}

[data-theme="dark"] .slider {
  background-color: #555555;
}

[data-theme="dark"] input:checked + .slider {
  background-color: var(--primary-color, #4A9FE8);
}

/* 搜索设置面板样式 */
.search-suggestions-settings {
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 1rem;
}

.search-suggestions-settings .setting-option {
  margin-bottom: 1rem;
}

.search-suggestions-settings .setting-option:last-child {
  margin-bottom: 0;
}

/* 暗色模式适配 */
[data-theme="dark"] .search-suggestions-settings {
  background: #2d2d2d;
}

[data-theme="dark"] .search-suggestions-settings .setting-option:hover {
  background-color: #404040;
}

/* 设置窗口遮罩：保留点击关闭，无视觉背景效果 */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.settings-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-sidebar {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(1080px, 94vw);
  height: min(780px, 88vh);
  max-width: 94vw;
  max-height: 88vh;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1003;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-50%, -46%, 0) scale(0.96);
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.settings-sidebar.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(-50%, -50%, 0) scale(1);
}

@media (max-width: 1024px) {
  .settings-sidebar {
    width: min(980px, 96vw);
    height: min(760px, 90vh);
  }
}

@media (max-width: 768px) {
  .settings-sidebar {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: translate3d(0, 12px, 0) scale(1);
  }

  .settings-sidebar.open {
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.settings-sidebar-content {
  padding: 20px 22px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.settings-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eeeeee;
  flex-shrink: 0;
}

.settings-sidebar-close {
  font-size: 24px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.settings-sidebar-close:hover {
  color: #000;
  background-color: #f3f4f6;
}

.settings-sidebar .settings-layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.settings-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
  padding-right: 20px;
  border-right: 1px solid #eeeeee;
  width: 160px;
  flex-shrink: 0;
  overflow-y: auto;
}

.settings-sidebar .settings-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0 0 0 20px;
  padding-right: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .settings-sidebar-content {
    padding: 16px;
  }
}

/* 设置选项卡按钮样式 */
.settings-tab-button {
  text-align: left;
  padding: 10px 15px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: #1a202c;
  transition: background-color 0.15s ease, color 0.15s ease;
  font-weight: 500;
}

.settings-tab-button:hover {
  background-color: rgba(15, 23, 42, 0.06);
  color: var(--primary-color, #4A9FE8);
}

.settings-tab-button.active,
.settings-tab-button.active:hover {
  background-color: var(--primary-color, #4A9FE8);
  color: #ffffff;
  font-weight: 500;
}

/* 暗色模式适配 */
[data-theme="dark"] .settings-sidebar-nav {
  border-right-color: #333333;
}

[data-theme="dark"] .settings-tab-button {
  color: #ffffff;
}

[data-theme="dark"] .settings-tab-button:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .settings-tab-button.active,
[data-theme="dark"] .settings-tab-button.active:hover {
  background-color: var(--primary-color, #4A9FE8);
  color: #ffffff;
}
[data-theme="dark"] .settings-sidebar-header {
  border-bottom: 1px solid #404040;
}
[data-theme="dark"] .settings-sidebar-close:hover {
  color: #ffffff;
  background-color: #333333;
}
[data-theme="dark"] .settings-overlay {
  background-color: transparent;
}
/* 响应式设计 - 在小屏幕上切换回上下结构 */
@media (max-width: 768px) {
  .settings-sidebar .settings-layout {
    flex-direction: column;
  }
  
  .settings-sidebar-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #eeeeee;
    padding-right: 0;
    padding-bottom: 15px;
    margin-bottom: 15px;
    max-height: 160px;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
  }
  
  .settings-sidebar .settings-content {
    margin-left: 0;
    padding-left: 0;
  }
  
  [data-theme="dark"] .settings-sidebar-nav {
    border-bottom-color: #333333;
  }
}



#container-width-settings {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  margin-top: 1rem;
}
#floating-width-settings {
  margin-bottom: 24px;
  padding: 16px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 新增书签卡片高度设置样式 */
#card-height-settings {
  margin-bottom: 24px;
  padding: 16px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #card-height-settings {
  background-color: #2d2d2d;
  color: #e5e7eb;
}

/* 暗色模式适配 */
[data-theme="dark"] #container-width-settings {
  background: #2d2d2d;
}
[data-theme="dark"] #floating-width-settings {
  background: #2d2d2d;
}
.settings-tab-content p {
  font-size: 14px;
  margin-bottom: 1rem;
}

.settings-tab-content {
  min-width: 0;
  max-width: 100%;
}

#account-settings,
.account-settings-body,
.account-settings-skeleton {
  min-width: 0;
  max-width: 100%;
}

/* 赞赏页面样式 */
.donate-description {
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 24px;
}

.donate-options {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.donate-option {
  flex: 1;
  min-width: 200px;
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donate-option-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 16px;
  text-align: center;
}

.donate-qrcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donate-qrcode {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.donate-qrcode-text {
  margin-top: 10px;
  text-align: center;
  color: #666;
}

.donate-list-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.donate-list-button {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: #e8e8e8;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  transition: all 0.2s ease;
  justify-content: center;
  min-width: 140px;
  font-size: 14px;
}

.donate-list-button:hover {
  background-color: #e5e7eb;
  color: var(--primary-color, #4A9FE8);
  transform: none;
}

[data-theme="dark"] .donate-list-button {
  background-color: #2d2d2d;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

[data-theme="dark"] .donate-list-button:hover {
  background-color: #404040;
  color: var(--primary-color, #4A9FE8);
}

/* 保留原有的donate-list-link样式用于兼容性 */
.donate-list-link {
  display: block;
  margin-top: 10px;
  text-align: center;
  color: #4285f4;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1005; /* 确保链接的z-index高于侧边栏 */
}

.donate-list-link:hover {
  text-decoration: underline;
  color: #2b579a;
}

[data-theme="dark"] .donate-list-link {
  color: #8ab4f8;
}

[data-theme="dark"] .donate-list-link:hover {
  color: #aecbfa;
}

.donate-paypal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.donate-paypal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background-color: #0070ba;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}

.donate-paypal-button:hover {
  background-color: #005ea6;
}

.donate-thank-you {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color, #4A9FE8);
  text-align: center;
  margin-top: 16px;
}

/* 暗色模式适配 */
[data-theme="dark"] .donate-description {
  color: #e5e7eb;
}

[data-theme="dark"] .donate-option {
  background-color: #2d2d2d;
}

[data-theme="dark"] .donate-option-title {
  color: #e5e7eb;
}

[data-theme="dark"] .donate-qrcode-text {
  color: #9ca3af;
}

[data-theme="dark"] .donate-thank-you {
  color: var(--primary-color, #4A9FE8);
}

/* 优化悬停和激活状态的动画 */
.folder-tab:hover {
  transform: scale(1.2);
  background-color: #d1d5db;
}

/* 加强激活状态的显示效果 */
.folder-tab.active {
  width: 10px;
  height: 10px;
  background-color: var(--primary-color, #4A9FE8);
  transform: scale(1.2);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2); /* 添加光晕效果 */
}

/* 悬停时的提示样式 */
.folder-tab:hover::after {
  opacity: 1;
}

/* 切换时的临时提示样式 */
.folder-tab.active.switching::after {
  opacity: 1;
  background-color: rgba(var(--primary-color-rgb), 0.9);
  animation: fadeOutAfterDelay 1.5s ease forwards;
}

/* 调整淡出动画时间比例 */
@keyframes fadeOutAfterDelay {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* 移除之前的重复样式 */
.folder-tab.active::after {
  opacity: 0;
}

/* 切换时的动画效果 */
.folder-tab.switching {
  animation: pulse 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.2); }
}

/* 快捷键设置样式 */
.shortcuts-settings-container {
  margin-top: 1.5rem;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shortcut-item:hover {
  background-color: #f8f9fa;
  border-color: var(--primary-color, #4A9FE8);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.shortcut-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shortcut-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a202c;
}

.shortcut-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  color: #64748b;
}

.shortcut-value-label {
  color: #94a3b8;
  font-size: 12px;
}

.shortcut-value-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.shortcut-arrow {
  color: #94a3b8;
  font-size: 20px;
  transition: transform 0.2s ease;
}

.shortcut-item:hover .shortcut-arrow {
  transform: translateX(2px);
  color: var(--primary-color, #4A9FE8);
}

/* 暗色模式适配 */
[data-theme="dark"] .shortcut-item {
  background-color: #1f2937;
  border-color: #374151;
}

[data-theme="dark"] .shortcut-item:hover {
  background-color: #2d3748;
  border-color: var(--primary-color, #4A9FE8);
}

[data-theme="dark"] .shortcut-name {
  color: #e5e7eb;
}

[data-theme="dark"] .shortcut-value {
  color: #9ca3af;
}

[data-theme="dark"] .shortcut-arrow {
  color: #64748b;
}

[data-theme="dark"] .shortcut-item:hover .shortcut-arrow {
  color: var(--primary-color, #4A9FE8);
}

/* 必应壁纸样式 */
.bing-wallpapers-section {
    margin-bottom: 16px;
    max-width: 800px;
    padding-right: 10px;
}

.bing-wallpapers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
    aspect-ratio: 16/9;
}

.bing-wallpaper-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 16/9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bing-wallpaper-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bing-wallpaper-item:hover .bing-wallpaper-info {
    opacity: 1;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.bing-wallpaper-thumbnail {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.2s ease;
}

.bing-wallpaper-item:hover .bing-wallpaper-thumbnail {
    transform: scale(1.05);
}

.bing-wallpaper-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.bing-wallpaper-title {
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.bing-wallpaper-date {
    font-size: 10px;
    opacity: 0.8;
}

/* 暗黑模式样式 */
[data-theme="dark"] .bing-wallpapers-title,
[data-theme="dark"] .wallpaper-preset-title {
    color: var(--text-color-dark);
}

[data-theme="dark"] .bing-wallpaper-item {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .bing-wallpaper-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 必应壁纸的激活状态样式 */
.bing-wallpaper-item.active {
    border: 2px solid var(--primary-color, #4A9FE8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 暗黑模式下的激活状态样式 */
[data-theme="dark"] .bing-wallpaper-item.active {
    border-color: var(--primary-color, #4A9FE8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
/* ========== 右侧插件栏 ========== */
:root {
  --plugin-bar-width: 0px;
  --plugin-panel-width: 300px;
}

.plugin-bar {
  position: fixed;
  top: var(--side-panel-margin, 8px);
  right: var(--side-panel-margin, 8px);
  bottom: var(--side-panel-margin, 8px);
  height: calc(100vh - (var(--side-panel-margin, 8px) * 2));
  width: var(--plugin-panel-width, 300px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  /* Apple-like liquid glass */
  background: rgba(var(--glass-rgb), var(--glass-opacity));
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--side-panel-radius, 20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset -1px 0 0 rgba(255, 255, 255, 0.35),
    0 12px 40px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
  padding: 0.75rem 0.5rem;
  overflow: hidden;
}

.plugin-bar.hidden {
  display: none !important;
}

.plugin-bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.plugin-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 0;
  background: rgba(var(--glass-rgb), var(--glass-opacity-card));
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
  box-sizing: border-box;
}

.plugin-card[data-plugin="clock"] {
  flex: 0 0 auto;
  min-height: 0;
  max-height: 120px;
}

.plugin-card[data-plugin="todo"],
.plugin-card[data-plugin="notes"] {
  flex: 1.35 1 0;
  min-height: 180px;
}

.plugin-card-ghost {
  opacity: 0.45;
}

.plugin-card-chosen {
  box-shadow: 0 0 12px rgb(0 0 0 / 0.14);
}

.plugin-card-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.35rem;
  flex-shrink: 0;
  user-select: none;
}

.plugin-drag-handle {
  appearance: none;
  border: none;
  background: transparent;
  width: 18px;
  height: 22px;
  padding: 0;
  cursor: grab;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
}

.plugin-drag-handle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: #9ca3af;
}

.plugin-drag-handle:active {
  cursor: grabbing;
}

.plugin-card-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
}

.plugin-card-body {
  flex: 1;
  min-height: 0;
  padding: 0.35rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 时钟 */
.plugin-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  height: auto;
  min-height: 0;
  padding: 0.15rem 0 0.35rem;
  text-align: center;
}

.plugin-clock-time {
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.1;
  color: #111827;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.plugin-clock-date {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.3;
}

/* 待办 */
.plugin-todo-form {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
}

.plugin-todo-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
  background: #fff;
  color: #111827;
  outline: none;
}

.plugin-todo-input:focus {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.15);
}

.plugin-todo-add {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: var(--primary-color, #4A9FE8);
  color: #fff;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, filter 0.15s ease;
}

.plugin-todo-add .bookmark-add-icon {
  color: inherit;
}

.plugin-todo-add:hover {
  filter: brightness(0.92);
}

.plugin-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.plugin-todo-empty {
  font-size: 0.78rem;
  color: #9ca3af;
  text-align: center;
  padding: 0.75rem 0;
}

.plugin-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.35rem 0.3rem;
  border-radius: 6px;
}

.plugin-todo-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.plugin-todo-check {
  margin-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
}

.plugin-todo-text {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: #1f2937;
  line-height: 1.35;
  word-break: break-word;
}

.plugin-todo-item.is-done .plugin-todo-text {
  text-decoration: line-through;
  color: #9ca3af;
}

.plugin-todo-remove {
  appearance: none;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
  opacity: 0;
}

.plugin-todo-item:hover .plugin-todo-remove {
  opacity: 1;
}

.plugin-todo-remove:hover {
  color: #dc2626;
}

/* Markdown 便签 */
.plugin-notes-toolbar {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  background: rgba(var(--glass-rgb), var(--glass-opacity-soft));
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 7px;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  align-self: flex-start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.plugin-notes-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.28rem 0.55rem;
  border-radius: 5px;
  cursor: pointer;
}

.plugin-notes-mode-btn.active {
  background: var(--primary-color, #4A9FE8);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(var(--primary-color-rgb), 0.25);
}

.plugin-notes-editor,
.plugin-notes-preview {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  box-sizing: border-box;
}

.plugin-notes-editor {
  border: 1px solid #e5e7eb;
  padding: 0.55rem;
  resize: none;
  outline: none;
  background: #fff;
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.plugin-notes-editor:focus {
  border-color: var(--primary-color, #4A9FE8);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.12);
}

.plugin-notes-preview {
  border: 1px solid transparent;
  padding: 0.45rem 0.35rem;
  overflow-y: auto;
  color: #334155;
}

.plugin-notes-preview.markdown-body {
  font-size: 0.8rem;
  line-height: 1.62;
}

.plugin-notes-preview.hidden,
.plugin-notes-editor.hidden {
  display: none !important;
}

/* 主内容与右侧快捷图标让位（含插件栏宽度 + margin） */
body.plugin-bar-visible #sidebar-container {
  margin-right: calc(var(--plugin-bar-width, 300px) + var(--side-panel-margin, 8px));
  transition: margin-right 0.2s ease;
}

body.plugin-bar-visible .chrome-quick-icons,
body.plugin-bar-visible .settings-icon,
body.plugin-bar-visible .theme-toggle {
  right: calc(2rem + var(--plugin-bar-width, 300px) + var(--side-panel-margin, 8px));
}

/* chrome-quick-icons 拖拽排序 */
.chrome-quick-icons.reorder-enabled a {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.chrome-quick-icons.reorder-enabled a:active,
.chrome-quick-icons.is-reordering a,
.chrome-quick-icons-drag {
  cursor: grabbing;
}

.chrome-quick-icons-ghost {
  opacity: 0.35;
}

.chrome-quick-icons-chosen {
  background: rgba(74, 159, 232, 0.12);
}

.chrome-quick-icons-drag {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

/* 插件栏显示/隐藏按钮（对称于左侧 #toggle-sidebar） */
#toggle-plugin-bar {
  position: fixed;
  bottom: 2rem;
  right: calc(var(--side-panel-margin, 8px) + var(--plugin-panel-width, 300px) - 1.25rem);
  background-color: #ffffff;
  border: 1px solid #f4f4f5;
  border-radius: 50%;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, right 0.2s ease;
  z-index: 1000;
  height: 36px;
  width: 36px;
  color: #717882;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#toggle-plugin-bar:hover {
  background-color: #eeeeee;
  color: #111827;
}

#toggle-plugin-bar[hidden] {
  display: none !important;
}

[data-theme="dark"] #toggle-plugin-bar {
  background-color: #2d2d2d;
  border-color: #404040;
  color: #d1d5db;
}

[data-theme="dark"] #toggle-plugin-bar:hover {
  background-color: #404040;
  color: #ffffff;
}

@media (max-width: 959px) {
  #toggle-plugin-bar {
    display: none !important;
  }
}

/* 暗色模式 */
[data-theme="dark"] .plugin-bar {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .plugin-card {
  background: rgba(var(--glass-rgb-dark-card), var(--glass-opacity-card));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .plugin-card-title {
  color: #e5e7eb;
}

[data-theme="dark"] .plugin-drag-handle span {
  background: #9ca3af;
}

[data-theme="dark"] .plugin-clock-time {
  color: #f9fafb;
}

[data-theme="dark"] .plugin-clock-date {
  color: #9ca3af;
}

[data-theme="dark"] .plugin-todo-input,
[data-theme="dark"] .plugin-notes-editor {
  background: #2a2a2a;
  border-color: #404040;
  color: #f3f4f6;
}

[data-theme="dark"] .plugin-todo-text {
  color: #e5e7eb;
}

[data-theme="dark"] .plugin-todo-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .plugin-notes-toolbar {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .plugin-notes-mode-btn.active {
  background: var(--primary-color, #4A9FE8);
  color: #ffffff;
}

[data-theme="dark"] .plugin-notes-preview {
  color: rgba(226, 232, 240, 0.9);
}

@media (max-width: 959px) {
  .plugin-bar {
    display: none !important;
  }

  body.plugin-bar-visible #sidebar-container {
    margin-right: 0;
  }

  body.plugin-bar-visible .chrome-quick-icons,
  body.plugin-bar-visible .settings-icon,
  body.plugin-bar-visible .theme-toggle {
    right: 2rem;
  }
}

/* ========== 首次使用：产品快速指引 ========== */
.quick-guide-root {
  position: fixed;
  inset: 0;
  z-index: 4000;
  pointer-events: none;
}

.quick-guide-root:not([hidden]) {
  pointer-events: auto;
}

.quick-guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.quick-guide-hole {
  position: absolute;
  border-radius: 14px;
  box-shadow:
    0 0 0 9999px rgba(15, 23, 42, 0.55),
    0 0 0 3px rgba(58, 143, 212, 0.95),
    0 12px 36px rgba(15, 23, 42, 0.35);
  background: transparent;
  pointer-events: none;
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.quick-guide-root[data-has-target="1"] .quick-guide-backdrop {
  background: transparent;
}

.quick-guide-card {
  position: absolute;
  z-index: 1;
  width: min(360px, calc(100vw - 24px));
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  box-sizing: border-box;
  color: #1f2937;
}

.quick-guide-card.is-centered {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.quick-guide-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.quick-guide-progress {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.quick-guide-skip {
  appearance: none;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
}

.quick-guide-skip:hover {
  color: #111827;
}

.quick-guide-title {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}

.quick-guide-body {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #4b5563;
}

.quick-guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.quick-guide-btn {
  appearance: none;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.quick-guide-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quick-guide-btn.secondary {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

.quick-guide-btn.secondary:hover:not(:disabled) {
  background: #e5e7eb;
}

.quick-guide-btn.primary {
  background: #3A8FD4;
  color: #fff;
}

.quick-guide-btn.primary:hover {
  background: #2f7bb8;
}

body.quick-guide-open {
  overflow: hidden;
}

[data-theme="dark"] .quick-guide-card {
  background: #1f2937;
  color: #e5e7eb;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .quick-guide-title {
  color: #f9fafb;
}

[data-theme="dark"] .quick-guide-body,
[data-theme="dark"] .quick-guide-progress {
  color: #9ca3af;
}

[data-theme="dark"] .quick-guide-skip {
  color: #9ca3af;
}

[data-theme="dark"] .quick-guide-skip:hover {
  color: #e5e7eb;
}

[data-theme="dark"] .quick-guide-btn.secondary {
  background: #374151;
  color: #e5e7eb;
  border-color: #4b5563;
}

[data-theme="dark"] .quick-guide-btn.secondary:hover:not(:disabled) {
  background: #4b5563;
}

[data-theme="dark"] .quick-guide-hole {
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.65),
    0 0 0 3px rgba(74, 159, 232, 0.95),
    0 12px 36px rgba(0, 0, 0, 0.45);
}

/* ========== 设置：检查更新 ========== */
.update-check-panel {
  width: 100%;
  max-width: 380px;
  margin: 0.25rem auto 1.25rem;
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  box-sizing: border-box;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.update-check-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding-bottom: 0.55rem;
}

.update-check-toolbar {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
}

.update-check-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.update-check-actions[hidden] {
  display: none !important;
}

.update-check-button,
.update-download-button {
  min-width: 9.5rem;
}

.update-check-status {
  margin: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
  text-align: left;
  font-weight: 500;
}

.update-check-status.is-checking {
  color: #64748b;
}

.update-check-status.is-latest {
  color: #0f6e56;
  background: rgba(15, 110, 86, 0.08);
}

.update-check-status.is-available {
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
  font-weight: 600;
}

.update-check-status.is-error {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.about-text-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary-color, #4A9FE8);
  font-size: 13px;
  font-weight: 550;
  padding: 0;
  margin: 0 0 0.35rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.3;
}

.about-text-action:hover {
  text-decoration: underline;
  color: #3A8FD4;
}

.about-links .about-text-action {
  display: inline-block;
}

.about-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.85rem;
}

.about-legal-links .about-text-action {
  margin: 0;
}

.update-check-panel .update-auto-check-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.7rem 0 0.35rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.update-check-panel .update-auto-check-option:hover {
  background: transparent;
}

.update-auto-check-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  text-align: center;
}

.update-available-modal-content {
  max-width: 420px;
  width: calc(100% - 2rem);
}

#update-available-dialog.modal {
  z-index: 1100;
}

.update-available-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.update-available-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.update-available-dialog-message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #4b5563;
}

.update-available-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

[data-theme="dark"] .update-auto-check-hint,
[data-theme="dark"] .update-available-dialog-message {
  color: #9ca3af;
}

.update-check-button,
.update-download-button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.95rem;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.update-check-button {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.update-check-button:hover:not(:disabled) {
  background: #e2e8f0;
}

.update-check-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.cache-clear-panel {
  margin: 1rem 0 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.clear-cache-status {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.clear-cache-status.is-success {
  color: #3A8FD4;
}

.clear-cache-status.is-error {
  color: #dc2626;
}

[data-theme="dark"] .cache-clear-panel {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .clear-cache-status {
  color: #9ca3af;
}

[data-theme="dark"] .clear-cache-status.is-success {
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .clear-cache-status.is-error {
  color: #f87171;
}

.update-download-button {
  background: var(--primary-color, #4A9FE8);
  color: #ffffff;
}

.update-download-button:hover {
  background: #3A8FD4;
}

.settings-tab-button.has-update {
  position: relative;
}

.settings-tab-button.has-update::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #ffffff;
}

.settings-tab-button.has-update.active::after {
  box-shadow: 0 0 0 2px var(--primary-color, #4A9FE8);
}

[data-theme="dark"] .update-check-panel {
  background: #1f1f1f;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

[data-theme="dark"] .update-check-status {
  color: #94a3b8;
  background: #2a2a2a;
}

[data-theme="dark"] .update-check-status.is-latest {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .update-check-status.is-available {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

[data-theme="dark"] .update-check-status.is-error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

[data-theme="dark"] .about-text-action {
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .about-text-action:hover {
  color: #93c5fd;
}

[data-theme="dark"] .update-check-panel .update-auto-check-option {
  border-top-color: rgba(255, 255, 255, 0.1);
  background: transparent;
}

[data-theme="dark"] .update-check-panel .update-auto-check-option:hover {
  background: transparent;
}

[data-theme="dark"] .update-check-button {
  background: #2a2a2a;
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .update-check-button:hover:not(:disabled) {
  background: #363636;
}

[data-theme="dark"] .settings-tab-button.has-update::after {
  box-shadow: 0 0 0 2px #1c1c1c;
}

[data-theme="dark"] .settings-tab-button.has-update.active::after {
  box-shadow: 0 0 0 2px var(--primary-color, #4A9FE8);
}

/* ========== Apple glass controls (buttons / chips / floating chrome) ========== */
:root {
  --glass-control-bg: rgba(var(--glass-rgb), var(--glass-opacity));
  --glass-control-bg-soft: rgba(var(--glass-rgb), var(--glass-opacity-soft));
  --glass-control-border: rgba(255, 255, 255, 0.55);
  --glass-control-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 8px 24px rgba(15, 23, 42, 0.08);
  --glass-control-blur: blur(24px) saturate(170%);
}

#toggle-sidebar,
#toggle-plugin-bar,
#theme-toggle-btn,
.chrome-quick-icons,
.settings-icon,
.scroll-indicator,
.wallpaper-actions button,
.wallpaper-actions label,
.reset-button,
.upload-wallpaper-label,
.update-check-button,
#cancel-delete-button,
.cancel-button,
.cancel-category-button,
.custom-context-menu {
  background: var(--glass-control-bg) !important;
  backdrop-filter: var(--glass-control-blur);
  -webkit-backdrop-filter: var(--glass-control-blur);
  border: 1px solid var(--glass-control-border) !important;
  box-shadow: var(--glass-control-shadow);
}

#toggle-sidebar,
#toggle-plugin-bar,
#theme-toggle-btn,
.scroll-indicator {
  border-radius: 50%;
}

#theme-toggle-btn,
.chrome-quick-icons,
.settings-icon {
  border-radius: 12px;
}

.wallpaper-actions button,
.wallpaper-actions label,
.reset-button,
.upload-wallpaper-label,
.update-check-button,
#cancel-delete-button,
.cancel-button,
.cancel-category-button {
  border-radius: 10px;
  color: #374151;
}

.bookmark-root-toggle.active {
  background: rgba(var(--glass-rgb), 0.72) !important;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 8px rgba(15, 23, 42, 0.08);
}

#toggle-sidebar:hover,
#toggle-plugin-bar:hover,
#theme-toggle-btn:hover,
.wallpaper-actions button:hover,
.wallpaper-actions label:hover,
.reset-button:hover,
.upload-wallpaper-label:hover,
.update-check-button:hover:not(:disabled),
#cancel-delete-button:hover,
.cancel-button:hover,
.cancel-category-button:hover,
.scroll-indicator:hover {
  background: rgba(var(--glass-rgb), min(0.88, calc(var(--glass-opacity) + 0.28))) !important;
  color: var(--primary-color, #4A9FE8);
  border-color: rgba(255, 255, 255, 0.7) !important;
}

.chrome-quick-icons a:hover,
.settings-icon a:hover {
  background: rgba(var(--glass-rgb), 0.55) !important;
  color: var(--primary-color, #4A9FE8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bookmarks-container:hover .scroll-indicator {
  opacity: 0.75;
}

.bookmarks-container:hover .scroll-indicator:hover {
  opacity: 1;
  background: rgba(var(--glass-rgb), 0.88) !important;
}

.custom-context-menu {
  border-radius: 12px;
  overflow: hidden;
}

/* Dark mode glass controls */
[data-theme="dark"] #toggle-sidebar,
[data-theme="dark"] #toggle-plugin-bar,
[data-theme="dark"] #theme-toggle-btn,
[data-theme="dark"] .chrome-quick-icons,
[data-theme="dark"] .settings-icon,
[data-theme="dark"] .scroll-indicator,
[data-theme="dark"] .wallpaper-actions button,
[data-theme="dark"] .wallpaper-actions label,
[data-theme="dark"] .reset-button,
[data-theme="dark"] .upload-wallpaper-label,
[data-theme="dark"] .update-check-button,
[data-theme="dark"] #cancel-delete-button,
[data-theme="dark"] .cancel-button,
[data-theme="dark"] .cancel-category-button,
[data-theme="dark"] .custom-context-menu {
  background: rgba(var(--glass-rgb-dark), var(--glass-opacity)) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 8px 24px rgba(0, 0, 0, 0.28);
  color: #e5e7eb;
}

[data-theme="dark"] .bookmark-root-toggle.active {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.18);
  color: #f3f4f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] #toggle-sidebar:hover,
[data-theme="dark"] #toggle-plugin-bar:hover,
[data-theme="dark"] #theme-toggle-btn:hover,
[data-theme="dark"] .wallpaper-actions button:hover,
[data-theme="dark"] .wallpaper-actions label:hover,
[data-theme="dark"] .reset-button:hover,
[data-theme="dark"] .upload-wallpaper-label:hover,
[data-theme="dark"] .update-check-button:hover:not(:disabled),
[data-theme="dark"] #cancel-delete-button:hover,
[data-theme="dark"] .cancel-button:hover,
[data-theme="dark"] .cancel-category-button:hover,
[data-theme="dark"] .bookmarks-container:hover .scroll-indicator:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  color: var(--primary-color-light, #7BB8F0);
  border-color: rgba(255, 255, 255, 0.22) !important;
}

[data-theme="dark"] .chrome-quick-icons a:hover,
[data-theme="dark"] .settings-icon a:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] #theme-toggle-btn:hover svg {
  fill: var(--primary-color-light, #7BB8F0);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] #toggle-sidebar,
  html[data-theme="auto"] #toggle-plugin-bar,
  html[data-theme="auto"] #theme-toggle-btn,
  html[data-theme="auto"] .chrome-quick-icons,
  html[data-theme="auto"] .settings-icon,
  html[data-theme="auto"] .update-check-button,
  html[data-theme="auto"] .cancel-button,
  html[data-theme="auto"] .wallpaper-actions button,
  html[data-theme="auto"] .wallpaper-actions label {
    background: rgba(var(--glass-rgb-dark), var(--glass-opacity)) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: #e5e7eb;
  }

  html[data-theme="auto"] .chrome-quick-icons a:hover,
  html[data-theme="auto"] .settings-icon a:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--primary-color-light, #7BB8F0);
  }
}

/* AI Organize settings + preview */
.ai-organize-settings-panel {
  margin: 0.5rem 0 1.25rem;
  padding-top: 0;
  border-top: none;
}

[data-theme="dark"] .ai-organize-settings-panel {
  border-top-color: transparent;
}

.ai-organize-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

/* display:flex above would otherwise override the HTML hidden attribute */
.ai-organize-field[hidden],
.ai-organize-settings-panel [data-ai-byok-field][hidden],
.ai-organize-settings-panel [data-ai-hosted-field][hidden],
.ai-organize-settings-panel .ai-byok-hidden {
  display: none !important;
}

.ai-organize-field label {
  font-size: 13px;
  color: #4b5563;
}

[data-theme="dark"] .ai-organize-field label {
  color: #d1d5db;
}

.ai-organize-field .custom-input,
.ai-organize-select {
  width: 100%;
  max-width: 420px;
}

.ai-organize-modal-content {
  max-width: 520px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem 1.25rem;
  box-sizing: border-box;
}

.ai-organize-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.ai-organize-modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.ai-organize-close-button {
  appearance: none;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-organize-close-button:hover,
.ai-organize-close-button:focus {
  color: #111827;
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

[data-theme="dark"] .ai-organize-close-button {
  color: #9ca3af;
}

[data-theme="dark"] .ai-organize-close-button:hover,
[data-theme="dark"] .ai-organize-close-button:focus {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.08);
}

.ai-organize-preview-summary {
  margin: 0 0 0.75rem;
  color: #6b7280;
  font-size: 14px;
  flex-shrink: 0;
}

[data-theme="dark"] .ai-organize-preview-summary {
  color: #9ca3af;
}

.ai-organize-preview-list {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  max-height: none;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-recommend-modal-content {
  max-width: 520px;
}

.ai-recommend-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.ai-recommend-field label {
  font-size: 13px;
  font-weight: 500;
  color: #3a3a3c;
}

[data-theme="dark"] .ai-recommend-field label {
  color: rgba(255, 255, 255, 0.82);
}

.ai-recommend-count-field {
  max-width: none;
}

.ai-recommend-count-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.ai-recommend-count-input {
  width: 72px;
  flex: 0 0 auto;
}

.ai-recommend-count-presets {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ai-recommend-count-preset {
  appearance: none;
  min-width: 2.1rem;
  height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #3a3a3c;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.ai-recommend-count-preset:hover:not(:disabled) {
  border-color: rgba(0, 0, 0, 0.22);
  background: rgba(255, 255, 255, 0.95);
}

.ai-recommend-count-preset.is-active {
  border-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.45);
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.14);
  color: var(--primary-color, #4A9FE8);
}

.ai-recommend-count-preset:disabled {
  opacity: 0.5;
  cursor: default;
}

[data-theme="dark"] .ai-recommend-count-preset {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
}

[data-theme="dark"] .ai-recommend-count-preset:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ai-recommend-count-preset.is-active {
  border-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.55);
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.22);
  color: var(--primary-color-light, #7BB8F0);
}

.ai-recommend-status {
  margin: 0 0 0.85rem;
  font-size: 13px;
  color: #52525b;
}

.ai-recommend-status.is-error {
  color: #b42318;
}

[data-theme="dark"] .ai-recommend-status {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .ai-recommend-status.is-error {
  color: #f97066;
}

.ai-recommend-list {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  max-height: 360px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-recommend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

[data-theme="dark"] .ai-recommend-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.ai-recommend-item-check {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.ai-recommend-item-body {
  min-width: 0;
  flex: 1;
}

.ai-recommend-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.3;
}

.ai-recommend-item-meta {
  margin-top: 0.15rem;
  font-size: 12px;
  color: #71717a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-recommend-item-reason {
  margin-top: 0.25rem;
  font-size: 12px;
  color: #52525b;
  line-height: 1.35;
}

[data-theme="dark"] .ai-recommend-item-title {
  color: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .ai-recommend-item-meta,
[data-theme="dark"] .ai-recommend-item-reason {
  color: rgba(255, 255, 255, 0.6);
}

.ai-introduce-modal-content {
  max-width: 600px;
}

.ai-introduce-site-meta {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.1),
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.04)
  );
  border: 1px solid rgba(var(--primary-color-rgb, 74, 159, 232), 0.16);
}

.ai-introduce-site-title {
  font-size: 15px;
  font-weight: 600;
  color: #18181b;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.ai-introduce-site-url {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--primary-color, #4A9FE8);
  text-decoration: none;
  word-break: break-all;
  opacity: 0.92;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.ai-introduce-site-url:hover {
  color: var(--primary-color-light, #7BB8F0);
  opacity: 1;
  text-decoration: underline;
}

.ai-introduce-body {
  position: relative;
  min-height: 160px;
}

.ai-introduce-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 160px;
  padding: 18px 12px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-introduce-loading[hidden],
.ai-introduce-content[hidden] {
  display: none !important;
}

.ai-introduce-loading-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ai-introduce-orb {
  position: relative;
  width: 52px;
  height: 52px;
}

.ai-introduce-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--primary-color, #4A9FE8);
  border-right-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.35);
  animation: ai-introduce-spin 1.1s linear infinite;
}

.ai-introduce-orb-ring:nth-child(2) {
  inset: 7px;
  border-top-color: var(--primary-color-light, #7BB8F0);
  border-right-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.22);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.ai-introduce-orb-core {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff 0%,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.18) 48%,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.42) 100%
  );
  box-shadow: 0 0 14px rgba(var(--primary-color-rgb, 74, 159, 232), 0.35);
  animation: ai-introduce-pulse 1.4s ease-in-out infinite;
}

.ai-introduce-loading-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: #52525b;
  text-align: center;
  min-height: 1.35em;
}

.ai-introduce-loading-text::after {
  content: '';
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: ai-introduce-ellipsis 1.2s steps(4, end) infinite;
}

.ai-introduce-skeleton {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.ai-introduce-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.06) 0%,
    rgba(0, 0, 0, 0.1) 45%,
    rgba(0, 0, 0, 0.06) 90%
  );
  background-size: 200% 100%;
  animation: ai-introduce-shimmer 1.35s ease-in-out infinite;
}

.ai-introduce-skeleton-line:nth-child(2) {
  animation-delay: 0.12s;
}

.ai-introduce-skeleton-line:nth-child(3) {
  animation-delay: 0.24s;
}

.ai-introduce-skeleton-line.is-short {
  width: 62%;
  animation-delay: 0.36s;
}

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

@keyframes ai-introduce-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1); opacity: 1; }
}

@keyframes ai-introduce-ellipsis {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

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

.ai-introduce-content {
  min-height: 140px;
  max-height: 380px;
  overflow: auto;
  padding: 18px 20px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.96) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 10px 28px rgba(15, 23, 42, 0.05);
  font-size: 14.5px;
  line-height: 1.72;
  color: #334155;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

.ai-introduce-content::-webkit-scrollbar {
  width: 8px;
}

.ai-introduce-content::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.ai-introduce-content::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.42);
  background-clip: padding-box;
}

/* Shared markdown body (AI intro + plugin notes preview) */
.ai-introduce-content.markdown-body > p:first-child {
  margin-top: 0;
  font-size: 15px;
  color: #1e293b;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.15em 0 0.5em;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body h1 {
  font-size: 1.35rem;
  background: linear-gradient(
    135deg,
    var(--primary-color, #4A9FE8) 0%,
    var(--primary-color-light, #7BB8F0) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.markdown-body h2 {
  font-size: 1.12rem;
  padding-bottom: 0.35em;
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 74, 159, 232), 0.2);
}

.markdown-body h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.markdown-body h3::before {
  content: '';
  width: 3px;
  height: 0.95em;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    var(--primary-color, #4A9FE8),
    var(--primary-color-light, #7BB8F0)
  );
  flex-shrink: 0;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: 0.95rem;
  color: #334155;
}

.markdown-body p {
  margin: 0.55em 0;
}

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

.markdown-body p:has(+ ul),
.markdown-body p:has(+ blockquote) {
  margin-bottom: 0.3em;
}

.markdown-body ul + p,
.markdown-body blockquote + p {
  margin-top: 0.3em;
}

.markdown-body ul {
  margin: 0.3em 0 0.4em;
  padding: 0;
  list-style: none;
}

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

.markdown-body ul:last-child {
  margin-bottom: 0;
}

.markdown-body li {
  position: relative;
  margin: 0.16em 0;
  padding: 0.05em 0 0.05em 1.35rem;
  color: #475569;
}

.markdown-body li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color, #4A9FE8) 0%,
    var(--primary-color-light, #7BB8F0) 100%
  );
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb, 74, 159, 232), 0.12);
}

.markdown-body li strong {
  color: #1e293b;
}

.markdown-body em {
  font-style: italic;
  color: #64748b;
}

.markdown-body blockquote {
  margin: 0.35em 0;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid rgba(var(--primary-color-rgb, 74, 159, 232), 0.55);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(
    90deg,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.1),
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.02)
  );
  color: #475569;
  font-size: 0.96em;
  line-height: 1.6;
}

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

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

.markdown-body code {
  padding: 0.14em 0.42em;
  border-radius: 6px;
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.1);
  border: 1px solid rgba(var(--primary-color-rgb, 74, 159, 232), 0.16);
  color: var(--primary-color, #4A9FE8);
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.markdown-body pre {
  margin: 0.85em 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.12);
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.markdown-body pre code {
  padding: 0;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.84em;
  line-height: 1.6;
}

.markdown-body a {
  color: var(--primary-color, #4A9FE8);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--primary-color-rgb, 74, 159, 232), 0.28);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.markdown-body a:hover {
  color: var(--primary-color-light, #7BB8F0);
  border-bottom-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.45);
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.08);
}

.markdown-body strong {
  font-weight: 600;
  color: #0f172a;
}

[data-theme="dark"] .ai-introduce-loading {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .ai-introduce-orb-core {
  background: radial-gradient(
    circle at 35% 30%,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.55) 52%,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.85) 100%
  );
  box-shadow: 0 0 16px rgba(var(--primary-color-rgb, 74, 159, 232), 0.45);
}

[data-theme="dark"] .ai-introduce-loading-text {
  color: rgba(255, 255, 255, 0.72);
}

[data-theme="dark"] .ai-introduce-skeleton-line {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.14) 45%,
    rgba(255, 255, 255, 0.06) 90%
  );
  background-size: 200% 100%;
}

.ai-introduce-content.is-loading {
  color: #a1a1aa;
  font-style: italic;
}

.ai-introduce-status {
  margin-top: 10px;
  font-size: 13px;
  color: #52525b;
}

.ai-introduce-status.is-error {
  color: #dc2626;
}

[data-theme="dark"] .ai-introduce-site-title {
  color: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] .ai-introduce-site-meta {
  background: linear-gradient(
    135deg,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.18),
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.08)
  );
  border-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.24);
}

[data-theme="dark"] .ai-introduce-site-url {
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .ai-introduce-site-url:hover {
  color: var(--primary-color, #4A9FE8);
}

[data-theme="dark"] .ai-introduce-content {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 32px rgba(0, 0, 0, 0.28);
  color: rgba(226, 232, 240, 0.9);
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

[data-theme="dark"] .ai-introduce-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.32);
  background-clip: padding-box;
}

[data-theme="dark"] .ai-introduce-content.markdown-body > p:first-child {
  color: rgba(248, 250, 252, 0.95);
}

[data-theme="dark"] .markdown-body h1,
[data-theme="dark"] .markdown-body h2,
[data-theme="dark"] .markdown-body h3,
[data-theme="dark"] .markdown-body h4,
[data-theme="dark"] .markdown-body h5,
[data-theme="dark"] .markdown-body h6,
[data-theme="dark"] .markdown-body strong {
  color: rgba(255, 255, 255, 0.94);
}

[data-theme="dark"] .markdown-body h1 {
  background: linear-gradient(
    135deg,
    var(--primary-color-light, #7BB8F0) 0%,
    var(--primary-color, #4A9FE8) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .markdown-body h2 {
  border-bottom-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.28);
}

[data-theme="dark"] .markdown-body h4,
[data-theme="dark"] .markdown-body h5,
[data-theme="dark"] .markdown-body h6 {
  color: rgba(226, 232, 240, 0.88);
}

[data-theme="dark"] .markdown-body li {
  color: rgba(203, 213, 225, 0.92);
}

[data-theme="dark"] .markdown-body li strong {
  color: rgba(248, 250, 252, 0.95);
}

[data-theme="dark"] .markdown-body em {
  color: rgba(148, 163, 184, 0.95);
}

[data-theme="dark"] .markdown-body blockquote {
  border-left-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.65);
  background: linear-gradient(
    90deg,
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.16),
    rgba(var(--primary-color-rgb, 74, 159, 232), 0.04)
  );
  color: rgba(203, 213, 225, 0.92);
}

[data-theme="dark"] .markdown-body code {
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.18);
  border-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.24);
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .markdown-body pre {
  background: #020617;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .markdown-body pre code {
  color: #e2e8f0;
}

[data-theme="dark"] .markdown-body a {
  color: var(--primary-color-light, #7BB8F0);
  border-bottom-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.35);
}

[data-theme="dark"] .markdown-body a:hover {
  color: var(--primary-color, #4A9FE8);
  border-bottom-color: rgba(var(--primary-color-rgb, 74, 159, 232), 0.5);
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.14);
}

[data-theme="dark"] .ai-introduce-content.is-loading {
  color: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .ai-introduce-status {
  color: rgba(255, 255, 255, 0.65);
}

[data-theme="dark"] .ai-introduce-status.is-error {
  color: #f87171;
}

.ai-organize-category {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .ai-organize-category {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.ai-organize-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 14px;
}

.ai-organize-category-header span {
  flex-shrink: 0;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(var(--primary-color-rgb, 74, 159, 232), 0.15);
  color: var(--primary-color, #4A9FE8);
  font-size: 12px;
  font-weight: 600;
}

.ai-organize-category-titles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
}

.ai-organize-category-title-item {
  margin: 0;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.ai-organize-category-title-more {
  margin: 0.15rem 0 0;
  padding: 0;
  color: #9ca3af;
  font-style: italic;
}

[data-theme="dark"] .ai-organize-category-titles {
  color: #9ca3af;
}

[data-theme="dark"] .ai-organize-category-title-more {
  color: #6b7280;
}

.ai-organize-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.25rem;
}

.ai-organize-modal-actions .cancel-button,
.ai-organize-modal-actions .ai-organize-apply-button {
  min-width: 88px;
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.ai-organize-apply-button {
  appearance: none;
  border: none;
  background: var(--primary-color, #4A9FE8);
  color: #fff;
}

/* Account / membership settings */
.account-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.75rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* display:flex above would otherwise override the hidden attribute */
.account-card[hidden] {
  display: none !important;
}

.account-settings-skeleton[hidden],
.account-settings-body[hidden] {
  display: none !important;
}

.account-settings-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.account-skeleton-promo {
  width: 100%;
  height: 2.6rem;
  border-radius: 12px;
}

.account-skeleton-plans {
  margin-top: 0;
  /* Avoid real plan-card subgrid (span 4 / 1fr) which stretches skeleton incorrectly */
  grid-template-rows: none;
  align-items: stretch;
}

.account-skeleton-plan {
  display: flex;
  flex-direction: column;
  grid-row: auto;
  grid-template-rows: none;
  gap: 0.75rem;
  pointer-events: none;
  min-height: 0;
}

.account-skeleton-plan-top,
.account-skeleton-quota,
.account-skeleton-features {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.account-skeleton-plan-top {
  gap: 0.55rem;
}

.account-skeleton-bone {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.06) 0%,
    rgba(15, 23, 42, 0.12) 50%,
    rgba(15, 23, 42, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: account-skeleton-shimmer 1.35s ease-in-out infinite;
}

.account-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex-shrink: 0;
}

.account-skeleton-badge {
  width: 52px;
  height: 22px;
  border-radius: 999px;
  flex-shrink: 0;
}

.account-skeleton-line {
  height: 12px;
  width: 100%;
}

.account-skeleton-line-sm {
  width: 42%;
}

.account-skeleton-line-md {
  width: 64%;
}

.account-skeleton-line-lg {
  width: 78%;
  height: 14px;
}

.account-skeleton-billing {
  width: 9.5rem;
  height: 1.85rem;
  border-radius: 999px;
}

.account-skeleton-price {
  width: 56%;
  height: 28px;
  margin: 0.05rem 0;
}

.account-skeleton-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
}

.account-skeleton-button {
  width: 118px;
  height: 36px;
  border-radius: 10px;
}

.account-skeleton-button-block {
  width: 100%;
  margin-top: 0.1rem;
}

.account-skeleton-plan-top .account-skeleton-button-block {
  margin-top: 0.35rem;
}

.account-user-meta .account-skeleton-line + .account-skeleton-line {
  margin-top: 0.35rem;
}

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

[data-theme="dark"] .account-skeleton-bone {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
}

.account-signed-out-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.account-signed-out-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.account-user-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: #e5e7eb;
  flex-shrink: 0;
}

.account-user-meta {
  flex: 1;
  min-width: 0;
}

.account-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #111827;
}

.account-user-email {
  font-size: 0.8rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.account-plan-badge.free {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.account-plan-badge.pro {
  background: rgba(var(--primary-color-rgb), 0.16);
  color: var(--primary-color, #4A9FE8);
}

.account-plan-pricing {
  margin: 0 0 0.85rem;
  padding: 0 0 0.85rem;
  border: none;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.account-plans {
  display: grid;
  grid-template-columns: repeat(var(--account-plan-count, 2), minmax(0, 1fr));
  grid-template-rows: auto auto 1fr auto;
  gap: 0.75rem;
  margin-top: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: clip;
}

.account-plan-column {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  gap: 0.75rem;
  padding: 1rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.45);
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.account-plan-column-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-self: stretch;
  min-width: 0;
  height: 100%;
}

.account-plan-column-top .account-plan-upgrade-button {
  margin-top: auto;
}

.account-plan-column > * {
  min-width: 0;
  max-width: 100%;
}

.account-plan-column.is-pro,
.account-plan-column.is-premium {
  border-color: rgba(var(--primary-color-rgb), 0.28);
  background: rgba(var(--primary-color-rgb), 0.06);
}

.account-plan-column.is-premium {
  border-color: rgba(var(--primary-color-rgb), 0.42);
  background: rgba(var(--primary-color-rgb), 0.1);
}

.account-plan-column.is-current {
  box-shadow: inset 0 0 0 1px rgba(var(--primary-color-rgb), 0.35);
}

.account-plan-column-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.account-plan-column-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.account-plan-billing-slot {
  display: flex;
  align-items: center;
  min-height: 2.15rem;
  margin: 0.35rem 0 0.15rem;
}

.account-billing-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  width: fit-content;
  max-width: 100%;
}

.account-billing-option {
  appearance: none;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}

.account-billing-option.is-active {
  background: #fff;
  color: var(--primary-color, #4A9FE8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.account-plan-billing-static {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
}

.account-plan-price-slot {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.28rem;
  min-height: 1.5rem;
}

.account-plan-column-price {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.account-plan-price-unit {
  font-size: 0.92rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: -0.01em;
}

.account-plan-column-period {
  margin: 0;
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #6b7280;
  min-height: 1.25rem;
  max-width: 100%;
}

.account-plan-savings {
  margin: 0.15rem 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.2rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #6b7280;
}

.account-plan-savings strong {
  font-weight: 700;
  color: #111827;
}

.account-plan-billing-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b7280;
  cursor: help;
  vertical-align: -0.12em;
  line-height: 0;
}

.account-plan-billing-info svg {
  width: 0.95rem;
  height: 0.95rem;
}

.account-plan-billing-info:hover,
.account-plan-billing-info:focus-visible {
  color: #0f766e;
  outline: none;
}

.account-plan-billing-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35rem);
  transform: translateX(-50%);
  z-index: 5;
  width: max-content;
  max-width: min(13.5rem, calc(100vw - 2rem));
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.account-plan-billing-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #111827;
}

.account-plan-billing-info:hover .account-plan-billing-tooltip,
.account-plan-billing-info:focus-visible .account-plan-billing-tooltip {
  opacity: 1;
  visibility: visible;
}

.account-plan-column .account-plan-price-row {
  margin-top: 0.1rem;
}

.account-plan-column-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 0;
  align-self: stretch;
}

.account-plan-column-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  padding: 0.12rem 0;
  border-radius: 0;
  background: transparent;
  color: #111827;
  font-size: 0.8rem;
  line-height: 1.35;
}

.account-plan-column-features li::before {
  content: none;
  display: none;
}

.account-plan-feature-mark {
  flex: 0 0 auto;
  width: 0.85rem;
  margin-top: 0.05rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: #111827;
}

.account-plan-feature-text {
  flex: 1 1 auto;
  min-width: 0;
}

.account-plan-column-features li.is-on {
  color: #111827;
  opacity: 1;
}

.account-plan-column-features li.is-on .account-plan-feature-mark {
  color: #111827;
}

.account-plan-column-features li.is-off {
  color: #9ca3af;
  opacity: 1;
}

.account-plan-column-features li.is-off .account-plan-feature-mark {
  color: #9ca3af;
  font-weight: 600;
}

.account-plan-column-features li.is-includes {
  font-weight: 600;
  color: #1f2937;
  background: transparent;
}

.account-plan-column-features li.is-muted {
  opacity: 0.72;
  font-style: italic;
  padding-left: 0;
}

.account-plan-ai-quota {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-self: stretch;
}

.account-plan-ai-quota-row {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.account-plan-ai-quota-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
}

.account-plan-ai-quota-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4b5563;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-plan-ai-quota-meta {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.account-plan-ai-quota-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.account-plan-ai-quota-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--primary-color, #4A9FE8);
  transition: width 0.25s ease;
}

.account-plan-ai-quota-row.is-capacity .account-plan-ai-quota-fill {
  background: rgba(var(--primary-color-rgb), 0.28);
}

.account-plan-ai-quota-row.is-none .account-plan-ai-quota-label {
  color: #9ca3af;
  font-weight: 500;
}

.account-plan-ai-quota-row.is-none .account-plan-ai-quota-meta {
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
}

.account-plan-ai-quota-row.is-none .account-plan-ai-quota-track {
  background: rgba(15, 23, 42, 0.04);
}

.account-plan-ai-quota-row.is-none .account-plan-ai-quota-fill {
  background: transparent;
}

.account-plan-ai-quota-row.is-warning .account-plan-ai-quota-fill {
  background: #f59e0b;
}

.account-plan-ai-quota-row.is-exhausted .account-plan-ai-quota-fill {
  background: #ef4444;
}

.account-plan-upgrade-button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
  margin-top: auto;
  white-space: normal;
  text-align: center;
  box-sizing: border-box;
}

.account-plan-upgrade-button:disabled {
  opacity: 0.72;
  cursor: default;
  filter: none;
}

.account-plan-upgrade-button.is-free-upgrade:disabled {
  background: rgba(15, 23, 42, 0.08);
  color: #9ca3af;
  opacity: 1;
  box-shadow: none;
}

[data-theme="dark"] .account-plan-upgrade-button.is-free-upgrade:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: #6b7280;
}

@media (max-width: 640px) {
  .account-plans {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .account-plan-column {
    grid-row: auto;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
  }
}

.account-plan-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.65rem;
}

.account-plan-price {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: inherit;
}

.account-plan-compare-price {
  font-size: 0.9rem;
  color: #6b7280;
  text-decoration: line-through;
}

.account-plan-column.is-promo .account-plan-column-price {
  color: #0f8a74;
}

.account-plan-discount {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 138, 116, 0.14);
  color: #0f8a74;
}

.account-promo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 138, 116, 0.28);
  background:
    linear-gradient(135deg, rgba(15, 138, 116, 0.12), rgba(15, 138, 116, 0.04)),
    #f7fbfa;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.account-promo-banner[hidden] {
  display: none !important;
}

.account-promo-banner-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  text-align: center;
}

.account-promo-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f5f52;
}

.account-promo-countdown {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #0b7a66;
  font-variant-numeric: tabular-nums;
}

.account-plan-product-name {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.account-status-text {
  margin: 0;
  font-size: 0.86rem;
  color: #4b5563;
  line-height: 1.45;
}

.account-activation-modal-content {
  max-width: 420px;
  width: calc(100% - 2rem);
}

/* Above settings overlay (1002) and settings sidebar (1003) */
#account-activation-dialog.modal {
  z-index: 1100;
}

.account-activation-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.account-activation-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.account-activation-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0.1rem 0.35rem;
}

.account-activation-hint {
  margin: 0 0 0.85rem;
  color: #6b7280;
  font-size: 0.88rem;
  line-height: 1.45;
}

.account-activation-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.4rem;
}

.account-activation-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.04em;
  color: inherit;
  margin-bottom: 0.75rem;
}

.account-activation-input:focus {
  outline: none;
  border-color: rgba(var(--primary-color-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.16);
}

.account-activation-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.account-primary-button,
.account-secondary-button {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 550;
  cursor: pointer;
  line-height: 1.2;
}

.account-primary-button {
  background: var(--primary-color, #4A9FE8);
  color: #fff;
}

.account-primary-button:disabled,
.account-secondary-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.account-secondary-button {
  background: rgba(15, 23, 42, 0.06);
  color: #1f2937;
}

.account-button-pulse {
  animation: account-upgrade-pulse 0.9s ease 0s 2;
}

@keyframes account-upgrade-pulse {
  0%, 100% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.03); box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.25); }
}

.account-feedback {
  margin: 0 0 1rem;
  min-height: 1.1rem;
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.4;
}

.account-feedback[hidden] {
  display: none !important;
}

.account-feedback.is-success {
  color: #3A8FD4;
}

.account-feedback.is-error {
  color: #dc2626;
}

[data-theme="dark"] .account-card,
[data-theme="dark"] .account-plan-column {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .account-plan-column.is-pro,
[data-theme="dark"] .account-plan-column.is-premium {
  background: rgba(var(--primary-color-rgb), 0.12);
  border-color: rgba(var(--primary-color-rgb), 0.35);
}

[data-theme="dark"] .account-billing-toggle {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .account-billing-option {
  color: #9ca3af;
}

[data-theme="dark"] .account-billing-option.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .account-plan-billing-static {
  background: rgba(255, 255, 255, 0.08);
  color: #9ca3af;
}

[data-theme="dark"] .account-user-name {
  color: #f3f4f6;
}

[data-theme="dark"] .account-user-email,
[data-theme="dark"] .account-status-text,
[data-theme="dark"] .account-feedback,
[data-theme="dark"] .account-plan-product-name,
[data-theme="dark"] .account-plan-compare-price,
[data-theme="dark"] .account-plan-column-period,
[data-theme="dark"] .account-plan-price-unit,
[data-theme="dark"] .account-plan-savings,
[data-theme="dark"] .account-activation-label,
[data-theme="dark"] .account-activation-hint {
  color: #9ca3af;
}

[data-theme="dark"] .account-plan-savings strong {
  color: #f3f4f6;
}

[data-theme="dark"] .account-plan-billing-info {
  color: #9ca3af;
}

[data-theme="dark"] .account-plan-billing-info:hover,
[data-theme="dark"] .account-plan-billing-info:focus-visible {
  color: #5eead4;
}

[data-theme="dark"] .account-activation-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
}

[data-theme="dark"] .account-activation-close {
  color: #9ca3af;
}

[data-theme="dark"] .account-plan-column-features li.is-on {
  color: #f3f4f6;
  background: transparent;
}

[data-theme="dark"] .account-plan-column-features li.is-on .account-plan-feature-mark {
  color: #f3f4f6;
}

[data-theme="dark"] .account-plan-column-features li.is-off {
  color: #6b7280;
  background: transparent;
}

[data-theme="dark"] .account-plan-column-features li.is-off .account-plan-feature-mark {
  color: #6b7280;
}

[data-theme="dark"] .account-plan-column-features li.is-includes {
  background: transparent;
  color: #f3f4f6;
}

[data-theme="dark"] .account-plan-column-features li {
  background: transparent;
  color: #d1d5db;
}

[data-theme="dark"] .account-plan-ai-quota-label {
  color: #d1d5db;
}

[data-theme="dark"] .account-plan-ai-quota-meta {
  color: #f3f4f6;
}

[data-theme="dark"] .account-plan-ai-quota-track {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .account-plan-ai-quota-row.is-none .account-plan-ai-quota-label,
[data-theme="dark"] .account-plan-ai-quota-row.is-none .account-plan-ai-quota-meta {
  color: #6b7280;
}

[data-theme="dark"] .account-plan-ai-quota-row.is-none .account-plan-ai-quota-track {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .account-plan-column-features li.is-includes {
  background: transparent;
  color: #f3f4f6;
}

[data-theme="dark"] .account-plan-discount {
  background: rgba(45, 212, 191, 0.16);
  color: #5eead4;
}

[data-theme="dark"] .account-promo-banner {
  border-color: rgba(45, 212, 191, 0.28);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(45, 212, 191, 0.05)),
    rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .account-promo-label {
  color: #99f6e4;
}

[data-theme="dark"] .account-promo-countdown {
  color: #5eead4;
}

[data-theme="dark"] .account-feedback.is-success {
  color: var(--primary-color-light, #7BB8F0);
}

[data-theme="dark"] .account-feedback.is-error {
  color: #f87171;
}

[data-theme="dark"] .account-secondary-button {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

.ai-organize-apply-button:hover {
  filter: brightness(1.05);
}

[data-theme="dark"] .ai-organize-modal-actions .ai-organize-apply-button {
  color: #fff;
}
