:root{
  --bg:#0b1220;
  --panel:#111a2e;
  --panel-2:#0e1626;
  --border:#24324f;
  --text:#e7eefb;
  --muted:#93a4c4;
  --accent:#6366f1;
  --accent2:#22d3ee;
  --ok:#34d399;
  --err:#f87171;
  --warn:#fbbf24;
  --radius:14px;
}

*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;padding:0}

body{
  font-family:"Segoe UI","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  color:var(--text);
  background:radial-gradient(1100px 600px at 85% -10%,#1d2a4d 0%,var(--bg) 60%) fixed,var(--bg);
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 24px;
  border-bottom:1px solid var(--border);
  background:rgba(13,20,38,.78);
  backdrop-filter:blur(8px);
  position:sticky;
  top:0;
  z-index:10;
}
.brand{font-size:18px;font-weight:700;letter-spacing:.5px}

.container{
  width:min(1080px,94vw);
  margin:28px auto 48px;
  flex:1;
}

.hero{text-align:center;margin-bottom:28px}
.hero h1{font-size:clamp(24px,4vw,36px);margin:8px 0 10px}
.sub{color:var(--muted);margin:0 auto 24px;max-width:640px;line-height:1.7}

.drop-zone{
  border:2px dashed var(--border);
  border-radius:var(--radius);
  padding:42px 20px;
  background:linear-gradient(180deg,rgba(99,102,241,.07),rgba(34,211,238,.04));
  transition:border-color .2s,transform .2s,background .2s;
}
.drop-zone.dragging{
  border-color:var(--accent2);
  background:rgba(34,211,238,.08);
  transform:scale(1.01);
}
.dz-icon{font-size:46px}
.dz-title{font-size:19px;font-weight:600;margin:10px 0 4px}
.dz-hint{color:var(--muted);margin:6px 0 14px;font-size:14px}

.tips{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:18px;
  color:var(--muted);
  font-size:13px;
}

.btn{
  border:1px solid var(--border);
  border-radius:10px;
  cursor:pointer;
  padding:10px 18px;
  font-size:15px;
  color:var(--text);
  background:var(--panel);
  transition:filter .15s,transform .1s;
}
.btn:hover{filter:brightness(1.15)}
.btn:active{transform:translateY(1px)}
.btn.primary{
  background:linear-gradient(135deg,var(--accent),#8b5cf6);
  border:none;
  font-weight:600;
  box-shadow:0 6px 20px rgba(99,102,241,.35);
}
.btn.ghost{background:transparent}
.btn.small{padding:6px 12px;font-size:13px}

.panel{
  background:linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px 24px;
  margin-bottom:24px;
}
.panel h2{margin:0 0 16px;font-size:20px}

/* 进度条 */
.progress-label{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  color:var(--muted);
  font-size:14px;
}
.progress-track{
  height:10px;
  border-radius:999px;
  background:var(--panel-2);
  border:1px solid var(--border);
  overflow:hidden;
}
.progress-fill{
  height:100%;
  width:0;
  border-radius:999px;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  transition:width .25s;
}
.progress-actions{margin-top:12px;display:flex;justify-content:flex-end}

/* 统计卡片 */
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:14px;
}
.card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px 12px;
  text-align:center;
  background:var(--panel-2);
}
.card .num{
  font-size:clamp(20px,3vw,28px);
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.card .label{margin-top:6px;color:var(--muted);font-size:13px}
.card.accent{
  border-color:rgba(99,102,241,.6);
  background:linear-gradient(180deg,rgba(99,102,241,.16),rgba(99,102,241,.05));
}
.total-detail{color:var(--muted);font-size:14px;margin:14px 0 4px}

/* 重复视频确认面板 */
.dup-panel{
  border:1px solid rgba(251,191,36,.45);
  background:linear-gradient(180deg,rgba(251,191,36,.08),rgba(251,191,36,.02));
  border-radius:12px;
  padding:16px 18px;
  margin-bottom:18px;
}
.dup-head{font-weight:700;font-size:16px;color:var(--warn);margin-bottom:6px}
.dup-desc{color:var(--muted);font-size:13px;line-height:1.6;margin-bottom:12px}
.dup-list{display:flex;flex-direction:column;gap:8px;max-height:260px;overflow:auto}
.dup-item{
  display:flex;
  align-items:center;
  gap:12px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  transition:border-color .15s,background .15s;
}
.dup-item:hover{border-color:rgba(251,191,36,.55)}
.dup-check{width:17px;height:17px;accent-color:var(--accent2);flex:none;cursor:pointer}
.dup-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.dup-name{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dup-meta{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dup-tag{
  flex:none;
  font-size:12px;
  padding:3px 10px;
  border-radius:999px;
  white-space:nowrap;
}
.dup-tag.tag-on{background:rgba(52,211,153,.15);color:var(--ok)}
.dup-tag.tag-off{background:rgba(148,163,184,.12);color:var(--muted)}

/* 文件夹统计 */
.subtitle{font-weight:600;margin:20px 0 10px}
.subtitle .hint{color:var(--muted);font-weight:400;font-size:12px;margin-left:6px}

/* 列表 */
.list-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  flex-wrap:wrap;
}
.search{
  flex:1;
  min-width:220px;
  background:var(--panel-2);
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--text);
  padding:9px 14px;
  font-size:14px;
  outline:none;
}
.search:focus{border-color:var(--accent)}
.list-info{color:var(--muted);font-size:13px;white-space:nowrap}

.table-wrap{
  overflow:auto;
  max-height:60vh;
  border:1px solid var(--border);
  border-radius:10px;
}
table{border-collapse:collapse;width:100%;font-size:14px}
thead th{
  position:sticky;
  top:0;
  background:#182442;
  text-align:left;
  padding:11px 14px;
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
  cursor:pointer;
  user-select:none;
  z-index:1;
}
thead th:hover{color:var(--text)}
thead th.sort-asc::after{content:" ▲";color:var(--accent2)}
thead th.sort-desc::after{content:" ▼";color:var(--accent2)}
tbody td{padding:10px 14px;border-top:1px solid #1b2740;vertical-align:top}
tbody tr:nth-child(even){background:rgba(255,255,255,.015)}
tbody tr:hover{background:rgba(99,102,241,.07)}
td.name{
  font-weight:600;
  white-space:nowrap;
  max-width:340px;
  overflow:hidden;
  text-overflow:ellipsis;
}
td.path{
  color:var(--muted);
  white-space:nowrap;
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
}
td.duration{font-variant-numeric:tabular-nums;white-space:nowrap}
td.counted{white-space:nowrap;font-size:13px}
.counted-yes{color:var(--ok)}
.counted-no{color:var(--muted)}
.status{font-size:13px}
.status-done{color:var(--ok)}
.status-error{color:var(--err)}
.status-canceled{color:var(--warn)}

.folder-table{width:100%;font-size:14px}
.folder-table td{padding:8px 12px;border-top:1px solid #1b2740}
.warn{color:var(--err);font-size:12px;margin-left:4px}

.foot{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  padding:18px;
  border-top:1px solid var(--border);
}

.toast{
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translateX(-50%) translateY(20px);
  background:#1f2b4a;
  border:1px solid var(--border);
  color:var(--text);
  padding:11px 20px;
  border-radius:10px;
  opacity:0;
  pointer-events:none;
  transition:opacity .25s,transform .25s;
  z-index:99;
  box-shadow:0 10px 30px rgba(0,0,0,.4);
  max-width:90vw;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.error{border-color:rgba(248,113,113,.5);color:#fecaca}

@media (max-width:640px){
  .container{margin-top:16px}
  .panel{padding:16px}
  td.path{max-width:120px}
  td.name{max-width:180px}
}
