:root {
  --bg: #fafaf9;
  --bg-card: #ffffff;
  --text-primary: #1c1917;
  --text-secondary: #78716c;
  --text-tertiary: #a8a29e;
  --border: #e7e5e4;
  --border-hover: #d6d3d1;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --accent-light: #e0f2fe;
  --success: #22c55e;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { 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;
  font-size: 15px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255,255,255,.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
}

.logo-icon {
  font-size: 20px;
  color: var(--accent);
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all .2s;
}

.main-nav a:hover {
  color: var(--text-primary);
  background: var(--bg);
}

.main-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.privacy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--success);
  background: #f0fdf4;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.privacy-badge .lock { font-size: 14px; }

/* Hero */
.hero {
  text-align: center;
  padding: 64px 0 48px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 32px 0 64px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all .25s;
  position: relative;
}

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

.tool-card.featured {
  border-color: var(--accent-light);
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
}

.tool-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.tool-tag {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  background: #f0fdf4;
  color: var(--success);
  border-radius: 999px;
}

.tool-tag.tag-new {
  background: var(--accent-light);
  color: var(--accent);
}

/* Features Section */
.features-section {
  padding: 48px 0 80px;
  border-top: 1px solid var(--border);
}

.features-section h2 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

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

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ====== Tool Page Layout ====== */
.tool-page {
  padding: 32px 0 64px;
}

.tool-header {
  margin-bottom: 32px;
}

.tool-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.tool-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

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

/* Drop Zone */
.drop-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: #f0f9ff;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: #e0f2fe;
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.drop-zone h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.drop-zone-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Preview Area */
.preview-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 300px;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-area img {
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
}

.preview-area canvas {
  max-width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
}


/* Controls Panel */
.controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 80px;
}

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

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

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.control-group input[type="number"],
.control-group input[type="text"],
.control-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  transition: border-color .2s;
}

.control-group input[type="number"]:focus,
.control-group input[type="text"]:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--accent);
}

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

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

.size-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.size-inputs input {
  flex: 1;
}

.size-inputs span {
  color: var(--text-tertiary);
  font-size: 18px;
}

.lock-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}

.lock-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

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

.btn-primary:disabled {
  background: var(--text-tertiary);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  width: 100%;
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: #f5f5f4;
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 13px;
}

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

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Send-to dropdown */
.send-to-wrap {
  position: relative;
  display: inline-block;
}
.send-to-menu {
  position: fixed;
  min-width: 180px;
  max-width: calc(100vw - 16px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  z-index: 9999;
  padding: 4px;
}
.send-to-menu.hidden { display: none; }
.send-to-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.send-to-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}
.send-to-item .icon { font-size: 16px; }

/* Result preview cards */
.result-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
  width: 100%;
}
.result-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.result-card img {
  width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  cursor: zoom-in;
  background: #f5f5f4;
}
.result-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.result-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.result-card-name {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-card-size {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.result-card .btn { padding: 6px 16px; font-size: 14px; white-space: nowrap; }

/* Image lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 4px;
}

/* Result info */
.result-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: #166534;
}

.result-info .highlight {
  font-weight: 600;
  color: #15803d;
}

/* Loading */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  z-index: 10;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 12px;
}

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

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

.loading-progress {
  width: 200px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s;
}

/* Shared left-panel wrapper (compress + resize) */
.left-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Shared stats bar (compress + resize) */
.stats-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
}
.stats-group { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-value { font-size: 17px; font-weight: 600; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.btn-group { display: flex; gap: 8px; }

/* Shared file-list table (compress + resize) */
.file-list-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.file-list-header {
  display: grid;
  grid-template-columns: 50px 2fr 1fr 1fr 1fr 160px;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.file-list-body { max-height: 380px; overflow-y: auto; }
.file-item {
  display: grid;
  grid-template-columns: 50px 2fr 1fr 1fr 1fr 160px;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
  font-size: 13px;
}
.file-item:hover { background: var(--bg); }
.file-thumbnail {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.file-name {
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.file-size { color: var(--text-secondary); font-size: 12px; }
.file-status { font-size: 12px; font-weight: 500; }
.status-pending { color: var(--text-tertiary); }
.status-processing { color: var(--accent); }
.status-success { color: var(--success); }
.status-warning { color: #f59e0b; }
.status-failed { color: var(--danger); }
.action-btns { display: flex; gap: 4px; align-items: center; }
.dl-btn {
  padding: 4px 10px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 4px;
  font-size: 12px; cursor: pointer;
  transition: all .2s;
}
.dl-btn:hover:not(:disabled) { background: var(--accent-hover); }
.dl-btn:disabled { background: var(--text-tertiary); cursor: not-allowed; }
.send-btn {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.send-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Watermark position grid */
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.position-grid button {
  padding: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all .2s;
}

.position-grid button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Privacy note */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #166534;
  margin-bottom: 16px;
}

.privacy-note .icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* hidden */
.hidden { display: none !important; }

/* cropper specific */
.crop-container {
  width: 100%;
  height: 480px;
  max-height: 70vh;
  background: #1a1a1a;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

@media (max-width: 768px) {
  .crop-container {
    width: 100%;
    height: 45vh;
    max-height: 320px;
    min-height: 200px;
  }
}

/* When crop is active, neutralize preview-area flex/padding */
.preview-area.cropping {
  display: block;
  padding: 0;
  overflow: hidden;
  max-width: 100%;
  width: 100%;
}

/* Override preview-area img/canvas constraints inside cropper */
.crop-container img,
.crop-container canvas {
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  display: block;
}

/* Cropper.js internal elements must not be constrained */
.crop-container .cropper-container,
.crop-container .cropper-canvas,
.crop-container .cropper-crop-box,
.crop-container .cropper-modal,
.crop-container .cropper-view-box,
.crop-container .cropper-face,
.crop-container .cropper-line,
.crop-container .cropper-point {
  max-width: none !important;
  max-height: none !important;
}

.preset-ratios {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-ratios button {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all .2s;
}

.preset-ratios button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}


/* Before/After comparison slider */
.compare-container {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  user-select: none;
}

.compare-container img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  pointer-events: none;
}

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

.compare-before img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: white;
  box-shadow: 0 0 6px rgba(0,0,0,.4);
  cursor: ew-resize;
  transform: translateX(-50%);
}

.compare-slider-handle::after {
  content: '⇄';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.compare-label {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  background: rgba(0,0,0,.6);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
}

.compare-label-before { left: 12px; }
.compare-label-after { right: 12px; }

/* ====== 去水印画笔编辑器 ====== */
.canvas-editor {
  position: relative;
  width: 100%;
  background: #1a1a1a;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 非画笔模式时允许正常滚动 */
.canvas-editor.mode-auto {
  touch-action: auto;
  cursor: default;
}

.canvas-editor canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.tool-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.tool-tab {
  flex: 1;
  padding: 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.tool-tab.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.brush-cursor {
  position: absolute;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.5);
  display: none;
}

/* ====== 移动端适配 ====== */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* 顶部导航栏简化 */
  .site-header { position: sticky; top: 0; z-index: 100; }
  .header-inner {
    height: 52px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .main-nav { display: none; }
  .logo-text { font-size: 15px; }
  .logo-icon { font-size: 18px; }
  .privacy-badge { font-size: 11px; padding: 4px 8px; }

  /* 顶部 Tab 栏（放在 header 下方） */
  .mobile-tabbar {
    display: flex !important;
    position: sticky;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    padding-top: 2px;
    padding-bottom: 2px;
    backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255,255,255,.9);
  }
  .mobile-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    line-height: 1.2;
    border-radius: 6px;
    transition: all .2s;
  }
  .mobile-tabbar a .tab-icon { font-size: 18px; line-height: 1; }
  .mobile-tabbar a.active { color: var(--accent); background: var(--accent-light); }
  .mobile-tabbar a.active .tab-icon { transform: scale(1.05); }

  /* 主内容不需要底部留白了 */
  body { padding-bottom: 0; }

  /* Hero */
  .hero { padding: 24px 0 20px; }
  .hero h1 { font-size: 22px; }
  .hero-sub { font-size: 14px; }

  /* 工具页 */
  .tool-page { padding-top: 12px; }
  .tool-header { margin-bottom: 12px; }
  .tool-header h1 { font-size: 20px; }
  .tool-header p { font-size: 13px; }
  .tool-main {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* 预览区 */
  .preview-area { padding: 12px; min-height: 180px; margin-bottom: 16px; max-width: 100%; overflow: hidden; }
  .preview-area img, .preview-area canvas { max-height: 300px; }
  .canvas-editor { min-height: 160px; max-height: 40vh; }
  .canvas-editor canvas { max-width: 100%; max-height: 40vh; }
  .crop-container { overflow: hidden !important; position: relative; }
  .drop-zone { padding: 32px 16px; min-height: 200px; }

  /* 设置面板 */
  .tool-sidebar .card { padding: 14px; }
  .tool-sidebar label { font-size: 13px; }

  /* 统计栏和表格 */
  .stats-bar {
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 8px;
    border-left-width: 3px;
  }
  .stats-group { gap: 12px; }
  .stat-value { font-size: 14px; }
  .stat-label { font-size: 10px; }
  .file-list-header, .file-item {
    grid-template-columns: 40px 1.5fr 0.8fr 0.8fr 0.8fr 100px !important;
    gap: 4px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .file-list-header { font-size: 11px; }
  .btn-group { flex-wrap: wrap; }

  /* 结果卡片 */
  .result-card img { max-height: 280px; }

  /* 裁剪容器 */
  .crop-container {
    width: 100%;
    height: 45vh;
    max-height: 320px;
    min-height: 200px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }

  .logo-text { font-size: 14px; }
  .privacy-badge { display: none; }

  .hero h1 { font-size: 20px; }
  .hero-sub { font-size: 13px; }
  .hero-badges .badge { font-size: 12px; padding: 4px 10px; }

  /* 更紧凑 */
  .tool-header h1 { font-size: 18px; }
  .tool-header p { font-size: 12px; }

  .file-list-header, .file-item {
    grid-template-columns: 36px 1fr 0.7fr 0.7fr 0.7fr 80px !important;
    gap: 3px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .file-list-header { font-size: 10px; }
  .stats-bar { padding: 6px 8px; }
  .stats-group { gap: 8px; }

  .btn-group { width: 100%; }
  .btn-group button { flex: 1; font-size: 13px; padding: 8px 12px; }

  .preview-area img, .preview-area canvas { max-height: 220px; }
  .canvas-editor { max-height: 38vh; min-height: 140px; }
  .canvas-editor canvas { max-width: 100%; max-height: 38vh; }
  .crop-container { height: 40vh; max-height: 280px; min-height: 180px; }

  /* 顶部 tab 更紧凑 */
  .mobile-tabbar a { font-size: 9px; padding: 4px 2px; }
  .mobile-tabbar a .tab-icon { font-size: 16px; }
  body { padding-bottom: 0; }
}

/* ═══ FAQ 常见问题 ═══ */
.faq-section {
  margin-top: 48px;
}
.faq-section h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s;
}
.faq-item:hover { border-color: var(--border-hover); }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  padding: 14px 0;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '⌄';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 16px;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq-item p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  padding: 0 0 16px;
  margin: 0;
}

/* ═══ 最近处理历史 ═══ */
.history-section {
  margin-top: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-head h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.history-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all .2s;
}
.history-clear:hover { border-color: var(--danger); color: var(--danger); }
.history-note {
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 6px 0 14px;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  min-width: 0;
}
.history-item:first-child { border-top: none; }
.hi-tool {
  flex-shrink: 0;
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}
.hi-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.hi-meta { flex-shrink: 0; color: var(--text-secondary); font-size: 12px; }
.hi-time { flex-shrink: 0; color: var(--text-tertiary); font-size: 12px; }
@media (max-width: 640px) {
  .history-section { padding: 16px; }
  .hi-time { display: none; }
}
