/* 字节单位转换器 - 专用样式 */

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

.unit-category h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    padding-left: 1rem;
}

.unit-category h4::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* 存储单位分类使用蓝色主题 */
.unit-category:nth-child(2) h4::before {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 单位输入网格 */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .unit-grid {
        grid-template-columns: 1fr;
    }
}

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

/* 输入组样式 */
.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    background-color: #ffffff;
    color: #111827;
}

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

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

/* 更新动画效果 */
.input-group input.updated {
    background-color: #dbeafe;
    border-color: #3b82f6;
    animation: updatePulse 0.3s ease-in-out;
}

@keyframes updatePulse {
    0% {
        transform: scale(1);
        background-color: #dbeafe;
    }
    50% {
        transform: scale(1.02);
        background-color: #bfdbfe;
    }
    100% {
        transform: scale(1);
        background-color: #dbeafe;
    }
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

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

/* 信息卡片样式 */
.info-card {
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.info-title::before {
    content: '💡';
    margin-right: 0.5rem;
    font-size: 1.125rem;
}

.info-content {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .info-content {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.info-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.info-section h3::before {
    content: '▶';
    color: #3b82f6;
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

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

.info-section li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
    line-height: 1.5;
}

.info-section li:last-child {
    border-bottom: none;
}

.info-section li strong {
    color: #111827;
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .unit-category h3 {
        font-size: 1rem;
    }
    
    .input-group label {
        font-size: 0.8rem;
    }
    
    .input-group input {
        padding: 0.625rem;
        font-size: 0.8rem;
    }
}

/* 特殊单位标识 */
.unit-category:nth-child(1) h3::before {
    background-color: #10b981; /* 基础单位 - 绿色 */
}

.unit-category:nth-child(2) h3::before {
    background-color: #3b82f6; /* 十进制单位 - 蓝色 */
}

.unit-category:nth-child(3) h3::before {
    background-color: #8b5cf6; /* 二进制单位 - 紫色 */
}

/* 输入框占位符样式 */
.input-group input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* 禁用状态样式 */
.input-group input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* 错误状态样式 */
.input-group input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.input-group input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}