/* =========================================================
 * 移动端适配样式（全站统一）
 * 说明：
 * 1. 本文件在所有页面最后引入，只覆盖移动端表现；
 * 2. 汉堡按钮 / 抽屉 / 遮罩为新增元素，桌面端默认隐藏，
 *    不影响任何现有桌面布局；
 * 3. 所有对现有样式的覆盖均包在 @media (max-width: 768px)
 *    及 @media (max-width: 480px) 内，桌面端零变化。
 * ========================================================= */

/* ---------- 移动端导航组件（新增元素，桌面默认隐藏） ---------- */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 6px;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    transition: background .2s ease;
}
.mobile-menu-btn:active {
    background: rgba(255, 255, 255, .28);
}
.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform .3s ease, opacity .3s ease;
}
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 遮罩层 */
.mobile-nav-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 998;
}
.mobile-nav-mask.show {
    opacity: 1;
    visibility: visible;
}

/* 左侧抽屉菜单 */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    background: #fff;
    box-shadow: 4px 0 16px rgba(0, 0, 0, .18);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .3s ease, visibility .3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.mobile-nav.open {
    transform: translateX(0);
    visibility: visible;
}
.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 20px;
    height: 56px;
    background: #00A5FF;
    color: #fff;
    flex-shrink: 0;
}
.mobile-nav-title {
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 1px;
}
.mobile-nav-close {
    width: 40px;
    height: 56px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mobile-nav-close:active {
    opacity: .7;
}
.mobile-nav-list {
    flex: 1;
    padding: 6px 0;
}
.mobile-nav-list li {
    border-bottom: 1px solid #f0f3f6;
}
.mobile-nav-list li a {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    color: #333;
    transition: background .15s ease, color .15s ease;
}
.mobile-nav-list li a:active {
    background: #e9f6ff;
    color: #00A5FF;
}
.mobile-nav-foot {
    padding: 14px 20px 18px;
    border-top: 1px solid #f0f3f6;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}
.mobile-nav-foot .label {
    color: #00A5FF;
    font-weight: bold;
    margin-bottom: 2px;
}
.mobile-nav-foot .mail {
    color: #666;
    word-break: break-all;
}

/* =========================================================
 * 768px 以下：平板竖屏 / 手机
 * ========================================================= */
@media (max-width: 768px) {

    /* ---------- 全局流式化 ---------- */
    html, body {
        min-width: 0 !important;
        width: 100%;
        overflow-x: hidden;
    }
    body {
        font-size: 14px;
    }
    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        padding: 0 12px;
        box-sizing: border-box;
    }
    /* 各页卡片容器左右留 12px 间距 */
    .letter-container,
    .detail-container {
        margin: 16px 12px;
        padding: 16px;
    }
    .consult-container,
    .center-container,
    .list-container {
        margin: 16px 12px;
        padding: 0;
    }
    .breadcrumb-bar .bc-inner {
        padding: 8px 12px;
        font-size: 12px;
    }
    #slide {
        min-width: 0;
    }

    /* ---------- 头部 ---------- */
    .header {
        height: auto !important;
        min-height: 0 !important;
        padding: 10px 0;
    }
    .header .container {
        align-items: center;
    }
    .header .logo img {
        height: 34px;
        width: auto;
    }
    .header .headerTel {
        font-size: 12px;
        font-weight: normal;
        padding-right: 0;
    }
    .header .headerTel img {
        width: 24px;
        height: 24px;
    }
    .header .headerTel div {
        padding-left: 6px;
    }
    .header .headerTel p {
        font-size: 11px;
    }

    /* 隐藏横向导航，显示汉堡按钮 */
    .nav-bg {
        display: none;
    }
    .mobile-menu-btn {
        display: inline-flex;
        margin-right: 10px;
    }
    .header .logo {
        margin-right: auto;
    }

    /* ---------- 首页 ---------- */
    .mainbox {
        padding: 0 12px;
    }
    /* 功能菜单改 3 列网格 */
    .fun {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin: 0px 0 0;
        padding: 16px 10px;
        border-radius: 12px;
    }
    .fun li {
        margin: 0;
        height: 80px;
        border-radius: 8px;
    }
    .fun li a {
        flex-direction: column;
        font-size: 14px;
        gap: 4px;
    }
    .fun li i {
        width: 30px;
        height: 30px;
    }
    .fun li p {
        padding-left: 0;
    }
    .fun li p span:nth-child(1) {
        font-size: 14px;
    }
    /* 主区域改纵向排列 */
    .main1 {
        flex-direction: column;
    }
    .consult {
        width: 100%;
        padding-right: 0;
    }
    .side {
        padding-left: 0;
    }
    /* 搜索框不溢出 */
    .consult .title {
        height: auto;
        line-height: 1.4;
    }
    .consult .title .rt {
        float: none;
        margin-top: 8px;
    }
    .search {
        max-width: 100%;
    }
    .search input[type='text'] {
        width: 100%;
        max-width: 100%;
        padding-right: 60px;
    }
    /* 首页列表列宽压缩 */
    .context .head,
    .infoList li {
        font-size: 13px;
    }
    .context .head span,
    .infoList li span {
        padding: 0 6px;
    }
    .context .head span:first-of-type,
    .infoList li span:first-of-type {
        min-width: 40px;
    }
    .context .head span:nth-of-type(3),
    .infoList li span:nth-of-type(3) {
        min-width: 96px;
    }
    .context .head span:nth-of-type(4),
    .infoList li span:nth-of-type(4) {
        min-width: 60px;
    }
    .context .head span:nth-of-type(5),
    .infoList li span:nth-of-type(5) {
        min-width: 76px;
    }
    .infoList li span:last-of-type:before {
        left: 8px;
    }
    /* 统计区域允许换行（本身 flex-wrap，收窄即可） */
    .stats-item {
        padding: 6px 0;
    }
    /* 底部 */
    .ft {
        height: auto;
        line-height: 1.8;
        padding: 8px 0;
        white-space: normal;
    }
    .ft-ul {
        width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }
    .ft .float-left,
    .ft .float-right {
        float: none;
        display: block;
    }

    /* ---------- 表单页（submit / user_center） ---------- */
    .letter-form {
        padding: 16px;
    }
    .letter-header,
    .consult-header {
        padding: 14px 16px;
    }
    .letter-header h2,
    .consult-header h2 {
        font-size: 17px;
    }
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    .form-row .form-label,
    .form-label,
    .captcha-row .form-label {
        width: auto !important;
        text-align: left !important;
        padding: 0 0 6px;
        flex-shrink: 1;
    }
    .form-row .form-content,
    .form-row .form-control {
        flex-wrap: wrap;
    }
    .form-row .form-control input {
        min-width: 0;
    }
    .captcha-input {
        flex: 1;
        width: auto;
        min-width: 0;
    }
    .captcha-img {
        flex-shrink: 0;
    }
    /* 按钮全宽 */
    .btn-row {
        flex-direction: column;
    }
    .btn-row .btn {
        width: 100%;
    }
    .verify-form {
        max-width: none;
    }
    .form-actions {
        padding-left: 0;
    }
    .form-actions .btn {
        width: 100%;
    }
    .verify-card {
        padding: 20px 16px;
    }
    .verified-bar {
        padding: 12px 16px;
        font-size: 13px;
    }

    /* ---------- 列表页 ---------- */
    .card-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }
    .card-header .card-title {
        font-size: 17px;
    }
    .card-header .search-wrap {
        width: 100%;
    }
    .search-box {
        flex: 1;
    }
    .search-box input[type='text'] {
        width: 100%;
    }
    .table-header {
        padding: 0 12px !important;
        margin: 0 12px;
        height: 40px;
        line-height: 40px;
        font-size: 13px;
    }
    .table-body {
        padding: 0 12px;
    }
    .table-row {
        height: 44px;
        line-height: 44px;
        font-size: 13px;
    }
    /* 固定列适当收窄，标题列可收缩省略 */
    .table-header .col-code,
    .table-row .col-code {
        width: 100px;
    }
    .table-header .col-type,
    .table-row .col-type {
        width: 64px;
    }
    .table-header .col-date,
    .table-row .col-date {
        width: 92px;
    }
    .table-header .col-name,
    .table-row .col-name {
        width: 64px;
    }
    .table-header .col-status,
    .table-row .col-status {
        width: 64px;
    }
    .table-header .col-title,
    .table-row .col-title {
        min-width: 0;
    }
    /* 分页允许换行 */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }
    .page-btns {
        flex-wrap: wrap;
    }
    #pagercontainer > div {
        flex-wrap: wrap;
        height: auto;
    }

    /* ---------- 详情页 ---------- */
    .detail-header h2 {
        font-size: 17px;
    }
    .detail-info {
        gap: 10px;
        font-size: 13px;
    }
    .detail-content {
        padding: 12px 0;
        font-size: 14px;
    }
    .pdf-viewer {
        width: 100%;
        min-height: 320px;
    }

    /* ---------- 业务咨询页 ---------- */
    .consult-body {
        padding: 24px 16px;
        min-height: 200px;
    }

    /* ---------- 弹窗 ---------- */
    .reminder {
        width: 92%;
    }
}

/* =========================================================
 * 480px 以下：小屏手机，隐藏次要列
 * ========================================================= */
@media (max-width: 480px) {

    /* 表格隐藏序号列和日期列 */
    .table-header .col-no,
    .table-row .col-no,
    .table-header .col-date,
    .table-row .col-date {
        display: none;
    }
    /* 首页列表隐藏咨询时间列 */
    .context .head span:nth-of-type(3),
    .infoList li span:nth-of-type(3) {
        display: none;
    }
    /* 服务邮箱只保留图标 + “服务邮箱”小号字（隐藏邮箱地址裸文本，防止 360px 溢出） */
    .header .logo img {
        height: 30px;
    }
    .header .headerTel div {
        font-size: 0;
    }
    .header .headerTel p {
        display: block;
        font-size: 11px;
    }
    .fun li a {
        font-size: 13px;
    }
    .fun li p span:nth-child(1) {
        font-size: 13px;
    }
}
