/* ── Tab 切换 ── */
.tab-bar {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.7rem 1.5rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: #2563eb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* ── 上传区 ── */
.upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 10px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #2563eb;
    background: #f0f4ff;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.upload-text {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.upload-hint {
    font-size: 0.82rem;
    color: #999;
}

/* ── 图片预览+结果 ── */
.img-result {
    margin-top: 1.5rem;
}

.img-preview-wrap {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.img-preview {
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    object-fit: contain;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, white 0% 50%) 50% / 16px 16px;
}

.img-info {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.8;
}

.b64-output-wrap {
    margin-bottom: 0;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.btn-sm {
    padding: 0.25rem 0.8rem;
    font-size: 0.82rem;
}

.b64-output-text,
.b64-textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    resize: vertical;
    color: #333;
    background: #fafafa;
    box-sizing: border-box;
}

.b64-output-text {
    background: #f8f9fb;
}

.b64-textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
}

.b64-input-wrap {
    margin-bottom: 1rem;
}

/* ── Base64转图片结果 ── */
.decode-result {
    margin-top: 1.5rem;
}

.decode-preview-wrap {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background-image: repeating-conic-gradient(#f0f0f0 0% 25%, white 0% 50%);
    background-size: 16px 16px;
}

.decode-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 6px;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.88rem;
    }

    .upload-area {
        padding: 1.5rem 1rem;
    }

    .img-preview-wrap {
        flex-direction: column;
        align-items: center;
    }

    .img-preview {
        max-width: 100px;
        max-height: 100px;
    }

    .b64-output-text,
    .b64-textarea {
        font-size: 0.78rem;
    }
}