/* 面积转换工具专用样式 - 结合展开结构和现代化样式 */

/* 分类区域样式 */
.unit-category {
    margin-bottom: 2rem;
}

.unit-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.unit-category h3::before {
    content: '';
    width: 4px;
    height: 1.125rem;
    background-color: #3b82f6;
    margin-right: 0.75rem;
    border-radius: 2px;
}

/* 单位输入网格 */
.unit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .unit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .unit-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .unit-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 输入组样式 - 使用第二版的现代化样式 */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* 输入框样式 - 保留第二版的现代化设计 */
.input-group input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input:hover {
    border-color: #9ca3af;
}

.input-group input::placeholder {
    color: #9ca3af;
}

/* 当输入框有值时的样式 */
.input-group input:not(:placeholder-shown) {
    border-color: #facc15;
    font-weight: 500;
}

/* 按钮容器 */
.button-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* 按钮基础样式 - 使用第二版的现代化设计 */
.button-container button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

/* 清空按钮样式 */
.clear-button {
    background-color: #ef4444;
    color: white;
}

.clear-button:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.clear-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* 使用说明样式 */
.tips {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 0.75rem;
    border-left: 4px solid #3b82f6;
}

.tips h3 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips li {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.tips li:before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .unit-grid {
        grid-template-columns: 1fr;
    }
    
    .button-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .button-container button {
        min-width: auto;
        width: 100%;
    }
    
    .tips {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .input-group {
        padding: 1rem;
    }
    
    .input-group label {
        font-size: 1rem;
    }
    
    .input-group input {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

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

.calculator-card {
    animation: fadeIn 0.3s ease-out;
}

.input-group {
    animation: fadeIn 0.3s ease-out;
}

/* 输入验证状态 */
.input-group input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    background-color: #fef2f2;
}

.input-group input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* 加载状态样式 */
.input-group input.loading {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: wait;
}