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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  gap: 8px;
  align-items: center;
}

nav a {
  display: inline-block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s;
  white-space: nowrap;
}

nav a:hover {
  background: #2563eb;
  color: #fff;
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 32px;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 18px;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
}

main {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

section {
  background: #fff;
  padding: 32px;
  margin-bottom: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

section h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #1f2937;
  border-left: 4px solid #2563eb;
  padding-left: 12px;
}

.intro-text {
  line-height: 1.8;
  color: #4b5563;
  font-size: 16px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.video-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.video-card h3 {
  font-size: 18px;
  margin: 16px 16px 8px;
  color: #1f2937;
}

.video-meta {
  padding: 0 16px 8px;
  font-size: 14px;
  color: #6b7280;
}

.video-desc {
  padding: 0 16px 16px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  flex-grow: 1;
}

.video-card a {
  display: block;
  margin: 0 16px 16px;
  padding: 10px;
  background: #2563eb;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
}

.video-card a:hover {
  background: #1d4ed8;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.video-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s;
}

.video-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.video-item h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #1f2937;
}

.video-item h3 a {
  color: #1f2937;
  text-decoration: none;
}

.video-item h3 a:hover {
  color: #2563eb;
}

.video-item .meta {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 12px;
}

.video-item .desc {
  font-size: 15px;
  color: #4b5563;
  line-height: 1.7;
}

.detail-header {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.detail-header h1 {
  font-size: 32px;
  margin-bottom: 20px;
  color: #1f2937;
}

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

.info-item {
  padding: 12px;
  background: #f9fafb;
  border-radius: 4px;
}

.info-item strong {
  color: #6b7280;
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.info-item span {
  color: #1f2937;
  font-size: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  font-size: 14px;
}

.content-section {
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.content-section h2 {
  font-size: 22px;
  margin-bottom: 16px;
  color: #1f2937;
  border-left: 4px solid #2563eb;
  padding-left: 12px;
}

.content-section p {
  line-height: 1.8;
  color: #4b5563;
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.related-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s;
}

.related-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.related-card h4 {
  font-size: 16px;
  margin-bottom: 8px;
  color: #1f2937;
}

.related-card h4 a {
  color: #1f2937;
  text-decoration: none;
}

.related-card h4 a:hover {
  color: #2563eb;
}

.related-card p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

footer {
  background: #1f2937;
  color: #9ca3af;
  padding: 32px 20px;
  text-align: center;
  margin-top: 60px;
}

footer p {
  margin: 8px 0;
}

footer a {
  color: #60a5fa;
  text-decoration: none;
}

footer a:hover {
  color: #93c5fd;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  nav ul {
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 8px 4px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .hero p {
    font-size: 16px;
  }

  main {
    padding: 24px 16px;
  }

  section {
    padding: 20px 16px;
  }

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

  .detail-header {
    padding: 24px 20px;
  }

  .detail-header h1 {
    font-size: 24px;
  }

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

body.ui-style-0 { --primary-color: #2563eb; }
body.ui-style-1 { --primary-color: #7c3aed; }
body.ui-style-2 { --primary-color: #dc2626; }
body.ui-style-3 { --primary-color: #059669; }
body.ui-style-4 { --primary-color: #d97706; }
body.ui-style-5 { --primary-color: #0891b2; }
body.ui-style-6 { --primary-color: #4f46e5; }
body.ui-style-7 { --primary-color: #be123c; }
body.ui-style-8 { --primary-color: #15803d; }
body.ui-style-9 { --primary-color: #b45309; }
body.ui-style-10 { --primary-color: #0e7490; }
body.ui-style-11 { --primary-color: #6366f1; }
body.ui-style-12 { --primary-color: #e11d48; }
body.ui-style-13 { --primary-color: #16a34a; }
body.ui-style-14 { --primary-color: #ca8a04; }
body.ui-style-15 { --primary-color: #0284c7; }

.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 999;
}

.back-to-top:hover {
  background: #1d4ed8;
  transform: translateY(-4px);
}

.back-to-top.show {
  display: flex;
}
