* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8fb 100%);
    min-height: 100vh;
    padding: 0.8rem 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.calc-container {
    width: 95%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.1);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}
.calc-container:hover {
    transform: translateY(-3px);
}
.calc-header {
    background: linear-gradient(90deg, #4299e1, #38b2ac);
    color: #fff;
    padding: 1rem;
    text-align: center;
}
.calc-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.calc-header p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0;
}
.type-switch {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f0f5ff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background-color: #f8fbff;
}
.type-switch label {
    font-size: 0.85rem;
    color: #2d3748;
    cursor: pointer;
    margin: 0;
}
.type-switch input {
    width: 1rem;
    height: 1rem;
    accent-color: #4299e1;
}
.input-section {
    padding: 1rem;
}
.input-group {
    margin-bottom: 0.8rem;
}
.input-group.hide {
    display: none;
}
.input-group label {
    display: block;
    font-size: 0.8rem;
    color: #2d3748;
    margin-bottom: 0.3rem;
    font-weight: 500;
}
.input-group input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e0e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #fafdff;
}
.input-group input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.1);
    background-color: #fff;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem;
    background-color: #f8fbff;
    border-radius: 8px;
}
.checkbox-group input {
    width: 0.9rem;
    height: 0.9rem;
    accent-color: #4299e1;
}
.checkbox-group label {
    font-size: 0.85rem;
    color: #2d3748;
    cursor: pointer;
    margin: 0;
}
.checkbox-group .tips {
    font-size: 0.7rem;
    color: #6c757d;
    margin-left: 0.3rem;
}
.btn-group {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
}
.calc-btn {
    flex: 1;
    padding: 0.7rem 0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}
.primary-btn {
    background: #4299e1;
    color: #fff;
}
.primary-btn:hover {
    background: #3182ce;
    transform: translateY(-2px);
}
.primary-btn:disabled {
    background: #a0c4ff;
    cursor: not-allowed;
    transform: none;
}
.secondary-btn {
    background: #f0f5ff;
    color: #4299e1;
    border: 1px solid #e0e8f0;
}
.secondary-btn:hover {
    background: #e8f0ff;
    transform: translateY(-2px);
}
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 0.8rem;
}
.result-modal {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-title {
    font-size: 1.1rem;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f5ff;
}
.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #718096;
    cursor: pointer;
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}
.close-modal:hover {
    color: #4299e1;
    background-color: #f0f5ff;
}
.progress-container {
    width: 100%;
    height: 6px;
    background-color: #f0f5ff;
    border-radius: 3px;
    margin-bottom: 1rem;
    overflow: hidden;
    display: none;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4299e1, #38b2ac);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease-in-out;
}
.calc-formula {
    background-color: #f8fbff;
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #2d3748;
    line-height: 1.6;
    border: 1px solid #e8f0ff;
}
.formula-title {
    font-weight: 600;
    color: #4299e1;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.formula-item {
    margin-bottom: 0.3rem;
}
.formula-item span {
    color: #e53e3e;
    font-weight: 500;
}
.result-list {
    margin-top: 0.5rem;
}
.modal-result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f5f5f5;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s ease;
}
.modal-result-item.show {
    opacity: 1;
    transform: translateX(0);
}
.modal-label {
    font-size: 0.85rem;
    color: #4a5568;
}
.modal-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4299e1;
}
.unit {
    font-size: 0.75rem;
    color: #718096;
    margin-left: 2px;
}
.total-item {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 2px solid #4299e1;
}
.total-item .modal-label {
    color: #2d3748;
    font-size: 0.9rem;
}
.total-item .modal-value {
    color: #e53e3e;
    font-size: 0.95rem;
}
.save-btn {
    width: 100%;
    padding: 0.7rem 0;
    margin-top: 1rem;
    border-radius: 8px;
    background-color: #38b2ac;
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.save-btn:hover {
    background-color: #2c8c87;
}
.save-btn i {
    font-size: 1rem;
}
.copyright {
    text-align: center;
    font-size: 0.75rem;
    color: #6c757d;
    width: 100%;
    margin-top: auto;
    padding-bottom: 0.5rem;
}
.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* 自动填充列，每列至少 150px */
  gap: 20px; /* 元素间距 */
}