/* =========================================
   V0.9.9.5 移动端适配核心样式表 (Mobile Adaptation)
   ========================================= */

/* 1. 全局基础设置 */
body {
    font-size: 16px; /* 防止 iOS 自动缩放输入框 */
    -webkit-text-size-adjust: 100%;
}

/* 2. 触控体验优化 */
/* 强制所有按钮垂直居中，增加触控热区 */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px; /* 移动端最小触控高度 */
    font-size: 1rem !important;
}

.btn-sm {
    min-height: 38px;
    font-size: 0.9rem !important;
}

/* 输入框高度优化 */
.form-control, .form-select {
    min-height: 44px;
}

.form-control-sm, .form-select-sm {
    min-height: 38px;
}

/* 3. 表单元素防粘连 (Anti-Stickiness) */
/* 勾选框/单选框容器 */
.checkbox-group-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* 选项之间的间距 */
    margin-top: 8px;
}

.form-check {
    margin-bottom: 0; /* 由 wrapper gap 控制间距，清除默认 mb */
    padding-left: 1.8em;
    min-height: 24px;
    display: flex;
    align-items: center;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0; /* 修正对齐 */
    flex-shrink: 0;
}

.form-check-label {
    padding-left: 4px;
    padding-top: 1px;
    line-height: 1.4;
}

/* 4. 表格变卡片 (Table to Card) 核心逻辑 */
@media (max-width: 768px) {
    .table-responsive-stack thead {
        display: none; /* 隐藏表头 */
    }
    
    .table-responsive-stack tr {
        display: block;
        margin-bottom: 15px;
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        padding: 12px;
    }
    
    .table-responsive-stack td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid #f0f0f0;
        padding: 8px 0;
        font-size: 0.95rem;
    }
    
    .table-responsive-stack td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-top: 8px;
        justify-content: flex-end; /* 操作按钮靠右 */
    }

    /* 利用 data-label 属性显示列名 */
    .table-responsive-stack td:before {
        content: attr(data-label);
        font-weight: bold;
        color: #6c757d;
        margin-right: 15px;
        text-align: left;
        flex-shrink: 0;
    }
}

/* 5. 导航与布局微调 */
@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .card-header {
        padding: 12px 15px;
    }
    
    .card-body {
        padding: 15px;
    }

    /* 手机端隐藏某些非必要装饰 */
    .no-mobile {
        display: none !important;
    }
}

/* 6. 文件下载按钮组适配 */
.file-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.file-btn-group .btn {
    flex: 1 1 auto; /* 自适应宽度 */
    white-space: nowrap;
}