/* 全局样式 */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    line-height: 1.6;
    color: #2c3e50;
}

.page-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: #fff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 5px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #f5f7fa;
    color: #1890ff;
    border-left-color: #1890ff;
}

.nav-link.active {
    background: #e6f7ff;
    color: #1890ff;
    border-left-color: #1890ff;
}

.nav-divider {
    height: 1px;
    background: #eee;
    margin: 15px 0;
}

.nav-group-title {
    padding: 10px 20px;
    color: #999;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    background: #f0f2f5;
}

.calculator-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

h1 {
    text-align: center;
    color: #1a365d;
    margin: 0 0 30px;
    font-size: 28px;
    font-weight: 600;
}

/* 删除标题下的蓝色线条 */
h1:after {
    display: none;
}

/* 日期输入框并排显示 */
.date-inputs {
    display: flex;
    gap: 20px;
}

.date-inputs .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 利率类型和计息天数选项样式 */
.rate-type-options,
.year-days-options {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.rate-option,
.days-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
    transition: all 0.3s;
}

.rate-option:hover,
.days-option:hover {
    border-color: #1890ff;
    background: #f0f7ff;
}

/* 单选框样式 */
.rate-option input[type="radio"],
.days-option input[type="radio"] {
    margin: 0;
    margin-right: 0px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 标签样式 */
.rate-option label,
.days-option label {
    display: inline-block;
    margin: 0;
    cursor: pointer;
    font-size: 18px;
    color: #000;
    line-height: 1;
}

/* 选中状态样式 */
.rate-option input[type="radio"]:checked + label,
.days-option input[type="radio"]:checked + label {
    color: #1890ff;
    font-weight: 500;
}

.rate-option:has(input[type="radio"]:checked),
.days-option:has(input[type="radio"]:checked) {
    background: #f0f7ff;
    border-color: #1890ff;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.form-group:hover {
    background: #f0f7ff;
    box-shadow: 0 2px 8px rgba(24,144,255,0.1);
}

label {
    display: block;
    margin-bottom: 10px;
    color: #000;
    font-weight: 600;
    font-size: 18px;
}

input[type="number"],
input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 18px;
    transition: all 0.3s;
    background: #fff;
}

input[type="number"]:focus,
input[type="date"]:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(24,144,255,0.1);
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 20px;
    margin-top: 35px;
}

.clear-btn,
.calculate-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clear-btn {
    background: #f1f5f9;
    color: #64748b;
}

.calculate-btn {
    background: #1890ff;
    color: white;
    box-shadow: 0 4px 12px rgba(24,144,255,0.35);
}

.clear-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.calculate-btn:hover {
    background: #096dd9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24,144,255,0.4);
}

/* 结果显示区域样式 */
.result-container {
    margin-top: 40px;
    animation: fadeIn 0.5s ease-out;
}

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

.result-box {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.result-box h3 {
    color: #1a365d;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
}

.result-section {
    margin-bottom: 25px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.result-item .label {
    color: #000;
    font-weight: 500;
    font-size: 18px;
}

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

/* 计算步骤样式 */
.calculation-details {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    margin-top: 25px;
}

.calculation-details h4 {
    color: #1a365d;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.steps-content {
    color: #000;
    line-height: 1.8;
    font-size: 18px;
}

.steps-content p {
    margin: 12px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 18px;
    color: #000;
}

/* 使用说明弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #fff;
    margin: 50px auto;
    padding: 35px;
    max-width: 600px;
    border-radius: 12px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    right: 25px;
    top: 25px;
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #1a365d;
}

.instruction-section {
    margin-bottom: 35px;
}

.instruction-section h3 {
    color: #1a365d;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
}

.instruction-item {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.instruction-item h4 {
    color: #1890ff;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
}

.instruction-item p {
    color: #000;
    margin: 0;
    line-height: 1.6;
    font-size: 18px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .page-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 15px 0;
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .calculator-container {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .rate-type-options,
    .year-days-options {
        flex-direction: column;
        gap: 8px;
    }

    .rate-option,
    .days-option {
        padding: 8px;
    }

    .form-group {
        padding: 15px;
    }

    .result-box {
        padding: 20px;
    }
}