* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 24px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* 输入区 */
.input-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.input-row:last-child {
    margin-bottom: 0;
}

.input-group {
    flex: 1;
    min-width: 120px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.input-group .hint {
    color: #999;
    font-size: 10px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    min-width: 100px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    margin-top: 18px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-group {
    display: flex;
    align-items: flex-end;
}

.btn-group button {
    width: 100%;
    padding: 8px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-group button:hover {
    background: #5a67d8;
}

/* 结果表格 */
.results-section {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table th,
.results-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.results-table th {
    background: #f0f0f0;
    color: #555;
    font-weight: 600;
    font-size: 12px;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

.results-table tbody tr.best-row {
    background: linear-gradient(90deg, #d4edda 0%, #c3e6cb 100%);
    font-weight: 600;
}

.results-table tbody tr.best-row td {
    color: #155724;
}

.total-col {
    color: #667eea;
    font-weight: 700;
}

.results-table .courier-jd-express {
    color: #e74c3c;
}

.results-table .courier-jd-logistics {
    color: #3498db;
}

.results-table .courier-deppon {
    color: #f39c12;
}

.best-tip {
    margin-top: 12px;
    padding: 10px 16px;
    background: #d4edda;
    color: #155724;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* 计算公式区域 */
.formula-section {
    margin-top: 16px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
}

.formula-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-family: -apple-system, sans-serif;
}

.formula-content {
    color: #6c757d;
}

.formula-content p {
    margin: 4px 0;
    padding-left: 12px;
    border-left: 3px solid #dee2e6;
}

.formula-content .label {
    color: #495057;
    font-weight: 500;
}

.results-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.results-table tbody tr:hover {
    background: #e9ecef;
}

.results-table tbody tr.selected {
    background: #e7f1ff;
}

.results-table tbody tr.best-row.selected {
    background: #b8e0c8;
}

footer {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/* 响应式 */
@media (max-width: 600px) {
    .input-group {
        min-width: 100%;
    }

    .results-table {
        font-size: 12px;
    }

    .results-table th,
    .results-table td {
        padding: 8px 6px;
    }
}