/* ═══════════════════════════════════════ */
/* 用户端样式 v2.1                        */
/* ═══════════════════════════════════════ */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --primary-glow: rgba(99,102,241,.15);
    --bg: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --chat-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

* { margin:0; padding:0; box-sizing:border-box; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ═══ 登录/注册页面 ═══ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px; right: -200px;
    pointer-events: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,.2) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -150px; left: -150px;
    pointer-events: none;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
    position: relative;
    z-index: 1;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -.5px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.auth-card .form-group { margin-bottom: 18px; }

.auth-card label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text);
}

.auth-card input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all .2s;
    font-family: inherit;
    background: #fafbfc;
}

.auth-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #fff;
}

.auth-card .btn {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all .2s;
    letter-spacing: .5px;
}

.auth-card .btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,.4);
}

.auth-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,.5);
}

.auth-card .btn-primary:active { transform: translateY(0); }

.auth-card .link {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-card .link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all .2s;
}

.auth-card .link a:hover { color: var(--primary-hover); }

/* ═══ 主布局 ═══ */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 */
.app-sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: #e0e7ff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 12px rgba(0,0,0,.1);
}

.sidebar-top {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-profile {
    width: 100%;
    padding: 11px 16px;
    background: rgba(255,255,255,.06);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .2s;
    font-family: inherit;
}

.btn-profile .prof-icon { font-size: 16px; }

.btn-profile:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.btn-new-session {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
    font-family: inherit;
}

.btn-new-session:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,.4);
}

.btn-new-session:active { transform: translateY(0); }

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px;
}

.sessions-list::-webkit-scrollbar { width: 4px; }
.sessions-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.empty-sessions {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.empty-sessions .empty-icon { font-size: 32px; margin-bottom: 10px; }
.empty-sessions .empty-sub { font-size: 11px; color: #475569; margin-top: 4px; }

.session-item {
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .15s;
    position: relative;
    color: #94a3b8;
}

.session-item:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.session-item.active {
    background: rgba(99,102,241,.25);
    color: #fff;
}

.session-item .sess-icon { font-size: 14px; flex-shrink: 0; }

.session-item .title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.session-item .del-btn {
    opacity: 0;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all .15s;
    flex-shrink: 0;
    line-height: 1;
}

.session-item:hover .del-btn { opacity: 1; }
.session-item .del-btn:hover { color: #f87171; background: rgba(248,113,113,.15); }

.sidebar-bottom {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-bottom .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.sidebar-bottom .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-bottom .uname { font-weight: 600; font-size: 13px; color: #e2e8f0; }
.sidebar-bottom .ubal { font-size: 11px; color: #94a3b8; }

.btn-logout {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all .2s;
}

.btn-logout:hover {
    color: #f87171;
    background: rgba(248,113,113,.1);
}

/* 聊天区 */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
    min-width: 0;
}

.chat-header {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    gap: 16px;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.chat-title-text {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-rename {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all .2s;
    flex-shrink: 0;
}

.btn-rename:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.chat-header .model-select {
    padding: 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: border-color .2s;
    flex-shrink: 0;
    font-family: inherit;
}

.chat-header .model-select:focus { border-color: var(--primary); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }

.message-wrap {
    max-width: 850px;
    margin: 0 auto;
    padding: 20px 28px;
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.user .message-avatar { background: var(--primary-light); }
.message.assistant .message-avatar { background: #ecfdf5; }

.message-body {
    flex: 1;
    min-width: 0;
}

.message-content {
    line-height: 1.75;
    font-size: 15px;
    word-break: break-word;
}

.message-content p { margin-bottom: 12px; }
.message-content p:last-child { margin-bottom: 0; }

.message-meta-tag {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: #f8fafc;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.error-text { color: #ef4444; }
.muted-text { color: #94a3b8; }
.stop-notice {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* 代码块 */
.message-content pre {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 14px 0;
    font-size: 13.5px;
    line-height: 1.6;
    position: relative;
    border: 1px solid #2d2d44;
}

.message-content pre::-webkit-scrollbar { height: 6px; }
.message-content pre::-webkit-scrollbar-thumb { background: #4a4a6a; border-radius: 3px; }
.message-content pre::-webkit-scrollbar-track { background: transparent; }

.message-content pre::before {
    content: attr(data-lang);
    position: absolute;
    top: 8px; left: 16px;
    font-size: 11px;
    color: #6366f1;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.message-content pre[data-lang] { padding-top: 36px; }

/* 复制按钮 */
.copy-btn {
    position: absolute;
    top: 6px; right: 10px;
    padding: 4px 12px;
    border: 1px solid #4a4a6a;
    background: #2d2d44;
    color: #a5b4fc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all .2s;
    font-family: inherit;
    opacity: 0;
}

.message-content pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: #3b3b5c; color: #c7d2fe; border-color: #6366f1; }

.message-content code {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
    font-size: .9em;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 5px;
    color: #e11d48;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: inherit;
}

/* 列表 */
.message-content ul, .message-content ol {
    margin: 10px 0;
    padding-left: 24px;
}

.message-content li { margin-bottom: 4px; }

/* 引用 */
.message-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 4px 16px;
    color: var(--text-secondary);
    margin: 12px 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
}

/* 表格 */
.message-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.message-content th, .message-content td {
    border: 1px solid var(--border);
    padding: 8px 14px;
    text-align: left;
    font-size: 14px;
}

.message-content th { background: #f8fafc; font-weight: 600; }

/* 标题 */
.message-content h1, .message-content h2, .message-content h3, .message-content h4 {
    margin: 16px 0 8px;
    font-weight: 700;
}

.message-content h1 { font-size: 1.5em; }
.message-content h2 { font-size: 1.3em; }
.message-content h3 { font-size: 1.15em; }
.message-content h4 { font-size: 1.05em; }

/* 水平线 */
.message-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* 输入区 */
.chat-input-area {
    padding: 16px 28px 22px;
    border-top: 1px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}

.chat-input-wrap {
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 6px 8px 6px 18px;
    transition: all .25s;
}

.chat-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #fff;
}

.chat-input-wrap textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 15px;
    line-height: 1.55;
    padding: 10px 0;
    max-height: 160px;
    font-family: inherit;
    color: var(--text);
}

.chat-input-wrap textarea::placeholder { color: #cbd5e1; }

.btn-send {
    width: 42px; height: 42px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
    font-family: inherit;
}

.btn-send:hover { background: var(--primary-hover); transform: scale(1.05); }
.btn-send:active { transform: scale(.95); }
.btn-send:disabled { opacity: .3; cursor: not-allowed; transform: none; }

.btn-stop {
    width: 42px; height: 42px;
    border-radius: 12px;
    border: none;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
    font-family: inherit;
}

.btn-stop:hover { background: #dc2626; transform: scale(1.05); }
.btn-stop:active { transform: scale(.95); }

/* 加载动画 */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 6px 0;
}

.typing-indicator span {
    width: 8px; height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: .18s; }
.typing-indicator span:nth-child(3) { animation-delay: .36s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .3; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* 欢迎页 */
.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome h2 {
    font-size: 30px;
    margin-bottom: 10px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.welcome p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 520px;
    line-height: 1.7;
}

/* 快捷提问 */
.quick-prompts {
    margin-top: 28px;
    width: 100%;
    max-width: 620px;
}

.qp-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.qp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 500px) {
    .qp-grid { grid-template-columns: 1fr; }
}

.qp-item {
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all .2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.qp-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99,102,241,.12);
}

.qp-icon { font-size: 20px; flex-shrink: 0; }

/* 公告 */
.announcement-bar {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    padding: 11px 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid #fcd34d;
    flex-shrink: 0;
}

.announcement-bar .ann-icon { flex-shrink: 0; }

.announcement-bar .close-ann {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all .2s;
    flex-shrink: 0;
}

.announcement-bar .close-ann:hover { background: rgba(0,0,0,.1); }

/* 个人中心面板 */
.profile-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.profile-panel.show { display: flex; }

.profile-card {
    background: #fff;
    border-radius: 20px;
    width: 92%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,.25);
    animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.94) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.profile-card::-webkit-scrollbar { width: 5px; }
.profile-card::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 5px; }

.profile-card .header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 10;
}

.profile-card .header h3 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.modal-close-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    color: var(--text-secondary);
}

.modal-close-btn:hover { background: #e2e8f0; color: var(--text); }

.profile-card .body { padding: 28px; }

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.profile-stat {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid var(--border);
}

.profile-stat .val {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.profile-stat .lbl {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
    font-weight: 500;
}

.profile-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
}

.profile-section h4 {
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
}

.redeem-section {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.redeem-section input {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: all .2s;
    font-family: inherit;
}

.redeem-section input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.stats-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stats-filter .filter-sep { color: #94a3b8; font-size: 13px; }

.stats-chart-wrap {
    height: 220px;
    position: relative;
}

.stats-chart-wrap canvas { width: 100%; height: 100%; }

/* 通用按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    letter-spacing: .2px;
    text-decoration: none;
    font-family: inherit;
    justify-content: center;
}

.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 7px; }

.btn-block { width: 100%; }

.stats-filter .btn-sm.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* 表单控件 */
.form-control {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all .2s;
    background: #fff;
    color: var(--text);
    font-family: inherit;
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* 响应式 - 移动端 */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        z-index: 200;
        transform: translateX(-100%);
        width: 280px;
    }

    .app-sidebar.mobile-open { transform: translateX(0); }

    .chat-header { padding: 12px 16px; }
    .chat-header .model-select { padding: 5px 10px; font-size: 12px; }
    .chat-title-text { max-width: 200px; }
    .message-wrap { padding: 16px; }
    .message-content { font-size: 14px; }
    .chat-input-area { padding: 12px 16px 16px; }
    .profile-card { max-width: 96vw; border-radius: 14px; }
    .profile-stats { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .redeem-section { flex-direction: column; }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
    border-radius: 6px;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
}

.sidebar-overlay.show { display: block; }

/* Toast */
.user-toast {
    pointer-events: none;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}