/* 气泡生成器 样式 — 从 extras.css 拆分 */
/* --- 【全新】气泡生成器样式 --- */
#bubble-generator-page .page-content {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--text-primary);
    background-color: transparent; /* 让页面背景透明，以显示手机的背景 */
    display: flex;
    height: 100%;
    overflow-x: hidden;
}
#bubble-generator-page * { box-sizing: border-box; } /* 只在生成器页面内应用 */
#bubble-generator-page .container { display: flex; width: 100%; height: 100%;flex-direction: column; }
#bubble-generator-page .controls-panel { width: 480px; background-color: var(--bg-color-secondary); padding: 20px;   border-right: 1px solid var(--border-color); box-shadow: 2px 0 10px rgba(0,0,0,0.05); }
#bubble-generator-page .controls-panel h1 { font-size: 24px; text-align: center; margin: 0 0 20px; padding: 0; }
#bubble-generator-page .controls-panel p.intro { font-size: 14px; color: var(--text-secondary); margin: 0 0 20px; padding: 0; line-height: 1.5; }
#bubble-generator-page .control-group { background-color: var(--bg-color-tertiary); border: 1px solid var(--border-color); border-radius: 10px; padding: 15px; margin: 0 0 15px; }
#bubble-generator-page .control-group legend { font-weight: bold; font-size: 16px; margin: 0 0 15px; padding: 0 5px; color: var(--accent-color); }
#bubble-generator-page .control-item { display: flex; align-items: center; margin: 0 0 12px; padding: 0; gap: 10px; flex-wrap: wrap; }
#bubble-generator-page .control-item label { flex-shrink: 0; width: 80px; font-size: 14px; color: var(--text-secondary); margin: 0; padding: 0;}
#bubble-generator-page .control-item input[type="range"] { flex-grow: 1; -webkit-appearance: none; appearance: none; height: 5px; background: #ddd; border-radius: 5px; outline: none; transition: background 0.2s; margin: 0; padding: 0; }
#bubble-generator-page .control-item input[type="range"]:hover { background: #ccc; }
#bubble-generator-page .control-item input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; background: var(--accent-color); cursor: pointer; border-radius: 50%; }
#bubble-generator-page .control-item input[type="color"] { -webkit-appearance: none; -moz-appearance: none; appearance: none; width: 30px; height: 30px; background-color: transparent; border: none; cursor: pointer; padding: 0; margin: 0; }
#bubble-generator-page .control-item input[type="color"]::-webkit-color-swatch { border-radius: 50%; border: 1px solid var(--border-color); }
#bubble-generator-page .control-item input[type="text"], #bubble-generator-page .control-item select, #bubble-generator-page .control-item textarea { flex-grow: 1; background-color: #fff; border: 1px solid var(--border-color); color: var(--text-primary); padding: 5px 8px; border-radius: 5px; font-family: inherit; margin: 0; }
#bubble-generator-page .control-item .value-display { width: 45px; text-align: right; font-size: 13px; color: var(--text-secondary); margin: 0; padding: 0;}
#bubble-generator-page .button-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#bubble-generator-page .button-group button { border: 1px solid var(--border-color); padding: 6px 12px; border-radius: 5px; background-color: #fff; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; font-size: 13px; font-family: inherit; margin: 0; }
#bubble-generator-page .button-group button.compact-btn { padding: 5px 8px; }
#bubble-generator-page .button-group button.active { background-color: var(--accent-color); color: white; border-color: var(--accent-color); }
#bubble-generator-page #gradient-controls, #bubble-generator-page #bg-image-controls, #bubble-generator-page #underline-color-control { width: 100%; display: none; }
#bubble-generator-page .preview-panel {
    position: fixed; /* <-- 关键修改：从 sticky 改为 fixed */
    top: 0;
    left: 0; /* <-- 新增：固定在左边 */
    width: 40%; 
    height: 100%;
    z-index: 100; /* <-- 建议调高 z-index，确保它在最上层 */
    background-color: var(--bg-color-2);
    border-right: 2px solid var(--border-color); /* <-- 把原来的 border-right 加回来 */
}


#bubble-generator-page .preview-area { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><rect width="10" height="10" style="fill:rgb(240,240,240)" /><rect x="10" y="10" width="10" height="10" style="fill:rgb(240,240,240)" /></svg>'); background-repeat: repeat;background-color: #fff; }
#bubble-generator-page .output-area { height: auto; min-height: 250px;background-color: var(--bg-color-secondary); padding: 20px; display: flex; flex-direction: column; border-top: 1px solid var(--border-color); }
#bubble-generator-page .output-area .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#bubble-generator-page .output-area h3 { color: var(--text-secondary); margin: 0; }
#bubble-generator-page #copy-css-btn, #bubble-generator-page #export-png-btn { padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: all 0.2s; color: white; margin: 0;}
#bubble-generator-page #copy-css-btn { background-color: var(--accent-color); } #bubble-generator-page #copy-css-btn:active { transform: scale(0.95); }
#bubble-generator-page #export-png-btn { background-color: var(--success-color); }
#bubble-generator-page #css-output { width: 100%; height: 100%; background-color: #2d2d2d; color: #a9b7c6; font-family: 'Courier New', Courier, monospace; padding: 10px; border-radius: 5px; resize: none; font-size: 14px; line-height: 1.6; }
#bubble-generator-page #live-style-container { display: none; }
#bubble-generator-page .message-row { display: flex; align-items: flex-end; margin-bottom: 15px; max-width: 80%; gap: 10px; }
#bubble-generator-page .message-row.user { margin-left: auto; flex-direction: row-reverse; }
#bubble-generator-page .avatar-wrapper { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
#bubble-generator-page .chat-avatar { width: 100%; height: 100%; object-fit: cover; flex-shrink: 0; }
#bubble-generator-page .message-content { display: flex; flex-direction: column; position: relative; }
#bubble-generator-page .message-row.user .message-content { align-items: flex-end; }
#bubble-generator-page .chat-bubble { padding: 10px 15px; border-radius: 18px; max-width: 100%; word-wrap: break-word; position: relative; }
#bubble-generator-page .member-name { position: absolute; white-space: nowrap; margin: 0;}
#bubble-generator-page .message-timestamp { white-space: nowrap; margin: 0;}
#bubble-generator-page hr.separator { width:100%; border:none; border-top: 1px solid var(--border-color); margin: 15px 0; }
#bubble-generator-page .color-control { display: flex; align-items: center; gap: 8px; flex-grow: 1; }
#bubble-generator-page .color-control > input[type=range] { max-width: 80px; }
#bubble-generator-page .url-tip { font-size: 12px; color: #999; margin: -8px 0 0 90px; padding: 0; width: 100%;}
#bubble-generator-page .deco-layer { border: 1px dashed var(--border-color); border-radius: 8px; padding: 10px; margin-top: 10px; }
#bubble-generator-page .deco-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#bubble-generator-page .deco-header span { font-weight: bold; color: var(--text-secondary); }
#bubble-generator-page .deco-actions button { background: none; border: none; cursor: pointer; padding: 2px; font-size: 16px; color: var(--text-secondary); margin: 0; }
/* --- 【新增】气泡生成器手机端响应式适配 --- */
@media (max-width: 768px) {
    /* 让生成器所在的 .page-content 可以自由滚动 */
    #bubble-generator-page .page-content {
        overflow-y: auto;
        overflow-x: hidden;
    }
   
    /* 1. 将主容器从左右布局改为上下堆叠 */
    #bubble-generator-page .container {
        flex-direction: column;
        height: auto; /* 取消固定高度，让内容自然撑开并滚动 */
    }

    /* 2. 控制面板：宽度占满，高度自适应，移除侧边框 */
    #bubble-generator-page .controls-panel {
        width: 100%;
        height: auto;
        border-right: none;
        overflow-y: visible; /* 取消面板自身的滚动条 */
        flex-shrink: 0;
    }

    /* 4. 预览区域：减小边距，增加最小高度 */
    #bubble-generator-page .preview-area {
        padding: 25px 15px;
        min-height: 300px;
        background-color: #fff; 
    }

    /* 5. 输出区域微调 */
    #bubble-generator-page .output-area {
        height: auto;
        min-height: 250px;
    }

    /* 6. 控件标签宽度自适应，避免在手机上换行错乱 */
    #bubble-generator-page .control-item label {
        flex-basis: 90px;
    }
    /* --- 在 @media (max-width: 768px) { ... } 这个大括号里面 --- */

#bubble-generator-page .preview-panel {
    position: fixed; /* <-- 关键修改 */
    top: 0;
    left: 0;
    width: 100%; /* <-- 关键修改：宽度占满 */
    height: auto; /* <-- 关键修改：高度由内容决定 */
    z-index: 100;
    border-right: none; /* <-- 确保没有右边框 */
    background-color: var(--bg-color-2);
    border-bottom: 2px solid var(--border-color); /* <-- 保留底边框作为分割线 */
}

}
