html, body {
        overflow: hidden;
    }
    .question-edit-container {
        display: flex;
        position: fixed;
        top: var(--base-top-nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: #1e1e1e;
        color: #d4d4d4;
        overflow: hidden;
    }

    .question-panel {
        width: 40%;
        min-width: 300px;
        max-width: 600px;
        border-right: 1px solid #3c3c3c;
        overflow-y: scroll;
    }

    .question-title {
        font-size: 1.4rem;
        font-weight: bold;
        color: #fff;
    }

    .question-meta {
        font-size: 0.85rem;
        color: #888;
    }

    .question-content {
        line-height: 1.6;
        white-space: pre-wrap;
    }

    .question-content img {
        max-width: 100%;
        height: auto;
        margin: 10px 0;
    }

    .editor-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .editor-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 15px;
        background: #2d2d2d;
        border-bottom: 1px solid #3c3c3c;
    }

    .editor-toolbar .toolbar-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .editor-toolbar .toolbar-label {
        color: #cfd3d8;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .editor-toolbar .toolbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* 嵌入形态：分段按钮组 */
    .editor-toolbar .toolbar-segment {
        display: inline-flex;
        align-items: stretch;
        border: 1px solid #4a4a4a;
        border-radius: 6px;
        overflow: hidden;
        background: #2d2d2d;
    }

    .editor-toolbar .tb-btn {
        appearance: none;
        border: 0;
        background: transparent;
        color: #d4d4d4;
        font-size: 0.9rem;
        line-height: 1;
        padding: 9px 16px;
        cursor: pointer;
        border-right: 1px solid #4a4a4a;
        display: inline-flex;
        align-items: center;
    }

    .editor-toolbar .toolbar-segment .tb-btn:last-child {
        border-right: 0;
    }

    .editor-toolbar .tb-btn:hover:not(:disabled) {
        background: #3a3a3a;
    }

    .editor-toolbar .tb-btn:disabled {
        color: #6f6f6f;
        cursor: not-allowed;
    }

    .editor-toolbar .tb-btn-primary {
        background: #2c6fbb;
        color: #fff;
    }

    .editor-toolbar .tb-btn-primary:hover:not(:disabled) {
        background: #3a82d6;
    }

    .editor-toolbar .tb-btn-more {
        border: 1px solid #4a4a4a;
        border-radius: 6px;
    }

    .editor-toolbar .tb-btn-more::after {
        content: '\25BE';
        margin-left: 4px;
        font-size: 0.75rem;
        opacity: .85;
    }

    /* 语言选择：与深色编辑器主题一致（输入框 + 下拉面板） */
    .editor-toolbar .language-select {
        width: 150px;
    }

    .editor-toolbar .language-select .el-select__wrapper {
        background: #3c3c3c;
        box-shadow: 0 0 0 1px #4c4c4c inset;
    }

    .editor-toolbar .language-select .el-select__wrapper.is-focused {
        box-shadow: 0 0 0 1px #61afef inset;
    }

    .editor-toolbar .language-select .el-select__wrapper .el-select__placeholder,
    .editor-toolbar .language-select .el-select__wrapper .el-select__selected-item,
    .editor-toolbar .language-select .el-select__caret {
        color: #d4d4d4;
    }

    /* 下拉面板 teleport 到 body，用 popper-class 限定作用域 */
    .program-lang-dropdown.el-popper {
        background: #2d2d2d;
        border: 1px solid #4c4c4c;
    }

    .program-lang-dropdown.el-popper .el-popper__arrow::before {
        background: #2d2d2d;
        border-color: #4c4c4c;
    }

    .program-lang-dropdown .el-select-dropdown {
        background: #2d2d2d;
    }

    .program-lang-dropdown .el-select-dropdown__item {
        color: #d4d4d4;
    }

    .program-lang-dropdown .el-select-dropdown__item.is-hovering {
        background: #3c3c3c;
    }

    .program-lang-dropdown .el-select-dropdown__item.is-selected {
        color: #61afef;
        font-weight: 600;
    }

    /* 「更多」下拉：与深色工具栏保持一致 */
    .toolbar-more-dropdown.el-popper {
        background: #2d2d2d;
        border: 1px solid #4c4c4c;
    }

    .toolbar-more-dropdown.el-popper .el-popper__arrow::before {
        background: #2d2d2d;
        border-color: #4c4c4c;
    }

    .toolbar-more-dropdown .el-dropdown-menu {
        background: #2d2d2d;
    }

    .toolbar-more-dropdown .el-dropdown-menu__item {
        color: #d4d4d4;
    }

    .toolbar-more-dropdown .el-dropdown-menu__item:not(.is-disabled):focus,
    .toolbar-more-dropdown .el-dropdown-menu__item:not(.is-disabled):hover {
        background: #3c3c3c;
        color: #61afef;
    }

    .language-loading {
        color: #888;
        font-size: 0.85rem;
    }

    .editor-wrapper {
        flex: 1;
        position: relative;
    }

    #ace-editor {
        width: 100%;
        height: 100%;
        font-size: 14px;
        line-height: 1.5;
    }

    .result-panel {
        height: 250px;
        border-top: 1px solid #3c3c3c;
        background: #1e1e1e;
        display: none;
    }

    .result-panel.show {
        display: flex;
        flex-direction: column;
    }

    .result-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 15px;
        background: #2d2d2d;
        border-bottom: 1px solid #3c3c3c;
    }

    .result-header .status {
        font-size: 0.85rem;
    }

    .result-header .status.success {
        color: #4ec9b0;
    }

    .result-header .status.error {
        color: #f14c4c;
    }

    .result-close {
        background: none;
        border: none;
        color: #888;
        cursor: pointer;
        font-size: 1.2rem;
    }

    .result-content {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        font-family: 'Consolas', 'Monaco', monospace;
        font-size: 0.9rem;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .input-panel {
        height: 150px;
        border-top: 1px solid #3c3c3c;
        background: #1e1e1e;
        display: none;
    }

    .input-panel.show {
        display: flex;
        flex-direction: column;
    }

    .input-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 15px;
        background: #2d2d2d;
        border-bottom: 1px solid #3c3c3c;
    }

    .input-header .title {
        font-size: 0.85rem;
    }

    .input-toggle {
        background: none;
        border: none;
        color: #888;
        cursor: pointer;
        font-size: 1.2rem;
    }

    .input-content {
        flex: 1;
        padding: 10px;
    }

    .input-content textarea {
        width: 100%;
        height: 100%;
        background: #1e1e1e;
        color: #d4d4d4;
        border: 1px solid #3c3c3c;
        border-radius: 4px;
        padding: 10px;
        font-family: 'Consolas', 'Monaco', monospace;
        font-size: 0.9rem;
        resize: none;
        outline: none;
    }

    .input-content textarea:focus {
        border-color: #4ec9b0;
    }

    .result-content .error {
        color: #f14c4c;
    }

    /* 复制按钮样式 */
    .question-content pre {
        position: relative;
    }

    .copy-btn-container {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        gap: 6px;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 10;
    }

    .question-content pre:hover .copy-btn-container {
        opacity: 1;
    }

    .copy-btn,
    .input-btn {
        padding: 4px 10px;
        font-size: 12px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 600;
        transition: background-color 0.3s ease;
    }

    .copy-btn {
        background-color: #4ec9b0;
        color: #1e1e1e;
    }

    .copy-btn:hover {
        background-color: #5ee0c6;
    }

    .input-btn {
        background-color: #61afef;
        color: #1e1e1e;
    }

    .input-btn:hover {
        background-color: #72c5f5;
    }

    .copy-btn.copied,
    .input-btn.copied {
        background-color: #27ae60;
        color: #fff;
    }

/* ========== AI 助手悬浮面板 ========== */
    #ai-assistant-root {
        position: fixed;
        z-index: 30000;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    }

    .ai-fab {
        position: fixed;
        right: 28px;
        bottom: 40px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #4c8dff, #6f5bff);
        color: #fff;
        border: none;
        box-shadow: 0 4px 16px rgba(76, 141, 255, 0.45);
        cursor: pointer;
        font-size: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform .2s ease, box-shadow .2s ease;
        z-index: 30001;
    }
    .ai-fab:hover {
        transform: scale(1.08);
        box-shadow: 0 6px 22px rgba(76, 141, 255, 0.55);
    }

    .ai-dialog {
        position: fixed;
        width: 440px;
        height: 600px;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        background: #ffffff;
        border-radius: 14px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 30002;
        transition: width .2s ease, height .2s ease, border-radius .2s ease;
    }
    .ai-dialog.ai-dialog-expanded {
        border-radius: 8px;
    }

    .ai-header {
        height: 52px;
        flex: 0 0 52px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        background: linear-gradient(135deg, #4c8dff, #6f5bff);
        color: #fff;
        cursor: move;
        user-select: none;
    }
    .ai-header-title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
    }
    .ai-header-service {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.16);
    }
    .ai-header-service:hover {
        background: rgba(255, 255, 255, 0.28);
    }
    .ai-service-pop {
        position: absolute;
        top: 42px;
        left: 50%;
        transform: translateX(-50%);
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
        padding: 12px;
        z-index: 10;
    }
    .ai-service-qr {
        width: 120px;
        height: 120px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .ai-service-tip {
        margin-top: 8px;
        font-size: 12px;
        color: #666;
        text-align: center;
        white-space: nowrap;
    }
    .ai-header-actions {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .ai-icon-btn {
        width: 30px;
        height: 30px;
        border: none;
        background: transparent;
        color: inherit;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background .2s;
    }
    .ai-icon-btn:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.22);
    }
    .ai-icon-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

    .ai-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #f7f8fa;
    }
    .ai-chat {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .ai-empty {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
        padding: 24px;
        text-align: center;
    }
    .ai-empty-icon {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: linear-gradient(135deg, #4c8dff, #6f5bff);
        color: #fff;
        font-size: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(76, 141, 255, 0.35);
    }
    .ai-empty-title {
        font-size: 18px;
        font-weight: 600;
        color: #333;
    }
    .ai-empty-quick {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 320px;
    }
    .ai-quick-btn {
        padding: 10px 16px;
        border: 1px solid #e2e6ef;
        border-radius: 20px;
        background: #fff;
        color: #4c8dff;
        font-size: 14px;
        cursor: pointer;
        transition: all .2s;
        text-align: left;
    }
    .ai-quick-btn:hover {
        border-color: #4c8dff;
        background: #f0f6ff;
    }

    .ai-msg {
        display: flex;
        width: 100%;
    }
    .ai-msg-user {
        justify-content: flex-end;
    }
    .ai-msg-assistant {
        justify-content: flex-start;
    }
    .ai-bubble {
        max-width: 86%;
        padding: 10px 14px;
        border-radius: 12px;
        font-size: 14px;
        line-height: 1.65;
        word-break: break-word;
        position: relative;
    }
    .ai-msg-user .ai-bubble {
        background: #4c8dff;
        color: #fff;
        border-top-right-radius: 4px;
    }
    .ai-msg-assistant .ai-bubble {
        background: #fff;
        color: #333;
        border: 1px solid #eef0f4;
        border-top-left-radius: 4px;
    }
    .ai-user-text {
        white-space: pre-wrap;
    }
    .ai-md {
        font-size: 14px;
        line-height: 1.65;
    }
    .ai-md pre {
        background: #1e1e1e !important;
        border-radius: 6px;
        padding: 10px;
        overflow-x: auto;
    }
    .ai-md code {
        font-family: Consolas, Monaco, monospace;
    }

    /* markdown 主题统一：页面引入 github-markdown-dark 会令 .markdown-body 暗底白字，
       与 AI 气泡白底冲突；此处仅作用于 AI 面板内（#ai-assistant-root 前缀隔离），
       正文深色文字/透明底跟随白气泡，代码块保留深色高亮，不影响页面其他 markdown 区域 */
    #ai-assistant-root .markdown-body.ai-md {
        color: #24292f;
        background-color: transparent;
    }
    #ai-assistant-root .markdown-body.ai-md h1,
    #ai-assistant-root .markdown-body.ai-md h2,
    #ai-assistant-root .markdown-body.ai-md h3,
    #ai-assistant-root .markdown-body.ai-md h4,
    #ai-assistant-root .markdown-body.ai-md h5,
    #ai-assistant-root .markdown-body.ai-md h6 {
        color: #1f2328;
    }
    #ai-assistant-root .markdown-body.ai-md a {
        color: #0969da;
    }
    #ai-assistant-root .markdown-body.ai-md blockquote {
        color: #57606a;
        border-left-color: #d0d7de;
    }
    #ai-assistant-root .markdown-body.ai-md code {
        color: #24292f;
        background: rgba(175, 184, 193, 0.2);
        padding: 0.2em 0.4em;
        border-radius: 4px;
    }
    #ai-assistant-root .markdown-body.ai-md pre {
        background: #1e1e1e !important;
        color: #d4d4d4;
    }
    #ai-assistant-root .markdown-body.ai-md pre code {
        background: transparent;
        color: #d4d4d4;
        padding: 0;
    }
    #ai-assistant-root .markdown-body.ai-md table {
        color: #24292f;
    }
    #ai-assistant-root .markdown-body.ai-md tr {
        background-color: transparent;
        border-top-color: #d0d7de;
    }
    #ai-assistant-root .markdown-body.ai-md th,
    #ai-assistant-root .markdown-body.ai-md td {
        border-color: #d0d7de;
    }
    #ai-assistant-root .markdown-body.ai-md hr {
        background-color: #d0d7de;
    }
    #ai-assistant-root .markdown-body.ai-md img {
        max-width: 100%;
    }
    /* 块级公式左对齐，避免 KaTeX 默认整块居中（居中是内层 .katex 设置的） */
    #ai-assistant-root .ai-md .katex-display > .katex {
        text-align: left;
    }
    #ai-assistant-root .markdown-body.ai-md ol,
    #ai-assistant-root .markdown-body.ai-md ul {
        color: #24292f;
    }
    .ai-reasoning {
        margin-bottom: 8px;
        background: #f7f8fa;
        border: 1px solid #eef0f4;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 13px;
        color: #888;
    }
    .ai-reasoning summary {
        cursor: pointer;
        user-select: none;
        color: #999;
        font-size: 12px;
    }
    .ai-reasoning-text {
        margin-top: 6px;
        white-space: pre-wrap;
        max-height: 160px;
        overflow-y: auto;
    }
    .ai-copy {
        margin-top: 6px;
        border: none;
        background: #f2f4f8;
        color: #888;
        font-size: 12px;
        padding: 3px 10px;
        border-radius: 4px;
        cursor: pointer;
    }
    .ai-copy:hover {
        color: #4c8dff;
        background: #e8efff;
    }
    .ai-bubble-hint {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #eef4ff;
        border-color: #d6e4ff;
        color: #4c8dff;
        font-size: 13px;
        padding: 8px 14px;
    }
    .ai-hint-spinner {
        width: 14px;
        height: 14px;
        border: 2px solid #cfe0ff;
        border-top-color: #4c8dff;
        border-radius: 50%;
        animation: ai-spin .8s linear infinite;
    }
    @keyframes ai-spin {
        to { transform: rotate(360deg); }
    }

    .ai-footer {
        flex: 0 0 auto;
        border-top: 1px solid #eef0f4;
        background: #fff;
        padding: 10px 12px;
        position: relative;
    }
    .ai-input-row {
        display: flex;
        align-items: flex-end;
        gap: 6px;
    }
    .ai-input {
        flex: 1;
        min-height: 36px;
        max-height: 96px;
        border: 1px solid #e2e6ef;
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 14px;
        resize: none;
        outline: none;
        line-height: 1.5;
        background: #f9fafc;
        color: #333;
        font-family: inherit;
    }
    .ai-input:focus {
        border-color: #4c8dff;
        background: #fff;
    }
    .ai-send-btn {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        background: #4c8dff;
        color: #fff;
        font-size: 15px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background .2s, opacity .2s;
    }
    .ai-send-btn:hover:not(:disabled) {
        background: #3d7df0;
    }
    .ai-send-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }
    .ai-model-pop {
        position: absolute;
        right: 12px;
        bottom: 56px;
        width: 260px;
        max-height: 280px;
        overflow-y: auto;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
        padding: 8px;
        z-index: 20;
    }
    .ai-model-pop-title {
        font-size: 12px;
        color: #999;
        padding: 4px 8px 8px;
    }
    .ai-model-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 10px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14px;
        color: #333;
    }
    .ai-model-item:hover {
        background: #f2f6ff;
    }
    .ai-model-item.active {
        background: #e8efff;
        color: #4c8dff;
        font-weight: 600;
    }
    .ai-model-tag {
        font-size: 11px;
        color: #999;
        background: #f2f4f8;
        padding: 2px 6px;
        border-radius: 4px;
    }

    .ai-history {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .ai-history-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid #eef0f4;
        font-weight: 600;
        color: #333;
    }
    .ai-history-list {
        flex: 1;
        overflow-y: auto;
        padding: 8px;
    }
    .ai-history-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: background .2s;
    }
    .ai-history-item:hover {
        background: #eef4ff;
    }
    .ai-history-title {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ai-history-del {
        margin-left: 8px;
        color: #999;
    }
    .ai-history-del:hover {
        color: #ff4d4f;
    }
    .ai-history-time {
        font-size: 12px;
        color: #999;
        margin-top: 2px;
    }
    .ai-history-empty {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #999;
        font-size: 14px;
    }
