@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0f1c 0%, #1a1f35 50%, #0f1420 100%);
    color: #e2e8f0;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

#app {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* ===== 毛玻璃效果 ===== */
.glass {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* ===== 顶部导航栏 ===== */
.top-header {
    height: 60px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 100;
}

.top-header .logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-header .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #34d399, #22d3ee);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.top-header .logo-icon i {
    color: #0f172a;
    font-size: 15px;
}

.top-header .logo-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.top-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 9999px;
}

.top-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #34d399, #22d3ee);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
}

.top-header .user-name {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

.top-header .user-level {
    font-size: 11px;
    color: #94a3b8;
}

.top-header .vip-badge {
    padding: 2px 8px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
}

/* ===== 主布局 ===== */
.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ===== 左侧导航栏 ===== */
.sidebar {
    width: 220px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 16px 12px 24px;
}

.sidebar-group-label {
    padding: 0 12px;
    margin-top: 24px;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 1px;
}

.sidebar-group-label:first-child {
    margin-top: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    position: relative;
    text-align: left;
}

.sidebar-item:hover {
    background: rgba(52, 211, 153, 0.05);
    border-left-color: rgba(52, 211, 153, 0.4);
    color: #e2e8f0;
}

.sidebar-item.active {
    background: rgba(52, 211, 153, 0.08);
    border-left-color: #34d399;
    color: #34d399;
}

.sidebar-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-item .item-label {
    flex: 1;
}

.sidebar-item .badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 600;
    line-height: 1.4;
}

.sidebar-item .badge-orange {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.sidebar-item .badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.sidebar-item .badge-green {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* ===== 内容区域 ===== */
.content-area {
    flex: 1;
    overflow: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* ===== 滚动条美化 ===== */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15);
    border-radius: 4px;
}

/* ===== 通用工具类 ===== */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
}

/* ===== 正在开发中 页面 ===== */
.dev-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    background: rgba(15, 23, 42, 0.3);
}

.dev-placeholder .dev-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(34, 211, 238, 0.1));
    border: 1px solid rgba(52, 211, 153, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dev-placeholder .dev-icon-wrap i {
    font-size: 32px;
    color: #34d399;
}

.dev-placeholder .dev-title {
    font-size: 22px;
    font-weight: 700;
    color: #e2e8f0;
}

.dev-placeholder .dev-subtitle {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    max-width: 360px;
    line-height: 1.6;
}

.dev-placeholder .dev-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 9999px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    font-size: 13px;
    color: #34d399;
}

.dev-placeholder .dev-progress i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== 数据指挥中心 ===== */
.dashboard-wrap {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}
.dashboard-wrap::-webkit-scrollbar { width: 6px; }
.dashboard-wrap::-webkit-scrollbar-track { background: transparent; }
.dashboard-wrap::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
}

.dashboard-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.dashboard-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
}
.dashboard-header p {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}
.dashboard-tab-group {
    display: flex;
    gap: 8px;
}
.dashboard-tab {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.dashboard-tab.active {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}
.dashboard-tab:not(.active) {
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
}
.dashboard-tab:not(.active):hover {
    background: rgba(30, 41, 59, 0.6);
}

/* 统计卡片网格 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 10px 40px -10px rgba(52, 211, 153, 0.2);
}
.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.stat-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    font-size: 13px;
}
.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.stat-card-trend.up { color: #34d399; }
.stat-card-trend.down { color: #ef4444; }
.stat-card-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.stat-card-label {
    font-size: 12px;
    color: #64748b;
}

/* 玻璃卡片 */
.glass-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}
/* dash-grid-3 内的卡片内容区自动撑满剩余高度 */
.dash-grid-3 .glass-card .funnel-wrap,
.dash-grid-3 .glass-card #channel-list,
.dash-grid-3 .glass-card #ai-insight-body {
    flex: 1;
}
.glass-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 三列 / 二一 网格 */
.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.dash-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* 漏斗图 */
.funnel-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    padding: 4px 0;
    min-height: 120px;
}
.funnel-bar {
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}
.funnel-bar-leads  { background: linear-gradient(90deg, #3b82f6, #2563eb); width: 100% !important; }
.funnel-bar-private { background: linear-gradient(90deg, #06b6d4, #0891b2); width: 68%; }
.funnel-bar-order   { background: linear-gradient(90deg, #10b981, #059669); width: 42%; }

.funnel-connector {
    width: 2px;
    height: 28px;
    background: linear-gradient(to bottom, rgba(52, 211, 153, 0.5), rgba(34, 211, 238, 0.5));
    margin: 0 auto;
    position: relative;
    flex-shrink: 0;
}
.funnel-connector::after {
    content: attr(data-rate);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
    white-space: nowrap;
}

/* AI洞察内容区 */
#ai-insight-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

/* AI洞察卡片 */
.insight-card {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(34, 211, 238, 0.04));
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}
.insight-card:last-child { margin-bottom: 0; }
.insight-card-warn {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(251, 146, 60, 0.04));
    border-color: rgba(249, 115, 22, 0.2);
}
.insight-card-action {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08), rgba(34, 211, 238, 0.04));
    border-color: rgba(52, 211, 153, 0.2);
}
.insight-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.insight-inner .insight-title {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}
.insight-inner .insight-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

/* 渠道转化对比 */
#channel-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
}
.channel-item {
    margin-bottom: 0;
}
.channel-item-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}
.channel-item-name {
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.channel-item-rate { color: #34d399; font-family: monospace; }
.channel-progress {
    height: 8px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 4px;
    overflow: hidden;
}
.channel-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* 趋势图区域 */
.chart-area {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.chart-area canvas { max-height: 180px; }

/* 快捷操作 */
.quick-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.4);
    color: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.quick-btn:last-child { margin-bottom: 0; }
.quick-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(52, 211, 153, 0.3);
}
.quick-btn:hover .quick-btn-arrow { color: #34d399; }
.quick-btn-arrow { color: #475569; font-size: 12px; transition: color 0.2s; }
