:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-header: #12121f;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #6366f1;
  --accent-glow: #8b5cf6;
  --gold: #f59e0b;
  --green: #4ade80;
  --border: #2d2d44;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header { background: var(--bg-header); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--text); text-decoration: none; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 0.95rem; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero { text-align: center; padding: 80px 20px 60px; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; margin-bottom: 16px; }
.hero .accent { color: var(--accent-glow); }
.hero p { color: var(--text-dim); font-size: 1.1rem; margin-bottom: 32px; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-block; padding: 12px 28px; border-radius: 8px; font-size: 1rem; font-weight: 600; text-decoration: none; transition: all 0.2s; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-glow); text-decoration: none; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }
.btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: #1a1a2e; }
.btn-gold:hover { transform: translateY(-1px); text-decoration: none; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* Section */
.section { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }
.section-title { font-size: 1.5rem; margin-bottom: 24px; text-align: center; }

/* About grid */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.about-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.about-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.about-card p { color: var(--text-dim); font-size: 0.9rem; }

/* Novel grid */
.novel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.novel-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all 0.2s; text-decoration: none; color: var(--text); display: block; }
.novel-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.novel-card.coming-soon { opacity: 0.5; cursor: default; }
.novel-card.coming-soon:hover { transform: none; border-color: var(--border); }
.novel-cover { height: 200px; display: flex; align-items: center; justify-content: center; }
.novel-title-overlay { font-size: 1.8rem; font-weight: 800; color: white; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.novel-card h3 { padding: 12px 16px 4px; font-size: 1rem; }
.novel-author { padding: 0 16px; color: var(--text-dim); font-size: 0.85rem; }
.novel-tags { padding: 8px 16px 12px; }
.tag { display: inline-block; background: var(--border); color: var(--text-dim); padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; margin-right: 4px; }

/* Novel detail / Reader */
.novel-detail { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.novel-detail h1 { font-size: 2rem; margin-bottom: 8px; }
.novel-detail .meta { color: var(--text-dim); margin-bottom: 24px; }
.chapter-list { list-style: none; }
.chapter-list li { border-bottom: 1px solid var(--border); }
.chapter-list li a { display: flex; justify-content: space-between; align-items: center; padding: 14px 8px; color: var(--text); text-decoration: none; transition: background 0.2s; }
.chapter-list li a:hover { background: var(--bg-card); text-decoration: none; }
.chapter-list .ch-title { font-size: 0.95rem; }
.chapter-list .ch-status { font-size: 0.8rem; }
.ch-free { color: var(--green); }
.ch-locked { color: var(--gold); }

/* Reader */
.reader { max-width: 700px; margin: 40px auto; padding: 0 20px; }
.reader h1 { font-size: 1.5rem; margin-bottom: 8px; }
.reader .chapter-nav { display: flex; justify-content: space-between; margin: 30px 0; }
.reader-content { font-size: 1.05rem; line-height: 1.9; color: #cbd5e1; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
.reader-content p { margin-bottom: 16px; }
.paywall { text-align: center; padding: 60px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 40px; }
.paywall h2 { margin-bottom: 12px; }
.paywall p { color: var(--text-dim); margin-bottom: 24px; }

/* Account */
.account-container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.account-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.account-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-glow)); display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; font-weight: 700; }
.account-info h1 { font-size: 1.5rem; margin: 0; }
.account-info p { color: var(--text-dim); margin: 4px 0 0; font-size: 0.9rem; }
.btn-logout { background: none; border: 1px solid #475569; color: var(--text-dim); padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-logout:hover { border-color: #ef4444; color: #ef4444; }
.coins-display { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 24px; }
.coins-display .coins-count { font-size: 2rem; font-weight: 800; color: var(--gold); }
.coins-display .coins-label { color: var(--text-dim); font-size: 0.85rem; }
.coin-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.coin-pack { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; cursor: pointer; transition: all 0.2s; }
.coin-pack:hover { border-color: var(--gold); }
.coin-pack .pack-coins { font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.coin-pack .pack-price { color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; }
.login-prompt { text-align: center; padding: 80px 20px; }
.login-prompt h2 { font-size: 1.8rem; margin-bottom: 12px; }
.login-prompt p { color: var(--text-dim); margin-bottom: 32px; }
.btn-google { display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #1e293b; border: 1px solid #e2e8f0; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-google:hover { background: #f8fafc; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-google svg { width: 20px; height: 20px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }

/* Footer */
.site-footer { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: 60px; }
.site-footer a { color: var(--text-dim); }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .nav-toggle { display: block; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg-header); padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
  .nav-links.open { display: flex; }
}
