/**
 * 登录页 · 关灯态智能助手（灯火工坊 · 可收起）
 */
.auth-ai-panel {
    --ai-gold: #d4b07a;
    --ai-gold-soft: rgba(212, 176, 122, .55);
    --ai-ink: #07090f;
    --ai-panel: rgba(12, 16, 28, .78);
    --ai-well: rgba(4, 6, 12, .55);
    --ai-line: rgba(212, 176, 122, .18);
    --ai-text: #e8e2d6;
    --ai-muted: rgba(200, 190, 170, .62);
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--split-left, 55%);
    z-index: 7;
    display: flex;
    flex-direction: column;
    padding: 108px 16px 18px;
    box-sizing: border-box;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

.auth-stage.lights-on .auth-ai-panel {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* —— 收起态唤起条 —— */
.auth-ai-dock {
    pointer-events: auto;
    position: absolute;
    left: 14px;
    bottom: 22px;
    top: auto;
    transform: translateX(-8px);
    z-index: 2;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 46px;
    padding: 18px 0;
    border: 1px solid var(--ai-line);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(28, 24, 18, .92), rgba(10, 12, 18, .95));
    box-shadow:
        0 16px 40px rgba(0, 0, 0, .55),
        inset 0 1px 0 rgba(255, 230, 180, .12);
    color: var(--ai-gold);
    cursor: pointer;
    opacity: 0;
    transition: opacity .35s ease, transform .45s cubic-bezier(.22, 1, .36, 1), box-shadow .25s;
}

.auth-ai-dock:hover {
    box-shadow:
        0 18px 48px rgba(0, 0, 0, .6),
        0 0 28px rgba(212, 176, 122, .18),
        inset 0 1px 0 rgba(255, 230, 180, .16);
    transform: translateX(0);
}

.auth-ai-dock-glow {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 20%, rgba(212, 176, 122, .22), transparent 60%);
    pointer-events: none;
}

.auth-ai-dock-ico {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff2d4, var(--ai-gold) 55%, #8a6a38);
    box-shadow: 0 0 12px rgba(212, 176, 122, .65);
    animation: authAiPulse 2.4s ease-in-out infinite;
}

.auth-ai-dock-txt {
    writing-mode: vertical-rl;
    letter-spacing: .28em;
    font-size: 12px;
    font-weight: 600;
    color: #e8dcc4;
}

.auth-ai-panel.is-collapsed .auth-ai-dock {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    animation: authAiDockIn .5s cubic-bezier(.22, 1, .36, 1) both;
}

/* —— 主面板壳 —— */
.auth-ai-shell {
    pointer-events: auto;
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(155deg, rgba(32, 28, 22, .55) 0%, transparent 42%),
        linear-gradient(180deg, rgba(14, 18, 30, .88), rgba(6, 8, 14, .94));
    border: 1px solid rgba(212, 176, 122, .22);
    box-shadow:
        0 28px 64px rgba(0, 0, 0, .55),
        0 0 0 1px rgba(0, 0, 0, .35),
        inset 0 1px 0 rgba(255, 236, 200, .1);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    transform-origin: left center;
    transition:
        opacity .4s ease,
        transform .5s cubic-bezier(.22, 1, .36, 1),
        filter .4s ease;
}

.auth-ai-panel.is-collapsed .auth-ai-shell {
    opacity: 0;
    transform: translateX(-18px) scale(.96);
    filter: blur(2px);
    pointer-events: none;
    visibility: hidden;
}

.auth-ai-aura {
    position: absolute;
    left: 12%;
    right: 12%;
    top: -20%;
    height: 48%;
    background: radial-gradient(ellipse at 50% 0%, rgba(212, 176, 122, .2), transparent 68%);
    pointer-events: none;
    z-index: 0;
    animation: authAiAura 6s ease-in-out infinite;
}

.auth-ai-rim {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(90deg, transparent, rgba(212, 176, 122, .12), transparent) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 28%);
}

.auth-ai-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    background: linear-gradient(180deg, rgba(255, 236, 200, .05), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.auth-ai-brand {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.auth-ai-mark {
    flex: none;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 12px;
    background:
        radial-gradient(circle at 35% 30%, #fff6e4, var(--ai-gold) 48%, #6e5428 90%);
    box-shadow:
        0 0 0 1px rgba(212, 176, 122, .35),
        0 8px 20px rgba(0, 0, 0, .35),
        0 0 18px rgba(212, 176, 122, .35);
    position: relative;
}

.auth-ai-mark::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: rgba(8, 10, 16, .35);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, .4);
}

.auth-ai-kicker {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .22em;
    color: var(--ai-gold-soft);
    text-transform: uppercase;
}

.auth-ai-title {
    margin: 0;
    font-family: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
    color: #f4eee4;
    letter-spacing: .04em;
}

.auth-ai-sub {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--ai-muted);
    letter-spacing: .04em;
}

.auth-ai-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    margin-left: auto;
}

.auth-ai-busy {
    font-size: 11px;
    color: var(--ai-gold);
    max-width: 110px;
    text-align: right;
    line-height: 1.35;
    opacity: .9;
}

.auth-ai-icon-btn {
    appearance: none;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    border: 1px solid rgba(212, 176, 122, .22);
    background: rgba(255, 255, 255, .04);
    color: #e8dcc4;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s;
}

.auth-ai-icon-btn:hover {
    background: rgba(212, 176, 122, .12);
    border-color: rgba(212, 176, 122, .4);
    transform: translateY(-1px);
}

/* 右上角收起：紧凑动态图标，不占内容区 */
.auth-ai-fab-collapse {
    appearance: none;
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    z-index: 4;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #1a140c;
    background: linear-gradient(145deg, #f0dcb4, #c9a46a 55%, #a88448);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, .35),
        0 0 0 1px rgba(255, 230, 180, .25),
        inset 0 1px 0 rgba(255, 255, 255, .35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s;
}

.auth-ai-fab-collapse:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, .45),
        0 0 22px rgba(212, 176, 122, .35),
        0 0 0 1px rgba(255, 230, 180, .35),
        inset 0 1px 0 rgba(255, 255, 255, .4);
}

.auth-ai-fab-collapse:active {
    transform: scale(.94);
}

.auth-ai-fab-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid rgba(212, 176, 122, .45);
    animation: authAiFabRing 2.4s ease-out infinite;
    pointer-events: none;
}

.auth-ai-fab-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 55%);
    pointer-events: none;
    animation: authAiFabGlow 2.8s ease-in-out infinite;
}

.auth-ai-fab-ico {
    position: relative;
    z-index: 1;
    animation: authAiFabNudge 2.2s ease-in-out infinite;
}

.auth-ai-fab-trail {
    opacity: .55;
    stroke-dasharray: 8;
    animation: authAiFabTrail 1.8s ease-in-out infinite;
}

.auth-ai-main {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 14px 14px;
}

.auth-ai-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 12px;
    padding: 5px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}

.auth-ai-tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ai-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: color .2s, background .2s, box-shadow .2s, transform .2s;
}

.auth-ai-tab i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
}

.auth-ai-tab:hover {
    color: #f0e6d4;
}

.auth-ai-tab.is-active {
    color: #1a140c;
    background: linear-gradient(180deg, #e8d0a4, #c9a46a);
    box-shadow: 0 6px 16px rgba(180, 130, 60, .28);
}

.auth-ai-tab.is-active i {
    opacity: .7;
    background: #5a3f18;
}

.auth-ai-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 12px;
}

.auth-ai-pane {
    display: none;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
    animation: authAiPaneIn .35s ease both;
}

.auth-ai-pane.is-active {
    display: flex;
}

.auth-ai-well {
    flex: 1;
    min-height: 0;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%),
        var(--ai-well);
    border: 1px solid rgba(255, 255, 255, .06);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, .35),
        0 1px 0 rgba(255, 255, 255, .04);
    overflow: hidden;
}

.auth-ai-log {
    height: 100%;
    min-height: 140px;
    overflow: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 176, 122, .35) transparent;
}

.auth-ai-msg {
    max-width: 94%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ai-text);
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
    animation: authAiMsgIn .35s ease both;
}

.auth-ai-msg.user {
    align-self: flex-end;
    background: linear-gradient(145deg, rgba(212, 176, 122, .28), rgba(120, 90, 40, .22));
    border: 1px solid rgba(212, 176, 122, .3);
    border-bottom-right-radius: 5px;
}

.auth-ai-msg.bot {
    align-self: flex-start;
    background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
    border: 1px solid rgba(255, 255, 255, .08);
    border-bottom-left-radius: 5px;
}

.auth-ai-msg.err {
    align-self: stretch;
    background: rgba(120, 36, 36, .28);
    border: 1px solid rgba(255, 130, 130, .28);
    color: #ffd4d4;
}

.auth-ai-msg img,
.auth-ai-msg video {
    display: block;
    max-width: 100%;
    border-radius: 10px;
    margin-top: 8px;
}

.auth-ai-media {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.auth-ai-media img,
.auth-ai-media video {
    margin-top: 0;
    max-width: 100%;
    border-radius: 10px;
    background: rgba(0,0,0,.25);
}

.auth-ai-dl {
    appearance: none;
    border: 1px solid rgba(212, 176, 122, .45);
    background: rgba(212, 176, 122, .12);
    color: #e8c98a;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}
.auth-ai-dl:hover {
    background: rgba(212, 176, 122, .22);
    border-color: rgba(212, 176, 122, .7);
}

.auth-ai-hint {
    font-size: 12px;
    color: var(--ai-muted);
    line-height: 1.5;
    margin: 0;
    padding: 0 2px;
}

.auth-ai-compose {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .22));
    border: 1px solid rgba(212, 176, 122, .14);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
}

.auth-ai-compose textarea,
.auth-ai-compose input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .35);
    color: #f3ede3;
    font-size: 13px;
    padding: 11px 12px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.auth-ai-compose textarea:focus,
.auth-ai-compose input[type="text"]:focus {
    border-color: rgba(212, 176, 122, .45);
    box-shadow: 0 0 0 3px rgba(212, 176, 122, .12);
}

.auth-ai-compose textarea::placeholder,
.auth-ai-compose input::placeholder {
    color: rgba(180, 170, 150, .45);
}

.auth-ai-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-ai-row .grow {
    flex: 1;
    min-width: 0;
}

.auth-ai-btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #1a140c;
    background: linear-gradient(180deg, #edd7ad, #c9a46a);
    box-shadow: 0 8px 18px rgba(160, 120, 50, .28);
    white-space: nowrap;
    transition: transform .2s, filter .2s, box-shadow .2s;
}

.auth-ai-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.auth-ai-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.auth-ai-btn.ghost {
    color: #e8dcc4;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(212, 176, 122, .22);
    box-shadow: none;
}

.auth-ai-file {
    position: relative;
    overflow: hidden;
}

.auth-ai-file input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.auth-ai-preview {
    display: none;
    max-height: 56px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(212, 176, 122, .25);
}

.auth-ai-preview.is-on {
    display: block;
}

.auth-ai-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
}
.auth-ai-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(212, 176, 122, .28);
    flex-shrink: 0;
}
.auth-ai-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.auth-ai-thumb-rm {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 18, 28, .72);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.auth-ai-records .auth-ai-msg {
    white-space: pre-wrap;
    font-size: 12px;
    line-height: 1.55;
}

.auth-ai-tabs {
    flex-wrap: wrap;
}

/* 关灯且助手开启：灯体/吊线不动不改形；仅弱化拉绳旁提示，避免挡字 */
.auth-stage:not(.lights-on):has(#authAiPanel) .pull-tip {
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}
.auth-stage:not(.lights-on):has(#authAiPanel) .pull:hover .pull-tip,
.auth-stage:not(.lights-on):has(#authAiPanel) .pull:focus-visible .pull-tip {
    opacity: .95;
}

@keyframes authAiPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 176, 122, .45); transform: scale(1); }
    50% { box-shadow: 0 0 18px rgba(212, 176, 122, .85); transform: scale(1.08); }
}

@keyframes authAiAura {
    0%, 100% { opacity: .75; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

@keyframes authAiDockIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes authAiPaneIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes authAiMsgIn {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes authAiFabRing {
    0% { transform: scale(.92); opacity: .75; }
    70% { transform: scale(1.28); opacity: 0; }
    100% { transform: scale(1.28); opacity: 0; }
}

@keyframes authAiFabGlow {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

@keyframes authAiFabNudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-2px); }
}

@keyframes authAiFabTrail {
    0%, 100% { stroke-dashoffset: 0; opacity: .35; }
    50% { stroke-dashoffset: -8; opacity: .8; }
}

@media (max-width: 860px) {
    /* PC 登录页窄屏隐藏左侧助手；手机端官网自带 is-mobile-site 仍显示 */
    .auth-ai-panel:not(.is-mobile-site) {
        display: none !important;
    }
}

/* ========== 手机端官网悬浮智能助手 ========== */
.auth-ai-panel.is-mobile-site {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    z-index: 90;
    display: flex !important;
    flex-direction: column;
    pointer-events: none;
    background: transparent;
}
.auth-ai-panel.is-mobile-site .auth-ai-dock {
    left: auto;
    right: 14px;
    bottom: calc(var(--m-tabbar-h, 60px) + 14px + env(safe-area-inset-bottom, 0px));
    top: auto;
    transform: none;
    width: auto;
    min-width: 52px;
    height: 52px;
    padding: 0 16px;
    flex-direction: row;
    gap: 8px;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.auth-ai-panel.is-mobile-site.is-collapsed .auth-ai-dock {
    display: inline-flex;
    animation: none;
}
.auth-ai-panel.is-mobile-site .auth-ai-dock-txt {
    writing-mode: horizontal-tb;
    font-size: 12px;
    letter-spacing: 0;
}
.auth-ai-panel.is-mobile-site .auth-ai-shell {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(var(--m-appbar-h, 52px) + 8px);
    bottom: calc(var(--m-tabbar-h, 60px) + 8px + env(safe-area-inset-bottom, 0px));
    flex: none;
    width: auto;
    height: auto;
    transform-origin: bottom center;
    z-index: 2;
}
.auth-ai-panel.is-mobile-site.is-collapsed .auth-ai-shell {
    transform: translateY(24px) scale(.96);
}
.auth-ai-panel.is-mobile-site:not(.is-collapsed) {
    background: rgba(5, 8, 16, .45);
    pointer-events: auto;
}
.auth-ai-panel.is-mobile-site:not(.is-collapsed) .auth-ai-shell {
    pointer-events: auto;
}
body.auth-ai-open {
    overflow: hidden;
}
body.auth-ai-open .m-main {
    pointer-events: none;
}
