/* ============ 上传页 ============ */
.wrap { max-width: 980px; margin: 0 auto; padding: 40px 22px 60px; }

/* 引导门 */
.gate { display: grid; place-items: center; min-height: 56vh; }
.gate-card {
  text-align: center;
  background: linear-gradient(180deg, #191924, #13131c);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 52px 60px;
  box-shadow: var(--shadow);
}
.gate-ico { font-size: 46px; margin-bottom: 18px; }
.gate-card h2 { font-size: 21px; margin-bottom: 10px; }
.gate-card p { color: var(--txt2); font-size: 13.5px; line-height: 1.9; margin-bottom: 24px; }

/* 拖放区 */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: var(--panel);
  padding: 54px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s ease;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: rgba(139, 92, 246, 0.6); background: rgba(139, 92, 246, 0.06); }
.dropzone.drag {
  border-color: var(--accent2);
  background: rgba(34, 211, 238, 0.08);
  transform: scale(1.008);
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.08);
}
.dz-ico { font-size: 42px; margin-bottom: 14px; }
.dz-title { font-size: 17px; font-weight: 700; }
.dz-sub { font-size: 12.5px; color: var(--txt3); margin-top: 9px; line-height: 1.7; }
.dz-btns { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.dz-btns .btn { pointer-events: auto; }

/* 批量设置 */
.card-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 18px;
}
.batch-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.batch-row + .batch-row { margin-top: 14px; }
.batch-field { min-width: 150px; }
.batch-field.grow { flex: 1; min-width: 200px; }
.batch-field .input, .batch-field .select { width: 100%; }
.batch-btns { display: flex; gap: 10px; margin-left: auto; }

/* 文件行 */
.flist { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.frow {
  display: flex; gap: 15px; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  animation: toastIn 0.25s ease;
}
.fthumb {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  background: #16161f;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  position: relative;
}
.fthumb img, .fthumb video { width: 100%; height: 100%; object-fit: cover; }
.fthumb .ph { font-size: 20px; color: var(--txt3); }
.fthumb .spin {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fmain { flex: 1; min-width: 0; }
.fmain .input { width: 100%; padding: 7px 12px; font-size: 14px; }
.fsub { display: flex; align-items: center; gap: 9px; margin-top: 7px; font-size: 12px; color: var(--txt3); flex-wrap: wrap; }
.fsub .extb {
  padding: 2px 8px; border-radius: 6px;
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd; font-weight: 700; font-size: 11px;
}
.fsub .fdir {
  padding: 2px 8px; border-radius: 6px;
  background: rgba(34, 211, 238, 0.10);
  color: #67e8f9; font-size: 11px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fmain .progress { margin-top: 9px; }
.fstatus { font-size: 12.5px; margin-top: 7px; color: var(--txt3); }
.fstatus.ok { color: var(--ok); }
.fstatus.err { color: var(--danger); }
.fright { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.fright .select { min-width: 132px; font-size: 13px; padding: 7px 30px 7px 11px; }
.fcat-tag {
  font-size: 10.5px; padding: 2px 7px; border-radius: 6px;
  background: rgba(34, 211, 238, 0.12); color: #67e8f9;
  align-self: center; white-space: nowrap;
}
.fdel {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  color: var(--txt3); cursor: pointer; font-size: 14px;
  transition: all 0.18s;
}
.fdel:hover { color: var(--danger); background: rgba(248, 113, 113, 0.1); }
.frow.done { border-color: rgba(52, 211, 153, 0.35); }
.frow.fail { border-color: rgba(248, 113, 113, 0.45); }
.frow.dupe { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.05); }
.fstatus.warn { color: #fbbf24; }
/* 重复文件提示条 */
.fdup {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 7px 11px;
  border-radius: 9px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.32);
  font-size: 12.5px; color: #fde68a;
}
.fdup button { flex-shrink: 0; }
html[data-theme="light"] .frow.dupe { background: rgba(251, 191, 36, 0.08); }
html[data-theme="light"] .fdup { color: #8a6100; background: rgba(251, 191, 36, 0.14); }

/* 设置弹窗内 */
.set-stats {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.set-stat {
  flex: 1; text-align: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 8px;
}
.set-stat b { display: block; font-size: 19px; }
.set-stat span { font-size: 11.5px; color: var(--txt3); }
.set-sec { margin-bottom: 22px; }
.set-sec h4 { font-size: 14px; margin-bottom: 11px; color: var(--txt); }
.cat-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 11px; max-height: 200px; overflow-y: auto; }
.cat-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 13px;
  font-size: 13.5px;
}
.cat-item .n { margin-left: auto; color: var(--txt3); font-size: 12px; }
.cat-item button {
  border: none; background: transparent; color: var(--txt3);
  cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 6px;
}
.cat-item button:hover { color: var(--danger); background: rgba(248,113,113,0.1); }
.cat-add { display: flex; gap: 9px; }
.cat-add .input { flex: 1; }
/* 自动归类规则行 */
.rule-row {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 10px;
  margin-bottom: 7px;
}
.rule-row .rule-cat {
  flex-shrink: 0; min-width: 96px;
  font-size: 12.5px; font-weight: 600; color: #67e8f9;
}
.rule-row .rule-kw { flex: 1; padding: 6px 10px; font-size: 13px; }
.rule-row .rule-del {
  border: none; background: transparent; color: var(--txt3);
  cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 6px;
}
.rule-row .rule-del:hover { color: var(--danger); background: rgba(248,113,113,0.1); }
html[data-theme="light"] .rule-row { background: #faf9f7; border-color: rgba(20,22,26,0.08); }
html[data-theme="light"] .rule-row .rule-cat { color: #0a6fa8; }
.inline-form { display: flex; gap: 9px; }
.inline-form .input { flex: 1; }

@media (max-width: 720px) {
  .wrap { padding: 24px 14px 40px; }
  .gate-card { padding: 38px 26px; }
  .frow { flex-wrap: wrap; }
  .fright { width: 100%; justify-content: flex-end; }
  .batch-btns { width: 100%; justify-content: flex-end; }
}

/* ============ 浅色主题 ============ */
html[data-theme="light"] .gate-card {
  background: #fff;
  border-color: rgba(20, 22, 26, 0.08);
  box-shadow: 0 18px 48px rgba(20, 22, 26, 0.10);
}
html[data-theme="light"] .gate-card p { color: #5b6169; }
html[data-theme="light"] .dropzone {
  border-color: rgba(20, 22, 26, 0.16);
  background: #fff;
}
html[data-theme="light"] .dropzone:hover,
html[data-theme="light"] .dropzone:focus-visible { border-color: rgba(10, 134, 216, 0.55); background: rgba(53, 216, 255, 0.05); }
html[data-theme="light"] .dropzone.drag {
  border-color: #0a86d8;
  background: rgba(53, 216, 255, 0.09);
  box-shadow: 0 0 0 6px rgba(53, 216, 255, 0.12);
}
html[data-theme="light"] .dz-sub { color: #8b9098; }
html[data-theme="light"] .card-panel { background: #fff; border-color: rgba(20, 22, 26, 0.08); }
html[data-theme="light"] .frow { background: #fff; border-color: rgba(20, 22, 26, 0.08); }
html[data-theme="light"] .frow.done { border-color: rgba(16, 163, 74, 0.4); }
html[data-theme="light"] .frow.fail { border-color: rgba(192, 57, 43, 0.4); }
html[data-theme="light"] .fthumb { background: #f5f4f1; border-color: rgba(20, 22, 26, 0.08); }
html[data-theme="light"] .fthumb .ph { color: #9aa0a8; }
html[data-theme="light"] .fsub { color: #8b9098; }
html[data-theme="light"] .fsub .extb { background: rgba(10, 134, 216, 0.12); color: #0a6fa8; }
html[data-theme="light"] .fsub .fdir { background: rgba(10, 134, 216, 0.10); color: #0a6fa8; }
html[data-theme="light"] .fstatus { color: #8b9098; }
html[data-theme="light"] .fstatus.ok { color: #10803a; }
html[data-theme="light"] .fstatus.err { color: #c0392b; }
html[data-theme="light"] .fcat-tag { background: rgba(10, 134, 216, 0.10); color: #0a6fa8; }
html[data-theme="light"] .fdel { color: #8b9098; }
html[data-theme="light"] .fdel:hover { color: #c0392b; background: rgba(192, 57, 43, 0.08); }
html[data-theme="light"] .progress { background: rgba(20, 22, 26, 0.08); }
html[data-theme="light"] .set-stat { background: #faf9f7; border-color: rgba(20, 22, 26, 0.08); }
html[data-theme="light"] .set-stat span { color: #8b9098; }
html[data-theme="light"] .cat-item { background: #faf9f7; border-color: rgba(20, 22, 26, 0.08); }
html[data-theme="light"] .cat-item .n { color: #8b9098; }
html[data-theme="light"] .cat-item button { color: #8b9098; }
html[data-theme="light"] .cat-item button:hover { color: #c0392b; background: rgba(192, 57, 43, 0.08); }
