/* ===== 轻图（图片压缩）工具专属样式 =====
   全站共享样式（tokens / header / footer / FAQ 等）见 /css/site.css */

/* ===== Dropzone ===== */
.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  color: var(--muted);
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
}
.dz-icon { color: var(--accent); margin-bottom: 12px; }
.dz-main { font-size: 17px; font-weight: 600; color: var(--text); }
.dz-main .link { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.dz-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ===== Showcase（压缩效果演示）===== */
.showcase { margin-top: 0; }
.compare {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  user-select: none;
  touch-action: none;
  aspect-ratio: 16 / 9;
}
.compare-img {
  width: 100%; height: 100%;
  display: block; pointer-events: none;
  object-fit: cover; object-position: center;
}
.compare-after {
  position: absolute; inset: 0;
  clip-path: inset(0 50% 0 0);
}
.compare-after .compare-img { position: absolute; inset: 0; }
.compare-divider {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: #fff;
  box-shadow: 0 0 0 1px rgba(24, 24, 27, .18);
  pointer-events: none;
  transform: translateX(-1px);
  z-index: 2;
}
.compare-handle {
  position: absolute; top: 50%; left: 50%;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.compare:hover .compare-handle, .compare:focus-within .compare-handle { opacity: 1; }
.compare-handle::before, .compare-handle::after {
  content: ""; border: 4px solid transparent;
}
.compare-handle::before { border-right: 6px solid var(--accent-strong); margin-right: 3px; }
.compare-handle::after { border-left: 6px solid var(--accent-strong); margin-left: 3px; }
.compare input[type="range"] {
  display: none;
}
.compare { cursor: ew-resize; }
.compare-tags {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}
.demo-tag {
  background: rgba(24, 24, 27, .72); color: #fff;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.demo-tag b { color: #6ee7b7; }
.demo-tag.after b { color: #6ee7b7; }
.demo-stats {
  display: flex; justify-content: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.demo-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 22px; text-align: center; min-width: 120px;
  box-shadow: var(--shadow-sm);
}
.demo-stat b { display: block; font-size: 20px; font-weight: 700; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.demo-stat:nth-child(3) b, .demo-stat:nth-child(4) b { color: var(--text); font-size: 16px; padding-top: 3px; }
.demo-stat span { font-size: 12px; color: var(--muted); }

/* ===== Stats ===== */
.stats {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 16px;
}
.stat { display: flex; align-items: baseline; gap: 7px; }
.stat b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat.save b { color: var(--accent-strong); }
.stats-actions { margin-left: auto; display: flex; gap: 8px; }

.btn {
  font: inherit; font-weight: 600; font-size: 13.5px;
  border-radius: var(--radius-sm);
  padding: 8px 16px; cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn.ghost:hover { background: var(--neutral-soft); }

/* ===== File list ===== */
.file-list { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.file-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm);
  background-color: var(--neutral-soft);
  background-image:
    linear-gradient(45deg, #e9e9ec 25%, transparent 25%),
    linear-gradient(-45deg, #e9e9ec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9e9ec 75%),
    linear-gradient(-45deg, transparent 75%, #e9e9ec 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  flex-shrink: 0;
  cursor: pointer; padding: 0; border: 1px solid var(--border);
  overflow: hidden; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .thumb-tag {
  position: absolute; right: 2px; bottom: 2px;
  background: rgba(24, 24, 27, .72); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  pointer-events: none;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.file-meta .arrow { color: var(--border); margin: 0 4px; }
.file-meta .after { color: var(--accent-strong); font-weight: 600; }

.badge {
  font-size: 12.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  flex-shrink: 0; min-width: 58px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.badge.saved { background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-border); }
.badge.optimal { background: var(--neutral-soft); color: var(--muted); border: 1px solid var(--border); }
.badge.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; }

.badge.busy, .badge.pending {
  background: var(--neutral-soft); color: var(--muted); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--neutral-soft); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .stats-actions { margin-left: 0; width: 100%; }
  .stats-actions .btn { flex: 1; }
  .file-card { flex-wrap: wrap; }
  .badge { order: 5; }
  .demo-stat { padding: 8px 14px; min-width: 96px; }
  .demo-stat b { font-size: 17px; }
}

/* ===== 页面底部留白 ===== */
main.container { padding-bottom: 72px; }
@media (max-width: 640px) { main.container { padding-bottom: 48px; } }
