* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: #2c3e50;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: #bdc3c7;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.nav-links a:hover { color: #fff; }

.nav-user { color: #ecf0f1; font-size: 14px; }

.flash {
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 14px;
}
.flash-error { background: #ffeaea; color: #c0392b; border: 1px solid #f5c6cb; }
.flash-success { background: #eafbea; color: #27ae60; border: 1px solid #c3e6cb; }

.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
  width: 100%;
}

.footer {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 13px;
  border-top: 1px solid #e0e0e0;
  margin-top: 40px;
}

.btn-primary, .btn-secondary, .btn-danger {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
}

.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }

.btn-secondary { background: #95a5a6; color: #fff; }
.btn-secondary:hover { background: #7f8c8d; }

.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-primary-sm, .btn-logout {
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary-sm { background: #3498db; color: #fff; }
.btn-primary-sm:hover { background: #2980b9; }

.btn-logout { background: transparent; color: #e74c3c; border: 1px solid #e74c3c; }
.btn-logout:hover { background: #e74c3c; color: #fff; }

.nav-link-sm {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  color: #bdc3c7;
  transition: all 0.2s;
}
.nav-link-sm:hover { color: #fff; background: rgba(255,255,255,0.1); }

.btn-block { display: block; width: 100%; text-align: center; }

.btn-sm, .btn-danger-sm {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  display: inline-block;
}
.btn-sm:hover { background: #f0f0f0; }
.btn-danger-sm { border-color: #e74c3c; color: #e74c3c; background: #fff; }
.btn-danger-sm:hover { background: #e74c3c; color: #fff; }

.hero {
  text-align: center;
  padding: 60px 20px;
}

.hero-content h1 { font-size: 36px; margin-bottom: 10px; color: #2c3e50; }
.hero-subtitle { font-size: 18px; color: #7f8c8d; margin-bottom: 40px; }

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.feature-card {
  background: #fff;
  padding: 30px 20px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}

.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 36px; margin-bottom: 10px; }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; color: #2c3e50; }
.feature-card p { font-size: 13px; color: #999; }

.hero-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 136px);
}

.auth-bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
}

.bg-circle-1 {
  width: 500px;
  height: 500px;
  background: #3498db;
  top: -120px;
  right: -100px;
  animation: floatCircle 20s ease-in-out infinite;
}

.bg-circle-2 {
  width: 400px;
  height: 400px;
  background: #2ecc71;
  bottom: -80px;
  left: -80px;
  animation: floatCircle 25s ease-in-out infinite reverse;
}

.bg-circle-3 {
  width: 300px;
  height: 300px;
  background: #9b59b6;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatCircle 18s ease-in-out infinite;
}

@keyframes floatCircle {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-card {
  background: #fff;
  padding: 44px 40px 36px;
  border-radius: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: cardSlideIn 0.5s ease-out;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 28px;
  background: linear-gradient(135deg, #3498db, #2ecc71);
  border-radius: 16px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
}

.auth-logo h3 {
  font-size: 14px;
  font-weight: 600;
  color: #7f8c8d;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 6px;
  color: #2c3e50;
  font-size: 24px;
  font-weight: 700;
}

.auth-subtitle {
  text-align: center;
  color: #95a5a6;
  font-size: 13px;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #555;
  letter-spacing: 0.3px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid #e8ecf0;
  border-radius: 10px;
  font-size: 14px;
  color: #333;
  background: #f8fafc;
  transition: all 0.25s ease;
  outline: none;
  font-family: inherit;
}

.input-wrapper input::placeholder {
  color: #b0b8c1;
  font-size: 13px;
}

.input-wrapper input:hover {
  border-color: #c0c7cf;
  background: #fff;
}

.input-wrapper input:focus {
  border-color: #3498db;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
  opacity: 1;
}

.auth-btn {
  display: block;
  width: 100%;
  padding: 13px;
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #3498db, #2980b9);
  box-shadow: 0 4px 14px rgba(52, 152, 219, 0.35);
  transition: all 0.25s ease;
  letter-spacing: 4px;
  position: relative;
  overflow: hidden;
}

.auth-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #2980b9, #1a5276);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.45);
  transform: translateY(-1px);
}

.auth-btn:hover::after {
  transform: translateX(100%);
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 22px 0 12px;
  color: #b0b8c1;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8ecf0;
}

.auth-divider span {
  padding: 0 14px;
  white-space: nowrap;
}

.auth-switch-link {
  display: block;
  text-align: center;
  padding: 10px;
  border: 2px solid #e8ecf0;
  border-radius: 10px;
  color: #3498db;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
}

.auth-switch-link:hover {
  border-color: #3498db;
  background: #f0f7ff;
  color: #2980b9;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}

.form-control:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }

.required { color: #e74c3c; }

small { display: block; font-size: 12px; color: #999; margin-top: 4px; }
small a { color: #3498db; }

.dashboard h2 { margin-bottom: 20px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
}

.stat-number { font-size: 32px; font-weight: 700; color: #2c3e50; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }

.dashboard-section { margin-top: 20px; }
.dashboard-section h3 { margin-bottom: 12px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 10px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-header h2 { color: #2c3e50; }

.card {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.inline-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.filter-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-form .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}

.table th { background: #f8f9fa; font-weight: 600; color: #555; }

.table tr:hover td { background: #fafbfc; }

.action-cell { white-space: nowrap; }
.action-cell > * { margin-right: 4px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info { background: #e3f2fd; color: #1565c0; }

.empty-state { text-align: center; padding: 40px; color: #999; }
.empty-state a { color: #3498db; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 0 0;
  font-size: 14px;
}

.pagination a {
  padding: 6px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #3498db;
}

.pagination a:hover { background: #3498db; color: #fff; }

.upload-form { max-width: 600px; }

/* ========== 管理员后台样式 ========== */
.nav-admin-link {
  color: #f39c12 !important;
  font-weight: 600;
}
.nav-admin-link:hover { color: #e67e22 !important; }

.admin-badge {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

.admin-nav-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f0f2f5;
  padding: 4px;
  border-radius: 10px;
}

.admin-tab {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: #666;
  transition: all 0.2s;
}

.admin-tab:hover { color: #333; background: #e8eaed; }

.admin-tab.active {
  background: #fff;
  color: #2c3e50;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card-blue { border-left: 4px solid #3498db; }
.stat-card-green { border-left: 4px solid #2ecc71; }
.stat-card-purple { border-left: 4px solid #9b59b6; }
.stat-card-orange { border-left: 4px solid #e67e22; }

.stat-sub { font-size: 12px; color: #bbb; margin-top: 2px; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.admin-grid .card h3 {
  font-size: 16px;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.preview-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.preview-video-wrapper {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.preview-video {
  width: 100%;
  display: block;
  max-height: 480px;
}

.preview-info {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.info-table td {
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}

.info-table td:first-child {
  color: #999;
  width: 80px;
  font-size: 13px;
}

.info-table td code {
  font-size: 11px;
  background: #f5f7fa;
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
  color: #666;
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  margin-left: 4px;
}

.view-btn {
  padding: 6px 12px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  color: #999;
  transition: all 0.2s;
}

.view-btn:hover { color: #333; background: #f5f5f5; }

.view-btn.active { background: #3498db; color: #fff; }

.video-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.video-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.video-card-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #111;
  overflow: hidden;
}

.video-card-thumb video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  transition: background 0.2s;
  pointer-events: none;
}

.video-card:hover .video-card-play { background: rgba(52,152,219,0.9); }

.video-card-body {
  padding: 14px 16px 10px;
}

.video-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #999;
}

.video-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 14px;
  border-top: 1px solid #f5f5f5;
}

.video-card-actions input[type="checkbox"] {
  margin-right: 4px;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 16px;
  color: #2c3e50;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body {
  padding: 16px 20px 20px;
  background: #000;
}

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.doc-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.doc-card-icon {
  background: linear-gradient(135deg, #f5f7fa, #e8ecf0);
  padding: 28px;
  text-align: center;
  font-size: 48px;
}

.doc-card-body {
  padding: 14px 16px 10px;
}

.doc-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #999;
  flex-wrap: wrap;
}

.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px 14px;
  border-top: 1px solid #f5f5f5;
}

.doc-card-actions input[type="checkbox"] {
  margin-right: 4px;
  cursor: pointer;
}

.dash-card-view {
  display: none;
}

.dash-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.dash-item-card:last-child { border-bottom: none; }

.dash-item-card:hover { background: #fafbfc; margin: 0 -8px; padding: 10px 8px; border-radius: 6px; }

.dash-item-thumb {
  position: relative;
  width: 72px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}

.dash-item-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dash-item-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-item-icon {
  font-size: 32px;
  width: 72px;
  text-align: center;
  flex-shrink: 0;
  line-height: 42px;
}

.dash-item-info { flex: 1; min-width: 0; }

.dash-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-container {
    position: relative;
    padding: 0 16px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: #2c3e50;
    flex-direction: column;
    padding: 12px 16px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 99;
  }

  .nav-links.nav-open { display: flex; }

  .nav-links a,
  .nav-links .nav-user,
  .nav-links .btn-logout {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 8px;
    width: 100%;
  }

  .nav-links a:hover { background: rgba(255,255,255,0.08); }

  .nav-user { padding: 8px 16px; }

  .btn-logout {
    text-align: center;
    margin-top: 4px;
    padding: 12px 16px !important;
  }

  .main-content {
    padding: 0 12px;
    margin: 12px auto;
  }

  .card { padding: 16px; border-radius: 10px; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-header h2 { font-size: 20px; }

  .page-header > div {
    flex-wrap: wrap;
    width: 100%;
  }

  .page-header .btn-primary,
  .page-header .btn-secondary,
  .page-header .view-toggle {
    font-size: 13px;
    padding: 8px 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card { padding: 16px; }
  .stat-number { font-size: 24px; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .filter-form {
    flex-direction: column;
    gap: 8px;
  }

  .filter-form .form-group { min-width: 100%; }

  .filter-form .btn-primary,
  .filter-form .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .table { font-size: 13px; min-width: 600px; }

  .table th, .table td { padding: 10px 8px; }

  .action-cell { white-space: nowrap; }

  .btn-sm, .btn-danger-sm { padding: 6px 10px; font-size: 12px; }

  .video-card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .video-card-title { font-size: 13px; }

  .doc-card-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .doc-card-icon { padding: 18px; font-size: 36px; }

  .doc-card-title { font-size: 13px; }

  .doc-card-meta { font-size: 11px; gap: 4px; }

  .dash-table-view { display: none; }

  .dash-card-view { display: block; }

  .video-card-meta { font-size: 11px; gap: 6px; }

  .video-card-actions { padding: 6px 12px 10px; gap: 4px; }

  .modal-content {
    max-width: 95%;
    border-radius: 10px;
  }

  .modal-header { padding: 12px 16px; }

  .modal-header h3 { font-size: 14px; }

  .modal-body { padding: 8px; }

  .preview-container { grid-template-columns: 1fr; }

  .preview-video { max-height: 320px; }

  .auth-card {
    padding: 28px 20px 24px;
    margin: 0 8px;
    border-radius: 16px;
  }

  .auth-card h2 { font-size: 20px; }

  .hero-content h1 { font-size: 24px; }

  .hero { padding: 40px 16px; }

  .upload-form { max-width: 100%; }

  .pagination { gap: 8px; font-size: 13px; flex-wrap: wrap; }

  .pagination a { padding: 8px 14px; }

  .admin-grid { grid-template-columns: 1fr; }

  .admin-nav-tabs { flex-wrap: wrap; }

  .admin-tab { font-size: 13px; padding: 8px 12px; }

  .flash { margin: 8px 12px 0; font-size: 13px; padding: 10px 16px; }

  .footer { font-size: 12px; padding: 16px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  .video-card-grid { grid-template-columns: 1fr; }

  .doc-card-grid { grid-template-columns: 1fr; }

  .nav-brand { font-size: 17px; }
}
