/* 创作文例锦囊面板样式 */

/* 拟态窗口基础样式 */
.example-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 480px;
    max-width: 95vw;
    height: 600px;
    max-height: 80vh;
    background: linear-gradient(145deg, #f0f0f3, #ffffff);
    border-radius: 16px;
    box-shadow: 
        8px 8px 20px rgba(0, 0, 0, 0.1),
        -8px -8px 20px rgba(255, 255, 255, 0.9),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 99996;
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: hidden;
    min-width: 360px;
    min-height: 400px;
}

/* 面板头部 */
.example-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(145deg, #e8e8eb, #f5f5f8);
    border-radius: 16px 16px 0 0;
    cursor: move;
    flex-shrink: 0;
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.05);
}

.example-panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #5c4d3d;
}

.example-panel-header-btns {
    display: flex;
    gap: 8px;
}

.example-panel-header-btns button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.1),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
    transition: all 0.2s;
}

.example-panel-header-btns button:hover {
    background: linear-gradient(145deg, #e6e6e9, #f0f0f3);
    color: #333;
}

/* 检索区 */
.example-search-area {
    padding: 12px 16px;
    background: linear-gradient(145deg, #fafafa, #f5f5f5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.example-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.example-search-row:last-child {
    margin-bottom: 0;
}

.example-search-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    background: linear-gradient(145deg, #ffffff, #f0f0f3);
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.08),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9);
    outline: none;
    transition: all 0.2s;
}

.example-search-input:focus {
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.1),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

.example-search-input::placeholder {
    color: #aaa;
}

.example-module-select {
    width: 130px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    background: linear-gradient(145deg, #ffffff, #f0f0f3);
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.08),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9);
    cursor: pointer;
    outline: none;
}

.example-filter-btns {
    display: flex;
    gap: 8px;
}

.example-filter-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.08),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
    transition: all 0.2s;
}

.example-filter-btn:hover {
    color: #333;
}

.example-filter-btn.active {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 
        2px 2px 5px rgba(139, 92, 246, 0.3),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
}

/* 列表区 */
.example-list-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.example-list-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 13px;
}

.example-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff, #f5f5f8);
    box-shadow: 
        4px 4px 10px rgba(0, 0, 0, 0.06),
        -4px -4px 10px rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.example-item:hover {
    transform: translateY(-1px);
    box-shadow: 
        6px 6px 15px rgba(0, 0, 0, 0.08),
        -6px -6px 15px rgba(255, 255, 255, 0.9);
}

.example-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.example-item-keyword {
    font-weight: 600;
    color: #5c4d3d;
    font-size: 13px;
    flex: 1;
    word-break: break-all;
}

.example-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 10px;
}

.example-item-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #999;
    transition: all 0.2s;
}

.example-item-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.example-item-btn.collect-btn.active {
    color: #f59e0b;
}

.example-item-text {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.example-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 11px;
    color: #aaa;
}

.example-item-module {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* 操作区 */
.example-action-area {
    padding: 12px 16px;
    background: linear-gradient(145deg, #f5f5f8, #fafafa);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.example-action-btns {
    display: flex;
    gap: 10px;
}

.example-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        3px 3px 8px rgba(0, 0, 0, 0.08),
        -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #666;
    transition: all 0.2s;
}

.example-action-btn:hover {
    background: linear-gradient(145deg, #e6e6e9, #f0f0f3);
    color: #333;
}

.example-action-btn.primary {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 
        3px 3px 8px rgba(139, 92, 246, 0.3),
        -3px -3px 8px rgba(255, 255, 255, 0.8);
}

.example-action-btn.primary:hover {
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
}

/* 拟态弹窗 */
.example-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.example-modal {
    pointer-events: auto;
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    background: linear-gradient(145deg, #f5f5f8, #ffffff);
    border-radius: 16px;
    box-shadow: 
        12px 12px 30px rgba(0, 0, 0, 0.15),
        -12px -12px 30px rgba(255, 255, 255, 0.9),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
}

.example-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(145deg, #e8e8eb, #f0f0f3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.example-modal-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #5c4d3d;
}

.example-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.1),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
}

.example-modal-close:hover {
    color: #333;
}

.example-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.example-form-group {
    margin-bottom: 16px;
}

.example-form-group:last-child {
    margin-bottom: 0;
}

.example-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #5c4d3d;
    margin-bottom: 8px;
}

.example-form-input,
.example-form-textarea,
.example-form-select {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    background: linear-gradient(145deg, #ffffff, #f0f0f3);
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.08),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9);
    outline: none;
    box-sizing: border-box;
}

.example-form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.example-form-input:focus,
.example-form-textarea:focus,
.example-form-select:focus {
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.1),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}

.example-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(145deg, #f5f5f8, #fafafa);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.example-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-modal-btn.cancel {
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        3px 3px 8px rgba(0, 0, 0, 0.08),
        -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #666;
}

.example-modal-btn.confirm {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    box-shadow: 
        3px 3px 8px rgba(139, 92, 246, 0.3),
        -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #fff;
}

.example-modal-btn:hover {
    transform: translateY(-1px);
}

/* 弹窗右下角拖拽缩放手柄 */
.example-modal-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 10;
}

.example-modal-resize-handle::after {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #bbb;
    border-bottom: 2px solid #bbb;
}

/* 详情弹窗 */
.example-detail-content {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
    padding: 16px;
    background: linear-gradient(145deg, #fafafa, #f5f5f5);
    border-radius: 10px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05);
}

.example-detail-meta {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    font-size: 12px;
    color: #888;
}

.example-detail-meta span {
    padding: 4px 10px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    color: #8b5cf6;
}

/* 分页 */
.example-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}

.example-page-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.06),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
}

.example-page-btn:hover:not(:disabled) {
    color: #333;
}

.example-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.example-page-info {
    font-size: 12px;
    color: #888;
    padding: 0 8px;
}

/* 提示文字 */
.example-hint {
    font-size: 11px;
    color: #aaa;
    margin-top: 6px;
}

/* 加载状态 */
.example-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* 响应式 */
@media (max-width: 768px) {
    .example-panel {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        top: 0;
        right: 0;
        border-radius: 0;
    }
    
    .example-search-row {
        flex-direction: column;
    }
    
    .example-module-select {
        width: 100%;
    }
}


/* ========== 通用拟态弹窗样式 ========== */
.neumorphic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.neumorphic-modal {
    pointer-events: auto;
    width: 400px;
    max-width: 90vw;
    background: linear-gradient(145deg, #f5f5f8, #ffffff);
    border-radius: 16px;
    box-shadow: 
        12px 12px 30px rgba(0, 0, 0, 0.15),
        -12px -12px 30px rgba(255, 255, 255, 0.9),
        inset 1px 1px 2px rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.neumorphic-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(145deg, #e8e8eb, #f0f0f3);
}

.neumorphic-modal-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #5c4d3d;
}

.neumorphic-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.1),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
    transition: all 0.2s;
}

.neumorphic-close:hover {
    color: #333;
}

.neumorphic-modal-body {
    padding: 20px;
}

.neumorphic-points-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(145deg, #eff6ff, #e0e7ff);
    border-radius: 10px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.05);
}

.neumorphic-points-box span:first-child {
    color: #4f46e5;
    font-size: 14px;
}

.neumorphic-points-box .points-value {
    font-weight: 700;
    color: #dc2626;
    font-size: 18px;
}

.neumorphic-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(145deg, #f5f5f8, #fafafa);
}

.neumorphic-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.neumorphic-btn.cancel {
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        3px 3px 8px rgba(0, 0, 0, 0.08),
        -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #666;
}

.neumorphic-btn.confirm {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    box-shadow: 
        3px 3px 8px rgba(139, 92, 246, 0.3),
        -3px -3px 8px rgba(255, 255, 255, 0.8);
    color: #fff;
}

.neumorphic-btn:hover {
    transform: translateY(-1px);
}

/* 灵感续启来源选择按钮 */
.continue-source-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.continue-source-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    background: linear-gradient(145deg, #f0f0f3, #e6e6e9);
    box-shadow: 
        2px 2px 5px rgba(0, 0, 0, 0.08),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
    color: #666;
    transition: all 0.2s;
}

.continue-source-btn:hover {
    color: #333;
}

.continue-source-btn.active {
    background: linear-gradient(145deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 
        2px 2px 5px rgba(139, 92, 246, 0.3),
        -2px -2px 5px rgba(255, 255, 255, 0.8);
}

/* 自定义内容输入区 */
.continue-custom-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: linear-gradient(145deg, #ffffff, #f0f0f3);
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.08),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9);
    outline: none;
    box-sizing: border-box;
}

.continue-custom-textarea:focus {
    box-shadow: 
        inset 3px 3px 6px rgba(0, 0, 0, 0.1),
        inset -3px -3px 6px rgba(255, 255, 255, 0.9),
        0 0 0 2px rgba(139, 92, 246, 0.2);
}


/* ========== 文例码字引导覆盖层 ========== */
#exampleGuideOverlay {
    pointer-events: none;
    border-radius: 8px;
}

/* 引导激活时编辑器背景透明以显示覆盖层 */
.immersive-content.guide-active {
    background: transparent !important;
    position: relative;
    z-index: 2;
}


/* ========== 码字引导设置 ========== */
.guide-color-preset {
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.08), -2px -2px 5px rgba(255,255,255,0.8);
    transition: all 0.2s;
    padding: 0;
}

.guide-color-preset:hover {
    transform: scale(1.15);
    border-color: #8b5cf6;
}

.guide-settings-preview {
    padding: 14px;
    border-radius: 10px;
    background: #1a1a2e;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3);
    font-size: 14px;
    line-height: 2;
}

/* 文例列表项文字按钮样式 */
.example-item-btn {
    width: auto;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
}

.example-item-btn.collect-btn.active {
    color: #fff;
    background: #f59e0b;
}

/* ========== 深色模式适配 ========== */
body.dark-mode .example-panel { background: linear-gradient(145deg, #16213e, #1a1a3e); box-shadow: 8px 8px 20px rgba(0,0,0,0.3), -8px -8px 20px rgba(0,0,0,0.1); }
body.dark-mode .example-panel-header { background: linear-gradient(145deg, #1a1a3e, #16213e); }
