:root {
  --primary-color: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary-color: #0369a1;
  --accent-color: #f59e0b;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

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

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

body.ui-style-7 {
  background: linear-gradient(to bottom, #f0f4f8 0%, #e2e8f0 100%);
}

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

a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.nav a {
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.3s;
  white-space: nowrap;
  font-size: 0.95rem;
}

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

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

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

h2 {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-light);
}

h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
}

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

.intro p {
  margin-bottom: 1rem;
}

.intro p:last-child {
  margin-bottom: 0;
}

.section {
  margin: 3rem 0;
}

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

.video-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.video-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

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

.video-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0.25rem 0;
}

.video-desc {
  font-size: 0.95rem;
  color: #555;
  margin: 0.75rem 0;
  line-height: 1.5;
}

.rank {
  display: inline-block;
  background: var(--primary-light);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.rank.top3 {
  background: var(--accent-color);
}

.topic-tag {
  display: inline-block;
  background: var(--primary-light);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin: 0.2rem;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.topic-tag:hover {
  background: var(--primary-color);
}

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

.detail-header h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

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

.info-item {
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

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

.content-section {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.content-section h2 {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.content-section p {
  line-height: 1.8;
}

.tags {
  margin: 1rem 0;
}

.tag {
  display: inline-block;
  background: #e0f2fe;
  color: var(--secondary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  margin: 0.2rem;
  font-size: 0.9rem;
}

.footer {
  background: #1e293b;
  color: #94a3b8;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer p {
  margin: 0.5rem 0;
}

ul {
  list-style: none;
}

@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.4rem 0.3rem;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.4rem;
  }

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

  .intro {
    padding: 1.5rem;
  }

  .content-section {
    padding: 1.5rem;
  }

  .detail-header {
    padding: 1.5rem;
  }

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

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .nav a {
    font-size: 0.75rem;
    padding: 0.3rem 0.2rem;
  }
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-light);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.3s, transform 0.3s;
  opacity: 0;
  visibility: hidden;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

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