﻿/* assets/css/editor.css - 编辑器样式（深色科技风格 · 四列布局�?*/

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

/* ========== 顶部工具�?========== */
.top-bar {
    height: 50px;
    background: linear-gradient(135deg, #1a1c2e, #2a1a3e);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #2a2a4a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 100;
    position: relative;
    flex-wrap: nowrap;
}

/* 顶部工具栏内的设备选择�?*/
.top-bar .device-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 500px;
    margin-right: 15px;
}
.top-bar .device-selector label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}
.top-bar .device-selector select {
    width: 150px;
    min-width: 120px;
    max-width: 180px;
    background: #161822;
    border: 1px solid #333;
    color: #ccc;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}
.top-bar .device-selector select:hover {
    border-color: #667eea;
}
.top-bar .device-selector select option {
    background: #161822;
    color: #ccc;
    font-size: 11px;
}
.top-bar .device-info {
    font-size: 10px;
    color: #667eea;
    white-space: nowrap;
    flex-shrink: 0;
}
.top-bar .orientation-toggle {
    display: flex;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}
.top-bar .orient-btn {
    background: #161822;
    border: none;
    color: #888;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    border-right: 1px solid #333;
    white-space: nowrap;
}
.top-bar .orient-btn:last-child {
    border-right: none;
}
.top-bar .orient-btn:hover {
    color: #ccc;
    background: #1e2035;
}
.top-bar .orient-btn.active {
    background: #667eea;
    color: #fff;
}

.top-bar .logo {
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 20px;
    flex-shrink: 0;
}
.top-bar .page-title {
    font-size: 14px;
    color: #888;
}

/* ========== 四列主体 ========== */
.main-container {
    display: flex;
    height: calc(100vh - 50px);
}

/* �?列：分类�?*/
.col-sidebar {
    width: 220px;
    min-width: 220px;
    background: #161822;
    border-right: 1px solid #2a2a4a;
    display: flex;
    flex-direction: column;
    transition: width 0.3s, min-width 0.3s;
    overflow: hidden;
}
.col-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}
.sidebar-header {
    padding: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #aaa;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-toggle {
    background: none;
    border: 1px solid #444;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
}
.sidebar-toggle:hover { color: #fff; border-color: #667eea; }

/* 侧边栏展开按钮（收起时显示） */
.sidebar-expand {
    display: none;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 8px 6px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 12px;
    writing-mode: vertical-rl;
    letter-spacing: 2px;
    box-shadow: 2px 0 10px rgba(102,126,234,0.3);
    transition: all 0.3s;
}
.sidebar-expand:hover {
    padding-left: 10px;
    box-shadow: 2px 0 15px rgba(102,126,234,0.5);
}
.col-sidebar.collapsed ~ .sidebar-expand,
.sidebar-expand.show {
    display: block;
}
.category-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.category-list::-webkit-scrollbar { width: 4px; }
.category-list::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.cat-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cat-item:hover { background: #1e2035; }
.cat-item.active {
    background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
    color: #667eea;
    border-left: 3px solid #667eea;
}
.cat-count {
    margin-left: auto;
    font-size: 12px;
    color: #888;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 10px;
}
.cat-item:hover .cat-count {
    background: rgba(255,255,255,0.1);
}
.cat-item.active .cat-count {
    color: #667eea;
    background: rgba(102,126,234,0.15);
}

/* �?列：素材列表 */
.col-templates {
    width: 450px;
    min-width: 450px;
    display: flex;
    flex-direction: column;
    background: #12131f;
    border-right: 1px solid #2a2a4a;
}
.template-header {
    padding: 12px 15px;
    font-size: 13px;
    color: #888;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.template-count { color: #667eea; font-weight: bold; }
.template-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.template-grid::-webkit-scrollbar { width: 4px; }
.template-grid::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.tpl-card {
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid transparent;
    position: relative;
}
.tpl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.2);
    border-color: #667eea;
}
.tpl-card-preview {
    min-height: 60px;
    padding: 8px;
    background: #fff;
}
.tpl-card-preview > * { max-width: 100%; box-sizing: border-box; }
.tpl-card-title {
    display: none;
    position: absolute;
    bottom: 6px;
    left: 8px;
    font-size: 11px;
    color: #aaa;
    background: rgba(22,24,34,0.85);
    padding: 2px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}
.tpl-card:hover .tpl-card-title {
    display: block;
}
.tpl-vip-tag {
    display: inline-block;
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 4px;
    font-weight: bold;
    vertical-align: middle;
}
.empty-templates {
    text-align: center;
    padding: 40px 10px;
    color: #555;
    font-size: 13px;
	background-color:#fff;
}

/* �?列：移动端画�?*/
.col-canvas {
    flex: 1;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    background: #161822;
}
.canvas-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid #2a2a4a;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

/* 工具栏按�?*/
.tb-btn {
    background: #1e2035;
    border: 1px solid #333;
    color: #ccc;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
}
.tb-btn:hover { background: #2a2d4a; color: #fff; border-color: #667eea; }
.tb-btn.active { background: #667eea; color: #fff; border-color: #667eea; }
.tb-separator {
    width: 1px;
    background: #333;
    margin: 0 4px;
    align-self: stretch;
}
.tb-select {
    background: #1e2035;
    border: 1px solid #333;
    color: #ccc;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
.tb-select option { background: #1e2035; }
.color-picker-wrapper {
    position: relative;
    display: inline-flex;
}
.tb-color-btn {
    width: 30px;
    height: 28px;
    background: #1e2035;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tb-color-btn .color-indicator {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 4px;
    border-radius: 2px;
    background: #ccc;
}
.font-size-options {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e2035;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 0;
    display: none;
    z-index: 100;
    min-width: 60px;
}
.font-size-options.show { display: block; }
.font-size-option {
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    color: #ccc;
}
.font-size-option:hover { background: #2a2d4a; color: #fff; }

/* 画布主体 */
.canvas-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #0a0b14;
    min-height: 0;
}
.canvas-body::-webkit-scrollbar { width: 4px; }
.canvas-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.phone-frame {
    width: var(--phone-width, 375px);
    height: var(--phone-height, 667px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(102,126,234,0.15);
    overflow: hidden;
    position: relative;
    transition: width 0.3s, height 0.3s;
}
.phone-frame-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}
.phone-screen {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
    outline: none;
    color: #333;
    font-size: 15px;
    line-height: 1.8;
    box-sizing: border-box;
}
.phone-screen::-webkit-scrollbar { width: 4px; }
.phone-screen::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.phone-screen:empty::before {
    content: '点击左侧素材插入到此区域...';
    color: #ccc;
    font-size: 14px;
}
.phone-screen * { max-width: 100% !important; }

/* 画布中的素材容器 */
.canvas-block {
    position: relative;
    transition: box-shadow 0.2s;
    margin: 4px 0;
    border: 2px solid transparent;
}
.canvas-block.active {
    border-color: #667eea;
}
.canvas-block.active .block-drag-btn,
.canvas-block.active .block-del-btn {
    display: block;
}

/* 拖动按钮（左上角） */
.canvas-block .block-drag-btn {
    display: none;
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 10px;
    line-height: 22px;
    text-align: center;
    cursor: grab;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.canvas-block .block-drag-btn:hover {
    background: #764ba2;
}
.canvas-block .block-drag-btn:active {
    cursor: grabbing;
}

/* 拖动时的虚线框占位符 */
.drag-placeholder {
    height: 4px;
    margin: 8px 0;
    border: 2px dashed #667eea;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.2s ease;
}

/* 正在拖动的素材 */
.canvas-block.dragging {
    opacity: 0.3;
    pointer-events: none;
}

/* 删除按钮（右上角） */
.canvas-block .block-del-btn {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.canvas-block .block-del-btn:hover {
    background: #d9363e;
}

/* 底部操作栏 */
.canvas-footer {
    padding: 10px 15px;
    border-top: 1px solid #2a2a4a;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-shrink: 0;
    background: #161822;
}
.action-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s;
}
.btn-copy {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.btn-copy:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-clear {
    background: #2a2d4a;
    color: #aaa;
    border: 1px solid #444;
}
.btn-clear:hover { color: #fff; border-color: #ff4d4f; }

/* 缩放比例控件 */
.top-bar .scale-sep {
    color: #333;
    margin: 0 6px;
    flex-shrink: 0;
}
.top-bar .scale-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}
.top-bar .device-selector .scale-select {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    background: #161822;
    border: 1px solid #333;
    color: #ccc;
    padding: 4px 4px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}
.top-bar .scale-select:hover { border-color: #667eea; }
.top-bar .scale-select option { background: #161822; color: #ccc; font-size: 11px; }
/* 预览按钮 */
.btn-preview {
    background: linear-gradient(135deg, #36cfc9, #13a8a8);
    color: #fff;
}
.btn-preview:hover { opacity: 0.9; transform: translateY(-1px); }

/* 保存按钮 */
.btn-save {
    background: linear-gradient(135deg, #52c41a, #389e0d);
    color: #fff;
}
.btn-save:hover { opacity: 0.9; transform: translateY(-1px); }

/* 预览弹窗 */
.preview-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.preview-overlay.show { display: flex; }
.preview-overlay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.preview-overlay-title {
    font-size: 16px;
    color: #e0e0e0;
    font-weight: bold;
}
.preview-overlay-close {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.preview-overlay-close:hover { background: rgba(255,77,79,0.6); border-color: #ff4d4f; }
.preview-phone {
    width: 375px;
    max-height: 80vh;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(102,126,234,0.3);
    position: relative;
}
.preview-phone-notch {
    width: 120px; height: 24px;
    background: #0f1117;
    border-radius: 0 0 14px 14px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.preview-phone-content {
    padding: 10px 15px;
    max-height: calc(80vh - 24px);
    overflow-y: auto;
    color: #333;
    font-size: 15px;
    line-height: 1.8;
}
.preview-phone-content::-webkit-scrollbar { width: 3px; }
.preview-phone-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.draft-status {
    font-size: 11px;
    color: #666;
    margin-left: 14px;
    transition: color 0.3s;
}
.draft-status.saved { color: #52c41a; }
.draft-status.saving { color: #667eea; }

/* �?列：VIP素材（预留） */
.col-vip {
    width: 240px;
    min-width: 240px;
    background: #12131f;
    border-left: 1px solid #2a2a4a;
    display: flex;
    flex-direction: column;
    transition: width 0.3s, min-width 0.3s;
}
.col-vip.collapsed {
    width: 0;
    min-width: 0;
    border-left: none;
}
.vip-header {
    padding: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #aaa;
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.vip-badge {
    font-size: 10px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}
.vip-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}
.vip-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.vip-text {
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}
.vip-desc {
    font-size: 12px;
    color: #444;
    line-height: 1.6;
}

/* ========== 通用 ========== */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #555;
}
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(102,126,234,0.95);
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 历史记录卡片 */
.history-title {
    font-size: 12px;
    color: #e0e0e0;
    padding: 8px;
    text-align: center;
    word-break: break-all;
}

.history-time {
    font-size: 10px;
    color: #888;
    text-align: center;
    padding: 4px 8px 8px;
}

/* 历史记录卡片美化 */
#historyGrid {
    padding: 8px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.history-batch-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 8px;
    background: #1a1c2e;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
}

.history-batch-bar label {
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-batch-bar .batch-delete-btn {
    margin-left: auto;
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(255,77,79,0.15);
    border: 1px solid rgba(255,77,79,0.3);
    color: #ff4d4f;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-batch-bar .batch-delete-btn:hover {
    background: rgba(255,77,79,0.3);
}

.history-batch-bar .batch-delete-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.history-card {
    position: relative;
    background: #1a1c2e;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.history-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102,126,234,0.2);
}

.history-card.selected {
    border-color: #667eea;
    background: rgba(102,126,234,0.1);
}

.history-card-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background: #12131f;
    border-bottom: 1px solid #2a2a4a;
}

.history-card-header input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.history-card-preview + .history-card-title {
    padding: 4px 8px;
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-title {
    flex: 1;
    font-size: 12px;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-card-delete {
    padding: 2px 6px;
    font-size: 11px;
    background: transparent;
    border: 1px solid rgba(255,77,79,0.3);
    color: #ff4d4f;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 6px;
}

.history-card-delete:hover {
    background: rgba(255,77,79,0.2);
}

.history-card-preview {
    min-height: 50px;
    max-height: 120px;
    overflow: hidden;
    padding: 4px;
    background: #fff;
    border-radius: 4px 4px 0 0;
}
.history-card-preview > * { max-width: 100%; box-sizing: border-box; }

.history-card-body {
    padding: 8px;
}

.history-card-time {
    font-size: 10px;
    color: #666;
    text-align: center;
}

/* ========== Emoji 选择器 ========== */
.emoji-picker {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    width: 360px;
    max-height: 320px;
    background: #1e2035;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    flex-direction: column;
    overflow: hidden;
}
.emoji-picker.show {
    display: flex;
}
.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #333;
    background: #161822;
}
.emoji-picker-title {
    font-size: 13px;
    font-weight: bold;
    color: #ccc;
}
.emoji-picker-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.emoji-picker-close:hover {
    color: #ff4d4f;
}
.emoji-search {
    padding: 8px;
    border-bottom: 1px solid #333;
}
.emoji-search-input {
    width: 100%;
    padding: 6px 10px;
    background: #12131f;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    outline: none;
}
.emoji-search-input:focus {
    border-color: #667eea;
}
.emoji-search-input::placeholder {
    color: #555;
}
.emoji-categories {
    display: flex;
    padding: 6px 8px;
    gap: 4px;
    border-bottom: 1px solid #333;
    background: #161822;
}
.emoji-cat-btn {
    background: none;
    border: 1px solid transparent;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
.emoji-cat-btn:hover {
    background: #2a2d4a;
    border-color: #444;
}
.emoji-cat-btn.active {
    background: #667eea;
    border-color: #667eea;
}
.emoji-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: flex-start;
}
.emoji-grid::-webkit-scrollbar {
    width: 4px;
}
.emoji-grid::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}
.emoji-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    border: none;
    background: none;
    padding: 0;
}
.emoji-item:hover {
    background: #2a2d4a;
    transform: scale(1.2);
}
.emoji-item:active {
    transform: scale(0.95);
}


/* ========== 可编辑区域样式 ========== */
.editable-zone {
    border: 2px dashed transparent;
    border-radius: 4px;
    transition: all 0.2s;
    margin: 4px 0;
}

/* 悬浮时显示虚线边框 */
.editable-zone:hover {
    border-color: #667eea;
}

/* 选中状态 */
.editable-zone.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* 悬浮覆盖层 */
.zone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    pointer-events: none;
    border-radius: 4px;
    z-index: 10;
}

.editable-zone:hover .zone-overlay {
    background: rgba(102, 126, 234, 0.05);
    opacity: 1;
}

.editable-zone.selected .zone-overlay {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
}

.zone-hint {
    background: #667eea;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s;
}

.editable-zone:hover .zone-hint,
.editable-zone.selected .zone-hint {
    opacity: 1;
    transform: scale(1);
}

/* 模块复制按钮（一键排版区域内每个section的复制按钮） */
.zone-copy-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    z-index: 20;
    display: none;
    transition: all 0.2s;
    opacity: 0.85;
}
.zone-copy-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}
.editable-zone:hover .zone-copy-btn {
    display: block;
}
/* 子模块删除按钮（右上角，复制按钮左侧） */
.zone-del-btn {
    display: none;
    position: absolute;
    top: 4px;
    right: 60px;
    width: 22px;
    height: 22px;
    background: rgba(255,77,79,0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.zone-del-btn:hover {
    background: rgba(220,20,60,0.9);
}
.editable-zone:hover .zone-del-btn {
    display: block;
}

/* 子模块拖动手柄（左上角） */
.zone-drag-btn {
    display: none;
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    background: rgba(102,126,234,0.9);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    cursor: grab;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.zone-drag-btn:hover {
    background: rgba(118,75,162,0.9);
}
.zone-drag-btn:active {
    cursor: grabbing;
}
.editable-zone:hover .zone-drag-btn {
    display: block;
}

/* 子模块拖动时的虚线框占位符 */
.zone-drag-placeholder {
    height: 4px;
    margin: 4px 0;
    border: 2px dashed #667eea;
    border-radius: 4px;
    background: rgba(102, 126, 234, 0.1);
    transition: all 0.2s ease;
}

/* 正在拖动的子模块 */
.editable-zone.dragging {
    opacity: 0.3;
    pointer-events: none;
}
