:root {
  --bg-dark: #12101a;
  --bg-card: #1e1b2b;
  --bg-card-hover: #28243a;
  --accent: #ff5a76;
  --accent-gradient: linear-gradient(135deg, #ff5a76, #ff9a5a);
  --text-main: #f2eff6;
  --text-sub: #a39eb0;
  --border-color: rgba(255, 255, 255, 0.08);
}
* { 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-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Header */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(18, 16, 26, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo-box { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 18px; }
.logo-box img { height: 32px; width: auto; border-radius: 6px; }
.nav-links { display: none; gap: 20px; }
.nav-links a { color: var(--text-sub); font-size: 14px; transition: color 0.3s; }
.nav-links a:hover { color: var(--text-main); }
.header-download { display: none; }

/* Hero */
.hero {
  padding: 60px 0 40px;
  text-align: center;
  background: radial-gradient(circle at top, rgba(255, 90, 118, 0.15) 0%, transparent 60%);
}
.hero h1 { font-size: 32px; line-height: 1.2; margin-bottom: 16px; }
.hero h1 span { display: block; margin-top: 8px; }
.hero p { color: var(--text-sub); font-size: 16px; max-width: 600px; margin: 0 auto 30px; }
.btn-group { display: flex; flex-direction: column; gap: 12px; justify-content: center; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 32px; border-radius: 30px; font-weight: bold; font-size: 16px;
  transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; border: none;
  width: 100%; max-width: 240px;
}
.btn-primary {
  background: var(--accent-gradient); color: #fff;
  box-shadow: 0 4px 15px rgba(255, 90, 118, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 90, 118, 0.5); }
.btn-outline {
  background: transparent; color: var(--text-main);
  border: 1px solid var(--text-sub);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Section Common */
section { padding: 40px 0; }
.sec-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-end; }
.sec-title { font-size: 24px; font-weight: bold; }
.sec-subtitle { font-size: 14px; color: var(--text-sub); margin-top: 4px; }

/* Rankings */
.rank-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.rank-col { background: var(--bg-card); border-radius: 16px; padding: 16px; }
.rank-list { list-style: none; }
.rank-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); gap: 12px; }
.rank-item:last-child { border-bottom: none; }
.rank-num {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold; border-radius: 4px; background: rgba(255,255,255,0.1); color: var(--text-sub);
}
.rank-num.top1 { background: #ffd700; color: #000; }
.rank-num.top2 { background: #c0c0c0; color: #000; }
.rank-num.top3 { background: #cd7f32; color: #fff; }
.rank-info { flex: 1; }
.rank-name { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.rank-heat { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }
.rank-heat i { color: #ff9a5a; font-style: normal; }
.rank-trend { font-size: 14px; font-weight: bold; }
.trend-up { color: #4ade80; }
.trend-down { color: #f87171; }

/* Recommend */
.scroll-wrap { position: relative; }
.scroll-track {
  display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px;
  scroll-behavior: smooth;
}
.scroll-track::-webkit-scrollbar { display: none; }
.card-movie {
  flex: 0 0 140px; background: var(--bg-card); border-radius: 12px; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}
.card-movie:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.card-movie img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.card-match {
  position: absolute; top: 8px; right: 8px; background: rgba(255, 90, 118, 0.9);
  color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold;
}
.card-title { padding: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; text-align: center; }

/* Categories */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-item {
  background: var(--bg-card); padding: 16px; border-radius: 12px; text-align: center;
  transition: background 0.3s, transform 0.2s;
}
.cat-item:hover { background: var(--bg-card-hover); transform: scale(1.02); }
.cat-icon { font-size: 28px; margin-bottom: 8px; }
.cat-name { font-size: 15px; font-weight: bold; }
.cat-count { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* High Score */
.completed-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card-completed {
  background: var(--bg-card); border-radius: 12px; overflow: hidden; position: relative;
}
.card-completed img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.score-badge {
  position: absolute; top: 8px; left: 8px; background: #ffd700; color: #000;
  font-size: 12px; font-weight: bold; padding: 2px 6px; border-radius: 4px;
}
.ep-badge {
  position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.7);
  color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px;
}

/* Welfare Bar */
.welfare-bar {
  background: linear-gradient(90deg, rgba(255,90,118,0.2), rgba(255,154,90,0.2));
  border: 1px solid rgba(255,90,118,0.3); border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center;
}
.welfare-text { font-size: 16px; font-weight: bold; }
.welfare-time { color: #ff5a76; font-family: monospace; font-size: 18px; margin: 0 4px; }
.btn-welfare { padding: 8px 24px; font-size: 14px; background: #fff; color: #ff5a76; border-radius: 20px; font-weight: bold; border: none; cursor: pointer; }

/* Calendar */
.calendar-scroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.calendar-scroll::-webkit-scrollbar { display: none; }
.cal-day {
  flex: 0 0 100px; background: var(--bg-card); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.cal-dt { font-size: 14px; font-weight: bold; text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.cal-item { font-size: 12px; color: var(--text-sub); }
.cal-item strong { color: var(--text-main); display: block; margin-bottom: 2px; font-weight: 500; }

/* Actors */
.actor-card {
  flex: 0 0 120px; background: var(--bg-card); border-radius: 12px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
}
.actor-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.actor-name { font-size: 14px; font-weight: bold; }
.actor-works { font-size: 11px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.actor-btn { margin-top: 4px; font-size: 12px; padding: 4px 12px; border-radius: 12px; background: var(--accent); color: #fff; border: none; cursor: pointer; }

/* Memes */
.masonry-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.meme-card {
  position: relative; border-radius: 12px; overflow: hidden; background: var(--bg-card);
}
.meme-card img { width: 100%; height: auto; display: block; }
.meme-text {
  padding: 12px; font-size: 14px; font-weight: bold; font-style: italic;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  position: absolute; bottom: 0; width: 100%; color: #fff;
}

/* Stats */
.stats-panel { display: flex; justify-content: space-around; background: var(--bg-card); border-radius: 16px; padding: 20px; text-align: center; }
.stat-item h4 { font-size: 20px; font-weight: bold; color: var(--accent); margin-bottom: 4px; }
.stat-item p { font-size: 12px; color: var(--text-sub); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-q {
  padding: 16px 0; font-weight: bold; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.faq-a { padding-bottom: 16px; color: var(--text-sub); font-size: 14px; display: none; }
.faq-item.active .faq-a { display: block; }
.faq-item.active .faq-q { color: var(--accent); }

/* Footer */
footer { border-top: 1px solid var(--border-color); padding: 30px 0; text-align: center; color: var(--text-sub); font-size: 12px; }
footer p { margin-bottom: 8px; }
footer a { color: var(--text-sub); transition: color 0.3s; }
footer a:hover { color: var(--text-main); }
.time-info { margin-top: 12px; font-size: 12px; opacity: 0.7; }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7);
  display: none; justify-content: center; align-items: center; z-index: 1000;
}
.modal-content {
  background: var(--bg-card); padding: 24px; border-radius: 16px; width: 90%; max-width: 320px;
  text-align: center; position: relative;
}
.modal-close { position: absolute; top: 12px; right: 12px; color: var(--text-sub); cursor: pointer; font-size: 20px; }
.modal-text { font-size: 14px; color: var(--text-main); margin-bottom: 16px; line-height: 1.6; }
.copy-box {
  background: var(--bg-dark); padding: 12px; border-radius: 8px; font-size: 13px;
  word-break: break-all; margin-bottom: 16px; color: var(--accent); border: 1px solid var(--border-color);
}
.btn-copy { background: var(--accent-gradient); color: #fff; border: none; padding: 10px 24px; border-radius: 20px; font-weight: bold; cursor: pointer; width: 100%; }

/* Animations */
.fade-up { opacity: 1; transform: translateY(0); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-up.pre-anim { opacity: 0; transform: translateY(20px); }
@keyframes scroll-num {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .header-download { display: inline-block; padding: 6px 16px; font-size: 14px; border-radius: 20px; background: var(--accent-gradient); color: #fff; font-weight: bold; }
  .btn-group { flex-direction: row; }
  .rank-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .completed-grid { grid-template-columns: repeat(4, 1fr); }
  .welfare-bar { flex-direction: row; justify-content: space-between; text-align: left; }
  .masonry-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 40px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 24px; }
  .hero { padding: 80px 0 60px; }
  .hero h1 { font-size: 48px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .completed-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .masonry-grid { grid-template-columns: repeat(4, 1fr); }
  .card-movie { flex: 0 0 180px; }
}