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

body {
    font-family: 'Segoe UI', '思源黑体', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 30px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

h1 i {
    color: #3498db;
}

/* 模式切换 */
.mode-switch {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 12px 40px;
    border-radius: 50px;
    background: #e9ecef;
    color: #495057;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
    user-select: none;
}

.mode-btn.active {
    background: #1e3c72;
    color: white;
    border-color: #1e3c72;
}

.mode-btn input[type="radio"] {
    display: none;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

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

.form-group {
    flex: 1 1 200px;
    min-width: 150px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.form-group input[readonly] {
    background: #e9ecef;
    cursor: not-allowed;
}

.form-group small {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 4px;
}

/* 复选框组优化 */
.checkbox-group {
    flex: none !important;        /* 不参与伸缩，宽度由内容决定 */
    width: auto !important;
    min-width: 140px;              /* 保持最小宽度，避免过窄 */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;                     /* 控制复选框之间的间距 */
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    margin: 0;                     /* 移除默认边距，由 gap 控制 */
    white-space: nowrap;           /* 防止文字换行 */
}

/* 设备表格样式 */
.equipment-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}
.equipment-table th {
    text-align: left;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    padding: 8px 5px;
    border-bottom: 1px solid #dee2e6;
}
.equipment-table td {
    padding: 5px;
    vertical-align: middle;
}
.equipment-table input,
.equipment-table select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
}
.equipment-table .remove-equip {
    background: #dc3545;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.equipment-table .remove-equip:hover {
    background: #c82333;
}

/* 按钮 */
.btn-primary, .btn-secondary, .btn-small {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #1e3c72;
    color: white;
}

.btn-primary:hover {
    background: #15345c;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #17a2b8;
    color: white;
}

.btn-small:hover {
    background: #138496;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* 工具提示 */
.tooltip {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #6c757d;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
}

/* 预览条 */
.preview-bar {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    gap: 30px;
    justify-content: center;
    font-weight: 500;
    border: 1px solid #b8daff;
}

.preview-bar span {
    color: #1e3c72;
}

/* 结果容器 */
.result-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    border: 1px solid #dee2e6;
}

/* 历史记录 */
.history-section {
    margin-top: 40px;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#history-table th {
    background: #1e3c72;
    color: white;
    padding: 12px;
    text-align: left;
}

#history-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

#history-table tr:hover {
    background: #f1f3f5;
}

.load-btn {
    padding: 5px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.load-btn:hover {
    background: #218838;
}
#add-equipment {
    margin-top: 15px;
}
/* 移动端响应式优化 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    .form-group {
        width: 100%;
        flex: none;
        min-width: 100%;
    }
    /* 复选框组在移动端保持行内，但允许换行 */
    .checkbox-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 12px;
    }
    .checkbox-group label {
        /*white-space: normal;   !* 允许文字换行，避免溢出 *!*/
    }
    .preview-bar {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .mode-switch {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .mode-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    /* 表格在小屏幕上的处理（横向滚动） */
    .equipment-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
body .plan-report {padding: 30px 5px;}
 body{padding: 20px 5px;}
    /* 历史表格优化 */
    #history-table {
        display: block;
        width: 100%;
        overflow-x: auto;          /* 允许横向滚动 */
        white-space: nowrap;
        font-size: 0.9rem;         /* 适当缩小字体 */
    }

    #history-table th,
    #history-table td {
        padding: 8px 6px;          /* 减小内边距 */
    }

    /* 模式列中的英文改为显示中文，但由 JS 处理，这里只保证样式 */
    /* 查看按钮 */
    .load-btn {
        padding: 4px 8px;          /* 缩小按钮 */
        font-size: 0.85rem;
        white-space: nowrap;        /* 禁止换行 */
    }

    /* 设备表格中的添加设备按钮 */
    #add-equipment {
        width: 100%;                /* 按钮占满宽度 */
        justify-content: center;
        margin-top: 10px;
    }
}