:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #20242d;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #8d93a3;
  --accent: #6aa9ff;
  --accent-hover: #84b8ff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

header { margin-bottom: 24px; }
header h1 { margin: 0 0 4px; font-size: 22px; }
header p  { margin: 0; color: var(--muted); }

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.panel h2 {
  margin: 0 0 14px;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Drop zone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px 20px;
  min-height: 120px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--panel-2);
  color: var(--text);
}
.dropzone strong {
  display: block;
  color: var(--accent);
  font-size: 15px;
}
.dropzone small { display: block; color: var(--muted); }
.dropzone input { display: none; }

/* Controls */
.field { margin-bottom: 14px; }
.field label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field label .val { color: var(--text); font-variant-numeric: tabular-nums; }
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row input[type="number"] {
  width: 70px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
.row span.sep { color: var(--muted); }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
select, .field input[type="number"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  transition: background .12s, border-color .12s;
}
button:hover { border-color: var(--accent); }
button.primary {
  background: var(--accent);
  color: #0b1220;
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* File list */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 640px;
  overflow-y: auto;
}
.file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: var(--panel-2);
}
.file-item .thumbs {
  display: flex;
  gap: 6px;
}
.file-item .thumbs img {
  width: 96px; height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #000;
  cursor: zoom-in;
  transition: transform .12s, border-color .12s;
}
.file-item .thumbs img:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}
@media (max-width: 640px) {
  .file-item .thumbs img { width: 72px; height: 72px; }
}
.file-item .meta { min-width: 0; }
.file-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-item .info {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.file-item .info .ok  { color: var(--ok); }
.file-item .info .err { color: var(--err); }
.file-item .info code { color: var(--text); }
.file-item .actions-cell { display: flex; gap: 6px; }
.file-item button {
  padding: 5px 9px;
  font-size: 12px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

.summary {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
}
.summary b { color: var(--text); }

footer {
  margin-top: 30px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
footer code { color: var(--text); }

/* Lightbox / 对比预览 */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(2px);
}
.lightbox-content {
  position: relative;
  width: min(1100px, 100%);
  max-height: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  background: var(--panel-2);
}
.lightbox-title {
  font-size: 13px;
  color: var(--muted);
  word-break: break-all;
  padding-right: 40px;
}
.lightbox-title b { color: var(--text); }
.lightbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 760px) {
  .lightbox-grid { grid-template-columns: 1fr; }
}
.lightbox-grid figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
.lightbox-grid figcaption {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.lightbox-grid figcaption b { color: var(--text); }
.lightbox-grid img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}
.lightbox-empty {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 6px;
}
