﻿/* 全局重置 - 绿色模块 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础页面样式 -  */
body {
    /*font-family: Arial, sans-serif;*/
    font-family: PingFang SC-Regular;
    background-color: #fff;
    color: #333;
}

a {
    text-decoration: none;
}

/************************************************************/

/* 头部导航 */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #242426; /* 深色背景 */
    padding: 0; /* 容器内控制间距 */
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px; /* 与 main 容器对齐 */
    margin: 0 auto;
    padding: 0 20px;
    height: 77px; /* 固定头部高度 */
}

/* 左侧 logo（手机端隐藏） */
.header-logo {
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

    .header-logo img {
        height: 36px;
        margin-right: 8px;
    }

/* 中间导航（手机端隐藏） */
.header-nav a {
    color: #ccc;
    text-decoration: none;
    margin: 0 18px;
    font-size: 20px;
    transition: color 0.3s;
}

    .header-nav a:hover {
        color: #fff;
    }

/* 右侧搜索框 - 核心优化 */
.search-wrapper {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 6px 12px;
    border: none;
    border-radius: 20px 0 0 20px; /* 左侧圆角 */
    outline: none;
    font-size: 14px;
    background-color: #fff;
    width: 240px; /* 搜索框宽度 */
}

    .search-input::placeholder {
        color: #999;
    }

.search-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 0 20px 20px 0; /* 右侧圆角 */
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .search-btn:hover {
        background-color: #444;
    }

    .search-btn svg {
        width: 16px;
        height: 13px;
        fill: #999;
        transition: fill 0.3s;
    }

    .search-btn:hover svg {
        fill: #fff;
    }

/* 搜索结果标题 */
.search-result-title {
    font-size: 14px;
    color: #00bfa5;
    margin: 20px 0;
}


/*********************************************************************************/

/* 主要内容区域 -  */
main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    min-height: 700px;
}


.comic-list {
    display: grid;
    /*grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));*/
    grid-template-columns: repeat(6, minmax(120px, 1fr)); /* 每行6列 */
    gap: 20px;
}


/* 漫画卡片通用样式 -  */
.comic-item {
    text-decoration: none;
    color: #333;
    display: block;
}

.comic-item img {
    width: 100%;
    height: 249px;
    border-radius: 12px;
    margin-bottom: 8px;
    object-fit: cover;        
}

.comic-item span {
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
}

.comic-title {
    color: #333333;
    white-space: nowrap; /* 禁止换行 */
    overflow: hidden; /* 溢出内容隐藏 */
    text-overflow: ellipsis; /* 溢出内容用省略号表示 */
    /*width: 50px;*/ /* 必须设置宽度 */
}

.comic-type {
    font-size: 14px;
    text-align: center;
    line-height: 1.4;
    color: #999999;
    white-space: nowrap; /* 禁止换行 */
    overflow: hidden; /* 溢出内容隐藏 */
    text-overflow: ellipsis; /* 溢出内容用省略号表示 */
    /*width: 50px;*/ /* 必须设置宽度 */
}

/* 底部样式 -  */
footer {
    text-align: center;
    padding: 10px 0;
    background-color: #191E22;
    font-size: 14px;
    color: #E4E4E4;
    margin-top: 70px;
    height: 118px;
    min-height: 80px; /* 设置最小高度 */
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    line-height: 1.6;
}

    footer a {
        color: #fff;
    }

.footer-content {
    width: 100%;
}

/*********************************************************************************/

/* 响应式适配  手机端显示 */
@media (max-width: 768px) {
    header {
        background-color: #fff; /* 白色背景 */
    }

    /* 手机端隐藏 logo 和导航 */
    .header-logo, .header-nav, footer {
        display: none;
    }

    main {
        margin-top: -20px;
    }

    .search-wrapper {
        margin-top: 0px;
    }
    /* 搜索框宽度自适应，铺满可用空间 */
    .search-input {
        width: calc(100% - 50px); /* 预留按钮宽度 */
        color: #333;
    }

    .search-input, .search-btn {
        background: #F2F2F2;
    }
}

/*********************************************************************************/


/* 响应式适配    一行显示几个 */
@media (max-width: 1200px) {
    .comic-list {
        grid-template-columns: repeat(6, minmax(100px, 1fr));
    }
}

@media (max-width: 992px) {
    .comic-list {
        grid-template-columns: repeat(5, minmax(100px, 1fr));
    }
}

@media (max-width: 768px) {
    .comic-list {
        grid-template-columns: repeat(4, minmax(100px, 1fr));
    }
}

@media (max-width: 576px) {
    .comic-list {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }
}

@media (max-width: 375px) {
    .comic-list {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }
}


/***************************************************************************************************************************/
/***************************************************************************************************************************/

/*搜索页*/
.result-tip {
    font-size: 14px;
    color: #999;
    margin-top: 30px;
    margin-bottom: 30px;
}


.comic-keywords {
    color: #34B8A4;
}

/*****************************************  组件  ****************************************/

/* 轮播图基础样式 */
.banner {
    max-width: 100%;
    margin: 20px auto;
    overflow: hidden;
    position: relative;
    display: flex; /* 新增：使用flex布局实现垂直居中 */
    align-items: center; /* 新增：垂直居中 */
    padding: 20px 0; /* 新增：上下内边距20px */
    background: #000;
    margin-top: 0px;
}

.banner-slide {
    display: flex;
    width: max-content;
    transition: transform 0.5s ease-in-out;
}

.banner-item {
    width: 755px;
    height: 425px;
    padding: 0 10px;
    flex-shrink: 0;
}

    .banner-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

.banner-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}



/***************************/

/** 右侧悬浮窗 */

.float-widget {
    position: fixed;
    right: 125px;
    top: 72%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 999;
    /* 外层容器样式 */
    padding: 6px;
    border: 1px solid #ddd; /* 边框 */
    border-radius: 8px; /* 圆角 */
    box-shadow: 0 2px 12px rgba(0,0,0,0.1); /* 阴影 */
    background-color: #fff; /* 白色背景 */    
}

    .float-widget img {
        width: 100px;
        height: auto;
        /*margin-bottom: 10px;*/
        margin-bottom: 8px; /* 调整间距 */
        cursor: pointer;
    }

    .float-widget .text {
        text-align: center;
        color: #9B9B9B;
        font-size: 12px;
        line-height: 1.4;
    }

/***************************/

/* 手机端底部弹窗 */
.mobile-bottom-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8); /* 半透明背景 */
    color: #9B9B9B;
    padding: 12px 20px;
    box-sizing: border-box;
    display: none; /* 默认隐藏 */
    justify-content: space-between;
    align-items: center;
    z-index: 1000; /* 确保层级高于其他内容 */
}

.mobile-bottom-popup span.title {
    color: #E5E4E3;
    font-size: 14px;
}

.mobile-bottom-popup .content {
    display: flex;
    align-items: center;
}

.mobile-bottom-popup .content img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.mobile-bottom-popup .content .text {
    font-size: 12px;
    line-height: 1.4;
}

.mobile-bottom-popup .close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    font-family: 宋体;
    font-weight: lighter;
    border: 1px dotted #999;
    /*调整关闭按钮的位置*/
    position: relative;
    top: -10px;
    right: -6px;
}

/***************************/

.section-title {
    font-size: 24px;
    font-weight: bold;
    margin: 40px 0 20px;
}


/***************************/


@media (max-width: 1024px) {
    .banner-item {
        width: 33.333vw;
        height: 18.75vw;
        padding: 0 5px;
    }
}

@media (max-width: 768px) {
    .banner-item {
        width: 50vw;
        height: 28.125vw;
    }
    .float-widget {
        display: none;
    }
    .comic-item img {
        height: 140px;
    }
    .mobile-bottom-popup {
        display: flex;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 16px;
        margin: 20px 0 10px;
    }

    .banner {
        margin-bottom: 50px;
        padding: 0;
        background: none;
    }

    .banner-item {
        width: 100vw;
        /*height: 56.25vw;*/
        height: 26.25vw;
        padding: 0 2px;
    }
}
