/* Module6 专用样式 - 清理整合版 */

/* ========== 基础样式 ========== */

/* 上传区域样式 */
.upload-container {
    margin-bottom: 2rem;
}

.file-upload-area {
    position: relative;
}

.dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    fill: #6c757d;
}

.upload-text {
    margin: 0;
    color: #6c757d;
    font-size: 1rem;
}

/* 文件信息显示 */
.file-info {
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.file-info.show {
    opacity: 1;
    transform: translateY(0);
}

.file-preview {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    position: relative;
}

.file-icon {
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.875rem;
    color: #6c757d;
}

.file-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.file-remove-btn:hover {
    background: #c82333;
}

/* ========== 按钮样式 ========== */
.action-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: auto;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-outline {
    background-color: white;
    color: #007bff;
    border: 1px solid #007bff;
}

.btn-outline:hover {
    background-color: #007bff;
    color: white;
}

.btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ========== 结果显示和表单 ========== */
.result-content {
    margin-top: 1rem;
}

.result-content .form-control {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background-color: #f8f9fa;
}

/* 卡片样式 */
.card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

/* 模块标题 */
.module-header {
    margin-bottom: 1.5rem;
}

.module-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.page-header .text-muted {
    color: #000000; 
}

/* ========== 弹窗样式 ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(1px);
}

/* 调整第一个弹窗大小 */
.modal-content {
    background-color: white;
    margin: 5% auto;  /* 从 3% 改为 5% */
    border-radius: 8px;
    width: 85%;       /* 从 90% 改为 85% */
    max-width: 480px; /* 从 520px 改为 480px */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.2s ease-out;
}

.parameter-detail-content {
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    margin: 2% auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close,
.modal-close-detail {
    font-size: 24px;
    font-weight: bold;
    color: #adb5bd;
    cursor: pointer;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover,
.modal-close-detail:hover {
    color: #495057;
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-body {
    padding: 1.2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.parameter-detail-content .modal-body {
    flex: 1;
    padding: 1.2rem 1.2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* ========== 新的参数配置按钮样式 ========== */
/* 调整参数配置网格的内边距 */
.parameter-category-grid {
    padding: 12px 0;  /* 从 20px 改为 16px */
}

/* 删除不再需要的提示文本样式 */
/* .instruction-text 样式可以删除，因为不再使用 */

/* 调整按钮网格间距 */
.category-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;        /* 从 16px 改为 12px */
    max-width: 700px; /* 从 800px 改为 700px */
    margin: 0 auto;
}

/* 调整按钮大小 */
.category-button {
    display: flex;
    align-items: center;
    padding: 16px;    /* 从 20px 改为 16px */
    border: 2px solid #e5e7eb;
    border-radius: 10px; /* 从 12px 改为 10px */
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: left;
    min-height: 85px;  /* 从 100px 改为 85px */
}

/* 调整图标大小 */
.category-icon {
    font-size: 28px;  /* 从 32px 改为 28px */
    margin-right: 14px; /* 从 16px 改为 14px */
    flex-shrink: 0;
}

/* 调整标题字体 */
.category-title {
    font-size: 16px;  /* 从 18px 改为 16px */
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px; /* 从 6px 改为 4px */
}

/* 调整描述字体 */
.category-desc {
    font-size: 13px;  /* 从 14px 改为 13px */
    color: #6b7280;
    margin-bottom: 6px; /* 从 8px 改为 6px */
}

.category-status {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.category-button[data-configured="false"] .category-status {
    background: #fef3c7;
    color: #92400e;
}

.category-button[data-configured="true"] .category-status {
    background: #d1fae5;
    color: #065f46;
}

.category-button[data-configured="true"] .category-status::before {
    content: "✓ ";
}

.config-summary {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #374151;
}

.config-summary span:first-child {
    margin-right: 16px;
}

#configured-count {
    color: #10b981;
    font-weight: 600;
}

/* ========== 表单样式 ========== */
.form-section {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
    display: inline-block;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group .form-control,
.form-group input,
.form-group select {
    width: 100%;
    height: 36px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: white;
    box-sizing: border-box;
}

.form-group .form-control:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.2);
}

.form-group input::placeholder,
.form-group select::placeholder {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* ========== 措施表单样式 ========== */
.measures-container {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0;
    background: white;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.measures-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.measure-section {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.measure-section:last-child {
    border-bottom: none;
}

.measure-section h5 {
    font-size: 0.9rem;
    color: #495057;
    margin: 0 0 0.8rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: #e3f2fd;
    border-radius: 4px;
    border-left: 3px solid #2196f3;
}

.measure-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.measure-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    transition: all 0.2s ease;
    gap: 0.8rem;
    margin-bottom: 15px;
}

.measure-item:hover {
    background: #ffffff;
    border-color: #007bff;
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.15);
}

.measure-item label {
    flex: 1;
    font-size: 0.85rem;
    color: #495057;
    font-weight: 500;
    margin: 0;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.measure-item input {
    width: 100px !important;
    height: 32px !important;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white !important;
    flex-shrink: 0;
}

.measure-item input:focus {
    outline: none !important;
    border-color: #007bff !important;
    box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, 0.2) !important;
}

.measure-item input::placeholder {
    color: #9ca3af;
    font-size: 0.8rem;
}

.unit-label {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}

/* ========== 概览界面样式 ========== */
.overview-header {
    text-align: center;
    padding: 2rem 0 1rem 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.overview-header h1 {
    color: #495057;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #495057;
    border: 1px solid #e9ecef;
}

.stat-icon {
    font-size: 1rem;
}

.overview-content {
    max-width: 1000px;
    margin: 0 auto;
}

.overview-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

.param-category {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.param-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.param-item:hover {
    background: #ffffff;
    border-color: #007bff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.1);
}

.param-item.calculated {
    border-left: 3px solid #17a2b8;
    background: linear-gradient(135deg, #e1f5fe 0%, #f0f8ff 100%);
}

.param-item.calculated:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fdff 100%);
}

.param-label {
    flex: 0 0 200px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.param-input {
    flex: 1;
    height: 36px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background: white;
}

.param-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.2);
}

.param-input.calculated-field {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #17a2b8;
}

.param-input.changed {
    background: #fff3cd;
    border-color: #ffc107;
}

.param-input.updated {
    background: #d4edda !important;
    border-color: #28a745 !important;
    animation: flashGreen 1s ease-out;
}

.overview-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    margin-top: 2rem;
}

/* ========== 滚动条样式 ========== */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== 动画和过渡效果 ========== */
.fade-in {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flashGreen {
    0% { 
        background: #28a745; 
        transform: scale(1.02);
    }
    100% { 
        background: #d4edda; 
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1100;
    animation: slideInRight 0.3s ease-out;
}

.message-toast.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.message-toast.error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
}

.message-toast.info {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .action-container {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
    
    .dropzone {
        padding: 1.5rem 1rem;
    }
    
    .upload-icon {
        width: 36px;
        height: 36px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .parameter-detail-content {
        margin: 3% auto;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .measure-items-grid {
        grid-template-columns: 1fr;
    }
    
    .measure-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .measure-item label {
        white-space: normal;
        text-overflow: initial;
    }
    
    .measure-item input {
        width: 100% !important;
    }

    .param-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .param-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .param-label {
        flex: none;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .overview-actions {
        flex-direction: column;
        align-items: center;
    }

    .category-buttons-grid {
        grid-template-columns: 1fr;
    }
}   