/* 导航栏 - 移动端优先 */
header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    flex-wrap: wrap;
    gap: 10px;
}
.logo {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.logo::before {
    content: "✨";
    font-size: 20px;
    animation: sparkle 2s infinite alternate;
}
@keyframes sparkle {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}
.nav-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.nav-btn {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #e879f9, #6366f1);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(232, 121, 249, 0.2);
    min-width: 120px;
    justify-content: center;
}
.nav-btn:hover {
    background: linear-gradient(135deg, #d946ef, #4f46e5);
    transform: translateY(-1px);
}

/* 阅读主容器 */
.read-container {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 阅读头部 */
.read-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 15px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    gap: 15px;
}
.chapter-info {
    font-size: 17px;
    font-weight: bold;
    color: #1e293b;
    text-align: center;
    line-height: 1.4;
}

/* 核心：自定义下拉框样式（完全替代原生select） */
.custom-select-wrap {
    width: 100%;
    max-width: 280px;
    position: relative; /* 相对定位，用于下拉面板绝对定位 */
}
/* 下拉触发按钮（替代原生select框） */
.custom-select-trigger {
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 15px;
    color: #475569;
    cursor: pointer;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}
.custom-select-trigger:hover {
    border-color: #e879f9;
    box-shadow: 0 0 8px rgba(232, 121, 249, 0.15);
    transform: translateY(-1px);
}
.custom-select-trigger:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}
/* 下拉箭头 */
.select-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}
/* 箭头旋转（展开状态） */
.custom-select-wrap.open .select-arrow {
    transform: rotate(180deg);
}
/* 下拉面板（替代原生option列表） */
.custom-select-panel {
    position: absolute;
    top: calc(100% + 8px); /* 触发框下方8px */
    left: 0;
    width: 100%; /* 和触发框宽度完全一致 */
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 999;
    transition: max-height 0.3s ease;
}
/* 面板展开 */
.custom-select-wrap.open .custom-select-panel {
    max-height: 300px; /* 最大高度，超出滚动 */
    overflow-y: auto;
}
/* 下拉选项（替代原生option） */
.custom-select-option {
    padding: 12px 15px;
    font-size: 15px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}
/* 选中状态 */
.custom-select-option.active {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #6366f1;
    font-weight: 500;
}
/* 悬浮状态 */
.custom-select-option:hover:not(.active) {
    background: #f8fafc;
    color: #e879f9;
}

/* 阅读内容区 */
.read-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 10px 0;
}
.comic-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}
.comic-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
    display: block;
    object-fit: contain;
    max-height: auto;
}
.comic-img:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
@media (max-width: 480px) { 
    header {
        height: auto;
    }
    footer {
        height: 210px;
    }
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    .logo {
        width: 100%;
        justify-content: center;
    }
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    .search-box {
        width: 100%;
        justify-content: center;
    }
    .search-box input {
        width: 100%;
        max-width: 300px;
    }
}

/* 大屏适配 */
@media (min-width: 768px) {
    .nav-container {
        /* height: 70px; */
        flex-wrap: nowrap;
        padding: 0 20px;
        gap: 0;
    }
    /* .logo {
        font-size: 20px;
    } */
    /* .logo::before {
        font-size: 18px;
    } */
    .nav-actions {
        gap: 15px;
    }
    .read-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 20px 25px;
        gap: 20px;
    }
    .chapter-info {
        text-align: left;
        font-size: 18px;
        flex: 1;
    }
    .custom-select-wrap {
        max-width: 220px;
        flex-shrink: 0;
    }
    .comic-content {
        gap: 15px;
    }
    .comic-img {
        border-radius: 10px;
    }
}

@media (min-width: 1200px) {
    .read-container {
        margin: 20px auto;
    }
}