/* ============================================
   TikLoad — Modern Dark UI
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-1: #25F4EE;
  --accent-2: #FE2C55;
  --accent-3: #7c3aed;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-violet: linear-gradient(135deg, var(--accent-3), var(--accent-2));
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(37, 244, 238, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 40px rgba(37, 244, 238, 0.1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-1);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-2);
  bottom: -150px;
  right: -150px;
  animation-delay: -7s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-3);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 40px;
}

/* Input Section */
.input-section {
  max-width: 560px;
  margin: 0 auto;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 6px 6px 18px;
  backdrop-filter: blur(20px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

.input-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 14px 12px;
  min-width: 0;
}

.url-input::placeholder {
  color: var(--text-muted);
}

.download-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.download-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.download-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Error message */
.error-msg {
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(254, 44, 85, 0.1);
  border: 1px solid rgba(254, 44, 85, 0.2);
  border-radius: var(--radius-sm);
  color: #ff6b8a;
  font-size: 0.85rem;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Stats row */
.stats-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  padding: 20px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Results Section */
.results-section {
  padding: 40px 0;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
}

.results-header {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.results-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.results-info {
  flex: 1;
  min-width: 0;
}

.results-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.results-author {
  font-size: 0.85rem;
  color: var(--accent-1);
  margin-bottom: 4px;
}

.results-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Download buttons */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.dl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.dl-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 244, 238, 0.08);
}

.dl-btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.2rem;
}

.dl-btn-icon.video {
  background: rgba(37, 244, 238, 0.1);
}

.dl-btn-icon.audio {
  background: rgba(124, 58, 237, 0.1);
}

.dl-btn-icon.image {
  background: rgba(254, 44, 85, 0.1);
}

.dl-btn-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Features */
.features,
.how-it-works {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  transition: all var(--transition);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  border-color: rgba(37, 244, 238, 0.15);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* How it works */
.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.step {
  text-align: center;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
  max-width: 200px;
}

.step-number {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 auto 12px;
}

.step h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.step p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.step-connector {
  width: 24px;
  height: 2px;
  background: var(--border);
  margin-top: 40px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-sub {
  margin-top: 4px;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 40px 0 30px; }
  .stats-row { gap: 16px; padding: 16px 20px; }
  .stats-row .stat-divider { height: 24px; }
  .steps { flex-direction: column; align-items: center; }
  .step-connector {
    width: 2px;
    height: 24px;
    margin: 0;
  }
  .step { max-width: 280px; width: 100%; }
  .results-header { flex-direction: column; }
  .results-thumb {
    width: 100%;
    height: 160px;
  }
}
