/* 全局样式 */
:root {
  --primary-color: #d32f2f;
  --secondary-color: #1976d2;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --bg-light: #f5f5f5;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
  --spacing-unit: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-light);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #b71c1c;
}

/* 导航栏 */
.site-nav {
  background: #fff;
  padding: 0 calc(var(--spacing-unit) * 3);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 24px;
  font-weight: bold;
  padding: calc(var(--spacing-unit) * 2) 0;
  white-space: nowrap;
}

.nav-logo a {
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: calc(var(--spacing-unit) * 1);
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  flex: 1 1 0;
  min-width: 0;
}

.nav-menu a {
  color: var(--text-light);
  text-decoration: none;
  padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: all 0.3s;
  border-radius: 4px;
}

.nav-menu a:hover {
  color: var(--primary-color);
  background: rgba(211, 47, 47, 0.05);
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
}

/* 英雄区域 */
.hero {
  text-align: center;
  padding: calc(var(--spacing-unit) * 6) 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: calc(var(--spacing-unit) * 5);
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 2);
  line-height: 1.3;
}

.hero-desc {
  font-size: 18px;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.95;
}

/* 介绍区域 */
.intro-section {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 5);
  box-shadow: var(--shadow);
  line-height: 2;
  font-size: 16px;
}

.intro-section a {
  font-weight: 500;
  text-decoration: underline;
}

/* 区块 */
.section {
  margin-bottom: calc(var(--spacing-unit) * 6);
}

.section-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding-bottom: calc(var(--spacing-unit) * 2);
  border-bottom: 3px solid var(--primary-color);
  color: var(--text-color);
}

/* 页面头部 */
.page-header {
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 5);
  padding: calc(var(--spacing-unit) * 5) 0;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-header h1 {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--text-color);
}

.page-header p {
  font-size: 18px;
  color: var(--text-light);
  line-height: 1.8;
}

/* 卡片网格 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
}

.video-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.video-info {
  padding: calc(var(--spacing-unit) * 3);
}

.video-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 1);
  line-height: 1.4;
}

.video-title a {
  color: var(--text-color);
}

.video-title a:hover {
  color: var(--primary-color);
}

.video-meta {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.video-genre {
  font-size: 14px;
  color: var(--secondary-color);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.video-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* 链接网格 */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
}

.link-card {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  text-decoration: none;
  display: block;
  border: 2px solid transparent;
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.link-card h3 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--text-color);
}

.link-card p {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.6;
}

/* 列表 */
.video-list {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-list-item {
  display: flex;
  align-items: center;
  padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s;
}

.video-list-item:last-child {
  border-bottom: none;
}

.video-list-item:hover {
  background: var(--bg-light);
}

.item-num {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  min-width: 40px;
  margin-right: calc(var(--spacing-unit) * 2);
}

.item-info {
  flex: 1;
}

.item-info h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: calc(var(--spacing-unit) * 1);
}

.item-info h3 a {
  color: var(--text-color);
}

.item-info h3 a:hover {
  color: var(--primary-color);
}

.item-meta {
  font-size: 14px;
  color: var(--text-light);
}

/* 详情页 */
.detail {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 5);
  text-align: center;
}

.detail-header h1 {
  font-size: 36px;
  font-weight: bold;
  line-height: 1.3;
}

.detail-info {
  padding: calc(var(--spacing-unit) * 5);
  border-bottom: 1px solid var(--border-color);
}

.detail-info h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--text-color);
}

.info-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: calc(var(--spacing-unit) * 2);
  row-gap: calc(var(--spacing-unit) * 2);
}

.info-list dt {
  font-weight: bold;
  color: var(--text-light);
}

.info-list dd {
  color: var(--text-color);
}

.detail-section {
  padding: calc(var(--spacing-unit) * 5);
  border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--text-color);
}

.detail-section p {
  font-size: 16px;
  line-height: 2;
  color: var(--text-color);
}

.related-section {
  padding: calc(var(--spacing-unit) * 5);
}

.related-section h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--text-color);
}

/* 页脚 */
.site-footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: calc(var(--spacing-unit) * 4) 0;
  margin-top: calc(var(--spacing-unit) * 8);
}

.site-footer p {
  font-size: 14px;
  opacity: 0.8;
}

/* 列表区域 */
.list-section {
  margin-top: calc(var(--spacing-unit) * 4);
}

/* 响应式设计 */
@media (max-width: 767px) {
  .site-nav {
    padding: 0 calc(var(--spacing-unit) * 2);
  }

  .nav-logo {
    font-size: 18px;
    padding: calc(var(--spacing-unit) * 1.5) 0;
  }

  .nav-menu {
    gap: calc(var(--spacing-unit) * 0.5);
  }

  .nav-menu a {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 0.8);
    font-size: 12px;
  }

  .container {
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
  }

  .hero {
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
  }

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

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

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

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

  .page-header p {
    font-size: 16px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
  }

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

  .detail-header {
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
  }

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

  .detail-info,
  .detail-section,
  .related-section {
    padding: calc(var(--spacing-unit) * 3);
  }

  .info-list {
    grid-template-columns: 80px 1fr;
    gap: calc(var(--spacing-unit) * 1);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .container {
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
  }
}

/* UI 风格变体 */
.ui-style-0 { --primary-color: #d32f2f; }
.ui-style-1 { --primary-color: #c2185b; }
.ui-style-2 { --primary-color: #7b1fa2; }
.ui-style-3 { --primary-color: #512da8; }
.ui-style-4 { --primary-color: #303f9f; }
.ui-style-5 { --primary-color: #1976d2; }
.ui-style-6 { --primary-color: #0288d1; }
.ui-style-7 { --primary-color: #0097a7; }
.ui-style-8 { --primary-color: #00796b; }
.ui-style-9 { --primary-color: #388e3c; }
.ui-style-10 { --primary-color: #689f38; }
.ui-style-11 { --primary-color: #afb42b; }
.ui-style-12 { --primary-color: #f57c00; }
.ui-style-13 { --primary-color: #e64a19; }
.ui-style-14 { --primary-color: #5d4037; }
.ui-style-15 { --primary-color: #455a64; }

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: calc(var(--spacing-unit) * 4);
  right: calc(var(--spacing-unit) * 4);
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  z-index: 99;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

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

@media (max-width: 767px) {
  .back-to-top {
    bottom: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}
