:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --surface-hover: #22222c;
  --accent: #ff4d6d;
  --accent-glow: rgba(255,77,109,0.4);
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --text: #e8e8ed;
  --text-muted: #9090a0;
  --border: rgba(255,255,255,0.08);
  --radius: 16px;
  --radius-sm: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,15,19,0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 32px; width: 32px; border-radius: 8px; object-fit: cover; }
.brand span { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.nav-links { display: none; gap: 22px; font-size: 14px; color: var(--text-muted); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.header-actions { display: flex; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 50px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; transition: transform .2s, box-shadow .25s, background .25s;
}
.btn-primary {
  background: linear-gradient(135deg, #ff4d6d, #ff7a59);
  color: #fff; box-shadow: 0 4px 18px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 26px var(--accent-glow); }
.btn-outline {
  background: transparent; color: var(--text); border-color: var(--border);
}
.btn-outline:hover { background: var(--surface-hover); transform: translateY(-2px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 60px 20px 50px;
  text-align: center;
}
.hero::before {
  content: ''; position: absolute; top: -160px; left: 50%;
  transform: translateX(-50%); width: 700px; height: 500px;
  background: radial-gradient(circle, rgba(255,77,109,0.18), transparent 65%);
  pointer-events: none;
}
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 50px;
  font-size: 13px; color: var(--accent);
  background: rgba(255,77,109,0.1); border: 1px solid rgba(255,77,109,0.25);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 52px); font-weight: 800; line-height: 1.2;
  letter-spacing: 1px; max-width: 820px; margin: 0 auto 18px;
  background: linear-gradient(135deg, #fff 20%, #ffb3c1 70%, #ff7a59);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  color: var(--text-muted); font-size: 15px; max-width: 600px;
  margin: 0 auto 30px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; justify-content: center; gap: 40px; margin-top: 46px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 26px; font-weight: 800; color: var(--accent); }
.hero-stat span { font-size: 13px; color: var(--text-muted); }

/* Section common */
.section { padding: 60px 20px; max-width: 1200px; margin: 0 auto; }
.section-head { margin-bottom: 32px; }
.section-head h2 {
  font-size: clamp(22px, 4vw, 32px); font-weight: 800; margin-bottom: 8px;
  background: linear-gradient(90deg, #fff 10%, #ff8fa3 60%, #ffb44d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}
.section-head p { color: var(--text-muted); font-size: 14px; }

/* Rank board */
.rank-board { display: grid; gap: 28px; }
.rank-col { background: var(--surface); border-radius: var(--radius); padding: 22px; border: 1px solid var(--border); }
.rank-col h3 { font-size: 17px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.rank-col h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.rank-list { list-style: none; }
.rank-list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
  transition: transform .2s;
}
.rank-list li:last-child { border-bottom: none; }
.rank-list li:hover { transform: translateX(4px); }
.rank-num {
  width: 24px; height: 24px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; font-size: 12px;
  font-weight: 700; background: var(--surface-hover); color: var(--text-muted);
  flex-shrink: 0;
}
.rank-num.top1 { background: linear-gradient(135deg,#ffd700,#ffb300); color: #1a1a22; }
.rank-num.top2 { background: linear-gradient(135deg,#e0e0e0,#a0a0a0); color: #1a1a22; }
.rank-num.top3 { background: linear-gradient(135deg,#e09a5d,#b06e30); color: #1a1a22; }
.rank-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-heat { color: var(--text-muted); font-size: 13px; display: flex; align-items: center; gap: 3px; }
.rank-heat .fire { color: #ff6b35; }
.rank-trend { font-size: 12px; }
.rank-trend.up { color: #4ade80; }
.rank-trend.down { color: #f87171; }

/* Rec cards */
.card-scroller {
  display: flex; gap: 16px; overflow-x: auto; padding-bottom: 14px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.card-scroller::-webkit-scrollbar { height: 6px; }
.card-scroller::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.rec-card, .drama-card {
  flex: 0 0 auto; width: 168px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  transition: transform .3s, box-shadow .3s;
}
.rec-card { width: 188px; }
.rec-card:hover, .drama-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,77,109,0.25);
}
.poster-wrap { position: relative; aspect-ratio: 3/4; overflow: hidden; background: #222; }
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.rec-card:hover .poster-wrap img, .drama-card:hover .poster-wrap img { transform: scale(1.06); }
.match-badge {
  position: absolute; top: 8px; right: 8px; padding: 3px 9px;
  border-radius: 30px; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg,#ff4d6d,#ff7a59); color: #fff;
}
.score-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 9px;
  border-radius: 8px; font-size: 12px; font-weight: 800;
  background: rgba(0,0,0,0.7); color: var(--gold); backdrop-filter: blur(4px);
}
.drama-meta { padding: 10px 12px 14px; }
.drama-meta h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drama-meta span { font-size: 12px; color: var(--text-muted); }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px 14px; text-align: center;
  transition: background .25s, transform .25s, border-color .25s;
}
.cat-item:hover { background: var(--surface-hover); transform: translateY(-4px); border-color: rgba(255,77,109,0.35); }
.cat-icon { font-size: 26px; margin-bottom: 6px; display: block; }
.cat-name { font-size: 14px; font-weight: 600; }
.cat-count { font-size: 12px; color: var(--text-muted); }

/* Welfare banner */
.welfare-banner {
  background: linear-gradient(120deg, rgba(255,77,109,0.18), rgba(255,180,77,0.12));
  border: 1px solid rgba(255,77,109,0.3);
  border-radius: var(--radius); padding: 26px 22px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 18px;
}
.welfare-banner h3 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.countdown { color: #ffb44d; font-variant-numeric: tabular-nums; font-weight: 800; }
.welfare-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.checkin-panel { display: none; margin-top: 16px; }
.checkin-panel.open { display: block; }
.checkin-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.day-cell {
  aspect-ratio: 1; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 11px; color: var(--text-muted);
}
.day-cell.done { background: rgba(255,77,109,0.15); border-color: rgba(255,77,109,0.4); color: var(--accent); }
.day-cell.done span.check { font-size: 14px; }
.day-cell.today { border-color: var(--gold); }

/* Schedule */
.week-timeline { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.day-col {
  flex: 0 0 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.day-col h4 { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.day-item { font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); display: flex; justify-content: space-between; gap: 6px; }
.day-item:last-child { border-bottom: none; }
.day-item span { color: var(--text-muted); }

/* Stars */
.star-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; }
.star-card {
  flex: 0 0 140px; background: var(--surface); border-radius: var(--radius);
  padding: 16px; text-align: center; border: 1px solid var(--border);
}
.star-avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; overflow: hidden; }
.star-avatar img { width: 100%; height: 100%; object-fit: cover; }
.star-card strong { font-size: 14px; display: block; margin-bottom: 4px; }
.star-card p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

/* Meme wall */
.meme-wall { columns: 2; column-gap: 12px; }
.meme-item { break-inside: avoid; margin-bottom: 12px; border-radius: var(--radius-sm); overflow: hidden; position: relative; cursor: default; }
.meme-item img { width: 100%; }
.meme-caption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-size: 12px; opacity: 0; transition: opacity .3s;
}
.meme-item:hover .meme-caption { opacity: 1; }

/* Community */
.review-grid { display: grid; gap: 16px; }
.review-card { background: var(--surface); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.review-head .avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg,#ff4d6d,#7b2ff7); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.review-head strong { font-size: 14px; }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.review-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.review-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* Stats board */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-box { background: var(--surface); border-radius: var(--radius); padding: 22px; border: 1px solid var(--border); text-align: center; }
.stat-box strong { font-size: 30px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; display: block; }
.stat-box span { font-size: 13px; color: var(--text-muted); }
.quote-list { list-style: none; margin-top: 22px; }
.quote-list li { font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.quote-list li b { color: var(--text); margin-right: 8px; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; background: none; border: none; color: var(--text);
  text-align: left; padding: 18px 0; font-size: 15px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-q::after { content: '+'; color: var(--accent); font-size: 20px; transition: transform .25s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding-bottom: 18px; font-size: 14px; color: var(--text-muted); }
.faq-item.open .faq-a { max-height: 220px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 34px 20px 26px; text-align: center;
  color: #66667a; font-size: 12px;
}
.site-footer .footer-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.site-footer .footer-tags a { color: #7a7a90; font-size: 12px; }
.site-footer .footer-tags a:hover { color: var(--accent); }
.site-footer p { margin-bottom: 6px; }
.site-footer a { color: #7a7a90; }
.footer-update { margin-top: 6px; }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 22px; max-width: 420px; width: 100%;
}
.modal-box h3 { font-size: 16px; margin-bottom: 10px; }
.modal-box p { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; color: var(--text); font-size: 13px;
}
.modal-close { margin-top: 14px; width: 100%; }

/* Fade-in on scroll */
.reveal { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s ease; }
.reveal:not(.in) { opacity: 0.35; transform: translateY(24px); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* 3D tilt */
.tilt { transition: transform .15s ease-out; will-change: transform; }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .rank-board { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .welfare-banner { flex-direction: row; align-items: center; justify-content: space-between; }
  .review-grid { grid-template-columns: 1fr 1fr; }
  .meme-wall { columns: 3; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(8, 1fr); }
  .hero { padding: 90px 20px 70px; }
  .section { padding: 80px 20px; }
}