/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header h1 i {
    color: #4f46e5;
}

.subtitle {
    font-size: 1.2rem;
    color: #718096;
    font-weight: 400;
}

/* 计算器主区域 */
.calculator {
    margin-bottom: 40px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 卡片通用样式 */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 22px 25px;
}

.card-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

.card-body {
    padding: 25px;
}

/* 输入组样式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group label i {
    color: #4f46e5;
    width: 18px;
    text-align: center;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: #2d3748;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-group input:hover {
    border-color: #cbd5e0;
}

/* 成本提示样式 */
.cost-hint {
    font-size: 0.85rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 5px;
    border-left: 3px solid #9ca3af;
    font-family: monospace;
}

.cost-hint::before {
    content: "💡 ";
    font-size: 0.8rem;
    margin-right: 4px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #edf2f7;
}

/* 信息框 */
.info-box {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px;
    display: flex;
    gap: 12px;
}

.info-box i {
    color: #0ea5e9;
    font-size: 1.2rem;
    margin-top: 2px;
}

.info-box p {
    color: #0369a1;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 结果卡片特殊样式 */
.result-card .card-header {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.result-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.result-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-section h3 {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-section h3 i {
    color: #059669;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row.highlight {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 12px 15px;
    border-radius: 10px;
    margin-top: 5px;
    border: 1px solid #bbf7d0;
}

.result-row.highlight span:first-child {
    font-weight: 600;
    color: #065f46;
}

.result-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
}

/* 重置按钮 */
.reset-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    transform: scale(1.02);
}

.reset-btn:active {
    transform: scale(0.98);
}

/* 汇总卡片 */
.summary-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-top: 20px;
}

.summary-header {
    margin-bottom: 25px;
}

.summary-header h3 {
    font-size: 1.5rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-header h3 i {
    color: #4f46e5;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #4f46e5;
    transition: transform 0.2s ease;
}

.summary-item:hover {
    transform: translateY(-3px);
    background: #f1f5f9;
}

.summary-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 25px 0;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    margin-top: 30px;
}

footer p {
    margin-bottom: 10px;
}

footer .copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

footer i {
    color: #f59e0b;
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-card {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .result-card {
        grid-column: span 1;
    }
    
    header h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    body {
        padding: 15px;
    }
    
    .card-header h2 {
        font-size: 1.4rem;
    }
    
    .result-value {
        font-size: 1rem;
    }
}

/* 数字格式化 */
.result-value, .summary-value {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* 加载动画 */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.updating {
    animation: pulse 1.5s infinite;
}