/**
 * Copyright (C), 2025, GOSUN CL
 * file: smart-toolbar.css
 * brief: 视评图说主题
 * Theme URI: https://faq7777.com
 * author: 视评图说
 * date: 2025年7月7日
 * version: 7.7.1
 */
/**
 * 新一代智能小工具栏样式
 * 特性：多位置、拖拽、折叠、主题切换、现代化动画
 */

/* ==================== CSS 变量定义 ==================== */
:root {
  --sptsz-primary: #667eea;
  --sptsz-primary-secondary: #764ba2;
  --sptsz-primary-rgba: rgba(255, 255, 255, 0.3);
  --sptsz-primary-rgba-2: rgba(255, 255, 255, 0.5);
  --sptsz-primary-rgba-3: rgba(102, 126, 234, 0.3);
  --sptsz-primary-rgba-4: rgba(102, 126, 234, 0.4);
  --sptsz-primary-rgba-5: rgba(102, 126, 234, 0.5);
  --sptsz-bg: rgba(255, 255, 255, 0.95);
  --sptsz-bg-soft: rgba(255, 255, 255, 0.9);
  --sptsz-bg-dark: rgba(30, 41, 59, 0.9);
  --sptsz-bg-dark-soft: rgba(30, 41, 59, 0.95);
  --sptsz-text: #333;
  --sptsz-text-muted: #666;
  --sptsz-text-light: #aaa;
  --sptsz-white: #fff;
  --sptsz-border: rgba(255, 255, 255, 0.1);
  --sptsz-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================== 根容器 ==================== */
.sptsz-smart-toolbar {
  position: fixed;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 右侧位置（默认） */
.sptsz-smart-toolbar.position-right {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* 左侧位置 */
.sptsz-smart-toolbar.position-left {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

/* 底部位置 */
.sptsz-smart-toolbar.position-bottom {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

/* 拖拽状态 */
.sptsz-smart-toolbar.is-dragging {
  transition: none;
  cursor: grabbing;
}

/* ==================== 主容器 ==================== */
.toolbar-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 底部位置时改为横向布局 */
.position-bottom .toolbar-main {
  flex-direction: row;
}

/* ==================== 折叠/展开按钮 ==================== */
.toolbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  background: linear-gradient(135deg, var(--sptsz-primary) 0%, var(--sptsz-primary-secondary) 100%);
  color: var(--sptsz-white);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.toolbar-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.toolbar-toggle:hover::before {
  width: 200%;
  height: 200%;
}

.toolbar-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--sptsz-primary-rgba-4);
}

.toolbar-toggle:active {
  transform: scale(0.95);
}

.toolbar-toggle svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.toolbar-toggle i {
  display: block;
  width: 28px;
  height: 28px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.toolbar-main.collapsed .toolbar-toggle svg,
.toolbar-main.collapsed .toolbar-toggle i {
  transform: rotate(180deg);
}

/* ==================== 工具按钮区域 ==================== */
.toolbar-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar-main:not(.collapsed) .toolbar-buttons {
  max-height: 600px;
  opacity: 1;
  padding: 0;
}

.position-bottom .toolbar-buttons {
  flex-direction: row;
}

/* ==================== 工具按钮 ==================== */
.toolbar-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 14px;
  background: var(--sptsz-primary-rgba);
  color: var(--sptsz-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.toolbar-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--sptsz-primary) 0%, var(--sptsz-primary-secondary) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toolbar-item:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px var(--sptsz-primary-rgba-3);
  background: var(--sptsz-primary-rgba-2);
}

.toolbar-item:hover::before {
  opacity: 1;
}

.toolbar-item:active {
  transform: translateY(0) scale(0.98);
}

.toolbar-item svg {
  width: 26px;
  height: 26px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.toolbar-item:hover svg {
  color: var(--sptsz-white);
  transform: scale(1.1);
}

.toolbar-item i {
  display: block;
  width: 26px;
  height: 26px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.toolbar-item:hover i {
  transform: scale(1.1);
}

.icon-like {
  background-image: url('../images/dz.png');
}

.toolbar-item.is-active .icon-like,
.toolbar-item[data-action="like"].is-active .icon-like {
  background-image: url('../images/dz_on.png');
}

.icon-fav {
  background-image: url('../images/xh1.png');
}

.toolbar-item.is-active .icon-fav,
.toolbar-item[data-action="favorite"].is-active .icon-fav {
  background-image: url('../images/xh.png');
}

.icon-share {
  background-image: url('../images/fx.png');
}

.icon-comment {
  background-image: url('../images/pl.png');
}

.icon-backtop {
  background-image: url('../images/icon_backtop.png');
}

.icon-toggle {
  background-image: url('../images/icon_arrow.png');
}

/* 激活状态（排除点赞和收藏按钮） */
.toolbar-item.is-active:not([data-action="favorite"]):not([data-action="like"]) {
  background: linear-gradient(135deg, var(--sptsz-primary) 0%, var(--sptsz-primary-secondary) 100%);
  color: var(--sptsz-white);
  box-shadow: 0 4px 12px var(--sptsz-primary-rgba-4);
}

/* 点赞按钮激活状态（仅改变图标，不改变背景） */
.toolbar-item[data-action="like"].is-active {
  background: var(--sptsz-primary-rgba);
  color: var(--sptsz-primary);
}

/* 收藏按钮激活状态（仅改变图标，不改变背景） */
.toolbar-item[data-action="favorite"].is-active {
  background: var(--sptsz-primary-rgba);
  color: var(--sptsz-primary);
}

/* ==================== 计数徽章 ==================== */
.toolbar-item .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: var(--sptsz-white);
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
  animation: badgePulse 2s ease-in-out infinite;
}

.toolbar-item .badge:empty {
  display: none;
  animation: none;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ==================== 分隔线 ==================== */
.toolbar-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sptsz-primary-rgba-3), transparent);
  margin: 4px 0;
}

.position-bottom .toolbar-divider {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--sptsz-primary-rgba-3), transparent);
  margin: 0 4px;
}

/* ==================== 进度条 ==================== */
.toolbar-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--sptsz-primary-rgba-2);
  overflow: hidden;
  border-radius: 0 0 20px 20px;
}

.toolbar-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--sptsz-primary) 0%, var(--sptsz-primary-secondary) 100%);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--sptsz-primary-rgba-5);
}

.position-bottom .toolbar-progress {
  bottom: auto;
  top: 0;
  height: 100%;
  width: 3px;
  border-radius: 20px 0 0 20px;
}

.position-bottom .toolbar-progress-bar {
  width: 100%;
  height: auto;
  transition: height 0.3s ease;
}

/* ==================== 弹出菜单 ==================== */
.toolbar-popup {
  position: absolute;
  background: var(--sptsz-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--sptsz-shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
}

.toolbar-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 右侧位置弹窗 */
.position-right .toolbar-popup {
  right: 60px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
}

.position-right .toolbar-popup.show {
  transform: translateY(-50%) translateX(0);
}

/* 左侧位置弹窗 */
.position-left .toolbar-popup {
  left: 60px;
  top: 50%;
  transform: translateY(-50%) translateX(-10px);
}

.position-left .toolbar-popup.show {
  transform: translateY(-50%) translateX(0);
}

/* 底部位置弹窗 */
.position-bottom .toolbar-popup {
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
}

.position-bottom .toolbar-popup.show {
  transform: translateX(-50%) translateY(0);
}

/* ==================== 弹出菜单项 ==================== */
.popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--sptsz-text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.popup-item:hover {
  background: var(--sptsz-primary-rgba);
  transform: translateX(-2px);
}

.position-bottom .popup-item:hover {
  transform: translateY(-2px);
}

.popup-item svg {
  width: 20px;
  height: 20px;
  color: var(--sptsz-primary);
  flex-shrink: 0;
}

.popup-item i {
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.icon-wechat {
  background-image: url('../images/icon_wechat.png');
}

.icon-weibo {
  background-image: url('../images/weibo.png');
}

.icon-qq {
  background-image: url('../images/icon_qq.png');
}

.icon-link {
  background-image: url('../images/pl.png');
}

/* ==================== 设置面板 ==================== */
.toolbar-settings {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--sptsz-bg);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--sptsz-shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
  width: 320px;
  max-width: calc(100vw - 40px);
  max-height: 80vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
}

.toolbar-settings.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.settings-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--sptsz-primary-rgba);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: var(--sptsz-primary);
}

.settings-close:hover {
  background: var(--sptsz-primary-rgba-2);
  transform: rotate(90deg);
}

.settings-section {
  margin-bottom: 20px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h4 {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--sptsz-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sptsz-primary-rgba);
}

.settings-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--sptsz-text);
  background: linear-gradient(135deg, var(--sptsz-primary) 0%, var(--sptsz-primary-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 主题选择器 */
.theme-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.theme-option {
  aspect-ratio: 1;
  border: 3px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.theme-option:hover {
  transform: scale(1.05);
}

.theme-option.active {
  border-color: var(--sptsz-primary);
  box-shadow: 0 0 0 3px var(--sptsz-primary-rgba-2);
}

.theme-option::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9px;
}

/* 主题样式 */
.theme-option[data-theme="default"]::after {
  background: linear-gradient(135deg, var(--sptsz-primary-rgba-3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

.theme-option[data-theme="ocean"]::after {
  background: linear-gradient(135deg, rgba(0, 150, 136, 0.3) 0%, rgba(0, 121, 107, 0.3) 100%);
}

.theme-option[data-theme="sunset"]::after {
  background: linear-gradient(135deg, rgba(255, 112, 67, 0.3) 0%, rgba(255, 87, 34, 0.3) 100%);
}

.theme-option[data-theme="forest"]::after {
  background: linear-gradient(135deg, rgba(67, 160, 71, 0.3) 0%, rgba(56, 142, 60, 0.3) 100%);
}

/* 位置选择器 */
.position-selector {
  display: flex;
  gap: 12px;
}

.position-option {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--sptsz-primary-rgba-2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  color: var(--sptsz-text-muted);
  font-size: 14px;
  font-weight: 500;
}

.position-option:hover {
  border-color: var(--sptsz-primary-rgba-4);
  background: var(--sptsz-primary-rgba);
}

.position-option.active {
  border-color: var(--sptsz-primary);
  background: var(--sptsz-primary-rgba);
  color: var(--sptsz-primary);
}

/* 开关选项 */
.toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toggle-option:last-child {
  border-bottom: none;
}

.toggle-option label {
  font-size: 14px;
  color: var(--sptsz-text);
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--sptsz-primary-rgba-2);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--sptsz-white);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.toggle-switch.active {
  background: linear-gradient(135deg, var(--sptsz-primary) 0%, var(--sptsz-primary-secondary) 100%);
}

.toggle-switch.active::after {
  transform: translateX(22px);
}

/* ==================== 提示消息 ==================== */
.toolbar-toast {
  position: absolute;
  top: 50%;
  left: auto;
  right: auto;
  transform: translateY(-50%) scale(0.9);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--sptsz-white);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  z-index: 10002;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  white-space: normal;
  word-wrap: break-word;
  word-break: break-word;
  max-width: 300px;
  min-width: 180px;
  text-align: center;
}

.toolbar-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

/* 右侧位置工具栏的提示消息（默认位置） */
.sptsz-smart-toolbar.position-right .toolbar-toast {
  left: auto;
  right: calc(100% + 20px);
  transform: translateY(-50%) scale(0.9);
}

.sptsz-smart-toolbar.position-right .toolbar-toast.show {
  transform: translateY(-50%) scale(1);
}

/* 左侧位置工具栏的提示消息 */
.sptsz-smart-toolbar.position-left .toolbar-toast {
  left: calc(100% + 20px);
  right: auto;
  transform: translateY(-50%) scale(0.9);
}

.sptsz-smart-toolbar.position-left .toolbar-toast.show {
  transform: translateY(-50%) scale(1);
}

/* 底部位置工具栏的提示消息 */
.sptsz-smart-toolbar.position-bottom .toolbar-toast {
  top: auto;
  bottom: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
}

.sptsz-smart-toolbar.position-bottom .toolbar-toast.show {
  transform: translateX(-50%) scale(1);
}

/* 响应式适配 */
@media (max-width: 1024px) {
  .toolbar-toast {
    max-width: 250px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .sptsz-smart-toolbar.position-right .toolbar-toast {
    left: auto;
    right: calc(100% + 10px);
  }

  .sptsz-smart-toolbar.position-left .toolbar-toast {
    left: calc(100% + 10px);
    right: auto;
  }
}

/* ==================== 遮罩层 ==================== */
.toolbar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10000;
}

.toolbar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 1024px) {
  .sptsz-smart-toolbar.position-right,
  .sptsz-smart-toolbar.position-left {
    right: 10px;
    left: auto;
  }

  .toolbar-main {
    border-radius: 16px;
  }

  .toolbar-toggle,
  .toolbar-item {
    width: 40px;
    height: 40px;
  }

  .toolbar-item {
    border-radius: 10px;
  }
}

@media (max-width: 768px) {
  .toolbar-main {
    border-radius: 24px;
    padding: 6px;
  }

  .position-bottom .toolbar-main {
    flex-direction: row;
  }

  .position-left .toolbar-main,
  .position-right .toolbar-main {
    flex-direction: column;
  }

  .toolbar-toggle {
    width: 44px;
    height: 44px;
  }

  .toolbar-item {
    width: 44px;
    height: 44px;
  }

  .toolbar-item svg {
    width: 22px;
    height: 22px;
  }

  .toolbar-item i {
    width: 22px;
    height: 22px;
  }

  .toolbar-buttons {
    flex-direction: row;
  }

  .position-left .toolbar-buttons,
  .position-right .toolbar-buttons {
    flex-direction: column;
  }

  .toolbar-divider {
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--sptsz-primary-rgba-3), transparent);
    margin: 0 4px;
  }

  .position-left .toolbar-divider,
  .position-right .toolbar-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sptsz-primary-rgba-3), transparent);
    margin: 4px 0;
  }

  .toolbar-popup {
    right: 50px;
    left: auto;
    bottom: 60px;
    top: auto;
    transform: translateY(10px);
  }

  .toolbar-popup.show {
    transform: translateY(0);
  }

  .toolbar-settings {
    min-width: 260px;
    padding: 20px;
  }

  .theme-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== 主题变体 ==================== */

/* 海洋主题 */
.sptsz-smart-toolbar.theme-ocean .toolbar-toggle {
  background: linear-gradient(135deg, #009688 0%, #00796b 100%);
}

.theme-ocean .toolbar-item {
  background: rgba(0, 150, 136, 0.1);
  color: #009688;
}

.theme-ocean .toolbar-item:hover {
  background: rgba(0, 150, 136, 0.2);
}

.theme-ocean .toolbar-item::before {
  background: linear-gradient(135deg, #009688 0%, #00796b 100%);
}

.theme-ocean .toolbar-item.is-active:not([data-action="favorite"]):not([data-action="like"]) {
  background: linear-gradient(135deg, #009688 0%, #00796b 100%);
}

.theme-ocean .toolbar-item[data-action="like"].is-active {
  background: rgba(0, 150, 136, 0.1);
  color: #009688;
}

.theme-ocean .toolbar-item[data-action="favorite"].is-active {
  background: rgba(0, 150, 136, 0.1);
  color: #009688;
}

.theme-ocean .toolbar-progress-bar {
  background: linear-gradient(90deg, #009688 0%, #00796b 100%);
}

/* 日落主题 */
.sptsz-smart-toolbar.theme-sunset .toolbar-toggle {
  background: linear-gradient(135deg, #ff7043 0%, #ff5722 100%);
}

.theme-sunset .toolbar-item {
  background: rgba(255, 112, 67, 0.1);
  color: #ff7043;
}

.theme-sunset .toolbar-item:hover {
  background: rgba(255, 112, 67, 0.2);
}

.theme-sunset .toolbar-item::before {
  background: linear-gradient(135deg, #ff7043 0%, #ff5722 100%);
}

.theme-sunset .toolbar-item.is-active:not([data-action="favorite"]):not([data-action="like"]) {
  background: linear-gradient(135deg, #ff7043 0%, #ff5722 100%);
}

.theme-sunset .toolbar-item[data-action="like"].is-active {
  background: rgba(255, 112, 67, 0.1);
  color: #ff7043;
}

.theme-sunset .toolbar-item[data-action="favorite"].is-active {
  background: rgba(255, 112, 67, 0.1);
  color: #ff7043;
}

.theme-sunset .toolbar-progress-bar {
  background: linear-gradient(90deg, #ff7043 0%, #ff5722 100%);
}

/* 森林主题 */
.sptsz-smart-toolbar.theme-forest .toolbar-toggle {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

.theme-forest .toolbar-item {
  background: rgba(67, 160, 71, 0.1);
  color: #43a047;
}

.theme-forest .toolbar-item:hover {
  background: rgba(67, 160, 71, 0.2);
}

.theme-forest .toolbar-item::before {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

.theme-forest .toolbar-item.is-active:not([data-action="favorite"]):not([data-action="like"]) {
  background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

.theme-forest .toolbar-item[data-action="like"].is-active {
  background: rgba(67, 160, 71, 0.1);
  color: #43a047;
}

.theme-forest .toolbar-item[data-action="favorite"].is-active {
  background: rgba(67, 160, 71, 0.1);
  color: #43a047;
}

.theme-forest .toolbar-progress-bar {
  background: linear-gradient(90deg, #43a047 0%, #388e3c 100%);
}

/* ==================== 暗色模式 ==================== */
@media (prefers-color-scheme: dark) {
  .toolbar-main {
  }

  .toolbar-popup,
  .toolbar-settings {
    background: var(--sptsz-bg-dark-soft);
    border-color: var(--sptsz-border);
    color: var(--sptsz-white);
  }

  .popup-item {
    color: var(--sptsz-white);
  }

  .settings-header h3 {
    color: var(--sptsz-white);
  }

  .settings-section h4 {
    color: var(--sptsz-text-light);
  }

  .toggle-option label {
    color: var(--sptsz-white);
  }

  .position-option {
    color: var(--sptsz-text-light);
    border-color: var(--sptsz-border);
  }

  .position-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
  }
}

body.dark-mode {
  background-color: #0f172a;
  color: #e0e0e0;
}

body.dark-mode .toolbar-main {
}

body.dark-mode .toolbar-popup,
body.dark-mode .toolbar-settings {
  background: var(--sptsz-bg-dark-soft);
  border-color: var(--sptsz-border);
  color: var(--sptsz-white);
}

body.dark-mode .popup-item {
  color: var(--sptsz-white);
}

body.dark-mode .settings-header h3 {
  color: var(--sptsz-white);
}

body.dark-mode .settings-section h4 {
  color: var(--sptsz-text-light);
}

body.dark-mode .toggle-option label {
  color: var(--sptsz-white);
}

body.dark-mode .position-option {
  color: var(--sptsz-text-light);
  border-color: var(--sptsz-border);
}

body.dark-mode .position-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

body.dark-mode a {
  color: #90caf9;
}

body.dark-mode a:hover {
  color: #64b5f6;
}

body.dark-mode .post-content,
body.dark-mode .entry-content {
  color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: var(--sptsz-white);
}

body.dark-mode .box {
  background-color: rgba(30, 41, 59, 0.8);
  border-color: var(--sptsz-border);
}

body.dark-mode .boxTitle {
  border-bottom-color: var(--sptsz-border);
}

body.dark-mode .boxTitle .name {
  color: var(--sptsz-white);
}

/* ==================== 无障碍访问 ==================== */
.toolbar-item:focus-visible,
.toolbar-toggle:focus-visible {
  outline: 2px solid var(--sptsz-primary);
  outline-offset: 2px;
}

/* ==================== 打印样式 ==================== */
@media print {
  .sptsz-smart-toolbar {
    display: none;
  }
}
