/* === AI 主题色变量 === */
:root {
    --ai-green-from: #11998e;
    --ai-green-to: #38ef7d;
}

/* === AI 星形 Logo === */
.ai-star-logo { position: relative; display: inline-flex; align-items: center; justify-content: center; }

.ai-star-glow {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(16,185,129,0.4) 25%, transparent 50%, rgba(56,239,125,0.3) 75%, transparent 100%);
    opacity: 0;
}

.ai-star-logo.animate { animation: ai-spin-cw 20s linear infinite; }
.ai-star-logo.animate .ai-star-glow { opacity: 1; animation: ai-spin-ccw 8s linear infinite; }

@keyframes ai-spin-cw { to { transform: rotate(360deg); } }
@keyframes ai-spin-ccw { to { transform: rotate(-360deg); } }


/* === 浮动光球 === */
.floating-orbs-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* 路径A：偏左上→右下的椭圆轨迹 */
@keyframes orb-float-A {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(25px, -20px) scale(1.12); }
    50%  { transform: translate(-15px, 18px) scale(0.92); }
    75%  { transform: translate(10px, -8px) scale(1.06); }
    100% { transform: translate(0, 0) scale(1); }
}

/* 路径B：偏右下→左上的椭圆轨迹 */
@keyframes orb-float-B {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(-20px, 15px) scale(0.9); }
    50%  { transform: translate(30px, -25px) scale(1.15); }
    75%  { transform: translate(-12px, 10px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}


/* === 预设问题卡片 === */
.ai-preset-section {
    width: 100%;
    position: relative;
    padding-bottom: 32px;
}

.ai-preset-card {
    background: linear-gradient(to bottom, rgba(17,153,142,0.08), transparent);
    border: 1px solid #1e2633;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    height: 180px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ai-preset-card:hover {
    background: linear-gradient(to bottom, rgba(17,153,142,0.12), rgba(17,153,142,0.02));
    border-color: rgba(17,153,142,0.3);
}

.ai-preset-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-preset-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(17,153,142,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ai-preset-card-icon i {
    font-size: 16px;
    background: linear-gradient(135deg, var(--ai-green-from), var(--ai-green-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-preset-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.ai-preset-card-subtitle {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.3;
}

.ai-preset-card-desc {
    font-size: 0.82rem;
    color: #999;
    line-height: 1.5;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Swiper 分页指示器 */
.ai-preset-pagination {
    text-align: center;
    margin-top: 16px;
}
.ai-preset-pagination .swiper-pagination-bullet {
    background: rgba(255,255,255,0.2);
    opacity: 1;
    width: 8px;
    height: 8px;
}
.ai-preset-pagination .swiper-pagination-bullet-active {
    background: var(--ai-green-from);
    width: 20px;
    border-radius: 4px;
}


/* === 免责声明 === */
.ai-disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 12px;
    color: #666;
    animation: ai-fade-in 0.6s ease 1.2s both;
}

.ai-disclaimer-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(17,153,142,0.5);
    animation: ai-pulse 2s ease-in-out infinite;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes ai-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* === 欢迎页入场动画 === */
@keyframes ai-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-welcome-logo {
    margin-bottom: 24px;
    animation: ai-slide-up 0.5s ease both;
}

.ai-welcome-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--ai-green-from), var(--ai-green-to), var(--ai-green-from));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: ai-slide-up 0.5s ease 0.2s both;
}

.ai-welcome-subtitle {
    font-size: 14px;
    color: #888;
    text-align: center;
    margin-bottom: 32px;
    max-width: 480px;
    animation: ai-slide-up 0.5s ease 0.35s both;
}

.ai-welcome-cards {
    width: 100%;
    animation: ai-slide-up 0.5s ease 0.5s both;
}

@media (min-width: 768px) {
    .ai-welcome-title { font-size: 30px; }
    .ai-welcome-subtitle { font-size: 16px; }
}


/* === 输入框 === */
.ai-input-gradient-border {
    border-radius: 16px;
    border: 2px solid transparent;
    background:
        linear-gradient(var(--phoenix-emphasis-bg, #1a1a2e), var(--phoenix-emphasis-bg, #1a1a2e)) padding-box,
        linear-gradient(135deg, var(--ai-green-from), var(--ai-green-to)) border-box;
}

.ai-input-inner {
    padding: 12px 16px 8px;
}

.ai-input-field .mud-input-slot {
    color: var(--phoenix-body-color, #ccc);
    font-size: 0.95rem;
}

.ai-input-field .mud-input::before,
.ai-input-field .mud-input::after {
    border-bottom: none !important;
}

.ai-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    margin-top: 8px;
}

/* === 发送/停止按钮 === */
.ai-send-btn {
    border-radius: 50% !important;
    background: linear-gradient(135deg, #11998e, #38ef7d) !important;
    color: #fff !important;
    width: 36px;
    height: 36px;
    min-width: 36px !important;
}

.ai-send-btn:disabled {
    opacity: 0.4;
}

.ai-stop-btn {
    background: linear-gradient(135deg, #e74c3c, #e67e22) !important;
}

/* === 加号按钮 + 附件菜单 === */
.ai-plus-btn {
    background-color: var(--phoenix-secondary-bg);
    padding: 8px 9px;
    border-radius: 50%;
    font-size: 18px;
    transition: transform 0.15s ease, border-color 0.2s, color 0.2s;
}

.ai-plus-btn:hover,
.ai-plus-btn:active,
.ai-plus-btn.active {
    transform: scale(1.15);
}

.ai-attach-wrap {
    position: relative;
}

.ai-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

@keyframes menu-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-attach-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    animation: menu-pop 0.18s ease;
    border-radius: 12px;
    background-color: var(--phoenix-secondary-bg);
    z-index: 999;
    cursor: pointer;
}

.ai-attach-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 160px;
    padding: 9px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}

.ai-attach-menu-item:hover {
    background: rgba(17,153,142,0.15);
    color: #fff;
}

.ai-attach-menu-item i {
    font-size: 15px;
    color: var(--ai-green-from);
    width: 16px;
    text-align: center;
}

/* Uploader 透明覆盖层 */
.ai-uploader-overlay {
    position: absolute !important;
    inset: 0 !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

.ai-upload-hint {
    font-size: 0.78rem;
    color: var(--ai-green-from);
    opacity: 0.85;
    display: flex;
    align-items: center;
}


/* === 消息列表 === */
.user-bubble {
    background: linear-gradient(135deg, #11998e, #28c76f);
    border-radius: 1rem;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.ai-chat-img {
    max-width: 100px;
    min-width: 50px;
    aspect-ratio: 4/3;
}

.ai-bubble {
    background-color: var(--phoenix-emphasis-bg);
    border-radius: 1rem;
    border-top-left-radius: 4px;
    border: 1px solid #252545;
}

.ai-avatar-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.ai-msg-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

@media (max-width: 999px) {
    .ai-msg-row {
        flex-direction: column;
        gap: 4px;
    }
}

.ai-cursor {
    display: inline;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}
