/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 500;
}

h3 {
    color: #34495e;
    margin: 20px 0 15px;
    font-size: 18px;
    font-weight: 500;
}

/* 贷款类型选择器 */
.loan-type-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.loan-type-btn {
    padding: 12px 24px;
    border: 2px solid #3498db;
    background-color: #fff;
    color: #3498db;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

.loan-type-btn:hover {
    background-color: #3498db;
    color: #fff;
}

.loan-type-btn.active {
    background-color: #3498db;
    color: #fff;
}

/* 表单样式 */
.loan-form {
    display: none;
    margin-bottom: 30px;
}

.loan-form.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    outline: none;
}

input[type="number"]:focus {
    border-color: #3498db;
}

.repayment-options {
    display: flex;
    gap: 20px;
    align-items: center;
}

.repayment-options label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
}

input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

/* 计算按钮 */
.calculate-btn {
    width: 100%;
    padding: 15px;
    background-color: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    outline: none;
    margin-bottom: 30px;
}

.calculate-btn:hover {
    background-color: #27ae60;
}

/* 结果区域 */
.result {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

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

.result-item .value {
    font-weight: 600;
    color: #e74c3c;
    font-size: 18px;
}

/* 还款明细表 */
.payment-schedule {
    margin-top: 30px;
}

.schedule-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.schedule-table th {
    background-color: #3498db;
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 500;
    position: sticky;
    top: 0;
}

.schedule-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: right;
}

.schedule-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.schedule-table tr:hover {
    background-color: #e8f4fd;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .loan-type-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .loan-type-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .repayment-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-item .value {
        font-size: 16px;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 8px;
        font-size: 14px;
    }
}

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

.result {
    animation: slideIn 0.5s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}