/* 几何图形计算器样式 */

/* 主容器样式 */
.calculator-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
}

/* 图形分类样式 */
.shape-category {
    margin-bottom: 2rem;
}

.shape-category h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* 图形网格布局 */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* 图形按钮样式 */
.shape-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px;
    text-align: center;
}

.shape-btn:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.shape-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.shape-icon {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.shape-btn span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.shape-btn.active span {
    color: #1e40af;
    font-weight: 600;
}

/* 输入区域样式 */
.input-section {
    border-bottom: 1px solid #e9ecef;
}

.input-section h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.shape-info {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.shape-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    min-height: 150px;
    border: 2px solid #dee2e6;
    margin: 8px 0;
}

.shape-preview svg {
    max-width: 100%;
    max-height: 100%;
}

.shape-description {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.shape-description h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.shape-description p {
    color: #6c757d;
    line-height: 1.5;
}

.input-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    color: #495057;
    margin-bottom: 5px;
    font-weight: 500;
}

.input-group input {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group .unit {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 3px;
}

/* 计算和清空按钮 - 统一标准样式 */
.calculate-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calculate-btn:hover {
    background-color: #1d4ed8;
    transform: scale(1.02);
}

.calculate-btn:active {
    transform: scale(0.98);
}

.clear-btn {
    background-color: #6b7280;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-btn:hover {
    background-color: #dc2626;
    transform: scale(1.02);
}

.clear-btn:active {
    transform: scale(0.98);
}

/* 结果区域样式 */

.result-section h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 10px;
}

.result-item h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 5px;
}

.result-unit {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 公式区域样式 */
.formulas {
   
}

.formulas h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.formula-item {
    background: white;
    margin-bottom: 10px;
    border-radius: 6px;
}

.formula-item:last-child {
    margin-bottom: 0;
}

.formula-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.formula-expression {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* 错误提示样式 */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin-top: 10px;
}
.container {
    padding: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .shape-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .shape-preview {
        min-height: 120px;
    }
    
    .input-fields {
        grid-template-columns: 1fr;
    }
    
    .results {
        grid-template-columns: 1fr;
    }
    
    .shape-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .shape-buttons {
        grid-template-columns: 1fr;
    }
    
    .calculate-btn {
        width: 100%;
        margin-bottom: 4px;
    }
    .clear-btn {
        width: 100%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section {
    padding-bottom: 12px;
}

.input-section,
.result-section {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .calculate-btn {
    background: #6c757d;
    cursor: not-allowed;
}

.loading .calculate-btn::after {
    content: " 计算中...";
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}