:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --bg-color: #ecf0f1;
  --text-color: #2c3e50;
  --border-color: #bdc3c7;
  --card-bg: #ffffff;
  --hover-color: #34495e;
}

body.ui-style-14 {
  --primary-color: #1a472a;
  --secondary-color: #27ae60;
  --accent-color: #f39c12;
  --bg-color: #f4f6f5;
  --text-color: #1a472a;
}

* {
  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;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

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

header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

nav ul {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  gap: 0;
}

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

nav ul li a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  transition: background 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

nav ul li a:hover {
  background: var(--hover-color);
}

main {
  padding: 2rem 0;
  min-height: 60vh;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--primary-color);
  line-height: 1.2;
}

h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.8rem;
  color: var(--primary-color);
  line-height: 1.2;
}

section {
  margin-bottom: 3rem;
}

.intro-section {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
  line-height: 1.8;
}

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

.video-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.video-card h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.video-card h3 a {
  color: var(--primary-color);
  text-decoration: none;
}

.video-card h3 a:hover {
  color: var(--secondary-color);
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.video-meta span {
  background: var(--bg-color);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.video-desc {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.tag {
  background: var(--secondary-color);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.video-list {
  list-style: none;
}

.video-list li {
  background: var(--card-bg);
  margin-bottom: 1rem;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}

.video-list li:hover {
  transform: translateX(4px);
}

.video-list h3 {
  margin-top: 0;
}

.video-list h3 a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.2rem;
}

.video-list h3 a:hover {
  color: var(--secondary-color);
}

.detail-header {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}

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

.info-item {
  padding: 0.8rem;
  background: var(--bg-color);
  border-radius: 4px;
}

.info-label {
  font-weight: bold;
  color: var(--primary-color);
  margin-right: 0.5rem;
}

.detail-content {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.detail-content h2 {
  margin-top: 0;
}

.detail-content p {
  margin-bottom: 1rem;
}

.related-section {
  margin-top: 3rem;
}

.rank-number {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 4px;
  margin-right: 0.8rem;
  font-weight: bold;
}

.group-section {
  margin-bottom: 3rem;
}

.group-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px 8px 0 0;
  font-size: 1.3rem;
  font-weight: bold;
}

.date-label {
  display: inline-block;
  background: var(--secondary-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  margin-right: 0.8rem;
  font-size: 0.9rem;
}

footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

footer a {
  color: white;
  text-decoration: none;
  margin: 0 0.5rem;
}

footer a:hover {
  text-decoration: underline;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--secondary-color);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: background 0.3s;
}

.back-to-top:hover {
  background: var(--primary-color);
}

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

@media (max-width: 768px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

  nav ul {
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: visible;
  }

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

  nav ul li a {
    padding: 0.5rem 0.3rem;
    font-size: 0.85rem;
  }

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

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

  .intro-section,
  .detail-header,
  .detail-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  nav ul li a {
    padding: 0.5rem 0.2rem;
    font-size: 0.8rem;
  }

  .logo {
    font-size: 1.2rem;
  }
}
