/* ============================================
   极简风格 — 参考 masterconvert 思路
   干净的卡片 + 留白 + 一点紫色强调
   ============================================ */

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #171717;
  --text-2: #525252;
  --text-3: #a3a3a3;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --success: #16a34a;
  --warning: #ea580c;
  --error: #dc2626;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --card: #171717;
    --border: #262626;
    --border-strong: #404040;
    --text: #fafafa;
    --text-2: #a3a3a3;
    --text-3: #525252;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
  }
}

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

html, body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

header {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}
header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
header p {
  color: var(--text-2);
  font-size: 0.95rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ----- Drop zone ----- */
#dropzone {
  background: var(--card);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
#dropzone:hover, #dropzone.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--card));
}
#dropzone .icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 1rem;
}
#dropzone .title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
#dropzone .hint {
  font-size: 0.85rem;
  color: var(--text-3);
}
#file-input { display: none; }

/* ----- File list ----- */
section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.queue-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.queue-head h2 { font-size: 1rem; font-weight: 600; }
.queue-head h2 span {
  color: var(--text-3); font-weight: 400; font-size: 0.85em; margin-left: 0.25rem;
}
.actions { display: flex; gap: 0.5rem; }

button {
  font-family: inherit; font-size: 0.85rem; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 0.4rem 0.85rem; background: var(--card); color: var(--text);
  transition: all 0.15s;
}
button:hover { background: var(--border); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; }

h2 { font-size: 1rem; font-weight: 600; padding: 1rem 1.25rem; }
h2 span { color: var(--text-3); font-weight: 400; font-size: 0.85em; margin-left: 0.25rem; }

ul { list-style: none; }
ul li {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.25rem; border-top: 1px solid var(--border);
}
ul li:first-child { border-top: none; }
ul li.processing { background: color-mix(in srgb, var(--accent) 3%, transparent); }
ul li.error     { background: color-mix(in srgb, var(--error) 4%, transparent); }
ul li.done      { background: color-mix(in srgb, var(--success) 3%, transparent); }

li .thumb {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: var(--text-2);
  flex-shrink: 0; overflow: hidden;
}
li .thumb img { width: 100%; height: 100%; object-fit: cover; }

li .info { flex: 1; min-width: 0; }
li .name { font-size: 0.9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
li .meta { font-size: 0.78rem; color: var(--text-3); margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

li .status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-2); min-width: 80px; justify-content: flex-end; }
li .status.error { color: var(--error); }
li .status.done { color: var(--success); }
li .progress {
  flex: 0 0 80px; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden;
}
li .progress-inner {
  height: 100%; background: var(--accent); transition: width 0.2s;
}
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

li .dl {
  color: var(--accent); text-decoration: none; font-size: 0.85rem;
  padding: 0.3rem 0.7rem; border: 1px solid var(--accent); border-radius: 6px;
}
li .dl:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ----- Info ----- */
.info { background: transparent; border: none; }
.info details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.info summary { cursor: pointer; font-weight: 500; color: var(--text-2); user-select: none; }
.info summary:hover { color: var(--text); }
.info ul {
  margin-top: 0.75rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  padding-left: 1.25rem;
  list-style: disc;
}
.info li { border: none; padding: 0; color: var(--text-2); font-size: 0.85rem; }

/* ----- Footer ----- */
footer {
  text-align: center; padding: 2rem 1.5rem; color: var(--text-3); font-size: 0.8rem;
}

/* ----- Toast ----- */
#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 100;
  pointer-events: none;
}
.toast-msg {
  background: var(--text); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: 6px;
  font-size: 0.85rem; box-shadow: var(--shadow);
  animation: toastIn 0.2s ease-out;
}
.toast-msg.error { background: var(--error); color: white; }
.toast-msg.success { background: var(--success); color: white; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----- Responsive ----- */
@media (max-width: 600px) {
  header { padding: 2.5rem 1rem 1.5rem; }
  header h1 { font-size: 1.5rem; }
  main { padding: 0 1rem 3rem; }
  #dropzone { padding: 2rem 1rem; }
  li .progress { flex: 0 0 50px; }
  li .status { min-width: 50px; }
}