/* vzong · AI视频工坊 - 自定义样式 */

:root {
  --bg-primary: #0A1128;
  --bg-secondary: #0F1A3A;
  --bg-card: rgba(15, 26, 58, 0.6);
  --accent: #00F0FF;
  --accent-glow: rgba(0, 240, 255, 0.4);
  --text-primary: #FFFFFF;
  --text-muted: rgba(255, 255, 255, 0.6);
  --border: rgba(0, 240, 255, 0.2);
  --border-strong: rgba(0, 240, 255, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Animations === */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow), 0 0 60px var(--accent-glow); }
}
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

@keyframes float-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.float-up { animation: float-up 0.5s ease-out forwards; }

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in { animation: fade-in 0.3s ease-out forwards; }

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.slide-in-right { animation: slide-in-right 0.3s ease-out forwards; }

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === Gradient text === */
.gradient-text {
  background: linear-gradient(135deg, #00F0FF 0%, #0080FF 50%, #00F0FF 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #FFD700 0%, #FF6B35 50%, #FFD700 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* === Glass cards === */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.glass-card-hover {
  transition: all 0.3s ease;
}
.glass-card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.15);
}

/* === Buttons === */
.btn-primary {
  background: linear-gradient(135deg, #00F0FF 0%, #0080FF 100%);
  color: #0A1128;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 240, 255, 0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* === Inputs === */
.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s ease;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}
.input-field::placeholder { color: rgba(255, 255, 255, 0.3); }

textarea.input-field {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

/* === Capsule buttons (style filter) === */
.capsule-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.capsule-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.capsule-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

/* === Slider === */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* === Select === */
select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300F0FF' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
select.input-field option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* === Toast === */
.toast {
  background: rgba(15, 26, 58, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  color: var(--text-primary);
  font-size: 14px;
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.toast.success { border-color: rgba(34, 197, 94, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }
.toast.info { border-color: var(--border-strong); }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* === Hero background grid === */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

/* === Task card === */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}
.task-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.2);
}

/* === Progress bar === */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00F0FF 0%, #0080FF 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* === Image upload zone === */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.05);
}
.upload-zone img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
}

/* === Collapsible === */
.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.collapsible-content.open {
  max-height: 800px;
}

/* === Nav link === */
.nav-link {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-link.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent);
  border: 1px solid var(--border);
}

/* === Tutorial code block === */
.code-block {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 240, 255, 0.05);
  border-bottom: 1px solid var(--border);
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
}
.code-block code {
  font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
  white-space: pre;
}

/* === Gallery video card thumb === */
.video-card-thumb {
  cursor: pointer;
  transition: transform 0.3s ease;
}
.video-card-thumb:hover {
  transform: scale(1.02);
}
.video-card-thumb:hover .backdrop-blur {
  background: rgba(0, 240, 255, 0.2);
}

/* === Drag active state === */
.drag-active {
  outline: 2px dashed var(--accent);
  outline-offset: -10px;
  background: rgba(0, 240, 255, 0.04);
}

/* === Status indicator (Ollama) === */
.bg-green-500 { background-color: #22c55e; }
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-500 { background-color: #eab308; }
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.text-yellow-400 { color: #facc15; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 255, 0.4); }

/* === Language toggle === */
.lang-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.lang-toggle button {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-toggle button.active {
  background: var(--accent);
  color: var(--bg-primary);
}

/* === Utility === */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.bg-card { background: var(--bg-card); }
.border-accent { border-color: var(--accent); }

/* === Responsive === */
@media (max-width: 768px) {
  .modal-content { padding: 20px; }
  .hero-glow { width: 400px; height: 400px; }
}
