/* 长度单位转换器 - 专用样式 */

/* 分类区域样式 */
.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, #56ab2f 0%, #a8e6cf 100%);
}

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

/* 市制单位分类使用橙色主题 */
.unit-category:nth-child(4) h4::before {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 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.updating {
    background-color: #fef3c7;
    border-color: #f59e0b;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* 清空按钮容器 */
.clear-button-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.clear-button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.clear-button:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

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

/* 信息区域样式 */
.info-section {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
}

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

.info-section h3::before {
    content: '📏';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

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

.info-section ul li {
    padding: 0.5rem 0;
    color: #475569;
    position: relative;
    padding-left: 1.5rem;
}

.info-section ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* 换算示例样式 */
.conversion-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.example-group {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.example-group h4 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.example-group h4::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.example-group:nth-child(2) h4::before {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.example-group:nth-child(3) h4::before {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.example-group:nth-child(4) h4::before {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.example-group p {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.example-group p:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .info-section {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .conversion-examples {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .example-group {
        padding: 1rem;
    }
    
    .clear-button-container {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .info-section {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
    }
    
    .info-section h3 {
        color: #f1f5f9;
    }
    
    .info-section ul li {
        color: #cbd5e1;
    }
    
    .example-group {
        background: #334155;
        border-color: #475569;
    }
    
    .example-group h4 {
        color: #f1f5f9;
    }
    
    .example-group p {
        color: #94a3b8;
    }
}

/* 特殊效果 */
.unit-category:hover h4::before {
    height: 1.4rem;
    transition: height 0.2s ease-in-out;
}

/* 输入框聚焦时的特殊效果 */
.input-group input:focus + .unit-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease-in-out;
}

/* 数值验证样式 */
.input-group input.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.input-group input.valid {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* 加载状态 */
.input-group input.loading {
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}