/**
 * style.css (精简版)
 * 只包含特定功能样式和覆盖，核心组件样式已移至 components.css
 * 依赖：base.css, components.css
 */

/* ===== 全局重置（补充 base.css）===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: #000;
  color: #fff;
  height: 100vh;
  overflow: hidden;
}

/* ===== Three.js 背景容器 ===== */
#three-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* UI 根容器 */
#ui-root {
  position: relative;
  z-index: 10;
  height: 100vh;
  pointer-events: none;
}

/* ===== 侧边栏容器（components.css 中只有按钮样式）===== */
.sidebar {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 15px;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.sidebar::before {
  content: '';
  position: absolute;
  left: -8px;
  top: -15px;
  bottom: -15px;
  width: 2px;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 255, 255, 0.3) 20%, rgba(0, 255, 255, 0.6) 50%, rgba(0, 255, 255, 0.3) 80%, transparent 100%);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===== 面板内容样式 ===== */
.panel-header {
  display: none;
}

.output-placeholder {
  color: rgba(0, 255, 255, 0.3);
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
}

/* ===== 模块控件样式 ===== */
.section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 255, 255, 0.8);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.label {
  font-size: 13px;
  color: rgba(0, 255, 255, 0.7);
  letter-spacing: 0.5px;
}

/* ===== 表单控件 ===== */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== 画质按钮组 ===== */
.quality-btn-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.square-btn {
  flex: 1;
  padding: 12px 5px;
  background: rgba(0, 20, 40, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 4px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.square-btn.active {
  background: rgba(0, 255, 255, 0.15);
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4), inset 0 0 10px rgba(0, 255, 255, 0.2);
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

/* ===== 比例按钮 ===== */
.ratio-grid {
  display: flex;
  gap: 6px;
  margin-bottom: 15px;
  justify-content: space-between;
  width: 100%;
}

/* ===== 单行比例按钮 ===== */
.ratio-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ratio-btn-inline {
  flex: 1;
  padding: 10px 8px;
  background: rgba(0, 20, 40, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.ratio-btn-inline:hover {
  background: rgba(0, 40, 80, 0.4);
  border-color: rgba(0, 255, 255, 0.4);
  color: #00ffff;
}

.ratio-btn-inline.active {
  background: rgba(0, 60, 100, 0.5);
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* ===== 自定义尺寸 ===== */
.custom-size-wrapper {
  position: relative;
  width: 100%;
}

.custom-size-toggle {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 20, 40, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-size-toggle:hover {
  background: rgba(0, 40, 80, 0.4);
  border-color: rgba(0, 255, 255, 0.4);
  color: #00ffff;
}

.custom-size-panel {
  display: none;
  margin-top: 10px;
  padding: 15px;
  background: rgba(0, 20, 40, 0.2);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 8px;
}

.custom-size-panel.show {
  display: block;
}

.custom-size-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.custom-size-input {
  flex: 1;
}

.custom-size-input label {
  display: block;
  font-size: 11px;
  color: rgba(0, 255, 255, 0.6);
  margin-bottom: 5px;
}

.custom-size-input input {
  width: 100%;
  padding: 8px;
  background: rgba(0, 20, 40, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
}

.custom-size-input input:focus {
  outline: none;
  border-color: rgba(0, 255, 255, 0.5);
}

.custom-size-apply {
  width: 100%;
  padding: 8px;
  background: rgba(0, 60, 100, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 4px;
  color: rgba(0, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-size-apply:hover {
  background: rgba(0, 80, 120, 0.5);
  border-color: #00ffff;
  color: #00ffff;
}

/* ===== 模型选择下拉框（自定义组件） ===== */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.model-select-trigger {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 14px;
  background: rgba(0, 15, 30, 0.6);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  color: #a0e8ff;
  font-size: 13px;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  outline: none;
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.25s ease;
  user-select: none;
  box-sizing: border-box;
}

.model-select-trigger::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 10px;
  height: 6px;
  border-left: 1.5px solid #00ffff;
  border-bottom: 1.5px solid #00ffff;
  transform: translateY(-75%) rotate(-45deg);
  transition: transform 0.25s ease;
}

.model-select-trigger.open::after {
  transform: translateY(-25%) rotate(-225deg);
}

.model-select-trigger:hover {
  border-color: rgba(0, 255, 255, 0.55);
  background: rgba(0, 20, 40, 0.7);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.15);
  color: #00ffff;
}

.model-select-trigger.open {
  border-color: #00ffff;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.35), inset 0 0 12px rgba(0, 255, 255, 0.08);
  color: #00ffff;
}

/* 隐藏原生 select */
.model-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* 自定义下拉面板 */
.model-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: rgba(0, 12, 24, 0.97);
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 8px;
  padding: 4px;
  z-index: 10000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 255, 0.12), inset 0 0 20px rgba(0, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.model-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.model-dropdown-item {
  padding: 11px 14px;
  color: rgba(180, 220, 255, 0.85);
  font-size: 13px;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.model-dropdown-item:hover {
  background: rgba(0, 60, 110, 0.5);
  color: #00ffff;
  padding-left: 18px;
}

.model-dropdown-item.selected {
  background: rgba(0, 80, 140, 0.4);
  color: #00ffff;
  font-weight: 500;
}

.model-dropdown-item.selected::before {
  content: '✓';
  color: #00ffff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.model-dropdown-item + .model-dropdown-item {
  margin-top: 2px;
}

/* ===== 加载动画 ===== */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(0, 255, 255, 0.1);
  border-top-color: #00ffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 255, 255, 0.2);
  border-top-color: #00ffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== 上传区域 ===== */
.upload-area,
.upload-zone {
  width: 100%;
  min-height: 120px;
  background: rgba(0, 20, 40, 0.2);
  border: 2px dashed rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 20px;
}

.upload-area:hover,
.upload-zone:hover,
.upload-zone.dragover {
  border-color: rgba(0, 255, 255, 0.5);
  background: rgba(0, 30, 60, 0.3);
}

.upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
}

.upload-icon svg {
  width: 40px;
  height: 40px;
  color: rgba(0, 255, 255, 0.5);
}

.upload-text {
  color: rgba(0, 255, 255, 0.7);
  font-size: 13px;
}

.upload-hint {
  color: rgba(0, 255, 255, 0.4);
  font-size: 11px;
}

/* ===== 进度条 ===== */
.progress-wrap {
  margin-top: 15px;
  display: none;
}

.progress-wrap.show {
  display: block;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #0080ff);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  color: rgba(0, 255, 255, 0.6);
  font-size: 12px;
  text-align: center;
}

/* ===== 错误消息 ===== */
.error-msg {
  color: #ff6b6b;
  font-size: 14px;
  padding: 15px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  text-align: center;
}

/* ===== 其他辅助样式 ===== */
.file-input {
  display: none;
}

.upload-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background: rgba(255, 50, 50, 0.8);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.upload-remove:hover {
  background: rgba(255, 50, 50, 1);
  transform: scale(1.1);
}

/* ===== 视频列表样式 ===== */
.video-list {
  margin-top: 20px;
}

.video-card {
  background: rgba(0, 20, 40, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.video-card:hover {
  border-color: rgba(0, 255, 255, 0.4);
  background: rgba(0, 30, 60, 0.4);
}

.video-card video {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
  max-height: 180px;
}

.video-card-actions {
  display: flex;
  gap: 8px;
}

.video-card-btn {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  border: none;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card-btn.download {
  background: rgba(0, 150, 100, 0.5);
  color: rgba(0, 255, 200, 0.9);
}

.video-card-btn.download:hover {
  background: rgba(0, 170, 120, 0.6);
}

.video-card-btn.delete {
  background: rgba(255, 50, 50, 0.5);
  color: rgba(255, 150, 150, 0.9);
}

.video-card-btn.delete:hover {
  background: rgba(255, 70, 70, 0.6);
}
