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

:root {
  --bg: #0a0e1a;
  --bg-card: #141828;
  --bg-card-hover: #1a1f35;
  --border: #2a2f45;
  --text: #f0f0f0;
  --text-dim: #8892a4;
  --text-muted: #555;
  --accent: #FF6B35;
  --accent-hover: #ff7d4f;
  --accent-dim: rgba(255, 107, 53, 0.15);
  --blue: #00D4FF;
  --green: #4ADE80;
  --yellow: #FBBF24;
  --red: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ===================== Header ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.logo-icon { font-size: 24px; }
.logo-text .accent { color: var(--accent); }

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

.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ===================== Main ===================== */
.main {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 20px 100px;
  min-height: calc(100vh - 60px);
}

.container { max-width: 700px; margin: 0 auto; }

/* ===================== Pages ===================== */
.page { display: none; }
.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ===================== Hero ===================== */
.hero {
  text-align: center;
  padding: 40px 20px 30px;
  background: linear-gradient(135deg, #0a0e1a 0%, #141828 50%, #0d3b2e 100%);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.gradient-text {
  background: linear-gradient(90deg, #FF6B35, #FBBF24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(13px, 2.5vw, 16px);
  color: var(--text-dim);
  margin-bottom: 12px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-core {
  font-size: 15px;
  color: var(--text);
}
.hero-core strong { color: var(--accent); }

/* ===================== Cards ===================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2 i { color: var(--accent); }

.rules-list, .guide-list {
  padding-left: 20px;
  line-height: 1.8;
  font-size: 14px;
}

.rules-list li, .guide-list li {
  margin-bottom: 6px;
}

.focus-card {
  border-left: 4px solid var(--accent);
}

.focus-card p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  font-family: var(--font-body);
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===================== Action Buttons ===================== */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

.action-buttons .btn {
  flex: 1;
  min-width: 200px;
}

/* ===================== Back Button ===================== */
.back-btn {
  margin-bottom: 16px;
}

/* ===================== Page Title ===================== */
.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 16px;
}

.title-hint {
  font-size: 16px;
  color: var(--text-dim);
  font-weight: 400;
}

.page-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ===================== Upload Area ===================== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.05);
}

.upload-area i {
  font-size: 48px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.upload-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===================== Video Preview ===================== */
.video-preview {
  margin-bottom: 20px;
}

.video-info {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===================== Duration Warning ===================== */
.duration-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--red);
}

/* ===================== Processing Overlay ===================== */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
}

.processing-content h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 20px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

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

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--yellow));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

#processingStatus {
  font-size: 14px;
  color: var(--text-dim);
}

/* ===================== Result Page ===================== */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}

.view-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.view-tag.side {
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent);
}

.view-tag.back {
  background: rgba(0, 212, 255, 0.15);
  color: var(--blue);
}

.result-time {
  font-size: 13px;
  color: var(--text-dim);
}

.result-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.result-section.good {
  border-left: 4px solid var(--green);
}

.result-section.problems {
  border-left: 4px solid var(--yellow);
}

.result-section.suggestions {
  border-left: 4px solid var(--blue);
}

.result-section h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-section.good h2 i { color: var(--green); }
.result-section.problems h2 i { color: var(--yellow); }
.result-section.suggestions h2 i { color: var(--blue); }

.result-list {
  padding-left: 20px;
  line-height: 1.8;
  font-size: 14px;
}

.result-list li {
  margin-bottom: 8px;
}

.result-empty {
  color: var(--text-dim);
  font-style: italic;
}

/* ===================== History Page ===================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all 0.2s;
}

.history-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.history-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.history-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.history-view {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.history-view.side {
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent);
}

.history-view.back {
  background: rgba(0, 212, 255, 0.15);
  color: var(--blue);
}

.history-summary {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
  width: 100%;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 15px;
}

/* ===================== Disclaimer Footer ===================== */
.disclaimer-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 8px 20px;
  z-index: 100;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.disclaimer-footer p {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

/* ===================== Toast ===================== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success { border-color: var(--green); color: var(--green); }
.toast-error { border-color: var(--red); color: var(--red); }
.toast-info { border-color: var(--blue); color: var(--blue); }

/* ===================== Responsive ===================== */
@media (max-width: 600px) {
  .header-inner {
    padding: 10px 16px;
  }

  .nav { gap: 4px; }
  .nav-link { padding: 4px 10px; font-size: 13px; }

  .main { padding: 16px 16px 100px; }

  .hero { padding: 30px 16px 24px; }

  .action-buttons {
    flex-direction: column;
  }
  .action-buttons .btn {
    width: 100%;
    min-width: 0;
  }

  .card { padding: 16px; }

  .result-section { padding: 16px; }

  .disclaimer-footer p { font-size: 10px; }
}
