/* style-pro-enhanced.css - 专业维吾尔语字幕翻译系统增强版样式 */

:root {
  /* 苹果风格配色 - 优雅紫色系 */
  --primary-color: #8B5CF6;
  --primary-dark: #7C3AED;
  --primary-light: #C4B5FD;
  --primary-gradient: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-color: #EC4899;
  --success-color: #10B981;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --info-color: #3B82F6;
  
  /* 毛玻璃背景色 */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  
  /* 背景色 - 渐变系 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-gradient-light: linear-gradient(to bottom, #F9FAFB 0%, #EDE9FE 100%);
  
  /* 文字颜色 */
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-disabled: #D1D5DB;
  --text-inverse: #FFFFFF;
  
  /* 边框 - 更大的圆角 */
  --border-color: rgba(226, 232, 240, 0.6);
  --border-radius: 16px;
  --border-radius-small: 8px;
  --border-radius-large: 24px;
  
  /* 苹果风格阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
  
  /* 布局 */
  --header-height: 64px;
  --sidebar-width: 320px;
  --status-bar-height: 36px;
  
  /* 流畅动画 */
  --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 深色主题 - 现代紫黑配色 */
body.dark-theme {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-tertiary: #334155;
  --bg-elevated: #1E293B;
  --bg-hover: #334155;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-disabled: #475569;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', Roboto, sans-serif;
}

body {
  background: var(--bg-gradient-light);
  color: var(--text-primary);
  transition: var(--transition);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* 动态背景效果 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
  animation: backgroundPulse 15s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes backgroundPulse {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 5%) scale(1.1); }
}

/* 登录界面 - 苹果毛玻璃风格 */
.login-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  padding: 50px 40px;
  border-radius: var(--border-radius-large);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 8px 32px rgba(139, 92, 246, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  width: 380px;
  text-align: center;
  animation: floatIn 0.6s var(--bounce);
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-box input {
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1.5px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #1F2937;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.login-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 0 0 4px rgba(139, 92, 246, 0.15),
    0 4px 12px rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
}

.login-box input::placeholder {
  color: #6B7280;
  letter-spacing: normal;
}

.login-box button {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 
    0 8px 20px rgba(139, 92, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.login-box button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.login-box button:hover::before {
  left: 100%;
}

.login-box button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 12px 30px rgba(139, 92, 246, 0.45),
    0 0 30px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-box button:active {
  transform: translateY(-1px) scale(0.98);
}

.login-box button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#login-error-msg {
  font-weight: 500;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* 主容器 */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航 - 渐变背景 */
header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo h1 {
  font-size: 22px;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  font-size: 28px;
  color: var(--primary-color);
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-small);
  transition: var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background: var(--bg-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

.quick-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.quick-stats span {
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-small);
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-small);
  transition: var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
}

/* 主布局 */
.main-layout {
  display: flex;
  flex: 1;
  overflow: visible;
}

/* 左侧边栏 */
.left-sidebar {
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(139, 92, 246, 0.15);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
}

.left-sidebar.collapsed {
  width: 0;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.4);
  margin: 8px;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-fast);
}

.sidebar-section:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(2px);
}

.sidebar-section h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section h3 i {
  color: var(--primary-color);
}

/* 记忆库控制 */
.memory-bank-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.small-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--border-radius-small);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
}

.small-btn:hover {
  background: var(--bg-secondary);
}

.small-btn.primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.small-btn.primary:hover {
  background: var(--primary-dark);
}

/* 记忆库搜索 */
.memory-search input,
.memory-categories select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  margin-bottom: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* 记忆库列表 */
.memory-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.memory-item {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.memory-item:hover {
  background: var(--bg-secondary);
}

.memory-content {
  flex: 1;
}

.term-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}

.term-chinese {
  font-weight: 500;
}

.term-uyghur {
  color: var(--primary-color);
  font-family: 'UKIJ Tuz', 'Noto Sans Arabic', sans-serif;
}

.term-context,
.term-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.term-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.term-category {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--border-radius-small);
}

.memory-actions {
  display: flex;
  gap: 4px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--border-radius-small);
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--primary-color);
}

.empty-memory {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px;
  font-size: 14px;
}

/* 翻译设置 */
.translation-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-size: 14px;
  color: var(--text-secondary);
}

.setting-item select,
.setting-item input[type="number"],
.setting-item input[type="text"],
.setting-item input[type="password"],
.setting-item input[type="range"] {
  padding: 10px 14px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--border-radius-small);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  transition: var(--transition-fast);
}

.setting-item select:focus,
.setting-item input[type="number"]:focus,
.setting-item input[type="text"]:focus,
.setting-item input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

.setting-item input[type="range"] {
  padding: 0;
  height: 8px;
  cursor: pointer;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  cursor: pointer;
  border-radius: 50%;
}

.setting-item input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  cursor: pointer;
  border-radius: 50%;
  border: none;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: var(--transition-fast);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-fast);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* 主工作区 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  overflow: hidden;
}

.workspace-header {
  background: var(--bg-primary);
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.project-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.project-name-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  width: 300px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

#file-info {
  color: var(--text-secondary);
  font-size: 14px;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 12px 24px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.action-btn:hover::before {
  width: 300px;
  height: 300px;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
  border-color: var(--primary-color);
}

.action-btn.primary {
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: white;
  border: none;
  box-shadow: 
    0 8px 20px rgba(139, 92, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
  box-shadow: 
    0 12px 30px rgba(139, 92, 246, 0.45),
    0 0 20px rgba(139, 92, 246, 0.3);
  transform: translateY(-3px) scale(1.02);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.action-btn.success {
  background: var(--success-color);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
}

.action-btn.success:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* 翻译队列显示 */
.queue-display {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.queue-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.queue-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.queue-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-list {
  padding: 8px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  margin-bottom: 8px;
  background: var(--bg-primary);
  transition: var(--transition-fast);
  cursor: pointer; /* ✅ 可点击 */
}

.queue-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.queue-item.completed {
  border-left: 4px solid var(--success-color);
}

.queue-item.processing {
  border-left: 4px solid var(--primary-color);
}

.queue-item.error {
  border-left: 4px solid var(--error-color);
}

/* ✅ 选中状态样式 */
.queue-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.05) 100%);
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  transform: translateX(4px);
}

.queue-item.active:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.08) 100%);
}

.queue-item-info {
  flex: 1;
}

.queue-item-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.queue-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  align-items: center;
}

.queue-item-status {
  display: flex;
  align-items: center;
  gap: 4px;
}

.queue-progress {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.queue-progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.queue-item-actions {
  display: flex;
  gap: 4px;
}

/* 进度条 */
.translation-progress {
  background: var(--bg-primary);
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 字幕工作区 */
.subtitle-workspace {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
}

.empty-state .hint {
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.7;
}

/* 字幕编辑器 */
.subtitle-editor {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.editor-toolbar {
  background: var(--bg-primary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--border-radius-small);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: var(--bg-secondary);
}

#subtitle-search {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  width: 200px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

#filter-status {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* 字幕列表 */
.subtitle-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.subtitle-item {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--border-radius);
  margin-bottom: 12px;
  transition: var(--transition-fast);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subtitle-item:hover {
  box-shadow: 
    0 8px 20px rgba(139, 92, 246, 0.15),
    0 0 0 1px rgba(139, 92, 246, 0.3);
  transform: translateY(-2px) scale(1.005);
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary-color);
}

.subtitle-item.translated {
  border-left: 4px solid var(--success-color);
  background: linear-gradient(to right, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0.7) 30px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.subtitle-item.error {
  border-left: 4px solid var(--error-color);
  background: linear-gradient(to right, rgba(239, 68, 68, 0.1) 0%, rgba(255, 255, 255, 0.7) 30px);
}

.subtitle-item.edited {
  border-left: 4px solid var(--accent-color);
  background: linear-gradient(to right, rgba(236, 72, 153, 0.05) 0%, var(--bg-primary) 20px);
}

.subtitle-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.checkbox-container {
  display: inline-block;
  position: relative;
  width: 20px;
  height: 20px;
}

.subtitle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 20px;
  width: 20px;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-small);
  transition: var(--transition-fast);
}

.subtitle-checkbox:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.subtitle-checkbox:checked ~ .checkmark:after {
  display: block;
}

.subtitle-number {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 14px;
}

.subtitle-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

.subtitle-status {
  margin-left: auto;
  font-size: 16px;
}

.subtitle-body {
  padding: 12px 16px;
}

.original-text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.translated-text {
  font-size: 15px;
  color: var(--primary-color);
  line-height: 1.6;
  font-family: 'UKIJ Tuz', 'Noto Sans Arabic', sans-serif;
  min-height: 24px;
}

/* 新增：内联编辑样式 */
.editable-text {
  border: 1px solid transparent;
  border-radius: var(--border-radius-small);
  padding: 4px 8px;
  transition: var(--transition-fast);
  cursor: text;
}

.editable-text:hover {
  border-color: var(--border-color);
  background: var(--bg-secondary);
}

.editable-text:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-primary);
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.translated-text .placeholder {
  color: var(--text-disabled);
  font-style: italic;
  font-family: inherit;
}

/* 悬浮编辑器 */
.floating-editor {
  position: fixed;
  top: 100px;
  left: 100px;
  width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translate3d(0, 0, 0);
}

/* ===== Agent 悬浮窗口 ===== */
.agent-panel {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 420px;
  max-height: calc(100vh - 180px);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1001;
  overflow: hidden;
}

body.dark-theme .agent-panel {
  background: rgba(17, 24, 39, 0.75);
  border-color: rgba(255, 255, 255, 0.12);
}

.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  cursor: move;
  user-select: none;
}

body.dark-theme .agent-header {
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

.agent-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.agent-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.agent-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.agent-tool-btn:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}

body.dark-theme .agent-tool-btn:hover {
  background: rgba(255,255,255,0.10);
}

.agent-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.agent-close:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
}

body.dark-theme .agent-close:hover {
  background: rgba(255,255,255,0.10);
}

.agent-body {
  height: calc(100% - 56px);
  display: flex;
  flex-direction: column;
}

.agent-messages {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
}

.agent-msg {
  margin-bottom: 10px;
  display: flex;
}
.agent-msg.user { justify-content: flex-end; }
.agent-msg.assistant { justify-content: flex-start; }

.agent-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-msg.user .agent-bubble {
  background: rgba(79, 70, 229, 0.14);
  border: 1px solid rgba(79, 70, 229, 0.18);
}
.agent-msg.assistant .agent-bubble {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

.agent-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
body.dark-theme .agent-input-row {
  border-top-color: rgba(255, 255, 255, 0.10);
}

#agent-input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
}

#agent-input:focus {
  outline: none;
  border-color: #10b981;
}

.agent-send-btn {
  width: 42px;
  border: none;
  border-radius: 12px;
  background: #10b981;
  color: white;
  cursor: pointer;
}

.agent-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.agent-hint {
  padding: 0 12px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.floating-editor-header {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}

.floating-editor-title {
  font-weight: 500;
  color: var(--text-primary);
}

.floating-editor-controls {
  display: flex;
  gap: 4px;
}

.floating-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--border-radius-small);
  transition: var(--transition-fast);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.floating-editor-content {
  padding: 16px;
}

.floating-edit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.floating-edit-number {
  font-weight: 500;
  color: var(--primary-color);
}

.floating-edit-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.floating-edit-group {
  margin-bottom: 16px;
}

.floating-edit-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.floating-original-display {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  line-height: 1.5;
}

#floating-edit-translation {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 15px;
  line-height: 1.6;
  font-family: 'UKIJ Tuz', 'Noto Sans Arabic', sans-serif;
  resize: vertical;
  background: var(--bg-primary);
  color: var(--text-primary);
}

#floating-edit-translation:focus {
  outline: none;
  border-color: var(--primary-color);
}

.floating-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 右侧边栏 */
.right-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* 编辑面板 */
.editing-subtitle {
  padding: 16px;
}

.edit-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.edit-number {
  font-weight: 500;
  color: var(--primary-color);
}

.edit-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.edit-group {
  margin-bottom: 16px;
}

.edit-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.original-display {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  line-height: 1.5;
}

#edit-translation {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 15px;
  line-height: 1.6;
  font-family: 'UKIJ Tuz', 'Noto Sans Arabic', sans-serif;
  resize: vertical;
  background: var(--bg-primary);
  color: var(--text-primary);
}

#edit-translation:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* 记忆库建议 */
#memory-suggestions {
  max-height: 120px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-small);
  margin-bottom: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.suggestion-item:hover {
  background: var(--primary-light);
}

.suggestion-item small {
  color: var(--text-secondary);
  margin-left: 8px;
}

.no-suggestions {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 16px;
}

.edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.subtitle-item.active {
  outline: 2px solid rgba(139, 92, 246, 0.35);
  outline-offset: 2px;
}

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--border-radius-small);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.btn:hover {
  background: var(--bg-secondary);
}

.btn.primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* 无选择状态 */
.no-selection {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px;
  font-size: 14px;
}

/* 统计信息 */
.statistics {
  padding: 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.stat-label {
  color: var(--text-secondary);
}

.stat-value {
  font-weight: 500;
  color: var(--text-primary);
}

/* 底部状态栏 */
.status-bar {
  height: var(--status-bar-height);
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
}

.status-left,
.status-right {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-item i {
  font-size: 10px;
}

#status-message {
  font-weight: 500;
}

.status-success {
  color: var(--success-color);
}

.status-error {
  color: var(--error-color);
}

.status-info {
  color: var(--info-color);
}

/* 对话框 */
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
}

.dialog-content {
  background: var(--bg-primary);
  padding: 24px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}

.dialog-content h3 {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* 拖拽状态 */
.subtitle-workspace.drag-over {
  background: var(--primary-light);
  border: 2px dashed var(--primary-color);
}

.subtitle-workspace.drag-over .empty-state {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* 滚动条 */
/* ===== 增强滚动条样式 - 更显眼 ===== */
::-webkit-scrollbar {
  width: 14px;  /* 增加宽度，更显眼 */
  height: 14px;
}

::-webkit-scrollbar-track {
  background: linear-gradient(to right, var(--bg-secondary), rgba(139, 92, 246, 0.05));
  border-radius: 7px;
  border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8B5CF6 0%, #667eea 100%);
  border-radius: 7px;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5a67d8 100%);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
  transform: scale(1.05);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, #6d28d9 0%, #4c51bf 100%);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.6);
}

/* Firefox 滚动条样式 */
* {
  scrollbar-width: auto;  /* auto 或 thin，使用 auto 更显眼 */
  scrollbar-color: #8B5CF6 var(--bg-secondary);
}

/* 加载动画 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .right-sidebar {
    position: fixed;
    right: -320px;
    top: var(--header-height);
    height: calc(100vh - var(--header-height) - var(--status-bar-height));
    transition: right 0.3s ease;
    z-index: 50;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  }
  
  .right-sidebar.active {
    right: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }
  
  .left-sidebar {
    position: fixed;
    left: -280px;
    top: var(--header-height);
    height: calc(100vh - var(--header-height) - var(--status-bar-height));
    transition: left 0.3s ease;
    z-index: 50;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }
  
  .left-sidebar.active {
    left: 0;
  }
  
  .main-content {
    width: 100%;
  }
  
  .quick-stats {
    display: none;
  }
  
  .workspace-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .project-info {
    flex-direction: column;
    align-items: stretch;
  }
  
  .project-name-input {
    width: 100%;
  }
  
  .workspace-actions {
    justify-content: center;
  }
  
  .toolbar-left,
  .toolbar-right {
    flex-wrap: wrap;
  }
  
  #subtitle-search {
    width: 150px;
  }

  .floating-editor {
    width: 320px;
    left: 10px;
    top: 10px;
  }

  .queue-header {
    flex-direction: column;
    align-items: stretch;
  }

  .queue-controls {
    justify-content: center;
  }
}

/* 打印样式 */
@media print {
  header,
  .left-sidebar,
  .right-sidebar,
  .status-bar,
  .editor-toolbar,
  .workspace-header,
  .floating-editor {
    display: none;
  }
  
  .subtitle-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border: 1px solid #ddd;
  }
  
  .subtitle-header {
    background: #f5f5f5;
  }
  
  .checkbox-container {
    display: none;
  }
}

/* 特殊效果 */
.subtitle-item.translating {
  background: linear-gradient(90deg, var(--bg-primary) 0%, var(--primary-light) 50%, var(--bg-primary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-left: 4px solid var(--primary-color) !important;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 工具提示 */
[title] {
  position: relative;
}

[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
  z-index: 1001;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* 焦点样式 */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 禁用状态 */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 过渡动画 */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* 确保维吾尔语文本正确显示 */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

/* 修复深色模式下的对比度 */
body.dark-theme .btn.primary,
body.dark-theme .action-btn.primary,
body.dark-theme .small-btn.primary {
  background: #42A5F5;
}

body.dark-theme .btn.primary:hover,
body.dark-theme .action-btn.primary:hover,
body.dark-theme .small-btn.primary:hover {
  background: #2196F3;
}

body.dark-theme .translated-text {
  color: #64B5F6;
}

body.dark-theme input:checked + .slider {
  background-color: #42A5F5;
}

/* 优化移动端触摸目标 */
@media (max-width: 768px) {
  .btn,
  .action-btn,
  .toolbar-btn,
  .small-btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .subtitle-checkbox {
    width: 24px;
    height: 24px;
  }
  
  .checkmark {
    width: 24px;
    height: 24px;
  }
}

/* 新增：高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #000000;
  }
  
  body.dark-theme {
    --border-color: #FFFFFF;
    --text-secondary: #FFFFFF;
  }
}

/* 新增：减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 名字地名库样式 ===== */

.name-dict-manager {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dict-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dict-search input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.dict-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dict-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
}

.name-dict-item {
  background: var(--bg-primary);
  padding: 12px;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.name-dict-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.name-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.name-chinese {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.name-arrow {
  color: var(--text-secondary);
  font-size: 14px;
}

.name-uyghur {
  flex: 1;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 15px;
}

.name-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.name-type-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}

.name-usage {
  color: var(--text-secondary);
}

.name-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.dict-stats {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  text-align: center;
}

.dict-stats strong {
  color: var(--primary-color);
  font-size: 16px;
}

/* 小屏幕适配 */
@media (max-width: 768px) {
  .name-dict-item {
    padding: 10px;
  }
  
  .name-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .name-arrow {
    transform: rotate(90deg);
  }
}

/* 滚动条美化 */
.dict-list::-webkit-scrollbar {
  width: 6px;
}

.dict-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.dict-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.dict-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===== 队列头部样式 ===== */
.queue-header-title {
  flex: 1;
}

.queue-header-title h3 {
  margin: 0 0 6px 0;
}

.queue-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-hint i {
  color: var(--info-color);
}

/* ===== 名字地名建议按钮样式 ===== */
.name-suggestions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
  border-radius: var(--border-radius-small);
  border: 1px dashed rgba(139, 92, 246, 0.3);
}

.suggestion-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.suggestion-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

.suggestion-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(139, 92, 246, 0.2);
}

.suggestion-btn i {
  font-size: 11px;
  opacity: 0.9;
}

/* 深色主题 */
body.dark-theme .name-suggestions {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  border-color: rgba(139, 92, 246, 0.4);
}

body.dark-theme .suggestion-btn {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .suggestion-btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ===== 返回顶部按钮 ===== */
/* ===== 返回顶部按钮 - 增强版 ===== */
.back-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #8B5CF6 0%, #667eea 100%);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5), 0 0 0 0 rgba(139, 92, 246, 0.4);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  animation: pulse 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
  transform: translateY(-8px) scale(1.15);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.7), 0 0 20px rgba(139, 92, 246, 0.5);
  animation: none;
}

.back-to-top-btn:active {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 14px rgba(139, 92, 246, 0.5);
}

.back-to-top-btn i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  animation: bounce 1.5s infinite;
}

.back-to-top-btn:hover i {
  animation: bounceUp 0.6s ease-in-out;
}

/* 脉冲动画 */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5), 0 0 0 0 rgba(139, 92, 246, 0.4);
  }
  50% {
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5), 0 0 0 10px rgba(139, 92, 246, 0);
  }
}

/* 弹跳动画 */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* 向上弹动画 */
@keyframes bounceUp {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-8px);
  }
  50% {
    transform: translateY(-4px);
  }
  75% {
    transform: translateY(-6px);
  }
}

/* 深色主题 */
body.dark-theme .back-to-top-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #5a67d8 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(139, 92, 246, 0.4);
}

body.dark-theme .back-to-top-btn:hover {
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .back-to-top-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .back-to-top-btn {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}
/* === Editable compare view overrides (2026-01-11) === */
.subtitle-item.subtitle-item--editable{
  cursor: default;
}

.subtitle-item.subtitle-item--focused{
  box-shadow:
    0 10px 28px rgba(139, 92, 246, 0.18),
    0 0 0 2px rgba(139, 92, 246, 0.35);
  border-color: rgba(139, 92, 246, 0.55);
}

/* 上下对照布局（中文在上、维语在下） */
.subtitle-content.subtitle-compare.subtitle-compare--stack{
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}

.subtitle-col-title{
  font-size: 12px;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: .2px;
  font-weight: 500; /* ✅ 标题不要粗体 */
}

/* 亮色主题下明确使用黑色（更像你说的“黑色粗体”） */
body:not(.dark-theme) .subtitle-col-title{
  color: var(--primary-color);
}

.subtitle-header .subtitle-number,
.subtitle-header .subtitle-time{
  font-weight: 700; /* ✅ #序号 / 时间轴加粗（你说的 srt 字母行） */
}

.subtitle-textarea{
  width: 100%;
  min-height: 56px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 15px;
  font-weight: 600; /* ✅ 原文/译文内容加粗 */
  resize: vertical;
  outline: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* 亮色主题下内容明确为黑色 */
body:not(.dark-theme) .subtitle-textarea{
  color: #111827;
}

.subtitle-textarea:focus{
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.subtitle-textarea--translated{
  direction: rtl;
  text-align: right;
  font-family: 'UKIJ Tuz', 'Noto Sans Arabic', sans-serif;
}

/* === Editable compare view polish === */
.subtitle-context{
  padding: 10px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subtitle-context-line{
  font-size: 12px;
  color: rgba(107, 114, 128, 0.95);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle-context-prev::before{ content:"上一句："; color: rgba(107,114,128,.75); }
.subtitle-context-next::before{ content:"下一句："; color: rgba(107,114,128,.75); }

/* textarea 更像正文：默认无边框无底色，聚焦才出现 */
.subtitle-textarea{
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  padding: 10px 10px;
  resize: none;
  overflow: hidden;
}

/* ✅ 对比友好：原文/译文正文都居中显示（维语仍保持 RTL 方向） */
.subtitle-textarea{
  text-align: center;
  text-align-last: center;
}

.subtitle-textarea:hover{
  background: rgba(255,255,255,0.55);
}

.subtitle-textarea:focus{
  background: rgba(255,255,255,0.9);
}

/* 上下对照：加横向分割线 */
.subtitle-content.subtitle-compare.subtitle-compare--stack{
  position: relative;
}
.subtitle-content.subtitle-compare.subtitle-compare--stack::before{
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(14px + 12px + 12px); /* 大致在两块中间 */
  height: 1px;
  background: rgba(139, 92, 246, 0.12);
  pointer-events: none;
}

/* 如果高度变化导致分割线偏一点也没关系：聚焦态已经能强对比 */