/* 重量单位转换器 - 专用样式 */

/* 分类区域样式 */
.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.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: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 响应式按钮 */
@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* 计算器卡片样式增强 */
.calculator-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
}

.calculator-card h3 {
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.calculator-card .subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

/* 信息卡片样式 */
.info-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.info-title {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.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 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1rem;
}

.info-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1.5px;
}

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

.info-section li {
    padding: 0.5rem 0;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
    position: relative;
    padding-left: 1.5rem;
}

.info-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

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

/* 标题图标样式 */
.title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #1f2937;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.title .icon {
    color: #667eea;
}

/* 输入框验证状态 */
.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);
}

/* 加载状态 */
.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;
    }
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1f2937;
    color: white;
    text-align: center;
    border-radius: 0.375rem;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .calculator-card,
    .info-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .calculator-card h3,
    .info-title,
    .title {
        color: #f9fafb;
    }
    
    .unit-category h4,
    .info-section h3 {
        color: #e5e7eb;
    }
    
    .input-group label {
        color: #d1d5db;
    }
    
    .input-group input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .input-group input:focus {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    }
    
    .btn-secondary {
        background-color: #374151;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    .btn-secondary:hover {
        background-color: #4b5563;
        border-color: #6b7280;
    }
    
    .info-section li {
        color: #d1d5db;
    }
    
    .info-section li strong {
        color: #f9fafb;
    }
}