/* ═══════════════════════════════════════════════
   Design Tokens — 与 test2 对齐 (2026-04-10)
═══════════════════════════════════════════════ */
:root {
  /* Brand — Logo 蓝 */
  --brand-50:  #e6f0ff;
  --brand-300: #69b1ff;
  --brand-500: #1677ff;
  --brand-600: #0958d9;
  --brand-800: #003eb3;

  /* Gray */
  --gray-50:  #f9fafb;
  --gray-100: #f2f4f7;
  --gray-200: #e4e7ec;
  --gray-300: #d0d5dd;
  --gray-400: #98a2b3;
  --gray-500: #667085;
  --gray-700: #344054;
  --gray-800: #1d2939;
  --gray-900: #101828;

  /* 圆角 */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-full: 9999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-lg: 0 12px 16px -4px rgba(16,24,40,0.08), 0 4px 6px -2px rgba(16,24,40,0.03);

  /* 动效 */
  --dur-fast: 150ms;
  --dur-norm: 200ms;
  --dur-slow: 300ms;

  /* 布局 */
  --sidebar-w:  290px;
  --topbar-h:   64px;

  /* 面板 */
  --bg-page:     #F4F6FC;
  --bg-panel:    #ffffff;
  --bg-sidebar:  #ffffff;
  --bg-topbar:   #ffffff;

  /* Dark 面板 */
  --dark-page:   #101828;
  --dark-panel:  rgba(255,255,255,0.03);
  --dark-sidebar:#000000;
  --dark-topbar: #101828;
  --dark-border: #1d2939;

  /* 兼容旧变量名 */
  --color-page-bg:  var(--bg-page);
  --color-panel-bg: var(--bg-panel);
  --color-border:   var(--gray-200);
  --color-title:    var(--gray-800);
  --color-text:     var(--gray-700);
  --color-muted:    var(--gray-500);
  --shadow-panel:   0 1px 4px rgba(16,24,40,0.06);
  --sidebar-width:  var(--sidebar-w);
  --topbar-height:  var(--topbar-h);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-page-bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { text-decoration: none; color: inherit; }

/* ═══════════════════════════════════════════════
   App Shell — flex + 侧边栏 fixed
═══════════════════════════════════════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ═══════════════════════════════════════════════
   侧边栏
═══════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 50;
}

/* Logo 区 */
.sidebar-logo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 4px 18px; border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px; flex-shrink: 0;
}
.sidebar-logo-inner { display: flex; align-items: center; gap: 10px; }
.sidebar-logo-mark {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: block; object-fit: contain; flex-shrink: 0;
}
.sidebar-logo-text strong { display: block; font-size: 15px; font-weight: 700; color: var(--gray-800); }
.sidebar-logo-text span   { font-size: 11px; color: var(--gray-400); }

/* 分组标签 */
.sidebar-nav-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--gray-400);
  padding: 14px 8px 6px;
}

/* 导航分隔线 */
.sidebar-divider { height: 1px; background: var(--gray-200); margin: 8px 0; }

/* 普通导航项 */
.sidebar-nav { display: flex; flex-direction: column; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--gray-500);
  border: 0; background: transparent;
  cursor: pointer; text-align: left;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
  margin-bottom: 2px; white-space: nowrap;
}
.nav-item:hover  { background: var(--gray-100); color: var(--gray-700); }
.nav-item.active { background: var(--brand-50); color: var(--brand-500); font-weight: 600; }

.nav-item-icon {
  width: 20px; height: 20px; display: grid; place-items: center;
  flex-shrink: 0; color: var(--gray-400);
  transition: color var(--dur-fast) ease;
}
.nav-item-icon svg { width: 18px; height: 18px; stroke-width: 1.6px; display: block; }
.nav-item:hover .nav-item-icon  { color: var(--gray-600); }
.nav-item.active .nav-item-icon { color: var(--brand-500); }

.nav-item-label { flex: 1; }

/* 子菜单分组 */
.nav-group { margin-bottom: 2px; }

.nav-group-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--gray-500);
  border: 0; background: transparent; cursor: pointer; text-align: left;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
  white-space: nowrap;
}
.nav-group-btn:hover    { background: var(--gray-100); color: var(--gray-700); }
.nav-group-btn.open     { color: var(--gray-700); font-weight: 600; }
.nav-group-btn.has-active { color: var(--brand-500); font-weight: 600; }

.nav-group-btn .nav-item-icon { color: var(--gray-400); }
.nav-group-btn:hover .nav-item-icon    { color: var(--gray-600); }
.nav-group-btn.has-active .nav-item-icon { color: var(--brand-500); }

.nav-chevron {
  margin-left: auto; flex-shrink: 0; color: var(--gray-400);
  display: grid; place-items: center;
  transition: transform var(--dur-norm) ease, color var(--dur-fast) ease;
}
.nav-chevron svg { width: 14px; height: 14px; stroke-width: 2px; display: block; }
.nav-group-btn.open .nav-chevron { transform: rotate(180deg); }

.nav-submenu {
  margin-left: 22px; padding-left: 4px;
  border-left: 2px solid var(--gray-200);
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height var(--dur-slow) ease, opacity var(--dur-norm) ease;
}
.nav-submenu.open { max-height: 500px; opacity: 1; }

.nav-sub-item {
  display: flex; align-items: center; height: 36px;
  padding: 0 8px 0 18px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 400; color: var(--gray-500);
  border: 0; background: transparent; cursor: pointer;
  width: 100%; text-align: left;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
  white-space: nowrap;
}
.nav-sub-item:hover  { background: var(--gray-100); color: var(--gray-700); }
.nav-sub-item.active { color: var(--brand-500); font-weight: 500; }

/* 三级导航：用于“客户交付 → 客户服务空间 → 展示栏目”。 */
.nav-subgroup { margin: 1px 0; }
.nav-subgroup-btn { justify-content: space-between; gap: 6px; color: var(--gray-600); }
.nav-subgroup-btn .nav-chevron { margin-left: auto; }
.nav-subgroup-btn.open, .nav-subgroup-btn.has-active { color: var(--brand-500); font-weight: 600; }
.nav-submenu-nested { margin: 0 0 2px 14px; padding-left: 5px; border-left-width: 1px; }
.nav-submenu-nested .nav-sub-item { height: 34px; padding-left: 14px; font-size: 12.5px; }

/* 侧边栏底部用户 */
.sidebar-footer {
  margin-top: auto; padding: 14px 0 18px;
  border-top: 1px solid var(--gray-200);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-sm); cursor: pointer;
  transition: background var(--dur-fast) ease;
}
.sidebar-user:hover { background: var(--gray-100); }
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: var(--r-full);
  background: var(--brand-500); color: #fff;
  font-size: 13px; font-weight: 600;
  display: grid; place-items: center; flex-shrink: 0;
}
.sidebar-user-info strong { display: block; font-size: 13px; font-weight: 600; color: var(--gray-800); }
.sidebar-user-info span   { font-size: 12px; color: var(--gray-400); }

/* 退出登录按钮 */
.logout-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 6px 8px; margin-top: 4px;
  background: none; border: none; border-radius: var(--r-sm);
  font-size: 12px; color: var(--gray-400);
  cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast);
  text-align: left;
}
.logout-btn:hover { background: #fff1f0; color: #cf1322; }

/* ═══════════════════════════════════════════════
   顶栏 — 浮动毛玻璃
═══════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 12px;
  left: calc(var(--sidebar-w) + 16px);
  right: 16px;
  z-index: 40;
  display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
  padding: 0 20px 0 24px;
  height: var(--topbar-h);
  background: rgba(244, 246, 252, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 24px rgba(112, 144, 176, 0.13);
}

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

.topbar-breadcrumb { font-size: 13px; color: var(--gray-400); white-space: nowrap; }
.topbar-breadcrumb span { color: var(--gray-700); font-weight: 600; }

.topbar-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--r-sm); padding: 0 10px; height: 36px;
}
.topbar-search-icon { color: var(--gray-400); display: grid; place-items: center; }
.topbar-search-icon svg { width: 15px; height: 15px; stroke-width: 1.8px; }
.topbar-search-input {
  border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--gray-700); width: 200px;
}
.topbar-search-input::placeholder { color: var(--gray-400); }
.topbar-search-kbd {
  font-size: 11px; color: var(--gray-400);
  border: 1px solid var(--gray-200); border-radius: 5px; padding: 1px 5px;
}

.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-full);
  border: 1px solid var(--gray-200); background: #fff;
  display: grid; place-items: center; color: var(--gray-500); cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.topbar-icon-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.topbar-icon-btn svg   { width: 17px; height: 17px; stroke-width: 1.8px; }

.topbar-avatar {
  width: 34px; height: 34px; border-radius: var(--r-full);
  background: var(--brand-500); color: #fff;
  font-size: 13px; font-weight: 600;
  display: grid; place-items: center; cursor: pointer;
}

/* ── 别名：兼容 test2 class 命名 ── */
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex-shrink: 0; color: var(--gray-400); transition: color var(--dur-fast) ease; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.6px; display: block; }
.nav-item:hover .nav-icon, .nav-group-btn:hover .nav-icon  { color: var(--gray-600); }
.nav-item.active .nav-icon, .nav-group-btn.has-active .nav-icon { color: var(--brand-500); }
.nav-text { flex: 1; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-400); padding: 14px 8px 6px; }
.nav-divider { height: 1px; background: var(--gray-200); margin: 8px 0; }
.logo-inner { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; border-radius: var(--r-sm); display: block; object-fit: contain; flex-shrink: 0; }
.user-avatar { width: 36px; height: 36px; border-radius: var(--r-full); background: var(--brand-500); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }

/* 搜索框 (相对定位 + 图标绝对定位) */
.topbar-search { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--gray-400); pointer-events: none; display: grid; place-items: center; }
.search-icon svg { width: 15px; height: 15px; stroke-width: 1.8px; }
.search-input { height: 40px; width: 260px; padding: 0 48px 0 36px; border: 1px solid var(--gray-200); border-radius: var(--r-sm); background: transparent; font: inherit; font-size: 13px; color: var(--gray-800); outline: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.search-input::placeholder { color: var(--gray-400); }
.search-input:focus { border-color: var(--brand-300); box-shadow: 0 0 0 3px rgba(59,130,246,0.10); }
.search-kbd { position: absolute; right: 8px; display: flex; align-items: center; padding: 3px 6px; border: 1px solid var(--gray-200); border-radius: 6px; background: var(--gray-50); font-size: 11px; color: var(--gray-400); pointer-events: none; }

/* 顶栏图标按钮 */
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-full); border: 1px solid var(--gray-200); background: #fff; display: grid; place-items: center; color: var(--gray-500); transition: background var(--dur-fast), color var(--dur-fast); cursor: pointer; }
.icon-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.icon-btn svg { width: 17px; height: 17px; stroke-width: 1.8px; }
.dark-toggle { position: relative; overflow: hidden; }
.dark-toggle .icon-sun, .dark-toggle .icon-moon { position: absolute; display: grid; place-items: center; transition: transform var(--dur-norm) ease, opacity var(--dur-norm); }
.dark-toggle .icon-sun  { transform: translateY(0); opacity: 1; }
.dark-toggle .icon-moon { transform: translateY(20px); opacity: 0; }
body.dark .dark-toggle .icon-sun  { transform: translateY(-20px); opacity: 0; }
body.dark .dark-toggle .icon-moon { transform: translateY(0); opacity: 1; }

/* 折叠按钮 */
.collapse-btn { width: 24px; height: 24px; border-radius: 4px; border: none; background: transparent; display: grid; place-items: center; color: var(--gray-400); font-size: 14px; cursor: pointer; flex-shrink: 0; transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-norm); }
.collapse-btn:hover { background: var(--gray-100); color: var(--gray-600); }

/* 侧边栏折叠 */
.sidebar { transition: width var(--dur-slow) ease; }
.sidebar.collapsed { width: 90px; padding: 0 10px; }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-item-label,
.sidebar.collapsed .sidebar-logo-text { display: none; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .sidebar-nav-label,
.sidebar.collapsed .sidebar-divider { display: none; }
.sidebar.collapsed .collapse-btn { transform: rotate(180deg); }
.sidebar.collapsed .nav-group-btn { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .nav-chevron { display: none; }
.sidebar.collapsed .nav-submenu { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer { display: none; }
body.sidebar-collapsed .topbar { left: calc(90px + 16px); }
body.sidebar-collapsed .main-content { margin-left: 90px; }

/* ── Dark 模式 ── */
body.dark { background: #0c111d; color: rgba(255,255,255,0.80); }
body.dark .sidebar { background: #0f1623; border-color: rgba(255,255,255,0.08); }
body.dark .sidebar-logo { border-color: rgba(255,255,255,0.08); }
body.dark .sidebar-logo-text strong { color: rgba(255,255,255,0.95); }
body.dark .topbar { background: rgba(15,22,35,0.85); border-color: rgba(255,255,255,0.06); box-shadow: 0 4px 24px rgba(0,0,0,0.4); }
body.dark .nav-item { color: rgba(255,255,255,0.55); }
body.dark .nav-item:hover, body.dark .nav-group-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
body.dark .nav-item.active { background: rgba(22,119,255,0.15); color: #93c5fd; }
body.dark .nav-item.active .nav-icon,
body.dark .nav-item.active .nav-item-icon { color: #93c5fd; }
body.dark .nav-group-btn { color: rgba(255,255,255,0.55); }
body.dark .nav-group-btn.has-active { color: #93c5fd; }
body.dark .nav-sub-item { color: rgba(255,255,255,0.50); }
body.dark .nav-sub-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
body.dark .nav-sub-item.active { color: #93c5fd; }
body.dark .nav-label { color: rgba(255,255,255,0.30); }
body.dark .nav-divider { background: rgba(255,255,255,0.06); }
body.dark .sidebar-footer { border-color: rgba(255,255,255,0.06); }
body.dark .sidebar-user-info strong { color: rgba(255,255,255,0.90); }
body.dark .sidebar-user-info span { color: rgba(255,255,255,0.40); }
body.dark .icon-btn { border-color: rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.55); }
body.dark .icon-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.90); }
body.dark .topbar-icon-btn { border-color: rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.55); }
body.dark .topbar-icon-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.90); }
body.dark .topbar-breadcrumb { color: rgba(255,255,255,0.35); }
body.dark .topbar-breadcrumb span { color: rgba(255,255,255,0.85); }
body.dark .search-input { border-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.90); background: rgba(255,255,255,0.04); }
body.dark .search-input::placeholder { color: rgba(255,255,255,0.25); }
body.dark .search-kbd { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.30); }
body.dark .logout-btn { color: rgba(255,255,255,0.35); }
body.dark .logout-btn:hover { background: rgba(207,19,34,0.15); color: #ff7875; }
body.dark .collapse-btn { background: transparent; color: rgba(255,255,255,0.35); }
body.dark .collapse-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.70); }

/* ═══════════════════════════════════════════════
   主内容区
═══════════════════════════════════════════════ */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--dur-slow) ease;
}
.main-area.expanded { margin-left: 90px; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 92px 24px 24px;
  min-height: 100vh;
}

/* 当 main-content 在 main-area 内部时,不需要 margin-left */
.main-area .main-content {
  margin-left: 0;
  min-height: auto;
}

/* .content 别名 — test2 用 .content 做内容区 */
.content {
  flex: 1;
  padding: 96px 24px 24px;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
  margin: 0;
  transition: color var(--dur-slow);
}
body.dark .page-header h1 { color: rgba(255,255,255,0.95); }

.page-header p {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}
body.dark .page-header p { color: rgba(255,255,255,0.40); }

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.content-header h1 {
  margin: 0;
  color: var(--color-title);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
}

.content-header p {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.7;
}

.content-panel {
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-panel-bg);
  box-shadow: var(--shadow-panel);
}

.content-placeholder {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px;
}

.content-placeholder-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f3f6ff 0%, #edf3ff 100%);
  color: #3f6af6;
  font-size: 28px;
  font-weight: 700;
}

.content-placeholder h2 {
  margin: 0 0 8px;
  color: var(--color-title);
  font-size: 20px;
}

.content-placeholder p {
  max-width: 420px;
  margin: 0;
  color: var(--color-muted);
}

.dashboard {
  display: grid;
  gap: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.action-hero {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  border: 1px solid #cfe0ff;
  color: #1f2a44;
  background:
    linear-gradient(135deg, rgba(63, 106, 246, 0.14) 0%, rgba(63, 106, 246, 0.03) 42%, rgba(255, 255, 255, 0.95) 100%),
    linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.1);
}

.action-hero::after {
  content: "";
  position: absolute;
  right: -8px;
  top: -18px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 106, 246, 0.15) 0%, rgba(63, 106, 246, 0) 70%);
}

.action-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(89, 136, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 136, 255, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(120deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 58%, transparent 100%);
  pointer-events: none;
}

.action-hero .card-body {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
}

.action-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.action-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(63, 106, 246, 0.1);
  border: 1px solid rgba(63, 106, 246, 0.12);
  color: #3056c9;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.action-hero-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(63, 106, 246, 0.1);
  border: 1px solid rgba(63, 106, 246, 0.14);
}

.action-hero-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  color: #2f61ee;
}

.action-hero h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.action-hero p {
  margin: 0;
  color: #61718a;
  font-size: 12px;
  line-height: 1.55;
}

.action-hero-panel {
  margin-top: 2px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 249, 255, 0.86) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 22px rgba(59, 100, 201, 0.08);
  backdrop-filter: blur(4px);
}

.action-hero-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-hero .btn-primary {
  min-height: 32px;
  padding: 6px 14px;
  background: #2f61ee;
  border-color: #2f61ee;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(47, 97, 238, 0.18);
}

.action-hero .btn-primary:hover {
  background: #244fc9;
  border-color: #244fc9;
}

.action-hero .btn-default {
  min-height: 32px;
  padding: 6px 14px;
  border-color: #c9d8f8;
  background: rgba(255, 255, 255, 0.76);
  color: #35506f;
}

.action-hero .btn-default:hover {
  background: #ffffff;
  border-color: #b8cbf5;
}

.stat-card {
  position: relative;
  min-height: 112px;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 4px;
  border-radius: 999px;
}

.stat-card-danger::before {
  background: #dc2626;
}

.stat-card-primary::before {
  background: #2563eb;
}

.stat-card-success::before {
  background: #16a34a;
}

.stat-card .card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 14px 18px;
}

.stat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stat-card-title {
  color: var(--color-muted);
  font-size: 13px;
}

.stat-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #2450cf;
  background: linear-gradient(180deg, #eef4ff 0%, #e7efff 100%);
  padding: 9px;
}

.stat-card-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card-danger .stat-card-icon {
  color: #b91c1c;
  background: linear-gradient(180deg, #fff1f1 0%, #feeaea 100%);
}

.stat-card-success .stat-card-icon {
  color: #15803d;
  background: linear-gradient(180deg, #eefcf2 0%, #e7f8ec 100%);
}

.stat-card-value {
  margin: 0;
  color: var(--color-title);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stat-card-meta {
  color: #5a6678;
  font-size: 12px;
}

.stat-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
  color: var(--color-muted);
  font-size: 12px;
}

.stat-card-foot strong {
  color: var(--color-title);
  font-size: 12px;
  font-weight: 600;
}

.dashboard-banner {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  color: #ffffff;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.26), transparent 28%),
    linear-gradient(135deg, #335de8 0%, #244bc1 100%);
}

.dashboard-banner::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -36px;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-banner-body {
  position: relative;
  z-index: 1;
}

.dashboard-banner h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
}

.dashboard-banner p {
  max-width: 520px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.8;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.dashboard-actions .btn-default {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.dashboard-actions .btn-default:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.panel-note {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.7;
}

.quick-links {
  display: grid;
  gap: 12px;
}

.quick-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #dae5f3;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.quick-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #4f79ee;
  opacity: 0.95;
}

.quick-link:hover {
  border-color: #bfd0e9;
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(35, 64, 140, 0.08);
}

.quick-link-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.quick-link-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #edf3ff;
  color: #2450cf;
  font-size: 18px;
  flex: 0 0 46px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.quick-link-text strong {
  display: block;
  color: var(--color-title);
  font-size: 15px;
  font-weight: 700;
}

.quick-link-text span {
  display: block;
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.6;
}

.quick-link-arrow {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 121, 238, 0.08);
  color: #4a72da;
  font-size: 18px;
  line-height: 1;
}

.quick-link-primary {
  background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
}

.quick-link-primary::before {
  background: linear-gradient(180deg, #4f79ee 0%, #6a8ef2 100%);
}

.quick-link-primary .quick-link-icon {
  background: linear-gradient(180deg, #e9f0ff 0%, #dfe9ff 100%);
  color: #2e5fe8;
}

.quick-link-primary .quick-link-arrow {
  background: rgba(79, 121, 238, 0.1);
  color: #416bdd;
}

.quick-link-warning {
  background: linear-gradient(180deg, #fffaf3 0%, #fff5e8 100%);
}

.quick-link-warning::before {
  background: linear-gradient(180deg, #f2a23d 0%, #eb8a2f 100%);
}

.quick-link-warning .quick-link-icon {
  background: linear-gradient(180deg, #fff1db 0%, #ffe5c2 100%);
  color: #d97706;
}

.quick-link-warning .quick-link-arrow {
  background: rgba(234, 136, 36, 0.12);
  color: #c97315;
}

.quick-link-success {
  background: linear-gradient(180deg, #f4fcf8 0%, #ebf9f2 100%);
}

.quick-link-success::before {
  background: linear-gradient(180deg, #28b07d 0%, #1f9a6d 100%);
}

.quick-link-success .quick-link-icon {
  background: linear-gradient(180deg, #dcf7ea 0%, #ccf1de 100%);
  color: #0f8a5d;
}

.quick-link-success .quick-link-arrow {
  background: rgba(40, 176, 125, 0.12);
  color: #1c8c63;
}

.dashboard-list {
  display: grid;
  gap: 12px;
}

.dashboard-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
}

.dashboard-list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-list-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf3ff;
  color: #2c57da;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-list-main strong {
  display: block;
  color: var(--color-title);
  font-size: 14px;
  font-weight: 600;
}

.dashboard-list-main span {
  display: block;
  margin-top: 5px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.7;
}

.dashboard-list-meta {
  color: #99a4b3;
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-mini-table .data-table-wrap {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.dashboard-mini-table .data-table thead th {
  padding-top: 0;
}

.dashboard-mini-table .data-table tbody td {
  font-size: 13px;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-hero {
    grid-column: 1 / -1;
  }

}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "content";
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .main-content {
    padding: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-search {
    width: min(100%, 280px);
  }

}

@media (max-width: 560px) {
  .content-header {
    flex-direction: column;
  }

  .dashboard-banner {
    padding: 18px;
  }

  .action-hero-actions {
    width: 100%;
  }

  .dashboard-actions .btn,
  .dashboard-actions a.btn {
    width: 100%;
  }

  .quick-link {
    padding: 14px;
  }
}

.content-header p {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.content-panel {
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
}

.content-placeholder {
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.content-placeholder-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #edf3ff;
  color: var(--color-sidebar-active);
  font-size: 22px;
}

.content-placeholder h2 {
  margin: 0;
  color: var(--color-title);
  font-size: 18px;
  font-weight: 600;
}

.content-placeholder p {
  max-width: 420px;
  margin: 0;
  color: var(--color-muted);
}

@media (max-width: 1024px) {
  .topbar-search {
    width: 180px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) auto 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "content";
  }

  .sidebar {
    padding-bottom: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-search {
    width: 100%;
  }

  .main-content {
    padding: 16px;
  }
}

.report-page {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 20px;
}

.report-textarea {
  min-height: 320px;
}

.report-generate-btn {
  width: 100%;
  justify-content: center;
}

.report-error {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #feebeb;
  color: #b42318;
  font-size: 13px;
}

.report-placeholder.empty-state {
  min-height: 340px;
}

.result-content {
  display: none;
}

.report-preview-shell {
  min-height: 340px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding: 20px 22px;
  border: 1px solid #e6edf6;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.report-title {
  margin: 0 0 22px;
  color: var(--color-title);
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
}

.report-body {
  color: var(--color-text);
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.report-title[contenteditable="true"]:hover,
.report-body[contenteditable="true"]:hover {
  outline: 1px dashed var(--gray-300, #d0d5dd);
  outline-offset: 4px;
  cursor: text;
}
.report-title[contenteditable="true"]:focus,
.report-body[contenteditable="true"]:focus {
  outline: 2px solid var(--brand-500, #1677ff);
  outline-offset: 4px;
  cursor: text;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.report-save-hint {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 13px;
  font-weight: 600;
}

/* ── 展开/收起按钮 ── */
.expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--gray-400, #98a2b3);
  cursor: pointer;
  border-radius: 6px;
  z-index: 2;
  transition: all 150ms ease;
  padding: 0;
}

.expand-btn:hover {
  background: var(--gray-100, #f2f4f7);
  color: var(--gray-600, #475467);
}

body.dark .expand-btn {
  color: rgba(255, 255, 255, 0.4);
}

body.dark .expand-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

/* ── 全屏覆盖层 ── */
.fullscreen-overlay {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--bg-panel, #fff);
  padding: 20px;
  overflow-y: auto;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.fullscreen-overlay .expand-btn {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  z-index: 1001;
}

.fullscreen-overlay .report-textarea,
.fullscreen-overlay textarea {
  max-height: none;
  min-height: calc(100vh - 120px);
  height: calc(100vh - 120px);
  width: 100%;
  box-sizing: border-box;
}

.fullscreen-overlay .report-preview-shell {
  max-height: none;
  min-height: calc(100vh - 140px);
}

.fullscreen-overlay .report-actions {
  margin-top: 16px;
}

body.dark .fullscreen-overlay {
  background: var(--dark-bg, #0c111d);
}


.alerts-page {
  display: grid;
  gap: 20px;
}

.alerts-total-badge {
  min-width: 40px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1f1 0%, #feeaea 100%);
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
}

.alerts-filter-card {
  display: flex;
  align-items: center;
  gap: 18px 20px;
  flex-wrap: wrap;
}

.alerts-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alerts-filter-label {
  color: #667085;
  font-size: 13px;
  white-space: nowrap;
}

.alerts-risk-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.risk-filter-btn {
  min-height: 34px;
  padding: 0 14px;
}

.risk-filter-btn.active {
  background: var(--component-primary);
  border-color: var(--component-primary);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.alerts-filter-select {
  width: 160px;
}

.alerts-count-hint {
  margin-left: auto;
  color: #98a2b3;
  font-size: 13px;
}

.alerts-table-wrap {
  border-radius: 12px;
}

.col-risk {
  width: 80px;
  white-space: nowrap;
}

.col-title {
  min-width: 240px;
  max-width: 360px;
}

.col-source {
  width: 140px;
  white-space: nowrap;
}

.col-time {
  width: 156px;
  color: #98a2b3;
  white-space: nowrap;
}

.col-summary {
  min-width: 220px;
  color: #667085;
}

.col-title span,
.col-summary span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.col-title span {
  -webkit-line-clamp: 2;
}

.col-summary span {
  -webkit-line-clamp: 2;
}

.alerts-sub-meta {
  color: #98a2b3;
}

.alerts-empty-text {
  color: #98a2b3;
  font-style: normal;
}

.alerts-tag-neutral {
  background: #f2f4f7;
  color: #667085;
}

.data-row {
  cursor: pointer;
}

.data-row.expanded {
  background: #eef4ff;
}

.detail-row {
  display: none;
}

.detail-row.visible {
  display: table-row;
}

.detail-row td {
  padding: 0 !important;
  border-bottom: 0 !important;
}

.detail-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
  border-top: 1px solid #dbe5f3;
}

.detail-full {
  grid-column: 1 / -1;
}

.detail-block {
  padding: 16px 18px;
  border: 1px solid #e2eaf6;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
}

.detail-block h4 {
  margin: 0 0 8px;
  color: #667085;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.detail-block p {
  margin: 0;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.detail-block .placeholder {
  color: #98a2b3;
  font-style: italic;
}

.state-msg {
  padding: 52px 0;
  text-align: center;
  color: #98a2b3;
  font-size: 14px;
}

.state-msg.error {
  color: #b42318;
}

@media (max-width: 1180px) {
  .report-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .alerts-filter-card {
    align-items: stretch;
  }

  .alerts-filter-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .alerts-filter-select {
    width: 100%;
  }

  .alerts-count-hint {
    margin-left: 0;
  }

  .detail-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .report-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ═══════════════════════════════════════════════
   知识库 — 总览页布局(2026-04-30 K1 末追加)
   严格使用 main.css/components.css 已有 token,不引新色。
═══════════════════════════════════════════════ */

/* 5 张统计卡的响应式网格 */
.kb-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kb-overview-grid .card {
  cursor: pointer;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.kb-overview-grid .card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.kb-overview-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--brand-500);
}
.kb-overview-card-head svg {
  width: 20px; height: 20px;
}
.kb-overview-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-title);
}

.kb-overview-card-count {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-title);
  line-height: 1.1;
}

.kb-overview-card-meta {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 4px;
}

.kb-overview-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.kb-overview-card.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-panel);
}

/* 简版搜索条 */
.kb-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.kb-search-input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  font-family: inherit;
  transition: border-color var(--dur-fast) ease;
}
.kb-search-input:focus {
  outline: none;
  border-color: var(--brand-500);
}
.kb-search-input::placeholder {
  color: var(--gray-400);
}

/* 最近更新 feed */
.kb-recent-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kb-recent-feed li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.kb-recent-feed li:last-child {
  border-bottom: none;
}
.kb-recent-feed-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--brand-50);
  color: var(--brand-500);
  flex-shrink: 0;
}
.kb-recent-feed-type svg {
  width: 14px; height: 14px;
}
.kb-recent-feed-title {
  flex: 1;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-recent-feed-time {
  font-size: 12px;
  color: var(--color-muted);
  flex-shrink: 0;
}
