/* === styles/main.css (The Definitive Final Version - Chart Fix Applied) === */

/* --- 全局样式和变量 --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #051a33;
    --secondary-color: #007bff;
    --accent-color: #16a34a;
    --accent-hover-color: #15803d;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --text-color: #343a40;
    --light-text-color: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; line-height: 1.6; background-color: var(--background-color); color: var(--text-color); display: flex; flex-direction: column; min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 0.2rem 1.5rem; }

/* --- Header & Navigation (终极修复版) --- */
.header { background-color: var(--card-background); box-shadow: var(--shadow); padding: 0.75rem 0; position: sticky; top: 0; z-index: 1000; }
.header-container { display: flex; justify-content: space-between; align-items: center; padding-top: 0; padding-bottom: 0; }
.logo-area { flex-shrink: 0; }
.logo-wrapper { text-decoration: none; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); line-height: 1.2; }
.tagline { font-size: 0.8rem; font-weight: 500; color: var(--light-text-color); line-height: 1.2; }
.main-nav { display: flex; }
.nav-menu { list-style: none; display: flex; align-items: center; }
.nav-menu li { position: relative; margin-left: 2rem; padding-bottom: 0; margin-bottom: 0; }
.nav-menu a { text-decoration: none; color: var(--text-color); font-weight: 500; transition: color 0.3s ease; }
.nav-menu a:hover { color: var(--secondary-color); }
.dropdown-toggle { display: flex; align-items: center; }
.dropdown-toggle::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 0.5rem; vertical-align: middle; border-top: 5px solid; border-right: 5px solid transparent; border-bottom: 0; border-left: 5px solid transparent; transition: transform 0.3s ease; }
.dropdown.is-active > .dropdown-toggle::after { transform: rotate(-180deg); }
.dropdown { position: relative; padding-bottom: 10px; margin-bottom: 10px; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background-color: var(--card-background); list-style: none; padding: 0.5rem 0; border-radius: 8px; box-shadow: 0 8px 16px rgba(0,0,0,0.1); min-width: 240px; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }
.dropdown:hover .dropdown-menu { display: block; opacity: 1; visibility: visible; }
.dropdown-menu li { margin: 0; }
.dropdown-menu a { display: block; padding: 0.75rem 1.5rem; white-space: nowrap; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 10px; margin: -10px; }
.hamburger-line { display: block; width: 25px; height: 3px; background-color: var(--primary-color); margin: 5px 0; transition: all 0.3s ease-in-out; }

/* --- Main Content --- */
main { flex: 1; }
.home-hero-section.with-calculator { background-color: var(--card-background); padding: 3rem 0; }
.home-hero-section .hero-content-wrapper { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 3rem; }
.hero-text { order: 1; }
.hero-calculator-module { order: 2; }
.hero-text h1 { font-size: 2.75rem; color: var(--primary-color); line-height: 1.2; margin-bottom: 1rem; }
.hero-text p { font-size: 1.2rem; color: var(--light-text-color); margin-bottom: 2rem; }
.trust-badges { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 0.9rem; color: var(--light-text-color); font-weight: 500; }
.calculator-container.embedded { padding: 1.5rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); }
.calculator-container.embedded label { font-size: 0.9rem; }
.calculator-container.embedded .form-group { margin-bottom: 1rem; }
#hero-results-container { margin-top: 1rem; padding: 1rem; display: none; }
.advanced-link { text-align: center; margin-top: 1rem; font-size: 0.9rem; }
.advanced-link a { color: var(--secondary-color); text-decoration: none; font-weight: 500; }
.advanced-link a:hover { text-decoration: underline; }
.btn-add-row { display: flex; align-items: center; justify-content: center; width: 100%; padding: 0.75rem 1rem; margin-bottom: 1rem; font-weight: 600; color: var(--secondary-color); background-color: transparent; border: 1px dashed var(--border-color); border-radius: 8px; cursor: pointer; transition: background-color 0.3s ease, color 0.3s ease; }
.btn-add-row:hover { background-color: #e9ecef; color: var(--primary-color); }
.btn-add-row svg { margin-right: 0.5rem; }
.full-toolkit-section { padding: 3rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card { background-color: var(--card-background); border-radius: 12px; box-shadow: var(--shadow); padding: 2rem; display: flex; flex-direction: column; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 12px rgba(0, 0, 0, 0.08); }
.card h3 { color: var(--primary-color); margin-bottom: 0.5rem; }
.card p { color: var(--light-text-color); margin-bottom: 1.5rem; flex-grow: 1; }
.btn { display: inline-block; background-color: var(--accent-color); color: #fff; padding: 0.75rem 1.5rem; border-radius: 8px; text-decoration: none; font-weight: 600; transition: background-color 0.3s ease; text-align: center; border: none; cursor: pointer; }
.btn:hover { background-color: var(--accent-hover-color); }
.page-header { text-align: center; margin-bottom: 3rem; }
.page-header h1, .page-header h2 { color: var(--primary-color); }
.featured-posts { padding: 3rem 0; background-color: var(--card-background); }
.calculator-layout { display: flex; gap: 3rem; margin-top: 2rem; }
.calculator-main { flex: 3; min-width: 0; }
.calculator-sidebar { flex: 2; min-width: 0; }
.calculator-container { background: var(--card-background); padding: 0.4rem 1rem; border-radius: 12px; box-shadow: var(--shadow); }
.calculator-container h1 { color: var(--primary-color); margin-bottom: 2rem; font-size: 2.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; }
.form-group input { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: 'Inter', sans-serif; }
.btn-calculate { width: 100%; padding: 1rem; font-size: 1.1rem; margin-top: 1rem; }

/* ✅ 关键修复：修改 #results-container 的隐藏方式 */
#results-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--background-color);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    /* 使用 opacity 和 max-height 实现"软隐藏" */
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease, padding 0.4s ease;
}
#results-container.visible {
    opacity: 1;
    max-height: 1200px; /* 增加高度以容纳图表 */
    padding: 1.5rem; /* 确保显示时有内边距 */
}
/* 保持旧选择器以兼容没有图表的计算器 */
#hero-results-container.visible {
     max-height: 100px;
}

#results-container h3 { color: var(--primary-color); margin-bottom: 0.5rem; }
#results-container p { font-size: 2rem; font-weight: 700; color: var(--accent-color); }
.sidebar-content { position: sticky; top: 120px; }
.sidebar-content h2 { color: var(--primary-color); margin-bottom: 1rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem; }
.sidebar-content p, .sidebar-content ul { margin-bottom: 1.5rem; }
.sidebar-content ul { list-style-position: inside; }
.blog-post { background: var(--card-background); padding: 3rem; border-radius: 12px; }
.blog-post h1 { color: var(--primary-color); font-size: 2.75rem; line-height: 1.2; margin-bottom: 1rem; }
.post-meta { color: var(--light-text-color); margin-bottom: 2rem; font-weight: 500; }
.blog-post-content { font-size: 1.1rem; }
.blog-post-content h2 { color: var(--primary-color); margin-top: 2.5rem; margin-bottom: 1rem; }
.blog-post-content p, .blog-post-content ul, .blog-post-content blockquote { margin-bottom: 1.5rem; }
.blog-post-content a { color: var(--secondary-color); text-decoration: none; font-weight: 600; }
.blog-post-content a:hover { text-decoration: underline; }
.blog-post-content ul { padding-left: 1.5rem; }
.blog-post-content blockquote { border-left: 4px solid var(--accent-color); padding-left: 1rem; font-style: italic; color: var(--light-text-color); }
.footer { background-color: var(--primary-color); color: #fff; padding-top: 2.5rem; padding-bottom: 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-column h4 { font-size: 1.1rem; margin-bottom: 1rem; color: #fff; }
.footer-column.about-column p { color: rgba(255, 255, 255, 0.8); padding-right: 2rem; }
.footer-column ul { list-style: none; }
.footer-column.tools-column .tools-list { column-count: 2; column-gap: 2rem; }
.footer-column li { margin-bottom: 0.75rem; break-inside: avoid; page-break-inside: avoid; }
.footer-column a { color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: color 0.3s ease; }
.footer-column a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.2); }

/* === 新增：还款构成图表样式 === */
#payment-breakdown-chart {
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#payment-breakdown-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: left;
}

#payment-breakdown-details div {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
}

#payment-breakdown-details div:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* ApexCharts 自定义样式 */
.apexcharts-tooltip {
    background: #fff !important;
    color: var(--text-color) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: none !important;
    border-radius: 8px !important;
}

.apexcharts-tooltip-title {
    background: var(--primary-color) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-bottom: none !important;
}

.apexcharts-legend-text {
    color: var(--text-color) !important;
    font-weight: 500 !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #payment-breakdown-chart {
        margin: 15px -10px;
        border-radius: 0;
    }
    
    #payment-breakdown-details {
        margin: 15px -10px;
        border-radius: 0;
    }
    
    #results-container.visible {
        max-height: 1400px !important; /* 移动端需要更高高度 */
    }
}

/* 确保结果容器有足够高度容纳图表 */
#results-container.visible {
    max-height: 1200px !important;
}

/* === 响应式设计 === */
@media (min-width: 992px) {
    .full-toolkit-section .grid,
    .featured-posts .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 992px) {
    .home-hero-section .hero-content-wrapper { display: flex; flex-direction: column; gap: 1.5rem; }
    .hero-calculator-module { order: 1; }
    .hero-text { order: 2; text-align: center; margin-top: 0; }
    .trust-badges { justify-content: center; }
    .calculator-layout { flex-direction: column; }
    .sidebar-content { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
    .footer-column.about-column, .footer-column.tools-column { grid-column: 1 / -1; }
    .footer-column.tools-column .tools-list { column-count: 2; }
}
@media (max-width: 768px) {
    /* ✅ 恢复：这是所有页面的默认移动端内边距，保持不变 */
    .container { padding: 0.1rem 1rem; } 
    
    .home-hero-section.with-calculator { padding-top: 1rem; padding-bottom: 1.5rem; }
    .hero-text h1 { font-size: 2rem; }
    .hero-text p { font-size: 1.1rem; }
    .trust-badges { gap: 1rem; }
    .calculator-container h1, .page-header h1, .page-header h2 { font-size: 1.5rem; }
    .blog-post { padding: 1.5rem; }
    .blog-post h1 { font-size: 2rem; }
    .header-container { position: relative; }
    .logo-area { order: 1; }
    .hamburger { display: block; order: 2; z-index: 1010; }
    .main-nav { order: 3; position: absolute; top: calc(100% + 0.75rem); left: 0; right: 0; width: auto; background-color: var(--card-background); box-shadow: var(--shadow); max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; z-index: 1005; }
    .main-nav.is-active { max-height: calc(100vh - 70px); overflow-y: auto; }
    .nav-menu { flex-direction: column; align-items: flex-start; padding: 0; width: 100%; }
    .nav-menu > li { margin: 0; width: 100%; border-bottom: 1px solid var(--border-color); }
    .nav-menu > li:last-child { border-bottom: none; }
    .nav-menu a { padding: 1rem 1.5rem; display: block; width: 100%; border-bottom: none; }
    /* 移动端导航样式 - 新版本 */
    .mobile-nav {
        font-family: inherit;
    }
    
    .mobile-nav-list li:last-child {
        border-bottom: none;
    }
    
    .mobile-nav a:hover {
        background-color: #f8f9fa;
        color: var(--primary-color);
    }
    
    .mobile-dropdown a:hover {
        background-color: #f8f9fa;
        color: var(--primary-color);
    }
    
    .nav-overlay {
        backdrop-filter: blur(2px);
    }
    
    /* 隐藏桌面端下拉菜单在移动端的显示 */
    .dropdown .dropdown-menu {
        display: none !important;
    }
    .hamburger.is-active .hamburger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.is-active .hamburger-line:nth-child(2) { opacity: 0; }
    .hamburger.is-active .hamburger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    .footer { padding-top: 1.5rem; padding-bottom: 1.5rem; }
    .footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
    .footer-column.tools-column .tools-list { column-count: 1; }
    .footer-column.about-column { grid-column: 1 / -1; text-align: center; padding-right: 0; margin-bottom: 1.5rem; }
    .footer-column.about-column h4, .footer-column.about-column p { max-width: 400px; margin-left: auto; margin-right: auto; }
    .footer-column.about-column h4 { margin-bottom: 0.5rem; }
    .footer-column.tools-column { grid-column: 1 / 2; grid-row: 2 / span 3; }
    .footer-column.links-column, .footer-column.company-column, .footer-column.legal-column { 
        grid-column: 2 / 3; 
        margin-top: 1.5rem; 
    }
    .footer-column.company-column { grid-row: 2 / 3; margin-top: 0; }
    .footer-column.legal-column { grid-row: 3 / 4; }
    .footer-column.links-column { grid-row: 4 / 5; }
    .footer-column { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
    .footer-column h4 { font-size: 1rem; margin-bottom: 0.5rem; }
    .footer-column li { margin-bottom: 0.25rem; }
    .footer-bottom { margin-top: 0; padding-top: 1.5rem; }
    body.no-scroll { overflow: hidden; position: fixed; width: 100%; }

    /* ✅ 优化：RE-IRR 页面移动端布局优化 */
    body.page-re-irr-analyzer .calculator-main .calculator-container {
        /* 完全移除容器限制，利用全屏宽度 */
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        /* 移除圆角和阴影，使其看起来像页面的一部分 */
        border-radius: 0;
        box-shadow: none;
        background-color: transparent; /* 移除背景色，直接使用页面背景 */
    }
    
    /* ✅ 优化：RE-IRR 页面表单区域充分利用空间 */
    body.page-re-irr-analyzer .re-irr-inputs {
        background-color: var(--card-background); /* 为表单区域添加背景 */
        padding: 1rem;
        border-radius: 12px;
        box-shadow: var(--shadow);
        margin: 0; /* 移除外边距 */
    }
    
    /* ✅ 优化：RE-IRR 页面的 form-grid 在移动端使用两列布局以提高空间利用率 */
    body.page-re-irr-analyzer #re-irr-form .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem; /* 减少间距以节省空间 */
    }
    
    /* ✅ 优化：RE-IRR 页面表单组在移动端更紧凑 */
    body.page-re-irr-analyzer #re-irr-form .form-group {
        margin-bottom: 0.75rem; /* 减少表单组间距 */
    }
    
    /* ✅ 优化：RE-IRR 页面标签在移动端更紧凑 */
    body.page-re-irr-analyzer #re-irr-form .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    /* ✅ 优化：RE-IRR 页面输入框在移动端更紧凑 */
    body.page-re-irr-analyzer #re-irr-form .form-group input {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
    }
    
    /* ✅ 优化：RE-IRR 页面表单区域标题更紧凑 */
    body.page-re-irr-analyzer #re-irr-form .form-section h3 {
        font-size: 1rem;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }
    
    /* ✅ 优化：RE-IRR 页面表单区域间距更紧凑 */
    body.page-re-irr-analyzer #re-irr-form .form-section {
        margin-bottom: 1.5rem;
    }
    
    /* ✅ 优化：RE-IRR 页面标签页在移动端更紧凑 */
    body.page-re-irr-analyzer .re-irr-inputs .tab-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* ✅ 优化：RE-IRR 页面表单操作按钮在移动端更紧凑 */
    body.page-re-irr-analyzer .form-actions {
        margin-top: 1rem;
        gap: 0.5rem;
        flex-wrap: wrap; /* 允许按钮换行 */
    }
    
    body.page-re-irr-analyzer .form-actions .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        flex: 1; /* 按钮平均分配空间 */
        min-width: 120px; /* 最小宽度确保可读性 */
    }
}
/* === 新增：NPV现金流图表样式 === */
#cashflow-chart {
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 确保NPV结果容器有足够高度 */
#results-container.visible {
    max-height: 1400px !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #cashflow-chart {
        margin: 15px -10px;
        border-radius: 0;
    }
    
    #results-container.visible {
        max-height: 1600px !important;
    }
}
/* === 新增：Payback Period累计现金流图表样式 === */
#cumulative-cashflow-chart {
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 确保Payback Period结果容器有足够高度 */
#results-container.visible {
    max-height: 1400px !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #cumulative-cashflow-chart {
        margin: 15px -10px;
        border-radius: 0;
    }
    
    #results-container.visible {
        max-height: 1600px !important;
    }
}
/* === 新增：ROI仪表盘图表样式 === */
#roi-gauge-chart {
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
    padding: 15px;
    padding-bottom: 5px; /* 专门减少底部内边距 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* === 新增：Cap Rate仪表盘图表样式 === */
#cap-rate-gauge-chart {
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
    padding: 15px;
    padding-bottom: 5px; /* 专门减少底部内边距 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 仪表盘图例样式 */
.gauge-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 5px; /* 减少顶部边距 */
    flex-wrap: wrap;
}

.gauge-legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.gauge-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #roi-gauge-chart,
    #cap-rate-gauge-chart {
        margin: 15px -10px;
        border-radius: 0;
        padding: 15px 10px 5px 10px; /* 移动端也保持底部小内边距 */
    }
    
    .gauge-legend {
        margin-top: 3px; /* 移动端进一步减少顶部边距 */
    }
}
/* === styles/main.css - 在文件末尾添加以下代码 === */

/* --- ✅ 新增：高级IRR计算器行样式 --- */
.cash-flow-row {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 金额输入框更宽 */
    gap: 1rem;
    align-items: flex-end;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cash-flow-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cash-flow-row .form-group {
    margin-bottom: 0;
}

/* 移动端单列布局 */
@media (max-width: 480px) {
    .cash-flow-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        align-items: stretch;
    }
}
/* === 新增：IRR现金流图表样式 === */
#cashflow-chart {
    margin: 20px 0;
    border-radius: 8px;
    background: #fff;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 确保IRR结果容器有足够高度 */
#results-container.visible {
    max-height: 1400px !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #cashflow-chart {
        margin: 15px -10px;
        border-radius: 0;
    }
    
    #results-container.visible {
        max-height: 1600px !important;
    }
}
/* === styles/main.css - 在文件末尾添加以下代码 === */

/* --- ✅ 新增：Real Estate IRR Calculator 页面专属样式 --- */
.re-irr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.re-irr-inputs .tabs {
    display: flex;
    margin-bottom: -1px; /* 让激活的tab边框与下方容器重合 */
}

.re-irr-inputs .tab-link {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-bottom: none;
    background-color: var(--background-color);
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
    border-radius: 8px 8px 0 0;
    margin-right: 0.25rem;
    transition: background-color 0.3s ease;
}

.re-irr-inputs .tab-link.active {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--card-background);
    z-index: 2;
}

.re-irr-inputs .tab-content {
    display: none;
    background-color: var(--card-background);
    padding: 1rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 0 8px 8px 8px;
}

.re-irr-inputs .tab-content.active {
    display: block;
}

.form-section {
    margin-bottom: 2rem;
}
.form-section:last-child {
    margin-bottom: 0;
}
.form-section h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}
.btn-secondary {
    background-color: var(--light-text-color);
}
.btn-secondary:hover {
    background-color: #5a6268;
}

.re-irr-results .results-container {
    background-color: var(--card-background);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: sticky;
    top: 120px;
}

.add-year-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}
.add-year-form input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.add-year-form .btn {
    padding: 0.5rem 1rem;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
}
#results-table th, #results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
#results-table th {
    background-color: #e9ecef;
    font-weight: 600;
}
#results-table td {
    text-align: center;
}
#results-table tbody tr:last-child td {
    border-bottom: none;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .re-irr-layout {
        grid-template-columns: 1fr;
    }
    .re-irr-results .results-container {
        position: static;
        margin-top: 2rem;
    }
}
@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
/* === styles/main.css - 在文件末尾添加以下代码 === */

/* --- ✅ 新增：情景对比图表样式 --- */
#case-comparison-chart {
    margin: 30px 0;
    border-radius: 8px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 响应式调整 */
@media (max-width: 768px) {
    #case-comparison-chart {
        margin: 20px -10px;
        border-radius: 0;
        padding: 15px;
    }
}
/* === styles/main.css - 在文件末尾添加以下代码 === */

/* --- ✅ 新增：联系表单专属样式 --- */
#contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    resize: vertical; /* 允许用户垂直调整文本框大小 */
}
