/* ========================================
   TriScope - 豆包风格聊天页面样式
   ======================================== */

/* ── 整体布局 ── */
.chat-page {
    display: flex;
    min-height: calc(var(--vh, 1vh) * 100 - var(--tf-header-h));
    background: var(--db-bg);
    position: relative;
    isolation: isolate;
}

/* ── 左侧边栏 ── */
.chat-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--db-sidebar-bg);
    border-right: 1px solid var(--db-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding-top: 68px;
    transition: width 0.3s var(--tf-ease-out), transform 0.3s var(--tf-ease-out);
}

/* 左侧边栏品牌区 */
.sidebar-brand {
    display: none;
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 16px 16px 8px;
    border-bottom: 1px solid var(--db-border);
    margin-bottom: 4px;
}
.sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}
.credits-odometer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--db-border);
    border-radius: 10px;
}
.credits-odometer-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--db-text-muted);
    letter-spacing: 0.04em;
}
.credits-odometer-readout {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 3px 4px;
    background: #0a0a0d;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    --od-cell-h: 22px;
}
.od-cell {
    position: relative;
    width: 15px;
    height: var(--od-cell-h, 22px);
    overflow: hidden;
    background: linear-gradient(180deg, #22222a, #141419 60%, #1a1a21);
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.od-sep {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.8rem;
    font-weight: 700;
}
.od-strip {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.od-digit {
    height: var(--od-cell-h, 22px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
    color: #eceaf5;
    font-variant-numeric: tabular-nums;
}

/* 移动端积分里程表：默认隐藏，手机端显示在输入栏下方（与侧边栏同步） */
.credits-odometer-mobile {
    display: none;
}
.btn-new-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: var(--db-hover);
    border: 1px solid var(--db-border);
    border-radius: 12px;
    color: var(--db-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--tf-font-sans);
}
.btn-new-chat:hover { background: var(--db-hover-strong); border-color: rgba(255,255,255,0.1); }

/* 历史对话列表 */
.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.history-loading {
    text-align: center;
    padding: 24px;
    color: var(--db-text-muted);
    font-size: 0.82rem;
}

.chat-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--db-text-secondary);
    font-size: 0.84rem;
    margin-bottom: 2px;
}
.chat-history-item:hover { background: var(--db-hover); color: var(--db-text); }
.chat-history-item.active { background: var(--db-hover-strong); color: var(--db-text); }

.history-info { flex: 1; min-width: 0; overflow: hidden; }
.history-title {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--db-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-meta {
    font-size: 0.72rem;
    color: var(--db-text-muted);
    margin-top: 2px;
}
/* 提问历史：标题最多两行，省略过长内容 */
.history-title.history-question {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

.history-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.chat-history-item:hover .history-actions { opacity: 1; }
.history-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border: none;
    background: transparent;
    color: var(--db-text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.7rem;
    transition: all 0.15s ease;
}
.history-actions button:hover { background: rgba(255,255,255,0.06); color: var(--db-text); }

/* 从历史列表跳转时的高亮动画 */
@keyframes msg-highlight-pulse {
    0% { box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.55); background: rgba(139, 92, 246, 0.10); }
    100% { box-shadow: 0 0 0 2px transparent; background: transparent; }
}
.message.msg-highlight {
    border-radius: 14px;
    animation: msg-highlight-pulse 2.5s ease-out forwards;
}

.history-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--db-text-muted);
    font-size: 0.82rem;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--db-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.user-info-mini { display: flex; align-items: center; gap: 8px; flex: 1; }
.user-avatar-sm { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.user-meta { font-size: 0.82rem; color: var(--db-text-secondary); font-weight: 500; }
.btn-sidebar-collapse {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--db-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}
.btn-sidebar-collapse:hover { background: var(--db-hover); color: var(--db-text); }
.btn-logout-sidebar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--db-text-muted);
    font-size: 0.82rem;
    transition: all 0.15s ease;
    text-decoration: none;
}
.btn-logout-sidebar:hover { background: var(--db-hover); color: var(--db-text); }

/* ── 主聊天区 ── */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    min-width: 0;
    background: var(--db-bg);
}

/* ── 顶部栏 ── */
.chat-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--db-bg);
    border-bottom: 1px solid var(--db-border);
    z-index: 5;
    min-height: 52px;
}

.btn-toggle-sidebar {
    display: none;
    width: 34px; height: 34px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--db-text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s ease;
}
.btn-toggle-sidebar:hover { background: var(--db-hover); color: var(--db-text); }

.chat-mode-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.mode-current-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--db-text);
}
.mode-select {
    padding: 6px 12px;
    background: var(--db-hover);
    border: 1px solid var(--db-border);
    border-radius: 10px;
    color: var(--db-text-secondary);
    font-size: 0.82rem;
    font-family: var(--tf-font-sans);
    cursor: pointer;
    outline: none;
}
.mode-select:focus { border-color: rgba(91, 108, 240, 0.4); }

.chat-actions { display: flex; gap: 4px; }
.btn-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--db-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}
.btn-icon:hover { background: var(--db-hover); color: var(--db-text); }

/* ── 消息区 ── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* 消息容器居中 */
.message {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 768px;
    animation: msg-in 0.35s ease both;
}
@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 机器人消息 ── */
.message.bot-message {
    align-self: center;
    flex-direction: row;
}
.bot-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
    background: var(--db-hover);
}
.bot-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.message-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--db-text);
    padding-left: 2px;
}

.bot-message .message-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--db-text);
    background: transparent;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── 用户消息 ── */
.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.user-message .message-body {
    align-items: flex-end;
}
.user-message .message-bubble {
    padding: 10px 18px;
    border-radius: 18px 18px 4px 18px;
    font-size: 0.9rem;
    line-height: 1.7;
    background: linear-gradient(135deg, #4f6ef6 0%, #7c4dff 100%);
    color: #fff;
    max-width: 85%;
}

/* ── 消息元数据 ── */
.message-time {
    font-size: 0.7rem;
    color: var(--db-text-muted);
    padding: 0 4px;
}
.user-message .message-time { text-align: right; }

.message-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.bot-message:hover .message-actions { opacity: 1; }
.btn-msg-action {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--db-text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.btn-msg-action:hover { background: var(--db-hover); color: var(--db-text); }

/* ── 翻译标签 ── */
.translation-tabs {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.translation-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--db-text-muted);
    background: var(--db-hover);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}
.translation-tab:hover { color: var(--db-text); border-color: var(--db-border); }
.translation-tab.active { color: var(--db-accent); background: rgba(91,108,240,0.12); border-color: rgba(91,108,240,0.3); }
.translation-tab.loading { opacity: 0.6; cursor: wait; animation: tab-pulse 1.5s ease-in-out infinite; }
.translation-tab.ready { color: var(--tf-success); border-color: rgba(16,185,129,0.3); }
.translation-tab.error { color: var(--tf-error); text-decoration: line-through; }
@keyframes tab-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }

/* ── 推理区块 ── */
.reasoning-block {
    background: var(--db-hover);
    border: 1px solid var(--db-border);
    border-radius: 12px;
    margin-top: 6px;
    overflow: hidden;
}
.reasoning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--db-text-secondary);
    font-weight: 500;
}
.reasoning-header:hover { background: rgba(255,255,255,0.02); }
.reasoning-title { display: flex; align-items: center; gap: 6px; color: var(--db-accent); }
.reasoning-body { display: none; padding: 0 14px 12px; }
.reasoning-block.open .reasoning-body { display: block; }
.reasoning-block.open .reasoning-toggle i { transform: rotate(180deg); }
.reasoning-toggle { color: var(--db-text-muted); font-size: 0.7rem; transition: transform 0.2s ease; }
.reasoning-timeline {
    position: relative;
    border-left: 2px solid var(--db-border);
    padding-left: 14px;
    margin-left: 6px;
    font-size: 0.8rem;
    color: var(--db-text-secondary);
    line-height: 1.6;
}

/* ── Loading ── */
.loading-text {
    font-size: 0.8rem;
    color: var(--db-text-muted);
    margin-top: 6px;
}
.loading-dots {
    display: flex; gap: 5px;
    align-items: center; justify-content: flex-start;
    padding: 6px 0;
}
.loading-dots span {
    width: 6px; height: 6px;
    background: var(--db-accent);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── 电子邮件提示 ── */
.email-prompt-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--db-hover);
    border: 1px solid var(--db-border);
    border-radius: 12px;
}
.email-prompt-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--db-text-secondary);
}
.email-prompt-text i { color: var(--db-accent); }
.email-prompt-actions { display: flex; gap: 8px; }
.email-prompt-input {
    flex: 1;
    padding: 7px 12px;
    background: var(--db-bg-input);
    border: 1px solid var(--db-border);
    border-radius: 8px;
    color: var(--db-text);
    font-size: 0.8rem;
    font-family: var(--tf-font-sans);
}
.email-prompt-input:focus { outline: none; border-color: var(--db-accent); }
.btn-email-send {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    background: var(--db-accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--tf-font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-email-send:hover { opacity: 0.9; }

/* ═══════════════════════════════════════
   底部输入区 — 豆包风格
   ═══════════════════════════════════════ */
.chat-input-area {
    padding: 12px 16px 14px;
    background: var(--db-bg);
    border-top: 1px solid var(--db-border);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-input-container {
    width: 100%;
    max-width: 768px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── 输入框外包装 ── */
.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--db-bg-input);
    border: 1.5px solid var(--db-border);
    border-radius: 28px;
    padding: 8px 12px 8px 18px;
    transition: border-color 0.25s ease;
}
.input-wrapper:focus-within {
    border-color: rgba(91, 108, 240, 0.4);
}

/* 文本输入 */
.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--db-text);
    font-size: 0.9rem;
    font-family: var(--tf-font-sans);
    resize: none;
    min-height: 24px;
    max-height: 140px;
    line-height: 1.5;
    padding: 4px 0;
    outline: none;
}
.chat-input::placeholder {
    color: var(--db-text-muted);
    opacity: 0.6;
}

/* 右侧按钮组 — 横向排列 */
.input-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* 发送按钮 */
.btn-input-send {
    width: auto; height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    background: var(--tf-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--tf-font-sans);
    transition: all 0.2s ease;
}
.btn-input-send:hover {
    background: var(--tf-primary-dark);
    box-shadow: 0 0 16px var(--tf-primary-glow);
}
.btn-input-send:active { transform: scale(0.95); }
.btn-input-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 字數計數器 */
.char-counter {
    display: none; /* 豆包风格隐藏字符计数器 */
}

/* ── 快捷提示 ── */
.quick-prompts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.quick-prompt {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 18px;
    color: #a78bfa;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--tf-font-sans);
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
}
.quick-prompt i { font-size: 0.72rem; opacity: 0.6; transition: all 0.2s ease; }
.quick-prompt:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}
.quick-prompt:hover i { opacity: 1; }

/* ── 引导点击轮播钩子（滚屏问句） ── */
.prompt-rotator {
    display: flex;
    width: 100%;
    margin-top: 2px;
}
.prompt-rotator-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 18px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 14px;
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--tf-font-sans);
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    user-select: none;
    white-space: nowrap;
}
.prompt-rotator-item:hover {
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}
.prompt-rotator-item i {
    color: #a78bfa;
    font-size: 0.85rem;
    flex-shrink: 0;
    opacity: 0.9;
}
.prompt-rotator-text {
    display: inline-block;
    max-width: calc(100% - 34px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    will-change: transform, opacity;
}

/* ── 免责声明 ── */
.input-disclaimer {
    text-align: center;
    margin-top: 2px;
    font-size: 0.68rem;
    color: var(--db-text-muted);
    opacity: 0.5;
}

/* ═══════════════════════════════════════
   响应式 — 移动端
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        left: -100%;
        top: var(--tf-header-h);
        bottom: 0;
        width: 280px;
        z-index: 200;
        transition: left 0.3s var(--tf-ease-out);
    }
    .chat-sidebar.open { left: 0; }
    .btn-toggle-sidebar { display: flex; }
    .btn-sidebar-collapse { display: none; }

    .chat-topbar { padding: 8px 12px; gap: 8px; min-height: 44px; }
    .mode-select { display: none; }
    .chat-messages { padding: 16px 12px; gap: 18px; }
    .message { max-width: 100%; }

    .chat-input-area { padding: 10px 10px 12px; }
    .input-wrapper { padding: 6px 10px; border-radius: 24px; }
    .input-tools-left { display: none; }
    /* 快捷提示按钮：手机端放到输入栏上方，横向滑动 */
    .chat-input-container { flex-direction: column-reverse; }
    .quick-prompts {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .quick-prompts::-webkit-scrollbar { display: none; }
    .quick-prompt { flex-shrink: 0; padding: 6px 12px; font-size: 0.75rem; }

    /* 移动端积分里程表：输入栏下方，紧凑版 */
    .credits-odometer-mobile {
        display: inline-flex;
        align-self: center;
        margin-top: 8px;
        padding: 3px 9px;
        gap: 6px;
        background: rgba(0, 0, 0, 0.22);
        border-color: rgba(255, 255, 255, 0.08);
        --od-cell-h: 18px;
    }
    .credits-odometer-mobile .credits-odometer-label {
        font-size: 0.62rem;
    }
    .credits-odometer-mobile .credits-odometer-readout {
        padding: 2px 3px;
    }
    .credits-odometer-mobile .od-cell {
        width: 12px;
        border-radius: 2px;
    }
    .credits-odometer-mobile .od-digit {
        font-size: 0.7rem;
    }
}

/* ── 订阅按钮（跳转收费目录 #pricing） ── */
.btn-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a2e;
    background: linear-gradient(135deg, #f6d365, #fda085);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 2px 8px rgba(253, 160, 133, .35);
}
.btn-subscribe:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(253, 160, 133, .5);
    color: #1a1a2e;
}
@media (max-width: 560px) {
    .btn-subscribe span { display: none; }
    .btn-subscribe { padding: 6px 10px; }
}

@media (max-width: 480px) {
    .chat-messages { padding: 12px 8px; gap: 14px; }
    .message { max-width: 100%; }
    .chat-input-area { padding: 8px 6px 10px; }
    .input-wrapper { padding: 5px 8px; border-radius: 22px; }
    .btn-input-attach { display: none; }
}

/* ==========================================================
   TriScope 1.0 — 简化漏斗（免费排盘卡片 / Upsell / 完整报告）
   ========================================================== */
.chat-mode-selector .mode-select { display: none; }

.trio-report-area {
    max-width: 720px;
    margin: 0 auto 28px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.trio-pay-charts {
    margin-bottom: 18px;
}

.trio-daily-greeting {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    color: #c4b5fd;
    margin: 2px 0 -4px;
}

.trio-chart-card,
.trio-upsell-card {
    background: linear-gradient(180deg, #14141d, #0d0d15);
    border: 1px solid rgba(139, 92, 246, .22);
    border-radius: 16px;
    padding: 22px 22px 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}

.trio-card-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: #e4e4e7;
    letter-spacing: .3px;
}

.trio-birth-info {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: rgba(139, 92, 246, .08);
    border: 1px solid rgba(139, 92, 246, .18);
    border-radius: 10px;
    font-size: .82rem;
    line-height: 1.5;
}

.trio-birth-title {
    font-weight: 600;
    color: #c4b5fd;
    margin-bottom: 6px;
}

.trio-birth-rows {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 14px;
    color: #d4d4d8;
}

.trio-birth-label {
    color: #8b8b9a;
}

.trio-birth-hint {
    margin: 8px 0 0;
    font-size: .72rem;
    color: #8b8b9a;
}

.trio-birth-edit {
    color: #a78bfa;
    text-decoration: underline;
}

.trio-intro-text {
    white-space: pre-line;
    font-size: .92rem;
    line-height: 1.7;
    color: #d4d4d8;
    margin: 0;
}

.trio-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.trio-pillar {
    background: rgba(139, 92, 246, .08);
    border: 1px solid rgba(139, 92, 246, .16);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}

.trio-pillar-label {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b8b9a;
    margin-bottom: 4px;
}

.trio-pillar-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #c4b5fd;
}

.trio-chart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: .85rem;
    color: #a1a1aa;
    margin-bottom: 12px;
}

.trio-chart-meta strong { color: #e4e4e7; }

.trio-wuxing {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.trio-wx-row {
    display: grid;
    grid-template-columns: 64px 1fr 28px;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    color: #a1a1aa;
}

.trio-wx-bar {
    height: 8px;
    background: rgba(255, 255, 255, .06);
    border-radius: 4px;
    overflow: hidden;
}

.trio-wx-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #c084fc);
    border-radius: 4px;
}

.trio-wx-count { text-align: right; }

.trio-time-note {
    margin: 10px 0 0;
    font-size: .75rem;
    color: #71717a;
}

.trio-daily-slot {
    margin-top: 14px;
}

.trio-daily-chat-card {
    margin-top: 14px;
}

.trio-daily-chat-greeting {
    margin: 0 0 8px;
    font-size: .95rem;
    color: #c4b5fd;
}

.trio-daily-chat-note {
    margin: 0 0 8px;
    font-size: .75rem;
    color: #71717a;
}

.trio-daily-chat-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trio-daily-chat-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    font-size: .88rem;
    color: #d4d4d8;
    line-height: 1.5;
}

.trio-daily-chat-label {
    color: #c4b5fd;
    font-weight: 600;
}

.trio-daily-chat-label em {
    font-style: normal;
    font-size: .66rem;
    font-weight: 500;
    color: #8b8b9a;
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .22);
    border-radius: 12px;
    padding: 1px 8px;
    margin-left: 6px;
}

.trio-daily-chat-loading {
    font-size: .85rem;
    color: #8b8b9a;
}

.trio-upsell-card {
    position: relative;
    border-color: rgba(139, 92, 246, .45);
    background:
        radial-gradient(600px 180px at 50% -40px, rgba(139, 92, 246, .18), transparent 70%),
        linear-gradient(180deg, #15151f, #0d0d15);
}

.trio-upsell-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 4px 12px;
    border-radius: 20px;
}

.trio-upsell-sub {
    margin: 0 0 12px;
    font-size: .88rem;
    color: #a1a1aa;
}

.trio-upsell-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 14px;
}

.trio-upsell-list li {
    font-size: .85rem;
    color: #d4d4d8;
}

.trio-upsell-list i {
    color: #c4b5fd;
    width: 18px;
    margin-right: 6px;
}

.trio-upsell-note {
    margin: 12px 0 0;
    text-align: center;
    font-size: .75rem;
    color: #71717a;
}

.trio-report {
    background: linear-gradient(180deg, #14141d, #0d0d15);
    border: 1px solid rgba(139, 92, 246, .22);
    border-radius: 16px;
    padding: 24px;
}

.trio-report-loading {
    text-align: center;
    color: #a1a1aa;
    padding: 30px 0;
}

.trio-pay-spinner {
    display: inline-block;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(139, 92, 246, .25);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: trio-spin .8s linear infinite;
}

@keyframes trio-spin {
    to { transform: rotate(360deg); }
}

.trio-report-title {
    margin: 0 0 14px;
    font-size: 1.25rem;
    color: #c4b5fd;
}

.trio-report-content {
    color: #d4d4d8;
    line-height: 1.75;
    font-size: .92rem;
}

.trio-report-content h2,
.trio-report-content h3,
.trio-report-content h4 {
    color: #e4e4e7;
    margin: 18px 0 8px;
}

.trio-report-content ul {
    padding-left: 20px;
    margin: 8px 0;
}

/* ── 分析内容 Markdown 排版（聊天气泡 + 完整解读报告通用） ── */
.bot-message .message-bubble > *:first-child,
.trio-report-content > *:first-child { margin-top: 0; }
.bot-message .message-bubble > *:last-child,
.trio-report-content > *:last-child { margin-bottom: 0; }

.bot-message .message-bubble h1,
.bot-message .message-bubble h2,
.bot-message .message-bubble h3,
.bot-message .message-bubble h4,
.bot-message .message-bubble h5,
.bot-message .message-bubble h6,
.trio-report-content h1,
.trio-report-content h2,
.trio-report-content h3,
.trio-report-content h4,
.trio-report-content h5,
.trio-report-content h6 {
    color: #fcd34d;
    font-weight: 700;
    line-height: 1.45;
    margin: 20px 0 8px;
}
.bot-message .message-bubble h1,
.trio-report-content h1 { font-size: 1.28rem; }
.bot-message .message-bubble h2,
.trio-report-content h2 { font-size: 1.15rem; }
.bot-message .message-bubble h3,
.trio-report-content h3 { font-size: 1.04rem; }
.bot-message .message-bubble h4,
.trio-report-content h4 { font-size: 0.97rem; }
.bot-message .message-bubble h5,
.trio-report-content h5 { font-size: 0.93rem; }
.bot-message .message-bubble h6,
.trio-report-content h6 { font-size: 0.9rem; }

.bot-message .message-bubble p,
.trio-report-content p { margin: 0 0 10px; }

.bot-message .message-bubble ul,
.bot-message .message-bubble ol,
.trio-report-content ul,
.trio-report-content ol {
    margin: 6px 0 12px;
    padding-left: 22px;
}
.bot-message .message-bubble li,
.trio-report-content li { margin: 4px 0; }
.bot-message .message-bubble li::marker,
.trio-report-content li::marker { color: #fbbf24; }

.bot-message .message-bubble strong,
.trio-report-content strong { color: #fcd34d; font-weight: 700; }
.bot-message .message-bubble em,
.trio-report-content em { font-style: italic; }

.bot-message .message-bubble blockquote,
.trio-report-content blockquote {
    margin: 12px 0;
    padding: 8px 14px;
    border-left: 3px solid #8b5cf6;
    border-radius: 0 10px 10px 0;
    background: rgba(139, 92, 246, 0.08);
    color: #d4d4d8;
}
.bot-message .message-bubble blockquote p,
.trio-report-content blockquote p { margin: 0; }

.bot-message .message-bubble code,
.trio-report-content code {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.85em;
    background: rgba(255, 255, 255, 0.09);
    padding: 2px 6px;
    border-radius: 5px;
    color: #e879f9;
}
.bot-message .message-bubble pre,
.trio-report-content pre {
    background: #0d0d15;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 12px 0;
}
.bot-message .message-bubble pre code,
.trio-report-content pre code {
    background: none;
    padding: 0;
    color: #e4e4e7;
}

.bot-message .message-bubble table,
.trio-report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.88rem;
}
.bot-message .message-bubble th,
.bot-message .message-bubble td,
.trio-report-content th,
.trio-report-content td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
}
.bot-message .message-bubble th,
.trio-report-content th {
    background: rgba(139, 92, 246, 0.14);
    color: #f1f1f5;
    font-weight: 600;
    white-space: nowrap;
}
.bot-message .message-bubble tr:nth-child(even) td,
.trio-report-content tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }

.bot-message .message-bubble a,
.trio-report-content a {
    color: #a78bfa;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

.bot-message .message-bubble hr,
.trio-report-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.bot-message .message-bubble img,
.trio-report-content img { max-width: 100%; border-radius: 8px; }

.trio-report-error {
    color: #f87171;
}

@media (max-width: 560px) {
    .trio-pillars { grid-template-columns: repeat(2, 1fr); }
    .trio-upsell-list { grid-template-columns: 1fr; }
    .trio-report { padding: 16px; }
    .trio-report-area { padding: 0 12px; gap: 14px; }
    .trio-chart-card, .trio-upsell-card { padding: 16px 14px; }
    .trio-card-title { font-size: 1rem; }
    .trio-pillar-value { font-size: 1.2rem; }
    .trio-daily-greeting { font-size: 1rem; }
    .trio-chart-meta { font-size: .8rem; }
}

/* ── 手机端分析内容排版优化 ── */
@media (max-width: 768px) {
    .bot-message .message-bubble {
        font-size: 0.88rem;
        line-height: 1.75;
    }
    .trio-report-title { font-size: 1.1rem; }
    .trio-report-content {
        font-size: 0.88rem;
        line-height: 1.7;
    }
    .trio-report-content h1 { font-size: 1.16rem; }
    .trio-report-content h2 { font-size: 1.06rem; }
    .trio-report-content h3 { font-size: 0.98rem; }
    .trio-report-content h4 { font-size: 0.93rem; }
    .trio-report-content p { margin-bottom: 8px; }
    .trio-report-content blockquote { padding: 7px 12px; }
    /* 表格：手机端允许横向滑动，避免撑破版面 */
    .bot-message .message-bubble table,
    .trio-report-content table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    /* 命盘图：手机端允许横向滑动 */
    .trio-pay-charts,
    .trio-chart-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .trio-pay-charts img,
    .trio-pay-charts svg,
    .trio-chart-card img,
    .trio-chart-card svg {
        max-width: none;
    }
}

/* ── 手机端分析内容排版优化 ── */
@media (max-width: 768px) {
    .bot-message .message-bubble {
        font-size: 0.88rem;
        line-height: 1.75;
    }
    .trio-report-title { font-size: 1.1rem; }
    .trio-report-content {
        font-size: 0.88rem;
        line-height: 1.7;
    }
    .trio-report-content h1 { font-size: 1.16rem; }
    .trio-report-content h2 { font-size: 1.06rem; }
    .trio-report-content h3 { font-size: 0.98rem; }
    .trio-report-content h4 { font-size: 0.93rem; }
    .trio-report-content p { margin-bottom: 8px; }
    .trio-report-content blockquote { padding: 7px 12px; }
    /* 表格：手机端允许横向滑动，避免撑破版面 */
    .bot-message .message-bubble table,
    .trio-report-content table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    /* 命盘图：手机端允许横向滑动 */
    .trio-pay-charts,
    .trio-chart-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .trio-pay-charts img,
    .trio-pay-charts svg,
    .trio-chart-card img,
    .trio-chart-card svg {
        max-width: none;
    }
}
