:root {
  --primary: #1a73e8;
  --secondary: #34a853;
  --accent: #fbbc04;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --hover: #e8f0fe;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

header {
  background: var(--card-bg);
  box-shadow: 0 1px 3px 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: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.2s;
  display: block;
  white-space: nowrap;
  font-size: 14px;
}

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

main {
  padding: 32px 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.2;
}

h2 {
  font-size: 22px;
  margin: 32px 0 16px;
  color: var(--text);
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  margin: 24px 0 12px;
  color: var(--text);
  line-height: 1.2;
}

section {
  background: var(--card-bg);
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.intro {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

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

.video-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

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

.video-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

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

.video-card a:hover {
  text-decoration: underline;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.video-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 8px;
}

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

.tag {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 40px 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.detail-header h1 {
  color: white;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  opacity: 0.95;
}

.detail-section {
  background: var(--card-bg);
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

.detail-section p {
  line-height: 1.8;
  color: var(--text-secondary);
}

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

.related-item {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.related-item:hover {
  background: var(--hover);
}

.related-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.related-item p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}

footer {
  background: var(--card-bg);
  padding: 24px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.list-header {
  margin-bottom: 24px;
}

.list-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 6px;
  transition: background 0.2s;
}

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

.list-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.rank-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}

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

  .logo {
    font-size: 18px;
  }

  nav ul {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: visible;
  }

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

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

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

  .detail-header {
    padding: 24px 16px;
  }

  section {
    padding: 16px;
  }
}

body.ui-style-0 {
  --primary: #1a73e8;
  --secondary: #34a853;
}

body.ui-style-1 {
  --primary: #d32f2f;
  --secondary: #f57c00;
}

body.ui-style-2 {
  --primary: #7b1fa2;
  --secondary: #c2185b;
}

body.ui-style-3 {
  --primary: #0288d1;
  --secondary: #0097a7;
}

body.ui-style-4 {
  --primary: #388e3c;
  --secondary: #689f38;
}

body.ui-style-5 {
  --primary: #f57f17;
  --secondary: #fbc02d;
}

body.ui-style-6 {
  --primary: #5d4037;
  --secondary: #6d4c41;
}

body.ui-style-7 {
  --primary: #455a64;
  --secondary: #546e7a;
}

body.ui-style-8 {
  --primary: #c62828;
  --secondary: #ad1457;
}

body.ui-style-9 {
  --primary: #6a1b9a;
  --secondary: #4a148c;
}

body.ui-style-10 {
  --primary: #00838f;
  --secondary: #006064;
}

body.ui-style-11 {
  --primary: #2e7d32;
  --secondary: #1b5e20;
}

body.ui-style-12 {
  --primary: #e65100;
  --secondary: #bf360c;
}

body.ui-style-13 {
  --primary: #1565c0;
  --secondary: #0d47a1;
}

body.ui-style-14 {
  --primary: #558b2f;
  --secondary: #33691e;
}

body.ui-style-15 {
  --primary: #4e342e;
  --secondary: #3e2723;
}
