/* 深度思考按钮样式 */
.deep-think-toggle-btn {
    margin-left: 8px;
    background: var(--surface-color);
    border: 1.5px solid var(--border-color);
    color: var(--primary-blue);
    border-radius: 8px;
    padding: 4px 12px 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, border 0.2s, color 0.2s;
}
.deep-think-toggle-btn.selected {
    background: var(--primary-blue);
    color: #fff;
    border: 1.5px solid var(--primary-blue);
}
.deep-think-toggle-btn .material-symbols-outlined {
    font-size: 1.2em;
}

.deep-think-label {
    font-size: 0.98em;
    font-weight: 500;
}
/* Expert AI Studio - Final CSS */

:root {
    /* Apple Design tokens (appleDesign.md) */
    --bg-color: #f5f5f7;        /* canvas-parchment */
    --surface-color: #ffffff;   /* canvas */
    --surface-hover: #f0f0f0;   /* divider-soft */
    --primary-blue: #0066cc;    /* Action Blue */
    --primary-blue-focus: #0071e3;
    --text-main: #1d1d1f;       /* ink */
    --text-sub: #6e6e73;        /* ink-muted */
    --border-color: #e0e0e0;    /* hairline */
    --input-bg: #ffffff;
    --danger-color: #ff3b30;
    --accent-color: #1a7f37;

    /* Diff Colors */
    --diff-add-bg: rgba(52, 199, 89, 0.12);
    --diff-add-text: #1a7f37;
    --diff-del-bg: rgba(255, 59, 48, 0.12);
    --diff-del-text: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaaaaa; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Microsoft YaHei', '微软雅黑', sans-serif;
    background-color: var(--bg-color); color: var(--text-main);
    height: 100vh; display: flex; overflow: hidden;
    font-size: 17px; line-height: 1.47; letter-spacing: 0;
}

#menu-toggle {
    position: absolute; top: 15px; left: 15px; z-index: 200;
    background: transparent; border: none; color: var(--text-sub);
    cursor: pointer; padding: 8px; border-radius: 50%;
    transition: background 0.2s; display: flex; align-items: center; justify-content: center;
}
#menu-toggle:hover { background-color: var(--surface-hover); color: var(--text-main); }

#rightbar-toggle {
    border: none;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

#rightbar-toggle:hover {
    background-color: var(--surface-hover);
    color: var(--text-main);
}
#rightbar-toggle:active {
    transform: scale(0.94);
}

.topbar {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 210;
    display: flex;
    justify-content: flex-end;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.icon-btn:hover {
    background: var(--surface-hover);
    color: var(--primary-blue);
}

.topbar-auth {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
}

.sidebar-left {
    flex: 0 3 auto;
    flex-basis: clamp(180px, 20vw, 300px);
    min-width: 0;
    max-width: clamp(180px, 20vw, 300px);
    background-color: var(--bg-color);
    display: flex; 
    flex-direction: column; 
    padding: clamp(8px, 1vw, 10px);
    border-right: 1px solid transparent; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s step-end; 
    padding-top: clamp(50px, 6vw, 60px);
    gap: clamp(8px, 1vw, 10px);
    position: relative;
    z-index: 100; /* 一级界面：高于主界面（10），低于项目抽屉（150） */
}
.sidebar-left.hidden {
    transform: translateX(-100%); /* 向左移动，被主界面盖住 */
    z-index: 1; /* 降低z-index，让主界面（z-index: 10）能盖住它 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s step-start, max-width 0.25s ease, flex-basis 0.25s ease, padding 0.12s ease, opacity 0.12s ease;
    /* 收起时不再占用布局空间，使 .main-area 自动扩展 */
    flex: 0 0 0 !important;
    max-width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.project-drawer {
    position: fixed;
    top: 0; 
    left: clamp(180px, 20vw, 300px); /* 动态跟随左侧边栏宽度 */
    height: 100vh; 
    width: 300px;
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    box-shadow: 6px 0 20px rgba(0,0,0,0.1);
    z-index: 50; /* 二级界面：始终低于左侧边栏（100），被左侧边栏盖住 */
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-100%); /* 向左移动，被左侧边栏盖住 */
    opacity: 1; /* 保持不透明，只是被盖住 */
    visibility: hidden;
    pointer-events: none;
}
.project-drawer.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 50; /* 二级界面（显示时）：仍然低于左侧边栏（100），被左侧边栏盖住 */
}
.project-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; gap: 8px;
}
.project-drawer-title { font-size: 16px; font-weight: 600; color: var(--primary-blue); }
.drawer-close-btn {
    background: transparent; border: 1px solid var(--border-color);
    color: var(--text-sub); border-radius: 10px; padding: 6px;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.drawer-close-btn:hover { border-color: var(--primary-blue); color: var(--text-main); }
.project-drawer-body {
    flex: 1; overflow: hidden;
}
.project-drawer .history-list {
    height: 100%; overflow-y: auto;
}

.new-chat-btn {
    background: transparent;
    color: var(--text-sub);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    font-weight: 600;
    transition: color 0.2s ease, letter-spacing 0.2s ease, transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.02em;
}
.new-chat-btn .material-symbols-outlined {
    flex-shrink: 0;
}
.new-chat-btn span:not(.material-symbols-outlined) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease, max-width 0.3s ease;
    position: relative;
}
.new-chat-btn:hover {
    color: var(--primary-blue);
    background: rgba(0, 102, 204, 0.06);
    border-color: rgba(0, 102, 204, 0.18);
    letter-spacing: 0.04em;
}
.new-chat-btn:active { transform: scale(0.97); }

.enterprise-sidebar-entry {
    border-color: rgba(0, 102, 204, 0.2);
    background: rgba(0, 102, 204, 0.065);
    color: var(--primary-blue);
    text-decoration: none;
}

.enterprise-sidebar-entry:hover {
    border-color: rgba(0, 102, 204, 0.32);
    background: rgba(0, 102, 204, 0.11);
}
.billing-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10000;
    background: #202124;
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s, transform .18s;
}
.billing-toast.show { opacity: 1; transform: translateY(0); }
.admin-balance-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: #fff4e5;
    color: #8a4b00;
    border-bottom: 1px solid #ffd8a8;
    padding: 10px 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}
.admin-balance-banner-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #8a4b00;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}
@media (max-width: 768px) {
    .new-chat-btn {
        padding: clamp(6px, 1vw, 10px) clamp(8px, 1.2vw, 12px);
        font-size: clamp(10px, 1.2vw, 13px);
        gap: clamp(6px, 0.8vw, 8px);
    }
    .new-chat-btn span:not(.material-symbols-outlined) {
        opacity: 0;
        max-width: 0;
        transform: translateX(-10px);
        overflow: hidden;
        padding: 0;
        margin: 0;
    }
}
@media (max-width: 480px) {
    .new-chat-btn {
        padding: clamp(5px, 0.8vw, 8px) clamp(6px, 1vw, 10px);
        font-size: clamp(9px, 1vw, 11px);
        gap: clamp(4px, 0.6vw, 6px);
    }
}

/* 增大功能区与历史区的间距 */
#public-chat-btn { margin-bottom: 20px; }

.mini-panels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.mini-panel {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex: 1;
    transition: box-shadow 0.2s;
    overflow: hidden;
}
.mini-panel:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
@media (max-width: 768px) {
    .mini-panel {
        padding: clamp(6px, 1vw, 10px);
        gap: clamp(4px, 0.6vw, 8px);
    }
}
@media (max-width: 480px) {
    .mini-panel {
        padding: clamp(4px, 0.8vw, 8px);
        gap: clamp(3px, 0.5vw, 6px);
    }
}
.mini-panel-title {
    display: flex; 
    align-items: center; 
    gap: 8px;
    font-size: 14px; 
    font-weight: 600; 
    padding: 2px 0;
    color: var(--text-sub);
    overflow: hidden;
    letter-spacing: 0.02em;
    transition: color 0.25s ease, text-shadow 0.25s ease, letter-spacing 0.25s ease;
}
.mini-panel-title .material-symbols-outlined {
    flex-shrink: 0;
    transition: filter 0.25s ease;
}
.mini-panel:hover .mini-panel-title {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(0, 102, 204, 0.35);
    letter-spacing: 0.03em;
}
.mini-panel:hover .mini-panel-title .material-symbols-outlined {
    filter: drop-shadow(0 0 4px rgba(0, 102, 204, 0.45));
}
.mini-panel-title span:not(.material-symbols-outlined) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease, max-width 0.3s ease;
    position: relative;
}
.mini-public-title-text {
    flex: 0 0 auto;
}
.mini-public-profession {
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 400;
    margin-left: 2px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
@media (max-width: 768px) {
    .mini-panel-title {
        font-size: clamp(10px, 1.2vw, 12px);
        padding: 2px clamp(4px, 0.6vw, 6px);
        gap: clamp(4px, 0.6vw, 6px);
    }
    .mini-panel-title span:not(.material-symbols-outlined) {
        opacity: 0;
        max-width: 0;
        transform: translateX(-10px);
        overflow: hidden;
        padding: 0;
        margin: 0;
    }
    .mini-public-profession {
        font-size: clamp(9px, 1vw, 10px);
        opacity: 0.5;
        transform: translateX(-5px);
    }
    /* 在窄窗口时隐藏公共聊天栏面板，仿照热搜榜 */
    #mini-public-chat-panel {
        display: none;
    }
}
@media (max-width: 480px) {
    .mini-panel-title {
        font-size: clamp(9px, 1vw, 11px);
        padding: 2px clamp(3px, 0.5vw, 5px);
    }
    .mini-public-profession {
        opacity: 0;
        transform: translateX(-10px);
    }
}
.mini-public-messages {
    flex: 1 1 auto;
    /* 允许在 flex 容器中收缩但保持可滚动；不设置 max-height，让消息区撑满面板剩余空间，
       这样输入框会贴着面板底部，而不是留出一大块空白 */
    min-height: 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;  /* 平滑滚动效果 */
}
.mini-public-msg {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    overflow: hidden;
    /* 防止在垂直方向上被父容器压扁 */
    flex: 0 0 auto;
}
@media (max-width: 768px) {
    .mini-public-msg {
        padding: clamp(5px, 0.8vw, 8px) clamp(6px, 1vw, 10px);
        font-size: clamp(10px, 1.2vw, 12px);
        gap: clamp(4px, 0.6vw, 6px);
    }
}
@media (max-width: 480px) {
    .mini-public-msg {
        padding: clamp(4px, 0.6vw, 6px) clamp(5px, 0.8vw, 8px);
        font-size: clamp(9px, 1vw, 11px);
    }
}
.mini-public-msg.hover {
    background: #ececec;
}
.mini-public-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--text-sub);
    margin-bottom: 4px;
    font-size: 11px;
}
.mini-profession {
    padding: 2px 6px;
    background: rgba(0, 102, 204, 0.12);
    color: var(--primary-blue);
    border-radius: 6px;
}
.mini-public-body {
    color: var(--text-main);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-public-actions { display: flex; gap: 6px; }
.mini-public-actions.inline { display: inline-flex; gap: 6px; align-items: center; }
.mini-thumb {
    background: #f0f0f0;
    color: var(--text-sub);
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    padding: 3px 6px;
    font-size: 11px;
    display: inline-flex;
    gap: 4px;
    align-items: center;
    cursor: pointer;
}
.mini-thumb.active { border-color: var(--primary-blue); color: var(--text-main); }
.mini-thumb .material-symbols-outlined { font-size: 16px; }
.mini-public-input {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 8px;
    transition: border-color 0.2s, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 6px;
    overflow: hidden;
}
.mini-public-input:focus-within {
    border-color: var(--primary-blue);
}
.mini-public-input textarea {
    flex: 1;
    background: transparent;
    color: var(--text-main);
    border: none;
    outline: none;
    padding: 2px 4px;
    font-size: 12px;
    resize: none;
    min-height: 28px;
    max-height: 28px;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    line-height: 1.4;
    font-family: inherit;
}
.mini-btn {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
}
.mini-btn:hover {
    background: #0071e3;
    transform: translateY(-1px);
}
.mini-btn:active {
    transform: translateY(0);
}
@media (max-width: 768px) {
    .mini-public-input {
        opacity: 0.8;
        padding: clamp(4px, 0.6vw, 6px) clamp(5px, 0.8vw, 8px);
        gap: clamp(3px, 0.5vw, 5px);
    }
    .mini-public-input textarea {
        font-size: clamp(10px, 1.2vw, 12px);
        padding: clamp(2px, 0.3vw, 4px);
        min-height: clamp(24px, 3vw, 28px);
        max-height: clamp(24px, 3vw, 28px);
    }
    .mini-btn {
        padding: clamp(4px, 0.6vw, 6px) clamp(8px, 1vw, 12px);
        font-size: clamp(10px, 1.2vw, 12px);
    }
}
@media (max-width: 600px) {
    .mini-public-input {
        opacity: 0.5;
        padding: clamp(3px, 0.5vw, 5px) clamp(4px, 0.6vw, 6px);
        gap: clamp(2px, 0.4vw, 4px);
    }
    .mini-public-input textarea {
        font-size: clamp(9px, 1vw, 11px);
        opacity: 0.7;
    }
    .mini-btn {
        padding: clamp(3px, 0.5vw, 5px) clamp(6px, 0.8vw, 10px);
        font-size: clamp(9px, 1vw, 11px);
        opacity: 0.8;
    }
}
@media (max-width: 480px) {
    .mini-public-input {
        opacity: 0;
        max-height: 0;
        padding: 0;
        margin: 0;
        border: none;
        overflow: hidden;
    }
    .mini-public-input textarea {
        opacity: 0;
        max-width: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
    .mini-btn {
        opacity: 0;
        max-width: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}
.mini-public-empty { color: var(--text-sub); font-size: 12px; text-align: center; padding: 8px 0; }

.mini-trending-placeholder {
    background: #fafafa;
    border: 1px dashed #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
}

/* mini 语义热搜榜样式优化 */
#mini-trending-panel {
    position: relative;
    background: radial-gradient(120% 160% at 0% 0%, rgba(0, 102, 204, 0.15), transparent);
    border-radius: 14px;
    padding: 10px 10px 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
@media (max-width: 768px) {
    #mini-trending-panel {
        display: none;
    }
}

#mini-trending-panel .mini-panel-title {
    padding: 2px 4px 4px 4px;
    justify-content: flex-start;
    gap: 6px;
}

.mini-trending-title-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.mini-trending-sub {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-sub);
    opacity: 0.9;
}

.mini-trending-container {
    margin-top: 4px;
    border-radius: 10px;
    background: #f7f7f7;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 4px 3px;
    max-height: 230px;
    overflow: hidden;
}

.mini-trending-list {
    max-height: 222px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 2px;
    padding-bottom: 15px; /* 防止最后一条被底部裁剪 */
}

.mini-trending-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 12px;
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.mini-trending-item:hover {
    background: rgba(0, 102, 204, 0.05);
    border-color: rgba(0, 102, 204, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mini-trending-rank {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #111;
    background: rgba(195, 238, 208, 0.92);
}

.mini-trending-item:nth-child(1) .mini-trending-rank {
    background: linear-gradient(135deg, #ffcc70, #ff8177);
    color: #111;
}

.mini-trending-item:nth-child(2) .mini-trending-rank {
    background: linear-gradient(135deg, #0066cc, #4f7cff);
    color: #0b1020;
}

.mini-trending-item:nth-child(3) .mini-trending-rank {
    background: linear-gradient(135deg, #f6d5ff, #e26bf5);
    color: #160b24;
}

.mini-trending-text {
    flex: 1;
    color: var(--text-main);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.mini-trending-empty {
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
    padding: 10px 4px;
}

.history-list { flex: 1; overflow-y: auto; }
.history-item {
    position: relative; padding: 10px 15px; margin: 2px 0; border-radius: 20px;
    cursor: pointer; font-size: 14px; color: var(--text-sub);
    display: flex; justify-content: space-between; align-items: center;
}
.history-item:hover { background-color: var(--surface-hover); color: var(--text-main); }
.history-text-col { overflow: hidden; text-overflow: ellipsis; flex: 1; white-space: nowrap; margin-right: 5px; }
.history-more-btn {
    opacity: 0; background: transparent; border: none; color: var(--text-sub);
    cursor: pointer; padding: 4px; border-radius: 50%;
    transition: all 0.2s; display: flex; align-items: center;
}
.history-item:hover .history-more-btn { opacity: 1; }
.history-more-btn:hover { background-color: #ececec; color: var(--text-main); }

.action-menu {
    position: absolute;
    right: 10px;
    top: 35px; /* 根据 dots 按钮位置调整 */
    background: #f0f0f0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.14);
    display: none;
    flex-direction: column;
    min-width: 100px;
}

.stream-pre, .language-text {
  white-space: pre-wrap;
  margin: 0;
  overflow-x: auto;
  border-radius: 8px;
  font-family: 'Misans Light', 'Microsoft YaHei', monospace;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.62);
  line-height: 17px !important;
}

/* 统一“思考/推理”文字样式 */
.model-content .thinking {
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #6e6e73;   /* 略淡灰 */
    margin-bottom: 10px;
}


.stream-reasoning summary {
  cursor: pointer ;
  opacity: 0.85;
  margin-bottom: 6px;
}

/* 思考过程折叠块样式（最终渲染 & 历史回放） */
.thinking-block {
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
.thinking-block summary {
  cursor: pointer;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  background: var(--surface-hover);
  user-select: none;
}
.thinking-block summary:hover {
  color: var(--text-main);
}
.thinking-pre {
  margin: 0;
  padding: 12px 14px;
  font-family: 'Microsoft YaHei', 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-sub);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  background: transparent;
}

.action-menu.show { display: flex; }
.action-menu button {
    background: transparent; border: none; color: #1d1d1f; padding: 8px 12px;
    text-align: left; cursor: pointer; font-size: 13px; border-radius: 4px; font-family: inherit;
}
.action-menu button:hover { background: #ececec; }
.action-menu button.delete-btn { color: var(--danger-color); }

.sidebar-right {
    flex: 0 3 auto;
    flex-basis: clamp(200px, 20vw, 300px);
    min-width: 0;
    max-width: clamp(200px, 20vw, 300px);
    background-color: var(--bg-color); 
    padding: clamp(12px, 1.5vw, 20px);
    border-left: 1px solid var(--border-color);
    display: flex; 
    flex-direction: column; 
    gap: clamp(10px, 1.5vw, 20px);
    overflow: hidden;
    transition: flex-basis 0.25s ease, max-width 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
    position: relative;
    z-index: 1;
}
.sidebar-right.collapsed {
    flex: 0 0 0px;
    max-width: 0;
    min-width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}
.hidden-panel { display: none !important; }

/* 登录和注册的样式 */
.auth-section {
    display: flex; gap: 6px; margin-bottom: 8px; width: fit-content; margin-left: auto;
}
.auth-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 5px 10px; border-radius: 14px; border: none;
    cursor: pointer; font-size: 11px; font-weight: 500; font-family: inherit;
    transition: all 0.3s; white-space: nowrap; text-decoration: none;
}
.auth-btn.topbar-auth {
    min-width: 68px; height: 42px; padding: 0 18px;
    border-radius: 12px; font-size: 14px; font-weight: 600;
}
.auth-btn-login {
    background-color: var(--primary-blue); color: #fff;
}
.auth-btn-login:hover {
    background-color: #0071e3; transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}
.auth-btn-register {
    background-color: transparent; color: var(--text-main); border: 1px solid var(--border-color);
}
.auth-btn-register:hover {
    background-color: var(--surface-hover); border-color: var(--primary-blue);
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

/* 登录/注册页面通用样式 */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background-color: var(--bg-color);
    padding: 40px 16px; color: var(--text-main);
}

.auth-card {
    width: 100%; max-width: 520px;
    background: var(--surface-color); border-radius: 18px;
    border: 1px solid var(--border-color);
    padding: 28px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.auth-card .card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px;
}

.auth-card h1 {
    font-size: 22px; font-weight: 600; margin: 0;
    display: flex; align-items: center; gap: 8px; color: var(--primary-blue);
}

.auth-card p.subtext {
    margin: 4px 0 16px; color: var(--text-sub); font-size: 14px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { color: var(--text-sub); font-size: 14px; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"] {
    background: var(--bg-color); color: var(--text-main);
    border: 1px solid var(--border-color); border-radius: 10px;
    padding: 10px 12px; font-size: 14px; font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
}

.form-group input[type="file"] { padding: 9px 12px; }

.form-hint { color: var(--text-sub); font-size: 12px; }

.auth-actions { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }

.form-error {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 59, 48, 0.12);
    color: #c0392b;
    border: 1px solid rgba(255, 59, 48, 0.35);
    font-size: 14px;
}

/* 注册页内联错误提示样式 */
.form-error.inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 10px;
}

.auth-section .auth-user {
    color: var(--text-main);
    margin-right: 10px;
    font-weight: 600;
    text-decoration: none;
}

.user-menu-panel {
    position: fixed;
    top: 56px;
    right: 12px;
    width: 260px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    z-index: 220;
}

.user-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.user-menu-title { font-weight: 600; color: var(--text-main); }

.user-menu-body { display: flex; flex-direction: column; gap: 10px; }

.user-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-menu-label { color: var(--text-sub); font-size: 13px; }
.user-menu-value { color: var(--text-main); font-weight: 600; }

.menu-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}
.menu-link:hover { text-decoration: underline; }

.user-menu-form .ghost-btn.full-width { width: 100%; }

/* Admin tables */
.table-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
}
.table-scroll {
    max-height: 420px;
    overflow: auto;
    border-radius: 8px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: var(--text-main);
    font-size: 13px;
}
.admin-table thead {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
}
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ececec;
    word-wrap: break-word;
    word-break: break-word;
}
.admin-table th {
    color: var(--text-sub);
    font-weight: 600;
    text-align: left;
}
.admin-table tr:hover td {
    background: #f0f0f0;
}
.admin-table td .one-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Markdown answer tables: visible grid, readable spacing and safe narrow-screen scrolling. */
[data-md-source] {
    min-width: 0;
}
[data-md-source]:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
[data-md-source] table {
    width: 100%;
    min-width: 520px;
    margin: 16px 0;
    border: 1px solid #cfd6df;
    border-collapse: collapse;
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.55;
}
[data-md-source] th,
[data-md-source] td {
    padding: 10px 12px;
    border: 1px solid #cfd6df;
    text-align: left;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: anywhere;
}
[data-md-source] th {
    background: #f4f7fb;
    color: #344054;
    font-weight: 600;
}
[data-md-source] tbody tr:nth-child(even) td {
    background: #fafbfd;
}
[data-md-source] tbody tr:hover td {
    background: #f3f7fc;
}
.admin-table pre {
    background: #f7f7f7;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 8px;
    max-height: 220px;
    overflow: auto;
    font-family: 'Microsoft YaHei', monospace;
    font-size: 12px;
    color: var(--text-main);
}
.admin-table .ghost-btn {
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
}
.admin-table .badge {
    background: rgba(0, 102, 204, 0.15);
    border: 1px solid rgba(0, 102, 204, 0.35);
    color: var(--primary-blue);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.primary-btn {
    background: var(--primary-blue); color: #fff;
    border: none; border-radius: 9999px; padding: 12px;
    font-weight: 400; font-size: 15px; cursor: pointer;
    transition: opacity 0.15s ease, transform 0.12s ease;
}
.primary-btn:hover { opacity: 0.92; }
.primary-btn:active { transform: scale(0.97); }

.ghost-btn {
    background: transparent; color: var(--primary-blue);
    border: 1px solid var(--primary-blue); border-radius: 9999px;
    padding: 11px; font-weight: 400; cursor: pointer; font-size: 14px;
    transition: background 0.15s ease, transform 0.12s ease;
}
.ghost-btn:hover { background: rgba(0, 102, 204, 0.06); }
.ghost-btn:active { transform: scale(0.97); }

.text-link { color: var(--primary-blue); text-decoration: none; font-weight: 500; }
.text-link:hover { text-decoration: underline; }

.form-footer { text-align: center; color: var(--text-sub); font-size: 13px; }
/* 登录和注册的样式 */
.panel-section {
    background-color: var(--surface-color);
    padding: 15px;
    border-radius: 16px;
    margin-top: 30px;
    margin-right: 15px;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1.2fr 0.6fr 1fr auto;
    gap: 10px;
    align-items: center;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
}

.admin-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.admin-filter-row .filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-filter-row .filter-label {
    color: var(--text-sub);
    font-size: 13px;
    min-width: 42px;
    text-align: right;
}

.admin-filter-row input {
    width: 120px;
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
}

.admin-filter-row input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.admin-form-row input {
    width: 100%;
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
}

.admin-form-row input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

#hot-board {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#hot-board .trending-list {
    flex: 1;
}

.panel-title {
    font-size: 18px; 
    font-weight: 600; 
    margin-bottom: 15px;
    padding: 0;
    color: var(--primary-blue); 
    display: flex; 
    align-items: center; 
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel-title .material-symbols-outlined { font-size: 20px; margin-right: 2px; flex-shrink: 0; }
.llm-pick-count { font-size: 12px; color: var(--text-sub); margin: -8px 0 10px 2px; }
.panel-title span:not(.material-symbols-outlined) {
    transition: opacity 0.3s ease, transform 0.3s ease, max-width 0.3s ease;
    position: relative;
}
@media (max-width: 768px) {
    .panel-title {
        font-size: clamp(10px, 1.2vw, 14px);
    }
    .panel-title span:not(.material-symbols-outlined) {
        opacity: 0;
        max-width: 0;
        transform: translateX(-10px);
        overflow: hidden;
        padding: 0;
        margin: 0;
    }
}
@media (max-width: 480px) {
    .panel-title {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
        overflow: hidden;
        transition: opacity 0.3s ease, max-height 0.3s ease, margin-bottom 0.3s ease, padding 0.3s ease;
    }
}

/* ── 大模型选择行（llm-pick） ───────────────────────────────── */
.llm-pick {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; padding: 9px 12px;
    border: 1px solid var(--border-color); border-radius: 14px;
    background: #ffffff; cursor: pointer; user-select: none;
    transition: background 0.25s ease, border-color 0.2s ease, transform 0.12s ease;
}
.llm-pick:last-child { margin-bottom: 0; }
.llm-pick:hover { border-color: var(--primary-blue); }
.llm-pick:active { transform: scale(0.98); }

.llm-pick-logo {
    width: 26px; height: 26px; flex-shrink: 0;
    object-fit: contain; transition: filter 0.25s ease;
}
.llm-pick-label {
    flex: 1; min-width: 0; font-size: clamp(11px, 1.2vw, 14px); font-weight: 600;
    color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color 0.25s ease;
}
.llm-pick-arrow {
    flex-shrink: 0; font-size: 18px; color: var(--text-sub); border-radius: 6px;
    padding: 2px; transition: color 0.2s ease, background 0.15s ease, transform 0.2s ease;
}
.llm-pick-arrow:hover { background: rgba(0,0,0,0.06); }
.llm-pick.dropdown-open .llm-pick-arrow { transform: rotate(180deg); }

/* 选中态：渐变底色 + logo / 文字变白 */
.llm-pick.selected { border-color: transparent; }
.llm-pick.selected .llm-pick-label { color: #fff; }
.llm-pick.selected .llm-pick-arrow { color: rgba(255,255,255,0.85); }
.llm-pick.selected .llm-pick-arrow:hover { background: rgba(255,255,255,0.18); }
.llm-pick.selected .llm-pick-logo { filter: brightness(0) invert(1); }

.llm-pick.deepseek.selected { background: linear-gradient(135deg, #0b2a6b, #1c5fd9); }
.llm-pick.kimi.selected { background: linear-gradient(135deg, #34104f, #7a23b5); }
.llm-pick.qwen.selected { background: linear-gradient(135deg, #2b3aa0, #7b3fd1); }
.llm-pick.zai.selected { background: linear-gradient(135deg, #0a0a0c, #241b3d 55%, #18305c); }
.llm-pick.minimax.selected { background: linear-gradient(135deg, #ff5b1f, #ff2d6b); }
/* zai.svg / kimi.svg 原图是纯白色图形（为深色背景设计），未选中时在白底上需要反色才能看见 */
.llm-pick.zai .llm-pick-logo, .llm-pick.kimi .llm-pick-logo { filter: invert(1); }
.llm-pick.zai.selected .llm-pick-logo, .llm-pick.kimi.selected .llm-pick-logo { filter: brightness(0) invert(1); }
/* zai.svg / kimi.svg 原始素材边缘留白少，按 26px 渲染显得明显偏大，适当缩小 */
.llm-pick.zai .llm-pick-logo, .llm-pick.kimi .llm-pick-logo { width: 20px; height: 20px; }
/* qwen.svg 是多色图标，强制变白会糊成一片，选中后保持原色 */
.llm-pick.qwen.selected .llm-pick-logo { filter: none; }

/* 型号自定义下拉面板：挂载在 body 下，避免被 .sidebar-right 的 overflow:hidden 裁切 */
.llm-pick-dropdown {
    position: fixed; min-width: 190px;
    background: #ffffff; border: 1px solid var(--border-color); border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.16); z-index: 9999;
    padding: 6px; display: none;
}
.llm-pick-dropdown.open { display: block; }
.llm-pick-dropdown-option {
    padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text-main);
    cursor: pointer; white-space: nowrap; transition: background 0.1s;
}
.llm-pick-dropdown-option:hover { background: rgba(0,102,204,0.08); }
.llm-pick-dropdown-option.active { color: var(--primary-blue); font-weight: 600; background: rgba(0,102,204,0.1); }

@media (max-width: 768px) {
    .llm-pick { gap: clamp(6px, 0.8vw, 8px); padding: clamp(6px, 1vw, 9px) clamp(8px, 1.2vw, 12px); }
    .llm-pick-label {
        font-size: clamp(9px, 1vw, 11px);
        opacity: 0; max-width: 0; transform: translateX(-10px);
        overflow: hidden; padding: 0; margin: 0; pointer-events: none;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .llm-pick-arrow {
        opacity: 0; max-width: 0; transform: translateX(-10px);
        overflow: hidden; padding: 0; pointer-events: none;
        transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}
@media (max-width: 480px) {
    .llm-pick { margin-bottom: clamp(4px, 0.8vw, 8px); }
}
.expert-box-container { flex: 1; display: flex; flex-direction: column; min-height: 300px; }
.expert-textarea {
    width: 100%; flex: 1; min-height: 200px; background-color: var(--bg-color);
    border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-main);
    padding: 10px; font-family: 'Microsoft YaHei', monospace; resize: vertical;
}
.submit-btn {
    width: 100%; margin-top: 10px; padding: 10px; background: var(--text-main);
    color: var(--bg-color); border: none; border-radius: 20px; cursor: pointer;
    font-weight: bold; font-family: inherit;
}

/* 只读输入框样式 */
input:disabled {
    opacity: 0.5; cursor: not-allowed;
    background-color: #f0f0f0 !important; border-color: transparent !important;
}

.main-area { 
    flex: 1 0 0%;
    display: flex; 
    flex-direction: column; 
    position: relative; 
    max-width: 100%; 
    min-width: 250px; 
    z-index: 10;
    overflow: hidden;
}
.chat-container {
    flex: 1; 
    padding: clamp(12px, 1.5vw, 20px) clamp(16px, 2.5vw, 40px); 
    overflow-y: auto;
    padding-bottom: clamp(80px, 8vw, 120px); 
    padding-top: clamp(40px, 4vw, 60px); 
    width: 100%;
    box-sizing: border-box;
}
.chat-container.history-view-mode { width: 85%; margin: 0 auto; max-width: none; }

.welcome-msg-box { text-align: center; opacity: 0.7; }

/* 没有对话内容时：欢迎语 + 主输入框作为一组整体在页面中垂直居中，
   而不是贴着底部；一旦开始对话（#welcome-msg 被移除）自动恢复贴底布局 */
.main-area.chat-empty { justify-content: center; }
.main-area.chat-empty .chat-container {
    flex: 0 1 auto;
    overflow: visible;
    padding-top: 0;
    padding-bottom: 0;
}
.main-area.chat-empty .input-area-wrapper {
    position: relative;
    bottom: auto; left: auto; right: auto;
    margin-top: clamp(20px, 3vw, 32px);
    background-color: transparent;
}

/* [User Requirement 3] 优化专家结论展示样式 */
.expert-content-view {
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 15px; /* 字号适中 */
    line-height: 1.8; /* 行间距加大 */
    color: #1d1d1f;
    white-space: pre-wrap; /* 保留换行 */
    letter-spacing: 0.5px; /* 字间距微增 */
}

.message-user {
    background-color: var(--surface-color); padding: 20px 25px; border-radius: 16px;
    margin-bottom: 30px; max-width: 80%; margin-left: auto;
    border: 1px solid rgba(0, 102, 204, 0.2); /* 增加微弱边框增加质感 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.message-user:hover {
    background-color: rgba(0, 102, 204, 0.06);
    border-color: rgba(0, 102, 204, 0.4);
}
.message-user::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(0, 102, 204, 0.6);
    transition: transform 0.3s ease;
}
.message-user.collapsed::after {
    transform: translateY(-50%) rotate(-90deg);
}

.models-row { 
    display: flex; 
    gap: 10px; 
    padding-bottom: 10px; 
    align-items: flex-start; 
    width: 90%; 
    margin: 0 auto; 
    margin-bottom: 30px; /* 每轮对话之间留出空隙 */
    border-top: 1px dashed #d8d8d8; /* 增加视觉分割线 */
    padding-top: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
}
.models-block.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}
.model-col {
    background-color: var(--surface-color); border-radius: 16px; padding: 15px;
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); border: 1px solid transparent;
}
.model-col.expanded { flex-grow: 10; border-color: var(--primary-blue); z-index: 10; }
.model-col.compressed { flex-grow: 1; padding: 15px 5px; background-color: #fafafa; cursor: pointer; }
.model-col.compressed .model-name { font-size: 12px; justify-content: center; white-space: nowrap; overflow: hidden; }
.model-col.compressed .model-name small, 
.model-col.compressed .expand-btn, 
.model-col.compressed .model-content { display: none; }
.model-col.compressed .model-header { border-bottom: none; margin: 0; padding: 0; justify-content: center; }

/* 当有一列处于展开状态时，让展开列占满父容器，其他列通过可过渡的样式隐藏（避免直接使用 display） */
/* 使用 :has()，并提供 .single-expanded 作为不支持 :has 时的 JS 回退类。 */
.models-row:has(.model-col.expanded) .model-col {
    /* 隐藏非展开列，但保持可过渡的属性 */
    opacity: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: scale(0.98) !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
.models-row:has(.model-col.expanded) .model-col.expanded {
    /* 展开列占满空间并以动画显现 */
    display: flex !important;
    opacity: 1 !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: none !important;
    padding: 15px !important; /* 恢复默认内边距 */
    margin: 0 !important;
    transform: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
    z-index: 50 !important;
}

.model-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color);
}
.model-order-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; margin-right: 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0f9bff, #6dd5ed);
    color: #fff; font-weight: 700; font-size: 13px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.model-name {
    font-weight: bold; display: flex; align-items: center; gap: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: grab;
}
.model-logo { width: 20px; height: 20px; margin-right: 5px; vertical-align: middle; object-fit: contain; display: inline-block; }
.token-info { font-size: 11px; color: var(--text-sub); opacity: 0.55; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--border-color); text-align: right; font-family: monospace; }
.expand-btn { background: none; border: none; color: var(--text-sub); cursor: pointer; font-size: 18px; flex-shrink: 0; }
.model-content { 
    font-size: 14px; 
    line-height: 1.6; 
    white-space: pre-wrap; 
    word-break: break-word; 
    overflow-x: hidden; 

    /* 大小固定，防止模型回复过长 */
    max-height: 1000px;
    overflow-y: auto;
}

/* 模型分析区背景样式：灰色底，内边距与圆角 */
.model-analysis {
    background: var(--surface-hover);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-sub);
    margin-bottom: 8px;
    max-height: 360px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.model-analysis p { margin: 0 0 8px 0; }

.model-analysis::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.model-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.model-content pre { max-width: 100%; overflow-x: auto; border-radius: 8px; }

.loading-dots { display: flex; gap: 4px; padding: 10px 0; }
.loading-dot {
    width: 8px; height: 8px; background-color: var(--primary-blue);
    border-radius: 50%; animation: pulse 1.4s infinite ease-in-out both;
}
.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes pulse { 0%, 80%, 100% { transform: scale(0); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

.input-area-wrapper {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 0;
    background-color: var(--bg-color); 
    padding: clamp(12px, 1.5vw, 20px) clamp(16px, 2.5vw, 40px);
    display: flex; 
    justify-content: center; /* 默认居中 */
    z-index: 200;
}
.input-box {
    width: 100%; 
    max-width: min(900px, calc(100vw - clamp(180px, 20vw, 300px) - clamp(200px, 20vw, 300px) - clamp(32px, 5vw, 80px)));
    background-color: var(--surface-color);
    border-radius: clamp(15px, 2vw, 25px); 
    padding: clamp(6px, 0.8vw, 10px) clamp(12px, 1.5vw, 20px); 
    display: flex; 
    align-items: center; 
    gap: clamp(6px, 0.8vw, 10px);
    border: 1px solid transparent; 
    transition: border 0.3s;
    box-sizing: border-box;
    flex-shrink: 0;
}
.input-box:focus-within { background-color: var(--surface-hover); border-color: var(--border-color); }
/* style.css */

#user-prompt {
    flex: 1; 
    min-width: 0;
    background: transparent; 
    border: none; 
    color: var(--text-main);
    font-size: clamp(12px, 1.2vw, 16px); 
    outline: none; 
    
    /* 核心修改：允许垂直调整，禁止手动拖拽 */
    resize: none; 
    
    /* 核心修改：设置初始高度和最大高度 */
    height: clamp(20px, 1.5vw, 24px); 
    max-height: 200px; /* 超过这个高度出现滚动条 */
    
    overflow-y: auto; /* 超出显示滚动条 */
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.5; /* 增加行高，阅读更舒适 */
    padding: 0; /* 移除默认内边距，避免对齐问题 */
}
#send-btn { 
    background: transparent; 
    border: none; 
    color: var(--text-main); 
    cursor: pointer; 
    padding: clamp(4px, 0.6vw, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#send-btn .material-symbols-outlined {
    font-size: clamp(18px, 2.2vw, 24px);
}

#selection-popover {
    position: fixed; display: none; background: var(--accent-color);
    color: #fff; padding: 8px 16px; border-radius: 30px;
    font-size: 14px; font-weight: bold; cursor: pointer; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.18); font-family: 'Microsoft YaHei', sans-serif;
    transform: translateX(-50%); align-items: center; gap: 5px;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 2147483647;
}
#selection-popover:hover { transform: translateX(-50%) scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
#selection-popover span { vertical-align: middle; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px);
    z-index: 2000; display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; }
.modal-card {
    background: #ffffff; border: 1px solid #e0e0e0; border-radius: 16px;
    padding: 24px; min-width: 320px; max-width: 600px; /* 加宽以适应 diff 内容 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    transform: scale(0.9); transition: transform 0.3s;
}
.modal-overlay.show .modal-card { transform: scale(1); }
.modal-title { font-size: 18px; font-weight: bold; margin-bottom: 10px; color: var(--primary-blue); }
.modal-body { font-size: 14px; color: var(--text-sub); margin-bottom: 20px; line-height: 1.5; max-height: 60vh; overflow-y: auto; }
.modal-input {
    width: 100%; background-color: var(--bg-color); border: 1px solid var(--border-color);
    color: var(--text-main); padding: 10px; border-radius: 8px; margin-bottom: 20px;
    font-family: inherit; font-size: 14px;
}
.modal-input:focus { border-color: var(--primary-blue); outline: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-btn { padding: 8px 16px; border-radius: 20px; border: none; cursor: pointer; font-weight: 500; font-family: inherit; }
.modal-btn.primary { background: var(--primary-blue); color: #fff; }
.modal-btn.secondary { background: transparent; color: var(--text-main); border: 1px solid #cccccc; }
.modal-btn:hover { opacity: 0.9; }

/* 版本记录 Diff 样式 */
.version-list { list-style: none; padding: 0; margin: 0; }
.version-item {
    background: #f0f0f0; padding: 12px; border-radius: 8px; margin-bottom: 10px;
    border-left: 3px solid var(--border-color); transition: border-color 0.2s;
}
.version-item:hover { border-left-color: var(--primary-blue); background: #ececec; }
.version-meta { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; display: flex; justify-content: space-between; }
.version-content {
    font-size: 13px; font-family: monospace; white-space: pre-wrap; 
    background: #fafafa; padding: 8px; border-radius: 4px;
    max-height: 100px; overflow-y: auto; cursor: pointer; /* 提示可点击 */
}
/* Diff Highlight */
.diff-add { background-color: var(--diff-add-bg); color: var(--diff-add-text); text-decoration: none; }
.diff-del { background-color: var(--diff-del-bg); color: var(--diff-del-text); text-decoration: line-through; }

/* 公屏聊天样式 */
.public-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.public-chat-header .title {
    font-size: 18px;
    font-weight: 700;
}
.public-title-block { display: flex; flex-direction: column; gap: 2px; }
.public-chat-header .subtitle { font-size: 13px; color: var(--text-sub); }
.public-profession {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--primary-blue);
    font-weight: 600;
    white-space: nowrap;
}

.public-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.public-chat-header .title {
    font-size: 18px;
    font-weight: 700;
}

.public-chat-header .subtitle {
    font-size: 13px;
    color: var(--text-sub);
}

.public-chat-actions {
    display: flex;
    gap: 8px;
}

.public-messages {
    flex: 1;
    overflow-y: auto;
    background: #f7f7f7;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.public-msg {
    background: #ffffff;
    border-radius: 10px;
    padding: 8px 10px;
    border: 1px solid #ececec;
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 6px;
    gap: 8px;
}

.public-meta .author {
    font-weight: 500;
    color: var(--text-main);
}

.public-meta .profession {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 102, 204, 0.12);
    color: #0066cc;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.public-meta .time {
    opacity: 0.7;
    margin-left: auto;
}

.public-body {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public-actions.inline { display: inline-flex; gap: 8px; flex-shrink: 0; }

.public-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.thumb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f0f0f0;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.thumb-btn .material-symbols-outlined {
    font-size: 18px;
}

.thumb-btn:hover { border-color: var(--primary-blue); color: var(--text-main); }
.thumb-btn.active { background: #e6f0fb; border-color: var(--primary-blue); color: #0066cc; }

.public-empty {
    text-align: center;
    color: var(--text-sub);
    padding: 20px 0;
}

.public-input-bar {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.public-input-bar textarea {
    flex: 1;
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    padding: 10px;
    resize: vertical;
    min-height: 48px;
    max-height: 140px;
}

.primary-btn {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 400;
}

.ghost-btn {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    padding: 8px 12px;
    border-radius: 9999px;
    cursor: pointer;
}

.ghost-btn:hover, .primary-btn:hover { opacity: 0.92; }
.ghost-btn:active, .primary-btn:active { transform: scale(0.97); }

/* 热点榜单样式 */
.trending-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
    min-height: 0;
}

.trending-placeholder {
    background: #ffffff;
    border: 1px dashed #e0e0e0;
    border-radius: 12px;
    padding: 14px;
    color: var(--text-sub);
    font-size: 14px;
    text-align: center;
}

.trending-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.trending-item:hover {
    background: #f0f0f0;
    border-color: #aaaaaa;
}

.trending-item.expanded {
    background: #f0f0f0;
}

.trending-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.trending-rank {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.trending-rank.top1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.trending-rank.top2 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.trending-rank.top3 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.trending-content {
    flex: 1;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trending-item.expanded .trending-content {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.trending-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.trending-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ff6b6b;
    font-size: 13px;
}

.trending-likes .material-symbols-outlined {
    font-size: 16px;
}

.trending-details {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #cccccc;
}

.trending-item.expanded .trending-details {
    display: block;
}

.trending-detail-row {
    display: flex;
    gap: 6px;
    color: var(--text-sub);
    font-size: 13px;
    margin-bottom: 4px;
}

.trending-detail-label {
    color: #999;
    min-width: 50px;
}

.trending-detail-value {
    color: var(--text-main);
}

.trending-empty {
    text-align: center;
    color: var(--text-sub);
    padding: 30px 20px;
    font-size: 14px;
}

.trending-empty .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 10px;
}

/* 弹幕样式 */
.barrage-container {
    position: absolute;
    bottom: 100px;
    left: 60px;
    right: 60px;
    height: 80px;
    pointer-events: none;
    z-index: 40;
}

.barrage-item {
    position: absolute;
    background: rgba(0, 102, 204, 0.15);
    border: 1px solid rgba(0, 102, 204, 0.4);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.barrage-item:hover {
    background: rgba(0, 102, 204, 0.25);
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

@keyframes barrage-scroll {
    from {
        left: 100%;
        opacity: 1;
    }
    to {
        left: -400px;
        opacity: 0.2;
    }
}

.barrage-item.scrolling {
    animation: barrage-scroll 10s linear forwards;
}

.barrage-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: clamp(4px, 0.6vw, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    transition: all 0.2s;
}
.barrage-toggle-btn .material-symbols-outlined {
    font-size: clamp(18px, 2.2vw, 24px);
}

.barrage-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--text-main);
}

.barrage-toggle-btn.active {
    color: var(--primary-blue);
    background-color: rgba(0, 102, 204, 0.15);
}

/* Model console and wrapper for chat model rows */
.model-block {
    margin-bottom: 12px;
}


.models-console {
    /* size and layout only; visual styling is on .console-frame */
    width: 90%;
    margin: 0 auto 12px;
}

.models-console .console-frame {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 8px 12px 20px 12px;
    color: var(--text-sub);
    font-size: 0.95em;
}

.models-console .console-head {
    font-weight: 600;
    color: var(--primary-blue);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

.models-console .console-content {
    color: var(--text-sub);
    font-size: 0.95em;
    min-height: 250px;
    padding-bottom: 20px;

        height: 250px;
        overflow-y: auto;
}

.models-console .console-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.models-console .console-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
}

/* 响应式布局优化 - 主页面 */
@media (max-width: 1400px) {
    .main-area {
        min-width: 280px;
    }
    .sidebar-right {
        flex-basis: clamp(140px, 12vw, 220px);
        max-width: clamp(140px, 12vw, 220px);
        padding: clamp(10px, 1.3vw, 18px);
    }
    .sidebar-left {
        flex-basis: clamp(140px, 12vw, 220px);
        max-width: clamp(140px, 12vw, 220px);
    }
    .input-box {
        max-width: min(900px, calc(100vw - clamp(120px, 12vw, 220px) - clamp(140px, 12vw, 220px) - clamp(28px, 4vw, 60px)));
    }
}

@media (max-width: 1200px) {
    .main-area {
        min-width: 250px;
    }
    .sidebar-right {
        flex-basis: clamp(120px, 10vw, 180px);
        max-width: clamp(120px, 10vw, 180px);
        padding: clamp(8px, 1.2vw, 16px);
    }
    .sidebar-left {
        flex-basis: clamp(120px, 10vw, 180px);
        max-width: clamp(120px, 10vw, 180px);
    }
    .input-box {
        max-width: min(900px, calc(100vw - clamp(100px, 10vw, 180px) - clamp(120px, 10vw, 180px) - clamp(24px, 3.5vw, 50px)));
    }
}

@media (max-width: 1024px) {
    .main-area {
        min-width: 220px;
    }
    .sidebar-right {
        flex-basis: clamp(100px, 8vw, 160px);
        max-width: clamp(100px, 8vw, 160px);
        padding: clamp(6px, 1vw, 14px);
        gap: clamp(8px, 1.2vw, 16px);
    }
    .sidebar-left {
        flex-basis: clamp(100px, 8vw, 160px);
        max-width: clamp(100px, 8vw, 160px);
    }
    .input-box {
        max-width: min(900px, calc(100vw - clamp(80px, 8vw, 160px) - clamp(100px, 8vw, 160px) - clamp(20px, 3vw, 40px)));
        padding: clamp(5px, 0.7vw, 8px) clamp(10px, 1.3vw, 18px);
    }
    #user-prompt {
        font-size: clamp(11px, 1.1vw, 14px);
    }
}

@media (max-width: 768px) {
    .main-area {
        min-width: max(200px, calc(100vw - clamp(80px, 18vw, 150px) - clamp(80px, 18vw, 150px) - 20px));
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        z-index: 10;
    }
    .sidebar-right {
        position: absolute;
        right: 0;
        top: 0;
        height: 100vh;
        flex: 0 0 auto;
        flex-basis: clamp(70px, 16vw, 140px);
        max-width: clamp(70px, 16vw, 140px);
        z-index: 50;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, flex-basis 0.3s ease, max-width 0.3s ease;
        overflow: hidden;
    }
    .sidebar-right.collapsed {
        transform: translateX(100%);
    }
    .sidebar-left {
        position: absolute;
        left: 0;
        top: 0;
        height: 100vh;
        flex: 0 0 auto;
        flex-basis: clamp(70px, 16vw, 140px);
        max-width: clamp(70px, 16vw, 140px);
        z-index: 50;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }
    .sidebar-left.hidden {
        transform: translateX(-100%);
    }
    .input-area-wrapper {
        padding: clamp(10px, 1.3vw, 16px) clamp(12px, 2vw, 24px);
        z-index: 200;
        justify-content: flex-start;
    }
    .input-box {
        max-width: calc(100vw - clamp(12px, 2vw, 24px) * 2);
        padding: clamp(5px, 0.6vw, 8px) clamp(8px, 1.2vw, 16px);
        border-radius: clamp(12px, 1.8vw, 20px);
    }
    #user-prompt {
        font-size: clamp(10px, 1vw, 13px);
    }
    .chat-container {
        padding: clamp(10px, 1.3vw, 16px) clamp(12px, 2vw, 24px);
        padding-bottom: clamp(70px, 7vw, 100px);
        padding-top: clamp(35px, 3.5vw, 50px);
    }
}

@media (max-width: 600px) {
    .main-area {
        min-width: max(200px, calc(100vw - clamp(60px, 15vw, 120px) - clamp(60px, 15vw, 120px) - 20px));
    }
    .sidebar-right {
        flex-basis: clamp(50px, 12vw, 100px);
        max-width: clamp(50px, 12vw, 100px);
    }
    .sidebar-left {
        flex-basis: clamp(50px, 12vw, 100px);
        max-width: clamp(50px, 12vw, 100px);
    }
    .input-box {
        max-width: calc(100vw - clamp(8px, 1.5vw, 16px) * 2);
        padding: clamp(4px, 0.5vw, 6px) clamp(6px, 1vw, 12px);
    }
    #user-prompt {
        font-size: clamp(9px, 0.9vw, 12px);
    }
    .input-area-wrapper {
        padding: clamp(8px, 1.2vw, 12px) clamp(10px, 1.8vw, 20px);
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .main-area {
        min-width: max(180px, calc(100vw - clamp(40px, 10vw, 80px) - clamp(40px, 10vw, 80px) - 16px));
    }
    .sidebar-right {
        flex-basis: clamp(40px, 10vw, 80px);
        max-width: clamp(40px, 10vw, 80px);
    }
    .sidebar-left {
        flex-basis: clamp(40px, 10vw, 80px);
        max-width: clamp(40px, 10vw, 80px);
    }
    .input-box {
        max-width: calc(100vw - clamp(6px, 1.2vw, 12px) * 2);
        padding: clamp(4px, 0.4vw, 5px) clamp(5px, 0.8vw, 10px);
        gap: clamp(4px, 0.6vw, 8px);
    }
    #user-prompt {
        font-size: clamp(8px, 0.8vw, 11px);
    }
    #send-btn {
        padding: clamp(4px, 0.6vw, 6px);
    }
    .input-area-wrapper {
        padding: clamp(6px, 1vw, 10px) clamp(8px, 1.5vw, 16px);
        justify-content: flex-start;
    }
    .chat-container {
        padding: clamp(8px, 1.2vw, 12px) clamp(10px, 1.8vw, 20px);
        padding-bottom: clamp(60px, 6vw, 80px);
        padding-top: clamp(30px, 3vw, 40px);
    }
}

@media (max-width: 360px) {
    .main-area {
        min-width: max(150px, calc(100vw - clamp(40px, 10vw, 80px) - clamp(40px, 10vw, 80px) - 12px));
    }
    .sidebar-right {
        flex-basis: clamp(40px, 10vw, 80px);
        max-width: clamp(40px, 10vw, 80px);
    }
    .sidebar-left {
        flex-basis: clamp(40px, 10vw, 80px);
        max-width: clamp(40px, 10vw, 80px);
    }
    .input-box {
        max-width: calc(100vw - clamp(4px, 1vw, 8px) * 2);
        padding: clamp(3px, 0.3vw, 4px) clamp(4px, 0.7vw, 8px);
    }
    #user-prompt {
        font-size: clamp(7px, 0.7vw, 10px);
    }
    .input-area-wrapper {
        justify-content: flex-start;
    }
}

/* ── 通用美化下拉框（custom-select.js） ───────────────────────── */
.cs-wrap { position: relative; width: 100%; }
.cs-wrap > select { display: none !important; }
.cs-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #ffffff; border: 1px solid var(--border-color); border-radius: 8px;
    padding: 8px 12px; font-size: 14px; color: var(--text-main);
    cursor: pointer; transition: border-color 0.15s ease;
}
.cs-trigger:hover, .cs-trigger.open { border-color: var(--primary-blue); }
.cs-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-trigger-label.cs-placeholder { color: var(--text-sub); }
.cs-arrow { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-sub); flex-shrink: 0; transition: transform 0.15s ease; }
.cs-arrow svg { width: 18px; height: 18px; display: block; }
.cs-trigger.open .cs-arrow { transform: rotate(180deg); }
.cs-disabled .cs-trigger { opacity: 0.5; cursor: not-allowed; }
.cs-panel {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #ffffff; border: 1px solid var(--border-color); border-radius: 10px;
    max-height: 240px; overflow-y: auto; z-index: 300;
    box-shadow: 0 12px 28px rgba(0,0,0,0.14); padding: 6px;
}
.cs-panel.open { display: block; }
.cs-option {
    padding: 8px 12px; border-radius: 7px; font-size: 14px; color: var(--text-main);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background 0.1s;
}
.cs-option:hover { background: rgba(0, 102, 204, 0.08); }
.cs-option.selected { color: var(--primary-blue); font-weight: 600; background: rgba(0, 102, 204, 0.1); }
.cs-empty { padding: 10px 12px; text-align: center; color: var(--text-sub); font-size: 13px; }


.user-billing-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    background: #fafafa;
}
.user-billing-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-billing-balance { color: var(--primary-blue); font-weight: 700; font-size: 15px; }
.user-recharge-row { display: flex; align-items: center; gap: 6px; }
.user-recharge-input {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text-main);
    background: #fff;
    outline: none;
}
.user-recharge-input:focus { border-color: var(--primary-blue); }
.user-recharge-unit { color: var(--text-sub); font-size: 13px; }
.user-pay-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.user-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
}
.user-pay-btn:hover { border-color: var(--primary-blue); color: var(--primary-blue); }
.user-pay-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.user-billing-status { min-height: 16px; font-size: 12px; color: var(--text-sub); }
.user-billing-status.error { color: var(--danger-color); }
.user-billing-status.success { color: var(--accent-color); }
.user-pay-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.68);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-pay-box {
    width: 340px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 30px 34px;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 48px rgba(0,0,0,0.22);
}
.user-pay-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.user-pay-title { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--text-main); }
.user-pay-amount-line { margin: 8px 0 18px; color: var(--text-sub); font-size: 13px; }
.user-pay-amount-line strong { color: var(--text-main); }
.user-pay-qr-area { min-height: 210px; width: 210px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.user-pay-spinner { width: 44px; height: 44px; border: 4px solid #d8d8d8; border-top-color: var(--primary-blue); border-radius: 50%; animation: user-pay-spin .8s linear infinite; }
@keyframes user-pay-spin { to { transform: rotate(360deg); } }
.user-pay-tip { margin: 14px 0 0; color: var(--text-sub); font-size: 13px; }
.user-pay-countdown { margin: 6px 0 0; color: var(--text-sub); font-size: 12px; }
.user-pay-success, .user-pay-error { padding: 12px 0; }
.user-pay-state-icon { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(52, 199, 89, .12); color: var(--accent-color); font-size: 28px; font-weight: 800; }
.user-pay-state-icon.error { background: rgba(255, 59, 48, .12); color: var(--danger-color); }
.user-pay-success p, .user-pay-error p { margin: 6px 0; font-weight: 700; color: var(--text-main); }
.user-pay-success span { color: var(--text-sub); font-size: 13px; }
.user-pay-retry { border: none; border-radius: 8px; background: var(--primary-blue); color: #fff; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }


.balance-banner-action {
    border: none;
    border-radius: 999px;
    background: var(--primary-blue);
    color: #fff;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 10px;
}
.balance-banner-action:hover { opacity: .9; }

/* Recharge entries are navigation controls, not underlined text links. */
#sidebar-recharge-link,
#user-banner-recharge {
    text-decoration: none;
}

/* Enterprise invitations and management */
.enterprise-invite-overlay {
  position: fixed; inset: 0; z-index: 20000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, .68); backdrop-filter: blur(4px);
}
.enterprise-invite-dialog {
  width: min(440px, 100%); padding: 26px; border-radius: 18px; background: var(--bg-secondary, #fff);
  color: var(--text-main, #172033); box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
.enterprise-invite-dialog h2 { margin: 0 0 12px; }
.enterprise-invite-dialog p { line-height: 1.7; }
.enterprise-invite-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.enterprise-invite-actions button { min-width: 96px; padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.enterprise-secondary { border: 1px solid var(--border-color, #d9dee8); background: transparent; color: inherit; }
.enterprise-invite-error, .enterprise-status.error { color: #c62828; }
.enterprise-card {
  padding: 24px; margin-bottom: 16px; border: 1px solid #e7eaf0;
  border-radius: 12px; background: #fff; box-shadow: none;
  color: #1d2939; font-family: "Google Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.enterprise-card h3 { margin: 0 0 8px; color: #1d2939; font-size: 17px; line-height: 1.45; font-weight: 600; letter-spacing: 0; }
.enterprise-card p { margin: 0; }
.enterprise-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.enterprise-inline input, .enterprise-card > input, .enterprise-search-wrap input, .enterprise-card select {
  min-width: 220px; padding: 0 13px; height: 42px; border: 1px solid #d9dee7;
  border-radius: 9px; background: #fff; color: #1d2939; font: inherit; font-size: 14px;
  box-sizing: border-box; outline: none; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.enterprise-inline input::placeholder, .enterprise-card > input::placeholder, .enterprise-search-wrap input::placeholder { color: #98a2b3; }
.enterprise-inline input:focus, .enterprise-card > input:focus, .enterprise-search-wrap input:focus, .enterprise-card select:focus {
  border-color: #84adf4; box-shadow: 0 0 0 3px rgba(0, 102, 204, .09);
}
.enterprise-card .primary-btn {
  height: 42px; padding: 0 18px; border-radius: 9px; box-shadow: none;
  font-size: 14px; line-height: 42px; font-weight: 600; white-space: nowrap;
}
.enterprise-onboarding {
  max-width: 680px; padding: 28px 30px 24px; background: #fbfcfe;
}
.enterprise-onboarding-copy { margin-bottom: 24px; }
.enterprise-onboarding-copy h3 { font-size: 19px; margin-bottom: 6px; }
.enterprise-onboarding-copy p { color: #667085; font-size: 14px; line-height: 1.65; font-weight: 400; }
.enterprise-field-label { display: block; margin-bottom: 8px; color: #344054; font-size: 13px; line-height: 1.4; font-weight: 500; }
.enterprise-create-row { flex-wrap: nowrap; align-items: stretch; gap: 12px; }
.enterprise-create-row input { flex: 1 1 360px; min-width: 0; max-width: 420px; }
.enterprise-form-note { margin-top: 9px !important; color: #98a2b3; font-size: 12px; line-height: 1.55; }
.enterprise-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 28px; background: linear-gradient(135deg, #fbfdff 0%, #f7faff 100%); }
.enterprise-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.enterprise-logo { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 11px; background: #eaf2ff; color: #1769c2; }
.enterprise-logo .material-symbols-outlined { font-size: 22px; }
.enterprise-kicker { display: block; margin-bottom: 2px; color: #667085; font-size: 12px; font-weight: 500; }
.enterprise-identity h3 { display: inline; margin: 0 9px 0 0; font-size: 19px; vertical-align: middle; }
.enterprise-role-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #e8f1ff; color: #1769c2; font-size: 11px; font-weight: 500; vertical-align: middle; }
.enterprise-balance { text-align: right; flex: 0 0 auto; }
.enterprise-balance span { display: block; margin-bottom: 2px; color: #667085; font-size: 12px; font-weight: 400; }
.enterprise-balance strong { display: block; color: #101828; font-size: 25px; line-height: 1.25; font-weight: 600; letter-spacing: 0; }
.enterprise-balance a { display: inline-block; margin-top: 5px; color: #1769c2; font-size: 12px; font-weight: 500; text-decoration: none; }
.enterprise-section-card { padding: 25px 28px; }
.enterprise-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.enterprise-section-heading h3 { margin-bottom: 4px; font-size: 16px; }
.enterprise-section-heading p { max-width: 590px; color: #667085; font-size: 13px; line-height: 1.65; font-weight: 400; }
.enterprise-count { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; background: #f2f4f7; color: #667085; font-size: 11px; font-weight: 500; }
.enterprise-control-row { display: flex; align-items: center; gap: 16px; }
.enterprise-control-row label { color: #344054; font-size: 13px; font-weight: 500; }
.enterprise-control-row select { width: 230px; min-width: 0; }
.enterprise-invite-row { flex-wrap: nowrap; align-items: flex-start; gap: 12px; }
.enterprise-invite-row textarea {
  width: min(520px, 100%); min-width: 0; min-height: 112px; padding: 11px 13px;
  border: 1px solid #d9dee7; border-radius: 9px; background: #fff; color: #1d2939;
  font: inherit; font-size: 14px; line-height: 1.6; box-sizing: border-box; outline: none;
  resize: vertical; transition: border-color .16s ease, box-shadow .16s ease;
}
.enterprise-invite-row textarea::placeholder { color: #98a2b3; }
.enterprise-invite-row textarea:focus { border-color: #84adf4; box-shadow: 0 0 0 3px rgba(0, 102, 204, .09); }
.enterprise-invite-row .primary-btn { min-width: 128px; }
.enterprise-invite-results { width: min(660px, 100%); margin-top: 16px; overflow: hidden; border: 1px solid #e4e8ee; border-radius: 10px; background: #fafbfd; }
.enterprise-invite-result-summary { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-bottom: 1px solid #e8ebf0; color: #667085; font-size: 12px; }
.enterprise-invite-result-summary strong { color: #344054; font-size: 13px; font-weight: 600; }
.enterprise-invite-result-list { max-height: 250px; overflow-y: auto; }
.enterprise-invite-result-item { display: grid; grid-template-columns: 20px 104px minmax(0, 1fr); align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid #eef0f3; color: #667085; font-size: 12px; }
.enterprise-invite-result-item:last-child { border-bottom: 0; }
.enterprise-invite-result-item .material-symbols-outlined { font-size: 17px; }
.enterprise-invite-result-item strong { color: #344054; font-size: 12px; font-weight: 500; }
.enterprise-invite-result-item.success .material-symbols-outlined { color: #23945c; }
.enterprise-invite-result-item.error .material-symbols-outlined { color: #d04b4b; }
.enterprise-search-wrap { position: relative; width: min(330px, 100%); margin-bottom: 12px; }
.enterprise-search-wrap .material-symbols-outlined { position: absolute; left: 12px; top: 50%; z-index: 1; color: #98a2b3; font-size: 18px; transform: translateY(-50%); pointer-events: none; }
.enterprise-search-wrap input { width: 100%; min-width: 0; padding-left: 38px; }
#enterprise-members { border-top: 1px solid #eef0f3; }
.enterprise-member-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 66px; padding: 11px 0; border-bottom: 1px solid #eef0f3; }
.enterprise-member-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.enterprise-member-avatar { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 50%; background: #f0f4f8; color: #475467; font-size: 12px; font-weight: 600; }
.enterprise-member-identity strong { display: block; color: #1d2939; font-size: 14px; line-height: 1.4; font-weight: 500; }
.enterprise-member-identity small { display: block; margin-top: 2px; color: #98a2b3; font-size: 11px; line-height: 1.35; }
.enterprise-member-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.enterprise-member-row select { width: 126px; min-width: 0; height: 38px; font-size: 13px; }
.enterprise-member-row select:disabled { color: #475467; background: #f8fafc; cursor: not-allowed; opacity: 1; }
.enterprise-transfer { height: 38px; padding: 0 12px; border: 1px solid #b9d3f5; border-radius: 8px; background: #f7faff; color: #1769c2; font-size: 12px; font-weight: 500; cursor: pointer; }
.enterprise-transfer:hover { border-color: #84adf4; background: #eef5ff; }
.enterprise-remove, .enterprise-danger-zone button { height: 38px; border: 1px solid #f1b4b4; color: #c24141; background: #fff; border-radius: 8px; padding: 0 12px; font-size: 12px; font-weight: 500; cursor: pointer; }
.enterprise-remove:disabled { opacity: .4; cursor: not-allowed; }
.enterprise-rank-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid #eef0f3; color: #475467; font-size: 13px; }
.enterprise-rank-row strong { color: #1d2939; font-size: 13px; font-weight: 600; }
.enterprise-danger-zone { border-color: #f3d0d0; background: #fffdfd; }
.enterprise-danger-zone p { margin-bottom: 15px; color: #9f3a3a; font-size: 13px; line-height: 1.6; }
.enterprise-status { min-height: 22px; margin-top: 8px; color: #2e7d32; }
.enterprise-quick-billing select { max-width: 190px; padding: 6px 8px; border: 1px solid var(--border-color, #dfe3ea); border-radius: 8px; background: var(--bg-color, #fff); color: inherit; }
.user-billing-card [hidden] { display: none !important; }
.recharge-account-context { margin: 2px 0 10px; padding: 8px 10px; border-radius: 8px; background: #f5f8fc; color: #5f6f82; font-size: 11px; line-height: 1.55; }
.recharge-account-context.notice { background: #f7f8fa; color: #667085; }
@media (max-width: 620px) {
  .enterprise-summary { align-items: flex-start; flex-direction: column; }
  .enterprise-balance { text-align: left; }
  .enterprise-section-card, .enterprise-summary { padding: 21px 20px; }
  .enterprise-section-heading { flex-direction: column; gap: 10px; }
  .enterprise-control-row, .enterprise-member-row { align-items: flex-start; flex-direction: column; }
  .enterprise-member-actions { width: 100%; justify-content: flex-start; }
  .enterprise-invite-row { flex-direction: column; }
  .enterprise-invite-row textarea, .enterprise-control-row select { width: 100%; max-width: none; }
  .enterprise-invite-row .primary-btn { width: 100%; }
  .enterprise-invite-result-summary { flex-direction: column; gap: 3px; }
  .enterprise-invite-result-item { grid-template-columns: 20px minmax(90px, auto) minmax(0, 1fr); padding: 9px 10px; }
  .enterprise-onboarding { padding: 22px 20px 20px; }
  .enterprise-create-row { flex-direction: column; }
  .enterprise-create-row input, .enterprise-card .primary-btn { width: 100%; max-width: none; }
}

/* Home layout: the balance notice owns a real row and never overlays content. */
body.home-page {
    flex-direction: column;
}
.home-app-layout {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}
.home-page .admin-balance-banner {
    position: relative;
    inset: auto;
    z-index: 220;
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.home-page .topbar {
    position: absolute;
}
.home-page .project-drawer {
    position: absolute;
    height: 100%;
}
@media (max-width: 640px) {
    .home-page .admin-balance-banner {
        min-height: 52px;
        padding: 8px 42px 8px 12px;
        text-align: left;
        font-size: 12px;
        flex-wrap: wrap;
        gap: 5px 10px;
    }
}

/* Time-based Token usage */
.token-usage-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.token-usage-header .admin-page-title { margin-bottom: 0; }
.token-range-control { display: inline-flex; padding: 3px; border: 1px solid var(--border-color); border-radius: 8px; background: #eceff3; }
.token-range-btn { min-width: 68px; border: 0; border-radius: 6px; padding: 7px 10px; background: transparent; color: var(--text-sub); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.token-range-btn.active { color: var(--primary-blue); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.token-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.token-summary-item { padding: 16px 18px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; }
.token-summary-item span { display: block; color: var(--text-sub); font-size: 12px; margin-bottom: 6px; }
.token-summary-item strong { color: var(--text-main); font-size: 24px; line-height: 1.2; }
.token-summary-item.primary strong { color: var(--primary-blue); }
.token-usage-section { margin-bottom: 16px; padding: 18px; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; }
.token-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.token-section-heading h2 { font-size: 15px; font-weight: 700; color: var(--text-main); }
.token-section-heading p { margin-top: 3px; color: var(--text-sub); font-size: 12px; }
.token-refresh-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); border-radius: 50%; background: #fff; color: var(--text-sub); cursor: pointer; }
.token-refresh-btn:hover { color: var(--primary-blue); border-color: rgba(0,102,204,.3); }
.token-refresh-btn .material-symbols-outlined { font-size: 18px; }
.token-chart { height: 210px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(28px, 1fr); align-items: end; gap: 5px; overflow-x: auto; padding: 8px 2px 0; }
.token-day { height: 100%; min-width: 28px; display: grid; grid-template-rows: 18px 1fr 22px; align-items: end; text-align: center; }
.token-day-value { height: 18px; overflow: hidden; color: var(--text-sub); font-size: 9px; white-space: nowrap; }
.token-day-track { height: 145px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #e6e8eb; }
.token-day-bar { width: min(20px, 70%); min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--primary-blue); transition: opacity .18s; }
.token-day:hover .token-day-bar { opacity: .72; }
.token-day-bar.empty { background: #dfe3e8; }
.token-day-label { padding-top: 6px; color: var(--text-sub); font-size: 9px; white-space: nowrap; }
.token-history-list { display: flex; flex-direction: column; }
.token-history-item { display: grid; grid-template-columns: 36px minmax(180px, 1fr) auto 104px; align-items: center; gap: 13px; min-height: 68px; padding: 11px 4px; border-top: 1px solid #eceef0; }
.token-history-item:first-child { border-top: 0; }
.token-model-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(0,102,204,.08); color: var(--primary-blue); }
.token-model-icon .material-symbols-outlined { font-size: 19px; }
.token-history-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.token-history-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.token-history-title span { padding: 2px 6px; border-radius: 4px; background: #f0f2f5; color: var(--text-sub); font-size: 10px; }
.token-history-main time { display: block; margin-top: 4px; color: var(--text-sub); font-size: 11px; }
.token-history-breakdown { display: flex; gap: 14px; color: var(--text-sub); font-size: 11px; white-space: nowrap; }
.token-history-breakdown b { color: var(--text-main); font-weight: 600; }
.token-history-total { text-align: right; }
.token-history-total strong { display: block; color: var(--primary-blue); font-size: 16px; }
.token-history-total span { color: var(--text-sub); font-size: 10px; }
.token-loading, .token-empty { grid-column: 1 / -1; align-self: center; width: 100%; padding: 34px 12px; text-align: center; color: var(--text-sub); font-size: 13px; }
.token-empty.error { color: var(--danger-color); }
@media (max-width: 820px) {
    .token-usage-header { flex-direction: column; }
    .token-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .token-history-item { grid-template-columns: 36px minmax(0, 1fr) 86px; }
    .token-history-breakdown { display: none; }
}
@media (max-width: 520px) {
    .token-summary-grid { grid-template-columns: 1fr; }
    .token-range-control { width: 100%; }
    .token-range-btn { min-width: 0; flex: 1; }
    .token-usage-section { padding: 14px 12px; }
}
