/* 转码工具样式 */
.encoding-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.encoding-group {
    flex: 1;
}

.encoding-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.encoding-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.encoding-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.swap-btn {
    width: 40px;
    height: 40px;
    margin: 0 15px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--button-bg);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.encoding-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.encoding-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-group {
    flex: 1;
    padding: 15px;
}

.form-group textarea {
    width: 100%;
    height: 100%;
    min-height: 200px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.panel-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
}

.panel-actions div {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-text {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-text:hover {
    background: rgba(52, 152, 219, 0.1);
    text-decoration: underline;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-primary {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-secondary {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
}

.encoding-tools {
    margin-top: 30px;
}

.encoding-tools h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.tool-btn {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.tool-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.info-section {
    margin-top: 20px;
}

.info-section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-section li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .encoding-selector {
        flex-direction: column;
        gap: 15px;
    }
    
    .encoding-group {
        width: 100%;
    }
    
    .swap-btn {
        margin: 0;
        transform: rotate(90deg);
    }
    
    .encoding-container {
        flex-direction: column;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-primary,
    .btn-secondary {
        flex: 1 1 100%;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.encoding-panel {
    animation: fadeIn 0.3s ease;
}

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

.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 20px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 高亮效果 */
.highlight {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}

/* 警告状态 */
.warning {
    background: rgba(241, 196, 15, 0.2);
    border-color: #f1c40f;
}

/* 错误状态 */
.error {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
}