/* ─── 主应用 ─────────────────────────────────────────────────────────────── */
#app { display: none; height: 100vh; overflow: hidden; }
.app-layout { display: flex; height: 100vh; }

/* ─── 侧边栏 ───────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #08111f 0%, #0c1a30 40%, #0a1628 100%);
  display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; overflow-x: hidden;
  border-right: 1px solid rgba(6,182,212,.08);
  box-shadow: 2px 0 20px rgba(0,0,0,.25);
  position: relative;
}
.sidebar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent2));
}
.sidebar-header {
  padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,.05);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 12px; padding: 6px; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(6,182,212,.24); }
.sidebar-brand-text .name { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .3px; }
.sidebar-brand-text .sub { font-size: 10px; color: rgba(255,255,255,.35); letter-spacing: .5px; }
.sidebar-section { padding: 9px 10px 3px; }
.sidebar-section-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.25); letter-spacing: 2px;
  text-transform: uppercase; padding: 0 8px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.sidebar-section-label::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 9px; cursor: pointer; color: rgba(255,255,255,.55);
  font-size: 13.5px; font-weight: 500; transition: all .18s; margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(26,86,219,.9), rgba(37,99,235,.9));
  color: #fff; font-weight: 700;
  box-shadow: 0 3px 12px rgba(26,86,219,.45), inset 0 1px 0 rgba(255,255,255,.1);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { flex-shrink: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.nav-item .nav-icon img { width: 24px; height: 24px; object-fit: cover; border-radius: 7px; display: block; box-shadow: 0 2px 8px rgba(6,182,212,.18); }
.nav-item.active .nav-icon img { box-shadow: 0 3px 10px rgba(6,182,212,.35); }
/* 科技风首页图标（内联 SVG，颜色随导航状态联动） */
.nav-item .nav-icon-svg svg { width: 22px; height: 22px; display: block; color: rgba(186,216,255,.7); transition: color .18s ease, filter .18s ease; }
.nav-item:hover .nav-icon-svg svg { color: var(--accent); }
.nav-item.active .nav-icon-svg svg { color: var(--accent); filter: drop-shadow(0 0 5px rgba(6,182,212,.55)); }
.sidebar-footer {
  margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.05);
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: rgba(255,255,255,.4); }
.btn-logout {
  width: 100%; padding: 8px; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
  border-radius: 7px; color: #fca5a5; font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn-logout:hover { background: rgba(239,68,68,.2); }
.status-bar {
  padding: 8px 12px; background: rgba(16,185,129,.08); border-radius: 6px;
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: pulse 2s infinite; }
.status-text { font-size: 11px; color: rgba(255,255,255,.5); }

/* ─── 侧边栏收放（抽屉式把手吸附在侧栏右缘，收起后整屏留给主内容） ──────── */
.app-layout { position: relative; }
.sidebar { transition: width .28s ease; }
.sidebar-handle {
  position: absolute; left: var(--sidebar-width); top: 50%; transform: translateY(-50%);
  width: 18px; height: 64px; padding: 0; z-index: 50; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0c1a30, #0a1628);
  border: 1px solid rgba(6,182,212,.28); border-left: 0;
  border-radius: 0 9px 9px 0; color: rgba(186,216,255,.75);
  box-shadow: 2px 0 10px rgba(0,0,0,.22); opacity: .75;
  transition: left .28s ease, opacity .18s, color .18s;
}
.sidebar-handle:hover { opacity: 1; color: var(--accent); border-color: rgba(6,182,212,.55); }
.sidebar-handle svg { width: 14px; height: 14px; display: block; transition: transform .28s ease; }
body.sidebar-collapsed .sidebar {
  width: 0 !important; min-width: 0 !important; border: 0 !important; box-shadow: none;
}
body.sidebar-collapsed .sidebar-handle { left: 0; }
body.sidebar-collapsed .sidebar-handle svg { transform: rotate(180deg); }

/* ─── 主内容区 ───────────────────────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; background: #080d18; }
.page { display: none; padding: 28px 32px; min-height: 100%; }
.page.active { display: block; }
/* 数据大屏页：去内边距、铺满主内容区，iframe 充满 */
.page-bigscreen { padding: 0; height: 100%; background: #04070f; }
.page-bigscreen.active { display: flex; }
#bigscreen-frame { flex: 1; width: 100%; height: 100%; border: 0; display: block; }
.page-header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 2px solid transparent; background: linear-gradient(white, white) padding-box, linear-gradient(90deg, var(--primary), var(--accent)) border-box; border-radius: 0; }
.page-title { font-size: 22px; font-weight: 800; color: var(--gray-900); display: flex; align-items: center; gap: 10px; letter-spacing: -.3px; }
.module-title-icon { width: 30px; height: 30px; object-fit: cover; border-radius: 9px; box-shadow: 0 4px 12px rgba(26,86,219,.18); flex-shrink: 0; }
.page-desc { font-size: 13px; color: var(--gray-500); margin-top: 5px; }

/* ─── 卡片 ───────────────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: 14px; border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card); overflow: hidden; transition: box-shadow .2s, transform .15s;
}
.card:hover { box-shadow: 0 6px 24px rgba(26,86,219,.12); }
.card-header {
  padding: 15px 20px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #fafcff 0%, #f8fafc 100%);
}
.card-title { font-size: 13.5px; font-weight: 700; color: var(--gray-800); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px 20px; }

/* ─── 模块两列布局（AI互动整改已改为悬浮球聊天窗，不再占第三列） ─────────── */
.module-layout { display: grid; grid-template-columns: 380px minmax(0,1fr); gap: 22px; align-items: start; }
.module-layout-2col { display: grid; grid-template-columns: 440px minmax(0,1fr); gap: 22px; align-items: start; }
/* 结果列与左列等高：未分析时空状态撑满整列，不显空 */
.module-layout > div:nth-child(2) { align-self: stretch; }
.module-layout .result-panel { height: 100%; display: flex; flex-direction: column; }
.module-layout .result-panel .result-body { flex: 1; display: flex; flex-direction: column; }
.module-layout .result-panel .result-empty { flex: 1; }

