/* ============================================================
   AI 助手 —— 全局样式
   ============================================================ */

/* ---------- 悬浮按钮 ---------- */
.ai-float-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-float-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 28px rgba(102, 126, 234, 0.5);
}

/* ---------- 快速提问弹窗 ---------- */
.ai-chat-modal {
    position: fixed;
    bottom: 96px;
    right: 32px;
    width: 380px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
[data-md-color-scheme="slate"] .ai-chat-modal {
    background: rgba(30, 30, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

.ai-chat-head {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-md-color-scheme="slate"] .ai-chat-head {
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.ai-close {
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #999;
    transition: color 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.ai-close:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.ai-quick-body {
    padding: 20px;
}

.ai-quick-hint {
    margin: 0 0 14px;
    font-size: 13px;
    color: #888;
    text-align: center;
}
[data-md-color-scheme="slate"] .ai-quick-hint {
    color: #aaa;
}

.ai-quick-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

#aiQuickInput {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 999px;
    font-size: 14px;
    outline: none;
    background: #fafafa;
    color: #333;
    transition: border-color 0.25s, box-shadow 0.25s;
}
#aiQuickInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
    background: #fff;
}
[data-md-color-scheme="slate"] #aiQuickInput {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e0e0e0;
}
[data-md-color-scheme="slate"] #aiQuickInput:focus {
    background: rgba(255, 255, 255, 0.1);
}

#aiQuickSubmit {
    height: 44px;
    padding: 0 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
#aiQuickSubmit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}
#aiQuickSubmit:active {
    transform: scale(0.96);
}

/* ============================================================
   多轮对话页面
   ============================================================ */
.ai-chat-page {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding: 24px;
    color: #1f2937;
}

.ai-chat-layout {
    width: min(1280px, 100%);
    height: calc(100vh - 48px);
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
    gap: 16px;
}

.ai-chat-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d9e2ec;
}
[data-md-color-scheme="slate"] .ai-chat-card {
    background: #17212b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.ai-chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5ebf1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}
[data-md-color-scheme="slate"] .ai-chat-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ai-header-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.ai-chat-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}
[data-md-color-scheme="slate"] .ai-chat-title {
    color: #f8fafc;
}

.ai-chat-subtitle {
    font-size: 12px;
    color: #516173;
    background: #edf4f7;
    padding: 3px 8px;
    border-radius: 6px;
}
[data-md-color-scheme="slate"] .ai-chat-subtitle {
    color: #b8c4d1;
    background: rgba(255, 255, 255, 0.08);
}

.ai-back-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.ai-back-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 消息区 */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}
[data-md-color-scheme="slate"] .ai-chat-messages {
    background: #111923;
}

.ai-welcome {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ai-bubble {
    background: #ffffff;
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #e5ebf1;
    font-size: 14px;
    line-height: 1.6;
    max-width: 80%;
    word-break: break-word;
}
[data-md-color-scheme="slate"] .ai-bubble {
    background: #1f2a36;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

/* 用户/AI 消息 */
.user-message {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    max-width: min(78%, 680px);
    word-break: break-word;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

.ai-message {
    align-self: flex-start;
    background: #ffffff;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5ebf1;
    font-size: 14px;
    line-height: 1.6;
    max-width: min(86%, 760px);
    word-break: break-word;
}
[data-md-color-scheme="slate"] .ai-message {
    background: #1f2a36;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}
.ai-message p:first-child {
    margin-top: 0;
}
.ai-message p:last-child {
    margin-bottom: 0;
}

/* 输入区 */
.ai-chat-footer {
    padding: 14px 20px 18px;
    border-top: 1px solid #e5ebf1;
    background: #ffffff;
    flex-shrink: 0;
}
[data-md-color-scheme="slate"] .ai-chat-footer {
    background: #17212b;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.ai-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px 4px 4px 20px;
    border: 1px solid #d9e2ec;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.ai-input-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: #fff;
}
[data-md-color-scheme="slate"] .ai-input-wrap {
    background: #111923;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-md-color-scheme="slate"] .ai-input-wrap:focus-within {
    background: #17212b;
}

.ai-input-wrap input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #333;
    height: 40px;
}
[data-md-color-scheme="slate"] .ai-input-wrap input[type="text"] {
    color: #e0e0e0;
}

.ai-input-wrap input[type="text"]::placeholder {
    color: #aaa;
}

.ai-input-wrap button {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}
.ai-input-wrap button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.26);
}
.ai-input-wrap button:active {
    transform: scale(0.95);
}

/* 加载动画 */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
}
.ai-typing span {
    width: 8px;
    height: 8px;
    background: #2563eb;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}
.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 滚动条美化 */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}
.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

/* ---------- 参考文档（引用来源） ---------- */
.ai-sources {
    margin-top: 12px;
    border-top: 1px solid #e5ebf1;
    padding-top: 10px;
}
[data-md-color-scheme="slate"] .ai-sources {
    border-top-color: rgba(255,255,255,0.08);
}

.ai-sources-toggle {
    font-size: 12px;
    color: #2563eb;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 700;
}
.ai-sources-toggle:hover {
    background: rgba(37, 99, 235, 0.08);
}

.ai-sources-list {
    display: none;
    margin-top: 8px;
    animation: aiSourceIn 0.25s ease;
}
.ai-sources-list.show {
    display: block;
}

@keyframes aiSourceIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-source-item {
    width: 100%;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    font-size: 12px;
    border: 1px solid #d9e2ec;
    border-left: 3px solid #0f766e;
    color: inherit;
    cursor: pointer;
    display: block;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
[data-md-color-scheme="slate"] .ai-source-item {
    background: #17212b;
    border-color: rgba(255,255,255,0.08);
    border-left-color: #2dd4bf;
}
.ai-source-item:hover,
.ai-source-item.is-active {
    border-color: #2563eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.ai-source-item:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.ai-source-title {
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 4px;
    font-size: 13px;
}
[data-md-color-scheme="slate"] .ai-source-title {
    color: #5eead4;
}

.ai-source-content {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
}
[data-md-color-scheme="slate"] .ai-source-content {
    color: #bbb;
}

.ai-source-path {
    color: #6b7280;
    font-size: 11px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-md-color-scheme="slate"] .ai-source-path {
    color: #94a3b8;
}

.ai-source-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #d9e2ec;
}
[data-md-color-scheme="slate"] .ai-source-footer {
    border-top-color: rgba(255,255,255,0.08);
}

.ai-source-link {
    flex-shrink: 0;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.ai-source-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ---------- 右侧参考文档详情 ---------- */
.ai-reference-card {
    height: 100%;
    min-height: 0;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
[data-md-color-scheme="slate"] .ai-reference-card {
    background: #17212b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.ai-reference-header {
    padding: 16px 18px;
    border-bottom: 1px solid #e5ebf1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
[data-md-color-scheme="slate"] .ai-reference-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ai-reference-kicker {
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.ai-reference-header h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    line-height: 1.35;
}
[data-md-color-scheme="slate"] .ai-reference-header h2 {
    color: #f8fafc;
}

.ai-reference-link {
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    background: #eff6ff;
}
.ai-reference-link:hover {
    color: #1d4ed8;
    border-color: #93c5fd;
}
.ai-reference-link.is-disabled {
    pointer-events: none;
    color: #94a3b8;
    border-color: #e5ebf1;
    background: #f8fafc;
}

.ai-reference-meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 18px;
    border-bottom: 1px solid #edf2f7;
    flex-shrink: 0;
}
[data-md-color-scheme="slate"] .ai-reference-meta {
    color: #b8c4d1;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.ai-reference-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.75;
    white-space: normal;
    word-break: break-word;
    background: #fbfdff;
}
[data-md-color-scheme="slate"] .ai-reference-body {
    background: #111923;
    color: #e2e8f0;
}

.ai-reference-body h1,
.ai-reference-body h2,
.ai-reference-body h3,
.ai-reference-body h4,
.ai-reference-body h5,
.ai-reference-body h6 {
    margin: 0 0 10px;
    color: #111827;
    line-height: 1.35;
}
.ai-reference-body h1 { font-size: 22px; }
.ai-reference-body h2 { font-size: 19px; }
.ai-reference-body h3 { font-size: 17px; }
.ai-reference-body h4,
.ai-reference-body h5,
.ai-reference-body h6 { font-size: 15px; }
[data-md-color-scheme="slate"] .ai-reference-body h1,
[data-md-color-scheme="slate"] .ai-reference-body h2,
[data-md-color-scheme="slate"] .ai-reference-body h3,
[data-md-color-scheme="slate"] .ai-reference-body h4,
[data-md-color-scheme="slate"] .ai-reference-body h5,
[data-md-color-scheme="slate"] .ai-reference-body h6 {
    color: #f8fafc;
}

.ai-reference-body p {
    margin: 0 0 12px;
}

.ai-reference-body ul,
.ai-reference-body ol {
    margin: 0 0 12px 22px;
    padding: 0;
}

.ai-reference-body li {
    margin: 4px 0;
}

.ai-reference-body blockquote {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-left: 3px solid #0f766e;
    background: #eef7f6;
    color: #374151;
}
[data-md-color-scheme="slate"] .ai-reference-body blockquote {
    background: rgba(45, 212, 191, 0.1);
    color: #d1d5db;
}

.ai-reference-body code {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
    border-radius: 4px;
    padding: 1px 5px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.92em;
}

.ai-reference-body pre {
    margin: 0 0 12px;
    padding: 12px;
    overflow-x: auto;
    border-radius: 6px;
    background: #111827;
    color: #e5e7eb;
}

.ai-reference-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    white-space: pre;
}

.ai-reference-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 12px;
    font-size: 13px;
}

.ai-reference-body th,
.ai-reference-body td {
    border: 1px solid #d9e2ec;
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
}

.ai-reference-body th {
    background: #eef2f7;
    color: #111827;
    font-weight: 700;
}
[data-md-color-scheme="slate"] .ai-reference-body th,
[data-md-color-scheme="slate"] .ai-reference-body td {
    border-color: rgba(255, 255, 255, 0.1);
}
[data-md-color-scheme="slate"] .ai-reference-body th {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.ai-reference-body a {
    color: #2563eb;
    font-weight: 600;
}

.ai-reference-body > :last-child {
    margin-bottom: 0;
}

.ai-reference-body::-webkit-scrollbar {
    width: 6px;
}
.ai-reference-body::-webkit-scrollbar-track {
    background: transparent;
}
.ai-reference-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}

/* ============================================================
   文档代码块放大
   ============================================================ */
.md-typeset .highlight {
    position: relative;
}

.md-typeset .highlight .md-code-zoom {
    position: absolute;
    top: 0.3rem;
    right: 1.7rem;
    z-index: 2;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.1rem;
    background: transparent;
    color: var(--md-default-fg-color--lighter);
    cursor: pointer;
    opacity: 1;
    transition: color 125ms, opacity 125ms;
}

.md-typeset .highlight pre > .md-clipboard {
    top: 0.3rem;
    right: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    padding: 0;
    color: var(--md-default-fg-color--lighter);
    opacity: 1;
}

.md-typeset .highlight .md-code-zoom:hover,
.md-typeset .highlight .md-code-zoom:focus,
.md-typeset .highlight pre > .md-clipboard:hover,
.md-typeset .highlight pre > .md-clipboard:focus {
    background: transparent;
    box-shadow: none;
    color: var(--md-accent-fg-color);
    outline: none;
}

.md-typeset .highlight .md-code-zoom svg {
    display: block;
    width: 0.95rem;
    height: 0.95rem;
    margin: 0.15rem;
    transform: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.md-typeset .highlight pre > .md-clipboard::after {
    width: 0.95rem;
    height: 0.95rem;
    margin: 0.15rem;
}

body.md-code-zoom-active {
    overflow: hidden;
}

body.md-code-zoom-active::before {
    position: fixed;
    inset: 0;
    z-index: 9998;
    content: "";
    background: rgba(0, 0, 0, 0.48);
}

.md-typeset .highlight.md-code-zoomed {
    position: fixed;
    inset: 4rem 2rem 2rem;
    z-index: 10001;
    max-height: none;
    margin: 0;
    overflow: hidden;
    background: var(--md-default-bg-color);
    border: 0.05rem solid var(--md-default-fg-color--lightest);
    border-radius: 0.15rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.24);
}

.md-typeset .highlight.md-code-zoomed pre {
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: none;
    margin: 0;
    padding: 0.45rem 4.25rem 1rem 0;
    overflow: auto;
    background: var(--md-default-bg-color);
    border-radius: 0;
    box-shadow: none;
}

.md-typeset .highlight.md-code-zoomed pre code {
    display: block;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    counter-reset: code-line;
    font-size: 0.72rem;
    line-height: 1.65;
}

.md-typeset .highlight.md-code-zoomed pre code > span {
    display: block;
    min-width: 100%;
    padding-right: 4.25rem;
    background: rgba(0, 0, 0, 0.015);
    counter-increment: code-line;
}

.md-typeset .highlight.md-code-zoomed pre code > span:nth-child(even) {
    background: rgba(0, 0, 0, 0.04);
}

.md-typeset .highlight.md-code-zoomed pre code > span::before {
    position: sticky;
    left: 0;
    z-index: 1;
    display: inline-block;
    width: 2.6rem;
    margin-right: 0.65rem;
    padding: 0 0.55rem 0 0.35rem;
    border-right: 0.05rem solid var(--md-default-fg-color--lightest);
    background: inherit;
    color: var(--md-default-fg-color--lighter);
    font-variant-numeric: tabular-nums;
    text-align: right;
    user-select: none;
    content: counter(code-line);
}

[data-md-color-scheme="slate"] .md-typeset .highlight.md-code-zoomed pre code > span {
    background: rgba(255, 255, 255, 0.025);
}

[data-md-color-scheme="slate"] .md-typeset .highlight.md-code-zoomed pre code > span:nth-child(even) {
    background: rgba(255, 255, 255, 0.055);
}

.md-typeset .highlight.md-code-zoomed .md-code-zoom {
    position: fixed;
    top: 4.35rem;
    right: 3.95rem;
    z-index: 10002;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 1;
}

.md-typeset .highlight.md-code-zoomed .md-code-zoom svg {
    width: 0.8rem;
    height: 0.8rem;
    margin: 0.2rem;
    transform: translateY(-0.05rem);
}

.md-typeset .highlight.md-code-zoomed .md-clipboard {
    position: fixed;
    top: 4.35rem;
    right: 2.5rem;
    z-index: 10002;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 1;
}

/* 响应式 */
@media (max-width: 960px) {
    .ai-chat-page {
        padding: 16px;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    .ai-chat-layout {
        height: auto;
        min-height: auto;
        grid-template-columns: 1fr;
    }
    .ai-chat-card {
        height: 68vh;
        min-height: 68vh;
    }
    .ai-reference-card {
        height: 420px;
        min-height: 360px;
    }
}

@media (max-width: 640px) {
    .ai-chat-modal {
        right: 16px;
        left: 16px;
        width: auto;
        bottom: 80px;
    }
    .ai-chat-page {
        padding: 10px;
    }
    .ai-chat-layout {
        gap: 10px;
    }
    .ai-chat-card {
        min-height: 76vh;
        border-radius: 8px;
    }
    .ai-chat-header,
    .ai-reference-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .ai-header-left {
        flex-wrap: wrap;
    }
    .user-message,
    .ai-message,
    .ai-bubble {
        max-width: 100%;
    }
    .ai-reference-card {
        height: 70vh;
        max-height: 70vh;
    }
    .ai-float-btn {
        bottom: 20px;
        right: 20px;
        padding: 10px 16px;
        font-size: 13px;
    }
    .md-typeset .highlight .md-code-zoom {
        opacity: 1;
    }
    .md-typeset .highlight.md-code-zoomed {
        inset: 1rem;
    }
    .md-typeset .highlight.md-code-zoomed pre {
        padding-right: 4rem;
    }
    .md-typeset .highlight.md-code-zoomed .md-code-zoom {
        top: 1.35rem;
        right: 2.95rem;
    }
    .md-typeset .highlight.md-code-zoomed .md-clipboard {
        top: 1.35rem;
        right: 1.5rem;
    }
}
