* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  background: #f4f7f6;
  color: #1a1a1a;
  line-height: 1.5;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8e6;
}
.topbar h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}
.dim { color: #94a3a0; font-weight: 400; margin-left: 6px; }
.btn-ghost {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid #e2e8e6;
  border-radius: 6px;
  background: #fff;
}
.btn-ghost:hover { background: #f4f7f6; }
.layout {
  display: grid;
  /* 3 列：下载端 (1.2fr, 多控件) | 本地缓存 (0.9fr, 主要是文件树) | 上传端 (1.2fr) */
  grid-template-columns: 1.2fr 0.9fr 1.2fr;
  gap: 14px;
  padding: 18px 24px;
  max-width: 1500px;
  margin: 0 auto;
}
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  border: 1px solid #e2e8e6;
}
.panel h2 {
  font-size: 15px;
  margin: 0 0 14px;
  font-weight: 600;
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: #4b5754;
  margin-bottom: 4px;
  font-weight: 500;
}
.field input, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d4dcda;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: #ff6b00;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}
.field textarea { resize: vertical; min-height: 80px; }
.actions {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.btn {
  background: #fff;
  border: 1px solid #d4dcda;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
  transition: all 0.15s ease;
}
.btn:hover { background: #f4f7f6; }
.btn.primary {
  background: #ff6b00;
  border-color: #ff6b00;
  color: #fff;
}
.btn.primary:hover { background: #e55a00; }
.progress-block { margin-top: 14px; }
.progress-label {
  font-size: 12px;
  color: #4b5754;
  margin-bottom: 6px;
}
.progress-bar {
  width: 100%;
  height: 10px;
  background: #f4f7f6;
  border-radius: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b00, #ff8533);
  transition: width 0.3s ease;
}
.progress-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #94a3a0;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.settings { max-width: 720px; margin: 24px auto; padding: 0 24px; }
.status {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 24px;
  background: #fff;
  border-top: 1px solid #e2e8e6;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.status a { color: #94a3a0; text-decoration: none; }
.status a:hover { color: #ff6b00; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}

/* 滚动条（log-area 深色背景，浏览器默认滚动条看不见，必须显式） */
.log-area::-webkit-scrollbar { width: 10px; }
.log-area::-webkit-scrollbar-track { background: #2d2d2d; border-radius: 5px; }
.log-area::-webkit-scrollbar-thumb { background: #5a5a5a; border-radius: 5px; }
.log-area::-webkit-scrollbar-thumb:hover { background: #7a7a7a; }
.log-area { scrollbar-color: #5a5a5a #2d2d2d; scrollbar-width: thin; }
/* Tree +/- 按钮 + 折叠（2026-09-07 14:35）*/
.tree-dir { padding: 1px 0; }
.tree-dir.collapsed > ul.tree { display: none; }
.tree-toggle {
  color: #ff6b00;
  cursor: pointer;
  font-weight: bold;
  margin: 0 4px;
  user-select: none;
  display: inline-block;
  min-width: 14px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
}

/* 下载文件状态列表（修复 #1：能看到每个文件的状态 + 字节进度） */
.dl-files-list {
  margin-top: 8px;
  background: #f4f7f6;
  border-radius: 6px;
  padding: 6px 8px;
  max-height: 180px;
  overflow-y: auto;
}
.dl-files-list::-webkit-scrollbar { width: 8px; }
.dl-files-list::-webkit-scrollbar-thumb { background: #cbd5d1; border-radius: 4px; }
.fs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  border-radius: 3px;
}
.fs-row.fs-downloading { background: #fff8e1; color: #5d4037; }
.fs-row.fs-done { color: #94a3a0; }
.fs-row.fs-done .fs-name { text-decoration: line-through; }
.fs-row.fs-failed { background: #ffebee; color: #b71c1c; }
.fs-icon { width: 16px; text-align: center; flex-shrink: 0; }
.fs-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-size { font-size: 10px; flex-shrink: 0; }
