/* ================================================================
   菜刀客在线工具页 · image-base64-converter.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 覆盖公共值：本页容器更宽 ---- */
.container {
    max-width: 1400px;
}

.footer {
    max-width: 1400px;
}

/* ---- 双栏并排 ---- */
.main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.panel {
    display: flex;
    flex-direction: column;
    min-height: 640px;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    padding: 15px;
}

.panel-actions .btn {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-upload {
    cursor: pointer;
}

/* ---- 上传区 ---- */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 220px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-zone.drag {
    border-color: #667eea;
    background: #eef2ff;
    color: #4338ca;
}

.upload-zone .drop-icon {
    font-size: 42px;
}

.upload-zone .drop-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.upload-zone .drop-sub {
    font-size: 12px;
    color: #9ca3af;
}

/* ---- 图片预览 ---- */
.preview {
    display: none;
    text-align: center;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fcfcfd;
}

.preview img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
}

.preview-large {
    min-height: 200px;
    justify-content: center;
    align-items: center;
}

.preview-large img {
    max-height: 300px;
}

.preview-large .empty-state.compact {
    border: none;
    background: transparent;
    margin: 0;
}

/* ---- 代码输入 / 输出区 ---- */
.code-area {
    width: 100%;
    min-height: 160px;
    flex: 1;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    word-break: break-all;
    outline: none;
    color: #374151;
    background: #fff;
    box-sizing: border-box;
}

.code-area:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.code-area[readonly] {
    background: #f9fafb;
    color: #4b5563;
}

/* ---- 选项 ---- */
.opt-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    flex-shrink: 0;
}

.opt-check input {
    accent-color: #667eea;
}

/* ---- 状态条 ---- */
.status-bar {
    flex-shrink: 0;
}

.status-bar .stats {
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
}

.status-bar span:first-child {
    flex-shrink: 0;
}

/* ---- 小屏：双栏改上下纵向排列 ---- */
@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .panel {
        min-height: 0;
    }

    .panel-body {
        padding: 12px;
    }

    .code-area {
        min-height: 120px;
    }

    .upload-zone {
        min-height: 160px;
    }
}
