/* ── 页面状态容器 ─────────────────────────────────────────── */
.page-state { min-height: calc(100vh - 65px); }

/* ══ STATE 1: 上传 ══════════════════════════════════════════ */
#upload-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.upload-card {
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.upload-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.upload-hint { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 20px;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(245, 200, 66, 0.04);
}
.drop-icon { font-size: 40px; margin-bottom: 12px; }
.drop-text { font-size: 15px; color: var(--text-dim); }

/* ══ STATE 2: 处理中 ════════════════════════════════════════ */
#processing-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.processing-card {
  text-align: center;
  max-width: 400px;
  width: 100%;
}
.processing-icon { font-size: 48px; margin-bottom: 20px; }
.processing-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.progress-bar-wrap {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.processing-sub { color: var(--text-dim); font-size: 14px; }

/* ══ STATE 3: 查看器 ════════════════════════════════════════ */
#viewer-state { padding: 0 0 80px; }

.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 65px;
  background: var(--bg);
  z-index: 50;
}
.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
}
.btn-back:hover { color: var(--text); }
.shot-counter { font-size: 15px; color: var(--text-dim); }

.viewer-video-wrap {
  position: relative;
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 24px;
}
.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.shot-thumbnail {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface);
}

.shot-timecode {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin: 12px 0 24px;
}

/* 首帧/尾帧 */
.frames-row {
  display: flex;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 32px;
  padding: 0 24px;
}
.frame-item { flex: 1; }
.frame-label { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; text-align: center; }
.frame-placeholder {
  aspect-ratio: 16/9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.frame-placeholder img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.frame-loading { font-size: 12px; color: var(--text-dim); }

/* 三层分析 */
.analysis-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.analysis-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.analysis-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.analysis-content {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.btn-copy {
  margin-top: 12px;
  padding: 8px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

/* 点导航 + 箭头 */
.dot-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 16px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.dot.active { background: var(--accent); }
.dot.dot-done { background: #4caf50; }

.viewer-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.nav-arrow {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.nav-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nav-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
