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

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

a {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #004499;
  text-decoration: underline;
}

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

/* 顶部导航 */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  flex-direction: column;
  padding: 15px 20px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
}

.logo a {
  color: white;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 5px;
}

nav a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  color: white;
  padding: 8px 5px;
  border-radius: 5px;
  transition: background 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

nav a:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
  color: white;
}

nav a.active {
  background: rgba(255,255,255,0.3);
}

/* 主要内容区 */
main {
  padding: 30px 0;
  min-height: calc(100vh - 200px);
}

section {
  background: white;
  margin-bottom: 30px;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

h1 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #222;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

h2 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #333;
}

h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #444;
}

p {
  margin-bottom: 15px;
  line-height: 1.8;
}

/* 列表样式 */
.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.video-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.video-card h3 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 18px;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  font-size: 13px;
  color: #666;
}

.video-meta span {
  background: #f0f0f0;
  padding: 3px 8px;
  border-radius: 3px;
}

.video-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-link {
  display: inline-block;
  margin-top: 10px;
  color: #667eea;
  font-weight: 500;
}

/* 详情页样式 */
.detail-header {
  margin-bottom: 30px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

.meta-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.meta-label {
  font-weight: bold;
  color: #666;
  min-width: 60px;
}

.meta-value {
  color: #333;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

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

.content-section {
  margin: 30px 0;
}

.content-section h2 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 20px;
}

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

.related-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  transition: all 0.3s ease;
}

.related-item:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.related-item h4 {
  color: #667eea;
  margin-bottom: 8px;
  font-size: 16px;
}

.related-item p {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

/* 页脚 */
footer {
  background: #333;
  color: #ccc;
  text-align: center;
  padding: 20px;
  margin-top: 50px;
}

footer p {
  margin: 5px 0;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.btn:hover {
  background: #5568d3;
  text-decoration: none;
  color: white;
}

/* 返回顶部按钮 */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #667eea;
  color: white;
  width: 50px;
  height: 50px;
  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 ease;
  z-index: 999;
}

#backToTop:hover {
  background: #5568d3;
  transform: translateY(-5px);
}

#backToTop.show {
  display: flex;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  header {
    position: sticky;
  }

  .header-content {
    padding: 10px 15px;
  }

  .logo {
    font-size: 20px;
    margin-bottom: 8px;
  }

  nav {
    gap: 3px;
  }

  nav a {
    padding: 6px 3px;
    font-size: 12px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  section {
    padding: 20px 15px;
    margin-bottom: 20px;
  }

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

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

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

  #backToTop {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  nav a {
    font-size: 11px;
    padding: 5px 2px;
  }
}

/* UI 风格变体 */
body.ui-style-0 { --primary-color: #667eea; --secondary-color: #764ba2; }
body.ui-style-1 { --primary-color: #f093fb; --secondary-color: #f5576c; }
body.ui-style-2 { --primary-color: #4facfe; --secondary-color: #00f2fe; }
body.ui-style-3 { --primary-color: #43e97b; --secondary-color: #38f9d7; }
body.ui-style-4 { --primary-color: #fa709a; --secondary-color: #fee140; }
body.ui-style-5 { --primary-color: #30cfd0; --secondary-color: #330867; }
body.ui-style-6 { --primary-color: #a8edea; --secondary-color: #fed6e3; }
body.ui-style-7 { --primary-color: #ff9a56; --secondary-color: #ff6a88; }
body.ui-style-8 { --primary-color: #667eea; --secondary-color: #764ba2; }
body.ui-style-9 { --primary-color: #fbc2eb; --secondary-color: #a6c1ee; }
body.ui-style-10 { --primary-color: #fdcbf1; --secondary-color: #e6dee9; }
body.ui-style-11 { --primary-color: #a1c4fd; --secondary-color: #c2e9fb; }
body.ui-style-12 { --primary-color: #d299c2; --secondary-color: #fef9d7; }
body.ui-style-13 { --primary-color: #667eea; --secondary-color: #764ba2; }
body.ui-style-14 { --primary-color: #ebbba7; --secondary-color: #cfc7f8; }
body.ui-style-15 { --primary-color: #fff1eb; --secondary-color: #ace0f9; }
