/* =======================================
   十五五建言项目样式文件
   CSS版本: 1.0.0
   最后更新: 2025-10-23
   ======================================= */

/* =======================================
   1. 全局样式
   ======================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =======================================
   6. 弹层组件样式
   ======================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: #fff;
    background-image: url('../images/model-bg.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 449px;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    border: 2px solid #e8d8c8;
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border: none;
    background-color: #d03b14;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background-color: #cc0000;
    transform: scale(1.1);
}

.modal-content {
    padding: 85px 30px 65px;
}

.modal-form-group {
    margin-bottom: 25px;
}

.modal-form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

/* 带图标的输入框容器 */
.input-with-icon {
    position: relative;
    width: 100%;
    /* 确保所有带图标的输入框容器样式一致 */
}

/* 输入框内的图标 */
.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 1;
}

/* 输入框样式 */
.modal-form-group input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #f3ad95;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.modal-form-group input:focus {
    outline: none;
    border-color: #b38662;
}

/* 禁用状态的电话输入框 */
.modal-form-group input#phone {
    color: #bcbcbc;
    background-color: #f5f5f5;
    cursor: not-allowed;
    pointer-events: none;
}
/* 验证码容器 */
.captcha-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-container .input-with-icon {
    flex: 1;
}

.captcha-image {
    width: 120px;
    height: 45px;
    background-color: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    letter-spacing: 5px;
    color: #666;
    text-align: center;
    overflow: hidden;
    background-image: url('../images/icon03.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 短信验证码容器 */
.sms-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sms-container .input-with-icon {
    flex: 1;
}

/* 短信验证码按钮 */
.btn-get-sms {
    width: 120px;
    height: 45px;
    background-color: #d03b14;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-get-sms:hover {
    background-color: #ca2e06;
}

.btn-get-sms:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 确认按钮 */
.btn-confirm {
    width: 129px;
    height: 44px;
    background-color: #d03b14;
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 30px auto 0;
    display: block;
}

.btn-confirm:hover {
    background-color: #ca2e06;
}

.btn-confirm:active {
    transform: translateY(1px);
}


/* =======================================
   2. 页面基础样式
   ======================================= */

body {
    font-family: 'PingFang SC', XHW-pzh, 'Lantinghei SC', 'Helvetica Neue',
        Helvetica, Arial, 'Microsoft YaHei', 微软雅黑, STHeitiSC-Light, simsun,
        宋体, 'WenQuanYi Zen Hei', 'WenQuanYi Micro Hei', sans-serif;
    color: #333;
    background-color: #fffefa;
    line-height: 1.6;
}

/* 页面容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* 添加内边距确保响应式布局 */
}

/* =======================================
   3. 页面结构组件
   ======================================= */

/* Banner组件 */
.banner {
    position: relative;
    background: url('../images/banner.png') no-repeat center top;
    height: 600px;
}

.banner-desktop {
    display: block;
    position: relative;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
}

/* Banner - 移动端 */
.banner-mobile {
    display: none; /* 默认隐藏，在媒体查询中显示 */
    position: relative;
    width: 100%;
}

.mobile-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* 二维码组件 */
.qrcode {
    position: absolute;
    right: 25px;
    bottom: 0;
}

.qrcode-img {
    width: 135px;
    height: 177px;
    display: block;
}

/* 主内容区域 */
.main {
    background: url('../images/content-bg.png') no-repeat top center;
}

/* 建议区域 */
.suggestion {
    margin-top: -32px; /* 负边距与Banner重叠 */
}

/* 简介区域 */
.intro-content {
    background: url('../images/intro-bg.png') no-repeat center center/100% 100%;
    padding: 45px 60px;
}

.intro p {
    font-size: 16px;
    line-height: 1.8;
    color: #aa4b32;
    margin: 0;
}

/* =======================================
   4. UI组件样式
   ======================================= */

/* 标题组件 */
.categories-title {
    background-color: #b38662; /* 统一使用十六进制颜色值 */
    width: 260px;
    height: 46px;
    color: #fff;
    border: none;
    font-size: 24px;
    line-height: 46px;
    cursor: pointer;
    border-radius: 23px;
    transition: background-color 0.3s;
    margin: 0 auto 60px;
    display: block;
    text-align: center;
}

.comments-title,
.form-title {
    margin-bottom: 30px;
}

.comments-title .mobile-img,
.form-title .mobile-img {
    display: none; /* 默认隐藏移动端标题图 */
}

.comments-title .desktop-img,
.form-title .desktop-img {
    display: block;
    width: 100%;
    margin: 0 auto;
}

/* 分类网格 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

/* 分类项 */
.category-item {
    background: url('../images/category-item.png') no-repeat center/100% 100%;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 105px;
    text-align: center;
    color: #aa4b32;
}

.category-item:hover {
    transform: translateY(-2px);
}

/* 高亮状态的分类项 */
.category-item.highlighted {
    background: url('../images/category-item-on.png') no-repeat center/100% 100%;
}

/* 分类图标 */
.category-icon {
    width: 22px;
    height: 19px;
    background: url('../images/category-icon.png') no-repeat center center/100% 100%;
    margin-right: 5px;
}

/* 分类文本 */
.category-text {
    font-size: 22px;
}

/* 高亮状态下的图标和文本 */
.category-item.highlighted .category-icon {
    background: url('../images/category-icon-on.png') no-repeat center center/100% 100%;
}

.category-item.highlighted .category-text {
    color: #fff;
}

/* =======================================
   5. 表单组件样式
   ======================================= */

/* 建言表单区域 */
.suggestion-form {
    background-color: #fff;
    padding: 60px 0;
}

.form-container {
    width: 100%;
}

.form-intro {
    font-size: 18px;
    color: #aa4a31;
    margin-bottom: 30px;
    text-align: center;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

/* 表单组基础样式 */
.form-group {
    margin-bottom: 20px;
}

/* 表单行中的表单组样式 */
.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

/* 调整工作单位输入框的宽度分配 */
.form-row .form-group:nth-child(2) {
    flex: 1.5;
}

/* 表单标签样式 */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* 表单行中的标签样式 */
.form-row .form-group label {
    display: inline-block;
    margin-right: 8px;
    min-width: 80px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 第一个form-group（姓名）的样式 */
.form-row .form-group:first-child label {
    min-width: 45px;
}

/* 必填项星号样式 */
.required {
    color: #ff0000;
}

/* 表单控件基础样式 */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

/* 表单行中的输入框样式 */
.form-row .form-group input {
    width: calc(100% - 80px);
    flex: 1;
}

/* 第一个form-group（姓名）的输入框宽度 */
.form-row .form-group:first-child input {
    width: calc(100% - 45px);
}

/* 表单控件聚焦样式 */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #996633;
}

/* 文本域特殊样式 */
.form-group textarea {
    resize: vertical;
    min-height: 120px;
    padding-bottom: 30px;
}

/* 字数统计样式 */
.word-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: -30px;
    margin-right: 10px;
}

/* 提交按钮样式 */
.btn-submit {
    background-color: #b38662;
    color: #fff;
    border: none;
    padding: 0px 48px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 23px;
    transition: background-color 0.3s;
    display: block;
    margin: 30px auto 0;
    line-height: 46px;
}

.btn-submit:hover {
    background-color: #a8131f;
}

/* 网民这么说区域样式 */
.comments {
    padding: 0px 0 60px;
}

.comments-container {
    width: 100%;
}

.comments-list {
    display: block;
}

.comment-item {
    position: relative;
    background-color: #fff;
    background-image: url('../images/comment-item.png');
    background-repeat: no-repeat;
    background-position: 100% -50px;
    padding: 75px 25px 25px 25px;
    margin-bottom: 15px;
    border: 1px solid #e8d8c8;
    width: 100%;
    display: block;
    transition: all 0.3s;
}

.comment-item:hover {
    box-shadow: none;
    transform: none;
}

.comment-category {
    position: absolute;
    left: -25px;
    top: 15px;
    font-size: 18px;
    color: #fff;
    background-color: rgb(179, 134, 98);
    display: inline-block;
    padding: 0px 35px;
    border-radius: 19px;
    height: 38px;
    line-height: 38px;
}
.comment-title {
    font-size: 20px;
    line-height: 1.8;
    font-weight: bold;
    color: #333;
}
.comment-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.comment-author {
    font-size: 14px;
    color: #999;
    margin-top: 10px;
}

/* 底部样式 */
.footer {
    background-color: #b38662;
    color: #fff;
    padding: 30px 0;
    text-align: center;
}

.footer-content {
    width: 100%;
}

.footer p {
    margin-bottom: 10px;
    font-size: 14px;
}

.footer p:last-child {
    margin-bottom: 0;
}

/* =======================================
   7. 分页组件样式
   ======================================= */

/* 分页容器 */
.pagination-container {
    text-align: center;
    margin-top: 30px;
}

/* 分页组件 */
.pagination-container .pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}

/* 分页按钮基础样式 (统一页码按钮和控制按钮的基础样式) */
.pagination-container .pagination .page-btn,
.pagination-container .pagination .page-control {
    padding: 5px 10px;
    border: 1px solid #b38662;
    color: #b38662;
    cursor: pointer;
    font-size: 12px;
    line-height: 16px;
    transition: all 0.2s ease;
}

/* 页码按钮当前页样式 */
.pagination-container .pagination .page-btn.active {
    background-color: #b38662;
    color: #fff;
    cursor: default;
}

/* 页码按钮加载状态样式 */
.pagination-container .pagination .page-btn.loading {
    background-color: #e0d2c3;
    color: #666;
    cursor: wait;
    opacity: 0.8;
}

/* 活动状态下的加载样式 */
.pagination-container .pagination .page-btn.active.loading {
    background-color: #a07754;
    color: #fff;
}

/* 控制按钮禁用状态 */
.pagination-container .pagination .page-control:disabled {
    background-color: #dedede;
    color: #999;
    border: 0;
    cursor: not-allowed;
}

/* 首页和尾页按钮样式 */
.pagination-container .pagination .first-btn,
.pagination-container .pagination .last-btn {
    min-width: 50px; /* 确保按钮宽度足够显示文字 */
}

/* 页码省略号样式 */
.pagination-container .pagination .page-ellipsis {
    color: #b38662;
    font-size: 14px;
    padding: 0 5px;
    cursor: default;
}

/* 页码信息样式 */
.pagination-container .pagination .page-info {
    font-size: 12px;
    line-height: 16px;
    color: #666;
}
/* =======================================
   8. 响应式设计
   ======================================= */

/* 平板设备 (max-width: 1024px) */
@media (max-width: 1024px) {
    /* 内容区域背景 */
    .main {
        background: url('../images/content-bg-mb.png') no-repeat top center;
        background-size: 100% auto;
    }

    /* Banner样式调整 */
    .banner {
        background: none;
        height: auto;
    }

    .banner-desktop {
        display: none;
    }

    .banner-mobile {
        display: block;
    }

    /* 容器内边距调整 */
    .container {
        padding: 0 30px;
    }

    /* 分类标题和网格调整 */
    .suggestion{
        margin-top: 30px;
    }
    .categories-title {
        margin-bottom: 25px;
    }

    /* 分类容器样式 - 修改为flex布局，与768px保持一致 */
    .categories-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center; /* 水平居中 */
        align-items: center; /* 垂直居中 */
        gap: 15px;
        margin-bottom: 0;
    }

    .category-item {
        flex: 0 1 calc(50% - 7.5px); /* 保持大约两列布局，考虑gap */
        padding: 12px 15px;
        min-height: 100px;
        box-sizing: border-box;
        max-width: calc(50% - 7.5px); /* 确保不会超过容器宽度的一半 */
    }
    
    /* 确保最后一个分类项在1024px断点下也能正确显示 - 与768px保持一致 */
    .category-item:last-child {
        flex: 0 1 calc(50% - 7.5px);
        margin: 0 auto;
        max-width: calc(50% - 7.5px);
    }

    /* 评论项样式调整 */
    .comment-item {
        padding: 55px 10px 10px 10px;
    }

    .comment-category {
        font-size: 16px;
        left: 0;
        top: 10px;
        border-radius: 0 19px 19px 0;
        padding-left: 12px;
    }
    .comment-title {
        font-size: 18px;
    }
    .comment-content{
        font-size: 14px;
    }
}

/* 中小屏幕设备 (max-width: 768px) */
@media (max-width: 768px) {
    /* 容器内边距调整 */
    .container {
        padding: 0 15px;
    }

    /* 分类容器样式 - 修改为flex布局 */
    .categories-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center; /* 水平居中 */
        align-items: center; /* 垂直居中 */
        gap: 15px;
    }

    .category-item {
        flex: 0 1 calc(50% - 7.5px); /* 保持大约两列布局，考虑gap */
        padding: 12px 15px;
        min-height: 100px;
        box-sizing: border-box;
        max-width: calc(50% - 7.5px); /* 确保不会超过容器宽度的一半 */
    }
    /* 移动端分页组件样式 */
    .pagination-container .pagination {
        gap: 5px; 
        align-items: center;
        display: flex;
    }
    .pagination-container .pagination .page-numbers {
        font-size: 0;
        display: flex;
        gap: 5px;
    }
    
    /* 移动端分页按钮样式 - 统一所有按钮样式 */
    .pagination-container .pagination .page-btn,
    .pagination-container .pagination .page-control {
        padding: 0px 6px;
        font-size: 12px;
        line-height: 14px;
        margin-left: 5px;
        margin-right: 5px;
        height: 25px;
        min-width: 20px;
        margin: 0;
    }
    
    /* 移动端首页和尾页按钮 */
    .pagination-container .pagination .first-btn,
    .pagination-container .pagination .last-btn {
        min-width: 36px;
        font-size: 12px;
    }
    
    /* 移动端页码信息 */
    .pagination-container .pagination .page-info {
        font-size: 10px;
        margin-left: 5px;
        color: #666;
    }

    /* 分类项内部样式 */
    .category-item {
        padding: 15px;
    }

    .category-text {
        font-size: 13px;
    }

    /* 简介区域样式 */
    .intro {
        padding: 20px 0;
    }

    .intro-content {
        background: url('../images/intro-bg-mb.png') no-repeat center
            center/100% 100%;
        padding: 35px;
    }

    .intro p {
        font-size: 16px;
    }

    /* 标题样式 */
    .categories-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .suggestion{
        margin-top: 0px;
    }
    .suggestion-categories,
    .suggestion-form{
        padding: 15px 0;
    }
    .comments {
        padding: 30px 0;
    }

    .comments-title,
    .form-title {
        margin-bottom: 15px;
    }
    .form-intro{
        margin-bottom: 15px;
    }
    /* 标题图片响应式调整 */
    .comments-title .desktop-img,
    .form-title .desktop-img {
        display: none;
    }

    .comments-title .mobile-img,
    .form-title .mobile-img {
        display: block;
        width: 100%;
        margin: 0 auto;
    }

    /* 表单样式调整 */
    .form-intro {
        font-size: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    /* 表单控件样式 */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 8px;
    }

    /* 提交按钮样式 */
    .btn-submit {
        font-size: 14px;
    }

    /* 确保所有input宽100% */
    .form-group input {
        width: 100% !important;
    }

    /* 表单组垂直排列 */
    .form-row .form-group {
        flex-direction: column;
        align-items: flex-start;
        flex: 1 !important;
    }

    .form-row .form-group label,
    .form-row .form-group:first-child label {
        display: block;
        min-width: auto;
        margin-bottom: 5px;
    }

    .form-row .form-group input {
        width: 100%;
        flex: none;
    }

    /* 评论内容样式 */
    /* .comment-content {
        font-size: 16px;
    } */

    /* 底部样式 */
    .footer {
        padding: 20px 0;
    }

    .footer p {
        font-size: 11px;
    }
}

/* 小手机设备 (max-width: 480px) */
@media (max-width: 480px) {
    /* 容器内边距调整 */
    .container {
        padding: 0 10px;
    }

    /* 表单行样式 */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    /* 表单组垂直排列 */
    .form-row .form-group {
        flex-direction: column;
        align-items: flex-start;
        flex: 1 !important; /* 在移动端重置flex比例 */
    }

    /* 表单标签样式 */
    .form-row .form-group label,
    .form-row .form-group:first-child label {
        display: block;
        min-width: auto;
        margin-bottom: 5px;
    }

    /* 表单输入框样式 */
    .form-row .form-group input {
        width: 100%;
        flex: none;
    }

    /* 确保所有input宽100% */
    .form-group input {
        width: 100% !important;
    }

    /* 分类网格样式 - 精简优化 */
    .categories-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    /* 分类项样式 - 精简优化 */
    .category-item {
        flex: 0 1 calc(50% - 5px); /* 两列布局，考虑gap */
        min-height: 60px;
        padding: 10px 0;
        box-sizing: border-box;
        max-width: calc(50% - 5px);
    }

    /* 分类图标和文本样式 */
    .category-icon {
        width: 14px;
        height: 12px;
    }

    .category-text {
        max-width: 150px;
        text-align: left;
    }
    
    /* 弹层组件响应式设计 */
    .modal-container {
        width: 95%;
        max-height: 90vh;
        margin: 0 10px;
    }

    .modal-content {
        padding: 50px 20px 25px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 25px;
        height: 25px;
        font-size: 20px;
    }

    .modal-form-group {
        margin-bottom: 15px;
    }

    .modal-form-group input {
        padding: 10px 12px 10px 40px;
        font-size: 14px;
    }

    .input-icon {
        width: 18px;
        height: 18px;
        left: 10px;
    }

    .captcha-container,
    .sms-container {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .captcha-image,
    .btn-get-sms {
        flex: 1;
        width: auto;
    }
    
    .captcha-container .input-with-icon,
    .sms-container .input-with-icon {
        flex: 2;
    }

    .btn-confirm {
        height: 44px;
        font-size: 16px;
        margin-top: 25px;
    }
}
