/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1E1E1E;
    color: #CCCCCC;
    min-height: 100vh;
    overflow-y: hidden; /* 防止整个页面滚动，让内部滚动 */
}

/* 主容器 */
.editor-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* 顶部标题 */
.nav-header {
    height: 50px;
    background-color: #252526;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

/* 主内容区 - 双栏布局 */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧面板 */
.left-panel {
    width: 360px;
    background-color: #252526;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    gap: 20px;
}

/* 右侧面板 */
.right-panel {
    flex: 1;
    background-color: #1E1E1E;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
}

/* 面板区块样式 */
.panel-section {
    background-color: #333333;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 卡片样式 (右侧) */
.canvas-card, .data-card {
    background-color: #252526;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canvas-card {
    flex: 2; /* 画布占据更多空间 */
    min-height: 300px;
}

.data-card {
    flex: 1;
    min-height: 150px;
}

.card-header {
    height: 40px;
    background-color: #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid #3E3E42;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #DDD;
}

.card-badges {
    display: flex;
    gap: 5px;
}

.badge {
    background-color: #0E639C;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.data-content {
    flex: 1;
    position: relative;
    display: flex;
}

/* 工作类型选择器 */
.work-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.type-btn {
    padding: 8px 0;
    border: none;
    border-radius: 4px;
    background-color: #444;
    color: #CCC;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.type-btn.active {
    background-color: #0E639C; /* VS Code Blue */
    color: #FFFFFF;
    font-weight: bold;
}

.type-btn:hover:not(.active) {
    background-color: #555;
}

/* 上传按钮 */
.upload-btn {
    width: 100%;
    padding: 10px;
    border: 1px dashed #666;
    border-radius: 4px;
    background-color: #2D2D30;
    color: #CCC;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background-color: #3E3E42;
    border-color: #888;
    color: #FFF;
}

/* 工具栏 */
.toolbar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.tool-icon {
    aspect-ratio: 1;
    border-radius: 4px;
    background-color: #2D2D30;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tool-icon.active {
    background-color: #37373D;
    border-color: #0E639C;
    color: #FFF;
}

.tool-icon:hover:not(.disabled) {
    background-color: #3E3E42;
}

.tool-icon.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 应用到所有帧开关 */
.apply-all-switch {
    display: flex;
    align-items: center;
}

.apply-all-switch .switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #888;
}

.apply-all-switch input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

/* 颜色量化开关 */
.quantization-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 10px;
}

.quantization-control .switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #CCC;
}

.quantization-control input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.quantization-hint {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* 画布区域 */
.canvas-wrap {
    flex: 1;
    position: relative;
    background-color: #1E1E1E;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 像素画板 */
.pixel-board-wrap {
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background-color: #000000;
}

.pixel-grid-view {
    display: block;
}

.row {
    display: flex;
}

.cell {
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    /* 恢复网格线 */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 滑块样式 */
.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.s-label {
    width: 60px;
    font-size: 12px;
    color: #AAA;
}

.s-val {
    width: 50px;
    font-size: 12px;
    text-align: right;
    color: #FFF;
    font-family: monospace;
}

.bright-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.bright-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0E639C;
    cursor: pointer;
    border: 2px solid #FFF;
}

/* 颜色选择器 */
.palette-container {
    background-color: #2D2D30;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
}

.palette-scroll {
    overflow-x: auto;
    padding-bottom: 5px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #252526;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.palette {
    display: flex;
    gap: 8px;
    padding: 10px 4px;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 6px; /* 方形圆角更现代 */
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.color-circle.selected {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #FFF;
    z-index: 1;
}

.color-circle.add-btn {
    background: transparent;
    border: 1px dashed #666;
    color: #888;
}

.color-circle.close-btn {
    background: transparent;
    border: 1px solid #666;
    color: #F44336;
}

/* 尺寸设置区域 */
.size-settings-row {
    margin-bottom: 15px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    font-size: 14px; 
    color: #ccc;
}

.size-inputs-group {
    display: flex; 
    align-items: center; 
    gap: 8px;
}

.size-input {
    width: 60px;
    height: 32px;
    background: #333;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    padding: 0 5px;
    text-align: center;
    font-size: 14px;
}

.size-input:focus {
    border-color: #0E639C;
    outline: none;
}

.apply-btn {
    height: 32px;
    padding: 0 15px;
    background: #0E639C;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.apply-btn:hover {
    background: #1177BB;
}

/* 帧管理器 */
.frame-manager {
    background-color: #2D2D30;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
}

.fm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
}

.play-btn {
    padding: 4px 10px;
    background-color: #0E639C;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.frame-list {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.frame-item {
    width: 45px;
    min-width: 45px;
    height: 50px;
    background-color: #333;
    border-radius: 4px;
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.del-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background-color: #E62828;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.frame-item:hover .del-btn {
    display: flex; /* 悬停显示 */
}

.frame-item.add:hover .del-btn {
    display: none; /* 添加按钮不显示删除 */
}

.frame-item.active {
    background-color: #37373D;
    border-color: #0E639C;
}

/* 帧间插入按钮 */
.frame-insert {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    min-width: 14px;
    height: 50px;
    cursor: pointer;
    color: #555;
    font-size: 14px;
    font-weight: bold;
    border-radius: 2px;
    user-select: none;
    transition: all 0.15s ease;
    opacity: 0.3;
}

.frame-insert:hover {
    color: #0E639C;
    background: rgba(14, 99, 156, 0.15);
    opacity: 1;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-bottom: 4px;
}

/* 下一步按钮 */
.next-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background-color: #0E639C;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.next-btn:hover {
    background-color: #1177BB;
}

/* 像素代码框 */
.pixel-code-box {
    width: 100%;
    height: 100%;
    background-color: #1E1E1E;
    color: #9CDCFE; /* VS Code Variable Blue */
    border: none;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    resize: none;
    outline: none;
    line-height: 1.5;
    white-space: pre; /* 不换行 */
    overflow: auto;   /* 显示滚动条 */
}

.copy-icon-btn {
    background: transparent;
    border: 1px solid #444;
    color: #CCC;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-icon-btn:hover {
    background-color: #444;
}

/* 弹幕输入区 */
.danmu-input-box {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.dm-input {
    flex: 1;
    background-color: #2D2D30;
    border: 1px solid #444;
    color: #FFF;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}

.dm-btn {
    background-color: #0E639C;
    color: #FFF;
    padding: 0 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.dm-btn:hover {
    background-color: #1177BB;
}

/* 弹幕方向选择 */
.danmu-direction-box {
    margin-top: 10px;
}

.direction-title {
    font-size: 13px;
    color: #CCC;
    margin-bottom: 8px;
}

.direction-options {
    display: flex;
    gap: 10px;
}

.direction-item {
    width: 36px;
    height: 36px;
    background-color: #2D2D30;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #CCC;
    font-size: 16px;
    transition: all 0.2s;
}

.direction-item:hover {
    background-color: #3E3E42;
    border-color: #666;
}

.direction-item.active {
    background-color: #0E639C;
    border-color: #0E639C;
    color: #FFF;
}

/* 弹幕生成模式选择 */
.danmu-mode-box {
    margin-top: 10px;
}

.mode-title {
    font-size: 13px;
    color: #CCC;
    margin-bottom: 8px;
}

.mode-options {
    display: flex;
    gap: 10px;
}

.mode-item {
    padding: 8px 12px;
    background-color: #2D2D30;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #CCC;
    font-size: 12px;
    transition: all 0.2s;
}

.mode-item:hover {
    background-color: #3E3E42;
    border-color: #666;
}

.mode-item.active {
    background-color: #0E639C;
    border-color: #0E639C;
    color: #FFF;
}

/* 图片预览模态框 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.preview-header {
    width: 90%;
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: #FFF;
}

.preview-title {
    font-size: 16px;
    font-weight: 600;
}

.preview-close {
    font-size: 24px;
    cursor: pointer;
    color: #AAA;
}

.box-size-control {
    width: 90%;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    color: #CCC;
}

.img-wrap {
    width: 90%;
    max-width: 600px;
    height: 60vh; /* 限制高度 */
    position: relative;
    overflow: hidden;
    background-color: #111;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.crop-box {
    position: absolute;
    border: 2px solid #0E639C;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* 遮罩效果 */
    cursor: move;
}

/* 选框手柄样式 - 隐藏，因为现在只支持拖动和滑块缩放 */
.crop-box-handles .handle {
    display: none;
}
/*
.crop-box-handles .handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #0E639C;
    border: 1px solid #FFF;
}
.tl { top: -5px; left: -5px; cursor: nw-resize; }
.tr { top: -5px; right: -5px; cursor: ne-resize; }
.bl { bottom: -5px; left: -5px; cursor: sw-resize; }
.br { bottom: -5px; right: -5px; cursor: se-resize; }
*/

.preview-actions {
    margin-top: 20px;
}

.confirm-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 4px;
    color: #FFF;
    font-size: 16px;
    cursor: pointer;
    background-color: #0E639C;
}

.confirm-btn:hover {
    background-color: #1177BB;
}

.rotate-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    color: #FFF;
    font-size: 14px;
    cursor: pointer;
    background-color: #555;
}

.rotate-btn:hover {
    background-color: #666;
}

/* 取色器模态框 */
.picker-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.picker-panel {
    background-color: #252526;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ph-title {
    font-weight: 600;
    color: #FFF;
}

.ph-edit {
    cursor: pointer;
    color: #AAA;
    font-size: 18px;
}

.picker-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sv-box {
    height: 150px;
    border-radius: 4px;
    border: 1px solid #444;
}

.hue-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    outline: none;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFF;
    cursor: pointer;
    border: 2px solid #ccc;
}

.preview-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #555;
}

.preview-hex {
    font-family: monospace;
    color: #DDD;
}

.picker-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.pf-btn.confirm {
    background-color: #0E639C;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.hidden-canvas, .hidden-canvas-text {
    display: none;
}

/* ===== 特效预览面板（弹幕模式专属） ===== */
.fx-sub-title {
    font-size: 11px;
    color: #777;
    margin: 12px 0 6px;
}

.fx-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fx-chip {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1;
    color: #BBB;
    background: #2D2D30;
    border: 1px solid #444;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.fx-chip:hover {
    background: #3E3E42;
    border-color: #888;
    color: #FFF;
}

.fx-chip.active {
    background: #0E639C;
    border-color: #1177BB;
    color: #FFF;
}

.fx-select {
    width: 100%;
    padding: 6px 8px;
    background-color: #2D2D30;
    border: 1px solid #444;
    color: #FFF;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
}

.fx-hint {
    font-size: 11px;
    color: #777;
    white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 900px) {
    .editor-container {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .left-panel {
        width: 100%;
        height: auto;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid #333;
    }
    
    .right-panel {
        height: auto;
        min-height: 600px;
    }
}


/* ===== 设备型号 / 画布型号面板 ===== */
.model-btn {
    height: 32px;
    min-width: 112px;
    padding: 0 12px;
    background: #333;
    border: 1px solid #555;
    color: #FFF;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.model-btn:hover { border-color: #0E639C; background: #3A3A3D; }
.model-caret { color: #AAA; font-size: 12px; }

.model-mask {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2100;
    display: flex;
    justify-content: center;
    align-items: center;
}
.model-panel {
    width: 340px;
    max-width: 90vw;
    background-color: #252526;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 18px;
}
.mp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mp-title { font-weight: 600; color: #FFF; font-size: 15px; }
.mp-close { cursor: pointer; color: #AAA; font-size: 20px; line-height: 1; }
.mp-close:hover { color: #FFF; }
.mp-tip { font-size: 12px; color: #999; line-height: 1.5; margin-bottom: 14px; }
.mp-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.mp-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px;
    background: #2D2D30;
    border: 1px solid #3A3A3D;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.mp-item:hover { border-color: #0E639C; background: #333; }
.mp-item.active { border-color: #0E639C; background: #123A55; }
.mp-left { display: flex; flex-direction: column; gap: 4px; }
.mp-name { color: #FFF; font-size: 14px; font-weight: 600; }
.mp-desc { color: #999; font-size: 12px; }
.mp-check { color: #4EC9B0; font-size: 16px; }
.mp-custom { border-style: dashed; }

/* 外壳缺角：纯视觉隐藏，像素数据不变（与小程序 rebuildCornerMask 同语义） */
.pixel-grid-view .cell.corner-cut {
    background-color: #000000 !important;
    border-color: transparent !important;
}

/* ===== 发布到创意广场：顶部入口 ===== */
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-btn {
    height: 30px;
    padding: 0 14px;
    font-size: 13px;
    color: #D8D8D8;
    background: #333336;
    border: 1px solid #454549;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.nav-btn:hover { background: #3F3F43; border-color: #0E639C; }
.nav-btn-primary { color: #FFFFFF; background: #0E639C; border-color: #0E639C; }
.nav-btn-primary:hover { background: #1177BB; border-color: #1177BB; }

/* ===== 登录 / 发布弹窗 ===== */
.pub-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.66);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.pub-panel {
    width: 480px; max-width: calc(100vw - 32px);
    max-height: 90vh;
    display: flex; flex-direction: column;
    background: #252526;
    border: 1px solid #3E3E42;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.pub-panel-sm { width: 400px; }
.pub-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #3E3E42;
}
.pub-title { color: #FFFFFF; font-size: 16px; font-weight: 600; }
.pub-close { color: #999; font-size: 22px; line-height: 1; cursor: pointer; }
.pub-close:hover { color: #FFFFFF; }
.pub-body { padding: 18px; overflow-y: auto; }
.pub-tip { font-size: 12px; color: #9CDCFE; line-height: 1.6; margin-bottom: 16px; }
.pub-warn {
    font-size: 12px; line-height: 1.6; color: #F4A9A9;
    background: #3A2424; border: 1px solid #6B3535;
    border-radius: 5px; padding: 10px 12px; margin-bottom: 14px;
}
.pub-hint { font-size: 11px; color: #858585; line-height: 1.5; margin: 6px 0 14px; }
.pub-label { display: block; font-size: 12px; color: #BBBBBB; margin: 12px 0 6px; }
.pub-req { color: #F48771; }
.pub-input {
    width: 100%;
    padding: 9px 10px;
    font-size: 13px;
    color: #FFFFFF;
    background: #1E1E1E;
    border: 1px solid #454549;
    border-radius: 5px;
    outline: none;
}
.pub-input:focus { border-color: #0E639C; }
.pub-input::placeholder { color: #6E6E6E; }
.pub-textarea { min-height: 68px; resize: vertical; }
.pub-row { display: flex; align-items: center; gap: 10px; }
.pub-row .pub-input { flex: 1; }
.pub-switch-row { margin: 14px 0 4px; font-size: 12px; color: #BBBBBB; cursor: pointer; }
.pub-switch-row input { width: auto; margin-right: 4px; accent-color: #0E639C; }
.pub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-chip {
    padding: 6px 12px;
    font-size: 12px;
    color: #CCCCCC;
    background: #2D2D30;
    border: 1px solid #454549;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.pub-chip:hover { border-color: #0E639C; }
.pub-chip.active { color: #FFFFFF; background: #0E639C; border-color: #0E639C; }
.pub-cover-wrap {
    max-height: 150px; overflow: auto;
    background: #111; border: 1px solid #3E3E42; border-radius: 5px;
    padding: 8px;
}
.pub-cover-wrap canvas { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
.pub-btn {
    height: 34px; padding: 0 16px;
    font-size: 13px;
    border-radius: 5px;
    border: 1px solid #454549;
    background: #333336; color: #DDDDDD;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.pub-btn:hover:not(:disabled) { background: #3F3F43; border-color: #0E639C; }
.pub-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pub-btn-primary { background: #0E639C; border-color: #0E639C; color: #FFFFFF; }
.pub-btn-primary:hover:not(:disabled) { background: #1177BB; border-color: #1177BB; }
.pub-btn-ghost { background: #2D2D30; }
.pub-btn-full { width: 100%; margin-top: 18px; }
.pub-msg { font-size: 12px; line-height: 1.6; margin-top: 10px; min-height: 18px; word-break: break-all; }
.pub-msg.ok { color: #4EC9B0; }
.pub-msg.err { color: #F48771; }
