:root {
  --bg-color: #0f0f13;
  --surface-color: #1c1c24;
  --surface-hover: #262632;
  --primary-color: #ff7a00;
  --primary-light: #ffa04d;
  --text-main: #f0f0f5;
  --text-muted: #9a9aa8;
  --border-color: #2d2d3d;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --gradient-text: linear-gradient(90deg, #ff7a00, #ffb347);
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
}

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

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

a {
  text-decoration: none;
  color: inherit;
}

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

/* Typography */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.3;
}

.gradient-title {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 60px 0;
}

.section-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-header h2 {
  font-size: 28px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 19, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-area img {
  height: 32px;
  border-radius: 6px;
}

.logo-area span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.download-btn {
  background: var(--primary-color);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

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

/* Hero */
.hero {
  position: relative;
  padding: 80px 0;
  background: radial-gradient(circle at top right, rgba(255, 122, 0, 0.1), transparent 50%);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 600px;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.2;
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

.hero-actions .primary-btn {
  background: var(--primary-color);
  color: #fff;
  padding: 14px 32px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
}

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

/* Ranking Grid */
.ranking-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .ranking-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ranking-panel {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-color);
}

.ranking-panel h3 {
  font-size: 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.rank-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rank-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rank-badge {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  border-radius: 50%;
  color: #000;
}

.rank-badge.top1 { background: var(--gold); }
.rank-badge.top2 { background: var(--silver); }
.rank-badge.top3 { background: var(--bronze); }
.rank-badge.normal { color: var(--text-muted); }

.rank-title {
  font-size: 14px;
  font-weight: 500;
}

.rank-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.trend-up { color: #ff4d4f; }
.trend-down { color: #52c41a; }

/* Horizontal Scroll */
.scroll-wrapper {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}

.scroll-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.scroll-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
}

.scroll-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

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

.scroll-card h4 {
  font-size: 14px;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-tag {
  font-size: 12px;
  color: var(--primary-light);
  margin-top: 2px;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

.category-item {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.category-item:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.cat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.cat-name {
  font-size: 12px;
  font-weight: 500;
}

/* Completed Series */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .poster-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .poster-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.poster-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.poster-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.poster-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.poster-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.poster-info h4 {
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary-color);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Welfare Bar */
.welfare-bar {
  background: linear-gradient(90deg, #2a1a0a, #1c1c24);
  border: 1px solid #4a2e10;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .welfare-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.welfare-text {
  font-size: 16px;
  font-weight: 500;
}

.welfare-text span {
  color: var(--primary-color);
  font-weight: bold;
}

.checkin-btn {
  background: var(--primary-color);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.checkin-btn:hover {
  background: var(--primary-light);
}

/* Schedule */
.schedule-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.day-col {
  flex: 0 0 140px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.day-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.schedule-item {
  font-size: 13px;
  margin-bottom: 12px;
}

.schedule-item p:first-child {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-item p:last-child {
  font-size: 12px;
  color: var(--text-muted);
}

.subscribe-btn {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.subscribe-btn:hover {
  background: rgba(255, 122, 0, 0.1);
}

/* Actors */
.actor-card {
  flex: 0 0 120px;
  text-align: center;
}

.actor-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: #333;
  object-fit: cover;
}

.actor-name {
  font-size: 14px;
  font-weight: 500;
}

.actor-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

details {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

summary {
  padding: 16px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 20px;
  color: var(--text-muted);
}

details[open] summary::after {
  content: '-';
}

.faq-content {
  padding: 0 16px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-inner a {
  color: var(--text-muted);
  transition: var(--transition);
}

.footer-inner a:hover {
  color: var(--text-main);
}

/* Utility */
.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-enabled .fade-in {
  opacity: 0;
  transform: translateY(20px);
}

.js-enabled .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}