/* UI Style Variables */
:root {
  --primary-color: #2c5f8d;
  --secondary-color: #4a90c8;
  --accent-color: #e67e22;
  --text-color: #2c3e50;
  --bg-color: #f8f9fa;
  --border-color: #dee2e6;
  --card-bg: #ffffff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --hover-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Reset and Base Styles */
* {
  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';
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

/* Header and Navigation */
header {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

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

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

nav ul li a {
  display: block;
  padding: 10px 16px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 15px;
}

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

/* Main Container */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Typography */
h1 {
  font-size: 32px;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-weight: 700;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--primary-color);
  font-weight: 600;
}

h3 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-color);
  font-weight: 600;
}

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

/* Section Styles */
section {
  margin-bottom: 48px;
  background: var(--card-bg);
  padding: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.intro-section h1,
.intro-section p {
  color: white;
}

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

.video-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.video-card-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 12px;
}

.video-meta span {
  display: inline-flex;
  align-items: center;
}

.video-card-body {
  padding: 20px;
  flex-grow: 1;
}

.video-oneline {
  color: var(--secondary-color);
  font-weight: 500;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.video-summary {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

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

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-color);
  border-radius: 16px;
  font-size: 12px;
  color: var(--text-color);
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  text-align: center;
}

.btn:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

/* Video List Styles */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.video-list-item {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.video-list-item:hover {
  box-shadow: var(--hover-shadow);
}

.video-list-item h3 {
  margin-bottom: 12px;
}

.video-rank {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  margin-right: 12px;
  font-size: 14px;
}

/* Detail Page Styles */
.detail-header {
  margin-bottom: 32px;
}

.detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-color);
  border-radius: 8px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
  font-size: 14px;
}

.info-value {
  color: var(--text-color);
  font-size: 15px;
}

.detail-content {
  margin-bottom: 32px;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  border-left: 4px solid var(--secondary-color);
  padding-left: 16px;
  margin-bottom: 20px;
}

.review-box {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 24px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  font-style: italic;
  line-height: 1.8;
}

/* Related Videos */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.related-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.3s ease;
}

.related-item:hover {
  border-color: var(--secondary-color);
  box-shadow: var(--shadow);
}

.related-item h4 {
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--primary-color);
}

.related-item p {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 12px;
  line-height: 1.6;
}

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

.related-item a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  background: var(--card-bg);
  padding: 32px 20px;
  margin-top: 64px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
}

/* Mobile Navigation - Single Row Only */
@media (max-width: 768px) {
  .header-container {
    padding: 0 12px;
    min-height: 56px;
  }

  .logo {
    font-size: 18px;
    flex-shrink: 0;
  }

  nav {
    flex: 1;
    overflow: hidden;
  }

  nav ul {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    overflow: hidden;
  }

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

  nav ul li a {
    padding: 8px 6px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  main {
    padding: 24px 16px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  section {
    padding: 20px 16px;
  }

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

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

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

@media (max-width: 480px) {
  .logo {
    font-size: 16px;
  }

  nav ul li a {
    padding: 6px 4px;
    font-size: 11px;
  }
}
