:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel2: #1f232c;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #97a0b0;
  --accent: #4a8cff;
  --accent2: #2b6cd9;
  --ok: #2ec27e;
  --warn: #e0a93b;
  --err: #e25555;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }
header { background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header nav { display: flex; gap: 16px; align-items: center; flex: 1; }
header nav a { color: var(--muted); text-decoration: none; }
header nav a:hover { color: var(--text); }
header nav .meta { margin-left: auto; color: var(--muted); font-size: 12px; }
header code { background: var(--panel2); padding: 2px 6px; border-radius: 4px; }

main { padding: 20px 24px; max-width: 1500px; margin: 0 auto; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.row:last-child { margin-bottom: 0; }
.row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.row label.grow { flex: 1; min-width: 240px; }
.row input, .row select {
  background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; font-size: 14px;
}
.row input:focus, .row select:focus { outline: none; border-color: var(--accent); }
button {
  background: var(--accent); color: white; border: none; border-radius: 6px;
  padding: 9px 14px; font-size: 14px; cursor: pointer; font-weight: 500;
}
button:hover { background: var(--accent2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.filters input, .filters select { min-width: 110px; }
.deepscan { padding-top: 12px; border-top: 1px dashed var(--border); }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--border); }
.hint em { color: var(--text); font-style: normal; }

.status { padding: 10px 14px; border-radius: 6px; background: var(--panel); margin-bottom: 16px; font-size: 13px; }
.status.error { background: #3a1c1c; border: 1px solid var(--err); }
.hidden { display: none; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card .thumb { display: block; aspect-ratio: 16/9; background: #000; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.card .meta-line { color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card .dot { opacity: 0.6; }
.card .snippet { background: var(--panel2); padding: 8px; border-radius: 4px; font-size: 12px; border-left: 3px solid var(--accent); margin-top: 4px; }
.card .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.card .actions button { padding: 6px 10px; font-size: 12px; flex: 1; }
.card-status { font-size: 12px; color: var(--muted); min-height: 16px; }
.card-status.ok { color: var(--ok); }
.card-status.err { color: var(--err); }
.card.matched { border-color: var(--accent); }
.card .likes { color: var(--muted); font-size: 12px; }

.jobs { display: flex; flex-direction: column; gap: 12px; }
.job { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.job-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; }
.badge.pending { background: #3a3a1c; color: var(--warn); }
.badge.running { background: #1c2a3a; color: var(--accent); }
.badge.done { background: #1c3a2a; color: var(--ok); }
.badge.error { background: #3a1c1c; color: var(--err); }
.bar { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.fill { height: 100%; background: var(--accent); transition: width 0.3s; }
.job-msg { font-size: 12px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.job .meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.job pre { background: var(--panel2); padding: 8px; border-radius: 4px; overflow: auto; font-size: 11px; max-height: 240px; }
.job .err { color: var(--err); }

/* file panel */
.job-actions { margin-top: 8px; }
.btn-files { background: var(--panel2); color: var(--muted); border: 1px solid var(--border); font-size: 12px; padding: 5px 12px; }
.btn-files:hover { background: var(--border); color: var(--text); }
.files-panel { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.files-dir { margin-bottom: 14px; }
.files-dir-head { font-size: 13px; margin-bottom: 3px; }
.badge-platform { font-size: 11px; color: var(--muted); background: var(--panel2); padding: 1px 6px; border-radius: 8px; }
.files-count { font-size: 11px; color: var(--muted); }
.files-dir-path { font-size: 11px; color: var(--muted); font-family: monospace; margin-bottom: 6px; word-break: break-all; }
.files-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.files-table td { padding: 3px 8px 3px 0; color: var(--muted); vertical-align: top; white-space: nowrap; }
.files-table td:first-child { color: var(--text); white-space: normal; word-break: break-all; width: 100%; }
.files-err { color: var(--err); }

#files-bar { margin-top: 10px; }
#files-bar .btn-files { margin-bottom: 8px; }

.btn-resume { background: #1c3a2a; color: var(--ok); border: 1px solid var(--ok); font-size: 12px; padding: 5px 12px; }
.btn-resume:hover { background: var(--ok); color: #000; }
