body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    width: 90%;
    margin: 40px auto;
    padding: 30px 40px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    overflow-x: hidden;
    /* 防止子元素溢出 */
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
    background: #f8f9fa;
    padding: 25px 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: inline-block;
}

input,
select {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 100%;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #fff;
}

input:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

button {
    padding: 12px 28px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 30px 0;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,123,255,0.2);
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

button:hover {
    background-color: #0056b3;
}

.result-section {
    margin: 35px 0;
    padding: 25px 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    width: auto;
    overflow-x: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

#result {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

#result p {
    margin: 8px 0;
}

#result p:last-child {
    font-weight: bold;
    font-size: 18px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
}

/* 公式区域样式 */
.formula-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    width: auto;
    overflow-x: hidden;
}

.formula-container {
    margin-bottom: 20px;
}

.formula-container h4 {
    margin-top: 20px;
    color: #333;
}

.formula-container p {
    font-size: 16px;
    line-height: 1.8;
    margin: 8px 0;
    overflow-x: auto;
    /* 确保公式过长时可以滚动 */
}

.formula-container h5 {
    margin-top: 15px;
    color: #444;
}

.formula-container ul {
    margin: 5px 0;
    padding-left: 20px;
}

.formula-container li {
    color: #666;
    line-height: 1.5;
}

/* 公式容器样式 */
.formula-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.formula {
    text-align: center;
    font-size: 1.2em;
    background: white;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* 公式容器新样式 */
.formula-container {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.general-formula {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #e9ecef;
}

.formula-title {
    color: #495057;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.calculation-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.calculation-column {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.calculation-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.calculation-column h6 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #495057;
}

/* 移除左侧色条 */
.calculation-column.level-1,
.calculation-column.level-2,
.calculation-column.level-3 {
    border-left: none;
}

.formula-display {
    background: white;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    position: relative;
    font-size: 0.95em;
    line-height: 1.6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-wrap: break-word;
    /* 动态换行 */
    white-space: normal;
    /* 动态换行 */
}

/* 响应式布局调整 */
@media screen and (min-width: 768px) {
    .calculation-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .formula-display {
        font-size: 0.9em;
        padding: 12px;
    }
}

@media screen and (max-width: 767px) {
    .formula-container {
        margin: 10px 0;
        padding: 10px;
    }

    .calculation-column {
        padding: 12px;
    }

    .calculation-column h6 {
        font-size: 0.9em;
    }
}

/* 动画效果 */
.calculation-column {
    animation: slideIn 0.5s ease-out;
    animation-fill-mode: both;
}

.calculation-column:nth-child(1) {
    animation-delay: 0.1s;
}

.calculation-column:nth-child(2) {
    animation-delay: 0.2s;
}

.calculation-column:nth-child(3) {
    animation-delay: 0.3s;
}

/* 优化公式显示 */
.formula-display p {
    margin: 0;
    white-space: normal;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: #007bff #f8f9fa;
}

.formula-display::-webkit-scrollbar {
    height: 6px;
}

.formula-display::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.formula-display::-webkit-scrollbar-thumb {
    background-color: #007bff;
    border-radius: 3px;
}

/* 添加复制按钮悬停效果 */
.copy-btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* 优化特殊说明样式 */
.special-note {
    margin: 15px 0;
    padding: 12px 15px;
    background-color: #fff8dc;
    border-left: 4px solid #f39c12;
    border-radius: 4px;
    font-size: 0.95em;
}

/* C值表格样式 */
.c-table-container {
    width: 100%;
    overflow-x: auto;
    margin: 35px 0;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    padding: 15px 0; /* 移除左右padding */
    position: relative;
}

.c-table {
    width: calc(100% - 30px); /* 减去左右各15px的间距 */
    min-width: 600px;
    border-collapse: collapse;
    margin: 10px 15px; /* 添加左右外边距 */
    font-size: 14px;
    table-layout: fixed;
}

.c-table th,
.c-table td {
    border: 1px solid #dee2e6;
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
    word-wrap: break-word;
    white-space: normal;
}

.c-table th {
    background-color: #4285f4;  /* Google Blue 配色，更加柔和的蓝色 */
    color: white;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 8px;
    position: sticky;
    top: 0;
    z-index: 1;
    border: 1px solid #3b78e7;  /* 稍深一点的蓝色作为边框 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);  /* 添加微妙的阴影 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);  /* 文字阴影提升可读性 */
}

.c-table th:not(:last-child) {
    border-right: 1px solid #5a95f5;  /* 列之间的分隔线 */
}

.c-table td {
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

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

.c-table tr:hover {
    background-color: #f0f7ff;  /* 鼠标悬停效果 */
}

.c-table-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;  /* 确保圆角边框显示正确 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    margin: 25px 0;
}

/* 定义列宽 */
.c-table th:nth-child(1) {
    width: 8%;  /* 泵类型列极简化 */
}
.c-table th:nth-child(2) {
    width: 8%;  /* 流量范围列极简化 */
}
.c-table th:nth-child(3),
.c-table th:nth-child(4),
.c-table th:nth-child(5) {
    width: 28%;  /* C值列大幅增宽,突出显示数据 */
}

/* 计算过程样式 */
#calculation-process {
    margin: 15px 0;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 5px;
    border-left: 3px solid #007bff;
    overflow-x: auto;
    width: auto;
}

#calculation-process h4 {
    color: #0056b3;
    margin-bottom: 10px;
}

#calculation-process p {
    margin: 8px 0;
    line-height: 1.6;
}

/* 能效等级颜色 */
.level-1 {
    color: #2ecc71;
}

.level-2 {
    color: #3498db;
}

.level-3 {
    color: #f39c12;
}

.level-fail {
    color: #e74c3c;
}

.special-note {
    margin: 10px 0;
    padding: 10px 15px;
    background-color: #fff8dc;
    border-left: 4px solid #ffd700;
    border-radius: 4px;
}

.special-note ul {
    margin: 5px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.special-note li {
    margin: 5px 0;
    color: #333;
    line-height: 1.5;
}

.special-note strong {
    color: #d4a017;
}

.special-note p {
    margin: 5px 0;
    color: #333;
}

.special-note strong {
    color: #d4a017;
}

.efficiency-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.efficiency-table th,
.efficiency-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.efficiency-table th {
    background-color: #007bff;
    color: white;
}

/* 修复输入部分的样式 */
.input-section {
    margin-bottom: 20px;
}

.input-section label {
    display: block;
    margin-bottom: 5px;
}

.input-section input,
.input-section select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 特殊说明卡片样式 */
.special-notes {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 0;
}

.note-card {
    flex: 1;
    min-width: 250px;
    /* 减小最小宽度 */
    background: white;
    border-left: 4px solid #3498db;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.note-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.note-icon {
    color: #3498db;
    font-size: 1.2em;
    margin-right: 10px;
    font-weight: bold;
}

.note-card h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1em;
}

.note-card ul {
    margin: 0;
    padding-left: 25px;
}

.note-card li {
    color: #34495e;
    margin: 5px 0;
    line-height: 1.4;
}

/* 多级泵说明卡片使用不同的强调色 */
#multi-stage-note {
    border-left-color: #e74c3c;
}

#multi-stage-note .note-icon {
    color: #e74c3c;
}

/* 页眉样式 */
.app-header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.app-header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
}

.version-info {
    position: absolute;
    bottom: -12px;
    right: 0;
    background: white;
    padding: 0 15px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.version {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 10px;
    font-size: 0.85em;
}

.author {
    color: #34495e;
    font-style: italic;
}

/* 在移动设备上的响应式调整 */
@media (max-width: 768px) {
    .version-info {
        position: static;
        margin-top: 10px;
        text-align: center;
    }

    .app-header {
        padding: 15px 0;
    }
}

/* 响应式设计优化 */
@media screen and (max-width: 768px) {
    .container {
        margin: 10px auto;
        padding: 10px;
        width: auto;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* C值表格移动端优化 */
    .c-table-container {
        margin: 20px -10px;
        padding: 10px;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
        border-top: 1px solid #dee2e6;
        border-bottom: 1px solid #dee2e6;
    }

    .c-table {
        font-size: 12px;
    }

    .c-table th,
    .c-table td {
        padding: 8px 4px;
    }

    .c-table th {
        font-size: 12px;
        white-space: nowrap;
    }

    /* 添加水平滚动提示 */
    .c-table-container::after {
        content: '← 左右滑动查看更多 →';
        display: block;
        text-align: center;
        padding: 8px 0;
        color: #6c757d;
        font-size: 12px;
        background: #fff;
        position: sticky;
        bottom: 0;
        border-top: 1px solid #dee2e6;
    }

    /* 输入区域优化 */
    .input-section {
        gap: 10px;
        padding: 0 5px;
    }

    .input-section label {
        font-size: 14px;
    }

    input,
    select {
        font-size: 16px;
        /* 防止iOS自动缩放 */
        padding: 12px 8px;
    }

    button {
        width: 100%;
        padding: 15px;
        font-size: 16px;
        margin-top: 15px;
    }

    /* 表格容器优化 */
    .c-table-container {
        margin: 15px 0;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .c-table {
        font-size: 12px;
        min-width: 100%;
    }

    .c-table th,
    .c-table td {
        padding: 6px 4px;
    }

    /* 修正边框溢出问题 */
    .formula-section,
    .result-section,
    .efficiency-table,
    .special-notes {
        margin: 15px 0;
        padding: 10px;
        border-radius: 4px;
        width: auto;
    }

    .note-card {
        min-width: unset;
        width: auto;
        margin: 5px 0;
    }

    /* 计算过程容器优化 */
    #calculation-process {
        margin: 10px 0;
        padding: 10px;
        width: auto;
    }

    /* 移除负边距 */
    .c-table-container,
    .formula-section,
    .result-section,
    .efficiency-table {
        margin-left: 0;
        margin-right: 0;
    }

    /* 公式区域优化 */
    .formula-section {
        margin: 20px -15px;
        padding: 15px;
        border-radius: 0;
    }

    .formula {
        font-size: 1em;
        overflow-x: auto;
        padding: 10px;
    }

    /* 特殊说明卡片优化 */
    .special-notes {
        flex-direction: column;
        gap: 10px;
    }

    .note-card {
        min-width: unset;
        width: 100%;
    }

    /* 计算结果区域优化 */
    .result-section {
        margin: 20px -15px;
        padding: 15px;
        border-radius: 0;
    }

    #calculation-process {
        font-size: 14px;
        overflow-x: auto;
    }

    /* 标题和版本信息优化 */
    .app-header h1 {
        font-size: 1.4em;
        padding: 0 10px;
    }

    .version-info {
        position: static;
        margin-top: 10px;
        padding: 5px 0;
    }

    /* 能效等级表格优化 */
    .efficiency-table {
        margin: 15px -15px;
        overflow-x: auto;
    }

    .efficiency-table table {
        min-width: 280px;
    }
}

/* 移除暗黑模式相关代码 */

/* 触摸设备优化 */
@media (hover: none) {
    button:hover {
        background-color: #007bff;
    }

    input,
    select {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 小屏幕设备优化 */
@media screen and (max-width: 320px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 8px;
    }

    .input-section label {
        font-size: 13px;
    }

    input,
    select {
        font-size: 14px;
        padding: 8px;
    }

    .c-table {
        font-size: 11px;
    }

    .formula {
        font-size: 0.9em;
        padding: 8px;
    }
}

/* 添加平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 优化表单控件触摸区域 */
input[type="number"],
select {
    min-height: 44px;
    /* 确保触摸目标足够大 */
}

/* 添加加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeIn 0.3s ease-in;
}

/* 计算过程卡片样式 */
.calculation-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    padding: 20px;
    transition: all 0.3s ease;
}

.calculation-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.calculation-step {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    animation: fadeIn 0.5s ease-out;
}

.formula-display {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: "Consolas", monospace;
    position: relative;
    transition: all 0.3s ease;
    word-wrap: break-word;
    /* 动态换行 */
    white-space: normal;
    /* 动态换行 */
}

.formula-display:hover {
    background: #e9ecef;
}

/* 动画定义 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 计算结果动画 */
.result-item {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.result-item:nth-child(1) {
    animation-delay: 0.1s;
}

.result-item:nth-child(2) {
    animation-delay: 0.2s;
}

.result-item:nth-child(3) {
    animation-delay: 0.3s;
}

/* 复制按钮样式 */
.copy-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.formula-display:hover .copy-btn {
    opacity: 1;
}

/* GitHub风格的复制按钮 */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: #57606a;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.formula-display:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    color: #0366d6;
}

.copy-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-button.copied {
    color: #28a745;
}

/* 优化能效计算部分布局 */
.efficiency-calculations {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.calculation-column {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 16px;
}

/* 优化特殊说明样式 */
.special-note {
    background-color: #fff8dc;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 16px 0;
}

/* 响应式优化 */
@media screen and (max-width: 768px) {
    .calculation-card {
        margin: 10px 0;
        padding: 15px;
    }

    .formula-display {
        font-size: 14px;
        padding: 10px;
    }

    .copy-btn {
        opacity: 1;
        position: static;
        display: block;
        width: 100%;
        margin-top: 10px;
    }

    .formula-display {
        font-size: 13px;
        padding: 12px;
    }

    .copy-button {
        opacity: 1;
        background: rgba(255, 255, 255, 0.8);
    }
}

/* 复制按钮美化 */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #007bff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    z-index: 2;
}
.copy-btn:hover, .copy-btn.copied {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.10);
}
.copy-btn .copy-icon {
    font-size: 1.1em;
    pointer-events: none;
}

/* 公式区域简化分组 */
.calc-step, .calc-col, .calculation-column {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 18px;
}

.formula-display {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 40px 16px 16px;
    margin: 8px 0 0 0;
    min-height: 36px;
    font-size: 1em;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    word-break: break-all;
}

/* 结果区域分组简化 */
.result-basic, .result-efficiency {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 32px;
    margin-bottom: 10px;
    background: none;
    border: none;
    padding: 0;
}
.result-basic > div, .result-efficiency > div {
    min-width: 120px;
    font-size: 1em;
    color: #333;
}

/* 级别颜色 */
.result-efficiency .level-1 { color: #2ecc71; }
.result-efficiency .level-2 { color: #3498db; }
.result-efficiency .level-3 { color: #f39c12; }

/* 移除旧卡片样式 */
.calculation-card, .calculation-step, .calculation-column {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}