/* ======================
 * 基础样式与变量定义
 * ====================== */
:root {
  /* 颜色变量 */
  --toast-success-bg: rgba(76, 175, 80, 0.9);
  --toast-error-bg: rgba(244, 67, 54, 0.9);
  --toast-info-bg: rgba(33, 150, 243, 0.9);
  --toast-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  /* 过渡效果 */
  --transition-normal: 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  
  /* 背景相关 */
  --bg-overlay: linear-gradient(0deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.45));
  --bg-fade: 0.3s;
  --bg-spinner: 40px;
  --bg-blur: 12px;
  
  /* 快捷导航相关 */  
  --icon-size: 75px;
  --text-height: 30px;
  --row-gap: 30px;
  --col-gap: 45px;
}

/* 基础重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow: hidden;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: "Segoe UI", Segoe, Tahoma, Arial, Verdana, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-overlay);
  background-size: cover;
  background-position: 50%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: background-color var(--transition-normal);
  z-index: 0;
  transform: translateZ(0);
  backface-visibility: hidden;
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

/* ======================
 * 背景过渡效果
 * ====================== */
.bg-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: strict paint;
  transform: translateZ(0);
}

.bg-blur {
  position: absolute;
  width: 100vw;
  height: 100vh;
  inset: 0;
  background: var(--bg-overlay), var(--bg-thumbnail) center/cover;
  filter: blur(var(--bg-blur));
  opacity: 1;
  z-index: 1;
  transition: opacity var(--bg-fade) ease-out;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-blur::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--bg-spinner);
  height: var(--bg-spinner);
  margin: calc(var(--bg-spinner)/-2) 0 0 calc(var(--bg-spinner)/-2);
  border: 3px solid transparent;
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: bg-spin 0.8s linear infinite;
  opacity: 0;
  transition: opacity 0.15s;
}

.bg-sharp {
  position: absolute;
  inset: 0;
  background: var(--bg-image) center/cover;
  opacity: 0;
  z-index: 2;
  transition: opacity var(--bg-fade) ease-in;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.bg-loading .bg-blur::after {
  opacity: 1;
}

body.bg-loaded .bg-blur {
  opacity: 0;
}

body.bg-loaded .bg-sharp {
  opacity: 1;
}

@keyframes bg-spin {
  to {
    transform: translate(-50%, -50%) rotate(1turn);
  }
}

/* ======================
 * 遮罩层与菜单
 * ====================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  visibility: hidden;
}

/* ======================
 * 图标样式
 * ====================== */
svg.icon {
  width: 16px;
  height: 16px;
  margin: 0 5px 0 8px;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  pointer-events: none;
}

.list .title .icon {
  width: 18px;
  height: 18px;
}

/* 顶部控制栏 */
.top-controls {
  position: fixed;
  top: 15px;
  left: 10px;
  z-index: 900;
  display: flex;
  align-items: center;
}

/* ======================
 * 透明菜单按钮样式
 * ====================== */
#menu {
  position: fixed;
  width: 40px;
  height: 40px;
  right: 10px;
  top: 10px;
  z-index: 1100;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  pointer-events: auto;
}

#menu .icon {
  width: 24px;
  height: 24px;
  color: #fff;
  transition: all 0.3s ease;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

#menu:hover .icon {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

#menu:active .icon {
  transform: scale(0.95);
}

#menu[aria-expanded="true"] {
  right: 430px;
  transform: translateX(0);
}

#menu[aria-expanded="true"] .icon {
  color: #fff;
  transform: rotate(180deg);
}

/* ======================
 * 侧边面板样式
 * ====================== */
.side-panel {
  width: 420px;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
}

.side-panel[aria-expanded="true"] {
  transform: translateX(0);
}

/* ===== 标签页容器 ===== */
.panel-tabs {
  display: flex;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(74, 0, 255, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ===== 单个标签项 ===== */
.panel-tab {
  flex: 1;
  min-width: 0;
  padding: 16px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  color: #666; /* 默认文字和图标颜色 */
  transition: all 0.2s ease;
}

/* ===== 图标容器 ===== */
.tab-icon-wrapper {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
}

/* ===== SVG图标样式 ===== */
.tab-icon {
  width: 25px;
  height: 25px;
  fill: currentColor; /* 关键属性：继承文字颜色 */
  transition: inherit;
}

/* ===== 文字标签 ===== */
.tab-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  transition: inherit;
}

/* ===== 激活状态 ===== */
.panel-tab.active {
  color: #4a00ff; /* 同时改变文字和图标颜色 */
}

.panel-tab.active .tab-icon {
  transform: translateY(-2px);
}

.panel-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 25%;
  right: 25%;
  height: 3px;
  background: currentColor;
  border-radius: 3px 3px 0 0;
  animation: tab-active 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== 悬停效果 ===== */
.panel-tab:hover:not(.active) {
  color: #333;
}

.panel-tab:hover:not(.active) .tab-icon {
  transform: translateY(-1px);
}

/* ===== 点击反馈 ===== */
.panel-tab:active {
  transform: scale(0.98);
}

/* ===== 动画定义 ===== */
@keyframes tab-active {
  from {
    transform: scaleX(0.5);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* ===== 暗黑模式 ===== */
@media (prefers-color-scheme: dark) {
  .panel-tabs {
    background: rgba(30, 30, 40, 0.98);
    border-bottom-color: rgba(179, 136, 255, 0.1);
  }
  
  .panel-tab {
    color: rgba(255, 255, 255, 0.7);
  }
  
  .panel-tab.active {
    color: #b388ff;
  }
  
  .panel-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.9);
  }
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .panel-tabs {
    padding: 0 12px;
  }
  
  .panel-tab {
    padding: 14px 0 12px;
  }
  
  .tab-icon-wrapper {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
  }
  
  .tab-icon {
    width: 18px;
    height: 18px;
  }
  
  .tab-text {
    font-size: 12px;
  }
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  scrollbar-width: thin;
  scrollbar-color: #d1c4e9 transparent;
}

.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-thumb {
  background-color: #d1c4e9;
  border-radius: 3px;
}

.tab-content {
  display: none;
  height: 100%;
}

.tab-content.active {
  display: block;
}

/* ======================
 * 导航分类样式优化
 * ====================== */
.nav-category {
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 分类标题图标样式 */
.category-title {
  display: flex;
  align-items: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #4a00ff;
  margin-bottom: 12px;
  background: rgba(74, 0, 255, 0.05);
  border-radius: 8px;
}

.category-title .icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  color: #4a00ff;
}

.category-title img.category-icon {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  object-fit: contain;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
  .category-title {
    color: #b388ff;
    background: rgba(179, 136, 255, 0.1);
  }
  
  .category-title .icon {
    color: #b388ff;
  }
}

/* ======================
 * 导航项样式优化
 * ====================== */
.nav-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-item:hover {
  background: rgba(74, 0, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 0, 255, 0.1);
}

.nav-item-icon {
  width: 32px;
  height: 32px;
  margin-right: 12px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-item-info {
  flex: 1;
  min-width: 0;
}

.nav-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.nav-item-desc {
  font-size: 12px;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.nav-item-action {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: #4a00ff;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 10px;
  flex-shrink: 0;
}

.nav-item-action:hover {
  background: #3a00cf;
}

.nav-item-action.remove {
  background: #ff4757;
}

.nav-item-action.remove:hover {
  background: #e63946;
}

/* ======================
 * 暗黑模式适配
 * ====================== */
@media (prefers-color-scheme: dark) {
  .nav-category {
    background: rgba(30, 30, 40, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .category-title {
    color: #b388ff;
    background: rgba(179, 136, 255, 0.1);
  }
  
  .nav-item {
    background: rgba(40, 40, 50, 0.9);
    border-color: rgba(179, 136, 255, 0.1);
  }
  
  .nav-item-name {
    color: #e0e0e0;
  }
  
  .nav-item-desc {
    color: #aaa;
  }
  
  .nav-item-action {
    background: #b388ff;
  }
  
  .nav-item-action:hover {
    background: #9c64ff;
  }
  
  .nav-item-action.remove {
    background: #ff6b6b;
  }
  
  .nav-item-action.remove:hover {
    background: #ff4757;
  }
}

/* ======================
 * 移动端适配
 * ====================== */
@media (max-width: 768px) {
  .nav-items {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .nav-item {
    padding: 8px;
  }
  
  .nav-item-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
  }
}

/* ======================
 * 搜索框优化
 * ====================== */
/* 搜索框容器 */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

/* 搜索输入框 */
.nav-search-input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-search-input:focus {
  border-color: #4a00ff;
  box-shadow: 0 0 0 3px rgba(74, 0, 255, 0.1);
}

/* 搜索图标 */
.nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

/* 清除按钮 */
.nav-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s;
  display: none; /* 默认隐藏 */
}

.nav-search-clear:hover {
  opacity: 1;
}

.nav-search-clear .icon {
  width: 16px;
  height: 16px;
  color: #666;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
  .nav-search-input {
    background: rgba(30, 30, 40, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
  }
  
  .nav-search-icon {
    color: rgba(255, 255, 255, 0.6);
  }
  
  .nav-search-clear .icon {
    color: rgba(255, 255, 255, 0.6);
  }
}

/* 无结果提示 */
.no-results {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 14px;
  display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .nav-search-input {
    padding: 10px 15px 10px 36px;
    font-size: 13px;
  }
  
  .nav-search-icon {
    left: 12px;
    width: 14px;
    height: 14px;
  }
  
  .nav-search-clear {
    right: 10px;
    padding: 3px;
  }
}

/* ======================
 * 快捷站点导航链接
 * ====================== */
.quick-links-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: visible;  /* 改为 visible，避免内容被裁剪 */
    padding-bottom: 0px;  /* 为分页指示器预留空间 */
    position: relative;  /* 为分页容器提供定位基准 */
    overflow: visible;  /* 避免内容被裁剪 */
    min-height: calc(2 * var(--icon-size) + 2 * var(--text-height) + 2 * var(--row-gap) + 60px);
}

.quick-links {
    width: 100%;
    max-width: min(1200px, 95vw);
    margin: 50px 0;  /* 调整上下边距 */
    padding: 0 20px;
    overflow: visible;  /* 避免内容被裁剪 */
    min-height: 200px;  /* 确保内容区域有足够高度 */
}

.quick-links-grid {
    --icon-size: 75px;
    --icon-radius: 18px;
    display: grid;
    padding: 10px;
    grid-template-columns: repeat(auto-fill, var(--icon-size));
    gap: var(--row-gap) var(--col-gap);
    /* 关键：强制每页至少渲染2行（即使项目不足） */
    grid-auto-rows: calc(var(--icon-size) + var(--text-height));
    min-height: calc(2 * (var(--icon-size) + var(--text-height) + var(--row-gap)));
}

.quick-link-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform, opacity;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-decoration: none;
    will-change: transform, opacity;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.quick-icon {
    --icon-size: 75px;
    --icon-radius: 18px;
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: var(--icon-radius);
    background: 
        var(--icon-bg, 
            linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)
        ) center/cover;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, box-shadow;
}

/* 交互状态 */
.quick-link:hover {
    transform: scale(1.05);
}
.quick-link:hover .quick-icon {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px rgba(74, 0, 255, 0.3), 
                0 6px 20px rgba(74, 0, 255, 0.2);
    filter: brightness(1.05);
}
.quick-link:active .quick-icon {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

/* 文字样式 */
.quick-link-text {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

/* 特殊状态 */
.quick-icon.error {
    background: var(--fallback-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.quick-icon.error::before {
    content: attr(data-fallback);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 20px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.loading-spinner,
.quick-links-error {
    grid-column: 1 / -1;
    text-align: center;
    margin: 20px auto;
}
.loading-spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.quick-links-error {
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}
.quick-links-error svg {
    width: 40px; height: 40px;
    margin-bottom: 10px;
    fill: currentColor;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    .quick-icon:not(.loaded):not(.error) {
        background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    }
    .quick-link:hover .quick-icon {
        box-shadow: 0 0 0 3px rgba(179, 136, 255, 0.4),
                    0 6px 20px rgba(179, 136, 255, 0.3);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .quick-links {
        max-width: 100vw;
        padding: 0 10px;
        justify-content: flex-start;
    }
    .quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
/* ======================
 * 快捷链接移除按钮样式
 * ====================== */
.quick-link-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    padding: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0;
}

.quick-link-remove .icon {
    margin:4px;
}

.removal-mode .quick-link-remove {
    opacity: 1;
    transform: scale(1);
}

.quick-link-remove:hover {
    background: #fff;
    transform: scale(1.1);
}

.quick-link-remove:active {
    transform: scale(1.1);
}

/* 移除模式下的样式 */
.removal-mode .quick-link {
    transform: scale(0.95);
    filter: brightness(0.9);
    transition: all 0.3s ease;
}

.removal-mode .quick-link:hover {
    transform: scale(0.97);
    cursor: default;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .quick-link-remove {
        border-color: #2d3436;
    }
}

/* 分页容器样式 */
.pagination-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 分页指示器样式 */
.pagination-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    pointer-events: auto;  /* 恢复点击事件 */
}

.page-dot {
    width: 10px;
    height: 10px;
	margin: 0px 3px;
    border-radius: 50%;
    background: rgba(74, 0, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-dot:hover {
    background: rgba(74, 0, 255, 0.8);
}

.page-dot.active {
    width: 12px;
    height: 12px;
    background: #4a00ff;
    transform: scale(1.2);
}

.quick-links-grid.no-pagination {
    overflow: visible;
    height: auto;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    .pagination-indicator {
        background: rgba(30, 30, 40, 0.7);
    }
    
    .page-dot {
        background: rgba(179, 136, 255, 0.2);
    }
    
    .page-dot:hover {
        background: rgba(179, 136, 255, 0.4);
    }
    
    .page-dot.active {
        background: #b388ff;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .pagination-container {
        bottom: -20px;
    }
    
    .quick-links {
        padding: 0 10px;
        margin: 30px 0;
    }
}

/* ======================
 *  SortableJS 拖拽样式优化版
 * ====================== */
/* 基础拖拽状态 */
.quick-link-dragging {
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

/* 拖拽占位符 */
.sortable-ghost {
  opacity: 0.3;
}

/* 插入位置指示线 */
.sortable-insert-marker {
  position: relative;
}

.sortable-insert-marker::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 2px;
  background: #4a00ff;
  opacity: 0;
  transition: opacity 0.1s;
}

.sortable-insert-highlight::before {
  opacity: 1;
}

/* 拖拽手柄样式 */
.quick-icon {
  cursor: grab;
}

.quick-link-dragging .quick-icon {
  cursor: grabbing;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .sortable-insert-marker::before {
    background: #b388ff;
  }
  
  .quick-link-dragging {
    box-shadow: 0 2px 8px rgba(179, 136, 255, 0.2);
  }
}

/* 禁用拖拽时的过渡（添加到JS控制的class） */
.quick-links-grid.no-transition .quick-link {
  transition: none !important;
}

/* ======================
 *  快捷站点导航设置
 * ====================== */
.quick-links-settings {
    margin-top: 1.5rem;
}

.quick-links-controls {
    display: grid;
    gap: 1.5rem;
}

.control-group {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(74, 0, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(74, 0, 255, 0.1);
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a00ff;
    margin-bottom: 0.25rem;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  visibility: hidden;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
  pointer-events: none;
}

.slider-control {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    align-items: center;
    gap: 0.75rem;
}

.slider-control span:first-child {
    font-size: 0.8125rem;
    color: #666;
}

.slider-control input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4a00ff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.slider-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #3a00cf;
}

.slider-value {
    font-size: 0.8125rem;
    color: #4a00ff;
    font-weight: 500;
    text-align: right;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .control-group {
        background: rgba(179, 136, 255, 0.05);
        border-color: rgba(179, 136, 255, 0.1);
    }
    
    .control-group label {
        color: #b388ff;
    }
    
    .slider-control input[type="range"] {
        background: #555;
    }
    
    .slider-control input[type="range"]::-webkit-slider-thumb {
        background: #b388ff;
    }
    
    .slider-value {
        color: #b388ff;
    }
}

/* ======================
 * 搜索引擎切换器
 * ====================== */
.engine-switcher {
  display: flex;
  gap: 8px;
  border-radius: 4px;
  backdrop-filter: blur(5px);
}

.engine-switcher button {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.engine-switcher button.active {
  background: #4a00ff;
}

.engine-switcher button:hover {
  opacity: 0.8;
}

/* ======================
 * 背景页
 * ====================== */
 /* 今日背景预览样式 */
.today-bg-preview {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.today-bg-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.today-bg-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block; /* 确保图片正确显示 */
}

.today-bg-preview:hover img {
    filter: brightness(0.7);
}

.today-bg-preview .preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
    background: rgba(0, 0, 0, 0.3);
}

.today-bg-preview:hover .preview-overlay {
    opacity: 1;
}

.today-bg-preview .preview-overlay .preview-action {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.today-bg-preview:hover .preview-overlay .preview-action {
    background: rgba(255, 255, 255, 0.3);
}

.today-bg-preview .download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1; /* 改为始终显示 */
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    color: white;
    z-index: 2; /* 确保在预览层上方 */
}

.today-bg-preview .download-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* 保持更换背景按钮的悬停效果 */
.today-bg-preview .preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.today-bg-preview:hover .preview-overlay {
    opacity: 1;
}

/* 背景模态框样式 */
.bg-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.bg-modal.active {
    opacity: 1;
    visibility: visible;
}

.bg-modal-content {
    width: 80%;
    max-width: 800px;
    max-height: 63vh;
    min-height: 63vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.bg-modal.active .bg-modal-content {
    transform: translateY(0);
}


.bg-modal-header {
    padding: 10px 20px;
    background: #4a00ff;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.bg-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.bg-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.bg-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 允许内容区域收缩 */
  overflow: hidden; /* 隐藏内部溢出 */
}

.bg-content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 16px;
  
}

.bg-controls {
    padding: 16px;
    background: white;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bg-controls button {
    padding: 8px 12px;
    background: rgba(74, 0, 255, 0.1);
    color: #4a00ff;
    border: 1px solid rgba(74, 0, 255, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bg-controls button:hover {
    background: rgba(74, 0, 255, 0.2);
}

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

.bg-favorites {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(145px, auto); /* 设置最小行高 */
  gap: 12px;
  padding: 16px;
  overflow-y: auto; /* 单独滚动 */
  scrollbar-width: thin;
  scrollbar-color: #d1c4e9 transparent;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}

.settings-content::-webkit-scrollbar-thumb {
  background-color: #d1c4e9;
  border-radius: 3px;
}

/* ======================
 * 背景缩略图样式修复
 * ====================== */
.bg-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.05);
    /* 确保容器建立新的堆叠上下文 */
    isolation: isolate;
}

/* 加载动画样式调整 */
.bg-thumbnail::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #4a00ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 1;
    transition: opacity 0.3s;
    /* 确保加载动画在内容下方 */
    z-index: 1;
}

/* 加载完成状态 */
.bg-thumbnail img.loaded,
.bg-thumbnail.loaded img {
    opacity: 1;
}

.bg-thumbnail img.loaded ~ .bg-thumbnail::after,
.bg-thumbnail.loaded::after {
    opacity: 0;
    pointer-events: none;
}

.bg-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.3s ease;
    opacity: 0;
    position: relative;
    z-index: 2; /* 确保在加载动画上方 */
}

/* 信息层样式 */
.bg-thumbnail-date,
.bg-thumbnail-title,
.bg-remove {
    /* 确保信息层在最上层 */
    z-index: 3;
    position: absolute;
}

/* 添加加载动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bg-thumbnail, .today-bg-preview {
    animation: fadeIn 0.5s ease forwards;
}

.bg-thumbnail:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(74, 0, 255, 0.15);
}

.bg-thumbnail.active {
  transform: scale(0.98);
  box-shadow: 0 0 0 3px rgba(74, 0, 255, 0.5);
}

/* 信息展示 */
.bg-thumbnail-date {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.6875rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.bg-thumbnail-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.55rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  color: white;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 删除按钮 */
.bg-remove {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 24px;
  height: 24px;
  background: rgba(255, 71, 87, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.bg-thumbnail:hover .bg-remove {
  opacity: 1;
}

.bg-remove:hover {
  background: rgba(255, 71, 87, 1);
  transform: scale(1.1);
}

.bg-remove .icon {
  color: white;
  margin:0;
  padding: 3px;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .bg-modal-content {
        background: #2d2d2d;
    }
    .bg-favorites {
        background: #1e1e1e;
    }
    
    .bg-thumbnail {
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(40, 40, 50, 0.9);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .bg-favorites {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .bg-remove {
    opacity: 1; /* 移动端始终显示删除按钮 */
  }
}


/* ======================
 * 主要内容区域
 * ====================== */
#content {
  width: 100%;
  height: auto;  /* 改为自动高度 */
  min-height: 100vh;  /* 至少占满视口 */
  position: relative;
  z-index: 100;
  overflow: visible;  /* 避免裁剪 */
}

.con {
  width: 100%;
  margin: auto;
  min-width: 320px;
  height: 380px;
  position: absolute;
  left: 0;
  top: -280px;
  right: 0;
  bottom: 0;
}

.con .shlogo {
  position: relative;
  font-family: Source Sans Pro, Helvetica Neue, Helvetica, Arial, sans-serif;
  width: 480px;
  height: 120px;
  margin: 20px auto;
  text-align: center;
  font-weight: 700;
  font-size: 3.75rem;
  color: #fff;
  line-height: inherit;
  letter-spacing: -0.05em;
}

.con .sou {
  max-width: 580px;
  position: relative;
  width: calc(100% - 60px);
  min-width: 320px;
  margin: 0 auto;
}

/* ======================
 * 搜索框和搜索建议
 * ====================== */
.con .sou form {
  width: 100%;
  height: 50px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  border: 0;
  transition: all 0.3s ease;
}

.con .sou form .search-icon {
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #999;
}

.con .sou form .wd {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 0 10px;
  background: #fff;
  color: #333;
}

.con .sou form .wd::placeholder {
  color: #999;
}

.con .sou form .search-button {
  width: 100px;
  height: 50px;
  display: flex;
  margin-left: 5px;
  align-items: center;
  justify-content: center;
  background: #4a00ff;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: bold;
  border-radius: 0 8px 8px 0;
  border: none;
}

.con .sou form .search-button:hover {
  background: #3f00e7;
}

/* 搜索建议 */
.con .sou #suggestions {
  width: calc(100% - 2px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  position: absolute;
  left: 1px;
  top: 100%;
  background: #fff;
  line-height: 1.5;
  font-size: 16px;
  overflow: hidden;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 10px;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

.con .sou #suggestions::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.con .sou #suggestions::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.con .sou #suggestions::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

.con .sou #suggestions.showing {
  display: block;
}

.con .sou #suggestions li {
  padding: 6px 15px;
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.con .sou #suggestions li:last-child {
  border-bottom: none;
}

.con .sou #suggestions li:hover {
  color: #4a00ff;
  background: rgba(74, 0, 255, 0.05);
}

.con .sou #suggestions li svg.icon {
  margin-right: 10px;
  color: rgba(0, 0, 0, 0.6);
}

.con .sou #suggestions li:hover svg.icon {
  color: #4a00ff;
}

/* 搜索历史 */
.search-history-dropdown {
  width: calc(100% - 2px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  position: absolute;
  left: 1px;
  top: 100%;
  background: #fff;
  line-height: 1.5;
  font-size: 16px;
  overflow: hidden;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

.search-history-dropdown::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.search-history-dropdown::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.search-history-dropdown::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

.search-history-dropdown.showing {
  display: block;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  color: #666;
}

.history-header button {
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #4a00ff;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.history-header button:hover {
  background: rgba(74, 0, 255, 0.1);
  transform: scale(1.1);
}

.history-items {
  padding: 0;
  margin: 0;
  list-style: none;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.history-item:hover {
  background: rgba(74, 0, 255, 0.05);
}

.history-content {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.history-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(74, 0, 255, 0.1);
  color: #4a00ff;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 10px;
}

.query-text {
  flex-grow: 1;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  color: #999;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: rgba(74, 0, 255, 0.1);
  color: #ff6b6b;
}

.remove-btn svg {
  width: 14px;
  height: 14px;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

.no-history {
  padding: 20px;
  text-align: center;
  color: #444;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.no-history .icon {
  margin-bottom: 10px;
  width: 24px;
  height: 24px;
  color: #ccc;
}

/* ======================
 *  SETTINGS PANEL - OPTIMIZED
 * ====================== */

/* 基础容器样式 */
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1c4e9 transparent;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}

.settings-content::-webkit-scrollbar-thumb {
  background-color: #d1c4e9;
  border-radius: 3px;
}

/* 设置区块通用样式 */
.settings-section {
  --section-bg: rgba(255, 255, 255, 0.92);
  --section-border: 1px solid rgba(74, 0, 255, 0.1);
  
  background: var(--section-bg);
  border-radius: 12px;
  padding: 1.25rem;
  border: var(--section-border);
  box-shadow: 0 2px 12px rgba(74, 0, 255, 0.05);
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-section:hover {
  box-shadow: 0 4px 16px rgba(74, 0, 255, 0.1);
  transform: translateY(-1px);
}

.settings-section h4 {
  position: relative;
  margin: 0 0 1rem;
  color: #4a00ff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  line-height: 1.5;
    padding-right: 30px; /* 为按钮留空间 */
}

.settings-section h4 .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.section-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.section-toggle .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.section-toggle.collapsed .icon {
    transform: rotate(-90deg);
}

.settings-section-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.settings-section-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* 单选按钮组样式 */
.radio-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.radio-option {
  --option-bg: white;
  --option-border: 1px solid #e0e0e0;
  
  position: relative;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--option-bg);
  border: var(--option-border);
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.radio-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #4a00ff;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}

.radio-option:hover {
  --option-border: 1px solid #b388ff;
  --option-bg: rgba(179, 136, 255, 0.03);
}

.radio-option.active {
  --option-border: 1px solid #4a00ff;
  --option-bg: rgba(74, 0, 255, 0.05);
}

.radio-option.active::before {
  transform: scaleY(1);
}

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

.option-content {
  display: grid;
  gap: 0.25rem;
}

.option-title {
  font-weight: 500;
  color: #333;
  font-size: 0.9375rem;
}

.option-description {
  color: #666;
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* 引擎管理列表优化 */
.engine-manager-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.engine-manager-item {
  --item-bg: white;
  --item-border: 1px solid rgba(0, 0, 0, 0.05);
  
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: var(--item-bg);
  border: var(--item-border);
  transition: all 0.2s ease;
  gap: 1rem;
}

.engine-manager-item:hover {
  --item-border: 1px solid rgba(74, 0, 255, 0.2);
  box-shadow: 0 2px 8px rgba(74, 0, 255, 0.08);
}

/* 开关控件优化 */
.engine-switch {
  --switch-width: 2.625rem;
  --switch-height: 1.375rem;
  --switch-knob: calc(var(--switch-height) - 4px);
  
  position: relative;
  display: inline-block;
  width: var(--switch-width);
  height: var(--switch-height);
  flex-shrink: 0;
}

.engine-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.engine-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  transition: .3s;
  border-radius: var(--switch-height);
}

.engine-slider::before {
  position: absolute;
  content: "";
  height: var(--switch-knob);
  width: var(--switch-knob);
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .engine-slider {
  background-color: #4a00ff;
}

input:checked + .engine-slider::before {
  transform: translateX(calc(var(--switch-width) - var(--switch-knob) - 4px));
}

/* 引擎名称样式 */
.engine-name {
  display: flex;
  align-items: center;
  font-size: 0.9375rem;
  color: #333;
  gap: 0.75rem;
  overflow: hidden;
}

.engine-name .icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #4a00ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .settings-content {
    padding: 0.75rem;
    height: calc(100vh - 100px);
  }
  
  .settings-section {
    padding: 1rem;
  }
  
  .engine-manager-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .engine-switch {
    --switch-width: 2.375rem;
    --switch-height: 1.25rem;
  }
  
  .option-title {
    font-size: 0.875rem;
  }
  
  .option-description {
    font-size: 0.75rem;
  }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  .settings-section {
    --section-bg: rgba(30, 30, 40, 0.9);
    --section-border: 1px solid rgba(179, 136, 255, 0.1);
  }
  
  .radio-option {
    --option-bg: rgba(40, 40, 50, 0.8);
    --option-border: 1px solid rgba(179, 136, 255, 0.1);
  }
  
  .engine-manager-item {
    --item-bg: rgba(40, 40, 50, 0.8);
    --item-border: 1px solid rgba(179, 136, 255, 0.1);
  }
  
  .settings-section h4,
  .engine-name {
    color: #b388ff;
  }
  
  .option-title {
    color: #e0e0e0;
  }
  
  .option-description {
    color: #aaa;
  }
  
  .engine-slider {
    background-color: #555;
  }
}

/* ======================
 *  Bing Navigation System
 * ====================== */
.bing-nav-container {
  position: fixed;
  right: 50px;
  bottom: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.bing-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 24px;
  padding: 6px 8px 6px 6px;
  transition: all 0.3s ease;
}

.bing-info-group {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 2.5rem;
  border-radius: 8px;
  background: rgba(34, 34, 34, .9);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.bing-info-group:hover {
  background: rgba(0, 0, 0, 0.8);
}

.bing-info-group:hover .bing-current-title {
  color: #fff;
}

.bing-info-group:hover .bing-info-btn .icon {
  stroke: #fff;
  transform: scale(1.1);
}

.bing-current-title {
  font-size: 15px;
  padding: 0 16px 0 8px;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  transition: all 0.3s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Button Styles */
.bing-nav-btn,
.bing-info-btn,
.bing-card-link,
.bing-close-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(34, 34, 34, .9);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.bing-nav-btn:hover,
.bing-info-btn:hover,
.bing-card-link:hover,
.bing-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.bing-nav-btn:active,
.bing-info-btn:active,
.bing-card-link:active,
.bing-close-btn:active {
  transform: scale(0.98);
}

.bing-info-btn {
  background: transparent;
}

.bing-info-btn .icon {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: all 0.3s ease;
}

/* Navigation Buttons */
.bing-nav-buttons {
  display: flex;
  gap: 6px;
}

.bing-nav-btn .icon {
  width: 24px;
  height: 24px;
  fill: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.bing-nav-btn:hover .icon {
  fill: #fff;
  transform: scale(1.1);
}

.bing-nav-btn.prev:hover .icon {
  transform: translateX(-2px) scale(1.1);
}

.bing-nav-btn.next:hover .icon {
  transform: translateX(2px) scale(1.1);
}

/* Disabled State */
.bing-nav-btn:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

.bing-nav-btn:disabled .icon {
  fill: rgba(255, 255, 255, 0.5);
}

.bing-nav-btn:disabled:hover {
  background-color: transparent;
  transform: none;
}

/* Card Close Button */
.bing-card-link,
.bing-close-btn {
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
}

.bing-card-link:hover,
.bing-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.bing-card-link .icon,
.bing-close-btn .icon {
  transition: transform 0.4s ease;
}

.bing-card-link:hover .icon,
.bing-close-btn:hover .icon {
  transform: rotate(90deg);
}

/* Info Card */
.bing-info-card {
  width: 19rem;
  background-color: rgba(34, 34, 34, .9);    
  border-radius: 8px;
  margin-right: 8px;
  padding: 16px;
  color: white;
  display: none;
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  order: -1;
}

.bing-info-card.visible {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.bing-info-card .bing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.bing-info-card .bing-card-title {
  font-size: 16px;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.98);
  line-height: 1.4;
}

.bing-info-card .bing-card-actions {
  display: flex;
  gap: 8px;
}

.bing-info-card .bing-card-content {
  font-family: "Segoe UI", system-ui, sans-serif;
}

.bing-info-card .bing-card-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 8px 0;
  width: 100%;
}

.bing-info-card .bing-card-copyright-line1 {
  font-family: 'Segoe UI Light', 'Segoe UI', Arial, Helvetica, Sans-Serif;
  font-size: 1.375rem;
  font-weight: 100;
  line-height: 1.3;
  margin-bottom: 6px;
}

.bing-info-card .bing-card-copyright-line2 {
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.78);
  margin: .5rem 0 18px;
}

.bing-info-card .bing-card-date {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
}

.bing-info-card .bing-card-date .icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  fill: currentColor;
  opacity: 0.7;
}

.bing-info-card .bing-card-header,
.bing-info-card .bing-card-content {
  pointer-events: auto;
}

/* ======================
 *  Footer Styles
 * ====================== */
.foot {
  position: absolute;
  bottom: 10px;
  text-align: center;
  width: 100%;
  color: #fff;
  height: 20px;
  line-height: 20px;
  font-size: 0.875rem;
}

.foot a {
  text-decoration: none;
  color: #0ea5e9;
  transition: color 0.2s ease;
}

.foot-save-btn {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #0ea5e9;
  color: #0ea5e9;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.foot-save-btn:hover {
  background: rgba(14, 165, 233, 1);
  border: 1px solid #0ea5e9;
  color: #fff;
}

.foot-save-btn.favorited {
  border: 1px solid #4CAF50;
  background-color: #4CAF50;
  color: white;
}

.foot-save-btn.favorited:hover {
  border: 1px solid #45a049;
  background-color: #45a049;
}

/* ======================
 *  Toast Messages
 * ====================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 1100;
  opacity: 1;
  transition: all 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  max-width: 80%;
  box-shadow: var(--toast-shadow);
}

.toast-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-size: contain;
}

.toast-info .toast-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/></svg>");
}

.toast-success .toast-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/></svg>");
}

.toast-error .toast-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z'/></svg>");
}

.toast-info {
  background: var(--toast-info-bg);
}

.toast-success {
  background: var(--toast-success-bg);
}

.toast-error {
  background: var(--toast-error-bg);
}

.toast.fade-out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

/* ======================
 *  Confirmation Dialog
 * ====================== */
.confirm-modal {
  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;
}

.confirm-box {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  width: 80%;
  max-width: 300px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: confirm-fadein 0.3s;
}

.confirm-box h3 {
  margin: 0 0 10px;
  color: #333;
  font-size: 18px;
}

.confirm-box p {
  margin: 0 0 20px;
  color: #666;
}

.confirm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.confirm-cancel,
.confirm-ok {
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 80px;
  text-align: center;
  border: 1px solid transparent;
}

.confirm-cancel {
  background: #f5f5f5;
  color: #595959;
  border-color: #d9d9d9;
}

.confirm-cancel:hover {
  background: #e8e8e8;
  border-color: #bfbfbf;
  color: #262626;
}

.confirm-cancel:active {
  background: #d9d9d9;
}

.confirm-ok {
  background: #1890ff;
  color: white;
  border-color: #1890ff;
}

.confirm-ok:hover {
  background: #40a9ff;
  border-color: #40a9ff;
}

.confirm-ok:active {
  background: #096dd9;
  border-color: #096dd9;
}

.confirm-ok.is-danger {
  background: #ff4d4f;
  border-color: #ff4d4f;
}

.confirm-ok.is-danger:hover {
  background: #ff7875;
  border-color: #ff7875;
}

.confirm-ok.is-danger:active {
  background: #d9363e;
  border-color: #d9363e;
}

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

/* ======================
 *  Tooltips
 * ====================== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  margin-bottom: 5px;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ======================
 *  Scrollbars
 * ====================== */
/* 统一滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

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

/* 暗色模式滚动条 */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #2d2d2d;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #555;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #777;
    }
}

/* ======================
 *  Mobile Responsiveness
 * ====================== */
@media (max-width: 768px) {
  /* Background Optimization */
  body {
    background-attachment: fixed;
    background-size: cover;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
  }
  
  .bg-transition {
    height: 100%;
    width: 100%;
  }
  
  .bg-blur, .bg-sharp {
    background-size: cover !important;
    background-position: center !important;
  }

  /* Main Content Area */
  #content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    height: auto;
    min-height: 100vh;
  }

  .con {
    position: relative;
    top: 0;
    margin: 0 auto;
    width: 100%;
    height: auto;
    padding: 20px 0;
  }

  .con .shlogo {
    width: 100%;
    max-width: 280px;
    height: 80px;
    margin: 0 auto 20px;
    font-size: 2.2rem;
  }

  .con .sou {
    width: 100%;
    min-width: auto;
    margin: 0 auto;
  }

  .con .sou form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    height: auto;
  }

  .con .sou form .wd {
    width: 100%;
    height: 48px;
    border-radius: 24px;
    padding: 0 20px;
    border: 1px solid #e0e0e0;
  }

  .con .sou form .search-button {
    width: 100%;
    height: 48px;
    margin-left: 0;
    border-radius: 24px;
    font-size: 14px;
  }

  .con .sou form .search-icon {
    display: none;
  }

  .con .sou #suggestions,
  .search-history-dropdown {
    width: 100%;
    left: 0;
    top: calc(100% + 5px);
  }

  /* Footer Adjustments */
  .foot {
    position: static;
    margin-top: 30px;
    padding-bottom: 20px;
    padding: 0 20px 20px;
    line-height: 1.6;
  }
  
  /* Sidebar Adjustments */
  .list {
    width: 280px;
  }

  #menu {
    right: 5px;
    top: 5px;
  }
  
  #menu[aria-expanded="true"] {
    right: 285px;
  }
  
  #menu .icon {
    width: 20px;
    height: 20px;
  }
  
  #menu[aria-expanded="true"] {
    transform: translateX(-280px);
  }

  .list li:not(.title):not(.search-history) {
    width: calc(50% - 10px);
  }

  /* Navigation Buttons */
  .bing-nav-container {
    right: 16px;
    bottom: 80px;
    transform: scale(0.9);
    transform-origin: bottom right;
  }
  
  .bing-controls {
    flex-direction: column-reverse;
    gap: 8px;
    padding: 8px;
  }
  
  .bing-info-group {
    height: 2.2rem;
    max-width: 180px;
  }
  
  .bing-current-title {
    font-size: 13px;
    padding: 0 8px;
    max-width: 140px;
  }
  
  .bing-nav-buttons {
    flex-direction: row;
  }

  /* Toast Messages */
  .toast {
    bottom: 60px;
    top: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: none;
  }

  .toast.fade-out {
    transform: translateX(-50%) scale(0.95);
  }
}

/* ======================
 *  Mobile Settings Panel Optimization
 * ====================== */
@media (max-width: 768px) {
  /* Settings Button Position */
  .settings-container {
    bottom: 80px;
    left: 10px;
    right: auto;
    transform: scale(0.9);
    transform-origin: bottom right;
  }

  /* Settings Panel */
  .settings-panel {
    left: 10px;
    right: auto;
    bottom: 130px;
    width: 90vw;
    max-width: 360px;
    max-height: 70vh;
    flex-direction: column;
  }

/* ======================
 *  Small Screen Optimization
 * ====================== */
@media (max-width: 480px) {
  #menu {
    right: 12px;
    top: 12px;
  }
  
  #menu[aria-expanded="true"] {
    right: 152px;
  }
  
  .settings-panel {
    width: 95vw;
    max-width: none;
    bottom: 120px;
  }
}

/* ======================
 *  Animations
 * ====================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 加载动画 */
@keyframes loadingShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}