/* 虹蚁天眼 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --gold: #f5a623;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); overflow: hidden; height: 100vh; }
#app { display: flex; height: 100vh; }

/* 侧边栏 */
.sidebar { width: 240px; background: var(--sidebar-bg); display: flex; flex-direction: column; flex-shrink: 0; }
.logo { padding: 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo-icon { font-size: 28px; }
.logo-text h1 { color: #fff; font-size: 18px; font-weight: 600; }
.logo-text span { color: var(--sidebar-text); font-size: 11px; }
.nav-menu { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--sidebar-text); text-decoration: none; border-radius: 8px; margin-bottom: 4px; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.user-detail { display: flex; flex-direction: column; }
.user-name { color: #fff; font-size: 13px; }
.user-role { color: var(--sidebar-text); font-size: 11px; }

/* 主内容 */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 60px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.topbar-left h2 { font-size: 18px; font-weight: 600; }
.update-time { font-size: 12px; color: var(--text-secondary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.search-box { position: relative; }
.search-box input { width: 260px; padding: 8px 36px 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; outline: none; transition: border-color 0.2s; }
.search-box input:focus { border-color: var(--primary); }
.search-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.notifications { position: relative; cursor: pointer; font-size: 20px; }
.notif-badge { position: absolute; top: -4px; right: -6px; background: var(--danger); color: #fff; font-size: 10px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.page-container { flex: 1; overflow-y: auto; padding: 24px; }

/* 通用卡片 */
.card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 12px; color: var(--primary); cursor: pointer; text-decoration: none; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--gold); }
.stat-card.red::before { background: var(--danger); }
.stat-card.purple::before { background: #8b5cf6; }
.stat-card.cyan::before { background: #06b6d4; }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-change { font-size: 11px; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* 网格布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 24px; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; background: #f8fafc; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: #f8fafc; }
.data-table .score { font-weight: 700; }
.data-table .score.high { color: var(--danger); }
.data-table .score.mid { color: var(--gold); }
.data-table .score.low { color: var(--success); }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tag-red { background: #fef2f2; color: #dc2626; }
.tag-orange { background: #fff7ed; color: #ea580c; }
.tag-blue { background: #eff6ff; color: #2563eb; }
.tag-green { background: #f0fdf4; color: #16a34a; }
.tag-purple { background: #faf5ff; color: #9333ea; }
.tag-gray { background: #f3f4f6; color: #4b5563; }
.tag-gold { background: #fffbeb; color: #d97706; }

/* 按钮 */
.btn { padding: 6px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; border: none; font-weight: 500; transition: all 0.2s; display: inline-flex; align-items: center; gap: 4px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* 线索列表项 */
.lead-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 14px; transition: background 0.2s; cursor: pointer; }
.lead-item:hover { background: #f8fafc; }
.lead-score { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0; }
.lead-score.s-high { background: linear-gradient(135deg, #ef4444, #dc2626); }
.lead-score.s-mid { background: linear-gradient(135deg, #f59e0b, #d97706); }
.lead-score.s-low { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.lead-info { flex: 1; min-width: 0; }
.lead-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 12px; flex-wrap: wrap; }
.lead-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 企业卡片 */
.enterprise-card { background: var(--card); border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.enterprise-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(26,115,232,0.15); transform: translateY(-2px); }
.enterprise-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.enterprise-name { font-size: 14px; font-weight: 600; }
.enterprise-type { font-size: 11px; }
.enterprise-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.enterprise-footer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }

/* 图谱容器 */
.graph-container { width: 100%; height: calc(100vh - 200px); min-height: 500px; border-radius: 12px; overflow: hidden; }

/* 时间线 */
.timeline { padding-left: 20px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 20px 20px; }
.timeline-item::before { content: ''; position: absolute; left: -27px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary); }
.timeline-item.completed::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.current::before { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); animation: pulse 2s infinite; }
.timeline-item.future::before { background: #d1d5db; box-shadow: 0 0 0 2px #d1d5db; }
.timeline-date { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.timeline-content { font-size: 13px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* 筛选栏 */
.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-select { padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; background: #fff; cursor: pointer; }
.filter-select:focus { border-color: var(--primary); }

/* 架构图 */
.arch-container { padding: 20px; }
.arch-layer { margin-bottom: 20px; border-radius: 12px; padding: 16px 20px; position: relative; }
.arch-layer-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.arch-modules { display: flex; gap: 10px; flex-wrap: wrap; }
.arch-module { padding: 10px 16px; border-radius: 8px; font-size: 12px; font-weight: 500; text-align: center; min-width: 100px; }
.layer-client { background: #eff6ff; border: 1px solid #bfdbfe; }
.layer-client .arch-module { background: #dbeafe; color: #1e40af; }
.layer-app { background: #f0fdf4; border: 1px solid #bbf7d0; }
.layer-app .arch-module { background: #dcfce7; color: #166534; }
.layer-ai { background: #faf5ff; border: 1px solid #e9d5ff; }
.layer-ai .arch-module { background: #f3e8ff; color: #6b21a8; }
.layer-data { background: #fff7ed; border: 1px solid #fed7aa; }
.layer-data .arch-module { background: #ffedd5; color: #9a3412; }
.layer-collect { background: #f0fdfa; border: 1px solid #99f6e4; }
.layer-collect .arch-module { background: #ccfbf1; color: #115e59; }

/* Tab切换 */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 20px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text-secondary); transition: all 0.2s; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab:hover { color: var(--primary); }

/* 联系人卡片 */
.contact-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.contact-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #fff; flex-shrink: 0; }
.contact-info { flex: 1; }
.contact-name { font-size: 13px; font-weight: 500; }
.contact-title { font-size: 11px; color: var(--text-secondary); }
.contact-phone { font-size: 12px; color: var(--primary); }

/* 进度条 */
.progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* 响应式 */
@media (max-width: 1200px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) { .sidebar { width: 60px; } .logo-text, .nav-item span:not(.nav-icon), .user-detail { display: none; } .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; } }

/* 动画 */
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* AI推荐卡 */
.ai-recommend { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; padding: 20px; color: #fff; margin-bottom: 20px; }
.ai-recommend h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.ai-recommend-item { background: rgba(255,255,255,0.15); border-radius: 8px; padding: 12px; margin-bottom: 8px; backdrop-filter: blur(4px); }
.ai-recommend-item .title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.ai-recommend-item .desc { font-size: 11px; opacity: 0.85; }

/* 产业带地图 */
.map-placeholder { width: 100%; height: 300px; background: linear-gradient(135deg, #e0f2fe, #f0f9ff); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 13px; }

/* 漏斗 */
.funnel-step { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.funnel-bar { height: 32px; border-radius: 6px; display: flex; align-items: center; padding: 0 12px; color: #fff; font-size: 12px; font-weight: 500; transition: width 0.5s; }
.funnel-label { font-size: 12px; color: var(--text-secondary); min-width: 60px; }
.funnel-value { font-size: 13px; font-weight: 600; min-width: 40px; }

/* ===== 移动端适配增强 ===== */
@media (max-width: 768px) {
    .topbar { padding: 0 12px; height: 52px; }
    .topbar-left h2 { font-size: 16px; }
    .update-time { display: none; }
    .search-box input { width: 130px; }
    .page-container { padding: 14px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }
    .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
    .card { padding: 14px; }
    /* 表格横向滚动 */
    .card { overflow-x: auto; }
    .data-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .filter-bar { gap: 8px; }
    .filter-select { flex: 1; min-width: 40%; font-size: 12px; }
    .lead-item { flex-wrap: wrap; }
    .lead-actions { width: 100%; justify-content: flex-end; }
    .enterprise-detail { font-size: 11px; }
    .graph-container { height: 420px; min-height: 320px; }
    .timeline { padding-left: 14px; }
    .ai-recommend { padding: 14px; }
    .arch-module { min-width: 80px; padding: 8px 10px; font-size: 11px; }
    .contact-card { flex-wrap: wrap; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
    .search-box { display: none; }
    .stat-value { font-size: 20px; }
}
