/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

h1 {
    color: #2c3e50;
    font-size: 28px;
}

h2 {
    color: #3498db;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

h3 {
    color: #2c3e50;
    margin: 15px 0;
    font-size: 18px;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-btn:hover {
    background-color: #f0f0f0;
}

.tab-btn.active {
    color: #3498db;
    border-bottom: 3px solid #3498db;
    font-weight: bold;
}

.tab-content {
    padding: 20px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 表单样式 */
.form-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.form-group.compact {
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin-bottom: 10px;
    margin-right: 15px;
}

.form-group label {
    width: 120px;
    font-weight: bold;
}

.form-group.compact label {
    width: auto;
    margin-right: 5px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.small-input {
    width: 80px !important;
    padding: 5px !important;
    flex: none !important;
}

textarea {
    resize: vertical;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.sieve-size, .sieve-mass {
    width: 100%;
    text-align: center;
}

/* 筛分表格样式 */
.sieve-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.sieve-table th, .sieve-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.sieve-table th {
    background-color: #f2f2f2;
    white-space: nowrap;
    font-weight: bold;
}

.sieve-table input[type="number"] {
    width: 70px;
    text-align: center;
}

/* 按钮样式 */
button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-right: 10px;
}

button:hover {
    background-color: #2980b9;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-start;
}

/* 添加确认对话框样式 */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.confirm-dialog-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.confirm-dialog h3 {
    margin-top: 0;
    color: #333;
}

.confirm-dialog ul {
    margin-bottom: 15px;
}

.confirm-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.confirm-dialog-buttons button {
    padding: 8px 15px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

#confirm-calculate {
    background-color: #4CAF50;
    color: white;
}

#cancel-calculate {
    background-color: #f44336;
    color: white;
}

/* 图表容器 */
.chart-container {
    height: 400px;
    margin: 20px 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

/* 数据显示 */
.curve-data {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.data-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.data-item {
    flex: 1;
    min-width: 200px;
    margin: 5px;
}

.data-item label {
    font-weight: bold;
    margin-right: 10px;
}

/* 结果框 */
.result-box {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    min-height: 100px;
    margin-top: 15px;
    line-height: 1.8;
}

/* 汇总页面样式 */
/* 汇总页面样式优化 */
#summary {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

#summary h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.summary-section {
    margin-bottom: 30px;
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.summary-section h3 {
    color: #2980b9;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.summary-section h4 {
    color: #3498db;
    margin-top: 15px;
    margin-bottom: 10px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.summary-table th, .summary-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.summary-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.summary-table tr:hover {
    background-color: #f1f1f1;
}

.summary-data {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.summary-item {
    flex: 1;
    min-width: 200px;
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    border-left: 3px solid #3498db;
}

.summary-label {
    font-weight: bold;
    color: #555;
    margin-right: 5px;
}

#summary-soil-description {
    white-space: pre-line;
    line-height: 1.6;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #2ecc71;
}


/* 打印样式优化 */
@media print {
    body {
        font-size: 12pt;
    }
    
    #summary {
        box-shadow: none;
        padding: 0;
    }
    
    .summary-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .tab-btn, .tab-pane:not(#summary) {
        display: none !important;
    }
    
    #summary {
        display: block !important;
    }
}

.summary-chart-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#summary-curve-image {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    background-color: white;
    max-height: 500px;
    margin: 10px auto;
}

#generate-summary-curve {
    margin: 10px 0;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#generate-summary-curve:hover {
    background-color: #2980b9;
}

/* 土的工程分类样式 */
.classification-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.result-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.result-label {
    font-weight: bold;
    margin-right: 10px;
    min-width: 100px;
    color: #555;
}

.classification-description {
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 5px;
    border: 1px solid #b8d6f5;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 塑性图表样式 */
#plasticity-chart {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.chart-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

/* 土的分类表格样式 */
.classification-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.classification-table th, 
.classification-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    text-align: center;
}

.classification-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

.classification-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-group label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .summary-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .form-group.compact {
        margin-right: 0;
    }
}