@charset "utf-8";
/* 主容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    min-height: calc(100vh - 80px);
}

/* 计算器容器样式 - 修改为flex布局 */
.calculator-wrapper {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .calculator-wrapper {
        flex-direction: column;
    }
}

.calculator-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 30px;
    flex: 1;
}

.calculator-title {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculator-title i {
    color: #3498db;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    width: 180px;
    text-align: right;
    flex-shrink: 0;
}

.form-group label span {
    color: #e74c3c;
    font-size: 1.2rem;
}

.form-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    width: 250px;
    flex-shrink: 0;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input.error {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

.unit {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    background: white;
    padding: 0 5px;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    margin-left: 195px;
}

.calculate-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

.reset-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

/* 结果容器样式 - 放在右边 */
.result-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 30px;
    flex: 0 0 450px;
    border: 1px solid #eaeaea;
    display: none; /* 初始隐藏 */
}

.result-container.visible {
    display: block;
}

@media (max-width: 992px) {
    .result-container {
        flex: 1;
        margin-top: 20px;
    }
}

.result-title {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #e0e0e0;
}

.result-label {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-value span {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-left: 5px;
}

/* 等待计算状态样式 */
.result-value.waiting {
    font-size: 1.6rem;
    color: #95a5a6;
    font-weight: 500;
}

@media (max-width: 768px) {
    .result-value.waiting {
        font-size: 1.4rem;
    }
}

.result-coefficient {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 8px;
    font-style: italic;
}

/* 链接页面样式 */
.links-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 30px;
}

.links-title {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.link-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

.link-card:nth-child(2)::before {
    background: linear-gradient(90deg, #e74c3c, #e67e22);
}

.link-card:nth-child(3)::before {
    background: linear-gradient(90deg, #9b59b6, #34495e);
}

.link-card:nth-child(4)::before {
    background: linear-gradient(90deg, #2ecc71, #3498db);
}

.link-card:nth-child(5)::before {
    background: linear-gradient(90deg, #f1c40f, #e67e22);
}

.link-card-title {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.link-card-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    min-height: 60px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #3498db;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
}

.link-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 下载页面样式 */
.download-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.download-title {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.download-subtitle {
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.download-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
}

.download-item:hover {
    border-color: #3498db;
    transform: translateX(5px);
}

.download-item-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-item-info {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #2ecc71;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    margin-top: 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #2980b9;
    gap: 12px;
}

/* 响应式设计 - 重点修复移动端文本框问题 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .calculator-container {
        padding: 20px;
    }
    
    .calculator-title {
        font-size: 1.5rem;
    }
    
    .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .form-group label {
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
    }
    
    .form-input {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    .input-container {
        width: 100%;
    }
    
    .button-group {
        margin-left: 0;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .calculate-btn, .reset-btn {
        width: 48%;
        padding: 12px 15px;
    }
    
    .result-value {
        font-size: 1.8rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .download-container {
        padding: 25px 20px;
    }
    
    .form-input {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .calculate-btn, .reset-btn {
        width: 100%;
    }
}

/* 表单验证提示 */
.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    margin-left: 195px;
    display: none;
}

@media (max-width: 768px) {
    .error-message {
        margin-left: 0;
        width: 100%;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}