/* 现代化管理后台卡片风格样式 */

@import url('css/noto_sans_sc.css');

:root {
  /* 主色调 - 深色科技蓝 */
  --primary-color: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  
  /* 背景色 */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  
  /* 文字色 */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  /* 功能色 */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  --highlight-color: #ef15e4dd; /* 新增一个显眼的青绿色 */
  
  /* 边框和阴影 */
  --border-color: #334155;
  --border-light: #475569;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* 过渡 */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  overflow: hidden; /* 禁用页面滚动 */
}

.main-app-container {
  min-width: 320px;
  min-height: 400px;
  width: 95vw;
  height: 95vh;
  margin: 2.5vh auto;
  display: flex;
  gap: 24px;
  background: none;
  align-items: stretch;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  transition: var(--transition);
  overflow: hidden; /* 确保主容器不滚动 */
  position: relative;
}

.sidebar {
  min-width: 260px;
  max-width: 280px;
  width: 260px;
  height: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: var(--transition);
  border-right: 1px solid var(--border-color);
  overflow-x: hidden; /* 防止侧边栏水平滚动 */
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: var(--radius-xl) 0 0 0;
}

.sidebar-header h5 {
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#sidebarMenu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto; /* 允许垂直滚动 */
  overflow-x: hidden; /* 防止水平滚动 */
  max-height: calc(100vh - 200px); /* 设置最大高度，确保可以滚动 */
}

.sidebar .nav-link {
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  margin: 4px 0;
  text-align: left;
  transition: var(--transition);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.sidebar .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: var(--primary-color);
  transform: scaleY(0);
  transition: var(--transition);
}

.sidebar .nav-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar .nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-light);
  font-weight: 600;
}

.sidebar .nav-link.active::before {
  transform: scaleY(1);
}

.sidebar .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.user-info {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.8);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  transition: var(--transition);
  padding: 8px 0;
  font-size: 0.9rem;
}

.info-item:hover {
  color: var(--text-primary);
}

.info-item i {
  color: var(--primary-light);
  opacity: 0.8;
  font-size: 1rem;
}

#vip-status i {
  color: #fbbf24;
}

.content-area {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: var(--bg-primary);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  overflow: hidden; /* 禁用内容区滚动 */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden; /* 防止水平滚动 */
}

.window {
  display: none;
  height: 100%;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.window.active {
  display: flex;
}

.window-header {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  flex-shrink: 0;
}

.window-time {
  color: var(--text-secondary);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
}

.card-container {
  flex: 1;
  padding: 0; /* 移除padding，让卡片扩展到边缘 */
  overflow-y: auto; /* 允许卡片容器垂直滚动 */
  overflow-x: hidden; /* 防止水平滚动 */
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  margin: 24px; /* 使用margin代替padding，让卡片与window-header对齐 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100% - 48px); /* 减去上下margin */
  min-height: 0;
  width: calc(100% - 48px); /* 减去左右margin，与window-header对齐 */
  max-width: calc(100% - 48px); /* 防止超出容器 */
}

/* 确保卡片宽度与window-header对齐 */
.window-header {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  flex-shrink: 0;
  width: 100%; /* 确保window-header宽度为100% */
  box-sizing: border-box; /* 包括padding在宽度计算中 */
}

/* 确保所有窗口的卡片容器宽度一致 */
#main-window .card-container,
#logs-window .card-container,
#help-window .card-container {
  width: 100%;
  box-sizing: border-box;
}

/* 扫描目录、刮削、设置界面不再需要card-container */
#directory-window .card-container,
#scrape-window .card-container,
#settings-window .card-container {
  padding: 0;
  margin: 0;
  background: transparent;
  overflow: visible;
}

/* 确保所有窗口的卡片宽度一致 */
#main-window .card,
#logs-window .card,
#help-window .card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* 扫描目录、刮削、设置界面的卡片直接使用窗口布局 */
#directory-window .card,
#scrape-window .card,
#settings-window .card {
  margin: 0;
  border-radius: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  box-shadow: none;
  border: none;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}

/* 刮削界面的特殊布局 - 确保功能按钮在底部 */
#scrape-window .card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

#scrape-window .tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 刮削界面标签页通用布局 */
#scrape-window .tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 刮削界面表格容器 */
#scrape-window .table-responsive {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: calc(100vh - 250px);
}

/* 刮削界面分页控件 */
#scrape-window .pagination-controls {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

/* 刮削界面底部控制区域 */
.scrape-control-area {
  flex-shrink: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.scrape-control-area .border-bottom {
  border-bottom: 1px solid var(--border-color) !important;
}

/* 分页信息样式 */
.scrape-control-area .pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 100px;
  font-weight: 500;
}

/* 分页按钮容器 - 居中显示 */
.scrape-control-area .pagination-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex: 1;
}

/* 分页按钮样式 - 增大尺寸 */
.scrape-control-area .pagination-buttons .btn-sm {
  padding: 8px 12px;
  font-size: 0.9rem;
  min-width: 40px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.scrape-control-area .pagination-buttons .btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 分页信息显示样式 */
.scrape-control-area .pagination-buttons span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
}

/* 功能按钮容器 */
.scrape-control-area .action-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  width: 100%;
}

/* 功能按钮样式 - 增大尺寸 */
.scrape-control-area .action-buttons .btn-sm {
  padding: 10px 16px;
  font-size: 0.95rem;
  min-width: 100px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.scrape-control-area .action-buttons .btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 按钮行左对齐 */
.scrape-control-area .d-flex.justify-content-start {
  justify-content: flex-start !important;
  padding-left: 12px;
}

/* 分页行布局调整 - 确保分页按钮居中 */
.scrape-control-area .d-flex.justify-content-between.align-items-center.p-2.border-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px !important; /* 增加上下内边距 */
  min-height: 64px; /* 增加最小高度 */
}

/* 确保分页按钮容器占据中间空间 */
.scrape-control-area .pagination-buttons {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 8px 0; /* 添加上下边距 */
}

/* 分页按钮样式 - 增加上下边距 */
.scrape-control-area .pagination-buttons .btn-sm {
  padding: 10px 16px;
  font-size: 0.95rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  border: 2px solid #6b7280;
  margin: 4px 0; /* 添加上下边距 */
}

/* 分页信息显示样式 - 增加上下边距 */
.scrape-control-area .pagination-buttons span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 80px;
  text-align: center;
  margin: 8px 0; /* 添加上下边距 */
  display: inline-block;
  line-height: 1.5;
}

/* 修复刮削记录管理翻页按钮中 / 符号前后间距不一致问题 */
.scrape-control-area .pagination-buttons #scrape-current-page-display,
.scrape-control-area .pagination-buttons #scrape-success-current-page-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px; /* 确保 / 符号前后有相同的间距 */
  margin: 0 8px; /* 左右边距 */
  padding: 0 4px; /* 内边距 */
  min-width: auto; /* 移除固定最小宽度 */
  white-space: nowrap; /* 防止换行 */
}

/* 确保 / 符号本身有适当的间距 */
.scrape-control-area .pagination-buttons #scrape-current-page-display::before,
.scrape-control-area .pagination-buttons #scrape-success-current-page-display::before,
.scrape-control-area .pagination-buttons #scrape-current-page-display::after,
.scrape-control-area .pagination-buttons #scrape-success-current-page-display::after {
  content: none; /* 移除伪元素，使用 gap 属性控制间距 */
}

/* 确保 / 符号显示正常 */
.scrape-control-area .pagination-buttons #scrape-current-page-display,
.scrape-control-area .pagination-buttons #scrape-success-current-page-display {
  font-family: 'Fira Code', 'Menlo', 'Monaco', monospace; /* 使用等宽字体确保对齐 */
  letter-spacing: 0.5px; /* 轻微字母间距 */
}

/* 确保 / 符号前后数字对齐 */
.scrape-control-area .pagination-buttons #scrape-current-page-display > span,
.scrape-control-area .pagination-buttons #scrape-success-current-page-display > span {
  display: inline-block;
  min-width: 20px; /* 确保数字有相同的最小宽度 */
  text-align: center;
}

/* 分页信息样式 - 增加上下边距 */
.scrape-control-area .pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 100px;
  font-weight: 500;
  margin: 8px 0; /* 添加上下边距 */
  display: inline-block;
  line-height: 1.5;
}

/* 确保表格内容区域正确显示 */
#scrape-window .tab-pane > div:first-child {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 修复已刮削界面的特殊需求 */
#success-scrape .table-responsive {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 修复待刮削界面的特殊需求 */
#pending-scrape .table-responsive {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 修复刮削界面表格样式 */
#scrape-window .table {
  width: 100%;
  table-layout: fixed;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

#scrape-window .table th,
#scrape-window .table td {
  padding: 12px 8px;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--border-color);
}

#scrape-window .table th {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-primary);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* 确保标签页内容正确隔离 */
#scrape-tab-content .tab-pane {
  display: none;
  height: 100%;
  width: 100%;
  position: relative;
}

#scrape-tab-content .tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* 防止标签页内容重叠 */
#scrape-tab-content {
  position: relative;
  height: 100%;
  width: 100%;
}

#scrape-tab-content > .tab-pane {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#scrape-tab-content > .tab-pane:not(.active) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

#scrape-tab-content > .tab-pane.active {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* 调整刮削界面表格列宽 */
#scrape-window .table th:nth-child(1),
#scrape-window .table td:nth-child(1) {
  width: 5%;
}

#scrape-window .table th:nth-child(2),
#scrape-window .table td:nth-child(2) {
  width: 30%;
  text-align: left;
}

#scrape-window .table th:nth-child(3),
#scrape-window .table td:nth-child(3) {
  width: 20%;
  text-align: left;
}

#scrape-window .table th:nth-child(4),
#scrape-window .table td:nth-child(4) {
  width: 12%;
}

#scrape-window .table th:nth-child(5),
#scrape-window .table td:nth-child(5) {
  width: 10%;
}

#scrape-window .table th:nth-child(6),
#scrape-window .table td:nth-child(6) {
  width: 10%;
}

#scrape-window .table th:nth-child(7),
#scrape-window .table td:nth-child(7) {
  width: 10%;
}

#scrape-window .table th:nth-child(8),
#scrape-window .table td:nth-child(8) {
  width: 13%;
}

/* 修复成功记录表格列宽 */
#scrape-success-list .table th:nth-child(1),
#scrape-success-list .table td:nth-child(1) {
  width: 5%;
}

#scrape-success-list .table th:nth-child(2),
#scrape-success-list .table td:nth-child(2) {
  width: 25%;
  text-align: left;
}

#scrape-success-list .table th:nth-child(3),
#scrape-success-list .table td:nth-child(3) {
  width: 20%;
  text-align: left;
}

#scrape-success-list .table th:nth-child(4),
#scrape-success-list .table td:nth-child(4) {
  width: 10%;
}

#scrape-success-list .table th:nth-child(5),
#scrape-success-list .table td:nth-child(5) {
  width: 10%;
}

#scrape-success-list .table th:nth-child(6),
#scrape-success-list .table td:nth-child(6) {
  width: 10%;
}

#scrape-success-list .table th:nth-child(7),
#scrape-success-list .table td:nth-child(7) {
  width: 10%;
}

#scrape-success-list .table th:nth-child(8),
#scrape-success-list .table td:nth-child(8) {
  width: 10%;
  text-align: center;
}

/* 修复刮削界面按钮样式 */
#scrape-window .btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  line-height: 1.2;
  border-radius: 4px;
  min-width: 60px;
}

/* 修复分页控件样式 */
#scrape-window .pagination-controls {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  flex-shrink: 0;
}

#scrape-window .pagination-controls .btn {
  padding: 4px 12px;
  font-size: 0.85rem;
  min-width: 80px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 修复分页控件通用样式 */
.pagination-controls {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  flex-shrink: 0;
}

.pagination-controls.p-2.border-top {
  padding: 8px 16px !important;
  min-height: 48px !important;
}

.pagination-controls .btn {
  padding: 4px 12px;
  font-size: 0.85rem;
  min-width: 80px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 修复底部按钮样式 */
#scrape-window .bottom-buttons {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  min-height: 48px;
  align-items: center;
  flex-shrink: 0;
}

/* 修复刮削界面底部按钮容器高度 */
#scrape-window .bottom-buttons.p-2.border-top {
  padding: 8px 16px !important;
  min-height: 48px !important;
}

/* 修复底部按钮样式 */
.bottom-buttons {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  min-height: 48px;
  align-items: center;
  flex-shrink: 0;
}

.bottom-buttons.p-2.border-top {
  padding: 8px 16px !important;
  min-height: 48px !important;
}

/* 修复成功记录表格样式 */
#scrape-success-list .table th:nth-child(8),
#scrape-success-list .table td:nth-child(8) {
  width: 10%;
  text-align: center;
}

/* 修复复选框样式 */
#scrape-success-list .record-checkbox {
  width: 18px;
  height: 18px;
  margin: 0 auto;
  cursor: pointer;
}

/* 修复表格行选中样式 - 适用于所有表格 */
.table tbody tr.selected-row td {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25)) !important;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  color: var(--text-primary) !important;
}

.table tbody tr.selecting-row td {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35)) !important;
  font-weight: 600;
  color: var(--text-primary) !important;
  animation: selecting-pulse 1.5s ease-in-out infinite;
}

/* 确保待刮削界面的表格行也能正确显示选中状态 */
#scrape-failures-list tr.selected-row td,
#scrape-success-list tr.selected-row td {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25)) !important;
}

#scrape-failures-list tr.selecting-row td,
#scrape-success-list tr.selecting-row td {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35)) !important;
  animation: selecting-pulse 1.5s ease-in-out infinite;
}

/* 调整主窗口和日志窗口的特殊卡片样式 */
#main-window .card-container,
#logs-window .card-container {
  padding: 0;
}

#main-window .card,
#logs-window .card {
  margin: 0;
  border-radius: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%; /* 确保宽度为100% */
  max-width: 100%; /* 确保最大宽度为100% */
}

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

.card-header {
  background: rgba(30, 41, 59, 0.8);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

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

.card-body {
  padding: 0; /* 移除内边距，让内容直接填充 */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 隐藏溢出，让内部元素控制滚动 */
}

#main-window .card-container,

#logs-window .card-container {
  padding: 0;
}

#main-window .card,

#logs-window .card {
  margin: 0;
  border-radius: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#main-window .card-body,

#logs-window .card-body {
  padding: 0;
  flex: 1;
  min-height: 0;
}

#main-window .card-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}

#main-window .card:first-child {
  flex: 1;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color);
}

#main-window .card:last-child {
  flex-shrink: 0;
  margin-bottom: 0;
  height: auto;
}

#main-window .card:last-child .card-body {
  padding: 20px;
  flex: none;
  min-height: auto;
}

#main-window .input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

#main-window .input-group .form-control {
  flex: 1;
  font-size: 0. ninerem;
  font-size: 0.9rem; /* 主文字大小：0.9rem */
  padding: 8px 10px; /* 更紧凑的内边距 */
  height: 40px; /* 固定高度以便与按钮对齐 */
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  color: var(--text-primary);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
  box-sizing: border-box;
}

#main-window .input-group .form-control::placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}

#main-window .input-group .form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.06);
  outline: none;
}

#main-window .input-group .btn {
  flex-shrink: 0;
  height: 40px;
  padding: 0 14px;
  font-size: 0.9rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  #main-window .input-group .form-control {
    height: 36px;
    font-size: 0.88rem;
    padding: 6px 8px;
  }
  #main-window .input-group .btn {
    height: 36px;
    padding: 0 10px;
    font-size: 0.88rem;
  }
}

#main-window .input-group .form-control:disabled,

#main-window .input-group .btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.table-responsive {
  border-radius: var(--radius-md);
  overflow: auto; /* 允许水平滚动 */
}

.table {
  background: var(--bg-card);
  color: var(--text-primary);
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text-primary);
  font-weight: 600;
  padding: 16px;
  border-bottom: 2px solid var(--border-light);
  text-align: left;
}

.table td {
  background: var(--bg-card);
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-secondary);
}

.table-hover tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
  cursor: pointer;
}

.table-hover tbody tr:hover td {
  color: var(--text-primary);
}

.form-label {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.form-control,

.form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: var(--transition);
  width: 100%;
  height: 48px; /* 统一高度 */
}

.form-control:focus,

.form-select:focus {
  background: var(--bg-secondary);
  border-color: var(--primary-light);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

/* ==================== 统一按钮基础样式 ==================== */
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1rem;
  min-height: 48px;
  min-width: 100px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 小尺寸按钮 */
.btn-sm {
  padding: 10px 20px;
  font-size: 0.95rem;
  min-height: 42px;
  min-width: 90px;
  border-radius: 10px;
}

/* 超小尺寸按钮 */
.btn-xs {
  padding: 8px 16px;
  font-size: 0.9rem;
  min-height: 36px;
  min-width: 80px;
  border-radius: 8px;
}

/* 轮廓按钮 */
.btn-outline-primary,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-info,
.btn-outline-secondary {
  background: transparent !important;
  border: 2px solid;
  color: var(--text-primary);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover {
  color: white !important;
}

/* ==================== 功能按钮颜色区分 ==================== */

/* 1. 主要操作按钮 - 蓝色渐变 (新增、保存、确定等) */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: 2px solid #3b82f6;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #2563eb;
}

/* 2. 成功操作按钮 - 绿色渐变 (启用、启动、成功操作) */
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: 2px solid #10b981;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  border-color: #059669;
}

/* 3. 警告操作按钮 - 橙色渐变 (移至待刮削、编辑等) */
.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: 2px solid #f59e0b;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #d97706;
}

/* 4. 危险操作按钮 - 红色渐变 (删除、停止、清除等) */
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: 2px solid #ef4444;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #dc2626;
}

/* 5. 信息操作按钮 - 青色渐变 (查看、刷新、信息等) */
.btn-info {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  border: 2px solid #06b6d4;
}

.btn-info:hover {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  border-color: #0891b2;
}

/* 6. 次要操作按钮 - 灰色渐变 (取消、关闭、重置等) */
.btn-secondary {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  border: 2px solid #6b7280;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
  border-color: #4b5563;
}

/* 7. 特殊功能按钮 - 紫色渐变 (批量操作、高级功能) */
.btn-purple {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border: 2px solid #8b5cf6;
}

.btn-purple:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-color: #7c3aed;
}

/* ==================== 特定按钮样式调整 ==================== */

/* 侧边栏导航按钮 */
.sidebar .nav-link {
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px;
  margin: 4px 0;
  text-align: left;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  min-height: 48px;
  min-width: 100%;
  box-shadow: none;
}

.sidebar .nav-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25));
  color: var(--primary-light);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* 标签页导航按钮 */
.card-header-tabs .nav-link {
  background: transparent;
  color: var(--text-secondary);
  border-radius: 10px 10px 0 0;
  font-weight: 500;
  border: none;
  padding: 14px 20px;
  transition: all 0.3s ease;
  min-height: 48px;
  box-shadow: none;
}

.card-header-tabs .nav-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.card-header-tabs .nav-link.active {
  background: var(--bg-card);
  color: var(--primary-light);
  font-weight: 600;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(1px);
}

/* 批量切换按钮 */
.batch-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 8px;
  font-size: 0.8rem;
  padding: 0;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.batch-toggle-btn:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.batch-toggle-btn:active {
  transform: scale(0.95);
}

/* 刮削界面分页按钮 */
.scrape-control-area .pagination-buttons .btn-sm {
  padding: 10px 16px;
  font-size: 0.95rem;
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  border: 2px solid #6b7280;
}

.scrape-control-area .pagination-buttons .btn-sm:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563, #374151);
  border-color: #4b5563;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.scrape-control-area .pagination-buttons .btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 刮削界面功能按钮 - 与其他界面保持一致 */
.scrape-control-area .action-buttons .btn-sm {
  padding: 12px 20px;
  font-size: 1rem;
  min-width: 110px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
}

/* 刮削界面按钮悬停效果 */
.scrape-control-area .action-buttons .btn-sm:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* 刮削界面按钮流光动画 */
.scrape-control-area .action-buttons .btn-sm::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.scrape-control-area .action-buttons .btn-sm:hover::before {
  left: 100%;
}

/* 刮削界面按钮颜色与其他界面保持一致 */
.scrape-control-area .action-buttons .btn-outline-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: white !important;
  border: 2px solid #3b82f6 !important;
}

.scrape-control-area .action-buttons .btn-outline-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #2563eb !important;
}

.scrape-control-area .action-buttons .btn-outline-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
  border: 2px solid #10b981 !important;
}

.scrape-control-area .action-buttons .btn-outline-success:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  border-color: #059669 !important;
}

.scrape-control-area .action-buttons .btn-outline-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: white !important;
  border: 2px solid #f59e0b !important;
}

.scrape-control-area .action-buttons .btn-outline-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  border-color: #d97706 !important;
}

.scrape-control-area .action-buttons .btn-outline-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: white !important;
  border: 2px solid #ef4444 !important;
}

.scrape-control-area .action-buttons .btn-outline-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  border-color: #dc2626 !important;
}

.scrape-control-area .action-buttons .btn-outline-info {
  background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
  color: white !important;
  border: 2px solid #06b6d4 !important;
}

.scrape-control-area .action-buttons .btn-outline-info:hover {
  background: linear-gradient(135deg, #0891b2, #0e7490) !important;
  border-color: #0891b2 !important;
}

.scrape-control-area .action-buttons .btn-outline-secondary {
  background: linear-gradient(135deg, #6b7280, #4b5563) !important;
  color: white !important;
  border: 2px solid #6b7280 !important;
}

.scrape-control-area .action-buttons .btn-outline-secondary:hover {
  background: linear-gradient(135deg, #4b5563, #374151) !important;
  border-color: #4b5563 !important;
}

/* ==================== 底部按钮统一样式 ==================== */
.bottom-buttons {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  min-height: 60px;
  align-items: center;
  flex-shrink: 0;
}

/* 所有底部按钮统一尺寸 */
.bottom-buttons .btn,
.modal-footer .btn,
.scrape-control-area .action-buttons .btn,
#directory-window .bottom-buttons .btn,
#settings-window .bottom-buttons .btn {
  min-width: 120px;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
}

/* 底部按钮悬停效果 */
.bottom-buttons .btn:hover,
.modal-footer .btn:hover,
.scrape-control-area .action-buttons .btn:hover,
#directory-window .bottom-buttons .btn:hover,
#settings-window .bottom-buttons .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* 底部按钮流光动画 */
.bottom-buttons .btn::before,
.modal-footer .btn::before,
.scrape-control-area .action-buttons .btn::before,
#directory-window .bottom-buttons .btn::before,
#settings-window .bottom-buttons .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.bottom-buttons .btn:hover::before,
.modal-footer .btn:hover::before,
.scrape-control-area .action-buttons .btn:hover::before,
#directory-window .bottom-buttons .btn:hover::before,
#settings-window .bottom-buttons .btn:hover::before {
  left: 100%;
}

/* ==================== 表格按钮统一样式 ==================== */
/* 表格中的按钮 - 比底部按钮小一些 */
.table .btn,
.table td .btn,
.table th .btn,
#directory-tasks-list .btn,
#scrape-failures-list .btn,
#scrape-success-list .btn,
.cron-action-btn,
.batch-toggle-btn,
.btn-xs {
  min-width: 80px;
  min-height: 36px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
}

/* 表格按钮悬停效果 */
.table .btn:hover,
.table td .btn:hover,
.table th .btn:hover,
#directory-tasks-list .btn:hover,
#scrape-failures-list .btn:hover,
#scrape-success-list .btn:hover,
.cron-action-btn:hover,
.batch-toggle-btn:hover,
.btn-xs:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 表格按钮流光动画 */
.table .btn::before,
.table td .btn::before,
.table th .btn::before,
#directory-tasks-list .btn::before,
#scrape-failures-list .btn::before,
#scrape-success-list .btn::before,
.cron-action-btn::before,
.batch-toggle-btn::before,
.btn-xs::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.table .btn:hover::before,
.table td .btn:hover::before,
.table th .btn:hover::before,
#directory-tasks-list .btn:hover::before,
#scrape-failures-list .btn:hover::before,
#scrape-success-list .btn:hover::before,
.cron-action-btn:hover::before,
.batch-toggle-btn:hover::before,
.btn-xs:hover::before {
  left: 100%;
}

/* 批量切换按钮特殊样式 */
.batch-toggle-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.batch-toggle-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* 定时任务操作按钮 */
.cron-action-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* 目录窗口表格中的按钮组 */
#directory-window .table td .btn-group .btn {
  min-width: 80px;
  min-height: 36px;
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* 刮削界面分页按钮 */
.scrape-control-area .pagination-buttons .btn-sm {
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.95rem;
  border-radius: 10px;
}

/* 刮削界面功能按钮 */
.scrape-control-area .action-buttons .btn-sm {
  min-width: 110px;
  min-height: 46px;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 10px;
}

/* 输入组中的按钮 */
.input-group .btn {
  min-width: auto;
  min-height: 48px;
  border-radius: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  /* 底部按钮响应式 */
  .bottom-buttons {
    padding: 16px 20px;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .bottom-buttons .btn,
  .modal-footer .btn,
  .scrape-control-area .action-buttons .btn,
  #directory-window .bottom-buttons .btn,
  #settings-window .bottom-buttons .btn {
    min-width: 100px;
    min-height: 44px;
    padding: 10px 20px;
    font-size: 0.95rem;
  }
  
  /* 表格按钮响应式 */
  .table .btn,
  .table td .btn,
  .table th .btn,
  #directory-tasks-list .btn,
  #scrape-failures-list .btn,
  #scrape-success-list .btn,
  .cron-action-btn,
  .batch-toggle-btn,
  .btn-xs {
    min-width: 70px;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  .batch-toggle-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 0.7rem;
  }
  
  .cron-action-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 0.8rem;
  }
  
  /* 刮削界面按钮响应式 */
  .scrape-control-area .pagination-buttons .btn-sm {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.9rem;
  }
  
  .scrape-control-area .action-buttons .btn-sm {
    min-width: 100px;
    min-height: 42px;
    padding: 10px 16px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  /* 底部按钮响应式 */
  .bottom-buttons {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .bottom-buttons .btn,
  .modal-footer .btn,
  .scrape-control-area .action-buttons .btn,
  #directory-window .bottom-buttons .btn,
  #settings-window .bottom-buttons .btn {
    min-width: 90px;
    min-height: 40px;
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  /* 表格按钮响应式 */
  .table .btn,
  .table td .btn,
  .table th .btn,
  #directory-tasks-list .btn,
  #scrape-failures-list .btn,
  #scrape-success-list .btn,
  .cron-action-btn,
  .batch-toggle-btn,
  .btn-xs {
    min-width: 60px;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  
  .batch-toggle-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    font-size: 0.6rem;
  }
  
  .cron-action-btn {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 0.7rem;
  }
  
  /* 刮削界面按钮响应式 */
  .scrape-control-area .pagination-buttons .btn-sm {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  
  .scrape-control-area .action-buttons .btn-sm {
    min-width: 90px;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.9rem;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    min-height: 44px;
    min-width: 90px;
  }
  
  .btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: 40px;
    min-width: 80px;
  }
  
  .btn-xs {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 36px;
    min-width: 70px;
  }
  
  .bottom-buttons {
    padding: 16px 20px;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .bottom-buttons .btn {
    min-width: 100px;
    flex: 1;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: 40px;
    min-width: 80px;
  }
  
  .bottom-buttons {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .bottom-buttons .btn {
    min-width: 90px;
  }
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--primary-light);
  color: white;
  font-size: 12px;
  cursor: help;
  transition: var(--transition);
}

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

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 24px;
}

.modal-title {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-body {
  padding: 24px;
  color: var(--text-primary);
}

.modal-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
}

.tag-input-container {
  display: flex;
  flex-wrap: nowrap; /* 单行显示，超出横向滚动 */
  align-items: center;
  padding: 10px 16px; /* 调整垂直内边距以适应固定高度 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: var(--transition);
  height: 48px; /* 统一高度 */
  overflow-x: auto; /* 单行超出时横向滚动，避免容器增高 */
  overflow-y: hidden; /* 明确禁止纵向滚动条 */
  -webkit-overflow-scrolling: touch;
}

.tag-input-container:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.tag-item {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #161616;
  padding: 4px 10px; /* 缩小 padding，使标签更紧凑 */
  height: 28px; /* 调整为 28px，与输入框内文字对齐 */
  line-height: 1;
  border-radius: 6px;
  margin: 0 8px 0 0; /* 右侧间距，避免换行 */
  font-weight: 500;
  font-size: 0.85rem; /* 合理文字大小 */
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-item .remove-tag {
  margin-left: 6px;
  cursor: pointer;
  font-weight: 700;
  color: rgba(22, 23, 25, 0.6);
  font-size: 0.95rem;
  line-height: 1;
}

.tag-input-container input {
  flex: 1 1 auto; /* 允许输入框填充可用空间并根据需要收缩 */
  border: none;
  outline: none;
  padding: 4px 6px;
  height: 28px;
  min-width: 50px; /* 设置一个较小的最小宽度 */
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.tag-input-container::-webkit-scrollbar {
  height: 6px;
}

.tag-input-container::-webkit-scrollbar-track {
  background: transparent;
}

.tag-input-container::-webkit-scrollbar-thumb {
  background: rgba(51,65,85,0.6);
  border-radius: 3px;
}

.tag-input-container {
  -ms-overflow-style: none; /* IE 10+ */
  scrollbar-width: thin; /* Firefox */
}

.time-option {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
  min-width: 60px;
  font-size: 0.9rem;
  line-height: 1.2;
  margin: 2px;
  box-sizing: border-box;
  flex: 0 0 calc(12.5% - 4px); /* 每行8个，每个占12.5%宽度减去边距 */
  max-width: calc(12.5% - 4px);
}

.time-option:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.time-option.selected {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-color: var(--primary-light);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

#hours-container {
  display: flex !important;
  flex-wrap: wrap !important; /* 允许换行，固定3行 */
  gap: 4px !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: 100% !important;
  overflow-x: hidden !important; /* 隐藏水平滚动，因为会换行 */
  padding-bottom: 4px !important;
  height: auto !important;
  min-height: 120px !important; /* 固定高度，确保显示3行 */
  max-height: 120px !important; /* 固定最大高度，防止超过3行 */
}

#weekdays-container {
  display: flex !important;
  flex-wrap: nowrap !important; /* 禁止换行，强制一行显示 */
  gap: 4px !important;
  justify-content: flex-start !important;
  align-items: center !important;
  width: 100% !important;
  overflow-x: auto !important; /* 如果内容超出，允许水平滚动 */
  -webkit-overflow-scrolling: touch !important;
  padding-bottom: 4px !important; /* 为滚动条留出空间 */
  height: auto !important;
  min-height: 40px !important; /* 固定最小高度 */
}

#weekdays-container .time-option {
  flex: 0 0 calc(14.28% - 4px) !important; /* 每行7个，每个占14.28%宽度减去边距 */
  max-width: calc(14.28% - 4px) !important;
  flex-shrink: 0 !important; /* 禁止收缩，保持固定宽度 */
  min-width: calc(14.28% - 4px) !important;
  box-sizing: border-box !important;
}

#hours-container .time-option {
  flex: 0 0 calc(12.5% - 4px) !important; /* 每行8个，每个占12.5%宽度减去边距 */
  max-width: calc(12.5% - 4px) !important;
  flex-shrink: 0 !important; /* 禁止收缩，保持固定宽度 */
  min-width: calc(12.5% - 4px) !important;
  box-sizing: border-box !important;
  height: 32px !important; /* 固定高度 */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#cron-task-modal #hours-container,

#cron-task-modal #weekdays-container {
  all: unset !important;
  display: flex !important;
}

#cron-task-modal #hours-container {
  flex-wrap: wrap !important;
  height: 120px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#cron-task-modal #weekdays-container {
  flex-wrap: nowrap !important;
  height: 40px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

#cron-task-modal .card.bg-dark.border-secondary {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

#cron-task-modal .card.bg-dark.border-secondary .card-body {
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

#cron-task-modal .card.bg-dark.border-secondary .form-label {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.95rem;
  display: block;
}

#cron-task-modal .card.bg-dark.border-secondary .frequency-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.95rem;
  width: 100%;
  transition: var(--transition);
}

#cron-task-modal .card.bg-dark.border-secondary .frequency-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

#cron-task-modal .card.bg-dark.border-secondary .frequency-input::placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
}

#cron-task-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
}

#cron-task-modal .modal-content {
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  /* 移除时间选项的换行规则，保持一行显示 */
  .time-option {
    flex-shrink: 0; /* 禁止收缩，保持固定宽度 */
    min-width: 50px; /* 保持最小宽度 */
    padding: 6px 8px;
    font-size: 0.85rem;
  }
  
  /* 移除星期选项的换行规则，保持一行显示 */
  #weekdays-container .time-option {
    flex-shrink: 0; /* 禁止收缩，保持固定宽度 */
  }
  
  #cron-task-modal .modal-dialog {
    margin: 10px;
  }
  
  #cron-task-modal .modal-body {
    max-height: 60vh;
  }
}

@media (max-width: 480px) {
  /* 移除时间选项的换行规则，保持一行显示 */
  .time-option {
    flex-shrink: 0; /* 禁止收缩，保持固定宽度 */
    min-width: 40px; /* 保持最小宽度 */
    padding: 5px 6px;
    font-size: 0.8rem;
  }
  
  /* 移除星期选项的换行规则，保持一行显示 */
  #weekdays-container .time-option {
    flex-shrink: 0; /* 禁止收缩，保持固定宽度 */
  }
  
  /* 在小屏幕上，如果内容太多，允许水平滚动 */
  #hours-container, #weekdays-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

#hours-container::-webkit-scrollbar,

#weekdays-container::-webkit-scrollbar {
  height: 6px;
}

#hours-container::-webkit-scrollbar-track,

#weekdays-container::-webkit-scrollbar-track {
  background: rgba(51, 65, 85, 0.1);
  border-radius: 3px;
}

#hours-container::-webkit-scrollbar-thumb,

#weekdays-container::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.5);
  border-radius: 3px;
}

#hours-container::-webkit-scrollbar-thumb:hover,

#weekdays-container::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

@media (max-width: 1200px) {
    /* 移除对 .search-results-row 的固定列数限制，让 auto-fill 生效 */
}

@media (max-width: 992px) {
    /* 移除对 .search-results-row 的固定列数限制，让 auto-fill 生效 */
}

@media (max-width: 768px) {
    /* 移除对 .search-results-row 的固定列数限制，让 auto-fill 生效 */
    
    .search-results-row {
        /* 确保在小屏幕下也能正常响应 */
    }
    
    .result-info {
        padding: 12px;
    }
    
    .result-title {
        font-size: 0.9rem;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .pagination-controls .btn {
        min-width: 70px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .search-results-row {
        /* 确保在更小屏幕下也能正常响应 */
    }
    
    .search-result-item {
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
  .main-app-container {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    gap: 0;
    overflow-y: auto; /* 允许整个应用在需要时滚动 */
  }
  
  .sidebar {
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    border-radius: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    height: auto;
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: relative;
    flex-shrink: 0; /* 防止侧边栏被压缩 */
  }
  
  .sidebar.expanded {
    max-height: 50vh; /* 最大高度改为视口高度的一半 */
    overflow-y: auto; /* 改为垂直滚动 */
    overflow-x: hidden; /* 防止水平滚动 */
  }
  
  .sidebar-header {
    border-radius: 0;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }
  
  .sidebar-header::after {
    content: "▼";
    font-size: 0.8rem;
    color: white;
    transition: transform 0.3s ease;
  }
  
  .sidebar.expanded .sidebar-header::after {
    transform: rotate(180deg);
  }
  
  .sidebar-header h5 {
    font-size: 1.1rem;
    margin: 0;
  }
  
  #sidebarMenu {
    padding: 0;
    display: none;
    flex-direction: column !important; /* 强制垂直排列 */
    flex-wrap: nowrap !important; /* 强制不换行 */
    overflow-y: auto; /* 确保导航菜单可以垂直滚动 */
    overflow-x: hidden; /* 防止水平滚动 */
    max-height: calc(50vh - 60px); /* 减去标题栏高度 */
  }
  
  .sidebar.expanded #sidebarMenu {
    display: flex;
  }
  
  .sidebar .nav-link {
    width: 100% !important; /* 强制100%宽度 */
    padding: 12px 20px;
    font-size: 0.95rem;
    margin: 0 !important; /* 移除边距 */
    text-align: left;
    justify-content: flex-start;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    flex-direction: row; /* 确保图标和文字水平排列 */
    display: flex;
    align-items: center;
    flex-shrink: 0; /* 防止按钮被压缩 */
  }
  
  .sidebar .nav-link:last-child {
    border-bottom: none;
  }
  
  .sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    flex-shrink: 0; /* 防止图标被压缩 */
  }
  
  .user-info {
    display: none; /* 在小屏幕上隐藏用户信息区域 */
  }
  
  .content-area {
    border-radius: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden; /* 小屏幕下也禁用滚动 */
  }
  
  .card-container {
    padding: 12px;
  }
  
  .window-header {
    padding: 12px 16px;
  }
  
  .window-header h4 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  #sidebarMenu {
    flex-direction: column !important; /* 强制垂直排列 */
    flex-wrap: nowrap !important; /* 强制不换行 */
    overflow-y: auto; /* 确保导航菜单可以垂直滚动 */
    max-height: calc(50vh - 60px); /* 减去标题栏高度 */
  }
  
  .sidebar .nav-link {
    min-width: 100% !important; /* 强制100%宽度 */
    text-align: left;
    justify-content: flex-start;
    white-space: nowrap; /* 防止文本换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0; /* 防止按钮被压缩 */
  }
  
  .card-container {
    padding: 8px;
  }
  
  .card {
    margin-bottom: 12px;
  }
  
  .card-header {
    padding: 16px 20px;
  }
  
  .card-body {
    padding: 16px 20px;
  }
  
  .bottom-buttons {
    padding: 16px;
    flex-wrap: wrap;
  }
  
  .bottom-buttons .btn {
    flex: 1;
    min-width: 120px;
    margin: 4px;
  }
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
}

.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-inactive {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.cron-task-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.cron-status-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

.cron-status-toggle.active {
  background: linear-gradient(135deg, var(--success-color), #10b981);
  color: white;
}

.cron-status-toggle.inactive {
  background: linear-gradient(135deg, var(--error-color), #ef4444);
  color: white;
}

.cron-status-toggle:hover {
  opacity: 0.9;
}

.scrape-status-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

.scrape-status-toggle.active {
  background: linear-gradient(135deg, var(--success-color), #10b981);
  color: white;
}

.scrape-status-toggle.inactive {
  background: linear-gradient(135deg, var(--error-color), #ef4444);
  color: white;
}

.scrape-status-toggle:hover {
  opacity: 0.9;
}

.cron-task-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cron-task-controls .form-check {
  margin: 0;
}

.cron-action-buttons {
  display: flex;
  gap: 6px;
}

.cron-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cron-action-btn.edit {
  background: linear-gradient(135deg, var(--info-color), #3b82f6);
  color: white;
}

.cron-action-btn.edit:hover {
  background: linear-gradient(135deg, #2563eb, var(--info-color));
}

.cron-action-btn.view {
  background: linear-gradient(135deg, var(--bg-tertiary), #475569);
  color: var(--text-secondary);
}

.cron-action-btn.view:hover {
  background: linear-gradient(135deg, #374151, var(--bg-tertiary));
  color: white;
}

.cron-action-btn i {
  font-size: 0.9rem;
}

#directory-window .table td .btn {
  min-width: 90px;
  height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  justify-content: center;
  border: none;
  color: white !important; /* 确保文字是白色 */
  transition: background-color 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

#directory-window .table td .btn:first-of-type {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important; /* 紫色渐变 */
}

#directory-window .table td .btn:first-of-type:hover {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
  opacity: 0.9;
}

#directory-window .table td .btn:last-of-type {
  background: linear-gradient(135deg, #f97316, #fb923c) !important; /* 橙色渐变 */
}

#directory-window .table td .btn:last-of-type:hover {
  background: linear-gradient(135deg, #ea580c, #f97316) !important;
  opacity: 0.9;
}

#directory-window .table td .btn-group .btn {
  min-width: 90px;
  height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  justify-content: center;
  border: none;
  color: white !important;
  transition: background-color 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

#directory-window .table td .btn-group .btn:first-child {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa) !important; /* 紫色渐变 */
}

#directory-window .table td .btn-group .btn:first-child:hover {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
  opacity: 0.9;
}

#directory-window .table td .btn-group .btn:last-child {
  background: linear-gradient(135deg, #f97316, #fb923c) !important; /* 橙色渐变 */
}

#directory-window .table td .btn-group .btn:last-child:hover {
  background: linear-gradient(135deg, #ea580c, #f97316) !important;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .cron-task-controls {
    gap: 6px;
  }
  
  .cron-status-toggle {
    min-width: 80px;
    height: 28px;
    font-size: 0.75rem;
  }
  
  .cron-action-btn {
    width: 28px;
    height: 28px;
  }
  
  .cron-action-btn i {
    font-size: 0.8rem;
  }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9); /* 半透明深色背景 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000; /* 确保在最上层 */
    color: var(--text-secondary);
    font-size: 1.2rem; /* 增大字体 */
    font-weight: 600; /* 加粗字体 */
    gap: 20px; /* 增大间距 */
    border-radius: var(--radius-lg); /* 与卡片圆角一致 */
    animation: fadeIn 0.3s ease-out forwards; /* 添加淡入动画 */
}

.loading-spinner {
    display: inline-block;
    width: 60px; /* 增大加载动画 */
    height: 60px;
    border: 6px solid rgba(59, 130, 246, 0.3); /* 边框颜色 */
    border-radius: 50%;
    border-top-color: var(--primary-light); /* 旋转部分的颜色 */
    animation: spin 1s ease-in-out infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.terminal-style {
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Fira Code', 'Menlo', 'Monaco', monospace;
  font-size: 1rem;
  line-height: 1.6;
  overflow-y: auto; /* 保留终端滚动 */
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 0;
  height: 100%;
  flex: 1;
  min-height: 0;
}

.terminal-text {
  position: relative;
  padding-left: 8px;
  word-break: break-all;
}

.success { color: var(--success-color); }
.warning { color: var(--warning-color); }

.error { color: var(--error-color); }
.info { color: var(--info-color); }

.system { color: #8b5cf6; }
.log1 { color: #f59e0b; }

.tag1 { color: #8b5cf6; }

.prompt::before {
  content: "➜ ";
  color: var(--primary-light);
  font-weight: bold;
  opacity: 0.8;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 6px;
  height: 1.2em;
  background: var(--primary-light);
  vertical-align: middle;
  margin-left: 4px;
  animation: cursor-blink 1s step-end infinite;
  border-radius: 1px;
}

.bottom-buttons {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.batch-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--error-color);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  font-size: 0.7rem;
  padding: 0;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.batch-toggle-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(239, 68, 68, 0.4);
}

.batch-toggle-btn:active {
  transform: scale(0.95);
}

.btn-xs {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  min-width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  font-weight: 500;
}

.btn-xs i {
  font-size: 0.7rem;
  margin: 0;
}

.table td .btn-xs {
  margin: 0;
  padding: 0.15rem 0.3rem;
  font-size: 0.7rem;
  height: 22px;
}

.table td .btn-xs i {
  font-size: 0.65rem;
}

.form-switch .form-check-input {
  width: 2.5em;
  height: 1.5em;
  margin-right: 0.5em;
  background-color: var(--bg-tertiary);
  border-color: var(--border-color);
}

.form-switch .form-check-input:checked {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
}

.form-switch .form-check-label {
  font-weight: 500;
  color: var(--text-primary);
}

/* 修复设置界面中row和col的布局问题 */
#settings-window .row {
  margin-left: -8px;
  margin-right: -8px;
}

#settings-window .col-md-4, 
#settings-window .col-md-6 {
  padding-left: 8px;
  padding-right: 8px;
}

/* 修复刮削设置界面标题颜色问题 */
#scrape-settings h6.mb-3 {
  color: var(--text-primary) !important;
  font-weight: 600;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
  margin-top: 20px;
  margin-bottom: 15px !important;
}

/* 确保AI设置标题有足够的对比度 */
/* 大模型设置标题特殊样式 */
#scrape-settings h6.mb-3 {
  color: #fbbf24 !important; /* 使用醒目的黄色 */
  font-weight: 700;
  font-size: 1.2rem;
  border-bottom: 2px solid #fbbf24;
  margin-top: 20px;
  margin-bottom: 15px !important;
  padding-bottom: 8px;
}

/* 确保所有AI设置标题都有足够的对比度 */
#scrape-settings .ai-settings h6.mb-3 {
  color: var(--primary-light) !important;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border-bottom: 2px solid var(--primary-light);
  margin-top: 20px;
  margin-bottom: 15px !important;
  padding-bottom: 8px;
}

/* 确保设置界面的表单控件不超出容器 */
#settings-window .form-control,
#settings-window .form-select {
  max-width: 100%;
  box-sizing: border-box;
}

/* 修复设置界面标签页内容的溢出问题 */
#settings-tab-content {
  padding-top: 12px;
  padding-left: 16px; /* 减少左边距 */
  padding-right: 16px; /* 减少右边距 */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 修复设置界面各个标签页的边距 */
#basic-settings,
#proxy-settings-pane,
#notify-settings,
#scrape-settings,
#extension-settings {
  padding-left: 4px; /* 减少左边距 */
  padding-right: 4px; /* 减少右边距 */
}

/* 修复设置表单的边距 */
#settings-form,
#scrape-form,
#extension-form {
  margin-left: 0; /* 移除左边距 */
  margin-right: 0; /* 移除右边距 */
}

.mb-3 {
  margin-bottom: 1rem;
}

.mt-4 {
  margin-top: 1.5rem;
}

.gap-2 {
  gap: 0.5rem;
}

.justify-content-start {
  justify-content: flex-start;
}

.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.h-100 {
  height: 100%;
}

.flex-grow-1 {
  flex-grow: 1;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.text-danger {
  color: var(--error-color);
}

.text-decoration-none {
  text-decoration: none;
}

.border-top {
  border-top: 1px solid var(--border-color);
}

.border-bottom {
  border-bottom: 1px solid var(--border-color);
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 1rem;
}

.px-3 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.ps-0 {
  padding-left: 0;
}

.collapse {
  transition: var(--transition);
}

.collapse.show {
  display: block;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-light);
  text-decoration: none;
  padding: 0;
}

.btn-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.jstree-default {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.jstree-default .jstree-node {
  min-height: 28px;
  line-height: 24px; /* 关键：为对齐设置基准行高 */
  white-space: nowrap;
}

.jstree-default .jstree-ocl {
  width: 16px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
  background: none !important;
  text-align: center;
  margin-right: 4px;
}

.jstree-default .jstree-closed > .jstree-ocl::before,

.jstree-default .jstree-open > .jstree-ocl::before {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: normal;
  display: inline-block;
  line-height: 24px; /* 与父元素行高一致以实现垂直居中 */
  vertical-align: middle;
  transition: var(--transition);
}

.jstree-default .jstree-closed > .jstree-ocl::before {
  content: "▶";
}

.jstree-default .jstree-open > .jstree-ocl::before {
  content: "▼";
}

.jstree-default .jstree-leaf > .jstree-ocl {
  display: none; /* 叶子节点不显示图标 */
}

.jstree-default .jstree-ocl:hover::before {
  color: var(--primary-light);
  transform: scale(1.1);
}

.jstree-default .jstree-anchor {
  display: inline-block;
  vertical-align: middle;
  height: 26px;
  line-height: 24px; /* 与基准行高一致 */
  padding: 1px 8px !important;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
}

.jstree-default .jstree-themeicon {
  display: none !important;
}

.jstree-default .jstree-anchor:hover {
  color: var(--text-primary);
}

.jstree-default .jstree-hovered {
  background: rgba(59, 130, 246, 0.1) !important;
  border-radius: var(--radius-sm);
}

.jstree-default .jstree-clicked {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
  color: white !important;
  border-radius: var(--radius-sm);
}

.jstree-default .jstree-wholerow-clicked {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
}

.jstree-default .jstree-wholerow-hovered {
  background: rgba(59, 130, 246, 0.1) !important;
}

.card .table-responsive {
  margin: 0;
  width: 100%;
  overflow-x: hidden; /* 移除水平滚动 */
}

.card .bottom-buttons {
  margin: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.table-responsive {
  overflow-x: hidden; /* 移除水平滚动 */
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table {
  min-width: 100%;
  table-layout: auto;
  width: 100%;
}

.table th,

.table td {
  white-space: normal; /* 允许文本换行，避免水平滚动 */
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: auto; /* 移除固定最小宽度 */
  word-wrap: break-word;
}

.card .table-responsive {
  margin: 0;
  width: 100%;
  overflow-x: hidden; /* 移除水平滚动 */
  border-radius: 0;
}

.card .table {
  margin-bottom: 0;
}

.card-body.p-0 .table-responsive {
  border-radius: 0;
  overflow-x: auto; /* 允许水平滚动 */
  overflow-y: auto; /* 保留表格垂直滚动 */
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 300px); /* 设置最大高度，确保可以滚动 */
}

.card-body.p-0 .table {
  border-radius: 0;
  margin: 0;
  min-width: auto; /* 移除固定最小宽度 */
}

#directory-window .card-body.p-0 .table-responsive {
  max-height: calc(100vh - 350px); /* 目录窗口表格高度调整 */
  overflow-y: auto;
}

@media (max-width: 768px) {
  .main-app-container {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    gap: 0;
    overflow: hidden; /* 小屏幕下也禁用滚动 */
  }
  
  .table th, .table td {
    white-space: normal; /* 允许文本换行 */
    padding: 12px 8px;
    font-size: 0.9rem;
    word-wrap: break-word;
  }
  
  .table th {
    position: static; /* 移除粘性定位 */
    background: rgba(30, 41, 59, 0.95);
    z-index: 1;
  }
  
  /* 移除固定列宽，让表格自适应 */
  .table th:nth-child(1), .table td:nth-child(1) {
    min-width: auto;
    max-width: none;
  }
  
  .table th:nth-child(2), .table td:nth-child(2) {
    min-width: auto;
    max-width: none;
  }
  
  .table th:nth-child(3), .table td:nth-child(3) {
    min-width: auto;
    max-width: none;
  }
  
  .table th:nth-child(4), .table td:nth-child(4) {
    min-width: auto;
    max-width: none;
  }
  
  .table th:nth-child(5), .table td:nth-child(5) {
    min-width: auto;
    max-width: none;
  }
  
  .table th:nth-child(6), .table td:nth-child(6) {
    min-width: auto;
    max-width: none;
  }
  
  .table th:nth-child(7), .table td:nth-child(7) {
    min-width: auto;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .card-body.p-0 .table {
    min-width: auto; /* 移除固定最小宽度 */
  }
  
  .table th, .table td {
    padding: 10px 6px;
    font-size: 0.85rem;
    white-space: normal; /* 允许文本换行 */
    word-wrap: break-word;
  }
  
  .cron-task-controls {
    flex-direction: column;
    gap: 4px;
  }
  
  .cron-status-toggle {
    min-width: 70px;
    height: 24px;
    font-size: 0.7rem;
  }
  
  .cron-action-btn {
    width: 24px;
    height: 24px;
  }
  
  .cron-action-btn i {
    font-size: 0.7rem;
  }
}

#extension-window .card-body h5,

#proxy-window .card-body h5 {
  color: var(--text-primary) !important;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.card-body h5 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.card-header-tabs {
  border-bottom: none;
  margin: -20px -24px; /* 抵消 card-header 的 padding */
  padding: 0 24px;
  background: rgba(30, 41, 59, 0.8);
  overflow-x: hidden; /* 防止标签页水平滚动 */
  overflow-y: hidden; /* 移除垂直滚动 */
}

.card-header-tabs .nav-item {
  margin-bottom: -1px; /* 关键：让激活的 tab 边框与 card-body 的上边框重合 */
  margin-right: 2px; /* 添加标签项之间的间距 */
}

.card-header-tabs .nav-link {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 14px 18px; /* 调整内边距，让标签更紧凑 */
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap; /* 防止标签文本换行 */
  font-size: 0.9rem; /* 稍微减小字体大小 */
  border-radius: var(--radius-md) var(--radius-md) 0 0; /* 添加顶部圆角 */
}

.card-header-tabs .nav-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-light);
  background: rgba(59, 130, 246, 0.08);
}

.card-header-tabs .nav-link.active {
  color: var(--primary-light);
  background: var(--bg-card);
  border-bottom-color: var(--primary-light);
  font-weight: 600;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(1px); /* 激活标签轻微下移，增强视觉层次 */
}

#settings-tab-content {
  padding-top: 12px; /* 进一步减少上边距，让内容更紧凑 */
  padding-left: 24px; /* 添加左边距 */
  padding-right: 24px; /* 添加右边距，保持对称 */
  flex: 1;
  min-height: 0;
  overflow-y: auto; /* 恢复设置标签页内容滚动 */
  overflow-x: hidden; /* 防止水平滚动 */
}

.tab-pane {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* 防止水平滚动 */
  overflow-y: auto; /* 恢复内容区垂直滚动 */
}

.tab-pane > div:first-child {
  flex: 1;
  min-height: 0;
  overflow-y: auto; /* 恢复标签页内容滚动 */
  overflow-x: hidden; /* 防止水平滚动 */
  padding: 0 2px; /* 进一步减少内边距 */
}

/* 为设置界面的各个标签页内容添加左边距 */
#basic-settings,
#proxy-settings-pane,
#notify-settings,
#scrape-settings,
#extension-settings {
  padding-left: 8px; /* 为标签页内容添加左边距 */
  padding-right: 8px; /* 为标签页内容添加右边距，保持对称 */
}

/* 为设置表单添加适当的边距 */
#settings-form,
#scrape-form,
#extension-form {
  margin-left: 4px; /* 为表单添加左边距 */
  margin-right: 4px; /* 为表单添加右边距 */
}

/* 优化设置表单的间距 */
#settings-form .row.g-3.mb-3,
#scrape-form .row.g-3.mb-3,
#extension-form .row.g-3.mb-3 {
  margin-bottom: 1rem !important;
}

#settings-form .mb-3,
#scrape-form .mb-3,
#extension-form .mb-3 {
  margin-bottom: 1rem !important;
}

/* 优化标签页内容的间距 */
#basic-settings .row.g-3.mb-3,
#scrape-settings .row.g-3.mb-3,
#extension-settings .row.g-3.mb-3 {
  margin-bottom: 1rem !important;
}

/* 优化表单标签显示 */
#settings-form .form-label,
#scrape-form .form-label,
#extension-form .form-label {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-primary);
}

/* 优化表单控件显示 */
#settings-form .form-control,
#scrape-form .form-control,
#extension-form .form-control,
#settings-form .form-select,
#scrape-form .form-select,
#extension-form .form-select {
  font-size: 0.9rem;
  padding: 10px 14px;
  height: 42px;
}

/* 优化工具提示图标 */
.tooltip-icon {
  width: 18px;
  height: 18px;
  font-size: 11px;
  margin-left: 6px;
}

/* 优化设置界面的底部按钮 */
#settings-window .bottom-buttons {
  padding: 16px 24px;
  margin-top: 0;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

/* 优化标签输入容器 */
.tag-input-container {
  height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
}

.table td:first-child .drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: rgba(100, 116, 139, 0.2);
  transition: var(--transition);
  cursor: move;
  opacity: 0.6;
}

.table td:first-child .drag-handle:hover {
  background: rgba(100, 116, 139, 0.4);
  opacity: 1;
  transform: scale(1.1);
}

.table td:first-child .drag-handle i {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.table td:first-child .drag-handle:hover i {
  color: var(--text-primary);
}

#sidebarMenu,

.nav.flex-column#sidebarMenu,

.nav#sidebarMenu {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100%;
  box-sizing: border-box;
}

.sidebar .nav-link {
  width: 100% !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  white-space: nowrap; /* 保持文本不换行（若需换行可改为 normal） */
  box-sizing: border-box;
}

.sidebar .nav-link > i {
  flex-shrink: 0;
  margin-right: 12px;
}

.sidebar {
  min-height: 0;
  overflow-x: hidden; /* 防止水平滚动 */
  overflow-y: auto;
}

#sidebarMenu .nav-link {
  flex: 0 0 auto;
}

.search-input-container {
    margin-bottom: 20px;
    position: relative;
}

.search-input-container .input-group .form-control {
    height: 48px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.search-input-container .input-group .btn {
    height: 48px;
    padding: 0 20px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.search-results-container {
    padding: 20px;
    min-height: 400px;
    overflow-y: auto;
    position: relative;
}

#search-window .pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
}

#search-window .pagination-controls .btn {
    min-width: 80px;
    height: 32px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-window .pagination-controls span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); /* 自适应列数量，每列最小180px，最大1fr */
    gap: 20px;
    align-items: start;
}

.search-result-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.search-result-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.result-poster {
    position: relative;
    width: 100%;
    padding-top: 140%; /* 海报比例 1:1.4 */
    overflow: hidden;
}

.result-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.result-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.search-result-item:hover .result-overlay {
    opacity: 1;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.result-actions .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.result-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.result-type {
    background: var(--primary-light);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.result-rating {
    color: var(--warning-color);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-overview {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.result-flags {
    display: flex;
    flex-wrap: wrap; /* 允许换行，但优先不换行 */
    gap: 4px; /* 减小按钮之间的间距 */
    margin-top: 8px;
    justify-content: flex-start; /* 按钮左对齐 */
}

.search-result-item .result-flags .btn {
    padding: 4px 8px; /* 调整内边距，使其更紧凑 */
    font-size: 0.75rem; /* 调整字体大小，使其更小 */
    font-weight: 600; /* 加粗字体 */
    white-space: nowrap; /* 防止文字换行 */
    transition: var(--transition);
    flex-shrink: 0; /* 防止按钮被压缩 */
    border: 1px solid transparent; /* 默认透明边框 */
    color: white; /* 确保文字颜色 */
}

.search-result-item .result-flags .flag-115 {
    background: linear-gradient(135deg, #f97316, #fb923c); /* 橙色渐变 */
    border-color: #f97316;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.search-result-item .result-flags .flag-115:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.search-result-item .result-flags .flag-magnet {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa); /* 紫色渐变 */
    border-color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.search-result-item .result-flags .flag-magnet:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.search-result-item .result-flags .flag-ed2k {
    background: linear-gradient(135deg, #10b981, #34d399); /* 绿色渐变 */
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.search-result-item .result-flags .flag-ed2k:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

#detail-resources .btn.detail-flag {
    padding: 10px 20px; /* 调整内边距，使其更饱满 */
    font-size: 0.95rem; /* 调整字体大小 */
    font-weight: 600; /* 加粗字体 */
    white-space: nowrap; /* 防止文字换行 */
    box-shadow: var(--shadow-md); /* 添加中等阴影 */
    cursor: pointer; /* 添加指针样式 */
    transition: var(--transition);
    border-radius: var(--radius-md); /* 统一圆角 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px; /* 最小宽度 */
}

#detail-resources .btn.detail-flag:hover {
    transform: translateY(-2px); /* 悬停时轻微上浮 */
    box-shadow: var(--shadow-lg); /* 悬停时阴影更大 */
}

#detail-resources .btn.detail-flag.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

#detail-resources .btn.detail-flag.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

#detail-resources .btn.detail-flag.btn-info {
    background: linear-gradient(135deg, var(--info-color), #60a5fa);
    color: white;
}

#detail-resources .btn.detail-flag.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, var(--info-color));
}

#detail-resources .btn.detail-flag.btn-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
}

#detail-resources .btn.detail-flag.btn-success:hover {
    background: linear-gradient(135deg, #059669, var(--success-color));
}

#detail-resources .btn.detail-flag.btn-secondary {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--border-color));
    color: var(--text-primary);
}

#detail-resources .btn.detail-flag.btn-secondary:hover {
    background: linear-gradient(135deg, var(--border-color), var(--bg-tertiary));
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-controls .btn {
    min-width: 80px;
}

@media (max-width: 1200px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 992px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .result-info {
        padding: 12px;
    }
    
    .result-title {
        font-size: 0.9rem;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .pagination-controls .btn {
        min-width: 70px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
    
    .search-result-item {
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
  .command-input, .command-send {
    height: 36px;
  }
}

.sortable-ghost {
  opacity: 0.4;
  background: rgba(59, 130, 246, 0.1);
}

.sortable-drag {
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  transform: rotate(2deg);
}

#detailModal .modal-dialog {
    max-width: 90vw; /* 增加模态窗口的最大宽度 */
    width: 900px; /* 固定宽度，或根据需要调整 */
}

#detailModal .modal-body {
    padding: 24px; /* 恢复默认内边距 */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 允许模态窗口内容垂直滚动 */
    overflow-x: hidden; /* 确保内部滚动 */
}

.detail-content-wrapper {
    overflow: hidden;
}

.detail-poster-img {
    width: 150px; /* 封面图宽度 */
    height: 225px; /* 封面图高度 (1.5倍宽度) */
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.season-tags-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* 一行5列，自适应宽度 */
    gap: 10px; /* 标签之间的间距 */
    margin-top: 10px;
}

.season-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.season-tag:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--primary-light);
}

.season-tag.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--primary-light);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

#magnet-season-resources {
    margin-top: 20px;
}

.magnet-list-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.magnet-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.magnet-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.magnet-item .card-title {
    font-size: 1.2rem; /* 稍微增大字体 */
    font-weight: 700; /* 加粗字体 */
    color: white; /* 更明亮的白色 */
    margin-bottom: 12px;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* 增加阴影 */
}

.magnet-item .badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* 减小标签间距 */
    margin-bottom: 12px; /* 减小与下方元素的间距 */
}

.magnet-item .badge {
    font-size: 0.7rem; /* 稍微减小字体 */
    padding: 5px 9px; /* 调整内边距 */
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    box-shadow: var(--shadow-sm);
    text-transform: uppercase; /* 标签文字大写 */
    letter-spacing: 0.5px; /* 增加字母间距 */
}

.magnet-item .badge.bg-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.magnet-item .badge.bg-info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.magnet-item .badge.bg-dark {
    background: linear-gradient(135deg, #475569, #334155);
    color: white;
}

.magnet-item .badge.bg-secondary {
    background: linear-gradient(135deg, #64748b, #4b5563);
    color: white;
}

.magnet-item .badge.bg-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.magnet-item .badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.magnet-item .badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.magnet-item .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.magnet-item .badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.magnet-item .badge {
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    box-shadow: var(--shadow-sm);
}

.magnet-link-text {
    margin-top: 12px; /* 调整与上方元素的间距 */
    padding: 10px 14px; /* 调整内边距 */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--info-color); /* 使用信息色，更明亮 */
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    word-break: break-all; /* 确保长链接能换行 */
    white-space: normal; /* 允许文本换行 */
    line-height: 1.5;
    text-decoration: underline; /* 添加下划线 */
    cursor: pointer; /* 增加指针样式 */
    transition: var(--transition);
}

.magnet-link-text:hover {
    background: rgba(59, 130, 246, 0.1); /* 悬停时背景变浅 */
    border-color: var(--primary-light); /* 悬停时边框高亮 */
    color: var(--primary-light); /* 悬停时颜色变亮 */
}

.magnet-link-text p {
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .magnet-item {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .magnet-item .card-title {
        font-size: 1rem;
    }
    
    .magnet-item .badge-container {
        gap: 6px;
    }
    
    .magnet-item .badge {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
    
    .magnet-link-text {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .magnet-item {
        padding: 12px;
    }
    
    .magnet-item .card-title {
        font-size: 0.95rem;
    }
}

.loading-overlay-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 1rem;
    gap: 10px;
}

.loading-spinner-small {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-light);
    animation: spin 1s ease-in-out infinite;
}

.login-page {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-10px, -10px) rotate(5deg); }
    50% { transform: translate(10px, 10px) rotate(-5deg); }
    75% { transform: translate(-5px, 5px) rotate(3deg); }
}

.login-container {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 35px 60px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.05);
}

.login-header h3 {
    font-weight: 700;
    font-size: 1.75rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

.login-input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.login-input-group label {
    display: block;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.login-input-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #334155;
    background: rgba(15, 23, 42, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.login-input-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    z-index: 1;
}

.login-input-wrapper:focus-within .input-icon {
    color: #3b82f6;
}

.login-input-wrapper .form-control {
    background: transparent;
    border: none;
    color: #f8fafc;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    width: 100%;
    height: 56px;
    transition: all 0.3s ease;
}

.login-input-wrapper .form-control::placeholder {
    color: #64748b;
    font-size: 0.95rem;
}

.login-input-wrapper .form-control:focus {
    outline: none;
    box-shadow: none;
}

.login-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 2rem;
    height: 56px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-submit-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-page .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

@media (max-width: 480px) {
    .login-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .login-header h3 {
        font-size: 1.5rem;
    }
    
    .login-logo {
        width: 56px;
        height: 56px;
    }
    
    .login-input-wrapper .form-control, .login-submit-btn {
        height: 52px;
        font-size: 0.95rem;
    }
}

.login-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#detailModal[aria-hidden="true"].show {
    /* 这是一个非标准做法，但旨在解决顽固的 aria-hidden 焦点问题 */
    /* 理论上，当模态框显示时，aria-hidden 应该为 false */
    /* 如果 Bootstrap 无法正确管理，我们在此处尝试强制覆盖 */
    /* 注意：这可能会影响辅助技术的可访问性 */
    aria-hidden: false !important;
}

.terminal-style .clickable-option {
    color: var(--highlight-color); /* 使用新的高亮颜色 */
    text-decoration: none; /* 移除下划线 */
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    padding: 2px 4px; /* 增加内边距 */
    border-radius: 4px; /* 添加圆角 */
}

.terminal-style .clickable-option:hover {
    color: var(--primary-light);
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

.record-checkbox {
    width: 22px !important;
    height: 22px !important;
    cursor: pointer;
    margin: 0 auto !important;
    display: block !important;
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    vertical-align: middle;
}

.record-checkbox:checked {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.record-checkbox:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.record-checkbox:hover {
    border-color: var(--primary-light);
    transform: scale(1.1);
}

.record-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.table td:last-child {
    text-align: center !important;
    vertical-align: middle !important;
}

#scrape-success-list td:last-child {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 12px 8px !important;
}

#scrape-success-list td:last-child .record-checkbox {
    margin-left: auto !important;
    margin-right: auto !important;
    display: table-cell !important;
    vertical-align: middle !important;
}

.table tbody tr.selected-row {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

.table tbody tr.selected-row td {
    color: var(--text-primary) !important;
}

.table tbody tr.selecting-row {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35)) !important;
    position: relative;
    z-index: 1;
}

.table tbody tr.selecting-row td {
    color: var(--text-primary) !important;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

@keyframes selecting-pulse {
    0%, 100% {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35));
    }
    50% {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.4));
    }
}

.table tbody tr.selecting-row {
    animation: selecting-pulse 1.5s ease-in-out infinite;
}

/* 表格行选中样式 - 统一处理 */
.table tbody tr.selected-row {
    background: var(--bg-card) !important;
    position: relative;
}

.table tbody tr.selected-row td {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25)) !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    color: var(--text-primary) !important;
}

.table tbody tr.selecting-row {
    background: var(--bg-card) !important;
    position: relative;
    z-index: 1;
}

.table tbody tr.selecting-row td {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35)) !important;
    font-weight: 600;
    position: relative;
    z-index: 2;
    color: var(--text-primary) !important;
    animation: selecting-pulse 1.5s ease-in-out infinite;
}

@keyframes selecting-pulse {
    0%, 100% {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35));
    }
    50% {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.4));
    }
}

/* 确保所有表格都能正确显示选中状态 */
#scrape-failures-list tr.selected-row td,
#scrape-success-list tr.selected-row td,
.table tbody tr.selected-row td {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25)) !important;
}

#scrape-failures-list tr.selecting-row td,
#scrape-success-list tr.selecting-row td,
.table tbody tr.selecting-row td {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.35)) !important;
    animation: selecting-pulse 1.5s ease-in-out infinite;
}

.table tbody {
    cursor: default;
}

.table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover:not(.selected-row):not(.selecting-row) {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

/* 拖动模式样式 */
body.dragging-mode {
    cursor: crosshair !important;
    user-select: none;
}

body.dragging-mode .table tbody tr {
    cursor: crosshair !important;
}

/* 拖动选择提示 */
.drag-selection-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: none;
    backdrop-filter: blur(10px);
}

body.dragging-mode .drag-selection-hint {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.drag-selection-hint i {
    color: var(--primary-light);
    margin-right: 8px;
}

/* 键盘快捷键提示 */
.keyboard-shortcut-hint {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.keyboard-shortcut-hint kbd {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    margin: 0 4px;
    border: 1px solid var(--border-color);
}

.keyboard-shortcut-hint .shortcut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.keyboard-shortcut-hint .shortcut-item:last-child {
    margin-bottom: 0;
}

.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table tbody tr td {
    border-bottom: 1px solid var(--border-color) !important;
    position: static !important;
}

#scrape-success-list td:last-child {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 12px 8px !important;
    position: relative;
    z-index: 3;
}

#scrape-success-list td:last-child .record-checkbox {
    margin-left: auto !important;
    margin-right: auto !important;
    display: table-cell !important;
    vertical-align: middle !important;
    position: relative;
    z-index: 4;
}
