/* === Base Reset & Variables === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; transition: .2s; }
a:hover { opacity: .85; }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* === Header === */
.header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo i { font-size: 24px; color: var(--primary); }
.search-form { flex: 1; max-width: 420px; display: flex; background: var(--bg); border-radius: 24px; border: 1px solid var(--border); overflow: hidden; transition: .2s; }
.search-form:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-form input { border: none; background: none; padding: 8px 16px; flex: 1; font-size: 14px; outline: none; }
.search-form button { border: none; background: none; padding: 8px 14px; cursor: pointer; color: var(--text-light); font-size: 16px; }
.nav { display: flex; align-items: center; gap: 14px; font-size: 14px; white-space: nowrap; }
.nav a { color: var(--text); display: flex; align-items: center; gap: 4px; }
.nav-user { font-weight: 600; }
.vip-badge { background: linear-gradient(135deg, #f59e0b, #f97316); color: white; font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; margin-left: 4px; }

/* === Main === */
.main { flex: 1; padding: 24px 0 92px; }

/* === Notice === */
.notice { background: var(--primary-light); color: var(--primary); padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 24px; font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* === Section Title === */
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }

/* === Novel Grid === */
.novel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.novel-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: .25s; display: block; color: var(--text); }
.novel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); opacity: 1; }
.novel-cover { aspect-ratio: 3/4; overflow: hidden; background: var(--bg); position: relative; }
.novel-cover img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.novel-card:hover .novel-cover img { transform: scale(1.05); }
.cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: var(--primary); font-size: 48px; }
.cover-placeholder.lg { font-size: 64px; }
.novel-info { padding: 12px; }
.novel-title { font-size: 15px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.novel-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.tag { background: var(--primary-light); color: var(--primary); font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.novel-meta { font-size: 12px; color: var(--text-light); }

/* === Novel Detail === */
.novel-detail-header { display: flex; gap: 24px; margin-bottom: 32px; }
.novel-detail-cover { width: 200px; flex-shrink: 0; }
.novel-detail-cover img, .novel-detail-cover .cover-placeholder { width: 200px; height: 267px; border-radius: var(--radius); object-fit: cover; box-shadow: var(--shadow-md); }
.novel-detail-info { flex: 1; }
.novel-detail-info h1 { font-size: 28px; margin-bottom: 12px; }
.novel-desc { color: var(--text-light); margin: 12px 0; line-height: 1.8; }
.novel-actions { display: flex; gap: 12px; margin-top: 20px; }

/* === Chapter List === */
.chapter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.chapter-item { padding: 10px 14px; background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text); font-size: 14px; transition: .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-item:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); opacity: 1; }

/* === Reader === */
.reader { max-width: 800px; margin: 0 auto; }
.reader-header { margin-bottom: 24px; }
.back-link { font-size: 14px; color: var(--text-light); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.reader-header h2 { font-size: 24px; }
.reader-content { background: var(--white); padding: 32px; border-radius: var(--radius); box-shadow: var(--shadow); line-height: 2; font-size: 16px; color: #333; min-height: 300px; }
.reader-nav { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }

/* === VIP Wall === */
.vip-wall { position: relative; margin-top: -60px; padding-top: 80px; background: linear-gradient(to bottom, transparent, var(--bg) 40px); text-align: center; }
.vip-wall-inner { background: var(--white); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-md); border: 2px dashed var(--warning); }
.vip-wall i { font-size: 48px; color: var(--warning); }
.vip-wall h3 { font-size: 22px; margin: 12px 0 8px; }
.vip-wall p { color: var(--text-light); margin-bottom: 20px; }

/* === VIP Page === */
.vip-page { max-width: 900px; margin: 0 auto; }
.vip-header { text-align: center; padding: 40px 0 32px; }
.vip-header i { font-size: 56px; color: var(--warning); }
.vip-header h2 { font-size: 28px; margin: 8px 0; }
.vip-header p { color: var(--text-light); }
.vip-status { margin-top: 12px; background: #fef3c7; color: #92400e; padding: 8px 16px; border-radius: var(--radius-sm); display: inline-block; font-size: 14px; }
.vip-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.plan-card { background: var(--white); border-radius: var(--radius); padding: 28px; text-align: center; box-shadow: var(--shadow); border: 2px solid var(--border); transition: .2s; position: relative; }
.plan-card.featured { border-color: var(--primary); transform: scale(1.03); }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: white; font-size: 12px; padding: 2px 14px; border-radius: 12px; font-weight: 600; }
.plan-card h3 { font-size: 18px; margin-bottom: 12px; }
.plan-price { font-size: 36px; font-weight: 800; color: var(--primary); }
.price-symbol { font-size: 18px; }
.plan-days { color: var(--text-light); margin: 4px 0 8px; }
.plan-unit { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.plan-actions { display: flex; gap: 8px; justify-content: center; }
.btn-alipay { background: #1677ff; color: white; border: none; padding: 8px 18px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; transition: .2s; }
.btn-alipay:hover { background: #0958d9; color: white; }
.btn-wechat { background: #07c160; color: white; border: none; padding: 8px 18px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; transition: .2s; }
.btn-wechat:hover { background: #06ae56; color: white; }

/* === Pay Result === */
.pay-result { text-align: center; padding: 60px 0; }
.result-icon { font-size: 72px; margin-bottom: 16px; }
.result-icon.success { color: var(--success); }
.result-icon.pending { color: var(--warning); }
.pay-result h2 { font-size: 24px; margin-bottom: 8px; }
.pay-result p { color: var(--text-light); margin-bottom: 24px; }

/* === Auth === */
.auth-box { max-width: 400px; margin: 40px auto; background: var(--white); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow-md); }
.auth-box h2 { text-align: center; margin-bottom: 24px; font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.auth-form input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; transition: .2s; }
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-light); }

/* === User Center === */
.user-center { max-width: 600px; margin: 0 auto; }
.user-card { background: var(--white); border-radius: var(--radius); padding: 28px; display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow-md); margin-bottom: 24px; }
.user-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-light), #c7d2fe); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--primary); flex-shrink: 0; }
.user-info-detail h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.vip-info { color: var(--warning); font-size: 14px; margin-top: 4px; }
.text-muted { color: var(--text-light); font-size: 13px; }
.user-menu { display: flex; flex-direction: column; gap: 8px; }
.user-menu-item { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); color: var(--text); font-size: 15px; transition: .2s; }
.user-menu-item:hover { background: var(--primary-light); color: var(--primary); opacity: 1; }
.user-menu-item i { font-size: 20px; width: 24px; text-align: center; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: .2s; text-decoration: none; }
.btn-sm-inline { padding: 6px 10px; font-size: 12px; margin-left: auto; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #4338ca; color: white; }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* === Alerts === */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* === Pagination === */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); background: var(--white); color: var(--text); border: 1px solid var(--border); font-size: 14px; }
.pagination a.active, .pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* === Empty === */
.empty { text-align: center; padding: 60px 0; color: var(--text-light); font-size: 15px; }
.feed-state { text-align: center; margin-top: 20px; color: var(--text-light); font-size: 14px; }
.feed-sentinel { height: 2px; }

/* === Footer === */
.footer { text-align: center; padding: 20px 0; color: var(--text-light); font-size: 13px; border-top: 1px solid var(--border); background: var(--white); margin-top: 40px; }

/* === Bottom Nav === */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    z-index: 120;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-light);
    font-size: 12px;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--primary); font-weight: 600; }

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; }
    .search-form { order: 3; max-width: 100%; width: 100%; }
    .novel-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .novel-detail-header { flex-direction: column; align-items: center; text-align: center; }
    .novel-detail-cover { width: 160px; }
    .novel-actions { justify-content: center; }
    .chapter-list { grid-template-columns: 1fr; }
    .reader-content { padding: 20px; }
    .vip-plans { grid-template-columns: 1fr; }
    .plan-card.featured { transform: none; }
    .nav { gap: 10px; font-size: 13px; }
}
