/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

.container {
    min-height: 100vh;
    padding: 2rem 1rem;
    max-width: 64rem;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.title .icon {
    color: #3b82f6;
}

.subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    font-weight: 400;
}

/* 计算器卡片 */
.calculator-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label .icon {
    color: #6b7280;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: white;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:read-only {
    background-color: #f9fafb;
    color: #6b7280;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    pointer-events: none;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.button-container {
    display: flex;
    justify-content: center;
}

.calculate-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.calculate-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.calculate-button:active {
    transform: translateY(0);
}

/* 结果卡片 */
.result-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.result-card.hidden {
    display: none;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-title .icon {
    color: #3b82f6;
}

/* 对比表格 */
.comparison-table {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr 1fr 1fr 1fr;
    gap: 1px;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    display: contents;
}

.table-header .table-cell {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #374151;
    padding: 1rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
}

.table-row {
    display: contents;
}

.table-cell {
    background-color: white;
    padding: 1rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.year-label {
    font-weight: 600;
    color: #111827;
}

.policy-label {
    font-weight: 500;
}

.year-2024-2025 .policy-label {
    color: #059669;
}

.year-2026-2027 .policy-label {
    color: #d97706;
}

.year-2028 .policy-label {
    color: #dc2626;
}

.exemption-amount {
    color: #6b7280;
    font-size: 0.8rem;
}

.actual-tax {
    font-weight: 600;
}

.savings {
    font-weight: 600;
    color: #059669;
}

/* 税额计算说明样式 */
.tax-explanation {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.tax-explanation h3 {
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.calculation-formula, .calculation-example {
    margin-bottom: 1.5rem;
}

.calculation-formula h4, .calculation-example h4 {
    color: #475569;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.formula-box, .example-box {
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.formula-box p, .example-box p {
    margin: 0.5rem 0;
    color: #334155;
    line-height: 1.5;
}

.formula-box strong {
    color: #1e40af;
    font-weight: 600;
}

.example-box .highlight {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: #92400e;
    font-weight: 500;
    margin-top: 0.75rem;
}

/* 政策说明样式更新 */
.policy-explanation {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.explanation-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation-title .icon {
    color: #3b82f6;
}

.policy-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0f2fe;
}

.policy-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.policy-item h4 {
    color: #0c4a6e;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.policy-item p {
    color: #475569;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.policy-note {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: #1e40af;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.policy-list {
    list-style: none;
    padding: 0;
}

.policy-list li {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
    position: relative;
    color: #4b5563;
    line-height: 1.6;
}

.policy-list li:before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.policy-list li:last-child {
    margin-bottom: 0;
}

/* 相关工具推荐 */
.credit-card-promo {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #bae6fd;
}

.promo-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.promo-content .icon {
    color: #0284c7;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.promo-text p {
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.promo-text p:last-child {
    margin-bottom: 0;
}

.promo-text a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
}

.promo-text a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }
    
    .title {
        font-size: 1.875rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .calculator-card,
    .result-card {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .comparison-table {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .table-header {
        display: none;
    }
    
    .table-row {
        display: block;
        background-color: white;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
        padding: 1rem;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
    
    .table-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f3f4f6;
        text-align: left;
    }
    
    .table-cell:last-child {
        border-bottom: none;
    }
    
    .table-cell:before {
        content: attr(data-label);
        font-weight: 600;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .year-label:before {
        content: "年份: ";
    }
    
    .policy-label:before {
        content: "政策: ";
    }
    
    .exemption-amount:before {
        content: "免征额度: ";
    }
    
    .taxable-amount:before {
        content: "应纳税额: ";
    }
    
    .actual-tax:before {
        content: "实际税费: ";
    }
    
    .savings:before {
        content: "节省金额: ";
    }
}