/* 响应式首页样式 - 覆盖原有样式 */
html {
    font-size: 16px;
}

.p-index {
    background-color: #f5f5f5 !important;
    overflow-x: hidden;
}

.p-index * {
    box-sizing: border-box;
}

/* 隐藏原有的布局元素 */
.p-index .in-banner,
.p-index .in-nav,
.p-index .in-sec-wr,
.p-index .in-fine,
.p-index .in-ad,
.p-index .in-rank-box,
.p-index .recent-wr {
    display: none !important;
}

/* 主容器 */
.p-index .main-container {
    max-width: 1200px !important;
    margin: 0 auto 0 !important;
    padding: 0 20px !important;
    width: 100% !important;
}

/* 区块标题 */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff620e;
}

.section-title h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.more-link {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.more-link:hover {
    color: #ff620e;
}

/* 推荐区域样式 */
.section-recommended {
    margin-bottom: 40px;
}

.section-recommended .section-title {
    border-bottom-color: #ff620e;
}

.section-recommended .section-title h2 {
    color: #ff620e;
}

.recommended-tag {
    background: linear-gradient(135deg, #ff620e 0%, #ff8c42 100%) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 98, 14, 0.3);
}

/* 漫画网格布局 */
.comic-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 40px !important;
    width: 100% !important;
}

/* 漫画卡片 */
.comic-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.comic-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.comic-cover {
    position: relative;
    width: 100%;
    padding-bottom: 133.33%;
    overflow: hidden;
    background: #eee;
}

.comic-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.comic-card:hover .comic-cover img {
    transform: scale(1.05);
}

.comic-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comic-title {
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 榜单区域 */
.section-ranking {
    margin-bottom: 40px;
}

/* 排行榜网格布局 */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 排行榜列 */
.ranking-column {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* 排行榜头部 */
.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f8f8;
    border-bottom: 2px solid #e0e0e0;
}

.ranking-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ranking-more {
    font-size: 13px;
    color: #ff620e;
    text-decoration: none;
    transition: opacity 0.3s;
}

.ranking-more:hover {
    opacity: 0.8;
}

/* 排行榜列表 */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: #f8f8f8;
}

/* 排名序号 */
.item-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #999;
    background: #f0f0f0;
    border-radius: 4px;
    margin-right: 10px;
}

.item-number.top {
    background: linear-gradient(135deg, #ff620e 0%, #ff8c42 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 98, 14, 0.3);
}

/* 内容容器 */
.item-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

/* 章节链接 */
.item-chapter-link {
    flex-shrink: 0;
    margin-right: 20px;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #ff620e;
    text-decoration: none;
    transition: opacity 0.3s;
}

.item-chapter-link:hover {
    opacity: 0.8;
}

/* 漫画标题链接 */
.item-title-link {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.item-title-link:hover {
    color: #ff620e;
}

/* 更新日期 */
.item-date {
    flex-shrink: 0;
    font-size: 12px;
    color: #999;
}

/* 友情链接 */
.section-links {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 40px;
}

.links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.link-item {
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    transition: all 0.3s;
}

.link-item:hover {
    background: #ff620e;
    color: #fff;
}

/* 响应式断点 */

/* 平板设备 */
@media screen and (max-width: 1024px) {
    .main-container {
        padding: 15px !important;
    }
    
    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .section-title h2 {
        font-size: 20px !important;
    }
    
    /* 排行榜改为2列 */
    .ranking-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 手机设备 */
@media screen and (max-width: 768px) {
    .main-container {
        margin-top: 60px !important;
        padding: 10px !important;
    }
    
    .section-title {
        margin-bottom: 15px !important;
    }
    
    .section-title h2 {
        font-size: 18px !important;
    }
    
    .more-link {
        font-size: 12px !important;
    }
    
    .comic-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 30px !important;
    }
    
    .comic-title {
        padding: 8px;
        font-size: 13px;
    }
    
    .comic-tag {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    /* 排行榜改为1列，只显示第一个 */
    .ranking-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .section-ranking .ranking-grid .ranking-column:nth-child(2),
    .section-ranking .ranking-grid .ranking-column:nth-child(3),
    .section-ranking .ranking-grid .ranking-column:nth-child(4) {
        display: none !important;
    }
    
    .ranking-header {
        padding: 12px 15px;
    }
    
    .ranking-title {
        font-size: 15px;
    }
    
    .ranking-item {
        padding: 10px 12px;
    }
    
    .item-number {
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 11px;
    }
    
    .item-name {
        font-size: 13px;
    }
    
    .item-date {
        font-size: 11px;
    }
    
    .section-links {
        padding: 15px;
    }
    
    .links-container {
        gap: 10px;
    }
    
    .link-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 小屏手机 */
@media screen and (max-width: 480px) {
    .comic-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .section-title h2 {
        font-size: 16px !important;
    }
    
    .comic-title {
        font-size: 12px !important;
        padding: 6px !important;
    }
}

/* 大屏设备优化 */
@media screen and (min-width: 1400px) {
    .comic-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 25px !important;
    }
}

/* 额外的移动端优化 */
@media screen and (max-width: 600px) {
    .main-container {
        padding: 8px !important;
        margin-top: 60px !important;
    }
    
    .section-title {
        padding: 0 5px !important;
    }
    
    .comic-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    .ranking-list {
        gap: 8px !important;
    }
    
    .section-ranking,
    .section-links {
        padding: 10px !important;
    }
}

/* 超小屏幕 */
@media screen and (max-width: 375px) {
    .comic-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    
    .comic-title {
        font-size: 11px !important;
        padding: 5px !important;
    }
}


/* 搜索页面样式 */
.search-header {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.search-keyword {
    color: #ff620e;
}

.search-count {
    font-size: 14px;
    color: #999;
}

.no-result {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 30px;
}

.no-result-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.no-result-text {
    font-size: 14px;
    color: #999;
}

/* VIP标识 */
.vip-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
    z-index: 2;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}


/* 夜间模式 */
body.dark-mode {
    background: #1a1a1a !important;
    color: #e0e0e0;
}

body.dark-mode .main-container {
    background: #1a1a1a;
}

body.dark-mode .section-recommended,
body.dark-mode .section-latest,
body.dark-mode .section-popular,
body.dark-mode .section-category {
    background: #1a1a1a;
}

body.dark-mode .section-title {
    color: #e0e0e0;
}

body.dark-mode .section-title::after {
    background: linear-gradient(90deg, #ff620e 0%, transparent 100%);
}

body.dark-mode .comic-card {
    background: #2a2a2a;
}

body.dark-mode .comic-card:hover {
    box-shadow: 0 4px 12px rgba(255, 98, 14, 0.3);
}

body.dark-mode .comic-title {
    color: #e0e0e0;
}

body.dark-mode .comic-meta {
    color: #999;
}

body.dark-mode .comic-status {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .category-card {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .category-card:hover {
    border-color: #ff620e;
}

body.dark-mode .category-name {
    color: #e0e0e0;
}

body.dark-mode .category-count {
    color: #999;
}

body.dark-mode .view-more {
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .view-more:hover {
    background: #ff620e;
    border-color: #ff620e;
}


body.dark-mode .ranking-grid {
    background: #1a1a1a;
}

body.dark-mode .ranking-column {
    background: #2a2a2a;
}

body.dark-mode .ranking-header {
    background: #333;
    border-bottom-color: #444;
}

body.dark-mode .ranking-title {
    color: #e0e0e0;
}

body.dark-mode .ranking-more {
    color: #ff620e;
}

body.dark-mode .ranking-list {
    background: #2a2a2a;
}

body.dark-mode .ranking-item {
    border-bottom-color: #444;
}

body.dark-mode .ranking-item:hover {
    background: #333;
}

body.dark-mode .item-number {
    background: #444;
    color: #e0e0e0;
}

body.dark-mode .item-number.top {
    background: linear-gradient(135deg, #ff620e 0%, #ff8c42 100%);
    color: #fff;
}

body.dark-mode .item-title-link {
    color: #e0e0e0;
}

body.dark-mode .item-title-link:hover {
    color: #ff620e;
}

body.dark-mode .item-chapter-link {
    color: #ff620e;
}

body.dark-mode .item-date {
    color: #999;
}

body.dark-mode .section-update,
body.dark-mode .section-new {
    background: #1a1a1a;
}

body.dark-mode .more-link {
    color: #999;
}

body.dark-mode .more-link:hover {
    color: #ff620e;
}

body.dark-mode .comic-tag {
    background: rgba(0, 0, 0, 0.7);
}


body.dark-mode .section-ranking {
    background: #1a1a1a;
}

body.dark-mode .section-links {
    background: #2a2a2a;
}

body.dark-mode .links-title {
    color: #e0e0e0;
    border-bottom-color: #444;
}

body.dark-mode .links-list a {
    color: #999;
}

body.dark-mode .links-list a:hover {
    color: #ff620e;
}


body.dark-mode.p-index {
    background: #1a1a1a !important;
}
