/* 自定义样式 */
body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #667eea;
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 20px;
}

.header label {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 1px;
    flex: 1;
    text-align: center;
    margin-left: -180px;
}

.logo-link {
    text-decoration: none;
}

.logo img {
    height: 70px;
    border-radius: 8px;
    padding: 5px;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.card {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.card-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.card-body {
    padding: 15px;
}

h3 {
    font-size: 18px;
    margin: 0;
}

h4 {
    font-size: 16px;
    margin: 0 0 10px 0;
}

.form-control {
    padding: 5px 10px;
    font-size: 14px;
}

.btn {
    padding: 6px 12px;
    font-size: 14px;
}

.row {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 10px !important;
}

/* 表格样式 */
table {
    font-size: 14px;
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.table th {
    background-color: #e9ecef;
}

#needtiaozheng {
    background: white;
    border: none;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

#needtiaozheng:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.input-row input { 
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.input-group label {
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.input-group input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    width: 120px;
}

.input-group input[type="month"] {
    width: 150px;
}

.input-group input[type="radio"] {
    width: auto;
    margin: 0;
}

.gender-option {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
}

/* 数据表格样式 */
.data-table table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    table-layout: fixed;
    width: 100%;
}

.data-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    padding: 14px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.data-table td {
    padding: 12px 10px;
    border-color: #e8ecef;
    text-align: center;
}

.data-table td input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dce1e6;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.data-table td input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

/* 结果单元格样式 */
.result-cell {
    background: #e3f2fd;
    border-radius: 6px;
    padding: 8px;
    font-weight: 500;
    color: #1976d2;
}

.result-cell-highlight {
    background: #ffcdd2;
    border-radius: 6px;
    padding: 8px;
    font-weight: 600;
    color: #c62828;
}

.result-cell-success {
    background: #c8e6c9;
    border-radius: 6px;
    padding: 8px;
    font-weight: 500;
    color: #2e7d32;
}

/* 分析部分样式 */
.analysis-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.analysis-table {
    flex: 1;
}

.analysis-table th {
    background-color: #e3f2fd;
}

/* 管理方案样式 */
.management-plan {
    background-color: #f1f8e9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.management-plan h4 {
    margin-top: 0;
}

.management-plan ol {
    margin: 0;
    padding-left: 20px;
}

.management-plan li {
    margin-bottom: 5px;
}

/* 标注样式 */
.annotation {
    background: #fff3e0;
    border-radius: 10px;
    padding: 20px 25px;
    margin-top: 25px;
    border-left: 4px solid #ff9800;
}

.annotation p {
    margin: 10px 0;
    line-height: 1.7;
    color: #555;
    font-size: 14px;
}

.annotation p:first-child {
    margin-top: 0;
}

.annotation p:last-child {
    margin-bottom: 0;
}

/* 历史记录样式 */
.history-section {
    margin-top: 30px;
}

/* 按钮组样式 */
/* .button-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
} */
.button-group,
.action-buttons {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 优化按钮样式 */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-success {
    background: #11998e;
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.5);
}

.btn-secondary {
    background: #bdc3c7;
    color: #2c3e50;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 加载动画 */
.loading-overlay {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.loading-spinner {
    background: white;
    padding: 40px 60px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    width: 60px;
    height: 60px;
}

.loading-spinner p {
    color: #667eea;
    font-weight: 500;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示框样式 */
.alert {
    border-radius: 10px;
    padding: 15px 20px;
    font-weight: 500;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .header h1 {
        font-size: 20px;
        margin: 15px 0;
    }
    
    .button-group {
        flex-wrap: wrap;
    }
    
    .button-group .btn {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }
    
    #needtiaozheng {
        padding: 20px 15px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .input-group {
        width: 100%;
    }
    
    .input-group input {
        width: 100%;
    }
    
    .prediction-left, .prediction-right {
        width: 100%;
    }
    
    .chart-container {
        height: 500px;
    }
    
    table {
        font-size: 12px;
    }
    
    .table th, .table td {
        padding: 8px 5px;
    }
}

@media (max-width: 576px) {
    .button-group .btn {
        flex: 1 1 100%;
    }
    
    .legend-item {
        display: block;
        margin: 8px 0;
    }
    
    .chart-container {
        height: 500px;
    }
}

/* 预测区域 */
.prediction-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-top: 30px;
}

.prediction-section h3 {
    color: #333;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.eye-prediction-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid #667eea;
}

.eye-prediction-section h4 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 15px;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 400px;
}

.table-container {
    margin-top: 20px;
}
#tableContainer {
    margin-top: 20px;
    display: none;
}

.legend-container {
            margin-top: 15px;
            text-align: center;
        }
        .legend-item {
            display: inline-block;
            margin-right: 20px;
            font-weight: bold;
        }
        .legend-color {
            display: inline-block;
            width: 30px;
            height: 15px;
            margin-right: 5px;
            vertical-align: middle;
        }
        .red {
            background-color: red;
        }
        .green {
            background-color: rgb(33, 166, 65 , 0.6);
        }
        .green-line {
            background-color: rgba(7, 192, 237, 0.8);
            border: 2px dashed rgba(7, 192, 237, 0.8);
            height: 0;
        }
        .yellow-line {
            background-color: rgba(255, 85, 0, 0.8);
            border: 2px dashed rgba(255, 85, 0, 0.8);
            height: 0;
        }
        .critical-values {
            margin-top: 15px;
            padding: 10px;
            border-radius: 5px;
            font-weight: bold;
        }
        #predictionTable th {
            padding-right: 20px;
        }
/* 优化临界值显示 */
.critical-values {
    background: #fff3e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 15px;
    border-left: 4px solid #ff9800;
}

.critical-values div {
    margin: 5px 0;
    color: #555;
}

/* 图例 */
.legend-container {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin: 5px 15px;
    font-size: 14px;
    color: #555;
}

.legend-color {
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.green-line, .yellow-line {
    border-radius: 2px;
    margin-right: 8px;
}

/* 优化分析表格 */
.analysis-table table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.analysis-table th {
    background: #4fc3f7;
    color: white;
    font-weight: 600;
    padding: 14px 12px;
}

.analysis-section {
    gap: 25px;
    margin-bottom: 30px;
}

/* 优化近视管理方案 */
.management-plan {
    background: #f1f8e9;
    border-radius: 10px;
    padding: 20px 25px;
    border-left: 4px solid #8bc34a;
}

.management-plan h4 {
    color: #558b2f;
    font-weight: 600;
    margin-bottom: 15px;
}

.management-plan li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #33691e;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd6;
}

/* 参考文献区域样式 */
#referenceSection {
    background: #fff;
    padding: 25px;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#referenceSection h1 {
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin-top: 0;
    margin-bottom: 20px;
}

#referenceSection h3 {
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin-top: 0;
    margin-bottom: 20px;
}

#referenceSection .section {
    background: #fff;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#referenceSection h2 {
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin-top: 0;
}

#referenceSection h3 {
    color: #2980b9;
    margin-top: 25px;
}

#referenceSection p {
    margin: 10px 0;
}

#referenceSection .source {
    font-size: 0.9em;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
}

#referenceSection table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
}

#referenceSection th, #referenceSection td {
    border: 1px solid #ddd;
    padding: 10px 8px;
    text-align: center;
}

#referenceSection th {
    background-color: #ecf0f1;
    font-weight: bold;
    color: #2c3e50;
}

#referenceSection tr:nth-child(even) {
    background-color: #f9f9f9;
}

#referenceSection tr:hover {
    background-color: #f1f7ff;
}

#referenceSection .note {
    font-size: 0.9em;
    color: #666;
    background-color: #fffde7;
    padding: 10px;
    border-left: 3px solid #ffc107;
    margin: 15px 0;
}

#referenceSection .sub-table {
    margin-top: 15px;
}

#referenceSection .sub-table th, #referenceSection .sub-table td {
    padding: 6px 4px;
    font-size: 0.9em;
}