:root #tool-body {
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --primary: #16baaa;
  --danger: #ff5722;
  --dark-item: #2b2d36;
  --border-color: #eee;
  --text-muted: #999;
  --panel-bg: #f2f4f7;
}

#tool-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 上傳區 */
#tool-body .upload-area {
  padding: 40px;
  text-align: center;
  border-radius: 8px;
  border-width: 2px;
  cursor: pointer;
  transition: .3s;
  display: block;
  color: inherit;
}
#tool-body .upload-area:hover { border-color: var(--primary); }
#tool-body .upload-icon { font-size: 48px; color: var(--primary); margin-bottom: 10px; }
#tool-body .upload-area h3 { margin-bottom: 5px; }
#tool-body .upload-area p { color: var(--text-muted); font-size: 14px; }

/* 文件列表 */
#tool-body .section-title {
  margin: 25px 0 15px; font-weight: bold;
  display: flex; justify-content: space-between; align-items: center;
}
#tool-body .clear-btn { font-size: 14px; color: var(--danger); cursor: pointer; font-weight: normal; }

#tool-body .video-item {
  background: var(--dark-item); color: #fff; border-radius: 8px; margin-bottom: 15px; padding: 15px;
  display: flex; align-items: center; box-shadow: 0 4px 12px rgba(0,0,0,0.15); position: relative; overflow: hidden;
}
#tool-body .file-icon {
  z-index: 1; width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-right: 15px; flex-shrink: 0;
}
#tool-body .file-icon i { font-size: 20px; color: var(--primary); }
#tool-body .file-info { flex: 1; min-width: 0; z-index: 1; }
#tool-body .file-name { font-size: 14px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tool-body .file-meta { font-size: 12px; color: #bbb; margin-top: 3px; }
#tool-body .badge-fmt {
  background: var(--primary); color: #fff; padding: 0 5px; border-radius: 2px;
  font-size: 10px; margin-left: 5px; font-weight: bold;
}
#tool-body .del-btn {
  z-index: 1; margin-left: 15px; color: var(--danger); cursor: pointer;
  font-size: 20px; opacity: 0.6; transition: 0.2s; padding: 10px;
}
#tool-body .del-btn:hover { opacity: 1; transform: scale(1.1); }
#tool-body .item-progress { width: 100%; height: 3px; background: #555; margin-top: 8px; border-radius: 2px; overflow: hidden; display: none; }
#tool-body .item-progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s; }
#tool-body .item-status { font-size: 11px; color: #aaa; margin-top: 4px; display: none; }

/* 控制面板 */
#tool-body .control-panel-wrapper {
  background: var(--card-bg); border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-top: 20px; overflow: hidden; border: 1px solid var(--border-color);
}
#tool-body .panel-header {
  background: var(--panel-bg); padding: 15px 20px;
  display: flex; align-items: center; gap: 8px;
  font-weight: bold; color: #555; font-size: 15px;
  border-bottom: 1px solid var(--border-color);
}
#tool-body .panel-header i { color: var(--primary); font-size: 18px; }
#tool-body .panel-content { padding: 20px 25px; }

#tool-body .param-row {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 15px;
}
#tool-body .param-item { display: flex; align-items: center; gap: 10px; }
#tool-body .param-label { font-size: 13px; color: #666; font-weight: bold; white-space: nowrap; }

#tool-body .quality-btns { display: flex; gap: 8px; }
#tool-body .q-btn {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid #ddd;
  cursor: pointer; font-size: 13px; transition: 0.2s; background: transparent; color: #666;
  user-select: none;
}
#tool-body .q-btn:hover { border-color: var(--primary); color: var(--primary); }
#tool-body .q-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

#tool-body .format-select-wrap { display: flex; align-items: center; gap: 10px; }
#tool-body .simple-select {
  border: 1.5px solid #ddd; background: transparent; font-size: 14px; font-weight: 500;
  color: #333; outline: none; cursor: pointer; padding: 5px 10px; border-radius: 6px;
  transition: 0.2s;
}
#tool-body .simple-select:hover, #tool-body .simple-select:focus { border-color: var(--primary); }

#tool-body .action-row {
  display: flex; align-items: center; gap: 15px; padding-top: 15px;
  border-top: 1px dashed var(--border-color); margin-top: 5px;
}
#tool-body #processBtn {
  flex: 1; background-color: var(--primary); min-width: 200px;
  transition: 0.3s; border: none;
}

/* 輸出區 */
#tool-body .output-area { display: none; margin-top: 30px; border-top: 1px solid var(--border-color); padding-top: 20px; }
#tool-body .output-item {
  border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 15px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); flex-wrap: wrap; gap: 10px;
}
#tool-body .output-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
#tool-body .output-name {
  font-weight: bold; font-size: 14px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#tool-body .tag-fmt {
  background: #e3f9f5; color: var(--primary);
  border: 1px solid #c2e9e3; padding: 2px 7px; border-radius: 4px;
  font-size: 12px; flex-shrink: 0; font-weight: bold;
}
#tool-body .tag-size {
  color: var(--text-muted); font-size: 12px; white-space: nowrap;
}
#tool-body .output-player-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#tool-body audio { height: 32px; outline: none; max-width: 280px; border-radius: 20px; }
#tool-body .output-player-wrap a.layui-btn {
  display: flex; align-items: center; justify-content: center; color: #fff;
}

/* 響應式 */
@media screen and (max-width: 768px) {
  #tool-body .upload-area { padding: 20px; }
  #tool-body .param-row { gap: 12px; }
  #tool-body .output-item { flex-direction: column; align-items: flex-start; }
  #tool-body .output-left { width: 100%; }
  #tool-body .output-player-wrap { width: 100%; }
  #tool-body audio { width: 100%; max-width: none; height: 40px; }
  #tool-body .output-name { max-width: 55vw; }
}

/* 夜間模式 */
.theme-dark-mode #tool-body { color: #ddd; }
.theme-dark-mode #tool-body .control-panel-wrapper,
.theme-dark-mode #tool-body .output-item { background: #2b2b2b; border-color: #444; }
.theme-dark-mode #tool-body .panel-header { background: #333; color: #bbb; border-color: #444; }
.theme-dark-mode #tool-body .param-label { color: #aaa; }
.theme-dark-mode #tool-body .q-btn { border-color: #555; color: #aaa; background: transparent; }
.theme-dark-mode #tool-body .q-btn:hover { border-color: var(--primary); color: var(--primary); }
.theme-dark-mode #tool-body .q-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.theme-dark-mode #tool-body .simple-select { border-color: #555; color: #ddd; background: #333; }
.theme-dark-mode #tool-body .action-row { border-color: #383838; }
.theme-dark-mode #tool-body .output-name { color: #ddd; }
.theme-dark-mode #tool-body .tag-fmt { background: #1a3a38; border-color: #2a5a55; }
.theme-dark-mode #tool-body audio { filter: invert(0.85); }
.theme-dark-mode #tool-body .output-area { border-color: #444; }

#tool-body .preview-btn {
  cursor: pointer;transition: 0.2s;
}
#tool-body .preview-btn:hover { transform: scale(1.1); }