/* ===== Base64 编解码工具样式 ===== */
.base64-tool {
    width: 100%;
    max-width: 100%;
}

.base64-tool-body {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ===== 介绍区 ===== */
.base64-tool-intro {
    background: #e8f5e9;
    border-left: 4px solid #43a047;
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 24px;
    font-size: 14px;
}
.base64-tool-intro p {
    margin: 4px 0;
}
.base64-tool-intro ul {
    margin: 6px 0 4px 0;
    padding-left: 20px;
}
.base64-tool-intro li {
    margin: 2px 0;
    display: inline-block;
    margin-right: 16px;
}
.base64-tool-intro strong {
    color: #2e7d32;
}

/* ===== 主体：左右两栏 ===== */
.base64-tool-main {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    align-items: stretch;
}

/* ===== 左栏：输入区 ===== */
.base64-input-area {
    flex: 0.9;
    min-width: 260px;
    display: flex;
    flex-direction: column;
}
.base64-input-area label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
    color: #2c3e50;
    flex-shrink: 0;
}

.base64-textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
    flex: 1;
}
.base64-textarea:focus {
    border-color: #43a047;
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.12);
}

.base64-btn-group {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* 按钮统一灰色 */
.base64-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #d0d4d8;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    background: #f1f3f5;
    color: #555;
}
.base64-btn:hover {
    background: #e5e8eb;
    border-color: #b0b4b8;
}
.base64-btn:active {
    background: #d5d8db;
}

/* ===== 右栏：输出区（4 行紧凑） ===== */
.base64-output-area {
    flex: 1.2;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.base64-output-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 6px 14px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
}

/* 左侧标签 */
.base64-output-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    font-weight: 500;
    min-width: 68px;
}

/* 中间结果值 */
.base64-result-box {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #1a1a2e;
    word-break: break-all;
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    line-height: 1.5;
    max-height: 60px;
    overflow-y: auto;
}
.base64-result-box.empty {
    color: #999;
    font-style: italic;
}

/* 滚动条美化 */
.base64-result-box::-webkit-scrollbar {
    width: 4px;
}
.base64-result-box::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* 右侧复制按钮 */
.base64-copy-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 2px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.base64-copy-btn:hover {
    background: #43a047;
    border-color: #43a047;
    color: #fff;
}
.base64-copy-btn.copied {
    background: #2d7d46;
    border-color: #2d7d46;
    color: #fff;
}

/* ===== 使用说明 ===== */
.base64-tool-usage {
    background: #f8f9fa;
    padding: 18px 22px;
    border-radius: 6px;
    border-left: 4px solid #43a047;
    margin-top: 28px;
}
.base64-tool-usage > p {
    margin: 0 0 12px 0;
    font-weight: 600;
    font-size: 15px;
}

.base64-usage-grid {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.base64-usage-col {
    flex: 1;
    min-width: 240px;
}
.base64-usage-col p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.7;
}
.base64-usage-col ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}
.base64-usage-col li {
    margin: 3px 0;
    font-size: 14px;
    line-height: 1.6;
}
.base64-usage-col strong {
    color: #2c3e50;
}
.base64-usage-col code {
    background: #e9ecef;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .base64-tool-body {
        padding: 16px 14px;
    }
    .base64-tool-main {
        flex-direction: column;
        align-items: stretch;
    }
    .base64-input-area {
        flex: 1;
        min-width: auto;
    }
    .base64-textarea {
        min-height: 80px;
        flex: 1;
    }
    .base64-output-area {
        min-width: auto;
        gap: 6px;
    }
    .base64-output-item {
        padding: 5px 10px;
        flex-wrap: wrap;
        gap: 4px;
        flex: 1;
    }
    .base64-output-label {
        min-width: 50px;
        font-size: 11px;
    }
    .base64-result-box {
        font-size: 12px;
        order: 3;
        flex-basis: 100%;
        padding-left: 0;
        max-height: 40px;
    }
    .base64-copy-btn {
        font-size: 11px;
        padding: 2px 10px;
    }
    .base64-btn-group {
        justify-content: center;
    }
    .base64-btn {
        flex: 1;
        text-align: center;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 13px;
    }
    .base64-usage-grid {
        flex-direction: column;
        gap: 16px;
    }
    .base64-tool-intro ul li {
        display: block;
        margin-right: 0;
    }
}