/* ============================================================
   閿︾帴鍥惧儚寮曟搸 - Components 缁勪欢鏍峰紡
   鐗堟湰: v1.0 | 鏃ユ湡: 2026-09-15
   璇存槑: 鎸夐挳銆佸崱鐗囥€佽〃鍗曘€佹爣绛俱€佸窘绔犵瓑鍙鐢ㄧ粍浠?   渚濊禆: variables.css, base.css
   ============================================================ */

/* ---------- 鎸夐挳缁勪欢 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-dark);
}

.btn:active {
  background: var(--bg-active);
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 涓绘寜閽?*/
.btn-primary {
  color: var(--text-inverse);
  background: var(--primary);
  border-color: var(--primary);
}

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

/* 娓愬彉鎸夐挳 */
.btn-gradient {
  color: var(--text-inverse);
  background: var(--primary-gradient);
  border: none;
  box-shadow: var(--shadow-primary);
}

.btn-gradient:hover {
  background: var(--primary-gradient-hover);
  box-shadow: var(--shadow-primary-lg);
  transform: translateY(-1px);
}

/* 鎴愬姛鎸夐挳 */
.btn-success {
  color: var(--text-inverse);
  background: var(--success);
  border-color: var(--success);
}

.btn-success:hover {
  background: var(--success-hover);
  border-color: var(--success-hover);
}

/* 鍗遍櫓鎸夐挳 */
.btn-danger {
  color: var(--text-inverse);
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

/* 骞界伒鎸夐挳 */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* 鎸夐挳灏哄 */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-lg);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---------- 鍗＄墖缁勪欢 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

/* 宸ュ叿鍗＄墖 */
.tool-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

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

.tool-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: var(--radius);
  background: var(--primary-light);
  margin-bottom: var(--space-3);
}

.tool-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.tool-card-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

/* ---------- 寰界珷/鏍囩 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* ---------- 鎻愮ず妗?---------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: var(--space-4);
}

.alert-info {
  background: var(--info-light);
  border-color: var(--info);
  color: var(--info);
}

.alert-success {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.alert-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning);
}

.alert-danger {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- 杩涘害鏉?---------- */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: visible;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ---------- 寮€鍏?---------- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 0;
  transition: var(--transition);
}

.switch input:checked + .switch-slider {
  background: var(--primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* ---------- 鍔犺浇鍔ㄧ敾 ---------- */
.spinner {
  width: auto;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 0;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- 鍒嗗壊绾?---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* === 从style.css迁移的样式 === */














﻿@import './design-system.css';

/* ========== 现代配色系统 ========== */
:root {
  --primary: #6366f1;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 顶部导航 */
.header {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
  padding: 12px 0;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.header .logo {
  color: var(--primary);
}

.header .logo-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.header nav a {
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 10px;
  padding: 8px 14px;
}

.header nav a:hover,
.header nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: auto;
  height: 40px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: visible;
}

.logo:hover .logo-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(79,70,229,0.35);
}

.logo-icon svg,
.logo-icon img {
  width: auto;
  height: 40px;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: white;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 主内容区 */
.main {
  padding: 40px 0;
  min-height: calc(100vh - 200px);
}

/* 面包屑导航 */
.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}
.breadcrumb span {
  margin: 0 8px;
  color: var(--border);
}

/* 页面标题 */
.page-title {
  text-align: center;
  margin-bottom: 32px;
}

.page-title h1 {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-title p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* 工具卡片网格（首页） */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  display: block;
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  background: var(--primary-light);
  color: var(--primary);
}

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 工具页面布局 */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

/* 上传区域 */
.upload-area {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--border-light);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--primary);
}

.drop-zone h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.upload-btn {
  display: inline-block;
  background: var(--primary-gradient);
  color: white;
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.upload-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.upload-btn:active {
  transform: translateY(0);
}

.upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 文件信息 */
.file-info {
  margin-top: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  display: none;
}

.file-info.show {
  display: block;
}

.file-name {
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
}

.file-meta {
  font-size: 13px;
  color: #64748b;
}

/* 预览区 */
.preview-area {
  margin-top: 20px;
  display: none;
}

.preview-area.show {
  display: block;
}

.preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* 参数设置 */
.settings-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.settings-panel h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group input[type="color"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s;
  background: white;
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-group input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.range-value {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* 操作按钮 */
.action-btn {
  width: 100%;
  background: var(--primary-gradient);
  color: white;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.action-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-btn {
  width: 100%;
  background: var(--success);
  color: white;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: block;
  text-align: center;
  margin-top: 12px;
}

.download-btn:hover {
  background: #219a52;
}

/* 结果区 */
.result-area {
  margin-top: 24px;
  padding: 20px;
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  border-radius: 8px;
  display: none;
}

.result-area.show {
  display: block;
}

.result-area h4 {
  color: #22543d;
  margin-bottom: 12px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #22543d;
}

.stat-label {
  font-size: 12px;
  color: #68d391;
}

/* 加载中 */
.loading {
  text-align: center;
  padding: 20px;
  display: none;
}

.loading.show {
  display: block;
}

.spinner {
  width: auto;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 0;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* 错误提示 */
.error-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

.error-msg.show {
  display: block;
}

/* 底部 */
.footer {
  background: #0f172a;
  color: #bdc3c7;
  padding: 32px 0;
  margin-top: 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .footer-content {
    grid-template-columns: 1fr;
  }
}

.footer h4 {
  color: white;
  margin-bottom: 12px;
  font-size: 16px;
}

.footer p, .footer li {
  font-size: 14px;
  line-height: 1.8;
}

.footer ul {
  list-style: none;
}

.footer a {
  color: #bdc3c7;
  text-decoration: none;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  font-size: 13px;
}

/* 颜色选择预设 */
.color-presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-preset {
  width: auto;
  height: 40px;
  border-radius: 0;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.color-preset:hover {
  transform: scale(1.15);
}

.color-preset.active {
  border-color: #6366f1;
  border-width: 3px;
}

/* Base64 输出 */
.base64-output {
  margin-top: 16px;
}

.base64-output textarea {
  width: 100%;
  height: 120px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12px;
  font-family: monospace;
  resize: vertical;
  background: #f8f9fa;
}

.copy-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.copy-btn:hover {
  background: #2980b9;
}

/* 多图上传 */
.multi-upload-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.multi-upload-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: visible;
}

.multi-upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-upload-item .remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

/* ========== 体验优化：进度条 ========== */
.progress-container {
  width: 100%;
  height: 36px;
  background: #f1f5f9;
  border-radius: 18px;
  overflow: visible;
  position: relative;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #7c3aed);
  border-radius: 18px;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 600;
  color: #333;
  z-index: 1;
}

/* ========== 体验优化：前后对比滑块 ========== */
.comparison-slider {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: visible;
  user-select: none;
  margin: 16px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.comparison-overlay {
  position: relative;
  width: 100%;
  padding-top: 60%;
}

.comparison-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fafafa;
}

.comparison-before {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: visible;
}

.comparison-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
}

.comparison-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: white;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}

.comparison-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: 40px;
  background: white;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  color: #6366f1;
}

.comparison-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12px;
  color: #666;
  background: #f8f9fa;
}

.label-original { color: #e74c3c; font-weight: 600; }
.label-processed { color: #27ae60; font-weight: 600; }

/* ========== 体验优化：智能预设按钮 ========== */
.preset-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.preset-btn {
  flex: 1;
  min-width: 60px;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
  text-align: center;
}

.preset-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.preset-btn.active {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: white;
  border-color: transparent;
}

.preset-btn .preset-value {
  display: block;
  font-size: 10px;
  opacity: 0.8;
  margin-top: 2px;
}

/* ========== 体验优化：结果操作区 ========== */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.result-action-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.result-action-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  transform: translateY(-1px);
}

.result-action-btn.primary {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: white;
  border-color: transparent;
}

.result-action-btn.primary:hover {
  opacity: 0.9;
  color: white;
}

/* ========== 体验优化：快捷键提示 ========== */
.shortcut-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #999;
  margin-left: 8px;
}

.shortcut-key {
  display: inline-block;
  padding: 2px 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: monospace;
  font-size: 10px;
  color: #666;
}

/* ========== 体验优化：实时估算提示 ========== */
.estimate-hint {
  font-size: 12px;
  color: #27ae60;
  margin-top: 6px;
  padding: 6px 10px;
  background: #e8f8f0;
  border-radius: 6px;
  display: none;
}

.estimate-hint.show {
  display: block;
}

/* ========== 体验优化：自动处理开关 ========== */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 10px;
}

.switch-label {
  font-size: 13px;
  color: #555;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 0;
}

.switch input:checked + .switch-slider {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
}

.switch input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* ========== 体验优化：最近记录 ========== */
.recent-records {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.recent-records h4 {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.recent-record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.recent-record-item .record-name {
  flex: 1;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #555;
}

.recent-record-item .record-stats {
  color: #27ae60;
  font-weight: 600;
  margin: 0 10px;
}

.recent-record-item .record-download {
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
}

.recent-record-item .record-download:hover {
  text-decoration: underline;
}

/* ========== 体验优化：移动端适配增强 ========== */
@media (max-width: 600px) {
  .preset-btn {
    font-size: 11px;
    padding: 6px 8px;
  }

  .result-action-btn {
    min-width: 100%;
  }

  .comparison-button {
    width: auto;
    height: 40px;
    font-size: 14px;
  }

  .drop-zone {
    padding: 32px 16px;
  }

  .drop-zone-icon {
    font-size: 36px;
  }
}

/* ========== UI升级：图标与细节优化 ========== */
.inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1.1em;
  height: 1.1em;
}

.inline-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* 结果区域优化 */
.result-area {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  animation: resultFadeIn 0.4s ease;
}

@keyframes resultFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-area h4 {
  color: #166534;
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

/* 统计卡片优化 */
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-item {
  background: white;
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 文件信息优化 */
.file-info {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  display: none;
  border-left: 3px solid var(--primary);
}

.file-info.show {
  display: block;
  animation: resultFadeIn 0.3s ease;
}

.file-name {
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
  color: var(--text-primary);
  font-size: 14px;
}

.file-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 预览区优化 */
.preview-area {
  margin-top: 20px;
  display: none;
  text-align: center;
}

.preview-area.show {
  display: block;
  animation: resultFadeIn 0.3s ease;
}

.preview-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

/* 加载动画优化 */
.loading {
  display: none;
  text-align: center;
  padding: 32px;
  margin-top: 20px;
}

.loading.show {
  display: block;
}

.spinner {
  width: auto;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 0;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

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

.loading p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* 错误提示优化 */
.error-msg {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--danger);
  color: #991b1b;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.error-msg.show {
  display: block;
  animation: resultFadeIn 0.3s ease;
}

/* 预设按钮优化 */
.preset-btn {
  position: relative;
  overflow: visible;
}

.preset-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  pointer-events: none;
}

/* 结果操作按钮优化 */
.result-action-btn {
  position: relative;
  overflow: visible;
}

.result-action-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;
}

.result-action-btn:hover::before {
  left: 100%;
}

/* 导航链接优化 */
.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: white;
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

/* 工具卡片图标背景色 */
.tool-icon {
  background: var(--primary-light);
  color: var(--primary);
}

/* ========== 结果在线预览 ========== */
.result-preview-image {
  text-align: center;
  margin: 16px 0;
  padding: 16px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  animation: resultFadeIn 0.4s ease;
}

.result-preview-image img {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: inline-block;
}

/* ========== 模式选择按钮 ========== */
.mode-btn {
  padding: 12px 8px;
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: 13px;
  color: var(--text-primary);
}

.mode-btn:hover {
  border-color: var(--primary);
}

.mode-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.mode-btn small {
  font-size: 11px;
}

.btn,.btn-primary,button{border-radius:10px;font-weight:600;border:none;cursor:pointer}
.btn-primary{background:linear-gradient(135deg,#667eea,#764ba2);box-shadow:0 4px 20px rgba(99,102,241,.3);color:#fff}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 6px 24px rgba(99,102,241,.4)}
.card,.tool-card,.stat-card,[class*=card]{border-radius:14px;border:1px solid var(--border-light);box-shadow:0 1px 3px rgba(15,23,42,.06);background:var(--bg-card)}
.tool-card:hover,.card:hover{transform:translateY(-4px);box-shadow:0 12px 40px rgba(15,23,42,.12);border-color:rgba(99,102,241,.2)}
.tool-icon{background:linear-gradient(135deg,rgba(102,126,234,.1),rgba(118,75,162,.1));border-radius:10px}

.upload-area,.drop-zone,[class*=upload]{border-radius:14px;border:2px dashed var(--border);background:linear-gradient(135deg,#fafbff,#f5f3ff)}
.upload-area:hover,.drop-zone:hover{border-color:var(--primary);background:var(--primary-light)}
input,select,textarea{border-radius:10px;border:1px solid var(--border);background:#fff;color:var(--text-primary)}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(99,102,241,.15);outline:none}
input[type=range],.toggle,.switch,[class*=toggle]{accent-color:var(--primary)}
.quality-btn,.option-btn,[class*=quality]{border-radius:10px;border:1px solid var(--border);background:#fff;color:var(--text-secondary);font-weight:600}
.quality-btn.active,.option-btn.active{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border-color:transparent;box-shadow:0 4px 20px rgba(99,102,241,.3)}

@keyframes fadeInUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
.tool-card,.card,.stat-card{animation:fadeInUp .4s ease-out backwards}
.tool-card:nth-child(2){animation-delay:.05s}.tool-card:nth-child(3){animation-delay:.1s}.tool-card:nth-child(4){animation-delay:.15s}.tool-card:nth-child(5){animation-delay:.2s}.tool-card:nth-child(6){animation-delay:.25s}.tool-card:nth-child(7){animation-delay:.3s}.tool-card:nth-child(8){animation-delay:.35s}
body{font-family:apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}

/* 移动端点击优化 */
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, a, .tool-card, .upload-area, #dropZone, .quality-btn, .nav-link { touch-action: manipulation; cursor: pointer; }
#fileInput { opacity: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0; cursor: pointer; z-index: 10; }

/* 移动端上传优化 */
.upload-area, #dropZone { position: relative; overflow: visible; }
.mobile-file-input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 100; -webkit-opacity: 0; }
.upload-btn { position: relative; z-index: 1; pointer-events: none; }

/* ===== 按钮颜色增强 - 移动端高对比度 ===== */
.upload-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border: 2px solid #4338ca !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4) !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
  min-height: 48px !important;
  min-width: 120px !important;
  padding: 12px 32px !important;
  font-size: 16px !important;
}
.upload-btn:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5) !important;
}
.action-btn, .result-action-btn, .download-btn, .copy-btn {
  min-height: 48px !important;
  font-weight: 600 !important;
  border: 2px solid transparent !important;
}
.result-action-btn.primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border-color: #4338ca !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4) !important;
}
.preset-btn {
  min-height: 56px !important;
  border: 2px solid #e2e8f0 !important;
  font-weight: 600 !important;
}
.preset-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border-color: #4338ca !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4) !important;
}
#compressBtn:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  border: 2px solid #4338ca !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4) !important;
  font-weight: 700 !important;
  min-height: 56px !important;
  font-size: 18px !important;
}


/* ===== 移动端按钮超强增强 ===== */
@media (max-width: 768px) {
  .upload-btn {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    border: 3px solid #3730a3 !important;
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.5) !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    min-height: 56px !important;
    font-size: 18px !important;
    padding: 14px 32px !important;
    letter-spacing: 1px;
  }
  .upload-btn:hover {
    background: linear-gradient(135deg, #3730a3 0%, #5b21b6 100%) !important;
  }
  #compressBtn:not(:disabled), .action-btn.primary, .result-action-btn.primary {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    border: 3px solid #3730a3 !important;
    box-shadow: 0 6px 16px rgba(67, 56, 202, 0.5) !important;
    font-weight: 800 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    min-height: 56px !important;
    font-size: 18px !important;
  }
  .preset-btn.active {
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    border: 3px solid #3730a3 !important;
    font-weight: 700 !important;
  }
  /* 上传区域增强 */
  .drop-zone, #dropZone {
    border: 3px dashed #6366f1 !important;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%) !important;
    min-height: 220px !important;
  }
  .drop-zone h3, #dropZone h3 {
    color: #1e1b4b !important;
    font-weight: 700 !important;
    font-size: 18px !important;
  }
  .drop-zone p, #dropZone p {
    color: #4338ca !important;
    font-size: 14px !important;
  }
}


