/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 主要内容区域 */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* 卡片样式 */
.calculator-card,
.formula-card,
.examples-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

/* 计算器样式 */
.calculator-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.calculator-desc {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: color 0.2s ease;
}

.radio-label:hover {
    color: #007bff;
}

.radio-label input[type="radio"] {
    margin: 0;
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: #007bff;
    cursor: pointer;
}

.radio-text {
    user-select: none;
}

.calculate-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 200px;
}

.calculate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

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

/* 结果区域样式 */
.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 1rem;
}

.result-grid {
    display: grid;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.highlight {
    background: rgba(37, 99, 235, 0.05);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    font-weight: 600;
}

.result-label {
    font-weight: 500;
    color: #374151;
}

.result-value {
    font-weight: 600;
    color: #1e293b;
    font-family: 'Courier New', monospace;
}

.result-item.highlight .result-value {
    color: #2563eb;
    font-size: 1.1rem;
}

/* 公式区域样式 */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
}

.formula-step {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.formula-step h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.5rem;
}

.formula-text p {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

/* 表格样式 */
.tax-table {
    margin-top: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.table td {
    color: #4b5563;
}

.table tr:hover {
    background: #f9fafb;
}

/* 示例区域样式 */
.examples-content {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.example-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.example-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 1rem;
}

.example-calculation p {
    margin-bottom: 0.5rem;
    color: #4b5563;
    font-size: 0.95rem;
}

.example-result {
    font-weight: 600;
    color: #059669 !important;
    background: #ecfdf5;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #10b981;
    margin-top: 0.75rem !important;
}

/* 页脚样式 */
.footer {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-text {
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-list {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .calculator-card,
    .formula-card,
    .examples-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .calculator-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .examples-content {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .calculator-card,
    .formula-card,
    .examples-card {
        padding: 1rem;
    }
    
    .nav-list {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeInUp 0.5s ease-out;
}

/* 输入验证样式 */
.form-input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}