/**
 * 漫画详情页样式 v2 - 柔和少女漫风格
 */

/* ----- 顶部详情卡 ----- */
.detail-header {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 36px;
    background: #fff;
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 28px 0 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(251,100,173,0.04);
}
/* 顶部装饰渐变 */
.detail-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 360px; height: 200px;
    background:
        radial-gradient(circle at 80% 0%, rgba(251,100,173,0.10), transparent 60%),
        radial-gradient(circle at 100% 50%, rgba(255,182,213,0.15), transparent 70%);
    pointer-events: none;
}
.detail-header > * { position: relative; z-index: 1; }

/* 封面 */
.detail-cover {
    width: 240px; height: 336px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--primary-softer);
    box-shadow:
        0 12px 30px rgba(251,100,173,0.25),
        0 0 0 1px rgba(251,100,173,0.08);
    position: relative;
    transition: transform .4s cubic-bezier(.4,.0,.2,1);
}
.detail-cover:hover { transform: translateY(-4px); }
.detail-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s cubic-bezier(.4,.0,.2,1);
}
.detail-cover:hover img { transform: scale(1.04); }
/* 封面光泽 */
.detail-cover::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left .6s ease;
    pointer-events: none;
}
.detail-cover:hover::after { left: 130%; }

/* 信息区 */
.detail-info { min-width: 0; }
.detail-title {
    font-size: 28px;
    margin-bottom: 14px;
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.5px;
}
.detail-meta {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-bottom: 20px;
    color: var(--text-sub);
    font-size: 14px;
}
.detail-meta > span:not(.tag-badge) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.detail-meta i { color: var(--primary); }

/* 统计四宫格 */
.detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0;
    border: 0;
    margin-bottom: 22px;
    background: linear-gradient(135deg, var(--primary-softer), #FFFCFE);
    border-radius: var(--radius-md);
    padding: 18px 0;
    position: relative;
}
.stat {
    text-align: center;
    position: relative;
}
.stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0; top: 20%; bottom: 20%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(251,100,173,0.20), transparent);
}
.stat-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
    font-family: -apple-system, "Helvetica Neue", sans-serif;
    letter-spacing: -0.5px;
}
.stat-val.text-vip {
    color: var(--vip);
    background: var(--vip-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 12px;
    color: var(--text-tip);
    margin-top: 4px;
    font-weight: 500;
}

/* 简介 */
.detail-desc {
    color: var(--text-sub);
    line-height: 1.85;
    margin-bottom: 22px;
    font-size: 14px;
    padding: 14px 16px;
    background: #FFFCFE;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    max-height: 120px;
    overflow-y: auto;
}
.detail-desc::-webkit-scrollbar { width: 4px; }

/* 操作按钮区 */
.detail-actions {
    display: flex; gap: 12px; margin-bottom: 18px;
}
.detail-actions .btn-lg {
    padding: 13px 32px;
    font-size: 15px;
    font-weight: 600;
}
.detail-actions .btn.collected {
    background: linear-gradient(135deg, #FFF0F4, #FFFCFE);
    color: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(255,91,124,0.18);
}
.detail-actions .btn.collected:hover {
    background: linear-gradient(135deg, #FFE0E8, #FFF0F4);
    color: var(--danger);
}

/* 评分区 */
.detail-rate {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-top: 0;
    background: linear-gradient(135deg, #FFFBEF, #FFFCFE);
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(255,184,0,0.25);
}
.detail-rate > .text-sub {
    font-weight: 600;
    color: var(--text-main);
}
.detail-rate .stars-input .fa {
    font-size: 26px;
    color: #FFB800;
    cursor: pointer;
    transition: transform .15s;
    margin-right: 4px;
}
.detail-rate .stars-input .fa-star-o { color: #E8DEE7; }
.detail-rate .stars-input .fa:hover { transform: scale(1.25); }
#rateTip { font-size: 13px; }

/* ----- 章节排序按钮 ----- */
.chapter-order {
    display: inline-block;
    padding: 4px 14px;
    margin-left: 6px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-sub);
    background: var(--primary-softer);
    border: 1px solid transparent;
    transition: all .2s;
}
.chapter-order:hover {
    color: var(--primary);
    background: var(--primary-soft);
}
.chapter-order.active {
    background: var(--primary-grad);
    color: #fff;
    box-shadow: 0 3px 10px rgba(251,100,173,0.30);
}

/* ----- 章节列表 ----- */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.chapter-item {
    padding: 12px 14px;
    background: #FFFCFE;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-align: center;
    font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: all .2s cubic-bezier(.4,.0,.2,1);
    position: relative;
    font-weight: 500;
}
.chapter-item:hover {
    background: var(--primary-grad);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(251,100,173,0.25);
}
/* VIP 章节标识（如果将来支持） */
.chapter-item.vip::after {
    content: 'VIP';
    position: absolute;
    top: 0; right: 0;
    background: var(--vip-grad);
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 0 var(--radius-sm) 0 6px;
    font-weight: 700;
}

/* PDF 章节标识 */
.chapter-item.pdf {
    border-color: rgba(255,140,64,0.30);
    background: linear-gradient(135deg, #FFF7EF, #FFFCFE);
    padding-right: 36px;  /* 给右上角标签留位 */
}
.chapter-item.pdf::after {
    content: 'PDF';
    position: absolute;
    top: 0; right: 0;
    background: var(--vip-grad);
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 0 var(--radius-sm) 0 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.chapter-item.pdf:hover {
    background: var(--vip-grad);
    color: #fff;
    border-color: transparent;
}
.chapter-item.pdf:hover::after {
    background: rgba(255,255,255,0.25);
}

/* ============================================================
 * 排行榜页面
 * ============================================================ */
.rank-full-list { padding: 4px 0; }
.rank-full-item {
    display: flex; align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-light);
    transition: all .25s cubic-bezier(.4,.0,.2,1);
    border-radius: var(--radius-sm);
    position: relative;
}
.rank-full-item:hover {
    background: var(--primary-softer);
    padding-left: 16px;
    padding-right: 16px;
}
.rank-full-item:hover .rank-full-title { color: var(--primary); }
.rank-full-item:hover .rank-cover img { transform: scale(1.05); }
.rank-full-item:last-child { border-bottom: 0; }

.rank-full-item .rank-num {
    width: 44px; height: 44px;
    line-height: 44px;
    font-size: 18px;
    margin-right: 18px;
    flex-shrink: 0;
    border-radius: 12px;
}
.rank-cover {
    width: 60px; height: 84px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--primary-softer);
    margin-right: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.rank-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s cubic-bezier(.4,.0,.2,1);
}
.rank-detail { flex: 1; min-width: 0; }
.rank-full-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    transition: color .2s;
}
.rank-detail .text-tip i { color: #FFB800; margin-right: 2px; }
.rank-detail .text-tip .ml-16 i { color: var(--primary); }

.rank-score {
    text-align: right;
    width: 100px;
    flex-shrink: 0;
}
.rank-score-val {
    font-size: 24px;
    font-weight: 800;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    font-family: -apple-system, "Helvetica Neue", sans-serif;
    letter-spacing: -0.5px;
}
.rank-score-label {
    font-size: 12px;
    color: var(--text-tip);
    margin-top: 2px;
}
.ml-16 { margin-left: 16px; }

/* 排行榜前三名特殊处理 */
.rank-full-item:nth-child(1) {
    background: linear-gradient(90deg, rgba(255,216,111,0.10), transparent 60%);
}
.rank-full-item:nth-child(2) {
    background: linear-gradient(90deg, rgba(192,192,192,0.10), transparent 60%);
}
.rank-full-item:nth-child(3) {
    background: linear-gradient(90deg, rgba(232,166,107,0.10), transparent 60%);
}
.rank-full-item:nth-child(1):hover,
.rank-full-item:nth-child(2):hover,
.rank-full-item:nth-child(3):hover {
    background: var(--primary-softer);
}

/* ============================================================
 * 搜索结果页
 * ============================================================ */
.search-hl {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-softer);
    padding: 1px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

/* ============================================================
 * 404 页
 * ============================================================ */
.notfound-wrapper {
    text-align: center;
    padding: 80px 0 100px;
    position: relative;
}
.notfound-wrapper::before {
    content: '';
    position: absolute;
    top: 40px; left: 50%;
    transform: translateX(-50%);
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(251,100,173,0.10), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.notfound-code {
    font-size: 160px;
    font-weight: 900;
    line-height: 1;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -8px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}
.notfound-msg {
    font-size: 20px;
    color: var(--text-sub);
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}
.notfound-msg .fa {
    color: var(--primary);
    margin-right: 8px;
}
.notfound-wrapper .btn {
    position: relative;
    z-index: 1;
}
