* {
  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: 15px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
  text-decoration: none;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 5px;
}

nav a {
  color: #555;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.3s;
  font-size: 14px;
  white-space: nowrap;
}

nav a:hover {
  background: #f0f0f0;
  color: #2c3e50;
}

main {
  min-height: 60vh;
  padding: 30px 0;
}

.page-title {
  font-size: 28px;
  margin-bottom: 20px;
  color: #2c3e50;
}

.intro-section {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  line-height: 1.8;
}

.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 22px;
  margin-bottom: 20px;
  color: #2c3e50;
  padding-left: 12px;
  border-left: 4px solid #3498db;
}

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

.video-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.video-card-content {
  padding: 15px;
}

.video-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #2c3e50;
}

.video-meta {
  font-size: 13px;
  color: #777;
  margin-bottom: 8px;
}

.video-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 10px;
}

.video-link {
  display: inline-block;
  color: #3498db;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.video-link:hover {
  color: #2980b9;
}

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

.detail-title {
  font-size: 32px;
  margin-bottom: 20px;
  color: #2c3e50;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.meta-item {
  font-size: 14px;
  color: #555;
}

.meta-label {
  font-weight: bold;
  color: #333;
  margin-right: 8px;
}

.detail-section {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-section h2 {
  font-size: 20px;
  margin-bottom: 15px;
  color: #2c3e50;
}

.detail-section p {
  line-height: 1.8;
  color: #555;
}

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

.tag {
  background: #ecf0f1;
  color: #555;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 13px;
}

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

.related-item {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 6px;
  transition: background 0.3s;
}

.related-item:hover {
  background: #f0f0f0;
}

.related-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #2c3e50;
}

.related-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 8px;
}

footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 30px 20px;
  margin-top: 50px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #ecf0f1;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #3498db;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #3498db;
  color: #fff;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 99;
}

.back-to-top:hover {
  background: #2980b9;
  transform: translateY(-3px);
}

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

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

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

  nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 6px 4px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo {
    font-size: 20px;
  }

  .page-title {
    font-size: 22px;
  }

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

  .detail-title {
    font-size: 24px;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }
}

body.ui-style-5 {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
}

body.ui-style-5 .section-title {
  border-left-color: var(--primary-color);
}

body.ui-style-5 .video-link {
  color: var(--primary-color);
}
