/* 数据库 AI 问答页 — 对齐 midnight 深色风格 */
.dmj-ai-page {
    --ai-bg: #0e0914;
    --ai-panel: rgba(22, 14, 30, 0.88);
    --ai-line: rgba(157, 78, 221, 0.28);
    --ai-accent: #c084fc;
    --ai-accent-2: #ffc045;
    --ai-text: #efe7f7;
    --ai-muted: #a898b8;
    --ai-user: rgba(157, 78, 221, 0.22);
    --ai-bot: rgba(255, 255, 255, 0.045);
    position: relative;
    isolation: isolate;
    /* 避开绝对定位顶栏（50px）与右侧登录入口 */
    min-height: calc(100vh - 50px);
    margin-top: 50px;
    padding: 28px 20px 48px;
    padding-right: max(20px, 140px);
    overflow: hidden;
    background: var(--ai-bg);
}

/* ===== 背景动效层 ===== */
.dmj-ai-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.dmj-ai-bg-aurora {
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(42% 36% at 18% 12%, rgba(157, 78, 221, 0.34), transparent 70%),
        radial-gradient(36% 30% at 82% 18%, rgba(255, 192, 69, 0.14), transparent 68%),
        radial-gradient(48% 40% at 50% 88%, rgba(88, 28, 135, 0.28), transparent 72%);
    animation: dmj-ai-aurora 14s ease-in-out infinite alternate;
    filter: blur(8px);
}

.dmj-ai-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    mix-blend-mode: screen;
}

.dmj-ai-bg-orb-a {
    width: 280px;
    height: 280px;
    left: -40px;
    top: 18%;
    background: rgba(157, 78, 221, 0.45);
    animation: dmj-ai-orb-a 18s ease-in-out infinite;
}

.dmj-ai-bg-orb-b {
    width: 220px;
    height: 220px;
    right: 8%;
    top: 8%;
    background: rgba(255, 192, 69, 0.22);
    animation: dmj-ai-orb-b 22s ease-in-out infinite;
}

.dmj-ai-bg-orb-c {
    width: 320px;
    height: 320px;
    right: 18%;
    bottom: -60px;
    background: rgba(109, 40, 217, 0.32);
    animation: dmj-ai-orb-c 20s ease-in-out infinite;
}

.dmj-ai-bg-stars {
    position: absolute;
    inset: 0;
}

.dmj-ai-bg-stars i {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 6px rgba(208, 180, 255, 0.8);
    animation: dmj-ai-twinkle 3.6s ease-in-out infinite;
}

.dmj-ai-bg-stars i:nth-child(1)  { left: 8%;  top: 14%; animation-delay: 0s; }
.dmj-ai-bg-stars i:nth-child(2)  { left: 22%; top: 28%; animation-delay: .4s; width: 3px; height: 3px; }
.dmj-ai-bg-stars i:nth-child(3)  { left: 41%; top: 10%; animation-delay: .9s; }
.dmj-ai-bg-stars i:nth-child(4)  { left: 58%; top: 22%; animation-delay: 1.2s; }
.dmj-ai-bg-stars i:nth-child(5)  { left: 73%; top: 12%; animation-delay: .2s; width: 3px; height: 3px; }
.dmj-ai-bg-stars i:nth-child(6)  { left: 88%; top: 30%; animation-delay: 1.6s; }
.dmj-ai-bg-stars i:nth-child(7)  { left: 14%; top: 62%; animation-delay: .7s; }
.dmj-ai-bg-stars i:nth-child(8)  { left: 33%; top: 74%; animation-delay: 1.1s; }
.dmj-ai-bg-stars i:nth-child(9)  { left: 49%; top: 58%; animation-delay: .3s; width: 3px; height: 3px; }
.dmj-ai-bg-stars i:nth-child(10) { left: 67%; top: 70%; animation-delay: 1.8s; }
.dmj-ai-bg-stars i:nth-child(11) { left: 81%; top: 54%; animation-delay: .5s; }
.dmj-ai-bg-stars i:nth-child(12) { left: 92%; top: 78%; animation-delay: 1.4s; }

.dmj-ai-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(192, 132, 252, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(192, 132, 252, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.55), transparent 78%);
    animation: dmj-ai-grid 28s linear infinite;
    opacity: 0.55;
}

@keyframes dmj-ai-aurora {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(2%, -1.5%, 0) scale(1.05); }
    100% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
}

@keyframes dmj-ai-orb-a {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(48px, 36px, 0); }
}

@keyframes dmj-ai-orb-b {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-40px, 50px, 0); }
}

@keyframes dmj-ai-orb-c {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-30px, -40px, 0) scale(1.08); }
}

@keyframes dmj-ai-twinkle {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.6); }
}

@keyframes dmj-ai-grid {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 56px 56px, 56px 56px; }
}

.dmj-ai-shell {
    position: relative;
    z-index: 1;
    width: min(1200px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: calc(100vh - 140px);
}

.dmj-ai-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 4px 8px;
}

.dmj-ai-kicker {
    margin: 0 0 6px;
    color: var(--ai-accent);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dmj-ai-head h1 {
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 2px 18px rgba(157, 78, 221, 0.35);
}

.dmj-ai-desc {
    margin: 8px 0 0;
    color: var(--ai-muted);
    font-size: 14px;
    line-height: 1.6;
}

.dmj-ai-head-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 4px;
}

.dmj-ai-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease, filter .15s ease;
}

.dmj-ai-btn-ghost {
    background: rgba(0, 0, 0, 0.22);
    border-color: var(--ai-line);
    color: var(--ai-text);
    backdrop-filter: blur(6px);
}

.dmj-ai-btn-ghost:hover {
    border-color: var(--ai-accent);
    color: #fff;
}

.dmj-ai-btn-primary {
    background: linear-gradient(135deg, #9d4edd, #7b2cbf);
    color: #fff;
    border-color: transparent;
    min-width: 88px;
}

.dmj-ai-btn-primary:hover {
    filter: brightness(1.08);
}

.dmj-ai-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

.dmj-ai-btn-stop {
    border-color: rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.dmj-ai-btn-stop:hover {
    border-color: #f87171;
    color: #fff;
    background: rgba(127, 29, 29, 0.35);
}

.dmj-ai-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dmj-ai-chat {
    flex: 1;
    min-height: 420px;
    max-height: min(62vh, 680px);
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--ai-line);
    border-radius: 14px;
    background: var(--ai-panel);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

.dmj-ai-msg {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.dmj-ai-msg:last-child {
    margin-bottom: 0;
}

.dmj-ai-msg-user {
    flex-direction: row-reverse;
}

.dmj-ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(157, 78, 221, 0.25);
    color: var(--ai-accent);
    border: 1px solid var(--ai-line);
}

.dmj-ai-msg-user .dmj-ai-avatar {
    background: rgba(255, 192, 69, 0.16);
    color: var(--ai-accent-2);
    border-color: rgba(255, 192, 69, 0.35);
}

.dmj-ai-bubble {
    max-width: min(980px, calc(100% - 50px));
    padding: 14px 16px 16px;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(42, 28, 58, 0.55), rgba(22, 14, 30, 0.35)),
        rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(192, 132, 252, 0.22);
    color: var(--ai-text);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dmj-ai-msg-user .dmj-ai-bubble {
    background: var(--ai-user);
    border-color: rgba(157, 78, 221, 0.35);
    box-shadow: none;
}

.dmj-ai-bubble-text,
.dmj-ai-rich {
    font-size: 12.5px;
    line-height: 1.65;
    word-break: break-word;
}

.dmj-ai-rich > *:first-child {
    margin-top: 0 !important;
}

.dmj-ai-rich > *:last-child {
    margin-bottom: 0 !important;
}

.dmj-ai-bubble-text .dmj-ai-p {
    margin: 0 0 10px;
    color: #e8dff2;
}

.dmj-ai-bubble-text .dmj-ai-p:last-child {
    margin-bottom: 0;
}

.dmj-ai-bubble-text .dmj-ai-h {
    margin: 14px 0 8px;
    color: #fff;
    font-weight: 700;
    line-height: 1.35;
}

.dmj-ai-bubble-text h1.dmj-ai-h { font-size: 16px; }
.dmj-ai-bubble-text h2.dmj-ai-h { font-size: 14.5px; }
.dmj-ai-bubble-text h3.dmj-ai-h { font-size: 13px; color: #e9d5ff; }
.dmj-ai-bubble-text h4.dmj-ai-h { font-size: 12.5px; color: #e9d5ff; }

.dmj-ai-bubble-text .dmj-ai-title {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(192, 132, 252, 0.22);
    font-size: 16px !important;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #fff, #e9d5ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dmj-ai-bubble-text .dmj-ai-section {
    margin: 14px 0 8px;
    padding-left: 10px;
    border-left: 3px solid rgba(192, 132, 252, 0.7);
    font-size: 12.5px !important;
    color: #f3e8ff !important;
    font-weight: 600;
}

.dmj-ai-bubble-text .dmj-ai-h:first-child,
.dmj-ai-bubble-text .dmj-ai-title:first-child {
    margin-top: 0;
}

.dmj-ai-icon-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 12px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(192, 132, 252, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.dmj-ai-icon-card .dmj-ai-img,
.dmj-ai-icon-card img {
    width: 56px;
    height: 56px;
    max-width: 56px;
    max-height: 56px;
    margin: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 192, 69, 0.35);
    background: #1a1224;
    object-fit: cover;
}

/* 多图轮播（需覆盖站点全局 button !important） */
.dmj-ai-swiper {
    margin: 4px 0 14px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(192, 132, 252, 0.28);
    background: rgba(0, 0, 0, 0.28);
    user-select: none;
    max-width: 320px;
}

.dmj-ai-swiper button {
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    color: inherit !important;
    font-weight: 400 !important;
    height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    line-height: 1 !important;
    font-size: inherit !important;
    white-space: normal !important;
    box-shadow: none !important;
}

.dmj-ai-swiper-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dmj-ai-swiper-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
}

.dmj-ai-swiper-track {
    display: flex;
    transition: transform 0.28s ease;
    will-change: transform;
}

.dmj-ai-swiper-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.dmj-ai-swiper-slide .dmj-ai-img-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 !important;
    padding: 6px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-radius: 8px !important;
    height: auto !important;
    cursor: zoom-in;
}

.dmj-ai-swiper-slide .dmj-ai-img,
.dmj-ai-swiper-slide img {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
    max-height: 160px;
    margin: 0 auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #f5f5f5;
    object-fit: contain;
}

.dmj-ai-swiper-nav {
    flex: 0 0 28px;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(192, 132, 252, 0.4) !important;
    background: rgba(18, 10, 28, 0.92) !important;
    color: #efe7f7 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 0 2px !important;
}

.dmj-ai-swiper-nav:hover {
    border-color: #ffc045 !important;
    color: #ffc045 !important;
    opacity: 1;
}

.dmj-ai-swiper-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.dmj-ai-swiper-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.dmj-ai-swiper-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.28) !important;
    cursor: pointer;
    padding: 0 !important;
}

.dmj-ai-swiper-dot.is-active {
    background: #c084fc !important;
    width: 14px !important;
    border-radius: 999px !important;
}

.dmj-ai-swiper-count {
    color: #c4b0d8;
    font-size: 11px;
    line-height: 1;
}

.dmj-ai-kv {
    margin: 0 0 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(192, 132, 252, 0.24);
    background: rgba(0, 0, 0, 0.22);
}

.dmj-ai-kv-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: start;
}

.dmj-ai-kv-row:nth-child(odd) {
    background: rgba(157, 78, 221, 0.06);
}

.dmj-ai-kv-row:last-child {
    border-bottom: 0;
}

.dmj-ai-kv-k {
    color: #c4b0d8;
    font-size: 12px;
    line-height: 1.5;
}

.dmj-ai-kv-v {
    color: #f4edfa;
    font-size: 12.5px;
    line-height: 1.55;
}

.dmj-ai-chips {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dmj-ai-chips li {
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(192, 132, 252, 0.28);
    background: rgba(157, 78, 221, 0.12);
    color: #efe7f7;
    font-size: 12px;
    line-height: 1.3;
}

.dmj-ai-hr {
    border: 0;
    border-top: 1px solid rgba(192, 132, 252, 0.22);
    margin: 14px 0;
}

.dmj-ai-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(192, 132, 252, 0.28);
    background: rgba(0, 0, 0, 0.22);
}

.dmj-ai-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 280px;
    font-size: 12px;
}

.dmj-ai-table th,
.dmj-ai-table td {
    padding: 9px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dmj-ai-table th {
    width: 28%;
    color: #e9d5ff;
    background: rgba(157, 78, 221, 0.16);
    font-weight: 600;
    white-space: nowrap;
}

.dmj-ai-table tr:last-child td {
    border-bottom: 0;
}

.dmj-ai-table td {
    color: var(--ai-text);
}

.dmj-ai-img,
.dmj-ai-bubble-text img {
    display: block;
    max-width: min(180px, 100%);
    max-height: 180px;
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(192, 132, 252, 0.3);
    background: rgba(0, 0, 0, 0.25);
    object-fit: contain;
}

.dmj-ai-img-btn {
    appearance: none;
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 4px 0 10px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: inherit !important;
    height: auto !important;
    font: inherit;
    line-height: 1 !important;
    white-space: normal !important;
    cursor: zoom-in;
    vertical-align: top;
    box-shadow: none !important;
}

.dmj-ai-img-btn:hover .dmj-ai-img,
.dmj-ai-img-btn:hover img {
    border-color: rgba(255, 192, 69, 0.55);
    box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25);
}

.dmj-ai-img-zoom {
    font-size: 11px;
    color: #c4b0d8;
    line-height: 1;
}

.dmj-ai-img-btn:hover .dmj-ai-img-zoom {
    color: #ffc045;
}

.dmj-ai-icon-card .dmj-ai-img-btn {
    margin: 0;
}

.dmj-ai-icon-card .dmj-ai-img-zoom {
    display: none;
}

.dmj-ai-img-fallback {
    color: #ffc045;
}

/* 原图预览弹层 */
body.dmj-ai-lightbox-lock {
    overflow: hidden;
}

.dmj-ai-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000000050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dmj-ai-lightbox.is-open {
    display: flex;
}

.dmj-ai-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 3, 12, 0.82);
    backdrop-filter: blur(6px);
}

.dmj-ai-lightbox-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: min(96vw, 1400px);
}

.dmj-ai-lightbox-stage {
    position: relative;
    box-sizing: border-box;
    width: min(92vw, 720px);
    min-width: min(92vw, 600px);
    min-height: 300px;
    max-height: calc(92vh - 56px);
    padding: 28px 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(192, 132, 252, 0.35);
    background:
        radial-gradient(ellipse at 50% 40%, rgba(88, 48, 120, 0.22), transparent 65%),
        rgba(12, 8, 18, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.dmj-ai-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: min(420px, calc(92vh - 120px));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    box-shadow: none;
}

.dmj-ai-lightbox-cap {
    margin: 0;
    color: #c4b0d8;
    font-size: 13px;
    text-align: center;
    max-width: 90vw;
    line-height: 1.4;
}

.dmj-ai-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(192, 132, 252, 0.45) !important;
    background: rgba(24, 14, 36, 0.92) !important;
    color: #fff !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 0 2px !important;
}

.dmj-ai-lightbox-prev { left: 10px; }
.dmj-ai-lightbox-next { right: 10px; }

.dmj-ai-lightbox-nav:hover {
    border-color: #ffc045 !important;
    color: #ffc045 !important;
    opacity: 1;
}

.dmj-ai-lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(192, 132, 252, 0.45) !important;
    background: rgba(18, 10, 28, 0.96) !important;
    color: #efe7f7 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    z-index: 3;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.dmj-ai-lightbox-close::before,
.dmj-ai-lightbox-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 1.5px;
    margin: 0;
    background: currentColor;
    border-radius: 1px;
}

.dmj-ai-lightbox-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.dmj-ai-lightbox-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.dmj-ai-lightbox-close:hover {
    border-color: #ffc045 !important;
    color: #ffc045 !important;
    background: rgba(36, 20, 52, 0.98) !important;
    opacity: 1;
}

@media (max-width: 720px) {
    .dmj-ai-lightbox-stage {
        width: 92vw;
        min-width: 0;
        min-height: 240px;
        padding: 20px 44px;
    }
    .dmj-ai-lightbox-close {
        top: 8px;
        right: 8px;
    }
    .dmj-ai-lightbox-prev { left: 4px; }
    .dmj-ai-lightbox-next { right: 4px; }
    .dmj-ai-swiper {
        max-width: 100%;
    }
    .dmj-ai-swiper-slide .dmj-ai-img,
    .dmj-ai-swiper-slide img {
        max-height: 140px;
    }
}

.dmj-ai-quote {
    margin: 8px 0 12px;
    padding: 8px 12px;
    border-left: 3px solid rgba(192, 132, 252, 0.55);
    background: rgba(157, 78, 221, 0.1);
    color: #ddd0ea;
    border-radius: 0 8px 8px 0;
}

.dmj-ai-bubble-text a,
.dmj-ai-bubble-text .dmj-ai-link {
    color: #d8b4fe;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dmj-ai-bubble-text a:hover,
.dmj-ai-bubble-text .dmj-ai-link:hover {
    color: #f0e2ff;
}

.dmj-ai-bubble-text strong {
    color: #fff;
    font-weight: 700;
}

.dmj-ai-bubble-text em {
    font-style: italic;
    color: #e8dff2;
}

.dmj-ai-bubble-text code {
    background: rgba(0, 0, 0, 0.35);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
}

.dmj-ai-bubble-text .dmj-ai-list {
    margin: 4px 0 12px;
    padding: 0;
    list-style: none;
}

.dmj-ai-bubble-text .dmj-ai-list li {
    position: relative;
    margin: 0 0 6px;
    padding: 7px 10px 7px 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #efe7f7;
}

.dmj-ai-bubble-text .dmj-ai-list li::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: var(--ai-accent);
    box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
}

.dmj-ai-bubble-text ol.dmj-ai-list {
    counter-reset: dmj-ai-ol;
}

.dmj-ai-bubble-text ol.dmj-ai-list li {
    padding-left: 34px;
}

.dmj-ai-bubble-text ol.dmj-ai-list li::before {
    content: counter(dmj-ai-ol);
    counter-increment: dmj-ai-ol;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    left: 10px;
    border-radius: 5px;
    background: rgba(157, 78, 221, 0.35);
    box-shadow: none;
    color: #f3e8ff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dmj-ai-stopped-tag {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(127, 29, 29, 0.25);
}

.dmj-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.dmj-ai-suggestions button {
    appearance: none;
    border: 1px solid var(--ai-line);
    background: rgba(0, 0, 0, 0.2);
    color: var(--ai-text);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.dmj-ai-suggestions button:hover {
    border-color: var(--ai-accent);
    color: #fff;
    background: rgba(157, 78, 221, 0.18);
}

.dmj-ai-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    height: 18px;
}

.dmj-ai-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-accent);
    opacity: 0.4;
    animation: dmj-ai-bounce 1s infinite ease-in-out;
}

.dmj-ai-typing i:nth-child(2) { animation-delay: .15s; }
.dmj-ai-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes dmj-ai-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: .35; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.dmj-ai-composer {
    position: relative;
    border: 1px solid var(--ai-line);
    border-radius: 14px;
    background: var(--ai-panel);
    padding: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
}

.dmj-ai-login-gate {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 14px;
    background: rgba(14, 8, 22, 0.78);
    backdrop-filter: blur(8px);
    text-align: center;
    padding: 16px;
}

.dmj-ai-login-gate[hidden] {
    display: none !important;
}

.dmj-ai-login-gate p {
    margin: 0;
    color: #f3e8ff;
    font-size: 14px;
    font-weight: 600;
}

.dmj-ai-composer.is-locked textarea,
.dmj-ai-composer.is-locked .dmj-ai-composer-bar {
    opacity: 0.35;
    pointer-events: none;
}

.dmj-ai-composer textarea {
    width: 100%;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ai-text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 56px;
    max-height: 160px;
    font-family: inherit;
}

.dmj-ai-composer textarea::placeholder {
    color: #7d6e8c;
}

.dmj-ai-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.dmj-ai-hint {
    color: var(--ai-muted);
    font-size: 12px;
}

.dmj-ai-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 900px) {
    .dmj-ai-page {
        padding-right: 20px;
    }
}

@media (max-width: 720px) {
    .dmj-ai-page {
        padding: 20px 12px 32px;
        padding-right: 12px;
    }
    .dmj-ai-head {
        flex-direction: column;
    }
    .dmj-ai-head h1 {
        font-size: 22px;
    }
    .dmj-ai-chat {
        max-height: none;
        min-height: 52vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dmj-ai-bg-aurora,
    .dmj-ai-bg-orb,
    .dmj-ai-bg-stars i,
    .dmj-ai-bg-grid {
        animation: none !important;
    }
}
