/**
 * global.css – 声量智传平台全局样式（最终版）
 * 严格遵循 .clinerules v3.0
 * 
 * 【修正说明】
 * - 导航树选择器从 data-* 属性改为 class 选择器，匹配 nav-tree.js 实际输出
 * - 删除无效 data-overview 冗余代码
 * - 其他所有布局、配色、变量、响应式均保持不变
 * 
 * 【V9.5 新增通用组件样式】
 * - 所有新增样式均放在文件末尾，不修改任何现有样式
 * - 新增 .page-shell / .page-tabs / .toast / .skeleton / .empty-state / .kpi-grid / .quick-grid / .filter-aside 等
 * - 所有样式使用现有 CSS Token，不引入新颜色
 */

/* ============================================================
   1. CSS 变量定义（全局 Tokens）
   ============================================================ */
:root {
  /* 布局 & 背景 */
  --bg: #F8F9FA;
  --panel: #FFFFFF;
  --panel-soft: #FFFFFF;
  --sidebar-bg: #F3F4F6;

  /* 品牌色（丹赤红系） */
  --primary: #E63917;
  --primary-deep: #C92F10;
  --primary-soft: #FFECEC;
  --primary-pale: #FFF0ED;

  /* 强调色（暖橙系） */
  --accent: #E66A3A;
  --accent-soft: #FDF0E8;

  /* 次色（深青系） */
  --secondary: #0D3B66;
  --secondary-soft: #62748C;
  --secondary-muted: #9CA3AF;

  /* 点缀色（暖金系） */
  --gold: #D4A843;
  --gold-soft: #FDF6E3;

  /* 边框 & 线条 */
  --line: #EAEAEC;
  --line-strong: #D7D9DF;
  --border: #E5E7EB;

  /* 文本 */
  --text: #0D3B66;
  --muted: #62748C;
  --avatar-text: #374151;

  /* 功能色 */
  --success: #16A34A;
  --success-soft: #E8F7EE;
  --warning: #E66A3A;
  --warning-soft: #FFF1E8;
  --danger: #DC2626;
  --danger-soft: #FDECEC;

  /* 组件特殊色 */
  --notif-bg: #FCD34D;
  --avatar-bg: #F3F4F6;

  /* 阴影 & 圆角 */
  --shadow: 0 2px 8px rgba(0,0,0,.05);
  --shadow-soft: 0 1px 4px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 14px rgba(0,0,0,.08);
  --shadow-modal: 0 10px 28px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;

  /* 固定尺寸 */
  --topbar-h: 64px;
  --sidebar-w: 240px;
}

/* ============================================================
   2. 基础重置（防溢出骨架）
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
}

@supports (height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

a {
  color: inherit;
  text-decoration: none;
}
button, input, select, textarea {
  font: inherit;
}
ul, ol {
  list-style: none;
}
.hidden {
  display: none !important;
}

/* ============================================================
   3. 侧边栏（严格锁定 240px，任何屏幕都不变）
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px;
  gap: 14px;
}

@supports (height: 100dvh) {
  .sidebar {
    height: 100dvh;
  }
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-muted);
}

/* ============================================================
   4. LOGO 卡片
   ============================================================ */
.logo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

/* 20261025：LOGO 卡片改为可点击（点击返回工作台） */
a.logo-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.logo-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}
a.logo-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 4px;
}

.logo-text {
  min-width: 0;
  flex: 1;
}
.logo-text h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-text p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   5. 导航容器
   ============================================================ */
.nav-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.nav-group-title {
  padding: 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   6. 导航树（ID: #geo-tree）
   适配 JS 输出 .active / .ancestor-active / .expanded class
   完全遵循 clinerules 配色交互
   ============================================================ */
#geo-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.geo-tree-item {
  display: flex;
  flex-direction: column;
}

.geo-tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  background: transparent;
}

/* 默认文字 */
.geo-tree-row .geo-tree-link,
.geo-tree-row .geo-tree-label,
.geo-tree-row .geo-tree-text {
  color: var(--secondary);
  font-size: 14px;
  font-weight: 500;
}

/* 悬停 */
.geo-tree-row:hover {
  background: var(--primary-pale);
}
.geo-tree-row:hover .geo-tree-link,
.geo-tree-row:hover .geo-tree-label,
.geo-tree-row:hover .geo-tree-text {
  color: var(--secondary);
}

/* 当前激活项 active */
#geo-tree .geo-tree-item.active > .geo-tree-row {
  background: var(--primary-soft);
}
#geo-tree .geo-tree-item.active > .geo-tree-row .geo-tree-link,
#geo-tree .geo-tree-item.active > .geo-tree-row .geo-tree-label,
#geo-tree .geo-tree-item.active > .geo-tree-row .geo-tree-text {
  color: var(--primary);
  font-weight: 700;
}
#geo-tree .geo-tree-item.active > .geo-tree-row .geo-tree-toggle {
  display: none;
}

/* 父级拥有激活子菜单 ancestor-active */
#geo-tree .geo-tree-item.ancestor-active > .geo-tree-row .geo-tree-link,
#geo-tree .geo-tree-item.ancestor-active > .geo-tree-row .geo-tree-label,
#geo-tree .geo-tree-item.ancestor-active > .geo-tree-row .geo-tree-text {
  color: var(--secondary);
  font-weight: 500;
}

/* 箭头切换 */
.geo-tree-toggle {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--secondary-muted);
  transition: transform 0.2s ease;
}
.geo-tree-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#geo-tree .geo-tree-item.expanded > .geo-tree-row .geo-tree-toggle {
  transform: rotate(90deg);
}

/* 层级缩进 */
#geo-tree .geo-tree-item.depth-0 > .geo-tree-row { padding-left: 8px; }
#geo-tree .geo-tree-item.depth-1 > .geo-tree-row { padding-left: 24px; }
#geo-tree .geo-tree-item.depth-2 > .geo-tree-row { padding-left: 40px; }

.geo-tree-spacer {
  width: 20px;
  flex-shrink: 0;
}

.geo-tree-link,
.geo-tree-label {
  flex: 1;
  min-width: 0;
  text-decoration: none;
  outline: none;
}
.geo-tree-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 子菜单容器 */
.geo-tree-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 核心：未展开菜单强制隐藏，匹配 JS 的 expanded class */
#geo-tree .geo-tree-item:not(.expanded) > .geo-tree-children {
  display: none;
}

/* 二级子项激活背景强化 */
#geo-tree .geo-tree-item.depth-1.active > .geo-tree-row {
  background: var(--primary-soft);
}

/* ============================================================
   7. 侧边栏底部
   ============================================================ */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-note {
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ============================================================
   8. 主内容区
   ============================================================ */
.main-area {
  flex: 1;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
@supports (height: 100dvh) {
  .main-area {
    height: 100dvh;
  }
}

/* ============================================================
   8.1 iframe 嵌入模式（引呈营销引擎聚合页 /settings/engine）
   子页以 ?embed=1 打开：跳过布局渲染，隐藏空壳侧边栏/顶栏，内容直出
   ============================================================ */
body.layout-embed {
  margin: 0;
  background: var(--bg);
}
body.layout-embed > .sidebar,
body.layout-embed > .main-area > .topbar {
  display: none !important;
}
body.layout-embed > .main-area {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
body.layout-embed > .main-area > .content-area {
  overflow: visible;
}

/* ============================================================
   9. 顶部导航栏（卡片样式：带边距、圆角、阴影）
   ============================================================ */
.topbar {
  flex-shrink: 0;
  height: var(--topbar-h);
  margin: 14px 14px 0 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

/* 面包屑 */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.breadcrumb-item {
  color: var(--muted);
}
.breadcrumb-item.current {
  color: var(--secondary);
  font-weight: 600;
}
.breadcrumb-separator {
  color: var(--line-strong);
  font-size: 12px;
}

/* 全局搜索 */
.global-search {
  flex: 1;
  min-width: 0;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 4px 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.global-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-pale);
}
.global-search .search-icon {
  color: var(--secondary-muted);
  font-size: 16px;
  flex-shrink: 0;
}
.global-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.global-search input::placeholder {
  color: var(--secondary-muted);
}
.global-search .search-btn {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.global-search .search-btn:hover {
  background: var(--primary-deep);
}

/* 顶部操作区 */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.notif {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
  font-size: 20px;
  line-height: 1;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif:hover {
  transform: scale(1.05);
}

/* ===== 20261025 施工单 V2.3 P1-T3：铃铛强提醒动效（纯追加，不改上方现有 .notif） =====
   触发：铃铛按钮带 .notif--alert（layout.js 读 unread-count 的 highCount>0 时挂上，
   清零即移除）。抖动 + 呼吸光仅作用于该类，不影响其他按钮。 */
@keyframes notif-shake {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-8deg); }
  50% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  70% { transform: rotate(2deg); }
  80% { transform: rotate(0deg); }
}
@keyframes notif-breath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
.notif--alert {
  animation:
    notif-shake 0.9s ease-in-out infinite,
    notif-breath 1.6s ease-in-out infinite;
  border-radius: 50%;
}
.notif--alert:hover {
  animation-play-state: paused;
}

.action-btn {
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.action-btn.login {
  background: var(--primary);
  color: #fff;
  border: none;
}
.action-btn.login:hover {
  background: var(--primary-deep);
}
.action-btn.exit {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
}
.action-btn.exit:hover {
  background: var(--bg);
  color: var(--secondary);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--avatar-bg);
  color: var(--avatar-text);
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

/* ============================================================
   顶栏头像 · 个人信息卡（20261025）
   全部颜色走 Token，禁止硬编码品牌色
   ============================================================ */
.user-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 292px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1200;
}
.user-menu[hidden] {
  display: none;
}
.um-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.um-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
}
.um-id {
  min-width: 0;
}
.um-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.um-role {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.um-info-error {
  margin-top: 6px;
}
.um-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.um-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.um-metric-label {
  font-size: 12px;
  color: var(--muted);
}
.um-metric-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  word-break: break-all;
}
.um-retry {
  padding: 0;
  border: none;
  background: none;
  color: var(--danger);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.um-cash-extra {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.um-recharge {
  width: 100%;
  height: 34px;
  margin-top: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: var(--panel);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.um-recharge:hover {
  background: var(--primary-deep);
}
.um-group-title {
  margin: 14px 0 6px;
  font-size: 12px;
  color: var(--secondary-muted);
}
.um-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.um-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.um-link:hover {
  background: var(--bg);
  color: var(--primary);
}
.um-link small {
  font-size: 12px;
  color: var(--secondary-muted);
}
.um-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.um-logout {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.um-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* 移动端/窄屏：顶栏个人信息卡不展示（PC 专用） */
@media (max-width: 900px) {
  .user-menu {
    display: none;
  }
}

/* ============================================================
   10. 内容区（唯一滚动容器）
   ============================================================ */
.content-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: var(--bg);
}

.content-scroll {
  min-width: 0;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section,
.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--line);
  min-width: 0;
}

.page-header,
.toolbar,
.section-head,
.page-title,
.page-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.split-50-50,
.split-65-35,
.split-3,
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  min-width: 0;
}

.split-50-50 > .half { width: calc(50% - 8px); min-width: 0; }
.split-65-35 > .left { width: calc(65% - 8px); min-width: 0; }
.split-65-35 > .right { width: calc(35% - 8px); min-width: 0; }
.split-3 > .third { width: calc(33.333% - 11px); min-width: 0; }
.tool-grid > .tool-card { width: calc(33.333% - 12px); min-width: 0; }

.tool-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.btn-primary {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.btn-ghost {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--secondary);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   11. 全屏模式
   ============================================================ */
body.fullscreen-mode {
  overflow: hidden;
  background: var(--bg);
}
body.fullscreen-mode .sidebar,
body.fullscreen-mode .topbar {
  display: none !important;
}
body.fullscreen-mode .main-area {
  padding: 0;
}

/* ============================================================
   12. 响应式布局（移动端不改变侧边栏宽度）
   ============================================================ */
@media (max-width: 1200px) {
  .tool-grid > .tool-card,
  .split-3 > .third {
    width: calc(50% - 8px);
  }
  .split-50-50 > .half,
  .split-65-35 > .left,
  .split-65-35 > .right {
    width: 100%;
  }
}

@media (max-width: 767px) {
  /* 侧边栏始终保持 240px 锁定，不做任何覆盖 */

  .topbar {
    flex-direction: column;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
    margin: 14px 14px 0 14px;
  }
  .app-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .global-search {
    max-width: none;
    width: 100%;
  }
  .topbar-actions {
    margin-left: 0;
    justify-content: flex-end;
    width: 100%;
  }

  .page-header,
  .toolbar,
  .page-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-grid > .tool-card,
  .split-3 > .third {
    width: 100%;
  }
}

/* ============================================================
   13. 品牌曝光模块专用样式（V9.5）
   ============================================================ */

/* 13.1 防闪烁强制（所有 Tab 面板默认隐藏） */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }

.sub-panel { display: none; }
.sub-panel.active { display: flex; }


/* ============================================================
   ============================================================
   14. V9.5 新增通用组件样式
   ============================================================
   ============================================================ */

/* ============================================================
   14.1 页面容器 .page-shell
   所有业务页面的根容器
   ============================================================ */
.page-shell {
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

/* ============================================================
   14.2 Tab 切换 .page-tabs
   用于AI选品、品牌曝光等多 Tab 页面
   ============================================================ */
.page-tabs {
  display: flex;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  flex-shrink: 0;
}

.page-tabs .tab-item {
  padding: 12px 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  font-family: inherit;
}

.page-tabs .tab-item:hover {
  color: var(--secondary);
}

.page-tabs .tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   14.3 Toast 提示系统
   全站统一 Toast 样式
   ============================================================ */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: 92vw;
}

.toast {
  background: var(--secondary);
  color: #fff;
  padding: 10px 28px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  animation: toastSlideIn 0.3s ease;
  pointer-events: auto;
  max-width: 100%;
  text-align: center;
  transition: opacity 0.3s ease;
}

.toast.success {
  background: var(--success);
}

.toast.warning {
  background: var(--warning);
}

.toast.danger {
  background: var(--danger);
}

.toast.info {
  background: var(--secondary);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================================
   14.4 骨架屏 .skeleton
   加载占位动画
   ============================================================ */
.skeleton {
  background: var(--line);
  animation: pulse 1.4s ease-in-out infinite;
  border-radius: 10px;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.skel-card {
  height: 96px;
  border-radius: var(--radius);
}

.skel-line {
  height: 14px;
  margin-bottom: 8px;
}

.skel-line.short {
  width: 60%;
}

/* ============================================================
   14.5 空状态 .empty-state
   无数据时的占位提示
   ============================================================ */
.empty-state {
  text-align: center;
  color: var(--secondary-muted);
  padding: 60px 20px;
  font-size: 14px;
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state .title {
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
}

.empty-state .desc {
  color: var(--secondary-muted);
  margin-bottom: 20px;
}

/* ============================================================
   14.6 KPI 卡片 .kpi-grid / .kpi-card
   用于工厂总览、获客总览等页面
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.kpi-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .2s;
  border: 1px solid transparent;
  min-width: 0;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-pale);
}

.kpi-card:active {
  transform: scale(0.98);
}

.kpi-card .k-label {
  font-size: 13px;
  color: var(--secondary-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.kpi-card .k-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.15;
  word-break: break-all;
}

.kpi-card .k-change {
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.kpi-card .k-change.up {
  color: var(--success);
}

.kpi-card .k-change.down {
  color: var(--danger);
}

.kpi-card .k-change.neutral {
  color: var(--secondary-muted);
}

.kpi-card .k-sub {
  font-size: 12px;
  color: var(--secondary-muted);
  margin-top: 4px;
}

.kpi-card .k-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--danger-soft);
  color: var(--danger);
}

.kpi-card .k-badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.kpi-card .k-source {
  font-size: 10px;
  color: var(--secondary-muted);
  margin-top: 8px;
  opacity: 0.6;
  border-top: 1px dashed var(--line);
  padding-top: 6px;
}

/* KPI 卡片响应式 */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-card .k-value {
    font-size: 22px;
  }
  .kpi-card {
    padding: 14px 16px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .kpi-card {
    padding: 12px 14px;
  }
  .kpi-card .k-value {
    font-size: 18px;
  }
  .kpi-card .k-label {
    font-size: 11px;
  }
}

/* ============================================================
   14.7 快捷入口 .quick-grid / .quick-card
   用于工厂总览等页面
   ============================================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.quick-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.quick-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--primary);
}

.quick-card:active {
  transform: scale(0.97);
}

.quick-card .left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.quick-card .left .emoji {
  font-size: 24px;
  background: var(--primary-pale);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.quick-card .left .info {
  min-width: 0;
}

.quick-card .left .info .title {
  font-weight: 600;
  font-size: 15px;
  color: var(--secondary);
}

.quick-card .left .info .desc {
  font-size: 12px;
  color: var(--secondary-muted);
}

.quick-card .arrow {
  color: var(--secondary-muted);
  font-size: 20px;
  transition: 0.2s;
  flex-shrink: 0;
}

.quick-card:hover .arrow {
  transform: translateX(4px);
  color: var(--primary);
}

@media (max-width: 1200px) {
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .quick-card {
    padding: 12px 14px;
  }
  .quick-card .left .emoji {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .quick-card .left .info .title {
    font-size: 13px;
  }
}

/* ============================================================
   14.8 左侧筛选器 .filter-aside
   用于AI选品、客户挖掘等页面
   ============================================================ */
.filter-aside {
  width: 288px;
  flex-shrink: 0;
  min-width: 288px;
  max-width: 288px;
  overflow: hidden;
}

.filter-aside-inner {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 24px;
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 100%;
}

.filter-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--secondary);
  margin: 0;
}

.filter-reset {
  font-size: 12px;
  color: var(--secondary-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.filter-reset:hover {
  color: var(--primary);
}

.filter-body {
  max-height: 750px;
  overflow-y: auto;
}

.filter-section {
  border-bottom: 1px solid var(--line);
}

.filter-section:last-child {
  border-bottom: none;
}

.filter-toggle {
  width: 100%;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.filter-toggle:hover {
  background: var(--primary-pale);
}

.filter-toggle span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arrow-icon {
  transition: transform .3s ease;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.arrow-icon.open {
  transform: rotate(90deg);
}

.filter-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease-out;
}

.filter-content.default-open {
  max-height: 600px;
}

.filter-inner {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-footer {
  padding: 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
}

.filter-footer .start-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-family: inherit;
  transition: background .2s ease;
}

.filter-footer .start-btn:hover {
  background: var(--primary-deep);
}

@media (max-width: 1024px) {
  .filter-aside {
    display: none;
  }
}

/* ============================================================
   14.9 分发链路进度条
   用于工厂总览、内容管理分发链路
   ============================================================ */
.distribute-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}

.distribute-item:last-child {
  margin-bottom: 0;
}

.distribute-item .label {
  width: 80px;
  flex-shrink: 0;
  color: var(--secondary-muted);
}

.distribute-item .bar-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.distribute-item .bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s ease;
}

.distribute-item .bar-fill.primary {
  background: var(--primary);
}

.distribute-item .bar-fill.orange {
  background: var(--warning);
}

.distribute-item .bar-fill.gold {
  background: var(--gold);
}

.distribute-item .bar-fill.green {
  background: var(--success);
}

.distribute-item .bar-fill.blue {
  background: var(--info);
}

.distribute-item .percent {
  width: 44px;
  text-align: right;
  font-weight: 600;
  color: var(--secondary);
}

/* ============================================================
   14.10 待办事项 .todo-item
   用于工厂总览、获客总览等页面
   ============================================================ */
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  margin-bottom: 8px;
  transition: background 0.15s;
  cursor: pointer;
}

.todo-item:hover {
  background: var(--primary-pale);
}

.todo-item:active {
  transform: scale(0.99);
}

.todo-item:last-child {
  margin-bottom: 0;
}

.todo-item .priority {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.todo-item .priority.high {
  background: var(--danger);
}

.todo-item .priority.medium {
  background: var(--warning);
}

.todo-item .priority.low {
  background: var(--success);
}

.todo-item .content {
  flex: 1;
  font-size: 14px;
  color: var(--secondary);
  min-width: 0;
}

.todo-item .content strong {
  font-weight: 600;
}

.todo-item .action-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.todo-item .action-link:hover {
  text-decoration: underline;
}

/* ============================================================
   14.11 数据来源说明 .data-source-bar
   ============================================================ */
.data-source-bar {
  font-size: 12px;
  color: var(--secondary-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  border: 1px solid var(--line);
}

.data-source-bar .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
}

.data-source-bar .dot.green {
  background: var(--success);
}

.data-source-bar .dot.orange {
  background: var(--warning);
}

.data-source-bar .learn-more {
  margin-left: auto;
  cursor: pointer;
  color: var(--primary);
}

.data-source-bar .learn-more:hover {
  text-decoration: underline;
}

/* ============================================================
   14.12 Box Header（区块标题）
   ============================================================ */
.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.box-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  margin: 0;
}

.detail-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.detail-link:hover {
  text-decoration: underline;
}

/* ============================================================
   14.13 状态标签（通用）
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--gold-soft);
  color: var(--secondary);
}

.tag.primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.muted {
  background: var(--bg);
  color: var(--secondary-soft);
}

.tag.green {
  background: var(--success-soft);
  color: var(--success);
}

.tag.gold {
  background: var(--gold-soft);
  color: var(--gold);
}

/* ============================================================
   页眉 · AI 智能助手（V9.5 新增 · 仅新增不改动其他页眉元素）
   ============================================================ */

/* ---- AI 触发按键 ---- */
.ai-trigger {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  font-size: 14px;
  flex-shrink: 0;
}
.ai-trigger .ai-icon {
  font-size: 18px;
  line-height: 1;
}
.ai-trigger:hover {
  background: var(--primary-pale);
  border-color: var(--primary);
  transform: scale(1.05);
}
.ai-trigger .ai-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  border: 1.5px solid var(--panel);
  display: none;
}
.ai-badge.has-unread {
  display: block;
  animation: aiPulse 1.2s ease-in-out infinite;
}
@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* ---- AI 助手弹窗 ---- */
.ai-popup {
  position: fixed;
  top: var(--topbar-h);
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: 480px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  z-index: 99999;
  display: none;
  overflow: hidden;
  flex-direction: column;
  animation: aiSlideDown 0.2s ease;
}
.ai-popup.open {
  display: flex;
}
@keyframes aiSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.ai-popup-header .ai-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.ai-popup-header .ai-close {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ai-popup-header .ai-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== 【V5.6-M M1-2/M1-3】助手弹窗双区：页签 + 提醒区（颜色全走 Token） ===== */
.ai-popup-tabs {
  display: flex;
  flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.ai-popup-tabs .ai-tab {
  flex: 1;
  padding: 9px 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ai-popup-tabs .ai-tab:hover { color: var(--secondary); }
.ai-popup-tabs .ai-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.ai-popup-tabs .ai-tab-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  vertical-align: 1px;
}
/* 未激活页签默认由 CSS 隐藏（禁 JS 延迟隐藏，防 FOUC） */
.ai-tab-panel { display: none; flex-direction: column; flex: 1; min-height: 0; }
.ai-tab-panel.active { display: flex; }

.ai-alert-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-alert-bar .ai-alert-count { color: var(--muted); font-size: 12px; }
.ai-alert-bar .ai-alert-readall {
  border: none; background: transparent; color: var(--primary);
  font-size: 12px; cursor: pointer; padding: 2px 4px;
}
.ai-alert-bar .ai-alert-readall:hover { text-decoration: underline; }
.ai-alert-list { flex: 1; overflow-y: auto; padding: 4px 0; max-height: 300px; min-height: 140px; }
.ai-alert-empty { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.ai-alert-item {
  padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.ai-alert-item:hover { background: var(--primary-pale); }
.ai-alert-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-alert-item-title { font-size: 13px; color: var(--secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-alert-item.unread .ai-alert-item-title { font-weight: 600; }
.ai-alert-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); margin-left: 6px; vertical-align: 1px; }
.ai-alert-tag { flex-shrink: 0; font-size: 11px; color: var(--secondary-soft); background: var(--primary-pale); border-radius: 4px; padding: 1px 6px; }
.ai-alert-time { margin-top: 3px; font-size: 11px; color: var(--secondary-muted); }
.ai-alert-item-body { margin-top: 7px; border-top: 1px dashed var(--border); padding-top: 7px; }
.ai-alert-content { font-size: 12px; color: var(--secondary-soft); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.ai-alert-hint { margin-top: 6px; font-size: 11px; color: var(--secondary-muted); }
.ai-alert-actions { display: flex; gap: 8px; margin-top: 8px; }
.ai-alert-act {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--secondary);
  font-size: 12px; border-radius: var(--radius-sm); padding: 3px 10px; cursor: pointer;
}
.ai-alert-act:hover { border-color: var(--primary); color: var(--primary); }
.ai-alert-reply-echo {
  margin-top: 6px; padding: 6px 8px; border-radius: var(--radius-sm);
  background: var(--primary-pale); color: var(--secondary); font-size: 12px;
}
.ai-alert-footer {
  flex-shrink: 0; border-top: 1px solid var(--border); padding: 8px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.ai-alert-reply { display: none; gap: 6px; }
.ai-alert-reply .ai-input {
  flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--secondary); outline: none;
}
.ai-alert-reply .ai-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-pale); }
.ai-alert-reply .ai-send {
  flex-shrink: 0; height: 32px; padding: 0 14px; border: none; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 13px; cursor: pointer;
}
.ai-alert-more {
  border: none; background: transparent; color: var(--primary);
  font-size: 12px; cursor: pointer; padding: 2px 0;
}
.ai-alert-more:hover { text-decoration: underline; }

.ai-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  max-height: 260px;
}
.ai-popup-body .ai-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}
.ai-popup-body .ai-msg.bot {
  background: var(--sidebar-bg);
  color: var(--secondary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.ai-popup-body .ai-msg.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-popup-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-popup-footer .ai-input-row {
  display: flex;
  gap: 8px;
}
.ai-popup-footer .ai-input-row .ai-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--panel);
  color: var(--secondary);
  outline: none;
}
.ai-popup-footer .ai-input-row .ai-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-pale);
}
.ai-popup-footer .ai-input-row .ai-send {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ai-popup-footer .ai-input-row .ai-send:hover {
  background: var(--primary-deep);
}
.ai-popup-footer .ai-tip {
  font-size: 11px;
  color: var(--secondary-muted);
  line-height: 1.5;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .ai-popup {
    top: calc(var(--topbar-h) - 4px);
    right: 10px;
    width: calc(100vw - 20px);
    max-height: 70vh;
  }
}

/* ============================================================
   【V9.5 打磨 · 任务15】移动端 H5 全局入口
   - topbar 按钮（layout.js buildTopbar .mobile-entry）
   - 侧边栏底部链接（layout.js buildSidebar .mobile-entry-link）
   - 仅复用既有 Token，不新增色值；按文件约定追加于文末，不改既有样式
   ============================================================ */
.topbar-actions .mobile-entry {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.topbar-actions .mobile-entry:hover {
  background: var(--sidebar-bg);
}
.sidebar-note .mobile-entry-link {
  color: var(--primary);
  font-weight: 500;
}
.sidebar-note .mobile-entry-link:hover {
  text-decoration: underline;
}

/* ============================================================
   分层权限控制（20260830_01）：导航锁标 + 权限引导弹窗 + 轻提示
   仅引用既有 Token，不新增业务色值
   ============================================================ */
.geo-tree-link .geo-lock-badge {
  margin-left: auto;
  font-size: 12px;
  line-height: 1;
  opacity: 0.72;
  transform: translateX(2px);
}
.geo-tree-row:hover .geo-lock-badge {
  opacity: 1;
}
.ac-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 10000;
  max-width: min(480px, calc(100vw - 32px));
  padding: 10px 18px;
  border-radius: var(--radius-sm, 8px);
  background: var(--panel, #fff);
  color: var(--text, #1f2329);
  border: 1px solid var(--line, #e5e6eb);
  box-shadow: var(--shadow-hover, 0 8px 24px rgba(0, 0, 0, 0.12));
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ac-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ac-toast.is-error {
  border-color: var(--danger, #e63917);
  color: var(--danger, #e63917);
}
.ac-guide-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ac-guide-panel {
  position: relative;
  width: min(400px, 100%);
  background: var(--panel, #fff);
  border-radius: var(--radius-sm, 12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  padding: 28px 24px 24px;
  text-align: center;
}
.ac-guide-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted, #86909c);
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
}
.ac-guide-close:hover {
  background: var(--sidebar-bg, #f7f8fa);
  color: var(--text, #1f2329);
}
.ac-guide-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 12px;
}
.ac-guide-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text, #1f2329);
}
.ac-guide-desc {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted, #86909c);
  word-break: break-all;
}
.ac-guide-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.ac-btn-primary {
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-sm, 8px);
  background: var(--primary, #e63917);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.ac-btn-primary:hover {
  filter: brightness(0.96);
}
.ac-btn-ghost {
  padding: 9px 22px;
  border: 1px solid var(--line, #e5e6eb);
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  color: var(--muted, #86909c);
  font-size: 14px;
  cursor: pointer;
}
.ac-btn-ghost:hover {
  color: var(--text, #1f2329);
  border-color: var(--line-strong, #c9cdd4);
}

/* 20261025 认证页协议链接：统一用主色标识「可单独点开查看」（此前继承父级灰色，用户反馈不像可点） */
.agreement a,
.agreement label a,
.yc-auth-agree a {
  color: #E63917;
  text-decoration: none;
}
.agreement a:hover,
.agreement label a:hover,
.yc-auth-agree a:hover {
  text-decoration: underline;
}
