:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #e6eaf2;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #4f6ef7;
    --primary-dark: #3b57d6;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------------------------------------------------------------- 布局 */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 224px;
    flex-shrink: 0;
    background: #111827;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand h1 {
    font-size: 16px;
    color: #fff;
    letter-spacing: .3px;
}

.brand span {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nav {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* 菜单项增多后（如新增「功能配置」）在矮屏 / 高缩放下可滚动，避免最后几项被裁掉 */
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    transition: background .15s, color .15s;
}

.nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
}

/* 侧边栏底部语言切换（所有页面共用，由 common.js 渲染） */
.sidebar-lang {
    display: flex;
    gap: 6px;
    padding: 0 20px 12px;
}

.sidebar-lang button {
    flex: 1;
    padding: 6px 0;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.sidebar-lang button:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.sidebar-lang button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    font-size: 12px;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 24px 28px 40px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-head h2 {
    font-size: 21px;
    font-weight: 600;
}

.page-head p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ---------------------------------------------------------------- 组件 */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-head h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.btn:hover {
    border-color: #c8d1e0;
    background: #f9fafb;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-danger {
    color: var(--danger);
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn-group {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.btn-group button {
    border: none;
    background: transparent;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--muted);
    border-right: 1px solid var(--border);
}

.btn-group button:last-child {
    border-right: none;
}

.btn-group button.active {
    background: var(--primary);
    color: #fff;
}

/* 指标卡 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.stat .label {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat .value {
    font-size: 26px;
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: -.5px;
}

.stat .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.stat .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

@media (max-width: 1024px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
}

.chart {
    width: 100%;
    height: 300px;
}

/* 表格 */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    padding: 11px 14px;
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    background: #fafbfd;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f4f9;
    vertical-align: middle;
}

tbody tr:hover {
    background: #fafbfd;
}

tbody tr:last-child td {
    border-bottom: none;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 18px;
    background: #eef2ff;
    color: var(--primary-dark);
}

.tag-green {
    background: #ecfdf5;
    color: var(--success);
}

.tag-red {
    background: #fef2f2;
    color: var(--danger);
}

.tag-gray {
    background: #f3f4f6;
    color: var(--muted);
}

.tag-orange {
    background: #fffbeb;
    color: var(--warning);
}

.tag-blue {
    background: #eff6ff;
    color: #2563eb;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
    font-size: 13px;
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.field label .req {
    color: var(--danger);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}

.hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 16px;
    overflow-y: auto;
    z-index: 100;
}

.modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 16px;
}

.modal-body {
    padding: 22px;
    max-height: 66vh;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
}

.icon-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: var(--text);
}

/* 提示条 */
#toast-box {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.toast {
    min-width: 220px;
    max-width: 380px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .28);
    animation: toast-in .2s ease;
}

.toast.success {
    background: #15803d;
}

.toast.error {
    background: #b91c1c;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 代码片段 */
.code-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 12px;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.7;
}

/* ---------------------------------------------------------------- 对话页 */
.chat-main {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
}

.chat-wrap {
    flex: 1;
    min-height: 0;
}

.chat-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-title select {
    width: auto;
    min-width: 190px;
    padding: 7px 10px;
    font-weight: 500;
}

.chat-title #model-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 对话页操作区里的下拉选择：宽度自适应，不占满整行 */
.chat-actions select {
    width: auto;
    padding: 5px 8px;
    font-size: 12px;
}

.chat-params {
    padding: 16px 20px 4px;
    border-bottom: 1px solid var(--border);
    background: #fafbfd;
}

.chat-params textarea {
    resize: vertical;
}

.chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 22px;
    background: #fafbfd;
}

.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--muted);
}

.chat-empty h4 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 8px;
}

.chat-empty p {
    font-size: 13px;
    max-width: 460px;
    line-height: 1.8;
}

.chat-empty code {
    background: #eef2ff;
    color: var(--primary-dark);
    padding: 1px 6px;
    border-radius: 4px;
}

/* 消息气泡 */
.msg {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.msg.user {
    flex-direction: row-reverse;
}

.avatar {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #94a3b8;
    user-select: none;
}

.msg.user .avatar {
    background: var(--primary);
}

.msg.assistant .avatar {
    background: #0f172a;
}

.bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.75;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.msg.assistant .bubble {
    background: #fff;
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.msg.user .bubble {
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 4px;
}

.bubble .md > *:first-child {
    margin-top: 0;
}

.bubble pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    line-height: 1.6;
}

.bubble pre code {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 12px;
    white-space: pre;
}

.bubble p code,
.bubble .md code {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 12px;
    background: rgba(15, 23, 42, .07);
    padding: 1px 5px;
    border-radius: 4px;
}

.msg.user .bubble .md code {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.typing-hint {
    color: var(--muted);
    font-size: 13px;
}

.typing-hint .dots::after {
    content: '...';
    animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
    0% {
        content: '';
    }
    25% {
        content: '.';
    }
    50% {
        content: '..';
    }
    75% {
        content: '...';
    }
}

.msg-error {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--danger);
    font-size: 12.5px;
}

.msg-usage {
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px dashed var(--border);
    padding-top: 6px;
}

.msg.user .msg-usage {
    border-top-color: rgba(255, 255, 255, .3);
    color: rgba(255, 255, 255, .8);
}

/* 思考过程折叠块 */
.reasoning {
    margin-bottom: 8px;
    border: 1px dashed #dbe2ec;
    border-radius: 8px;
    background: #f8fafc;
    padding: 6px 10px;
}

.reasoning summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
    outline: none;
}

.reasoning-body {
    margin-top: 6px;
    font-size: 12.5px;
    color: #64748b;
    line-height: 1.7;
    max-height: 260px;
    overflow-y: auto;
}

/* 输入区 */
.chat-foot {
    border-top: 1px solid var(--border);
    padding: 12px 20px 16px;
    background: #fff;
}

.chat-endpoint {
    font-size: 11px;
    margin-bottom: 8px;
}

.chat-input-box {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 10px 8px 12px;
    transition: border-color .15s, box-shadow .15s;
}

.chat-input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}

.chat-input-box textarea {
    border: none;
    padding: 4px 0;
    resize: none;
    max-height: 180px;
    overflow-y: auto;
    background: transparent;
    line-height: 1.6;
}

.chat-input-box textarea:focus {
    outline: none;
    box-shadow: none;
}

.chat-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

@media (max-width: 900px) {
    .chat-title #model-meta {
        display: none;
    }

    .bubble {
        max-width: 88%;
    }
}

/* ---------------------------------------------------------------- 登录页 */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at 18% 18%, #23325a 0%, #101a2e 52%, #0a1120 100%);
}

.login-card {
    width: 100%;
    max-width: 384px;
    background: var(--card);
    border-radius: 16px;
    padding: 30px 30px 28px;
    box-shadow: 0 26px 64px rgba(2, 6, 23, .46);
}

.login-brand {
    text-align: center;
    margin-bottom: 20px;
}

.login-brand h1 {
    font-size: 20px;
    letter-spacing: .3px;
}

.login-brand span {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.login-card h2 {
    font-size: 16px;
    font-weight: 600;
}

.login-tip {
    font-size: 12px;
    margin: 2px 0 18px;
}

.login-field-gap {
    margin-top: 14px;
}

.login-submit {
    width: 100%;
    margin-top: 20px;
    padding: 10px;
    font-size: 14px;
}

.login-error {
    margin-top: 14px;
    padding: 9px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--danger);
    font-size: 12.5px;
}

/* 侧边栏退出登录按钮 */
.sidebar-logout {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

/* ---------------------------------------------------------------- 请求记录页 */
.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.log-filters input[type="text"] {
    width: 200px;
}

.log-filters .btn {
    padding: 8px 16px;
}

.log-preview {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12.5px;
    line-height: 1.5;
}

td.log-question,
td.log-answer {
    max-width: 320px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 14px;
    font-size: 12.5px;
}

/* 语义缓存控制区 */
.cache-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

.cache-field {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.cache-field > label:first-child {
    color: var(--muted);
}

.cache-metrics {
    margin-left: auto;
    font-size: 12.5px;
}

/* 开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .18s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .18s;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* 详情弹窗 */
.detail-meta {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 4px;
    word-break: break-all;
    line-height: 1.9;
}

.detail-kind {
    margin-right: 8px;
}

.modal-body h4 {
    font-size: 13px;
    margin: 16px 0 8px;
    color: var(--text);
}

/* ---------------------------------------------------------------- 移动端适配 */
/* 移动端侧边栏改为抽屉：左上角按钮唤出，点遮罩/菜单项收起（common.js 挂载） */
.mobile-menu-btn,
.sidebar-mask {
    display: none;
}

@media (max-width: 768px) {
    .layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 160;
        width: 76%;
        max-width: 288px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .22s ease;
    }

    .sidebar.open {
        transform: none;
        box-shadow: 0 20px 60px rgba(2, 6, 23, .45);
    }

    .sidebar-mask {
        position: fixed;
        inset: 0;
        z-index: 155;
        background: rgba(15, 23, 42, .45);
    }

    .sidebar-mask.show {
        display: block;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 150;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: #fff;
        color: var(--text);
        font-size: 17px;
        line-height: 1;
        box-shadow: var(--shadow);
        cursor: pointer;
    }

    .main {
        padding: 58px 12px 28px;
    }

    .page-head {
        margin-bottom: 14px;
        gap: 10px;
    }

    .page-head h2 {
        font-size: 18px;
    }

    .page-head p {
        font-size: 12px;
    }

    .card-head {
        padding: 12px 14px;
        flex-wrap: wrap;
    }

    .card-body {
        padding: 14px;
    }

    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .stat {
        padding: 14px 16px;
    }

    .stat .value {
        font-size: 22px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 12px;
    }

    th {
        padding: 9px 10px;
    }

    td {
        padding: 10px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 5px 10px;
    }

    .modal-mask {
        padding: 10px 8px;
    }

    .modal {
        max-width: 100% !important;
        border-radius: 12px;
    }

    .modal-head {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 14px;
        max-height: 72vh;
    }

    .modal-foot {
        padding: 12px 16px;
    }

    #toast-box {
        left: 10px;
        right: 10px;
        top: 54px;
    }

    .toast {
        max-width: none;
        min-width: 0;
    }

    .log-filters input[type="text"] {
        width: 100%;
    }

    .log-filters input,
    .log-filters select {
        flex: 1 1 140px;
        min-width: 0;
    }

    .code-box {
        font-size: 11px;
    }

    /* 对话页：顶栏换行、气泡更宽、输入区贴底 */
    .chat-main {
        height: calc(100vh - 58px);
        padding: 10px 12px 12px;
    }

    .chat-head {
        padding: 10px 12px;
        gap: 8px;
    }

    .chat-title {
        width: 100%;
    }

    .chat-title select {
        width: 100%;
        min-width: 0;
    }

    .chat-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .chat-body {
        padding: 14px;
    }

    .chat-params {
        padding: 12px 14px 4px;
    }

    .bubble {
        max-width: 92%;
    }
}

@media (max-width: 480px) {
    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-body {
        padding: 16px;
    }

    .login-card {
        padding: 24px 20px;
    }
}


