* {
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', '微软雅黑', sans-serif;
}

body {
    background: #e9f0f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

h1 {
    background: #2c3e66;
    color: white;
    margin: 0;
    padding: 18px 24px;
    font-size: 1.6rem;
    font-weight: 500;
}

.tab-container {
    padding: 20px 24px 24px;
}

.tab-buttons {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 1rem;
    padding: 8px 18px;
    cursor: pointer;
    border-radius: 30px;
    transition: 0.2s;
    color: #555;
}

.tab-btn.active {
    background: #2c3e66;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px 20px;
    background: #f9fafc;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.form-row label {
    width: 110px;
    font-weight: 500;
    color: #1e2a3a;
}

.form-row input {
    flex: 1;
    min-width: 140px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9rem;
}

fieldset {
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

fieldset legend {
    font-weight: 600;
    padding: 0 10px;
}

.dynamic-section {
    background: #f0f4f8;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dynamic-section label {
    font-weight: 500;
}

.stratum-section {
    margin-bottom: 25px;
}

.stratum-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    background: #f9fafc;
    padding: 10px;
    border-radius: 10px;
}

.stratum-header button {
    background: #3a6ea5;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

.stratum-header .note {
    color: #8a2e2e;
    font-size: 0.8rem;
    margin-left: auto;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: center;
}

th {
    background: #eef2f7;
    font-weight: 600;
}

td input {
    width: 95%;
    border: 1px solid transparent;
    background: transparent;
    text-align: center;
    padding: 4px;
}

td input:focus {
    border-color: #3a6ea5;
    outline: none;
    background: #fff;
}

.delete-row {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    width: 28px;
    height: 28px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.action-buttons button, .result-header button {
    background: #2c3e66;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.action-buttons button:hover, .result-header button:hover {
    background: #1f2c48;
}

.result-box {
    background: #f1f3f4;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 70vh;
    margin-top: 15px;
}

.result-header {
    display: flex;
    justify-content: flex-end;
}