/* ======================
 * 基础组件样式
 * ====================== */

/* 卡片组件 */
.card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  transition: var(--transition);
  border: 1px solid rgba(74, 0, 255, 0.1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  height: 36px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-size: 0.9375rem;
  line-height: 1;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  height: 28px;
  font-size: 0.875rem;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 8px var(--primary-shadow);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

/* 表单组件 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--light-text);
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 0.9375rem;
  background-color: var(--white);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* 模态框组件 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2100;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 20px;
}

.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 2101;
  transform: translateY(20px);
  transition: var(--transition);
}

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

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--light-text);
  padding: 5px;
  transition: var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background-color: var(--light-bg);
  color: var(--text-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* 遮罩层 */
.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;
}

/* ======================
 * 布局组件
 * ====================== */

/* 控制组 */
.control-group {
  display: grid;
  gap: 0.75rem;
  margin-top: 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: var(--primary-color);
  margin-bottom: 0.25rem;
}

/* 滑动条控制 */
.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: var(--primary-color);
  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: var(--primary-color);
  font-weight: 500;
  text-align: right;
}

/* 单选按钮组 */
.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: var(--primary-color);
  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;
}

/* ======================
 * 背景管理模块
 * ====================== */

/* 背景过渡 */
.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;
}

/* 背景预览 */
.today-bg-preview {
  margin-top: 0.75rem;
  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 svg {
  margin: 0;
  padding: 0;
  width: 16px;
  height: 16px;
}

.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);
}

/* 背景模态框 */
.bg-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.bg-modal .modal-content {
  display: flex;
  max-height: 64vh;
  min-height: 64vh;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.bg-modal h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.bg-modal .modal-body {
  padding: 0 0 0.75rem;
  overflow: hidden;
}

.bg-controls {
  padding: 0.75rem 1.5rem;
  background: rgba(74, 0, 255, 0.03);
  border-bottom: 1px solid rgba(74, 0, 255, 0.08);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bg-controls button {
  padding: 8px 12px;
  background: rgba(74, 0, 255, 0.1);
  color: var(--primary-color);
  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(220px, auto);
  gap: 15px;
  padding: 26px;
  width: 100%;
  max-height: 49vh;
  min-height: 49vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1c4e9 transparent;
}

/* 空状态/加载状态 */
.favorites-loading,
.favorites-error,
.no-favorites {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: var(--light-text);
}

.favorites-loading svg,
.favorites-error svg,
.no-favorites svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

/* 单个收藏项 */
.favorite-item {
  position: relative;
  border-radius: 15px;
  height: 220px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.favorite-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.favorite-item.removing {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 缩略图容器 */
.thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--loading-bg);
}

/* 缩略图图片 */
.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.thumbnail-image.loaded {
  opacity: 1;
}

/* 缩略图遮罩层 */
.thumbnail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.favorite-item:hover .thumbnail-overlay {
  opacity: 1;
}

/* 日期标签 */
.thumbnail-date {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  z-index: 1;
}

/* 删除按钮 */
.thumbnail-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(255, 71, 87, 0.8);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.thumbnail-remove:hover {
  background: #ff4757;
  transform: scale(1.1);
}

.remove-icon {
  width: 18px;
  height: 18px;
  fill: white;
}

/* 缩略图信息 */
.thumbnail-info {
  padding: 0.55rem 0.75rem;
}

.thumbnail-info h4 {
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumbnail-info p {
  font-size: 13px;
  color: var(--light-text);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 菜单按钮 */
.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 svg {
    padding: 0;
    margin: 0;
}

.menu .menu-open-icon {
    display: block;
    position: absolute;
    opacity: 1;
    transform: rotate(0deg);
    transition: all 0.3s ease;
}

.menu .menu-close-icon {
    display: block;
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
    transition: all 0.3s ease;
}

.menu[aria-expanded="true"] .menu-open-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.menu[aria-expanded="true"] .menu-close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.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);
}

/* ======================
 * 侧边面板模块
 * ====================== */

.side-panel {
  width: var(--sidebar-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.5rem 0.75rem;
  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;
  padding: 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--light-text);
  font-size: 0.875rem;
  transition: var(--transition);
  position: relative;
  transition: all 0.2s ease;
}

.tab-icon-wrapper {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 5px;
}

.tab-icon-wrapper svg {
  margin: 0;
  padding: 0;
  width: 24px;
  height: 24px;
  transition: var(--transition);
}

.tab-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  transition: inherit;
}

.panel-tab.active {
  color: var(--primary-color);
}

.panel-tab.active .tab-icon:hover .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);
}

.panel-content {
  flex: 1;
  overflow: hidden;
  padding: 1.25rem 0;
}

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

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

/* ======================
 * 设置面板模块
 * ====================== */

.settings-container {
  height: calc(100vh - 120px);
  display: flex;
  padding-bottom: 0.75rem;
  margin: 0;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.75rem;
  margin-left: 1.25rem;
  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-content::-webkit-scrollbar-thumb:hover {
  background: #b388ff;
}

.settings-section {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  padding: 1.25rem;
  border: 1px solid rgba(74, 0, 255, 0.1);
  box-shadow: 0 2px 12px rgba(74, 0, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-section-header {
  position: relative;
  margin: 0;
  padding: 0.75rem;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.settings-section-header:hover {
  background: rgba(74, 0, 255, 0.05);
}

.settings-section-header .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  fill: var(--primary-color);
}

.section-toggle-icon {
  margin-left: auto;
  width: 1.25rem;
  height: 1.25rem;
  fill: var(--primary-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-toggle-icon.expand {
  opacity: 1;
  transform: scale(1);
}

.section-toggle-icon.collapse {
  opacity: 0;
  transform: scale(0.8);
  position: absolute;
  right: 0.75rem;
}

.settings-section-header.active .section-toggle-icon.expand {
  opacity: 0;
  transform: scale(0.8);
}

.settings-section-header.active .section-toggle-icon.collapse {
  opacity: 1;
  transform: scale(1);
}

.settings-section-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
}

.settings-section-content.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
}

/* 视图设置 */
.view-settings-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(74, 0, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(74, 0, 255, 0.1);
}

/* 搜索引擎设置 */
.search-settings-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(74, 0, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(74, 0, 255, 0.1);
}

.search-setting-item {
  --active-color: #4a00ff;
  --inactive-color: #e0e0e0;
  --option-bg: white;
  --option-border: 1px solid #e0e0e0;
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--option-bg);
  border: var(--option-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-setting-item:hover {
  --option-border: 1px solid #b388ff;
  --option-bg: rgba(179, 136, 255, 0.03);
  box-shadow: 0 2px 8px rgba(74, 0, 255, 0.1);
}

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

.search-setting-content {
  flex: 1;
  margin-right: 12px;
}

.search-setting-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.search-setting-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  margin: 0;
}

.search-setting-toggle {
  position: relative;
  width: 40px;
  height: 20px;
  border-radius: 10px;
  background: var(--inactive-color);
  transition: all 0.2s ease;
}

.search-setting-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: all 0.2s ease;
}

.search-setting-item.active .search-setting-toggle {
  background: var(--active-color);
}

.search-setting-item.active .search-setting-toggle::after {
  left: 22px;
}

.search-feature-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* ======================
 * 导航搜索框模块
 * ====================== */
.nav-container {
    display: flex;
    margin: 0 0.75rem;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* 搜索框 */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box svg {
  margin: 0;
  padding: 0;
  width: 16px;
  height: 16px;
  fill: var(--primary-color);
}

.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: var(--primary-color);
  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;
  fill: var(--primary-color);
}

.no-results {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 14px;
  display: none;
}

/* 主要内容区域 */
.main {
  width: 100%;
  height: auto;
  min-height: 100vh;
  position: relative;
  z-index: 100;
  overflow: visible;
}

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

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

.container .search-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: var(--search-max-width, 800px);
    margin: 0 auto;
    padding: 0 20px;
    min-height: var(--logo-container-height);
    transition: all 0.3s ease;
}

.container .search-container.no-logo {
    min-height: var(--logo-container-height-no-logo);
    justify-content: center;
}

/* 搜索表单样式 */
.container .search-container form {
    --search-width: 520px;
    --search-height: calc(var(--search-width) * 0.0923); /* 48/520≈0.0923 */
    --search-radius: calc(var(--search-height) * 0.1667); /* 8/48≈0.1667 */
    --search-opacity: 1;
    
    width: min(90vw, var(--search-width));
    height: var(--search-height);
    border-radius: var(--search-radius);
    opacity: var(--search-opacity);
    display: flex;
    margin: 0 auto;
    position: relative;
  align-items: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

.container .search-container form .wd {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  background: #fff;
  color: #333;
  font-size: calc(var(--search-height) * 0.333); /* 20/48≈0.4167 */
  padding: 0 calc(var(--search-height) * 0.4167);
}

.container .search-container form .wd::placeholder {
  color: #999;
}

.container .search-container form .search-button {
  width: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  border: none;
  height: 100%;
  border-radius: 0 var(--search-radius) var(--search-radius) 0;
  font-size: calc(var(--search-height) * 0.333); /* 16/48≈0.333 */
}

.container .search-container form .search-button:hover {
  background: var(--primary-hover);
}

.container .search-container form .search-button .icon{
  width: calc(var(--search-height) * 0.454);
  height: calc(var(--search-height) * 0.454);
  overflow-clip-margin: content-box;
  overflow: clip;
  fill: #fff;
}

/* 搜索建议 */
.container .search-container .suggestions {
  width: min(90vw, var(--search-width));
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  position: absolute;
  left: 50%;
  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: 5px;
  transform: translateX(-50%);
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

.container .search-container .suggestions::-webkit-scrollbar-track {
  background: #f0f0f0;
}

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

.container .search-container .suggestions::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

.container .search-container .suggestions.showing {
  display: block;
}

.container .search-container .suggestions li {
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: calc(var(--search-height) * 0.833); /* 40/48≈0.833 */
  font-size: calc(var(--search-height) * 0.3);
  padding: 6px 15px;
}

.container .search-container .suggestions li:last-child {
  border-bottom: none;
}

.container .search-container .suggestions li:hover {
  color: var(--primary-color);
  background: rgba(74, 0, 255, 0.05);
}

.container .search-container .suggestions li svg.icon {
  width: 14px;
  height: 14px;
  margin-right: 10px;
  fill: rgba(0, 0, 0, 0.6);
}

.container .search-container .suggestions li:hover svg.icon {
  color: var(--primary-color);
}

/* 搜索历史 */
.search-history-dropdown {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  position: absolute;
  left: 50%;
  top: 100%;
  background: #fff;
  line-height: 1.5;
  font-size: 16px;
  overflow: hidden;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateX(-50%);
  width: min(90vw, var(--search-width));
  margin-top: 5px;
  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: var(--primary-color);
  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;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  height: calc(var(--search-height) * 0.75); /* 36/48≈0.75 */
  font-size: calc(var(--search-height) * 0.3);
  padding: 5px 15px;
}

.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: var(--primary-color);
  border-radius: 4px;
  font-size: 12px;
  margin-right: 10px;
}

.query-text {
  flex-grow: 1;
  color: #333;
  max-width: 320px;
  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: 32px;
  height: 32px;
  fill: currentColor;
}

/* 搜索图标 */
.search-icon {
  position: relative;
  width: 50px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 1);
  padding-right: 12px;
}

.search-icon:hover {
  background: rgba(255, 255, 255, 0.9);
}

.search-icon:active {
  background: rgba(255, 255, 255, 0.8);
}

.search-icon .icon {
  width: 16px;
  height: 16px;
  transition: all 0.3s ease;
  color: #999;
}

.search-icon img {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
  color: #999;
}

.search-icon:hover .icon {
  color: var(--primary-color);
  transform: scale(1.1);
}

.search-icon svg {
  margin: 0px;
  padding: 0px;
  width: 100%;
  height: 100%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #999;
  opacity: 1;
  transition: all 0.3s ease;
}

.search-icon:hover::after,
.search-icon.active::after {
  opacity: 1;
}

.search-icon.active {
  background: rgba(255, 255, 255, 0.9);
}

.search-icon.active .icon {
  color: var(--primary-color);
}

.search-icon.has-dropdown::after {
  opacity: 1;
  border-top-color: var(--primary-color);
  transform: translateY(-50%) rotate(180deg);
}

/* 搜索框清除按钮 */
.search-clear-button {
    position: absolute;
    right: 90px; /* 在搜索按钮左侧 */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.search-clear-button:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.search-clear-button .icon {
    width: 16px;
    height: 16px;
    fill: var(--primary-color);
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    .search-clear-button:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .search-clear-button .icon {
        fill: #b388ff;
    }
}

/* 引擎切换器 */
.engine-switcher-dropdown {
  --engine-columns: 5; /* 默认5列 */
  position: fixed;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  padding: 16px;
  display: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  max-height: 80vh;
  overflow-y: auto;
}

.engine-switcher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 8px;
}

.engine-switcher-header span {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.engine-add-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--primary-color);
}

.engine-add-btn:hover {
  background: rgba(74, 0, 255, 0.05);
  transform: scale(1.1);
}

.engine-add-btn .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: inherit;
}

.engine-switcher-grid {
  display: grid;
  grid-template-columns: repeat(var(--engine-columns), minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.engine-switcher-item {
  position: relative;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
}

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

.engine-switcher-item.active {
  background: rgba(74, 0, 255, 0.1);
  border-color: rgba(74, 0, 255, 0.2);
  position: relative;
}

.engine-switcher-item.active::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

.engine-switcher-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px 3px;
  box-sizing: border-box;
}

.engine-switcher-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.engine-switcher-icon img {
  margin: 0px;
  padding: 0px;
  width: 100%;
  height: 100%;
  color: var(--primary-color);
  transition: transform 0.2s ease;
}

.engine-switcher-item:hover .engine-switcher-icon .icon {
  transform: scale(1.1);
}

.engine-switcher-name {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  text-align: center;
  width: 100%;
  overflow: hidden;
  padding: 0 4px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.engine-switcher-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.engine-switcher-overlay.visible {
  display: block;
  opacity: 1;
}

.engine-icon-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(74, 0, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 14px;
}

/* ======================
 * Bing导航模块
 * ====================== */

.bing-nav-container {
  position: fixed;
  right: 50px;
  bottom: 10px;
  z-index: 900;
  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;
  fill: #fff; 
  transform: scale(1.1);
}

.bing-current-title {
  font-size: .8125rem;
  padding: 0 18px 0 3px;
  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);
}

.bing-nav-btn,
.bing-info-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 {
  background: rgba(0, 0, 0, 0.8);
}

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

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

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

.bing-nav-buttons {
  display: flex;
  gap: 6px;
}

.bing-nav-btn {
  transition: opacity 0.2s;
}

.bing-nav-btn .icon {
  width: 14px;
  height: 14px;
  fill: rgba(255, 255, 255, 1);
  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);
}

.bing-nav-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

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

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

.bing-nav-btn:not(:disabled):hover {
  opacity: 0.8;
}

.bing-restore-btn {
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  background: rgba(34, 34, 34, .9);
  border-radius: 8px;
  border: none;
  bottom: 16px;
  color: var(--light-blue-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  position: fixed;
  right: 12px;
  z-index: 2;
  font-size: 14px;
  transition: all .3s ease;
  overflow: hidden
}

.bing-restore-btn svg {
  margin: 0 5px 0 10px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-right: 0;
  transition: margin-right .3s ease;
  fill: #f2f2f2;
  min-width: 20px
}

.bing-restore-btn span {
  opacity: 0;
  width: 0;
  white-space: nowrap;
  transition: opacity .3s ease,width .3s ease
}

.bing-restore-btn:hover {
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 1.25rem;
  background: #f2f2f2;
  border: 1px solid #999;
  max-width: 200px;
  width: auto;
  padding-right: 15px
}

.bing-restore-btn:hover svg {
  margin-right: 8px;
  fill: var(--light-blue-text);
}

.bing-restore-btn:hover span {
  opacity: 1;
  width: auto
}

.bing-card-link {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 4px 10px;
  transition: background 0.2s ease;
}

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

.bing-card-link svg {
  width: 14px;
  height: 14px;
  fill: rgba(255, 255, 255, 0.9);
}

.bing-info-card {
  width: 265px;
  background-color: rgba(34,34,34,.9);    
  border-radius: 6px;
  margin-right: 8px;
  bottom: calc(2.5rem + .5rem);
  padding: .625rem 1.25rem 1.25rem;
  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;
  gap: 10px;
  padding-bottom: 0.725rem;
  margin-bottom: 0.625rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.98);
}

.bing-info-card .bing-card-title {
  font-size: 0.8125rem;
  font-weight: normal;
  color: rgba(255, 255, 255, 0.98);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
  
.bing-info-card .bing-card-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

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

.bing-info-card .bing-card-copyright {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.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-title {
  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-copyright-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.bing-info-card .bing-card-copyright-info {
  font-size: 0.6875rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  color: #ccc;
  padding-right: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bing-info-card .bing-card-actions {
  display: flex;
  flex-shrink: 0;
  margin-left: auto;
}

/* ======================
 * 页脚模块
 * ====================== */

.foot {
  position: absolute;
  bottom: 140px;
  text-align: center;
  margin: 0 auto;
  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 .foot-sitetitle {
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 2.25rem;
  text-align: center;
  padding: 1rem;
  background-color: transparent;
}

.foot .border-white {
  width: 200px;
  margin: 0 auto;
  border-color: var(--white-text);
}

.foot .foot-copyright {
  grid-auto-flow: column dense;
  place-items: center;
  text-align: center;
  padding: 1rem;
  padding-bottom: 0.65rem;
  background-color: transparent;
}

.foot-save-container {
  display: inline-block;
  min-width: 100px;
  text-align: center;
}

.foot-save-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--white-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.foot-save-btn:hover {
  background: rgba(255,255,255,0.2);
}

.foot-saved {
  grid-auto-flow: column dense;
  place-items: center;
  text-align: center;
  color: var(--white-text);
  background-color: transparent;
}

.foot-saved a {
  color: var(--light-blue-text);
}

.foot-save-container .icon {
  margin: 0;
  padding: 0 3px 0 0;
  width: 16px;
  height: 16px;
}

/* ======================
 * 动画定义
 * ====================== */

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@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);
  }
  
  /* 搜索框 */
  .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 {
    fill: rgba(255, 255, 255, 0.6);
  }

  /* 快捷链接 */
  .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);
  }

  /* 分页 */
  .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;
  }

  /* 设置面板 */
  .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;
  }

  /* 背景模态框 */
  .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);
  }

  /* 快捷站点导航设置 */
  .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;
  }
  
  /* 滚动条 */
  ::-webkit-scrollbar-track {
    background: #2d2d2d;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #555;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #777;
  }

  /* 搜索图标 */
  .search-icon .icon {
    color: rgba(255, 255, 255, 0.7);
  }
  
  .search-icon:hover .icon,
  .search-icon.active .icon {
    color: #b388ff;
  }
  
  .search-icon:hover,
  .search-icon.active {
    background: rgba(179, 136, 255, 0.1);
  }
  
  .search-icon::after {
    border-top-color: rgba(255, 255, 255, 0.6);
  }
  
  .search-icon.has-dropdown::after {
    border-top-color: #b388ff;
  }

  /* 引擎切换器 */
  .engine-switcher-dropdown {
    background: rgba(30, 30, 40, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .engine-switcher-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  .engine-switcher-header span {
    color: rgba(255, 255, 255, 0.7);
  }
  
  .engine-add-btn {
    color: #b388ff;
  }
  
  .engine-add-btn:hover {
    background: rgba(179, 136, 255, 0.05);
  }
  
  .engine-add-btn .icon {
    color: #b388ff;
  }
  
  .engine-switcher-item {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
  }
  
  .engine-switcher-item:hover {
    background: rgba(179, 136, 255, 0.08);
    box-shadow: 0 4px 12px rgba(179, 136, 255, 0.1);
  }
  
  .engine-switcher-item.active {
    background: rgba(179, 136, 255, 0.15);
    border-color: rgba(179, 136, 255, 0.3);
  }
  
  .engine-switcher-item.active::after {
    background: #b388ff;
  }
  
  .engine-switcher-icon .icon {
    color: #b388ff;
  }
  
  .engine-switcher-name {
    color: rgba(255, 255, 255, 0.9);
  }

  .engine-icon-placeholder {
    background: rgba(179, 136, 255, 0.1);
    color: #b388ff;
  }
}

/* ======================
 * 移动端适配
 * ====================== */

@media (max-width: 768px) {
    :root {
        --logo-container-height: 150px;
        --logo-container-height-no-logo: 100px;
    }
  /* 背景优化 */
  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;
  }

  /* 主要内容区域 */
  #content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 20px;
    height: auto;
    min-height: 100vh;
  }

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

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

  .container .search-container {
    width: 100%;
    min-width: auto;
    margin: 0 auto;
	min-height: 150px; /* 移动端初始高度 */
  }
    
    .container .search-container.no-logo {
        min-height: 100px; /* 移动端隐藏LOGO后的高度 */
        padding-top: 15px;
    }

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

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

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

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

  /* 页脚调整 */
  .foot {
    position: static;
    margin-top: 30px;
    padding-bottom: 20px;
    padding: 0 20px 20px;
    line-height: 1.6;
  }
  
  /* 侧边栏调整 */
  .side-panel {
    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);
  }

  /* 导航按钮 */
  .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;
  }

  /* 引擎切换器 */
  .engine-switcher-dropdown {
    width: 280px;
    left: 10px;
  }
  
  .engine-switcher-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .engine-switcher-item {
    aspect-ratio: unset;
    height: 80px;
  }
}

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