/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* 输入区域样式 */
.input-section {
    flex: 1;
    min-width: 300px;
}

.input-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 25px;
    
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-with-unit input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-with-unit input.error {
    border-color: #e74c3c;
}

.unit {
    position: absolute;
    right: 15px;
    color: #666;
    font-weight: 600;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 18px;
}

/* 快捷金额样式 */
.quick-amounts {
    margin: 30px 0;
}

.quick-amounts h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

.quick-btn {
    padding: 8px 16px;
    margin-right: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 按钮样式 */
.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.calculate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.reset-btn {
    width: 100%;
    padding: 12px;
    background: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #e0e0e0;
}

/* 结果区域样式 */
.result-section {
    flex: 2;
    min-width: 400px;
}

.result-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* 结果卡片样式 */
.result-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.result-card.goods {
    border-left: 5px solid #4CAF50;
}

.result-card.service {
    border-left: 5px solid #2196F3;
}

.result-card.engineering {
    border-left: 5px solid #FF9800;
}

.result-card h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-item .label {
    font-weight: 600;
    color: #666;
}

.result-item .value {
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
}

.result-item.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.result-item.total .value {
    font-size: 1.3rem;
    color: #667eea;
}

.result-card.goods .result-item.total .value {
    color: #4CAF50;
}

.result-card.service .result-item.total .value {
    color: #2196F3;
}

.result-card.engineering .result-item.total .value {
    color: #FF9800;
}

/* 费率表区域样式 */
.rate-table-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.rate-table-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-x: auto;
}

#rateTable {
    width: 100%;
    border-collapse: collapse;
}

#rateTable th,
#rateTable td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

#rateTable th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

#rateTable tr:hover {
    background-color: #f5f5f5;
}

#rateTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* 历史记录区域样式 */
.history-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.history-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.history-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.history-item .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.history-item .history-time {
    color: #666;
    font-size: 0.9rem;
}

.history-item .history-amount {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.history-item .history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 0.9rem;
}

.history-item .history-detail {
    display: flex;
    justify-content: space-between;
}

.history-item .history-detail .key {
    color: #666;
}

.history-item .history-detail .value {
    font-weight: 600;
    color: #333;
}

.history-item .history-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.history-item .history-actions button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.history-item .history-actions button:hover {
    background: #f5f5f5;
}

/* 页脚样式 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 1199px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    
    .input-section,
    .result-section {
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    .quick-btn {
        padding: 6px 12px;
        margin-right: 8px;
        font-size: 0.8rem;
    }
    
    .result-item .value {
        font-size: 1rem;
    }
    
    .result-item.total .value {
        font-size: 1.2rem;
    }
    
    .table-container {
        padding: 10px;
    }
    
    #rateTable th,
    #rateTable td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .input-section h2,
    .result-section h2,
    .rate-table-section h2,
    .history-section h2 {
        font-size: 1.3rem;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
    
    .calculate-btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .history-item .history-details {
        grid-template-columns: 1fr;
    }
}