/* ============================================
   GGB 统一浮动美化工具 - 样式
   适用于：AI GGB / 课件 / AI作品 三个页面
   ============================================ */

/* 浮动开关按钮 —— 竖排贴右边 */
.ggb-beautify-toggle {
    position: fixed;
    right: 0;
    bottom: 50%;
    transform: translateY(50%);
    z-index: 10000;
    writing-mode: vertical-rl;
    padding: 10px 6px;
    border-radius: 8px 0 0 8px;
    border: 1px solid #d0d5dd;
    border-right: none;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 2px;
}

.ggb-beautify-toggle:hover {
    box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.18);
    background: #f3f4f6;
}

.ggb-beautify-toggle.active {
    background: #eef2ff;
    border-color: #818cf8;
    color: #4f46e5;
}

.ggb-beautify-toggle i {
    writing-mode: horizontal-tb;
    font-size: 14px;
}

/* 浮动面板 —— 白色 */
.ggb-beautify-panel {
    position: fixed;
    right: 32px;
    bottom: 50%;
    transform: translateY(50%);
    z-index: 10001;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 0;
    display: none;
    color: #1f2937;
    font-size: 13px;
    animation: beautifySlideIn 0.2s ease-out;
}

.ggb-beautify-panel.show {
    display: block;
}

@keyframes beautifySlideIn {
    from {
        opacity: 0;
        transform: translateY(50%) translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateY(50%) translateX(0);
    }
}


/* 面板头部 */
.beautify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.beautify-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #6366f1;
}

.beautify-header-title i {
    margin-right: 6px;
}

.beautify-close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.beautify-close-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

/* 面板内容区 */
.beautify-body {
    padding: 8px 16px 14px;
}

/* 分组标题 */
.beautify-section {
    margin-bottom: 10px;
}

.beautify-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}

/* 滑动条行 */
.beautify-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.beautify-slider-label {
    flex: 0 0 60px;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.beautify-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.beautify-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    transition: transform 0.15s;
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.3);
}

.beautify-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.beautify-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    border: none;
}

.beautify-slider-value {
    flex: 0 0 24px;
    text-align: right;
    font-size: 12px;
    color: #6366f1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 复选框行 */
.beautify-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.beautify-check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    transition: background 0.15s;
    user-select: none;
    font-size: 12px;
}

.beautify-check-item:hover {
    background: #eef2ff;
}

.beautify-check-item input[type="checkbox"] {
    accent-color: #6366f1;
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.beautify-check-item span {
    color: #374151;
}

/* 滚动条 */
.ggb-beautify-panel::-webkit-scrollbar {
    width: 4px;
}

.ggb-beautify-panel::-webkit-scrollbar-track {
    background: transparent;
}

.ggb-beautify-panel::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ggb-beautify-panel {
        right: 8px;
        left: 8px;
        bottom: 50%;
        width: auto;
        max-height: 60vh;
    }

    .ggb-beautify-toggle {
        padding: 8px 5px;
        font-size: 12px;
    }
}
