:root {
    --purple-glow: #8b5cf6;
    --cyan-glow: #06b6d4;
    --void: #0a0a0f;
}

body {
    background: var(--void);
}

[x-cloak] {
    display: none !important;
}

/* 玻璃拟态卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.glass-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.08);
}

/* 发光按钮 */
.glow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    min-height: 2.75rem;
    line-height: 1.5;
    background: linear-gradient(135deg, var(--purple-glow), var(--cyan-glow));
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    text-align: center;
    white-space: nowrap;
}

.glow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.6), 0 0 20px rgba(6, 182, 212, 0.3);
}

.glow-btn-sm {
    display: inline-block;
    background: linear-gradient(135deg, var(--purple-glow), var(--cyan-glow));
    color: white;
    border-radius: 0.5rem;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    transition: transform 0.2s, box-shadow 0.3s;
}

.glow-btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    min-height: 2.75rem;
    line-height: 1.5;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    transition: all 0.3s;
}

.glass-btn:hover {
    border-color: var(--purple-glow);
    background: rgba(139, 92, 246, 0.1);
}

/* 表单 */
.form-label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #f3f4f6;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    border-color: var(--purple-glow);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* 扫描线 */
.scanline {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* 网格叠加 */
.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* LOGO 光晕 */
.logo-glow::after {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3), transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

/* Hero 光球 */
.hero-orb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.4), rgba(6, 182, 212, 0.2), transparent 70%);
    animation: orb-pulse 4s ease-in-out infinite;
    box-shadow: 0 0 80px rgba(139, 92, 246, 0.3);
}

@keyframes orb-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Glitch 标题 */
.glitch-title {
    position: relative;
}

/* 3D 卡片倾斜 */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* VIP 特色卡片 */
.vip-featured {
    border-color: rgba(251, 191, 36, 0.4) !important;
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.15), 0 0 80px rgba(139, 92, 246, 0.1);
}

.vip-featured::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(139, 92, 246, 0.3));
    z-index: -1;
    opacity: 0.5;
}

/* 上传区 */
.upload-zone {
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    animation: upload-pulse 3s ease-in-out infinite;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--cyan-glow);
    background: rgba(6, 182, 212, 0.05);
}

@keyframes upload-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
    50% { box-shadow: 0 0 20px 0 rgba(139, 92, 246, 0.1); }
}

.upload-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 导航链接 */
.nav-link {
    border-left: 2px solid transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.nav-link:hover {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--purple-glow);
}
.nav-link-active {
    background: rgba(139, 92, 246, 0.14);
    border-left-color: var(--purple-glow);
    color: #fff;
}
.nav-link--vip.nav-link-active {
    background: rgba(251, 191, 36, 0.08);
    border-left-color: #fbbf24;
}

.nav-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s, border-color 0.25s;
    flex-shrink: 0;
}
.nav-link:hover .nav-icon-wrap {
    color: #e9d5ff;
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
}
.nav-link-active .nav-icon-wrap {
    color: #c4b5fd;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.2));
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}
.nav-link--vip:hover .nav-icon-wrap,
.nav-link--vip.nav-link-active .nav-icon-wrap {
    color: #fcd34d;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(139, 92, 246, 0.15));
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.3);
}

.nav-icon {
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: filter 0.25s, stroke 0.25s;
}
.nav-icon rect:not(.nav-icon-duo),
.nav-icon path:not(.nav-icon-duo),
.nav-icon circle:not(.nav-icon-duo) {
    vector-effect: non-scaling-stroke;
}
.nav-icon .nav-icon-duo {
    fill: currentColor;
    stroke: none;
    opacity: 0.35;
}
.nav-link-active .nav-icon {
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.6));
}
.nav-link--vip.nav-link-active .nav-icon {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.55));
}

/* 移动端底栏导航 */
.mobile-nav-link {
    min-width: 2.75rem;
    transition: color 0.2s;
}
.mobile-nav-link .nav-icon-wrap {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
}
.mobile-nav-link .nav-icon {
    width: 1.25rem;
    height: 1.25rem;
}
.mobile-nav-link:hover .nav-icon-wrap,
.mobile-nav-active .nav-icon-wrap {
    color: #e9d5ff;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.18));
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}
.mobile-nav-active {
    color: #c4b5fd !important;
}
.mobile-nav-link--vip.mobile-nav-active .nav-icon-wrap,
.mobile-nav-link--vip:hover .nav-icon-wrap {
    color: #fcd34d;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(139, 92, 246, 0.12));
}

/* 页面进入动画 */
.page-enter {
    animation: fade-up 0.6s ease-out;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fade-up 0.4s ease-out;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 3px; }

/* ========== 增强动效 v2 ========== */

/* 极光背景 */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(139, 92, 246, 0.15), transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(6, 182, 212, 0.12), transparent 50%),
        radial-gradient(ellipse 50% 60% at 60% 80%, rgba(167, 139, 250, 0.1), transparent 50%);
    animation: aurora-shift 12s ease-in-out infinite alternate;
}

@keyframes aurora-shift {
    0% { filter: hue-rotate(0deg) brightness(1); transform: scale(1); }
    100% { filter: hue-rotate(20deg) brightness(1.1); transform: scale(1.05); }
}

/* 漂浮光球 */
.floating-orbs span {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(40px);
    animation: float-orb 20s ease-in-out infinite;
}
.floating-orbs span:nth-child(1) { width: 200px; height: 200px; background: rgba(139,92,246,0.15); top: 10%; left: 5%; animation-delay: 0s; }
.floating-orbs span:nth-child(2) { width: 150px; height: 150px; background: rgba(6,182,212,0.12); top: 60%; right: 10%; animation-delay: -5s; }
.floating-orbs span:nth-child(3) { width: 120px; height: 120px; background: rgba(244,114,182,0.1); bottom: 20%; left: 30%; animation-delay: -10s; }
.floating-orbs span:nth-child(4) { width: 180px; height: 180px; background: rgba(99,102,241,0.1); top: 30%; right: 25%; animation-delay: -7s; }
.floating-orbs span:nth-child(5) { width: 100px; height: 100px; background: rgba(251,191,36,0.08); bottom: 10%; right: 40%; animation-delay: -15s; }

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* HUD 角落装饰 */
.hud-corner {
    position: fixed;
    width: 60px;
    height: 60px;
    z-index: 8;
    pointer-events: none;
    opacity: 0.4;
}
.hud-corner::before, .hud-corner::after {
    content: '';
    position: absolute;
    background: linear-gradient(90deg, var(--purple-glow), transparent);
}
.hud-tl { top: 12px; left: 12px; }
.hud-tl::before { top: 0; left: 0; width: 30px; height: 2px; }
.hud-tl::after { top: 0; left: 0; width: 2px; height: 30px; background: linear-gradient(180deg, var(--purple-glow), transparent); }
.hud-tr { top: 12px; right: 12px; transform: scaleX(-1); }
.hud-tr::before { top: 0; left: 0; width: 30px; height: 2px; }
.hud-tr::after { top: 0; left: 0; width: 2px; height: 30px; background: linear-gradient(180deg, var(--cyan-glow), transparent); }
.hud-bl { bottom: 12px; left: 12px; transform: scaleY(-1); }
.hud-bl::before { top: 0; left: 0; width: 30px; height: 2px; }
.hud-bl::after { top: 0; left: 0; width: 2px; height: 30px; }
.hud-br { bottom: 12px; right: 12px; transform: scale(-1); }
.hud-br::before { top: 0; left: 0; width: 30px; height: 2px; }
.hud-br::after { top: 0; left: 0; width: 2px; height: 30px; }

/* 霓虹渐变边框卡片 */
.neon-border {
    position: relative;
    overflow: hidden;
}
.neon-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(139,92,246,0.4), transparent 40%, rgba(6,182,212,0.4));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.neon-border:hover::before { opacity: 1; }

/* Glitch 标题 */
.glitch-title {
    position: relative;
}
.glitch-title:hover span {
    animation: glitch-skew 0.4s ease;
}
@keyframes glitch-skew {
    0%, 100% { transform: none; text-shadow: none; }
    20% { transform: skewX(-2deg); text-shadow: 2px 0 var(--cyan-glow), -2px 0 var(--purple-glow); }
    40% { transform: skewX(2deg); text-shadow: -2px 0 var(--cyan-glow), 2px 0 var(--purple-glow); }
    60% { transform: skewX(-1deg); }
}

/* Hero 装饰 */
.hero-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent, transparent 100px, rgba(139,92,246,0.03) 100px, rgba(139,92,246,0.03) 101px);
    animation: hero-lines-scroll 20s linear infinite;
    pointer-events: none;
}
@keyframes hero-lines-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(101px); }
}

.hero-ring {
    position: absolute;
    inset: 10%;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    animation: ring-rotate 15s linear infinite;
}
.hero-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--cyan-glow);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--cyan-glow);
}
@keyframes ring-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.neon-pill { animation: pill-glow 3s ease-in-out infinite; }
@keyframes pill-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(139,92,246,0.2); }
    50% { box-shadow: 0 0 20px rgba(139,92,246,0.4); }
}

.neon-stat {
    padding: 1rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.02);
}

.float-icon { animation: icon-float 3s ease-in-out infinite; }
@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.shimmer-badge {
    animation: shimmer 2s linear infinite;
    background-size: 200% 100%;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 错落进入动画 */
.stagger-children > * {
    opacity: 0;
    animation: fade-up 0.6s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }

.stagger-grid > * {
    opacity: 0;
    animation: fade-up 0.5s ease-out forwards;
}
.stagger-grid > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.25s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.35s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.45s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.55s; }

/* 按钮涟漪（仅裁切光效，保留足够内边距避免文字被切） */
.glow-btn, .glass-btn { position: relative; overflow: hidden; }
.glow-btn.w-full, .glass-btn.w-full { display: flex; }
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: ripple-anim 0.6s ease-out;
    pointer-events: none;
}
@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

/* 全屏加载 */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.page-loader.hidden { display: none; }
.loader-ring {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(139,92,246,0.2);
    border-top-color: var(--purple-glow);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }

/* VIP 卡片粒子 hover */
.vip-featured:hover {
    animation: vip-pulse 2s ease-in-out infinite;
}
@keyframes vip-pulse {
    0%, 100% { box-shadow: 0 0 40px rgba(251,191,36,0.15); }
    50% { box-shadow: 0 0 60px rgba(251,191,36,0.25), 0 0 30px rgba(139,92,246,0.2); }
}

/* 模板卡片描述截断（与后台 line-clamp-2 一致） */
.template-desc-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.5;
    max-height: 3em;
    word-break: break-word;
}

/* 地区限制页 */
.region-block-card {
    box-shadow: 0 0 60px rgba(239, 68, 68, 0.08), 0 0 40px rgba(139, 92, 246, 0.06);
    border-color: rgba(239, 68, 68, 0.15);
}

/* AI 助手工作室 */
#support-chat-root {
    height: calc(100dvh - 2rem);
    max-height: calc(100dvh - 2rem);
}
@media (min-width: 768px) {
    #support-chat-root {
        height: calc(100dvh - 4rem);
        max-height: calc(100dvh - 4rem);
    }
}
.chat-layout {
    flex: 1 1 auto;
    min-height: 0;
}
.chat-workspace {
    flex: 1 1 auto;
    min-height: 0;
    border-color: rgba(255, 255, 255, 0.035) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 12px 40px rgba(0, 0, 0, 0.22);
    background:
        radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.06), transparent 45%),
        radial-gradient(ellipse at bottom left, rgba(6, 182, 212, 0.04), transparent 40%),
        rgba(255, 255, 255, 0.025);
}
.chat-workspace:hover {
    border-color: rgba(255, 255, 255, 0.045) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 12px 40px rgba(0, 0, 0, 0.22);
    transform: none;
}
.chat-sidebar {
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.035);
}
.chat-sidebar-head {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.035);
}
.chat-sidebar-foot {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.chat-composer-zone {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.chat-topbar {
    min-height: 1.75rem;
}
.chat-empty {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem 0.75rem 2rem;
    text-align: center;
}
.chat-empty-hero {
    max-width: 34rem;
}
.chat-empty-title {
    font-family: inherit;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    color: #f3f4f6;
    margin-bottom: 0.4rem;
}
.chat-empty-sub {
    font-size: 0.875rem;
    color: #9ca3af;
    line-height: 1.55;
    margin-bottom: 0.85rem;
}
.chat-empty-welcome {
    font-size: 0.875rem;
    color: #d1d5db;
    line-height: 1.65;
    text-align: left;
    white-space: pre-wrap;
}
.chat-empty-quick {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    width: 100%;
    max-width: 34rem;
}
@media (min-width: 640px) {
    .chat-empty-quick {
        grid-template-columns: 1fr 1fr;
    }
}
.chat-empty-card {
    text-align: left;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #e5e7eb;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.chat-empty-card:hover {
    border-color: rgba(6, 182, 212, 0.35);
    background: rgba(6, 182, 212, 0.08);
}
.chat-scroll {
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.chat-scroll::-webkit-scrollbar {
    width: 6px;
}
.chat-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}
.chat-composer {
    align-items: flex-start;
}
.chat-composer:focus-within {
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 0 0 1px rgba(6, 182, 212, 0.12);
}
.chat-composer-input {
    field-sizing: content;
}
.chat-mode-inline {
    display: none;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.2rem 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    user-select: none;
    white-space: nowrap;
}
.chat-mode-inline.is-on {
    display: inline-flex;
}
.chat-mode-inline-x {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    line-height: 1;
    color: rgba(165, 243, 252, 0.85);
}
.chat-mode-inline-x:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.chat-tool-icon {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    opacity: 0.9;
}
.chat-tool-btn.is-active {
    color: #e2e8f0;
    border-color: rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 0.14);
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.12);
}
.chat-badge-vip {
    border-color: rgba(6, 182, 212, 0.4) !important;
    color: #67e8f9 !important;
    background: rgba(6, 182, 212, 0.08);
}
.chat-badge-locked {
    border-color: rgba(251, 191, 36, 0.35) !important;
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.06);
}
.chat-studio-shell {
    background: transparent;
}
.chat-bubble-tip {
    border-color: rgba(6, 182, 212, 0.22) !important;
    background: rgba(6, 182, 212, 0.06) !important;
}
.chat-session-group {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 0.65rem 0.5rem 0.25rem;
}
.chat-session-item {
    position: relative;
    border: 1px solid transparent;
}
.chat-session-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.chat-session-item.is-active {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.22);
}
.chat-session-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 2px;
    border-radius: 999px;
    background: #22d3ee;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.45);
}
.chat-session-del {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.chat-session-item:hover .chat-session-del,
.chat-session-item:focus-within .chat-session-del {
    opacity: 1;
}
@media (max-width: 767px) {
    .chat-session-del {
        opacity: 0.7;
    }
}
.chat-thinking {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.25rem;
    color: #9ca3af;
    font-size: 0.75rem;
}
.chat-thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}
.chat-thinking-dots i {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: #67e8f9;
    opacity: 0.35;
    animation: chat-dot-pulse 1.05s ease-in-out infinite;
}
.chat-thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.chat-thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot-pulse {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}
.chat-tool-btn.is-locked,
#btn-upload.is-locked {
    opacity: 0.9;
}
@media (max-width: 767px) {
    .chat-sidebar {
        position: absolute;
        z-index: 30;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(18rem, 86vw);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
    }
    .chat-sidebar.is-open {
        transform: translateX(0);
    }
    .chat-sidebar-backdrop {
        position: absolute;
        inset: 0;
        z-index: 20;
        background: rgba(0, 0, 0, 0.55);
    }
}

/* ========== AI 全站悬浮球 ========== */
.ai-fab {
    --ai-fab-size: 3.5rem;
    position: fixed;
    z-index: 45;
    right: 1.25rem;
    top: auto;
    bottom: 5.5rem;
    width: var(--ai-fab-size);
    height: var(--ai-fab-size);
    touch-action: none;
    user-select: none;
}
@media (min-width: 1024px) {
    .ai-fab {
        bottom: 2rem;
        right: 1.75rem;
    }
}
.ai-fab.is-create-page {
    bottom: 6.5rem;
}
@media (min-width: 1024px) {
    .ai-fab.is-create-page {
        bottom: 5.5rem;
    }
}
.ai-fab.is-dragging {
    transition: none;
}
.ai-fab.is-dragging .ai-fab-orb {
    cursor: grabbing;
}

.ai-fab-orb-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.ai-fab-orb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    text-decoration: none;
    color: #fff;
    cursor: grab;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.ai-fab-orb:focus-visible {
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.8);
}

.ai-fab-core {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(139, 92, 246, 0.95), rgba(6, 182, 212, 0.85) 55%, rgba(99, 102, 241, 0.9));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.18) inset,
        0 0 22px rgba(139, 92, 246, 0.45),
        0 0 40px rgba(6, 182, 212, 0.2);
    overflow: hidden;
    animation: ai-fab-breathe 3.2s ease-in-out infinite;
}
.ai-fab-core::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 45%);
    pointer-events: none;
}

.ai-fab-glyph {
    position: relative;
    z-index: 2;
    font-family: Orbitron, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.ai-fab-ring {
    position: absolute;
    inset: -6px;
    z-index: 1;
    border-radius: 999px;
    border: 1.5px dashed rgba(167, 139, 250, 0.55);
    border-top-color: rgba(6, 182, 212, 0.85);
    border-right-color: transparent;
    animation: ai-fab-spin 10s linear infinite;
    pointer-events: none;
}
.ai-fab-ring::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 999px;
    background: var(--cyan-glow);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.ai-fab-spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
    opacity: 0.75;
    animation: ai-fab-orbit 5.5s linear infinite;
}
.ai-fab-spark--1 { offset-path: path('M28,28 m-18,0 a18,18 0 1,1 36,0 a18,18 0 1,1 -36,0'); }
.ai-fab-spark--2 { animation-duration: 7s; animation-delay: -2s; width: 3px; height: 3px; background: #a5f3fc; offset-path: path('M28,28 m-14,0 a14,14 0 1,1 28,0 a14,14 0 1,1 -28,0'); }
.ai-fab-spark--3 { animation-duration: 4.2s; animation-delay: -1s; width: 3px; height: 3px; background: #ddd6fe; offset-path: path('M28,28 m-10,0 a10,10 0 1,1 20,0 a10,10 0 1,1 -20,0'); }

/* fallback orbit without offset-path support */
@supports not (offset-path: path('M0,0')) {
    .ai-fab-spark--1 { top: 18%; left: 62%; animation: ai-fab-float-a 3s ease-in-out infinite; }
    .ai-fab-spark--2 { top: 62%; left: 22%; animation: ai-fab-float-b 3.6s ease-in-out infinite; }
    .ai-fab-spark--3 { top: 40%; left: 70%; animation: ai-fab-float-a 2.8s ease-in-out infinite reverse; }
}

.ai-fab-hover-label {
    position: absolute;
    right: calc(100% + 0.65rem);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    white-space: nowrap;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-family: Orbitron, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: #e9d5ff;
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.ai-fab[data-side="left"] .ai-fab-hover-label {
    right: auto;
    left: calc(100% + 0.65rem);
    transform: translateY(-50%) translateX(-6px);
}
.ai-fab-orb:hover .ai-fab-hover-label,
.ai-fab-orb:focus-visible .ai-fab-hover-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.ai-fab-orb:hover .ai-fab-core,
.ai-fab-orb:focus-visible .ai-fab-core {
    transform: scale(1.08);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.25) inset,
        0 0 28px rgba(139, 92, 246, 0.65),
        0 0 52px rgba(6, 182, 212, 0.35);
}
.ai-fab-orb:hover .ai-fab-ring,
.ai-fab-orb:focus-visible .ai-fab-ring {
    animation-duration: 4s;
    border-color: rgba(6, 182, 212, 0.7);
}

.ai-fab-collapse {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    z-index: 5;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(15, 15, 25, 0.85);
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.ai-fab-collapse:hover,
.ai-fab-collapse:focus-visible {
    opacity: 1;
    background: rgba(139, 92, 246, 0.55);
    outline: none;
}
.ai-fab[data-side="left"] .ai-fab-collapse {
    right: auto;
    left: -0.2rem;
}

/* 靠边缩小条 */
.ai-fab-tab {
    position: absolute;
    top: 0;
    width: 0.85rem;
    height: 3rem;
    padding: 0;
    border: 1px solid rgba(139, 92, 246, 0.45);
    background:
        linear-gradient(180deg, rgba(139, 92, 246, 0.55), rgba(6, 182, 212, 0.4));
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
    cursor: pointer;
    overflow: hidden;
    display: none;
    align-items: center;
    justify-content: center;
    animation: ai-fab-breathe 2.8s ease-in-out infinite;
}
.ai-fab.is-collapsed .ai-fab-tab {
    display: flex;
}
.ai-fab.is-collapsed .ai-fab-orb-wrap {
    display: none;
}
.ai-fab.is-collapsed {
    width: 0.85rem;
    height: 3rem;
}
.ai-fab[data-side="right"] .ai-fab-tab {
    right: 0;
    border-radius: 0.65rem 0 0 0.65rem;
    border-right: none;
}
.ai-fab[data-side="left"] .ai-fab-tab {
    left: 0;
    border-radius: 0 0.65rem 0.65rem 0;
    border-left: none;
}
.ai-fab-tab-scan {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: ai-fab-scan 2.4s ease-in-out infinite;
    pointer-events: none;
}
.ai-fab-tab-chevron {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    position: relative;
    z-index: 1;
}
.ai-fab[data-side="right"] .ai-fab-tab-chevron {
    border-right: 5px solid rgba(255, 255, 255, 0.9);
}
.ai-fab[data-side="left"] .ai-fab-tab-chevron {
    border-left: 5px solid rgba(255, 255, 255, 0.9);
}
.ai-fab-tab:hover,
.ai-fab-tab:focus-visible {
    filter: brightness(1.15);
    outline: none;
}

@keyframes ai-fab-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes ai-fab-breathe {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset, 0 0 18px rgba(139,92,246,0.4), 0 0 32px rgba(6,182,212,0.15); }
    50% { box-shadow: 0 0 0 1px rgba(255,255,255,0.22) inset, 0 0 28px rgba(139,92,246,0.65), 0 0 48px rgba(6,182,212,0.3); }
}
@keyframes ai-fab-orbit {
    to { offset-distance: 100%; }
}
@keyframes ai-fab-float-a {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    50% { transform: translate(-4px, 5px); opacity: 1; }
}
@keyframes ai-fab-float-b {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(5px, -4px); opacity: 1; }
}
@keyframes ai-fab-scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-fab-ring,
    .ai-fab-core,
    .ai-fab-spark,
    .ai-fab-tab,
    .ai-fab-tab-scan {
        animation: none !important;
    }
    .ai-fab-orb:hover .ai-fab-core {
        transform: none;
    }
}

