/* ====== JSON 查看器样式 ====== */
.json-viewer {
    position: relative;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.2;
}

.json-bracket {
    color: #2563eb;
    font-weight: bold;
}

.json-key {
    color: #ea580c;
}

.json-string {
    color: #ca8a04;
}

.json-number {
    color: #16a34a;
}

.json-boolean {
    color: #db2777;
}

.json-null {
    color: #64748b;
}

.json-list {
    list-style-type: none;
    padding-left: 20px;
    margin: 0;
}

.json-toggle {
    cursor: pointer;
    font-size: 12px;
    padding: 2px 8px;
    background-color: #fff7ed;
    border-radius: 4px;
    margin-right: 5px;
    user-select: none;
    color: #f97316;
    font-weight: bold;
    border: 1px solid #fed7aa;
}

.minify-stats {
    background: #f0f9ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.json-search-box {
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.json-search-box button {
    margin-top: 0;
}

.json-search-box input {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    margin-top: 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.json-search-box input:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.json-search-box .search-count {
    color: #64748b;
}

.json-highlight {
    background-color: rgba(249, 115, 22, 0.2);
    color: #9a3412;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ====== 设置面板 ====== */
.settings-panel {
    background: #fafbfc;
    border: 1px solid #fef3c7;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: flex-start;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.setting-group label {
    color: #64748b;
    white-space: nowrap;
}

.setting-group input[type="range"] {
    background: #e2e8f0;
    width: 80px;
}

.setting-group input[type="color"] {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    width: 36px;
    height: 28px;
}

.setting-group select {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    padding: 4px 8px;
    min-width: 80px;
}

.setting-group select:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.setting-group span {
    color: #ea580c;
}

/* ====== 上传区域 ====== */
.upload-area {
    border: 2px dashed #eab308;
    background: #fefce8;
    margin: 16px 0;
}

.upload-area:hover {
    border-color: #ca8a04;
    background: #fef9c3;
}

.upload-area.drag-over {
    border-color: #facc15;
    background: #fef08a;
}

.upload-content p {
    color: #64748b;
}

/* ====== 分割线 ====== */
.divider {
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

::selection {
    background: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

/* ====== 社区论坛样式 ====== */
#forum-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    padding-left: 60px;
    transform-origin: top left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
main.container {
    padding-left: 60px;
    transform-origin: top left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.forum-header h1 {
    font-size: 22px;
    margin: 0;
    color: #1f2937;
    line-height: 1;
}
.forum-search {
    display: flex;
    gap: 8px;
    align-items: center;
}
.forum-search input {
    padding: 0 12px;
    height: 36px;
    line-height: 34px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
    outline: none;
}
.forum-search input:focus {
    border-color: #f97316;
}
.forum-search button {
    height: 36px;
    line-height: 34px;
    padding: 0 16px;
    box-sizing: border-box;
    background: #f97316;
    color: #fff;
    border: 1px solid #f97316;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    margin-top: 0;
}
.forum-search button:hover {
    background: #ea580c;
    border-color: #ea580c;
}

.forum-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #374151;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.forum-toast.show {
    opacity: 1;
}
.report-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}
.report-overlay.show { display: flex; }
.report-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 360px;
    max-width: 90vw;
}
.report-box h3 { font-size: 16px; margin-bottom: 16px; color: #1f2937; }
.report-box textarea {
    width: 100%;
    height: 80px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    font-size: 14px;
    resize: none;
}
.report-box .report-btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.report-box .report-btns button {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.report-box .btn-cancel { background: #f3f4f6; color: #374151; }
.report-box .btn-submit { background: #ef4444; color: #fff; }

.post-editor .w-e-text-container {
    min-height: calc(1.5em * 15) !important;
    max-height: calc(1.5em * 30) !important;
    overflow-y: auto !important;
}
.comment-editor .w-e-text-container {
    min-height: calc(1.5em * 5) !important;
}
.forum-form-box,
.forum-comment-form,
.inline-reply-container {
    --w-e-toolbar-bg-color: transparent;
    --w-e-toolbar-border-color: transparent;
    --w-e-toolbar-active-bg-color: #e5e7eb;
    --w-e-toolbar-active-color: #1f2937;
    --w-e-toolbar-color: #374151;
    --w-e-textarea-bg-color: transparent;
    --w-e-textarea-border-color: transparent;
    --w-e-textarea-slight-border-color: transparent;
    --w-e-textarea-slight-bg-color: #f3f4f6;
    --w-e-textarea-color: #1f2937;
}
.post-editor,
.comment-editor,
#post-toolbar,
#comment-toolbar,
.inline-reply-toolbar {
    border: none !important;
}
.post-editor .w-e-text-container,
.comment-editor .w-e-text-container {
    border: none !important;
    padding: 0 !important;
}
.post-editor .w-e-text-container [data-slate-editor],
.comment-editor .w-e-text-container [data-slate-editor] {
    padding: 4px 8px !important;
    border-top-color: transparent !important;
}
#post-toolbar .w-e-bar,
#comment-toolbar .w-e-bar,
.inline-reply-toolbar .w-e-bar {
    padding: 2px 4px !important;
    font-size: 12px !important;
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
}
#post-toolbar .w-e-bar-item,
#comment-toolbar .w-e-bar-item,
.inline-reply-toolbar .w-e-bar-item {
    padding: 2px 4px !important;
    height: 24px !important;
}
#post-toolbar .w-e-bar-item button,
#comment-toolbar .w-e-bar-item button,
.inline-reply-toolbar .w-e-bar-item button {
    font-size: 12px !important;
    height: 24px !important;
    padding: 0 2px !important;
    background: transparent !important;
    color: #374151 !important;
    border: none !important;
    box-shadow: none !important;
    margin-top: 0 !important;
    border-radius: 3px !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    overflow: visible !important;
}
#post-toolbar .w-e-bar-item button:hover,
#comment-toolbar .w-e-bar-item button:hover,
.inline-reply-toolbar .w-e-bar-item button:hover {
    background: #e5e7eb !important;
    color: #1f2937 !important;
    box-shadow: none !important;
}
#post-toolbar .w-e-bar-item button.active,
#comment-toolbar .w-e-bar-item button.active,
.inline-reply-toolbar .w-e-bar-item button.active {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
}

.forum-setup-box {
    max-width: 400px;
    margin: 40px auto;
    padding: 24px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.forum-setup-box h2 {
    margin: 0 0 8px;
    font-size: 18px;
}
.forum-setup-box p {
    margin: 0 0 16px;
    color: #6b7280;
    font-size: 14px;
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.form-group small {
    color: #9ca3af;
    font-size: 12px;
}
.captcha-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.captcha-group input {
    width: 80px !important;
    height: 36px;
    box-sizing: border-box;
    padding: 0 8px;
}
.captcha-group img {
    height: 36px;
    border-radius: 4px;
}

.forum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.forum-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.forum-cat-btn {
    padding: 4px 14px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.forum-cat-btn.active {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}
.forum-cat-btn.active:hover {
    background: #ea580c;
    border-color: #ea580c;
}
.forum-new-post-btn {
    padding: 6px 20px;
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.forum-new-post-btn:hover {
    background: #ea580c;
}

.forum-form-box {
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 16px;
}
.forum-form-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
}
.form-actions {
    display: flex;
    gap: 8px;
}
.form-actions button {
    padding: 6px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.form-actions button:first-child {
    background: #f97316;
    color: #fff;
}
.form-actions button:first-child:hover {
    background: #ea580c;
}
.form-actions button:last-child {
    background: #e5e7eb;
    color: #374151;
}

.forum-post-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.15s;
}
.forum-post-item:hover {
    background: #f9fafb;
}
.forum-post-item .post-title {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
}
.forum-post-item .post-meta {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #9ca3af;
}

.forum-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    transition: all 0.2s;
}
.forum-back-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #f97316;
}
.forum-back-btn svg {
    width: 16px;
    height: 16px;
}

.forum-detail-post {
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 16px;
}
.forum-detail-post h2 {
    margin: 0 0 8px;
    font-size: 18px;
}
.forum-detail-post .post-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 12px;
}
.forum-detail-post .post-body {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
}

.forum-comment-form {
    margin-bottom: 16px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.forum-comment-form button {
    padding: 6px 20px;
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}
.forum-comment-form button:hover {
    background: #ea580c;
}

.forum-comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}
.forum-comment-item .comment-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
}
.forum-comment-item .comment-body {
    font-size: 14px;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
}

#forum-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
#forum-pagination button {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
}
#forum-pagination button.active {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}
#forum-pagination button:disabled {
    opacity: 0.5;
    color: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .forum-search input {
        width: 140px;
    }
}

/* ====== 文档中心 / 知识库样式 ====== */
.doc-search {
    position: relative;
    margin-bottom: 16px;
}
.doc-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.doc-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.doc-search::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    opacity: 0.6;
}

.toc-item {
    padding: 6px 10px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    text-decoration: none;
    display: block;
}
.toc-item:hover {
    background: #e2e8f0;
    color: #1e3a5f;
}
.toc-item.active {
    background: #3b82f6;
    color: #fff;
    font-weight: 500;
}

.code-block-wrap {
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}
.code-block-label {
    background: #334155;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #475569;
}
.code-block-wrap pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
}
.code-block-wrap code {
    font-family: 'SF Mono', 'Fira Code', 'Menlo', monospace;
}

@media (max-width: 768px) {
    .tutorial-sidebar {
        width: 100% !important;
        position: static !important;
        margin-bottom: 20px;
    }
    #tutorial-page > div > div {
        flex-direction: column;
    }
}

.faq-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 12px;
}
.faq-item h4 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #1e3a5f;
}
.faq-item p {
    margin: 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.7;
}

.doc-highlight {
    background: #fef08a;
    padding: 1px 2px;
    border-radius: 2px;
}

.sidebar-search-result {
    font-size: 12px;
    color: #64748b;
    padding: 4px 10px;
    display: none;
}
.sidebar-search-result.show {
    display: block;
}

/* ====== JSON 树视图补充样式 ====== */
.json-line {
    margin-left: 20px;
    line-height: 1.6;
}
.json-array, .json-object {
    margin-left: 16px;
}
.json-undefined {
    color: #8b949e;
    font-style: italic;
}
.json-index {
    color: #6b7280;
    font-size: 12px;
    margin-right: 4px;
}
.minify-result {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}