@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* 深色主题 */
  --bg-primary: #0a0e27;
  --bg-secondary: #131829;
  --bg-card: #1a1f3a;
  --bg-card-hover: #22274a;

  /* 渐变色 */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* 文字颜色 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;

  /* 强调色 */
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-pink: #f472b6;
  --accent-green: #34d399;

  /* 边框与阴影 */
  --border: #2d3748;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -50%;
  left: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(118, 75, 162, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ========== NAVBAR ========== */
.navbar {
  background: rgba(26, 31, 58, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  gap: 2rem;
}

.navbar-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.search-box {
  position: relative;
  width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-primary);
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
}

.btn-login {
  padding: 0.625rem 1.25rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.btn-logout {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-back {
  padding: 0.625rem 1.25rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-back:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* ========== MAIN LAYOUT ========== */
.main-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ========== SIDEBAR ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-section {
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s;
}

.filter-section:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.filter-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.stats {
  background: var(--gradient-primary);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-glow);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.stat-label {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

/* ========== CONTENT ========== */
.content {
  min-height: 60vh;
}

.content-header {
  margin-bottom: 2rem;
}

.content-title {
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 1rem;
  letter-spacing: -0.02em;
}

.content-count {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ========== VIDEO GRID ========== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.video-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent-purple);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(102, 126, 234, 0.3);
}

.video-thumbnail {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.1);
}

.video-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: white;
  font-size: 4rem;
}

.video-score-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.375rem 0.875rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  color: #fbbf24;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.video-info {
  padding: 1.25rem;
}

.video-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
}

.video-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.video-category {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: var(--gradient-blue);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.video-date {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ========== DETAIL PAGE ========== */
.detail-page {
  max-width: 900px;
  margin: 2rem auto;
}

.detail-header {
  margin-bottom: 2rem;
}

.detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.detail-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.9375rem;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: var(--shadow-glow);
}

.detail-section {
  margin-bottom: 2rem;
  background: rgba(26, 31, 58, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s;
}

.detail-section:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.detail-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-section-content {
  line-height: 1.8;
  color: var(--text-primary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--gradient-blue);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-item {
  padding: 1.25rem;
  background: var(--bg-card);
  border-left: 4px solid var(--accent-purple);
  border-radius: 12px;
  transition: all 0.3s;
}

.step-item:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.step-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.25rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 12px;
}

.timeline-time {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.code-block {
  padding: 1.25rem;
  background: #1e293b;
  color: #e2e8f0;
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.875rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 0.75rem 0;
  white-space: pre-wrap;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.action-box {
  padding: 2rem;
  background: var(--gradient-primary);
  border-radius: 16px;
  margin-top: 2rem;
  box-shadow: var(--shadow-glow);
}

.action-box-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.25rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: white;
  color: #667eea;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ========== LOADING & EMPTY ========== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  text-align: center;
}

.empty-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

/* ========== MODAL ========== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.modal-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: var(--text-primary);
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.form-error {
  padding: 0.875rem;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  font-size: 0.875rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-block {
  width: 100%;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .search-box {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    gap: 1rem;
  }

  .search-box {
    width: 100%;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 1.75rem;
  }

  .content-title {
    font-size: 1.5rem;
  }
}
