/**
 * components.css
 * 组件特定样式 - 从 style.css 提取的组件样式
 * 不包含基础重置和布局代码（已在 base.css 和 layout.css 中）
 */

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

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

/* ===== 全息面板样式 ===== */
.hologram-panel {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 85vh;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-left: 2px solid rgba(0, 255, 255, 0.4);
  box-shadow: -4px 0 20px rgba(0, 255, 255, 0.15);
  animation: breathe 3s ease-in-out infinite;
  pointer-events: auto;
  padding: 30px 25px;
  overflow-y: auto;
}

/* 呼吸灯动画 */
@keyframes breathe {
  0%, 100% {
    box-shadow: -4px 0 20px rgba(0, 255, 255, 0.15);
    border-left-color: rgba(0, 255, 255, 0.4);
  }
  50% {
    box-shadow: -4px 0 30px rgba(0, 255, 255, 0.25);
    border-left-color: rgba(0, 255, 255, 0.6);
  }
}

/* 全息面板滚动条 */
.hologram-panel::-webkit-scrollbar {
  width: 4px;
}
.hologram-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.hologram-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.3);
  border-radius: 2px;
}
.hologram-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 255, 0.5);
}

/* ===== 侧边栏按钮组 ===== */
.sidebar-btn {
  width: 60px;
  height: 60px;
  background: rgba(0, 20, 40, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  color: rgba(0, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 600;
  font-family: 'Inter', 'Courier New', monospace;
  letter-spacing: 0.5px;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.scan-line {
  position: absolute;
  top: -100%;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0, 255, 255, 0.8), transparent);
  animation: scanMove 3s linear infinite;
  opacity: 0;
}

@keyframes scanMove {
  0% { top: -100%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 200%; opacity: 0; }
}

.sidebar-btn:hover {
  background: rgba(0, 40, 80, 0.5);
  border-color: #00ffff;
  color: #00ffff;
  transform: translateX(10px) scale(1.1);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5), inset 0 0 20px rgba(0, 255, 255, 0.1);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.sidebar-btn:hover .scan-line {
  opacity: 1;
}

.sidebar-btn.active {
  background: rgba(0, 60, 100, 0.6);
  border-color: #00ffff;
  color: #00ffff;
  transform: translateX(5px);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.6), inset 0 0 30px rgba(0, 255, 255, 0.15);
  text-shadow: 0 0 15px rgba(0, 255, 255, 1);
  animation: breathe 2s ease-in-out infinite;
}

.sidebar-btn.active .scan-line {
  opacity: 1;
  animation: scanMove 2s linear infinite;
}

/* ===== 输入/输出面板 ===== */
#input-panel {
  position: fixed;
  left: 100px;
  top: 50%;
  transform: translateY(-50%);
  width: 420px;
  height: 80vh;
  background: rgba(0, 10, 20, 0.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 12px;
  padding: 20px;
  padding-top: 15px;
  z-index: 50;
  overflow-y: auto;
  box-shadow:
    0 0 20px rgba(0, 255, 255, 0.15),
    0 0 50px rgba(0, 220, 255, 0.10),
    0 0 90px rgba(0, 180, 255, 0.06),
    inset 0 0 40px rgba(0, 255, 255, 0.08),
    inset 0 0 80px rgba(0, 200, 255, 0.04);
  pointer-events: auto;
}

#output-panel {
  position: fixed !important;
  right: 40px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 45%;
  height: 80vh;
  background: rgba(0, 10, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 255, 255, 0.5);
  border-radius: 12px;
  padding: 16px;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3), inset 0 0 50px rgba(0, 255, 255, 0.1);
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 输出面板收起状态 — 顶部细长条（与左侧输入面板顶部对齐） */
#output-panel.collapsed {
  cursor: pointer;
  overflow: hidden;
  top: calc(50vh - 40vh) !important;
  transform: none !important;
  height: 44px !important;
  width: 45% !important;
  border-radius: 10px !important;
}

#output-panel.collapsed .output-content {
  display: none !important;
}

#output-panel.collapsed:hover {
  border-color: rgba(0, 255, 255, 0.6) !important;
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.35), inset 0 0 30px rgba(0, 255, 255, 0.12) !important;
}

#output-panel.collapsed::after {
  content: 'OUTPUT — 点击展开';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(0, 255, 255, 0.5);
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.output-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  overflow: hidden;
}

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

/* ===== 下载与卷帘按钮 ===== */
.download-btn {
  position: absolute;
  top: 20px;
  right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent !important;
  border: none;
  color: rgba(0, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.download-btn svg {
  width: 24px;
  height: 24px;
}

.download-btn:hover {
  color: var(--color-cyan, #00ffff);
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
}

.download-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.download-btn:disabled:hover {
  color: rgba(0, 255, 255, 0.6);
  transform: scale(1);
  filter: none;
}

/* 卷帘按钮 */
.toggle-btn {
  position: absolute;
  top: 20px;
  right: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent !important;
  border: none;
  color: rgba(0, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.toggle-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.toggle-btn:hover {
  color: var(--color-cyan, #00ffff);
  transform: scale(1.2);
  filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
}

/* 收起状态下的箭头按钮 — 居中在细长条内 */
#output-panel.collapsed .toggle-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%) scale(0.85);
}

#output-panel.collapsed .toggle-btn:hover {
  transform: translateY(-50%) scale(1.1) rotate(180deg);
}

/* ===== 表单控件 ===== */
.prompt-textarea {
  width: 100%;
  min-height: 100px;
  background: rgba(0, 20, 40, 0.3);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
}

.prompt-textarea:focus {
  outline: none;
  border-color: rgba(0, 255, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 16px;
  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.7);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

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

/* 画质按钮组 */
.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-btn {
  flex: 0 0 18%;
  aspect-ratio: 4 / 3;
  background: rgba(0, 20, 40, 0.4);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(0, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ratio-btn .ratio-icon {
  display: none;
}

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

.ratio-btn.active {
  background: rgba(0, 255, 255, 0.1);
  border-color: #00ffff;
  color: #00ffff;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

/* 模型选择下拉框 */
.model-select {
  width: 100%;
  height: 42px;
  padding: 0 36px 0 12px;
  background: #0a0f1a;
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2300ffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: all 0.3s ease;
}

.model-select:hover {
  border-color: rgba(0, 255, 255, 0.6);
  background-color: rgba(0, 20, 40, 0.9);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.model-select:focus {
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* CTA 按钮 */
.cta-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(0, 200, 255, 0.4), rgba(0, 255, 255, 0.5));
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.cta-btn:hover {
  background: linear-gradient(135deg, rgba(0, 220, 255, 0.5), rgba(0, 255, 255, 0.6));
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

.cta-btn:disabled,
.cta-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.cta-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== 加载动画 ===== */
.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;
}

/* ===== 标签和文本 ===== */
.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;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: rgba(0, 255, 255, 0.9);
  margin-bottom: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.panel-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  margin-bottom: 20px;
}

.meta {
  font-size: 11px;
  color: rgba(0, 255, 255, 0.5);
}

.quantum-text {
  color: rgba(0, 255, 255, 0.8);
  font-size: 16px;
  letter-spacing: 2px;
  animation: pulse 1.5s ease-in-out infinite;
}

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