/* ============================================
   帮多多 全局样式 —— 亮色科技感
   ============================================ */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #8B5CF6;
    --accent: #06B6D4;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    --bg-sidebar-hover: #F1F5F9;
    --text: #1E293B;
    --text-light: #64748B;
    --text-sidebar: #64748B;
    --text-sidebar-active: #1E293B;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --sidebar-w: 240px;
    --transition: all 0.2s ease;
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
    --gradient-hero: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-card: linear-gradient(135deg, #818CF8 0%, #A78BFA 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ============================================
   登录/注册页
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -200px; right: -200px;
}
.auth-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    bottom: -150px; left: -100px;
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}
.auth-card h1 {
    text-align: center;
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 14px;
}

/* ============================================
   表单元素
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: #fff;
    color: var(--text);
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--bg); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { background: var(--bg); }

/* ============================================
   主布局
   ============================================ */
.app-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: var(--transition);
}
.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo {
width: 36px; height: 36px;
background: linear-gradient(135deg, var(--primary), var(--secondary));
border-radius: 10px;
display: flex;
align-items: center;
    justify-content: center;
    font-size: 20px;
}
.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}
.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0.5;
    padding: 12px 12px 6px;
    letter-spacing: 1px;
    font-weight: 700;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-sidebar-hover); color: var(--text-sidebar-active); }
.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.nav-item .nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
}

/* 侧边栏底部用户区 */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
    position: relative;
}
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.user-card:hover { background: var(--bg-sidebar-hover); }
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { color: var(--text); font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-credits { color: var(--accent); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.user-credits:hover { text-decoration: underline; }

/* 用户浮层 */
.user-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 12px;
    width: calc(100% - 24px);
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
}
.user-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
    line-height: 1;
}
.user-popover-item i { width: 18px; text-align: center; flex-shrink: 0; }
.user-popover-item:hover { background: var(--bg); }
.user-popover-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-popover-activity {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 24px 32px;
    min-height: 100vh;
}
.page-header {
    margin-bottom: 24px;
}
.page-header h2 { font-size: 24px; font-weight: 700; }
.page-header p { color: var(--text-light); font-size: 14px; margin-top: 4px; }

/* ============================================
   卡片 & 网格
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   Agent 卡片
   ============================================ */
.agent-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.agent-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.agent-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}
.agent-card:hover::before { opacity: 1; }
.agent-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}
.agent-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.agent-desc { color: var(--text-light); font-size: 13px; line-height: 1.5; margin-bottom: 12px; min-height: 40px; }
.agent-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.agent-category {
    background: rgba(99,102,241,0.08);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}
.agent-credits { color: var(--accent); font-weight: 600; }

/* ============================================
   对话界面
   ============================================ */
.chat-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-header-info { display: flex; flex-direction: row; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chat-header-info .agent-icon { width: 40px; height: 40px; font-size: 20px; margin: 0; border-radius: 10px; flex-shrink: 0; }
.chat-title { font-size: 17px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-subtitle { font-size: 12px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.message.assistant .message-avatar { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.message.user .message-avatar { background: var(--accent); }
.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.message.assistant .message-bubble {
    background: #F8F9FA;
    border-top-left-radius: 4px;
}
.message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-top-right-radius: 4px;
}
.message-meta { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.message.assistant .message-meta { text-align: left; }
.message.user .message-meta { text-align: right; }

.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
    transition: var(--transition);
}
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-actions { display: flex; gap: 8px; }
.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-light);
}
.model-selector select { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; }

/* 空对话提示 */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    gap: 12px;
}
.chat-empty .empty-icon { font-size: 64px; opacity: 0.3; }

/* ============================================
   后台管理
   ============================================ */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-light); }
.stat-icon-total { background: rgba(99,102,241,0.1); color: #6366f1; }
.stat-icon-unused { background: rgba(34,197,94,0.1); color: #22c55e; }
.stat-icon-used { background: rgba(59,130,246,0.1); color: #3b82f6; }
.stat-icon-disabled { background: rgba(239,68,68,0.1); color: #ef4444; }
.cardkey-code-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(99,102,241,0.08);
    color: #6366f1;
    font-size: 13px;
    font-family: monospace;
    transition: background 0.2s;
}
.cardkey-code-chip:hover { background: rgba(99,102,241,0.18); }

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.data-table tr:hover td { background: #FAFBFC; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.tag-success { background: rgba(39, 174, 96, 0.1); color: var(--success); }
.tag-danger { background: rgba(99, 102, 241, 0.1); color: var(--danger); }
.tag-warning { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.tag-info { background: rgba(139, 92, 246, 0.1); color: var(--secondary); }
.tag-primary { background: rgba(99, 102, 241, 0.1); color: var(--primary); }

/* ============================================
   通用组件
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-light { color: var(--text-light); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    min-width: 280px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--secondary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.spinner-dark {
    border-color: rgba(99,102,241,0.2);
    border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}
.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: modalOverlayIn .2s ease;
}
@keyframes modalOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    width: 560px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn .25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: #1e293b; }
.modal-close {
    width: 36px; height: 36px; border-radius: 10px;
    border: none; background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #64748b;
    transition: all .2s;
}
.modal-close:hover { background: rgba(99,102,241,0.1); color: var(--primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.modal-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    width: 560px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn .25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.modal-box-lg { width: 760px; }
.modal-lg { width: 720px; }
.modal-xl { width: 900px; }

/* 公告横幅 */
.announcement-banner {
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.announcement-banner.urgent {
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(99,102,241,0.05));
    border-color: rgba(99,102,241,0.2);
    color: var(--danger);
}

/* 图片网格 */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.image-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    aspect-ratio: 1;
    background: var(--bg);
}
.image-item:hover { transform: scale(1.02); box-shadow: var(--shadow-lg); }
.image-item img { width: 100%; height: 100%; object-fit: cover; }

/* 充值套餐 */
.package-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.package-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.package-card.selected { border-color: var(--primary); background: rgba(99,102,241,0.03); }
.package-card .pkg-label {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 2px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.package-card .pkg-amount { font-size: 32px; font-weight: 800; color: var(--primary); margin: 8px 0; }
.package-card .pkg-credits { font-size: 14px; color: var(--text-light); }
.package-card .pkg-bonus { color: var(--success); font-size: 13px; margin-top: 4px; font-weight: 600; }

/* 支付方式卡片 */
.pay-method-card.active { border-color: var(--primary) !important; background: rgba(99,102,241,0.05); }
.pay-method-card:hover { border-color: var(--primary) !important; }

/* ============================================
   V2 新增样式
   ============================================ */

/* 侧边栏滚动条 — 细小，不滚动时隐藏 */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    transition: background 0.3s;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25);
}

/* 导航项缩小 */
.nav-item {
    padding: 7px 12px !important;
    font-size: 13px !important;
    margin-bottom: 1px !important;
    border-radius: 6px !important;
}
.nav-item .nav-icon {
    font-size: 15px !important;
    width: 20px !important;
}
.nav-item .nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-section-title {
    font-size: 10px !important;
    padding: 10px 12px 4px !important;
    letter-spacing: 0.5px !important;
}

/* 角标颜色 */
.nav-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.4;
}
.badge-danger { background: var(--danger); color: #fff; }
.badge-warning { background: var(--warning); color: #8B6914; }
.badge-success { background: var(--success); color: #fff; }
.badge-info { background: var(--secondary); color: #fff; }
.badge-primary { background: var(--primary); color: #fff; }

/* Agent 卡片 Font Awesome 图标 */
.agent-icon-fa {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    color: var(--primary);
    transition: var(--transition);
}
.agent-card:hover .agent-icon-fa {
    transform: scale(1.08) rotate(-3deg);
}
.agent-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.agent-action {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: rgba(99,102,241,0.05);
}

/* 搜索栏 */
.agent-search-bar {
    position: relative;
    max-width: 500px;
}
.agent-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    pointer-events: none;
}
.agent-search-input {
    padding-left: 40px !important;
}

/* 侧边栏广告 */
.sidebar-ads {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
}
.sidebar-ad-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    padding: 4px 0;
    transition: var(--transition);
}
.sidebar-ad-link:hover {
    color: var(--primary-light);
    padding-left: 4px;
}

/* 顶部横幅广告 */
.top-banner-ads { margin-bottom: 16px; }
.top-banner-ad {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}
.top-banner-ad:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.top-banner-img {
    width: 100%;
    max-height: 80px;
    object-fit: cover;
}
.top-banner-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
}

/* 登录页 Logo */
.auth-logo {
    text-align: center;
    font-size: 48px;
    margin-bottom: 8px;
    color: var(--primary);
}

/* 弹窗广告 */
.popup-ad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}
.popup-ad-box {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: popupZoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popupZoom {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.popup-ad-close {
    position: absolute;
    top: 8px; right: 8px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: var(--transition);
}
.popup-ad-close:hover { background: rgba(0,0,0,0.8); transform: rotate(90deg); }
.popup-ad-img {
    display: block;
    max-width: 100%;
    max-height: 400px;
    object-fit: cover;
}
.popup-ad-text {
    padding: 40px;
    text-align: center;
}
.popup-ad-text h3 {
    font-size: 22px;
    color: var(--primary);
}

/* 弹窗广告过渡 */
.popup-fade-enter-active, .popup-fade-leave-active {
    transition: opacity 0.3s ease;
}
.popup-fade-enter-from, .popup-fade-leave-to {
    opacity: 0;
}

/* 图标选择器 */
.icon-picker {
    position: relative;
}
.icon-picker-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
}
.icon-picker-preview:hover { border-color: var(--primary); }
.icon-picker-preview i:first-child {
    font-size: 18px;
    color: var(--primary);
    width: 24px;
    text-align: center;
}
.icon-picker-name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    font-family: monospace;
}
.icon-picker-arrow {
    font-size: 12px;
    color: var(--text-light);
}
.icon-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.icon-picker-search {
    margin: 10px;
    padding: 8px 12px !important;
    font-size: 13px !important;
}
.icon-picker-list {
    overflow-y: auto;
    padding: 0 10px 10px;
}
.icon-picker-cat {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    padding: 8px 4px 4px;
    letter-spacing: 0.5px;
}
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
    margin-bottom: 8px;
}
.icon-picker-item {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text);
    transition: var(--transition);
}
.icon-picker-item:hover { background: rgba(99,102,241,0.1); color: var(--primary); }
.icon-picker-item.active { background: var(--primary); color: #fff; }

/* 图标选择器过渡 */
.dropdown-enter-active, .dropdown-leave-active {
    transition: all 0.2s ease;
}
.dropdown-enter-from, .dropdown-leave-to {
    opacity: 0;
    transform: translateY(-8px);
}

/* 上传区域 */
.upload-area {
    position: relative;
    width: 100%;
    min-height: 120px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}
.upload-area:hover { border-color: var(--primary); background: rgba(99,102,241,0.02); }
.upload-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}
.upload-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
}
.upload-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}
.upload-placeholder span {
    font-size: 13px;
}
.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* 弹窗配置区域 */
.popup-config {
    background: rgba(99,102,241,0.03);
    border: 1px solid rgba(99,102,241,0.1);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

/* 插件卡片 */
.plugin-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: var(--transition);
    border: 2px solid transparent;
}
.plugin-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}
.plugin-card.disabled { opacity: 0.6; }
.plugin-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.plugin-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}
.plugin-info { flex: 1; }
.plugin-name {
    font-size: 15px;
    font-weight: 700;
}
.plugin-version {
    font-size: 11px;
    color: var(--text-light);
    margin-left: 6px;
    font-weight: 400;
}
.plugin-author { font-size: 12px; color: var(--text-light); }
.plugin-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
    min-height: 36px;
}
.plugin-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.plugin-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* 代码块 */
.code-block {
    background: #1E1E2E;
    color: #A9B7C6;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    margin-top: 8px;
}

/* 表格图标 */
.table-icon {
    font-size: 18px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 文字颜色辅助类 */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ============================================
   动画效果
   ============================================ */

/* Toast 滑入 */
.toast-slide-enter-active, .toast-slide-leave-active {
    transition: all 0.3s ease;
}
.toast-slide-enter-from {
    transform: translateX(120%);
    opacity: 0;
}
.toast-slide-leave-to {
    transform: translateX(120%);
    opacity: 0;
}

/* 横幅滑入 */
.banner-slide-enter-active, .banner-slide-leave-active {
    transition: all 0.4s ease;
}
.banner-slide-enter-from {
    transform: translateY(-20px);
    opacity: 0;
}
.banner-slide-leave-to {
    transform: translateY(-20px);
    opacity: 0;
}

/* 下拉展开 */
.slide-down-enter-active, .slide-down-leave-active {
    transition: all 0.3s ease;
    overflow: hidden;
}
.slide-down-enter-from, .slide-down-leave-to {
    max-height: 0;
    opacity: 0;
}
.slide-down-enter-to, .slide-down-leave-from {
    max-height: 2000px;
    opacity: 1;
}

/* Agent 卡片入场动画 */
.agent-card {
    animation: cardFadeIn 0.4s ease backwards;
}
@keyframes cardFadeIn {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 统计卡片入场 */
.stat-card {
    animation: cardFadeIn 0.4s ease backwards;
}

/* 按钮波纹效果 */
.btn {
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}
.btn:active::after {
    width: 200px;
    height: 200px;
}

/* 链接hover动画 */
.nav-item {
    position: relative;
    overflow: hidden;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}
.nav-item:not(.active):hover::before {
    transform: scaleY(1);
}

/* 侧边栏底部用户卡片 */
.user-popover-item.logout-item:hover {
    color: var(--danger) !important;
    background: rgba(99,102,241,0.08) !important;
}

/* 未登录侧边栏底部按钮 */
.sidebar-footer .btn {
    width: 100%;
}

/* 响应式：移动端 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}

/* ================================================
   V3 新增样式：首页、悬浮窗、聊天抽屉、创作信息、人设、案例
   ================================================ */

/* ===== 首页 ===== */
.home-view { max-width: 1200px; margin: 0 auto; }
.hero-section {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
    border-radius: 16px;
    padding: 48px 40px;
    color: #fff;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.hero-title { font-size: 36px; font-weight: 800; margin-bottom: 12px; position: relative; }
.hero-subtitle { font-size: 18px; opacity: 0.9; margin-bottom: 24px; position: relative; }
.hero-actions { display: flex; gap: 12px; justify-content: center; position: relative; }
.hero-actions .btn-outline { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.25); }

.section { margin-bottom: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h2 { font-size: 22px; font-weight: 700; }

.agent-card-mini {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    text-align: center;
}
.agent-card-mini:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); border-color: var(--primary); }
.agent-card-mini .agent-icon-fa { margin: 0 auto 12px; width: 48px; height: 48px; }
.agent-card-mini .agent-name { font-weight: 700; margin-bottom: 6px; }
.agent-card-mini .agent-desc { font-size: 12px; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
}
.feature-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.feature-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 16px; }
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* ===== 案例展示 ===== */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.case-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); transition: var(--transition); }
.case-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
.case-card-image { width: 100%; height: 180px; overflow: hidden; background: var(--bg); }
.case-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.case-card:hover .case-card-image img { transform: scale(1.05); }
.case-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--text-lighter); }
.case-card-body { padding: 16px; }
.case-card-title { font-weight: 700; margin-bottom: 6px; }
.case-card-desc { font-size: 13px; color: var(--text-light); line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== 全局右侧悬浮窗 ===== */
.floating-panel { position: fixed; right: 20px; bottom: 80px; z-index: 900; }
.floating-panel-items { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.fp-item {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
}
.fp-item:hover { background: var(--primary); color: #fff; transform: scale(1.08); }
.fp-item-top { background: var(--primary); color: #fff; }
.floating-panel-items.expanded .fp-item {
    width: auto;
    padding: 0 16px;
    border-radius: 22px;
    gap: 8px;
}
.fp-label { font-size: 13px; font-weight: 500; }
.fp-popup {
    position: absolute;
    right: 56px;
    bottom: 0;
    width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 10;
}
.fp-popup-wide { width: 320px; }
.fp-popup-title { font-weight: 700; margin-bottom: 12px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.fp-share-buttons { display: flex; flex-direction: column; gap: 8px; }
.fp-share-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
}
.fp-share-btn:hover { background: var(--bg); border-color: var(--primary); }
.fp-textarea { resize: vertical; }
.fp-tutorial-list { display: flex; flex-direction: column; gap: 12px; }
.fp-tutorial-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); line-height: 1.5; }
.fp-step { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.fp-service-info { display: flex; flex-direction: column; gap: 10px; }
.fp-service-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.fp-success { text-align: center; padding: 20px; color: var(--success); font-size: 16px; }
.fp-success i { font-size: 36px; margin-bottom: 8px; display: block; }

.slide-left-enter-active, .slide-left-leave-active { transition: all 0.25s ease; }
.slide-left-enter-from, .slide-left-leave-to { opacity: 0; transform: translateX(20px); }
.fade-enter-active, .fade-leave-active { transition: opacity 0.25s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ===== 聊天右侧抽屉 ===== */
.chat-layout.has-drawer { padding-right: 0; }
.chat-layout { position: relative; }
.chat-main { width: 100%; transition: padding 0.3s; }
.has-drawer .chat-main { padding-right: 360px; }
.chat-drawer {
    position: absolute;
    top: 0; right: 0;
    width: 340px;
    height: 100%;
    background: #fff;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: -4px 0 16px rgba(0,0,0,0.06);
}
.drawer-header { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); gap: 8px; }
.drawer-tabs { display: flex; gap: 4px; flex: 1; }
.drawer-tab {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    display: flex; align-items: center; gap: 6px;
}
.drawer-tab.active { background: var(--primary); color: #fff; }
.drawer-tab:hover:not(.active) { background: var(--bg); }
.drawer-close { flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.drawer-selected-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: rgba(39,174,96,0.08);
    border: 1px solid rgba(39,174,96,0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #27AE60;
    font-weight: 500;
}

.drawer-slide-enter-active, .drawer-slide-leave-active { transition: all 0.3s ease; }
.drawer-slide-enter-from, .drawer-slide-leave-to { opacity: 0; transform: translateX(20px); }

.chat-header .btn.active { background: var(--primary); color: #fff; }
.chat-context-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 6px;
}
.chat-context-tag i.fa-xmark { cursor: pointer; opacity: 0.6; }
.chat-context-tag i.fa-xmark:hover { opacity: 1; }
.chat-context-banner {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.15);
    border-radius: 8px;
    text-align: left;
    max-width: 400px;
}
.chat-context-banner > div { font-size: 13px; color: var(--primary); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }

/* ===== 生成模式布局（文案类 Agent） ===== */
.generate-layout {
    display: flex;
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-height: calc(100vh - 120px);
}
.generate-main {
    width: 100%;
    transition: padding 0.3s;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
}
.generate-layout.has-drawer .generate-main { padding-right: 408px; }

/* 顶部大标题区 */
.generate-hero {
    text-align: center;
    margin-bottom: 24px;
}
.generate-hero-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 6px;
}
.generate-hero-icon {
    width: 48px; height: 48px;
    flex-shrink: 0;
    margin: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.generate-hero-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: 0.5px;
    text-align: left;
}
.generate-hero-desc {
    font-size: 14px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.generate-hero-tags {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 输入区 */
.generate-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.generate-textarea {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    padding: 24px;
    font-size: 15px;
    line-height: 1.8;
    resize: none;
    font-family: inherit;
    color: var(--text);
    min-height: 320px;
}
.generate-textarea:focus { box-shadow: inset 0 0 0 2px rgba(99,102,241,0.1); }
.generate-textarea:disabled { background: #fafafa; cursor: not-allowed; }
.generate-textarea::placeholder { color: #94a3b8; }

.generate-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: #fafafa;
    flex-shrink: 0;
}
.generate-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}
.generate-model-select {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}
.generate-credits {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}
.generate-credits i { color: var(--warning); }
.generate-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.generate-btn {
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
}
.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 聊天底部快捷模板栏 ===== */
.chat-template-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 12px;
    flex-wrap: wrap;
}
.chat-template-label {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.chat-template-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.chat-template-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.04);
}
.chat-template-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.chat-template-chip .fa-xmark { opacity: 0.6; }
.chat-template-chip .fa-xmark:hover { opacity: 1; }
.chat-template-empty {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.5;
    font-style: italic;
}

/* ===== 聊天界面创作小贴士 ===== */
.chat-tip-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.04));
    border: 1px solid rgba(99,102,241,0.15);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    width: 100%;
}
.chat-tip-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(99,102,241,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 16px;
}
.chat-tip-body { flex: 1; }
.chat-tip-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.chat-tip-text {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.7;
    white-space: pre-line;
}

/* ===== Agent 弹窗中的模板管理按钮 ===== */
.agent-template-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed var(--border);
}
.agent-template-section .section-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-template-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    background: rgba(99,102,241,0.04);
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}
.agent-template-btn:hover {
    background: var(--primary);
    color: #fff;
}
.agent-template-count {
    font-size: 12px;
    color: var(--text-light);
    margin-left: 8px;
}

/* ===== 创作信息卡片 ===== */
.ci-list { display: flex; flex-direction: column; gap: 12px; }
.ci-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; transition: var(--transition); }
.ci-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.ci-card.default { border-color: var(--primary); background: rgba(99,102,241,0.02); }
.ci-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ci-name { font-weight: 700; font-size: 14px; }
.ci-card-body { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ci-field { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.ci-field i { width: 14px; text-align: center; color: var(--primary); opacity: 0.7; }
.ci-card-actions { display: flex; gap: 6px; }

/* ===== 人设卡片 ===== */
.persona-list { display: flex; flex-direction: column; gap: 12px; }
.persona-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; transition: var(--transition); }
.persona-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.persona-card.default { border-color: var(--primary); background: rgba(99,102,241,0.02); }
.persona-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.persona-avatar {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.persona-avatar.blogger { background: rgba(99,102,241,0.1); color: var(--primary); }
.persona-avatar.merchant { background: rgba(245,158,11,0.15); color: #F59E0B; }
.persona-info { flex: 1; }
.persona-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.persona-role { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.persona-card-body { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.persona-field { font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 6px; }
.persona-field i { width: 14px; text-align: center; color: var(--primary); opacity: 0.7; }
.persona-card-actions { display: flex; gap: 6px; }

/* ===== 个人中心 Tabs ===== */
.profile-tabs {
    display: flex; gap: 4px; margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    flex-wrap: wrap;
}
.profile-tab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
    line-height: 1.4;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== 快捷提示词 ===== */
.quick-prompts-bar {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    padding: 10px 24px 12px;
    border-top: 1px dashed var(--border);
    background: #fafbfc;
}
.generate-input-area .quick-prompts-bar {
    flex-shrink: 0;
    margin-top: 0;
}
.chat-input-area .quick-prompts-bar {
    padding: 8px 0 0;
    margin-top: 8px;
    border-top: none;
    background: transparent;
}
.quick-prompts-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.quick-prompts-label i { color: var(--warning); }
.quick-prompt-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #f8f9ff;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.5;
    flex-shrink: 0;
}
.quick-prompt-chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== 聊天头部优化 ===== */
.chat-header {
    padding: 12px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-header-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.chat-header-info .agent-icon-fa {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    font-size: 18px !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
}
.chat-header-info > div:last-child {
    min-width: 0;
    flex: 1;
}
.chat-header-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.chat-title {
    font-size: 17px !important;
    font-weight: 700 !important;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-subtitle {
    font-size: 12px !important;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100% !important;
}

/* ===== 图生图上传区域 ===== */
.img2img-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}
.img2img-upload-zone:hover { border-color: var(--primary); background: rgba(99,102,241,0.02); }
.img2img-upload-zone.uploading { opacity: 0.6; pointer-events: none; }
.img2img-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
}
.img2img-upload-label i { font-size: 36px; color: var(--primary); opacity: 0.5; }
.img2img-preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 300px;
}
.img2img-preview img { width: 100%; display: block; border-radius: var(--radius); }
.img2img-clear {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.img2img-clear:hover { background: rgba(0,0,0,0.8); }

/* ==================== 页面切换动画 ==================== */
.fade-slide-enter-active {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.fade-slide-leave-active {
    transition: opacity 0.15s ease;
}
.fade-slide-enter-from {
    opacity: 0;
    transform: translateY(8px);
}
.fade-slide-leave-to {
    opacity: 0;
}

/* keep-alive 激活时的微动画 */
.main-content > * {
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ================================================
   首页增强样式
   ================================================ */

/* 数据统计条 */
.home-stats-bar {
    display: flex;
    justify-content: space-around;
    background: #fff;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.home-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    font-weight: 600;
}
.home-stat-item i {
    font-size: 20px;
    color: var(--primary);
}

/* 分类筛选 */
.home-cat-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}
.home-cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.home-cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.04);
}
.home-cat-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

/* 分类分组区块 */
.home-cat-section {
    margin-bottom: 28px;
}
.home-cat-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.home-cat-title i {
    color: var(--primary);
}
.home-cat-count {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 底部引导 */
.home-cta {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: #fff;
    margin-top: 40px;
}
.home-cta h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
}
.home-cta p {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 20px;
}
.home-cta .btn-primary {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.home-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ================================================
   帮助文档页面样式
   ================================================ */
.help-view { max-width: 1100px; margin: 0 auto; }
.help-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 32px 0;
}
.help-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}
.help-header h1 i { color: var(--primary); }
.help-header p { color: var(--text-light); font-size: 15px; }

.help-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.help-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-sm);
}
.help-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
    transition: var(--transition);
}
.help-nav-item:hover { background: var(--bg); color: var(--text); }
.help-nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.help-nav-item i { width: 18px; text-align: center; }

.help-content {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.help-section h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.help-section h2 i { color: var(--primary); }
.help-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 8px;
    color: var(--primary);
}
.help-section p {
    font-size: 14px;
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 8px;
}
.help-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 16px;
}
.help-list li {
    font-size: 14px;
    color: var(--text);
    line-height: 2;
    padding-left: 4px;
}
.help-list li i { margin-right: 6px; }

/* 步骤 */
.help-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(99,102,241,0.03);
    border-radius: 10px;
    border-left: 3px solid var(--primary);
}
.help-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.help-step h3 { margin: 0 0 4px; font-size: 15px; }
.help-step p { margin: 0; font-size: 13px; color: var(--text-light); }

/* 提示框 */
.help-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(243,156,18,0.1);
    border: 1px solid rgba(243,156,18,0.3);
    border-radius: 10px;
    margin-top: 20px;
    font-size: 14px;
    color: #8B6914;
}
.help-note i { font-size: 18px; color: var(--warning); }

/* FAQ */
.help-faq-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.help-faq-item:last-child { border-bottom: none; }
.help-faq-item h3 {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 6px;
}
.help-faq-item p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
}

/* 底部联系 */
.help-contact {
    text-align: center;
    padding: 24px 0 8px;
    margin-top: 20px;
    border-top: 2px dashed var(--border);
    color: var(--text-light);
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 900px) {
    .help-sidebar { display: none; }
    .help-layout { display: block; }
    .home-stats-bar { flex-wrap: wrap; gap: 12px; justify-content: center; }
    .generate-split { flex-direction: column !important; }
    .generate-form-side, .generate-result-side { width: 100% !important; }
}

/* ===== 生成模式 — 双栏布局 ===== */
.generate-split {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}
.generate-form-side {
    width: 420px;
    flex-shrink: 0;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}
.generate-result-side {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.generate-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
    flex-shrink: 0;
}
.generate-result-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.generate-result-title i { color: var(--primary); }
.generate-result-tools {
    display: flex;
    gap: 6px;
}
.generate-result-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.generate-result-textarea {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    padding: 24px;
    font-size: 15px;
    line-height: 1.8;
    resize: none;
    font-family: inherit;
    color: var(--text);
    background: #fff;
}
.generate-result-textarea:focus { box-shadow: inset 0 0 0 2px rgba(99,102,241,0.08); }
.generate-result-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    gap: 8px;
}
.generate-result-empty i {
    font-size: 48px;
    color: var(--border);
}
.generate-result-empty p {
    font-size: 15px;
    margin: 0;
}
.generate-result-empty-sub {
    font-size: 13px !important;
    color: var(--text-light);
    opacity: 0.6;
}
.generate-result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-light);
}

/* ===== 生成模式 — 表单 ===== */
.gen-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.gen-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gen-form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
}
.gen-form-label::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}
.gen-form-input,
.gen-form-select,
.gen-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    outline: none;
}
.gen-form-input:focus,
.gen-form-select:focus,
.gen-form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.gen-form-textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.6;
}
.gen-form-input::placeholder,
.gen-form-textarea::placeholder {
    color: #94a3b8;
}

/* ===== 小贴士警告 ===== */
.chat-tip-warn {
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: #8B6914;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-tip-warn i { color: var(--warning); }

/* ===== 批量模型绑定管理 ===== */
.batch-binding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.batch-binding-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.batch-binding-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.batch-binding-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}
.batch-binding-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #fafbfc;
}
.batch-agent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    transition: var(--transition);
}
.batch-agent-row:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}
.batch-agent-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.batch-agent-info {
    flex: 1;
    min-width: 0;
}
.batch-agent-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.batch-agent-cat {
    font-size: 12px;
    color: var(--text-light);
}
.batch-agent-models {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.batch-model-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: #f8f9ff;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}
.batch-model-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.batch-model-chip:hover {
    transform: translateY(-1px);
}
.batch-binding-summary {
    padding: 12px 16px;
    background: rgba(99,102,241,0.05);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.batch-binding-summary i { color: var(--primary); }

/* ================================================
   首页增强 — Hero 装饰与统计
   ================================================ */
.hero-decoration {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: heroFloat 6s ease-in-out infinite;
}
.hero-orb-1 {
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.4);
    top: -60px; right: 10%;
    animation-delay: 0s;
}
.hero-orb-2 {
    width: 150px; height: 150px;
    background: rgba(255,255,255,0.3);
    bottom: -40px; left: 15%;
    animation-delay: 2s;
}
.hero-orb-3 {
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.2);
    top: 30%; right: 30%;
    animation-delay: 4s;
}
@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -20px) scale(1.1); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    backdrop-filter: blur(4px);
}
.hero-bottom-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    position: relative;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-stat-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.hero-stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}
.hero-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.3);
}

/* ================================================
   首页增强 — 三步引导
   ================================================ */
.home-steps {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.home-step {
    flex: 1;
    text-align: center;
    padding: 28px 20px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}
.home-step:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-2px);
}
.home-step-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}
.home-step-num {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.home-step h3 {
    font-size: 16px;
    margin-bottom: 6px;
}
.home-step p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}
.home-step-arrow {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--text-lighter, #ccc);
    font-size: 20px;
}

/* ================================================
   首页增强 — 分类筛选计数
   ================================================ */
.home-cat-chip-count {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.home-cat-chip.active .home-cat-chip-count {
    background: rgba(255,255,255,0.25);
}

/* ================================================
   首页增强 — 分类标题图标
   ================================================ */
.home-cat-title-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

/* ================================================
   首页增强 — Agent 卡片 Mini 新布局
   ================================================ */
.agent-card-mini {
    position: relative;
    overflow: hidden;
    animation: cardFadeInUp 0.4s ease backwards;
}
@keyframes cardFadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.agent-card-mini-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}
.agent-card-mini-top .agent-icon-fa {
    margin: 0;
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.agent-card-mini .agent-name {
    text-align: left;
    padding-right: 4px;
}
.agent-card-mini .agent-desc {
    text-align: left;
    margin-bottom: 10px;
}
.agent-card-mini-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.agent-card-mini-cat {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 3px;
}
.agent-card-mini-credits {
    font-size: 11px;
    color: var(--danger);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ================================================
   智能体广场增强
   ================================================ */
.agents-banner {
    position: relative;
    border-radius: 16px;
    padding: 40px 32px;
    margin-bottom: 24px;
    overflow: hidden;
    color: #fff;
}
.agents-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
}
.agents-banner-bg::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.agents-banner-bg::after {
    content: '';
    position: absolute;
    bottom: -40%; left: -10%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}
.agents-banner-content {
    position: relative;
    z-index: 1;
}
.agents-banner h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}
.agents-banner h1 i {
    margin-right: 8px;
}
.agents-banner p {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 16px;
}
.agents-banner-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.agents-banner-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    background: rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.agents-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.agents-cat-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.agents-cat-nav-item:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.agents-cat-nav-count {
    display: inline-block;
    padding: 0 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 10px;
    font-size: 11px;
}
.agents-cat-nav-item:hover .agents-cat-nav-count {
    background: rgba(255,255,255,0.25);
}

.agents-cat-block {
    margin-bottom: 36px;
    scroll-margin-top: 80px;
}
.agents-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.agents-cat-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.agents-cat-header h3 i {
    color: var(--primary);
    font-size: 14px;
}
.agents-cat-badge {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* ================================================
   响应式
   ================================================ */
@media (max-width: 768px) {
    .home-steps { flex-direction: column; gap: 12px; }
    .home-step-arrow { display: none; }
    .hero-bottom-stats { gap: 16px; }
    .hero-stat-num { font-size: 22px; }
    .agents-banner { padding: 28px 20px; }
    .agents-banner h1 { font-size: 22px; }
}

/* ================================================
   智能工具箱 (zntool)
   ================================================ */
.zntool-page { max-width: 1200px; margin: 0 auto; }
.zntool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.zntool-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.25s;
    border: 2px solid transparent;
    position: relative;
}
.zntool-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--primary);
}
.zntool-card-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.zntool-card-info { flex: 1; min-width: 0; }
.zntool-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.zntool-card-desc { font-size: 13px; color: var(--text-light); }
.zntool-card-badge {
    position: absolute; top: 10px; right: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.zntool-detail-header {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.zntool-detail-header h2 { margin: 0; font-size: 20px; }
.zntool-credit-hint {
    margin-left: auto;
    font-size: 13px; color: var(--text-light);
    background: var(--bg-secondary);
    padding: 4px 12px; border-radius: 8px;
}
.zntool-ai-panel, .zntool-local-tool { max-width: 800px; }
.zntool-form { margin-bottom: 24px; }
.zntool-loading {
    text-align: center; padding: 40px;
    color: var(--text-light);
}
.zntool-loading .spinner { margin: 0 auto 12px; }
.zntool-result {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-top: 24px;
}
.zntool-result-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.zntool-result-header h3 { margin: 0; font-size: 16px; }
.zntool-result-content {
    line-height: 1.8;
    font-size: 14px;
}
.zntool-result-content h1, .zntool-result-content h2, .zntool-result-content h3 {
    margin: 16px 0 8px;
}
.zntool-result-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.zntool-result-content th, .zntool-result-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}
.zntool-result-content th { background: var(--bg-secondary); font-weight: 700; }
.zntool-result-content ul, .zntool-result-content ol { padding-left: 20px; margin: 8px 0; }
.zntool-result-content code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.zntool-result-content pre { background: var(--bg-secondary); padding: 12px; border-radius: 8px; overflow-x: auto; }
.zntool-list-item { margin-bottom: 16px; }
.zntool-crop-info { background: var(--bg-secondary); padding: 16px; border-radius: 8px; }
.zntool-preview { margin-top: 16px; }
.zntool-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.zntool-image-grid-item {
    text-align: center;
}
.zntool-image-grid-item img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 4px;
}
.zntool-image-grid-item span {
    font-size: 12px; color: var(--text-light);
    word-break: break-all;
}
.zntool-placeholder {
    text-align: center; padding: 60px 20px;
    color: var(--text-light);
}
.zntool-placeholder p { margin-top: 16px; font-size: 15px; }

/* ================================================
   底部版权 (app-footer)
   ================================================ */
.app-footer {
    margin-top: auto;
    padding: 32px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #cbd5e1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.app-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    text-align: center;
}
.app-footer-copyright {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
}
.app-footer-icp {
    font-size: 13px;
}
.app-footer-icp a {
    color: #818cf8;
    text-decoration: none;
    transition: var(--transition);
}
.app-footer-icp a:hover {
    color: #a78bfa;
    text-decoration: underline;
}

/* 侧边栏 mini footer */
.app-footer-mini {
    margin-top: auto;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.app-footer-mini .app-footer-copyright {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}
.app-footer-icp-link {
    display: inline-block;
    font-size: 11px;
    color: var(--text-light);
    text-decoration: none;
    margin-top: 2px;
    transition: var(--transition);
}
.app-footer-icp-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ================================================
   导航管理拖拽排序 (nav-drag)
   ================================================ */
.nav-drag-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.nav-section-drag {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
}
.nav-section-drag:hover {
    box-shadow: var(--shadow);
}
/* 拖拽悬停高亮 */
.nav-section-drag:active,
.nav-section-drag.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}
.nav-section-drag-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.06));
    border-bottom: 1px solid var(--border);
}
.nav-section-drag-header > i {
    color: var(--text-light);
    font-size: 14px;
    cursor: grab;
}
.nav-section-drag-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}
.nav-section-drag-count {
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}
.nav-section-drag-list {
    padding: 8px;
    min-height: 50px;
}
.nav-item-drag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid transparent;
    transition: all 0.18s ease;
    cursor: grab;
    margin-bottom: 6px;
}
.nav-item-drag:last-child {
    margin-bottom: 0;
}
.nav-item-drag:hover {
    background: #fff;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.nav-item-drag.dragging {
    opacity: 0.5;
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
    border-style: dashed;
    cursor: grabbing;
}
.nav-item-drag-handle {
    color: var(--text-light);
    cursor: grab;
    font-size: 14px;
    flex-shrink: 0;
}
.nav-item-drag-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}
.nav-item-drag-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 80px;
}
.nav-item-drag-path {
    flex: 1;
    font-size: 12px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-item-drag-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.nav-section-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 13px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
}

/* ================================================
   补充: 会员/卡密/充值 相关样式
   ================================================ */
.membership-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.membership-card.featured {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}
.membership-card.featured::before {
    content: '推荐';
    position: absolute;
    top: 12px; right: -28px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 32px;
    transform: rotate(35deg);
}
.membership-card-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0;
}
.membership-card-price .unit {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-light);
}
.membership-card-features {
    list-style: none;
    margin: 16px 0;
    padding: 0;
}
.membership-card-features li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.membership-card-features li i {
    color: var(--success);
    font-size: 12px;
}
.cardkey-input-group {
    display: flex;
    gap: 10px;
    max-width: 500px;
}
.cardkey-input-group .form-control {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}
