/**
 * XNForums WYSIWYG Editor Pro - Styles
 * 所见即所得专业编辑器样式
 * 
 * @version 2.0.0
 * @license Commercial
 */

/* ========== 编辑器容器 ========== */
.xnforums-wysiwyg-pro-wrapper {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    margin: 15px 0;
    transition: border-color 0.3s;
}

.xnforums-wysiwyg-pro-wrapper:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* ========== 工具栏 ========== */
.xnforums-wysiwyg-pro-toolbar {
    display: flex;
    align-items: center;
    padding: 10px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 5px;
}

.toolbar-group {
    display: flex;
    gap: 3px;
    background: #fff;
    padding: 3px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.toolbar-separator {
    width: 1px;
    height: 28px;
    background: #e0e0e0;
    margin: 0 6px;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #495057;
    min-width: 36px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    color: #007bff;
    border-color: #007bff;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toolbar-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 按钮内的格式化标签样式 */
.toolbar-btn strong,
.toolbar-btn em,
.toolbar-btn u,
.toolbar-btn s {
    font-size: 15px;
    font-weight: bold;
}

.toolbar-btn em {
    font-style: italic;
}

/* Unicode箭头和符号样式 */
.toolbar-btn[data-action="undo"],
.toolbar-btn[data-action="redo"] {
    font-size: 16px;
}

/* ========== 编辑器区域 ========== */
.xnforums-wysiwyg-pro-editor {
    min-height: 250px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    font-size: 16px;
    line-height: 1.7;
    color: #212529;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Noto Sans CJK SC", "Source Han Sans CN", Arial, sans-serif;
}

.xnforums-wysiwyg-pro-editor:focus {
    background: #fafffe;
}

/* 占位符 */
.xnforums-wysiwyg-pro-editor.is-empty:before {
    content: attr(data-placeholder);
    color: #999;
    opacity: 0.7;
    pointer-events: none;
    position: absolute;
}

/* ========== 编辑器内容样式 ========== */
.xnforums-wysiwyg-pro-editor h1,
.xnforums-wysiwyg-pro-editor h2,
.xnforums-wysiwyg-pro-editor h3 {
    margin: 20px 0 12px;
    font-weight: 600;
    line-height: 1.3;
}

.xnforums-wysiwyg-pro-editor h1 {
    font-size: 32px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
    margin-top: 0;
}

.xnforums-wysiwyg-pro-editor h2 {
    font-size: 26px;
    color: #333;
}

.xnforums-wysiwyg-pro-editor h3 {
    font-size: 22px;
    color: #555;
}

.xnforums-wysiwyg-pro-editor p {
    margin: 12px 0;
}

.xnforums-wysiwyg-pro-editor strong,
.xnforums-wysiwyg-pro-editor b {
    font-weight: 700;
    color: #000;
}

.xnforums-wysiwyg-pro-editor em,
.xnforums-wysiwyg-pro-editor i {
    font-style: italic;
    color: #444;
}

.xnforums-wysiwyg-pro-editor u {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.xnforums-wysiwyg-pro-editor strike,
.xnforums-wysiwyg-pro-editor s {
    text-decoration: line-through;
    opacity: 0.7;
}

/* 列表 */
.xnforums-wysiwyg-pro-editor ul,
.xnforums-wysiwyg-pro-editor ol {
    margin: 15px 0;
    padding-left: 35px;
}

.xnforums-wysiwyg-pro-editor ul {
    list-style-type: disc;
}

.xnforums-wysiwyg-pro-editor ol {
    list-style-type: decimal;
}

.xnforums-wysiwyg-pro-editor li {
    margin: 8px 0;
    padding-left: 5px;
}

.xnforums-wysiwyg-pro-editor li::marker {
    color: #007bff;
    font-weight: 600;
}

/* 引用 */
.xnforums-wysiwyg-pro-editor blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    background: linear-gradient(to right, #f8f9fa, #fff);
    border-left: 5px solid #007bff;
    color: #495057;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.xnforums-wysiwyg-pro-editor blockquote:before {
    content: '"';
    font-size: 36px;
    color: #007bff;
    opacity: 0.3;
    margin-right: 10px;
    font-family: Georgia, serif;
}

/* 代码 */
.xnforums-wysiwyg-pro-editor code {
    background: #f8f9fa;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #e83e8c;
    border: 1px solid #e9ecef;
}

.xnforums-wysiwyg-pro-editor pre {
    background: #282c34;
    color: #abb2bf;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    margin: 20px 0;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.xnforums-wysiwyg-pro-editor pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
}

/* 链接 */
.xnforums-wysiwyg-pro-editor a {
    color: #007bff;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.xnforums-wysiwyg-pro-editor a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

/* 图片 */
.xnforums-wysiwyg-pro-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.xnforums-wysiwyg-pro-editor img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 上传中提示 */
.xnforums-wysiwyg-pro-editor .uploading {
    display: inline-block;
    padding: 8px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    animation: pulse 1.5s infinite;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* ========== 滚动条美化 ========== */
.xnforums-wysiwyg-pro-editor::-webkit-scrollbar {
    width: 8px;
}

.xnforums-wysiwyg-pro-editor::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.xnforums-wysiwyg-pro-editor::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    transition: background 0.3s;
}

.xnforums-wysiwyg-pro-editor::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== 许可证锁定提示 ========== */
.xnforums-wysiwyg-pro-locked {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    margin: 20px 0;
}

.xnforums-wysiwyg-pro-locked p {
    font-size: 18px;
    margin-bottom: 20px;
}

.xnforums-wysiwyg-pro-locked .button {
    background: #fff;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
}

.xnforums-wysiwyg-pro-locked .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .xnforums-wysiwyg-pro-toolbar {
        gap: 3px;
        padding: 8px;
    }
    
    .toolbar-btn {
        padding: 5px 10px;
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    /* 移动端上某些按钮文字较长，允许略微缩小 */
    .toolbar-btn[data-action="ul"],
    .toolbar-btn[data-action="ol"],
    .toolbar-btn[data-action="quote"],
    .toolbar-btn[data-action="link"],
    .toolbar-btn[data-action="image"],
    .toolbar-btn[data-action="code"],
    .toolbar-btn[data-action="undo"],
    .toolbar-btn[data-action="redo"] {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .toolbar-separator {
        height: 24px;
        margin: 0 4px;
    }
    
    .xnforums-wysiwyg-pro-editor {
        padding: 15px;
        font-size: 15px;
        min-height: 200px;
    }
    
    .xnforums-wysiwyg-pro-editor h1 {
        font-size: 26px;
    }
    
    .xnforums-wysiwyg-pro-editor h2 {
        font-size: 22px;
    }
    
    .xnforums-wysiwyg-pro-editor h3 {
        font-size: 18px;
    }
}

/* ========== 深色模式 ========== */
@media (prefers-color-scheme: dark) {
    .xnforums-wysiwyg-pro-wrapper {
        border-color: #444;
        background: #1e1e1e;
    }
    
    .xnforums-wysiwyg-pro-toolbar {
        background: linear-gradient(to bottom, #2a2a2a, #242424);
        border-bottom-color: #444;
    }
    
    .toolbar-group {
        background: #2a2a2a;
    }
    
    .toolbar-btn {
        color: #e0e0e0;
    }
    
    .toolbar-btn:hover {
        background: #3a3a3a;
        color: #66b3ff;
        border-color: #66b3ff;
    }
    
    .xnforums-wysiwyg-pro-editor {
        color: #e0e0e0;
    }
    
    .xnforums-wysiwyg-pro-editor:focus {
        background: #1a1a1a;
    }
    
    .xnforums-wysiwyg-pro-editor blockquote {
        background: linear-gradient(to right, #2a2a2a, #1e1e1e);
        color: #c0c0c0;
    }
    
    .xnforums-wysiwyg-pro-editor code {
        background: #2a2a2a;
        color: #ff79c6;
        border-color: #444;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .xnforums-wysiwyg-pro-toolbar {
        display: none;
    }
    
    .xnforums-wysiwyg-pro-wrapper {
        border: none;
    }
    
    .xnforums-wysiwyg-pro-editor {
        padding: 0;
        max-height: none;
    }
}

