:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f5f5f5;
  --card-bg: #fff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

body.ui-style-0 { --primary-color: #3498db; }
body.ui-style-1 { --primary-color: #e74c3c; }
body.ui-style-2 { --primary-color: #2ecc71; }
body.ui-style-3 { --primary-color: #f39c12; }
body.ui-style-4 { --primary-color: #1abc9c; }
body.ui-style-5 { --primary-color: #34495e; }
body.ui-style-6 { --primary-color: #16a085; }
body.ui-style-7 { --primary-color: #27ae60; }
body.ui-style-8 { --primary-color: #2980b9; }
body.ui-style-9 { --primary-color: #8e44ad; }
body.ui-style-10 { --primary-color: #c0392b; }
body.ui-style-11 { --primary-color: #d35400; }
body.ui-style-12 { --primary-color: #7f8c8d; }
body.ui-style-13 { --primary-color: #c0392b; }
body.ui-style-14 { --primary-color: #16a085; }
body.ui-style-15 { --primary-color: #2c3e50; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

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

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

.site-footer {
  background: var(--secondary-color);
  color: #fff;
  padding: var(--spacing-lg) 0;
  margin-top: var(--spacing-xl);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.home-page,
.list-page,
.detail-page {
  min-height: calc(100vh - 200px);
  padding: var(--spacing-lg) 0;
}

.home-header,
.list-header,
.detail-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
}

.home-header h1,
.list-header h1,
.detail-header h1 {
  font-size: 2rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.home-intro,
.list-intro {
  background: var(--card-bg);
  padding: var(--spacing-lg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: var(--spacing-xl);
  line-height: 1.8;
  font-size: 1rem;
}

.home-section {
  margin-bottom: var(--spacing-xl);
}

.home-section h2,
.list-content h2,
.list-content h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--primary-color);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.content-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: var(--spacing-lg);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.content-card h3,
.content-card h4 {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-sm);
  line-height: 1.4;
}

.content-card h3 a,
.content-card h4 a {
  color: var(--secondary-color);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entrance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.entrance-card {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  padding: var(--spacing-xl);
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s ease;
}

.entrance-card:hover {
  transform: scale(1.05);
}

.entrance-card h3 {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-md);
  border: none;
  padding: 0;
}

.entrance-card h3 a {
  color: #fff;
}

.entrance-card p {
  font-size: 0.95rem;
  opacity: 0.9;
}

.section-more {
  text-align: center;
  margin-top: var(--spacing-lg);
}

.btn-more {
  display: inline-block;
  padding: 12px 32px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 24px;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.btn-more:hover {
  background: var(--accent-color);
  transform: scale(1.05);
  color: #fff;
}

.list-group,
.topic-group {
  margin-bottom: var(--spacing-xl);
}

.group-title,
.topic-title {
  font-size: 1.3rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-color);
  color: #fff;
  border-radius: 4px;
}

.rank-list,
.latest-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.rank-card,
.latest-card {
  display: flex;
  gap: var(--spacing-md);
  background: var(--card-bg);
  padding: var(--spacing-lg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rank-card:hover,
.latest-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}

.rank-num,
.latest-date {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #fff;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 8px;
}

.latest-date {
  font-size: 1rem;
}

.rank-content,
.latest-content {
  flex: 1;
}

.rank-content h3,
.latest-content h3 {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-sm);
}

.detail-content {
  background: var(--card-bg);
  padding: var(--spacing-xl);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-header {
  text-align: left;
  padding: 0 0 var(--spacing-lg) 0;
  margin-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--border-color);
}

.detail-info {
  margin-bottom: var(--spacing-xl);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  background: var(--bg-color);
  border-radius: 8px;
}

.info-item {
  display: flex;
  gap: var(--spacing-sm);
}

.info-item .label {
  font-weight: bold;
  color: var(--secondary-color);
  min-width: 60px;
}

.info-item .value {
  color: var(--text-color);
}

.info-tags {
  grid-column: 1 / -1;
}

.info-tags .value {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 16px;
  font-size: 0.85rem;
}

.detail-oneline,
.detail-summary,
.detail-review,
.detail-related {
  margin-bottom: var(--spacing-xl);
}

.detail-oneline h2,
.detail-summary h2,
.detail-review h2,
.detail-related h2 {
  font-size: 1.3rem;
  color: var(--secondary-color);
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-sm);
  border-left: 4px solid var(--primary-color);
}

.detail-oneline p,
.detail-summary p,
.detail-review p {
  line-height: 1.8;
  color: var(--text-color);
  font-size: 1rem;
  text-align: justify;
}

.detail-oneline p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary-color);
  padding: var(--spacing-md);
  background: var(--bg-color);
  border-radius: 4px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.related-card {
  padding: var(--spacing-md);
  background: var(--bg-color);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.related-card:hover {
  background: #e8f4f8;
}

.related-card h3 {
  font-size: 1rem;
  margin-bottom: var(--spacing-sm);
}

.related-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--spacing-sm);
}

.related-desc {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .home-header h1,
  .list-header h1,
  .detail-header h1 {
    font-size: 1.5rem;
  }

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

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

  .detail-content {
    padding: var(--spacing-md);
  }

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

@media (max-width: 480px) {
  .home-header h1,
  .list-header h1 {
    font-size: 1.2rem;
  }

  .detail-header h1 {
    font-size: 1.3rem;
  }

  .home-intro,
  .list-intro {
    padding: var(--spacing-md);
    font-size: 0.95rem;
  }
}

body.layout-A .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

body.layout-B .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

body.layout-C .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

body.layout-D .content-card {
  border-left: 4px solid var(--primary-color);
}

body.layout-E .content-card {
  border-radius: 12px;
}

body.layout-F .home-section {
  background: var(--card-bg);
  padding: var(--spacing-lg);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

body.layout-G .card-grid {
  gap: var(--spacing-xl);
}
