/* ============================================
   外贸CEM系统 - 外贸智能获客CRM系统
   现代化暗色主题样式
   ============================================ */

/* ===== CSS 变量 - 暗色主题（默认） ===== */
:root {
    --bg-base: #0a0e1a;
    --bg-sidebar: #0d1220;
    --bg-card: #131829;
    --bg-card-hover: #1a2138;
    --bg-input: #1a2138;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-active: rgba(99, 102, 241, 0.5);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0a0e1a;
    --primary: #6366f1;
    --primary-hover: #5558e3;
    --primary-light: rgba(99, 102, 241, 0.12);
    --primary-glow: rgba(99, 102, 241, 0.4);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);
    --purple: #8b5cf6;
    --purple-light: rgba(139, 92, 246, 0.12);
    --teal: #14b8a6;
    --teal-light: rgba(20, 184, 166, 0.12);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --transition: all 0.2s ease;
    --select-arrow-color: %2394a3b8;
}

/* ===== 亮色主题 ===== */
[data-theme="light"] {
    --bg-base: #f0f2f5;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f7fa;
    --bg-input: #f5f7fa;
    --bg-overlay: rgba(0, 0, 0, 0.3);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-active: rgba(99, 102, 241, 0.5);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --text-inverse: #ffffff;
    --primary: #6366f1;
    --primary-hover: #5558e3;
    --primary-light: rgba(99, 102, 241, 0.08);
    --primary-glow: rgba(99, 102, 241, 0.25);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.08);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.08);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.08);
    --purple: #8b5cf6;
    --purple-light: rgba(139, 92, 246, 0.08);
    --teal: #14b8a6;
    --teal-light: rgba(20, 184, 166, 0.08);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
    --select-arrow-color: %23a0aec0;
}

/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 256px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 100;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span:not(.nav-badge),
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 2px;
}

.nav-group {
    margin-bottom: 20px;
}

.nav-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.nav-badge-orange {
    background: var(--warning-light);
    color: var(--warning);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.user-card:hover {
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.user-plan {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== 顶部栏 ===== */
.topbar {
    height: 60px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
}

.breadcrumb {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    width: 280px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    padding: 9px 0;
    width: 100%;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    transition: var(--transition);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-sidebar);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

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

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

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

.btn-warning:hover {
    filter: brightness(1.1);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

/* ===== 页面容器 ===== */
.page-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.page-container::-webkit-scrollbar {
    width: 6px;
}

.page-container::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

/* ===== 通用组件 ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
}

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

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

.card-body {
    /* 内容区 */
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.purple::before { background: var(--purple); }
.stat-card.teal::before { background: var(--teal); }
.stat-card.danger::before { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.purple .stat-icon { background: var(--purple-light); color: var(--purple); }
.stat-card.teal .stat-icon { background: var(--teal-light); color: var(--teal); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.stat-trend svg {
    width: 14px;
    height: 14px;
}

/* ===== 网格布局 ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
}

/* ===== 表格 ===== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

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

table.data-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data-table td {
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

table.data-table tbody tr {
    transition: var(--transition);
}

table.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

table.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== 徽章/标签 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-teal { background: var(--teal-light); color: var(--teal); }
.badge-gray { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }

/* ===== 状态点 ===== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    margin-right: 6px;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.busy { background: var(--danger); }
.status-dot.away { background: var(--warning); }

/* ===== 进度条 ===== */
.progress {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar.primary { background: var(--primary); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* ===== 头像 ===== */
.avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

.avatar-list {
    display: flex;
}

.avatar-list .avatar {
    margin-left: -8px;
    border: 2px solid var(--bg-card);
}

.avatar-list .avatar:first-child {
    margin-left: 0;
}

/* ===== 输入框 ===== */
.input-group {
    margin-bottom: 16px;
}

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

.input,
.select,
.textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted);
}

.textarea {
    resize: vertical;
    min-height: 80px;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 36px;
    cursor: pointer;
}

[data-theme="light"] .select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ===== 过滤器栏 ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar .select {
    width: auto;
    min-width: 130px;
}

.filter-bar .input {
    width: auto;
    min-width: 200px;
}

/* ===== PWA 移动端适配 ===== */

/* 手机端遮罩层 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}
.mobile-overlay.active { display: block; }

/* 手机端汉堡菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 40px; height: 40px;
    border: none; background: none; cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
}
.mobile-menu-btn span {
    display: block; width: 22px; height: 2px;
    background: var(--text); margin: 5px 0;
    border-radius: 2px; transition: 0.3s;
}

/* 手机端底部导航栏 */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    z-index: 300;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-bottom-nav .mbn-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    padding: 6px 4px;
    color: var(--text-muted);
    text-decoration: none; font-size: 10px;
    cursor: pointer; border: none; background: none;
    min-width: 48px;
}
.mobile-bottom-nav .mbn-item svg {
    width: 22px; height: 22px;
    stroke: var(--text-muted); stroke-width: 2;
    fill: none; transition: 0.2s;
}
.mobile-bottom-nav .mbn-item.active svg { stroke: var(--primary); }
.mobile-bottom-nav .mbn-item.active { color: var(--primary); }

/* 手机端让主内容区有底部安全距离 */
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; flex-direction: column; justify-content: center; }
    .mobile-bottom-nav { display: flex; }
    .topbar { padding-left: 8px; }

    /* 侧边栏改为滑出覆盖 */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0; bottom: 0;
        width: 280px !important;
        z-index: 200;
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open {
        left: 0;
    }

    /* 主内容区域适配底部导航 */
    #mainContent {
        margin-left: 0 !important;
        padding-bottom: 70px !important;
    }

    /* 搜索框 */
    .search-box { display: none; }

    /* 网格全部单列 */
    .grid-2, .grid-3, .grid-4,
    .grid-2-1, .grid-1-2 { grid-template-columns: 1fr !important; }

    /* AI搜索表单单列 */
    .ai-engine-form { grid-template-columns: 1fr !important; }

    /* 统计卡片 */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .stats-grid .stat-card:nth-child(n+5) { grid-column: span 1; }

    /* 表格横向滚动 */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.data-table { min-width: 700px; }

    /* 筛选栏自动换行 */
    .filter-bar { flex-wrap: wrap; gap: 6px; }
    .filter-bar .select, .filter-bar .input { max-width: 100% !important; width: 100% !important; }
    .filter-spacer { display: none; }

    /* 弹窗全屏 */
    .modal-overlay { align-items: flex-end !important; }
    .modal-content {
        width: 100% !important; max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
    }
    .modal-header { padding: 16px 20px 12px !important; }
    .modal-footer { padding: 12px 20px 20px !important; }
    .modal-footer .btn { flex: 1; }

    /* 页面头部 */
    .page-header { flex-direction: column; align-items: flex-start !important; gap: 12px; }
    .page-header .flex { width: 100%; flex-wrap: wrap; }
    .page-header .btn { font-size: 13px; padding: 6px 12px; }

    /* 登录页面 */
    .login-overlay .login-box { margin: 20px; padding: 24px; }
    .login-title { font-size: 24px !important; }

    /* 卡片间距 */
    .card { margin-bottom: 12px; }
    .mb-4 { margin-bottom: 12px !important; }

    /* 渠道网格 */
    .channel-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* 标签页 */
    .subtabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .subtab { white-space: nowrap; padding: 8px 12px !important; font-size: 13px; }

    /* KPI卡片文字 */
    .stat-value { font-size: 20px !important; }
    .stat-label { font-size: 12px !important; }

    /* 输入组间距 */
    .input-group { margin-bottom: 12px; }

    /* Pipeline卡片 */
    .pipeline-column { min-width: 280px; }
    .pipeline-board { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* BI图表 */
    .bi-bar-chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* 极小屏幕 */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .channel-grid { grid-template-columns: 1fr !important; }
    .card-header { flex-direction: column; align-items: flex-start !important; gap: 8px; }
    .card-header .flex { width: 100%; }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: 200px !important; }
    .sidebar.collapsed { width: 64px !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 漏斗 ===== */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.funnel-stage {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.funnel-stage:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.funnel-stage-color {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.funnel-stage-info {
    flex: 1;
}

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

.funnel-stage-count {
    font-size: 12px;
    color: var(--text-muted);
}

.funnel-stage-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.funnel-stage-rate {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.funnel-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    transition: width 0.5s ease;
}

/* ===== 看板列 ===== */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    min-height: 500px;
}

.kanban-column {
    flex: 0 0 300px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-column-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 1px 8px;
    border-radius: var(--radius-full);
}

.kanban-column-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.kanban-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.kanban-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.kanban-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.kanban-card-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

/* ===== 时间线 ===== */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-card);
    z-index: 1;
}

.timeline-dot.primary { background: var(--primary); }
.timeline-dot.success { background: var(--success); }
.timeline-dot.warning { background: var(--warning); }
.timeline-dot.danger { background: var(--danger); }

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 13px;
    color: var(--text-primary);
}

.timeline-content strong {
    color: var(--primary);
}

/* ===== AI 获客引擎特殊样式 ===== */
.ai-engine-panel {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-sidebar) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.ai-engine-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

.ai-engine-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
}

.ai-engine-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    position: relative;
}

.ai-engine-form {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.ai-engine-actions {
    display: flex;
    gap: 12px;
    position: relative;
}

.ai-scan-animation {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    margin-top: 16px;
    position: relative;
}

.ai-scan-animation.active {
    display: flex;
}

.ai-scan-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-scan-text {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

/* ===== 获客渠道卡片 ===== */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.channel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition);
    cursor: pointer;
}

.channel-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.channel-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 18px;
}

.channel-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.channel-stat {
    font-size: 11px;
    color: var(--text-muted);
}

.channel-toggle {
    margin-top: 8px;
}

/* ===== 开关 ===== */
.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    top: 2px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
    background: #fff;
}

/* ===== 线索评分 ===== */
.score-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-track {
    flex: 1;
    height: 6px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    min-width: 60px;
}

.score-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.score-value {
    font-size: 12px;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
}

.score-high { color: var(--success); }
.score-medium { color: var(--warning); }
.score-low { color: var(--text-muted); }

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== Toast 通知 ===== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    border-left: 3px solid var(--primary);
}

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

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.danger .toast-icon { color: var(--danger); }
.toast .toast-icon { color: var(--primary); }

.toast-text {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
}

/* ===== 等级徽章 ===== */
.grade-badge {
    transition: var(--transition);
}
.grade-badge.grade-a { background: rgba(16,185,129,0.15) !important; color: var(--success) !important; }
.grade-badge.grade-b { background: rgba(99,102,241,0.15) !important; color: var(--primary) !important; }
.grade-badge.grade-c { background: rgba(245,158,11,0.15) !important; color: var(--warning) !important; }
.grade-badge.grade-d { background: rgba(100,116,139,0.15) !important; color: var(--text-muted) !important; }

/* ===== 世界地图热区图 ===== */
.world-map-container {
    padding: 12px;
    overflow: hidden;
}
.world-map-svg {
    display: block;
    margin: 0 auto;
}
.world-map-svg .heat-point {
    transition: var(--transition);
}
.world-map-svg .heat-glow {
    animation: heatPulse 2s ease-in-out infinite;
}
.world-map-svg .heat-point:hover circle {
    fill-opacity: 0.5;
}
@keyframes heatPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.3; }
}
.world-map-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.heat-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}
.heat-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ===== 加载动画 ===== */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 品类趋势分析 ===== */
.trend-search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 0;
}

.trend-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    transition: var(--transition);
}

.trend-search-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.hot-keywords-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.hot-keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.hot-keyword-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.hot-keyword-growth {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
}

.hot-keyword-growth.up {
    color: var(--success);
    background: var(--success-light);
}

.hot-keyword-growth.down {
    color: var(--danger);
    background: var(--danger-light);
}

.hot-keyword-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.hot-keyword-row:hover {
    background: var(--bg-card-hover);
}

.hot-keyword-row:last-child {
    border-bottom: none;
}

.hot-keyword-rank {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-top {
    background: var(--warning);
    color: #fff;
}

.rank-normal {
    background: var(--bg-input);
    color: var(--text-muted);
}

.hot-keyword-text {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.hot-keyword-searches {
    font-size: 12px;
    color: var(--text-muted);
}

.hot-keyword-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.hot-keyword-badge.hot {
    background: var(--danger-light);
    color: var(--danger);
}

.hot-keyword-badge.up {
    background: var(--success-light);
    color: var(--success);
}

.hot-keyword-badge.down {
    background: var(--danger-light);
    color: var(--danger);
}

/* 客户挖掘卡片 */
.mining-card {
    transition: var(--transition);
}

.mining-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.mining-score {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.trend-cat-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ===== 标签页 ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== 图表容器 ===== */
.chart-container {
    position: relative;
    height: 280px;
}

.chart-container-sm {
    position: relative;
    height: 200px;
}

/* ===== 列表项 ===== */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-info {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-action {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== 邮件模板 ===== */
.email-template {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.email-template:hover {
    border-color: var(--border-active);
}

.email-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.email-template-subject {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.email-template-preview {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    max-height: 40px;
    overflow: hidden;
}

/* ===== 国家旗帜 (使用emoji) ===== */
.flag {
    font-size: 16px;
    line-height: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -256px;
        top: 0;
        bottom: 0;
        z-index: 200;
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .search-box { width: 160px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .ai-engine-form { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ===== 加载动画 ===== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--primary);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== 脉冲动画 ===== */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ===== 工具类 ===== */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.font-bold { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.hidden { display: none; }

/* ===== 登录页面 ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e1a 0%, #0d1220 50%, #131829 100%);
}

[data-theme="light"] .login-overlay {
    background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf1 50%, #ffffff 100%);
}

.login-overlay::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-overlay::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    position: relative;
    width: 400px;
    max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    justify-content: center;
}

.login-logo svg {
    width: 44px;
    height: 44px;
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-form .input-group {
    margin-bottom: 20px;
}

.login-form .input {
    height: 44px;
    font-size: 14px;
}

.login-form .input-label {
    margin-bottom: 8px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 13px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.login-forgot {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
}

.login-forgot:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    height: 46px;
    font-size: 15px;
    margin-bottom: 20px;
}

.login-register {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.login-register a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-register a:hover {
    text-decoration: underline;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--primary);
}

.login-error {
    display: none;
    padding: 10px 14px;
    background: var(--danger-light);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--danger);
    margin-bottom: 16px;
    align-items: center;
    gap: 8px;
}

.login-error.show {
    display: flex;
}

/* ===== 社媒营销模块 ===== */
.social-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.social-platform-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.social-platform-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.social-platform-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.social-platform-card.fb::before { background: #1877f2; }
.social-platform-card.tt::before { background: #000; }
.social-platform-card.li::before { background: #0a66c2; }
.social-platform-card.ig::before { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-platform-card.yt::before { background: #ff0000; }
.social-platform-card.x::before { background: #000; }

.social-platform-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.social-platform-icon.fb { background: #1877f2; }
.social-platform-icon.tt { background: #000; }
.social-platform-icon.li { background: #0a66c2; }
.social-platform-icon.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-platform-icon.yt { background: #ff0000; }
.social-platform-icon.x { background: #000; }

.social-platform-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.social-platform-stat {
    font-size: 12px;
    color: var(--text-muted);
}

.social-platform-status {
    margin-top: 10px;
}

.social-post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.social-post-card:hover {
    border-color: var(--border-hover);
}

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

.social-post-platform {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.social-post-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 10px;
}

.social-post-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.social-post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.social-post-stat svg {
    width: 14px;
    height: 14px;
}

/* ===== 产品类目模块 ===== */
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.category-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-color-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.category-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.category-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.category-stat {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}

.category-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.category-products {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-product-tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== 主题切换器 ===== */
.theme-switcher {
    display: flex;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px;
}

.theme-option {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-option.active {
    background: var(--primary);
    color: #fff;
}

.theme-option svg {
    width: 14px;
    height: 14px;
}

/* ===== BI图表样式 ===== */
.bi-chart {
    overflow-x: auto;
}

.bi-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 10px 0;
    min-width: 320px;
}

.bi-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    min-width: 36px;
}

.bi-bar-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 100%;
    height: 160px;
    justify-content: center;
}

.bi-bar {
    width: 14px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
    cursor: pointer;
}

.bi-bar:hover {
    opacity: 0.8;
    filter: brightness(1.15);
}

.bi-bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.bi-bar-value {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.bi-pie {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.bi-pie::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}

.filter-spacer {
    flex: 1;
}
