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

:root {
  --primary-color: #00A1D6;
  --secondary-color: #FB7299;
  --text-color: #212121;
  --bg-color: #ffffff;
  --border-color: #e0e0e0;
  --hover-color: #f5f5f5;
  --spacing-unit: 8px;
}

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

body.ui-style-14 {
  --primary-color: #00A1D6;
  --secondary-color: #FB7299;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: calc(var(--spacing-unit) * 2) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 2);
}

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

.main-nav ul {
  list-style: none;
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  flex-wrap: nowrap;
  align-items: center;
}

.main-nav a {
  display: inline-block;
  padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
  border-radius: 4px;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 15px;
}

.main-nav a:hover {
  background: var(--hover-color);
  color: var(--primary-color);
}

.layout-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  gap: calc(var(--spacing-unit) * 3);
}

.layout__side {
  width: 240px;
  flex-shrink: 0;
  padding: calc(var(--spacing-unit) * 3);
  background: var(--hover-color);
  border-radius: 8px;
  margin: calc(var(--spacing-unit) * 3);
}

.layout__main {
  flex: 1;
  padding: calc(var(--spacing-unit) * 3);
  min-width: 0;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 3);
}

.page-header {
  margin-bottom: calc(var(--spacing-unit) * 4);
  padding-bottom: calc(var(--spacing-unit) * 3);
  border-bottom: 2px solid var(--border-color);
}

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

.page-desc {
  font-size: 16px;
  color: #666;
  line-height: 1.8;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 4);
}

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

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

.video-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-cover {
  position: relative;
  width: 100%;
  padding-top: 140%;
  background: var(--hover-color);
  overflow: hidden;
}

.video-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-cover img {
  transform: scale(1.05);
}

.video-info {
  padding: calc(var(--spacing-unit) * 2);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1);
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 1);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.video-meta {
  font-size: 13px;
  color: #999;
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  flex-wrap: wrap;
}

.video-one-line {
  font-size: 14px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.5;
}

.top-list__items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

.top-list__item {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  padding: calc(var(--spacing-unit) * 2);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.3s ease;
  align-items: center;
}

.top-list__item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transform: translateX(4px);
}

.top-rank {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  background: var(--hover-color);
  border-radius: 4px;
  flex-shrink: 0;
}

.top-list__item:nth-child(1) .top-rank,
.top-list__item:nth-child(2) .top-rank,
.top-list__item:nth-child(3) .top-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
}

.top-cover {
  width: 100px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--hover-color);
}

.top-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-info {
  flex: 1;
  min-width: 0;
}

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

.top-info p {
  font-size: 14px;
  color: #666;
  margin-bottom: calc(var(--spacing-unit) * 1);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-player-section {
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.video-player {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-player-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
}

.player-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.player-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(255, 255, 255, 1);
}

.player-play-icon {
  font-size: 36px;
  color: var(--primary-color);
  margin-left: 4px;
}

.detail-section {
  margin-bottom: calc(var(--spacing-unit) * 4);
  padding: calc(var(--spacing-unit) * 3);
  background: var(--bg-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.detail-section h1 {
  font-size: 28px;
  margin-bottom: calc(var(--spacing-unit) * 3);
  font-weight: 700;
}

.detail-section h2 {
  font-size: 22px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-weight: 600;
  color: var(--primary-color);
}

.detail-section h3 {
  font-size: 18px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-weight: 600;
}

.detail-section p {
  line-height: 1.8;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: #444;
}

.info-table {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.info-label {
  font-weight: 600;
  color: #666;
}

.info-value {
  color: #444;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 1);
  margin-top: calc(var(--spacing-unit) * 2);
}

.tag-item {
  padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
  background: var(--hover-color);
  border-radius: 16px;
  font-size: 13px;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
}

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

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

.video-card--related {
  max-width: 100%;
}

footer {
  background: var(--hover-color);
  padding: calc(var(--spacing-unit) * 4) 0;
  margin-top: calc(var(--spacing-unit) * 6);
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 3);
  text-align: center;
  color: #666;
  font-size: 14px;
}

.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: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

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

.page--top .top-list__items {
  max-width: 900px;
  margin: 0 auto;
}

.page--grouped .group {
  margin-bottom: calc(var(--spacing-unit) * 5);
}

.group__header {
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding-bottom: calc(var(--spacing-unit) * 2);
  border-bottom: 2px solid var(--border-color);
}

.group__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-color);
}

.group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: calc(var(--spacing-unit) * 3);
}

.page--with-sidebar {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  max-width: 1400px;
  margin: 0 auto;
}

.layout__side--filters {
  width: 240px;
  flex-shrink: 0;
  background: var(--hover-color);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: 8px;
  height: fit-content;
}

.filter-section {
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.filter-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.site-intro {
  padding: calc(var(--spacing-unit) * 4);
  background: linear-gradient(135deg, var(--hover-color), var(--bg-color));
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 4);
  border: 1px solid var(--border-color);
}

.site-intro h2 {
  font-size: 20px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--primary-color);
}

.site-intro p {
  line-height: 1.8;
  color: #555;
}

.home-section {
  margin-bottom: calc(var(--spacing-unit) * 5);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding-bottom: calc(var(--spacing-unit) * 2);
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
}

.section-more {
  font-size: 14px;
  color: var(--primary-color);
  padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.section-more:hover {
  background: var(--hover-color);
}

@media (max-width: 1200px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav ul {
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .main-nav a {
    padding: calc(var(--spacing-unit) * 1);
    font-size: 13px;
  }

  .layout-wrapper {
    flex-direction: column;
  }

  .layout__side {
    width: 100%;
    margin: calc(var(--spacing-unit) * 2);
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
  }

  .video-cover {
    padding-top: 120%;
  }

  .page--with-sidebar {
    flex-direction: column;
  }

  .layout__side--filters {
    width: 100%;
  }

  .top-list__item {
    flex-wrap: wrap;
  }

  .top-cover {
    width: 80px;
    height: 112px;
  }

  main {
    padding: calc(var(--spacing-unit) * 2);
  }

  .page-title {
    font-size: 24px;
  }

  .detail-section h1 {
    font-size: 22px;
  }

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

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

  .main-nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav ul::-webkit-scrollbar {
    display: none;
  }
}
