/* AI 聚合台 — 明亮科技主题（纯白背景） */
:root {
    --bg-deep: #ffffff;
    --bg-mid: #ffffff;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --surface-muted: #ffffff;
    --border: rgba(59, 130, 246, 0.16);
    --border-strong: rgba(37, 99, 235, 0.3);
    --text: #0f172a;
    --text-dim: #475569;
    --muted: #64748b;
    --accent: #0284c7;
    --accent-2: #4f46e5;
    --accent-soft: #ffffff;
    --accent-glow: rgba(2, 132, 199, 0.22);
    --accent-violet-glow: rgba(79, 70, 229, 0.18);
    --primary-gradient: linear-gradient(120deg, #06b6d4 0%, #2563eb 48%, #6366f1 100%);
    --sidebar-bg: #ffffff;
    --topbar-bg: #ffffff;
    --overlay: rgba(15, 23, 42, 0.42);
    --input-bg: #ffffff;
    --input-border: #dbeafe;
    --hover-bg: #ffffff;
    --hover-bg-strong: #ffffff;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    --hint: #ea580c;
    --error: #dc2626;
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 8px 28px rgba(37, 99, 235, 0.1);
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: #ffffff;
    background-image: none;
}

body::before {
    display: none;
}

.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-shell:has(.chat-panel) {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.top-bar {
    position: relative;
    z-index: 60;
    overflow: visible;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(26, 34, 58, 0.9) 0%, rgba(20, 28, 48, 0.86) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), var(--shadow-glow);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    min-width: 0;
    flex-shrink: 0;
}

.top-bar-brand-sep {
    font-size: 15px;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.65);
    user-select: none;
    line-height: 1;
}

.top-bar-api-link {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.top-bar-api-link:hover {
    color: var(--link-hover);
    border-bottom-color: rgba(147, 197, 253, 0.35);
}

.top-bar-api-link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.45);
    outline-offset: 3px;
    border-radius: 4px;
}

.brand-title {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.user-entry { text-decoration: none; color: inherit; }

.user-entry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 13px;
    color: var(--text-dim);
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.recharge-link {
    font-size: 13px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 700;
}

.recharge-link:hover {
    color: #f87171;
    text-decoration: underline;
}

.user-balance {
    margin-left: 6px;
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.auth-btn {
    border: 1px solid var(--input-border);
    background: #ffffff;
    color: var(--accent);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.auth-btn.ghost {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-dim);
}

.user-menu-wrap {
    position: relative;
    z-index: 70;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.user-menu-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.8;
    margin-top: -2px;
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 170px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(10, 16, 36, 0.96);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 80;
}

.user-menu-dropdown[hidden] {
    display: none !important;
}

.user-menu-item {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-dim);
    text-decoration: none;
    text-align: left;
    font-size: 13px;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(34, 211, 238, 0.12);
    color: var(--text);
}

.user-menu-item.danger:hover {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
}

.login-modal[hidden] { display: none !important; }

.recharge-modal[hidden] { display: none !important; }

.recharge-modal {
    position: fixed;
    inset: 0;
    z-index: 85;
}

.recharge-mask {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
}

.recharge-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(460px, calc(100% - 30px));
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(30, 41, 72, 0.95) 0%, rgba(18, 26, 48, 0.98) 100%);
    box-shadow: var(--shadow), 0 0 40px rgba(34, 211, 238, 0.12);
    padding: 18px;
}

.recharge-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text);
}

.recharge-row {
    margin-bottom: 12px;
}

.recharge-row > label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.recharge-amounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recharge-amount {
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
}

.recharge-amount.active {
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent);
}

.recharge-input {
    width: 100%;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: rgba(8, 12, 26, 0.65);
    color: var(--text);
}

.recharge-paytypes {
    display: flex;
    gap: 14px;
}

.recharge-paytype {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
}

.recharge-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.wxpay-modal[hidden] { display: none !important; }

.wxpay-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.wxpay-mask {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
}

.wxpay-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(380px, calc(100% - 30px));
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(30, 41, 72, 0.95) 0%, rgba(18, 26, 48, 0.98) 100%);
    box-shadow: var(--shadow), 0 0 40px rgba(34, 211, 238, 0.12);
    padding: 18px;
}

.wxpay-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.wxpay-body {
    text-align: center;
}

.wxpay-qrcode {
    width: 210px;
    height: 210px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px;
}

.wxpay-tip {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text);
}

.wxpay-tip.muted {
    color: var(--text-dim);
    font-size: 12px;
}

.wxpay-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.login-mask {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
}

.login-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(420px, calc(100% - 30px));
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(30, 41, 72, 0.95) 0%, rgba(18, 26, 48, 0.98) 100%);
    box-shadow: var(--shadow), 0 0 40px rgba(34, 211, 238, 0.12);
    padding: 18px;
}

.login-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text);
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.login-tab {
    border: 1px solid var(--border);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
}

.login-tab.active {
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent);
}

.login-row { margin-bottom: 10px; }

.login-row label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.login-row input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: rgba(8, 12, 26, 0.65);
    color: var(--text);
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-row input {
    flex: 1;
}

.captcha-img {
    width: 140px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(8, 12, 26, 0.65);
    cursor: pointer;
    user-select: none;
}

.login-err {
    color: var(--error);
    font-size: 12px;
    margin: 6px 0 10px;
}

.login-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.register-link {
    margin-right: auto;
    align-self: center;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

.register-link:hover {
    color: var(--link);
    text-decoration: underline;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px var(--accent-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.avatar-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 28px var(--accent-violet-glow);
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease;
}
.back-link:hover { color: var(--link-hover); }

.layout { display: flex; flex: 1; min-height: 0; }

.sidebar {
    width: 252px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border);
    box-shadow: inset -1px 0 0 rgba(34, 211, 238, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-brands {
    flex: 0 0 auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brands .brand-list {
    flex: 0 0 auto;
    min-height: auto;
    overflow-y: visible;
}

.history-session-block {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 4px;
}

/* 折叠：仍在「分类」区块下方（DOM 顺序），只占一行高度，不再用 flex 顶满侧栏底部 */
.history-session-block.is-collapsed {
    flex: 0 0 auto;
    min-height: 0;
}

.history-session-block.is-collapsed .history-session-list {
    display: none;
}

.history-session-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 12px 18px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.95;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    flex-shrink: 0;
}

.history-session-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.history-session-toggle:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.5);
    outline-offset: 2px;
}

.history-session-toggle-label {
    flex: 1;
    min-width: 0;
}

.history-session-toggle-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-right: 2px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    opacity: 0.85;
}

.history-session-block.is-collapsed .history-session-toggle-chevron {
    transform: rotate(-45deg);
}

.sidebar.sidebar-history-collapsed .sidebar-brands {
    max-height: none;
    flex: 0;
    /*min-height: 0;*/
}

.history-session-list {
    list-style: none;
    margin: 0;
    padding: 4px 10px 12px;
    --history-session-row-h: 96px;
    max-height: calc(var(--history-session-row-h) * 5 + 16px);
    overflow-x: hidden;
    overflow-y: auto;
    flex: 0 0 auto;
    min-height: 0;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) rgba(15, 23, 42, 0.35);
    -webkit-overflow-scrolling: touch;
}

.history-session-list::-webkit-scrollbar {
    width: 6px;
}

.history-session-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 3px;
}

.history-session-list::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-radius: 3px;
}

.history-session-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55);
}

.history-session-item {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    padding: 4px 4px 4px 8px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    cursor: default;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.history-session-item:hover {
    background: rgba(34, 211, 238, 0.06);
    border-color: rgba(34, 211, 238, 0.12);
}

.history-session-item.is-active {
    border-color: var(--border-strong);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.history-session-item-main {
    flex: 1;
    min-width: 0;
    padding: 6px 4px 6px 4px;
    cursor: pointer;
    border-radius: 6px;
}

.history-session-item-main:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-session-item-main:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.45);
    outline-offset: 1px;
}

.history-session-delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin-top: 4px;
    padding: 0;
    line-height: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease, background 0.15s ease;
}

.history-session-delete:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

.history-session-delete:focus-visible {
    outline: 2px solid rgba(248, 113, 113, 0.5);
    outline-offset: 1px;
}

.history-session-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-session-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
}

.history-session-empty {
    padding: 12px 14px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.sidebar-head {
    padding: 12px 14px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.9;
}

.brand-list {
    list-style: none;
    margin: 0;
    padding: 6px 8px 10px;
    overflow-y: auto;
}

.brand-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 6px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.brand-item:hover {
    background: rgba(34, 211, 238, 0.06);
    border-color: rgba(34, 211, 238, 0.15);
}

.brand-item.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.12) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: var(--border-strong);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.15), rgba(139, 92, 246, 0.12));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-brands--category-icons .brand-logo .category-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar-brands--category-icons .brand-item {
    justify-content: flex-start;
}

.sidebar-brands--category-icons .brand-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
    white-space: normal;
}

.sidebar-brands--category-icons .brand-text .sub {
    display: none;
}

.brand-text .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.brand-text .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: rgba(14, 20, 38, 0.32);
}

.app-shell:has(.chat-panel) .main {
    overflow: hidden;
}

.model-strip {
    flex: 0 0 auto;
    padding: 12px 16px 10px;
    background: rgba(24, 32, 54, 0.48);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.model-strip--dropdown {
    padding: 8px 16px;
}

.model-strip-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 12px;
    min-height: 36px;
}

.model-strip-label {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.model-strip-select {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 280px;
    height: 34px;
    padding: 0 28px 0 10px;
    font-size: 13px;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.model-strip-select:hover,
.model-strip-select:focus {
    border-color: rgba(34, 211, 238, 0.45);
    outline: none;
}

#modelStripSelect {
    flex: 1 1 240px;
    max-width: min(520px, 100%);
}

.model-strip-doc-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
    background: var(--primary-gradient);
    border: 1px solid rgba(34, 211, 238, 0.55);
    border-radius: 999px;
    box-shadow: 0 0 16px var(--accent-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.model-strip-doc-link::after {
    content: "→";
    font-size: 14px;
    font-weight: 700;
    opacity: 0.9;
}

.model-strip-doc-link:hover {
    color: #0f172a;
    filter: brightness(1.08);
    box-shadow: 0 0 22px var(--accent-violet-glow);
    transform: translateY(-1px);
}

.model-strip-doc-link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.65);
    outline-offset: 3px;
}

.model-strip-doc-link[hidden] {
    display: none;
}

.strip-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.model-panel.is-hidden { display: none; }

.model-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.model-card {
    position: relative;
    min-width: 168px;
    max-width: 228px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(30, 41, 72, 0.9) 0%, rgba(18, 26, 48, 0.95) 100%);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.model-card:hover {
    z-index: 4;
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.12), 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.model-card.selected {
    border-color: rgba(34, 211, 238, 0.65);
    background: linear-gradient(160deg, rgba(34, 211, 238, 0.12) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(18, 26, 48, 0.95) 100%);
    box-shadow: 0 0 36px rgba(34, 211, 238, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.model-card:focus-within {
    z-index: 5;
}

.model-card .title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.model-card .type-tag {
    display: inline-block;
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent);
    border: 1px solid rgba(34, 211, 238, 0.25);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.model-card .price {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

.model-card .price .price-tiered {
    margin-top: 4px;
    max-height: 54px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.model-card .price .price-tier-line {
    font-size: 10px;
    line-height: 1.35;
}

.model-card .price .price-tiered::-webkit-scrollbar {
    width: 4px;
}

.model-card .price .price-tiered::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

/* 有说明图标时给右下角留白，避免与价格文字重叠 */
.model-card:has(.model-card-info-anchor) {
    padding-bottom: 12px;
}

.model-card:has(.model-card-info-anchor) .price {
    padding-right: 30px;
}

.model-card-info-anchor {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
}

.model-card-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 50%;
    background: rgba(12, 18, 36, 0.75);
    color: var(--accent);
    cursor: help;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.model-card-info-btn:hover,
.model-card-info-btn:focus-visible {
    outline: none;
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(34, 211, 238, 0.14);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

.model-card-info-svg {
    width: 15px;
    height: 15px;
}

.model-card-info-tip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: min(300px, calc(100vw - 40px));
    max-height: min(280px, 42vh);
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: rgba(16, 22, 42, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow), 0 0 24px rgba(34, 211, 238, 0.12);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-dim);
    white-space: pre-wrap;
    word-break: break-word;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 30;
}

.model-card-info-anchor:hover .model-card-info-tip,
.model-card-info-anchor:focus-within .model-card-info-tip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.model-price-bar {
    flex: 0 0 auto;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    box-shadow: var(--card-shadow);
    font-size: 13px;
}

.model-price-bar-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 6px;
}

.model-price-bar-title {
    font-weight: 600;
    color: var(--text);
}

.model-price-bar-model {
    color: var(--text-dim);
    font-size: 12px;
}

.model-price-bar-doc {
    margin-left: auto;
    font-size: 12px;
    color: var(--link);
    text-decoration: none;
    white-space: nowrap;
}

.model-price-bar-doc:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.model-price-bar-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 140px;
    overflow-y: auto;
}

.model-price-bar-line {
    line-height: 1.45;
    word-break: break-word;
}

.model-price-bar-line--muted {
    color: var(--muted);
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px 14px;
    min-height: 0;
    overflow: hidden;
}

.chat-panel-composer {
    flex: 0 0 min(420px, 40vw);
    min-width: 300px;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    align-self: flex-start;
}

.chat-panel-composer .composer {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-panel-composer #composerInner {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-panel-composer #composerInner > .composer-actions,
.chat-panel-composer #composerInner > .composer-actions-send-only,
.chat-panel-composer #composerInner > .composer-actions-row-end {
    flex: 0 0 auto;
}

.chat-panel-composer #inputBox {
    flex: 0 0 auto;
    width: 100%;
    min-height: calc(1.45em * 3 + 20px);
    max-height: none;
}

.messages {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--card-shadow);
    scrollbar-color: rgba(100, 116, 139, 0.45) #ffffff;
}

.messages::-webkit-scrollbar {
    width: 8px;
}

.messages::-webkit-scrollbar-track {
    background: rgba(8, 12, 26, 0.5);
    border-radius: 6px;
}

.messages::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.45);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55);
    background-clip: padding-box;
}

.messages a {
    color: var(--link);
}

.messages a:hover {
    color: var(--link-hover);
}

.bubble {
    max-width: 720px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.bubble.user {
    margin-left: auto;
    background: #ffffff;
    border: 1px solid rgba(6, 182, 212, 0.35);
    color: var(--text);
    box-shadow: none;
}

.bubble.sys {
    background: #ffffff;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    color: var(--text-dim);
    box-shadow: none;
}

.bubble .bubble-body {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Markdown 美化 & HTML 代码块展示 */
.bubble .bubble-body.bubble-body-md {
    white-space: normal;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
}

.bubble .bubble-body.bubble-stream-pending {
    white-space: pre-wrap;
}

.bubble .bubble-body.bubble-body-md h1,
.bubble .bubble-body.bubble-body-md h2,
.bubble .bubble-body.bubble-body-md h3,
.bubble .bubble-body.bubble-body-md h4,
.bubble .bubble-body.bubble-body-md h5,
.bubble .bubble-body.bubble-body-md h6 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.35;
    margin: 16px 0 10px;
}

.bubble .bubble-body.bubble-body-md h1 { font-size: 1.4rem; }
.bubble .bubble-body.bubble-body-md h2 {
    font-size: 1.28rem;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.bubble .bubble-body.bubble-body-md h3 { font-size: 1.12rem; }

.bubble .bubble-body.bubble-body-md p {
    margin: 0 0 10px;
    color: var(--text-dim);
}

.bubble .bubble-body.bubble-body-md .bubble-md-list {
    margin: 0 0 12px;
    padding-left: 1.4em;
    color: var(--text-dim);
}

.bubble .bubble-body.bubble-body-md .bubble-md-list li {
    margin: 5px 0;
}

.bubble .bubble-body.bubble-body-md .bubble-md-list li strong {
    color: var(--text);
}

.bubble .bubble-body.bubble-body-md .bubble-md-hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.bubble .bubble-body.bubble-body-md .bubble-md-quote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--accent);
    background: rgba(6, 182, 212, 0.06);
    border-radius: 0 8px 8px 0;
    color: var(--text-dim);
}

.bubble .bubble-body.bubble-body-md .bubble-md-quote p {
    margin: 0;
}

.bubble .bubble-body.bubble-body-md a {
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.22);
}

.bubble .bubble-body.bubble-body-md a:hover {
    color: var(--link-hover);
}

.bubble .bubble-body.bubble-body-md .bubble-inline-code {
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: rgba(148, 163, 184, 0.18);
    padding: 0.12em 0.4em;
    border-radius: 4px;
    color: #0f172a;
}

.bubble .bubble-body.bubble-body-md .bubble-code-wrap {
    position: relative;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.15);
}

.bubble .bubble-body.bubble-body-md .bubble-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: #1e293b;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.bubble .bubble-body.bubble-body-md .bubble-code-lang {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #94a3b8;
    text-transform: uppercase;
}

.bubble .bubble-body.bubble-body-md .bubble-code-copy-btn {
    flex-shrink: 0;
    margin: 0;
    padding: 3px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bubble .bubble-body.bubble-body-md .bubble-code-copy-btn:hover {
    background: rgba(6, 182, 212, 0.25);
    border-color: var(--accent);
    color: #fff;
}

.bubble .bubble-body.bubble-body-md .bubble-code-copy-btn.is-copied {
    background: rgba(34, 197, 94, 0.25);
    border-color: #22c55e;
    color: #bbf7d0;
}

.bubble .bubble-body.bubble-body-md .bubble-code-block {
    margin: 0;
    padding: 14px 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre;
    word-break: normal;
    border: none;
}

.bubble .bubble-body.bubble-body-md .bubble-code-block code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: none;
    padding: 0;
    color: inherit;
}

.bubble .bubble-body.bubble-body-md .bubble-code-html .bubble-code-block {
    background: #1e293b;
    border-left: 3px solid var(--accent);
}

/* 助手气泡：处理中「思考中」与正文区切换 */
.bubble.sys.is-thinking .bubble-body {
    display: none;
}

.bubble.sys:not(.is-thinking) .bubble-thinking-wrap {
    display: none;
}

.bubble-thinking-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
}

.think-txt {
    color: var(--text);
    font-weight: 600;
}

.think-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.think-dots i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    animation: think-bounce 1.1s ease-in-out infinite;
}

.think-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.think-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes think-bounce {
    0%, 70%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }
    35% {
        transform: translateY(-7px);
        opacity: 1;
    }
}

.bubble-caption {
    margin-bottom: 10px;
    color: var(--text);
    line-height: 1.5;
}

.bubble-image-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.bubble-image-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.32);
}

.bubble-image-card img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 360px;
    object-fit: contain;
}

.bubble-image-actions {
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--border);
    background: rgba(8, 12, 26, 0.55);
}

.bubble-dl-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.bubble-dl-link:hover {
    text-decoration: underline;
}

.bubble-dl-hint {
    font-size: 11px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.bubble-audio-list {
    display: grid;
    gap: 10px;
}

.bubble-video-wrap video {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.bubble-video-pending {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

.composer-video-t2v-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--muted);
}

/* 模型 13：仅任务参数占首行；画面素材与方框在下一行 */
.composer-i2v-toprow {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 8px 12px;
    margin-bottom: 8px;
    width: 100%;
    text-align: left;
}

.composer-i2v-toprow .composer-video-t2v-fields {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-bottom: 0;
    justify-content: flex-start;
}

.composer-inline-select {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
}

.composer-inline-number {
    width: 7.5em;
    min-width: 6em;
}

.composer-inline-number::placeholder {
    color: var(--muted);
    opacity: 0.85;
}

.composer-seed-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.composer-seed-random-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-dim);
    cursor: pointer;
    vertical-align: middle;
}

.composer-seed-random-btn:hover {
    color: var(--accent);
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.1);
}

.composer-seed-random-icon {
    width: 14px;
    height: 14px;
    display: block;
}

/* 模型 13 图生视频：首帧 / 首尾帧 / 续写方形上传区 */
.i2v-frame-slots {
    margin: 10px 0 12px;
}

/* 画面素材标题独占一行，方框在其下一行横向排列 */
.i2v-frame-slots-below-params {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 10px;
    width: 100%;
    text-align: left;
}

.i2v-frame-slots-below-params .i2v-frame-slots-caption {
    margin-bottom: 0;
    width: 100%;
}

.i2v-frame-slots-pack {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
}

.i2v-frame-slots-below-params .i2v-frame-slots-row {
    margin: 0;
    flex-wrap: nowrap;
    gap: 8px;
}

.i2v-frame-slots-caption {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.i2v-frame-slots-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-start;
}

.i2v-frame-slot {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    background: rgba(8, 12, 26, 0.45);
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    outline: none;
}

.i2v-frame-slot:hover,
.i2v-frame-slot:focus-visible {
    border-color: rgba(34, 211, 238, 0.45);
}

.i2v-frame-file {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.i2v-frame-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.i2v-frame-slot.has-preview .i2v-frame-preview {
    display: block;
}

.i2v-frame-slot.i2v-frame-slot--video.has-preview .i2v-frame-preview-video {
    display: block;
}

.i2v-frame-preview-video {
    background: #000;
}

.i2v-frame-slot.has-preview .i2v-frame-placeholder {
    opacity: 0;
}

.i2v-frame-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--muted);
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.i2v-frame-clear {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.72);
    color: #e8eef8;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.i2v-frame-clear:hover {
    background: rgba(248, 113, 113, 0.85);
    color: #fff;
}

/* 模型 18 参考图：三槽等分侧栏宽度，上限略小于默认 120px，避免溢出边界 */
.i2v-frame-slots--ref-compact {
    max-width: 100%;
}

.i2v-frame-slots--ref-grid .i2v-frame-slots-row {
    flex-wrap: wrap;
}

.i2v-frame-slots--ref-grid .i2v-frame-slot {
    flex: 0 1 calc((100% - 12px) / 3);
    max-width: calc((100% - 12px) / 3);
}

.i2v-frame-slots--ref-compact.i2v-frame-slots--ref-grid .i2v-frame-slot {
    flex: 0 1 calc((100% - 12px) / 3);
    max-width: calc((100% - 12px) / 3);
    width: auto;
    height: auto;
    aspect-ratio: 1;
}

.i2v-frame-slots--ref-compact.i2v-frame-slots--ref-grid .i2v-frame-slot--add {
    flex: 0 1 calc((100% - 12px) / 3);
    max-width: calc((100% - 12px) / 3);
}

.i2v-frame-slot--add {
    border-style: dashed;
    background: rgba(8, 12, 26, 0.28);
    padding: 0;
    font: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.i2v-frame-slot--add:hover,
.i2v-frame-slot--add:focus-visible {
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(34, 211, 238, 0.08);
}

.i2v-frame-add-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    color: var(--muted);
    pointer-events: none;
}

.i2v-frame-slot--add:hover .i2v-frame-add-icon,
.i2v-frame-slot--add:focus-visible .i2v-frame-add-icon {
    color: rgba(34, 211, 238, 0.9);
}

.i2v-frame-slots--ref-compact .i2v-frame-slots-pack,
.i2v-frame-slots--ref-compact .i2v-frame-slots-row {
    width: 100%;
    max-width: 100%;
}

.i2v-frame-slots--ref-compact .i2v-frame-slots-row {
    gap: 6px;
}

.i2v-frame-slots--ref-compact .i2v-frame-slot {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    aspect-ratio: 1;
    max-width: 88px;
}

.bubble-audio-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.28);
}

.bubble-audio-item audio {
    width: 100%;
    display: block;
    padding: 10px;
}

.composer {
    flex: 0 0 auto;
    background: rgba(26, 34, 56, 0.68);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow), 0 0 40px rgba(139, 92, 246, 0.06);
}

.chat-option-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    user-select: none;
}

.composer-actions-right .chat-option-item {
    margin-right: 6px;
}

.risk-modal[hidden] { display: none; }

.risk-modal {
    position: fixed;
    inset: 0;
    z-index: 1900;
}

.risk-mask {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 22, 0.62);
    backdrop-filter: blur(2px);
}

.risk-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100vw - 28px));
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: rgba(20, 30, 50, 0.98);
    box-shadow: var(--shadow), 0 0 30px rgba(34, 211, 238, 0.12);
    padding: 16px;
}

.risk-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.risk-body {
    margin-top: 10px;
    color: var(--text-dim);
    line-height: 1.55;
}

.risk-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.upload-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.composer-actions-row {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    align-self: stretch;
}

.composer-actions-left {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.composer-actions-left .upload-toolbar {
    margin-bottom: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.composer-actions-left .upload-login-hint {
    font-size: 12px;
    white-space: nowrap;
}

.btn-icon-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 8px;
    color: #475569;
    line-height: 0;
    overflow: visible;
}

.btn-icon-upload:hover,
.btn-icon-upload:focus-visible {
    color: var(--accent);
    border-color: rgba(34, 211, 238, 0.45);
    background: rgba(34, 211, 238, 0.08);
}

.btn-icon-upload .upload-kind-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
    color: inherit;
    stroke: currentColor;
    fill: none;
}

.btn-icon-upload .upload-kind-icon use {
    color: inherit;
    stroke: inherit;
    fill: none;
}

.composer-actions-left .upload-login-hint.btn-icon-upload {
    cursor: default;
    border: 1px dashed var(--border);
    background: rgba(248, 250, 252, 0.9);
}

.attachments {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.attach-item { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }

.upload-progress-wrap {
    margin: 6px 0 10px;
}

.upload-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(8, 12, 26, 0.5);
    overflow: hidden;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22d3ee, #3b82f6 60%, #8b5cf6);
    transition: width 0.2s ease;
}

.upload-progress-text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

#inputBox {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    resize: none;
    outline: none;
    background: rgba(8, 12, 26, 0.65);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: calc(1.45em * 3 + 20px);
    max-height: none;
    overflow-y: hidden;
    field-sizing: content;
}

#inputBox::placeholder { color: var(--muted); }

#inputBox:focus {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), 0 0 24px rgba(34, 211, 238, 0.08);
}

.composer-extra {
    margin-top: 12px;
}

.composer-extra-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.composer-extra-label-spaced {
    margin-top: 14px;
}

.composer-extra-optional {
    font-weight: 500;
    color: var(--muted);
}

.composer-extra-desc {
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 8px;
}

.composer-extra-input {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 13px;
    resize: vertical;
    outline: none;
    min-height: 72px;
    background: rgba(8, 12, 26, 0.65);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer-extra-input::placeholder {
    color: var(--muted);
}

.composer-extra-input:focus {
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.composer-extra-foot {
    font-size: 11px;
    margin-top: 6px;
    text-align: right;
}

.composer-inline-code {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(8, 12, 26, 0.85);
    border: 1px solid var(--border);
}

.composer-size-hints {
    font-size: 12px;
    line-height: 1.55;
    margin: 0 0 10px 1.1em;
    padding: 0;
}

.composer-size-hints li {
    margin-bottom: 2px;
}

.composer-extra-select {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    background: rgba(8, 12, 26, 0.65);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer-extra-select:focus {
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.composer-extra-select-narrow {
    max-width: 220px;
}

.composer-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
}

.composer-actions .hint {
    order: 2;
    width: 100%;
    line-height: 1.45;
}

.composer-actions-right {
    order: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    align-self: flex-end;
    flex-shrink: 0;
}

.composer-actions-row .composer-actions-right {
    order: unset;
    align-self: auto;
    margin-left: auto;
}

.composer-actions-right .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 文生图等仅文本发送：无上传提示时右对齐发送 */
.composer-actions-send-only {
    margin-bottom: 4px;
}

.composer-actions-send-only.composer-actions-with-advanced {
    margin-bottom: 0;
}

/* 发送行末尾：新会话 + 发送 + 高级选项（高级与发送略拉开） */
.composer-actions-row-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.composer-advanced-inline {
    margin-left: 14px;
    flex-shrink: 0;
    align-self: center;
}

.composer-advanced-above {
    width: 100%;
    flex: 0 0 auto;
    margin-bottom: 10px;
}

.composer-advanced-static .composer-advanced-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 12px 2px 4px;
    user-select: none;
}

.composer-advanced-static .composer-advanced-body {
    padding-top: 0;
}

.composer-advanced-inline .composer-advanced-summary {
    padding: 2px;
}

.composer-advanced-inline[open] {
    flex: 1 0 100%;
    margin-left: 0;
    margin-top: 4px;
    align-self: stretch;
}

.composer-advanced {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(148, 163, 184, 0.06);
    padding: 0 12px 12px;
}

.composer-advanced-summary {
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 12px 2px;
    user-select: none;
    margin-top: 8px;
}

.composer-advanced-summary::-webkit-details-marker {
    display: none;
}

.composer-advanced-summary::after {
    content: "▼";
    float: right;
    font-size: 10px;
    color: var(--muted);
    transform: translateY(2px);
}

.composer-advanced[open] .composer-advanced-summary::after {
    content: "▲";
}

.composer-advanced-body {
    padding-top: 4px;
}

.btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}

.btn.primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(34, 211, 238, 0.35), 0 2px 8px rgba(139, 92, 246, 0.2);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(34, 211, 238, 0.45), 0 4px 12px rgba(139, 92, 246, 0.25);
}

.btn.primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 生成中：发送按钮变为「停止」 */
#sendBtn.btn-stop {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}

#sendBtn.btn-stop:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn.ghost {
    background: #ffffff;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn.ghost:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.35);
    color: var(--text);
}

/* 覆盖 .btn / .upload-login-hint 的 padding，保证回形针等 SVG 在方形容器内居中 */
.btn.ghost.btn-icon-upload,
.upload-login-hint.btn-icon-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    line-height: 0;
}

.hint { color: var(--hint); font-size: 12px; font-weight: 500; }

.hint-inline {
    color: var(--hint);
    font-size: 13px;
    margin: 0 12px;
    font-weight: 500;
}

.err { color: var(--error); font-size: 13px; font-weight: 500; }

/* 个人中心 */
.profile-page .top-bar { justify-content: flex-start; gap: 16px; }

.profile-card {
    max-width: 720px;
    margin: 36px auto;
    background: linear-gradient(165deg, rgba(30, 41, 72, 0.85) 0%, rgba(18, 26, 48, 0.92) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 28px 32px;
    box-shadow: var(--shadow), 0 0 48px rgba(34, 211, 238, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.profile-card h2 {
    margin-top: 0;
    font-size: 1.35rem;
    color: var(--text);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.muted { color: var(--muted); }

.profile-list {
    padding-left: 18px;
    color: var(--text-dim);
    line-height: 1.75;
}

.profile-list code {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    color: var(--accent);
}

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        flex-direction: column;
        max-height: 48vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-brands {
        max-height: none;
    }
    .sidebar-brands .brand-list {
        display: flex;
        flex-wrap: wrap;
        overflow-x: auto;
        overflow-y: visible;
    }
    .brand-item { white-space: nowrap; }
    .history-session-list {
        --history-session-row-h: 88px;
        max-height: calc(var(--history-session-row-h) * 5 + 16px);
    }
    .history-session-block.is-collapsed {
        max-height: none;
    }
    .chat-panel {
        flex-direction: column;
        overflow: visible;
        flex: 0 0 auto;
        min-height: auto;
    }
    .chat-panel-composer {
        flex: 0 0 auto;
        min-width: 0;
        max-width: none;
        width: 100%;
    }
    .chat-panel-composer #inputBox {
        min-height: calc(1.45em * 3 + 20px);
        max-height: none;
        flex: 0 0 auto;
    }

    /* 聊天页：composer + 侧栏总高度常超过视口，解除固定视口锁死，允许整页纵向滚动 */
    .app-shell:has(.chat-panel) {
        height: auto;
        min-height: 100dvh;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-shell:has(.chat-panel) .main {
        overflow: visible;
        flex: 0 0 auto;
        min-height: auto;
    }

    .app-shell:has(.chat-panel) .messages {
        flex: 0 0 auto;
        min-height: 240px;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .model-price-bar-body {
        max-height: none;
    }
}

/* ========== 会员中心：现代仪表盘布局 ========== */
body.user-center {
    color-scheme: light;
    color: #0f172a;
    background: #eef2ff;
    background-image:
        radial-gradient(ellipse 80% 60% at 10% -10%, rgba(99, 102, 241, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(14, 165, 233, 0.12), transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

body.user-center::before {
    display: none;
}

.user-center .uc-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.user-center .uc-app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.user-center .uc-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 60px;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
}

.user-center .uc-back {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}

.user-center .uc-back:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
    text-decoration: none;
}

.user-center .uc-header-center {
    justify-self: center;
    text-align: center;
    min-width: 0;
}

.user-center .uc-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.user-center .uc-header-sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.user-center .uc-header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-center .uc-header-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}

.user-center .uc-header-chip--balance {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.25);
    color: #065f46;
}

.user-center .uc-header-chip--balance strong {
    font-size: 15px;
    font-weight: 700;
    color: #047857;
}

.user-center .uc-header-chip-label {
    color: #059669;
    font-weight: 500;
}

.user-center .uc-header-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.user-center .uc-frame {
    flex: 1;
    display: flex;
    min-height: 0;
    align-items: stretch;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 20px 32px;
    gap: 20px;
    box-sizing: border-box;
}

.user-center .uc-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-center .uc-user-card {
    background: linear-gradient(145deg, #1e293b 0%, #334155 48%, #1e3a5f 100%);
    border-radius: 16px;
    padding: 18px 16px 16px;
    color: #f8fafc;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-center .uc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.user-center .uc-user-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-center .uc-user-id {
    margin-top: 2px;
    font-size: 12px;
    color: rgba(248, 250, 252, 0.65);
}

.user-center .uc-user-balance {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.user-center .uc-user-balance-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.55);
    margin-bottom: 4px;
}

.user-center .uc-user-balance-val {
    font-size: 22px;
    font-weight: 700;
    color: #6ee7b7;
    letter-spacing: -0.02em;
}

.user-center .uc-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.user-center .uc-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #475569;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.user-center .uc-nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.user-center .uc-nav-icon svg {
    width: 18px;
    height: 18px;
}

.user-center .uc-nav-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.user-center .uc-nav-label {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.user-center .uc-nav-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

.user-center .uc-nav-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.user-center .uc-nav-item:hover .uc-nav-icon {
    background: #e0e7ff;
    color: #4f46e5;
}

.user-center .uc-nav-item.is-active {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border-color: rgba(99, 102, 241, 0.2);
    color: #1e40af;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.user-center .uc-nav-item.is-active .uc-nav-icon {
    background: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
    color: #fff;
}

.user-center .uc-nav-item.is-active .uc-nav-desc {
    color: #6366f1;
}

.user-center .uc-sidebar-foot {
    margin-top: auto;
}

.user-center .uc-sidebar-recharge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(120deg, #06b6d4 0%, #3b82f6 55%, #6366f1 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

.user-center .uc-sidebar-recharge:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.32);
    color: #fff;
}

.user-center .uc-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.user-center .uc-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.user-center .uc-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.user-center .uc-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-center .uc-stat-icon svg {
    width: 22px;
    height: 22px;
}

.user-center .uc-stat-card--balance .uc-stat-icon {
    background: #ecfdf5;
    color: #059669;
}

.user-center .uc-stat-card--pending .uc-stat-icon {
    background: #fffbeb;
    color: #d97706;
}

.user-center .uc-stat-card--info .uc-stat-icon {
    background: #eef2ff;
    color: #4f46e5;
}

.user-center .uc-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.02em;
}

.user-center .uc-stat-value {
    margin-top: 4px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.user-center .uc-stat-value--sm {
    font-size: 18px;
    font-weight: 700;
}

.user-center .uc-stat-card--balance .uc-stat-value {
    color: #047857;
}

.user-center .uc-stat-card--pending .uc-stat-value {
    color: #b45309;
}

.user-center .uc-stat-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
}

.user-center .uc-section {
    margin: 0;
}

.user-center .uc-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}

.user-center .uc-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.user-center .uc-quick-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.user-center .uc-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
}

.user-center .uc-quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-center .uc-quick-icon svg {
    width: 20px;
    height: 20px;
}

.user-center .uc-quick-icon--green { background: #ecfdf5; color: #059669; }
.user-center .uc-quick-icon--blue { background: #eff6ff; color: #2563eb; }
.user-center .uc-quick-icon--violet { background: #f5f3ff; color: #7c3aed; }
.user-center .uc-quick-icon--cyan { background: #ecfeff; color: #0891b2; }

.user-center .uc-quick-label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.user-center .uc-quick-desc {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.user-center .uc-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.user-center .uc-panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 20px 22px 22px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.user-center .uc-panel-head {
    margin-bottom: 16px;
}

.user-center .uc-panel-head--row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
}

.user-center .uc-panel-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.user-center .uc-panel-desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.user-center .uc-panel-desc code {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.user-center .uc-panel-badge {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.user-center .uc-panel-badge strong {
    color: #047857;
    font-weight: 700;
}

.user-center .uc-info-list {
    margin: 0;
}

.user-center .uc-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
}

.user-center .uc-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.user-center .uc-info-row dt {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.user-center .uc-info-row dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    text-align: right;
}

.user-center .uc-muted-inline {
    color: #94a3b8;
    font-weight: 500;
}

.user-center .uc-api-key-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #0f172a;
    border: 1px solid #1e293b;
}

.user-center .uc-api-key-val {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: #a5f3fc;
    word-break: break-all;
    line-height: 1.5;
}

.user-center .uc-api-key-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-center .uc-tip {
    margin: 12px 0 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.user-center .uc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
    line-height: 1.2;
}

.user-center .uc-btn--primary {
    color: #fff;
    background: linear-gradient(120deg, #06b6d4 0%, #3b82f6 55%, #6366f1 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.user-center .uc-btn--primary:hover {
    opacity: 0.94;
    transform: translateY(-1px);
}

.user-center .uc-btn--ghost {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.user-center .uc-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

.user-center .uc-btn--warn {
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.user-center .uc-btn--warn:hover {
    opacity: 0.92;
}

.user-center .uc-form {
    max-width: none;
    margin-top: 0;
}

.user-center .uc-form--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
}

.user-center .uc-form-row {
    margin-bottom: 0;
}

.user-center .uc-form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.user-center .uc-form-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.user-center .uc-form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.user-center .uc-form-actions {
    grid-column: 1 / -1;
    padding-top: 4px;
}

.user-center .uc-msg {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
}

.user-center .uc-msg.ok { color: #16a34a; }
.user-center .uc-msg.err { color: #dc2626; }

.user-center .uc-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.user-center .uc-notice strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.user-center .uc-notice p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #a16207;
}

.user-center .uc-muted {
    margin: 0 0 10px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

.user-center .uc-muted strong { color: #334155; }

.user-center .uc-muted-note {
    margin-top: 4px;
    font-size: 13px;
    color: #94a3b8;
}

.user-center .uc-pending { color: #b45309; }
.user-center .uc-balance { color: #047857; }

.user-center .uc-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

.user-center .uc-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.user-center .uc-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}

.user-center .uc-badge--in {
    background: #ecfdf5;
    color: #047857;
}

.user-center .uc-badge--out {
    background: #fef2f2;
    color: #b91c1c;
}

.user-center .uc-badge--ok {
    background: #ecfdf5;
    color: #047857;
}

.user-center .uc-badge--pending {
    background: #fffbeb;
    color: #b45309;
}

.user-center .uc-badge--err {
    background: #fef2f2;
    color: #dc2626;
}

.user-center .uc-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 16px;
    margin: 0 0 18px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

.user-center .uc-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.user-center .uc-filter-field label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.user-center .uc-filter-control {
    min-width: 150px;
    max-width: 100%;
    padding: 9px 11px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
}

.user-center .uc-filter-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.user-center .uc-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.user-center .uc-filter-submit {
    padding: 9px 18px;
}

.user-center .uc-filter-reset {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
}

.user-center .uc-filter-reset:hover {
    color: #2563eb;
}

.user-center .uc-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.user-center .uc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.user-center .uc-table th,
.user-center .uc-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.user-center .uc-table tbody tr:last-child td {
    border-bottom: none;
}

.user-center .uc-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid #e2e8f0;
}

.user-center .uc-table tbody tr:hover td {
    background: #fafbff;
}

.user-center .uc-cell-nowrap {
    white-space: nowrap;
}

.user-center .uc-cell-ellipsis {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-center .uc-cell-model {
    font-weight: 600;
    color: #0f172a;
}

.user-center .uc-cell-money {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.user-center .uc-cell-money.is-plus { color: #047857; }
.user-center .uc-cell-money.is-minus { color: #dc2626; }

.user-center .uc-cell-error {
    min-width: 180px;
    max-width: 360px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
    font-size: 12px;
    color: #64748b;
}

.user-center .uc-empty {
    text-align: center;
    padding: 48px 24px 40px;
}

.user-center .uc-empty-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}

.user-center .uc-empty-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.user-center .uc-empty-desc {
    margin: 0 0 18px;
    font-size: 13px;
    color: #94a3b8;
}

.user-center .uc-pager {
    margin-top: 18px;
    font-size: 13px;
    color: #64748b;
}

.user-center .uc-pager ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.user-center .uc-pager li {
    display: inline-block;
    margin: 0;
}

.user-center .uc-pager a,
.user-center .uc-pager span {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #475569;
    text-decoration: none;
    background: #fff;
}

.user-center .uc-pager a:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

.user-center .uc-pager .active > span,
.user-center .uc-pager span.current {
    border-color: #6366f1;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 700;
}

.user-center .uc-grid-profile-edit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 960px) {
    .user-center .uc-grid-profile-edit {
        grid-template-columns: 1fr;
    }
}

.user-center .uc-form-actions--inline {
    padding-top: 4px;
}

.user-center .uc-panel--profile,
.user-center .uc-panel--mobile {
    min-height: 0;
}

.user-center .uc-mobile-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.user-center .uc-mobile-current-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.user-center .uc-mobile-current strong {
    font-size: 16px;
    color: #0f172a;
    letter-spacing: 0.04em;
}

.user-center .uc-mobile-step {
    padding: 16px 0;
    border-top: 1px dashed #e2e8f0;
}

.user-center .uc-mobile-step:first-of-type {
    border-top: none;
    padding-top: 0;
}

.user-center .uc-mobile-step.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.user-center .uc-mobile-step-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.user-center .uc-step-badge {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #2563eb);
}

.user-center .uc-step-status {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

.user-center .uc-step-status.is-ok {
    color: #059669;
}

.user-center .uc-sms-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    margin-bottom: 12px;
}

.user-center .uc-sms-code {
    flex: 1 1 140px;
    min-width: 120px;
}

.user-center .uc-sms-captcha {
    flex: 1 1 200px;
    min-width: 180px;
}

.user-center .uc-captcha-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-center .uc-captcha-inline .uc-form-input {
    flex: 1;
    min-width: 0;
}

.user-center .uc-captcha-img {
    width: 100px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    object-fit: cover;
    background: #fff;
}

.user-center .uc-sms-send {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-bottom: 0;
}

.user-center .uc-sms-captcha label,
.user-center .uc-sms-code label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

/* —— AI 介绍主页 —— */
.ai-home-body .ai-home {
    max-width: 1560px;
    margin: 0 auto;
    padding: 14px 24px 22px;
    min-height: calc(100vh - 50px);
    overflow: visible;
    width: 100%;
}

.brand-title-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
}

.brand-title-link:link,
.brand-title-link:visited,
.brand-title-link:hover,
.brand-title-link:active {
    text-decoration: none;
    color: inherit;
}

.brand-title-link:hover {
    opacity: 0.92;
}

.brand-title-link:focus-visible {
    outline: 2px solid rgba(34, 211, 238, 0.6);
    outline-offset: 4px;
    border-radius: 6px;
}

.ai-home-hero {
    margin-bottom: 14px;
    padding: 30px 32px;
    border-radius: var(--radius);
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(34, 211, 238, 0.16), transparent 46%),
        radial-gradient(120% 120% at 100% 0%, rgba(167, 139, 250, 0.18), transparent 42%),
        var(--surface);
    border: 1px solid rgba(99, 102, 241, 0.28);
    box-shadow: var(--shadow);
}

.ai-home-hero-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--accent-2);
    background: rgba(79, 70, 229, 0.22);
    border: 1px solid rgba(129, 140, 248, 0.35);
    margin-bottom: 10px;
}

.ai-home-hero h1 {
    margin: 0 0 12px;
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-home-lead {
    margin: 0 0 16px;
    line-height: 1.65;
    color: var(--text-dim);
    font-size: 1.03rem;
}

.ai-home-cta {
    margin: 0;
}

.ai-home-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 0 0 18px;
}

.ai-home-stat {
    display: flex;
    flex-direction: column;
    min-width: 72px;
}

.ai-home-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.ai-home-stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.ai-home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.ai-home-quicknav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.88rem;
}

.ai-home-quicknav a {
    color: var(--accent-2);
    text-decoration: none;
}

.ai-home-quicknav a:hover {
    text-decoration: underline;
}

.ai-home-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.ai-home-feature-card {
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(23, 31, 51, 0.35);
}

.ai-home-feature-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text);
}

.ai-home-feature-card p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-dim);
}

.ai-home-list--compact {
    margin-top: 0;
    font-size: 0.85rem;
}

.ai-home-list--compact li {
    margin-bottom: 6px;
}

.ai-home-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    background: rgba(79, 70, 229, 0.2);
    color: var(--accent-2);
    margin-right: 6px;
}

.ai-home-tag--muted {
    background: rgba(100, 116, 139, 0.25);
    color: var(--text-dim);
}

.ai-home-cap-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.ai-home-cap-tag {
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.25);
}

.ai-home-model-note {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.45;
    margin: 6px 0 10px;
}

.ai-home-model-price {
    line-height: 1.5;
}

.ai-home-price-line {
    margin-bottom: 2px;
}

.ai-home-price-more.is-hidden {
    display: none;
}

.ai-home-price-toggle {
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent-2);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.ai-home-price-toggle:hover {
    color: var(--accent);
}

.ai-home-model-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.ai-home-model-actions .ai-home-model-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
    margin-top: 0;
}

.ai-home-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.88rem;
}

.ai-home-table th,
.ai-home-table td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.ai-home-table th {
    background: rgba(79, 70, 229, 0.15);
    color: var(--text);
}

.ai-home-table--compact td:first-child {
    white-space: nowrap;
    width: 1%;
}

.ai-home-dl {
    margin: 12px 0;
}

.ai-home-dl dt {
    font-weight: 600;
    color: var(--text);
    margin-top: 12px;
}

.ai-home-dl dd {
    margin: 4px 0 0;
    color: var(--text-dim);
    line-height: 1.55;
}

.ai-home-dl code {
    font-size: 0.85em;
}

.ai-home-link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ai-home-link-card {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(30, 40, 64, 0.4);
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.ai-home-link-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.ai-home-link-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

.ai-home-link-card span {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.45;
}

.ai-home-section {
    margin-bottom: 28px;
    padding: 22px 24px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(31, 41, 67, 0.58), rgba(23, 31, 51, 0.45));
    border: 1px solid var(--border);
}

.ai-home-switcher {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    height: auto;
}

.ai-home-tabs {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 14px;
}

.ai-home-tab {
    border: 1px solid var(--border);
    background: rgba(30, 40, 64, 0.45);
    color: var(--text-dim);
    border-radius: 10px;
    min-height: 38px;
    height: auto;
    text-align: left;
    padding: 8px 12px;
    font-size: 0.88rem;
    line-height: 1.25;
    cursor: pointer;
    transition: all .2s ease;
}

.ai-home-tab.is-active {
    color: var(--text);
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(79, 70, 229, 0.24);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.ai-home-panels {
    position: static;
    flex: 1;
    min-width: 0;
}

.ai-home-panel {
    display: none;
    opacity: 1;
    transform: none;
    pointer-events: none;
    overflow: visible;
    padding-right: 0;
}

.ai-home-panel.is-active {
    display: block;
    pointer-events: auto;
}

.ai-home-section h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: var(--accent);
}

.ai-home-section--warn {
    border-color: rgba(251, 146, 60, 0.35);
    background: rgba(120, 53, 15, 0.12);
}

.ai-home-list {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.75;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.ai-home-list li {
    margin-bottom: 8px;
}

.ai-home-intro-video-caption {
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.ai-home-intro-video-wrap {
    margin: 0 0 20px;
    max-width: 720px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(15, 20, 32, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.ai-home-intro-video {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #0b0f18;
}

.ai-home-p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-dim);
    font-size: 0.92rem;
}

.ai-home-model-group {
    margin-top: 14px;
}

.ai-home-model-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.ai-home-model-cat {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    background: rgba(30, 40, 64, 0.45);
    cursor: pointer;
    transition: all .2s ease;
}

.ai-home-model-cat.is-active {
    color: var(--text);
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(79, 70, 229, 0.24);
}

.ai-home-model-group.is-hidden {
    display: none;
}

.ai-home-model-group-title {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

.ai-home-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.ai-home-model-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(19, 27, 46, 0.78), rgba(24, 34, 56, 0.62));
    padding: 14px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ai-home-model-card:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.42);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.ai-home-model-name {
    font-weight: 600;
    margin-bottom: 6px;
}

.ai-home-model-meta {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.55;
}

.ai-home-model-intro {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    min-height: 36px;
}

.ai-home-model-btn {
    display: inline-block;
    text-decoration: none;
}

.upload-login-hint:not(.btn-icon-upload) {
    font-size: 0.85rem;
    display: inline-block;
    padding: 4px 0;
}

@media (max-width: 768px) {
    .ai-home-body .ai-home {
        max-width: 100%;
        min-height: auto;
        overflow: visible;
        padding: 10px 12px 16px;
    }

    .ai-home-switcher {
        height: auto;
        display: block;
    }

    .ai-home-tabs {
        width: auto;
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }

    .ai-home-tab {
        height: 34px;
        padding: 0 10px;
    }

    .ai-home-panels {
        position: static;
    }

    .ai-home-panel,
    .ai-home-panel.is-active {
        position: static;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        overflow: visible;
        padding-right: 0;
        display: none;
    }

    .ai-home-panel.is-active {
        display: block;
    }

    .user-center .uc-frame {
        flex-direction: column;
        padding: 12px 12px 24px;
        gap: 12px;
    }

    .user-center .uc-sidebar {
        width: 100%;
    }

    .user-center .uc-user-card {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 12px;
        padding: 14px;
    }

    .user-center .uc-avatar {
        grid-row: 1 / span 2;
        margin-bottom: 0;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .user-center .uc-user-balance {
        grid-column: 3;
        grid-row: 1 / span 2;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        text-align: right;
    }

    .user-center .uc-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .user-center .uc-nav-item {
        flex: 0 0 auto;
        min-width: 132px;
        padding: 8px 10px;
    }

    .user-center .uc-nav-desc {
        display: none;
    }

    .user-center .uc-sidebar-foot {
        margin-top: 0;
    }

    .user-center .uc-stat-grid {
        grid-template-columns: 1fr;
    }

    .user-center .uc-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-center .uc-grid-2 {
        grid-template-columns: 1fr;
    }

    .user-center .uc-form--grid {
        grid-template-columns: 1fr;
    }

    .user-center .uc-header-sub {
        display: none;
    }

    .user-center .uc-header-actions {
        justify-self: end;
    }

    .user-center .uc-header-chip-label {
        display: none;
    }
}

/* === 纯白背景补充 === */
.top-bar,
.sidebar,
.main,
.model-strip,
.messages,
.composer,
.composer-advanced,
.ai-home-hero,
.ai-home-section,
.ai-home-model-card,
.ai-home-tab,
.ai-home-model-cat,
.profile-card,
.bubble.user,
.bubble.sys,
.bubble-image-card,
.bubble-audio-item,
.bubble-image-actions,
.model-card,
.brand-item,
.history-session-item,
.recharge-dialog,
.login-dialog,
.wxpay-dialog,
.risk-dialog,
.user-menu-dropdown {
    background: #ffffff;
}

.ai-home-hero {
    border-color: rgba(99, 102, 241, 0.18);
}

.bubble.user {
    color: var(--text);
    border: 1px solid rgba(6, 182, 212, 0.35);
    box-shadow: none;
}

.bubble.sys {
    border: 1px dashed rgba(148, 163, 184, 0.45);
    box-shadow: none;
}

.brand-item.active,
.history-session-item.is-active,
.ai-home-tab.is-active,
.ai-home-model-cat.is-active {
    background: #ffffff;
}

.recharge-amount.active,
.login-tab.active {
    background: #ffffff;
}

.user-center .uc-nav,
.user-center .uc-filter-form,
.user-center .uc-table th,
.user-center .uc-table-wrap,
.user-center .uc-panel,
.user-center .uc-stat-card,
.user-center .uc-quick-card,
.user-center .uc-header,
.user-center .uc-nav-item:hover {
    background: #ffffff;
}

body.user-center {
    background: #eef2ff;
    color: var(--text);
}

.top-bar {
    border-bottom: 1px solid #e2e8f0;
}

.sidebar {
    border-right: 1px solid #e2e8f0;
}

.model-strip {
    border-bottom: 1px solid #e2e8f0;
}

.auth-btn {
    color: var(--accent);
    font-weight: 600;
    background: #ffffff;
}

.user-menu-item:hover {
    color: var(--text);
}

.login-row input,
.recharge-input,
.composer-extra-input,
.composer-extra-select,
#inputBox,
.model-strip-select {
    background: #ffffff;
    border-color: var(--input-border);
}

.user-center .uc-header {
    background: #ffffff;
    border-bottom-color: #e2e8f0;
}

.user-center .uc-table tbody tr:hover td {
    background: #ffffff;
}

/* === 白底可读文字（覆盖残留浅色字） === */
.login-title,
.recharge-title,
.wxpay-title,
.risk-title,
.model-card .title,
.register-link {
    color: var(--link);
}

.back-link {
    color: var(--link);
}

.register-link:hover,
.back-link:hover {
    color: var(--link-hover);
}

.messages a {
    color: var(--link);
}

.messages a:hover {
    color: var(--link-hover);
}

.recharge-amount.active,
.login-tab.active {
    color: var(--accent);
}

.composer-extra-input,
.composer-extra-select,
#inputBox,
.recharge-input,
.login-row input {
    color: var(--text);
    background: #ffffff;
}

.user-menu-item {
    color: var(--text-dim);
}

.ai-home-hero-badge {
    color: var(--accent-2);
    background: #ffffff;
}
