/* 后台管理 - 移动端响应式样式 */

/* 汉堡菜单按钮 - 仅移动端显示 */
.admin-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* 遮罩层 */
.admin-nav-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}
.admin-nav-mask.show { display: block; }

/* 后台侧边栏 - 全局优化 */
.admin-side {
    overflow-x: hidden !important;
}
.admin-side .layui-nav {
    width: 100%;
    overflow: hidden;
}
/* 侧边栏菜单项分割线 */
.admin-side .layui-nav .layui-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.admin-side .layui-nav .layui-nav-item:last-child {
    border-bottom: none;
}

/* 后台表格 - 全局不换行，横向滚动 */
.admin-body {
    overflow-x: auto;
}
.admin-body .layui-table th,
.admin-body .layui-table td {
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* 汉堡按钮 */
    .admin-nav-toggle { display: block; }

    /* 侧边栏 - 移动端默认隐藏，通过JS添加show类显示 */
    .admin-side {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 999;
    }
    .admin-side.show {
        transform: translateX(0);
    }

    /* 顶栏 */
    .admin-header {
        left: 0;
        padding: 0 15px;
    }
    .admin-header .breadcrumb {
        font-size: 14px;
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .admin-header .user-info span { display: none; }

    /* 主体 */
    .admin-body {
        margin-left: 0;
        padding: 15px 12px;
    }

    /* 表格横向滚动 */
    .admin-body .layui-table {
        min-width: 600px;
    }

    /* 工具栏 */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-form {
        flex-direction: column;
        gap: 8px;
    }
    .filter-form .layui-input,
    .filter-form select {
        width: 100% !important;
        height: 36px;
    }
    .filter-form .layui-btn {
        width: 100%;
    }

    /* 模态框全屏化 */
    .layui-layer {
        /* 让layui弹窗更宽 */
    }

    /* 设置页面 */
    .setting-section .layui-form-label {
        width: 90px !important;
        font-size: 13px;
    }
    .setting-section .layui-input-block {
        margin-left: 100px !important;
    }
    .setting-section .layui-input,
    .setting-section .layui-textarea {
        max-width: 100% !important;
    }

    /* 密码修改页 */
    .pwd-box {
        width: 100% !important;
        max-width: 400px;
    }

    /* 登录页 */
    .login-box {
        width: 90% !important;
        max-width: 400px;
    }

    /* 仪表盘 */
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .dashboard-cards .dash-card {
        padding: 16px;
    }
    .dash-card .dash-value {
        font-size: 20px;
    }
    .dash-card .dash-icon {
        font-size: 28px;
    }
    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    /* 已售页面统计卡片 */
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* 域名表单 - 模态框内 */
    #domainFormHtml .layui-form-label {
        width: 90px !important;
    }
    #domainFormHtml .layui-input-block {
        margin-left: 100px !important;
    }

    /* 注册商表单 */
    #registrarFormHtml .layui-form-label {
        width: 100px !important;
    }
    #registrarFormHtml .layui-input-block {
        margin-left: 110px !important;
    }
}

@media (max-width: 480px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    .stat-cards {
        grid-template-columns: 1fr;
    }
}
