/* ═══════════════════════════════════════════════════════════════════
   企业智能工作台 · 门户设计系统（portal.css）
   在 app.css 之后加载：覆盖/补充门户专属视觉与组件。
   风格：简洁、清晰、卡片化；符合国人交互逻辑。
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. 设计令牌（门户专属，覆盖 app.css 同名变量） ─────────────── */
:root {
  /* 商业运营化（2026-09-29）：主色转深商务蓝、圆角收敛（12→9）、阴影扁平化（描边优先） */
  --brand: #1e40af;
  --brand-weak: #eef2fb;
  --brand-strong: #1e3a8a;
  --success: #15803d;
  --success-weak: #f0fdf4;
  --danger: #b91c1c;
  --danger-weak: #fef2f2;
  --warn: #b45309;
  --warn-weak: #fffbeb;
  --info: #0e7490;
  --info-weak: #ecfeff;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e3e8ef;
  --border-strong: #cdd5e0;
  --muted: #5c6b80;
  --text: #1a2332;
  --radius: 9px;
  --radius-sm: 7px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, .10);
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}
html[data-theme='dark'] {
  /* 高级灰（对齐控制台 app.css 深色调色板，2026-09-21 由深蓝改灰）：中性色全部去蓝，
     品牌蓝 #7fa5ff 仅作 accent 保留 */
  --brand: #7fa5ff;
  --brand-weak: #26282d;
  --brand-strong: #9db8ff;
  --success: #4ade80;
  --success-weak: #0a2e1a;
  --danger: #f87171;
  --danger-weak: #3b0d0d;
  --warn: #fbbf24;
  --warn-weak: #33260a;
  --info: #22d3ee;
  --info-weak: #222428;
  --bg: #161719;
  --surface: #1e1f22;
  --surface-2: #242629;
  --border: #303236;
  --border-strong: #43464c;
  --muted: #9b9ea4;
  --text: #e8e9eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
}
body { font-family: var(--font); background: var(--bg); color: var(--text); }

/* ── 2. 页面骨架：顶栏 / 侧边栏 ─────────────────────────────────── */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.topbar-title { font-weight: 600; font-size: 15px; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 12px 10px; gap: 2px; }
.nav-group {
  font-size: 11px; color: var(--muted); padding: 10px 12px 4px;
  letter-spacing: .04em; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px; border: none;
  background: transparent; color: var(--muted);
  font-size: 13.5px; cursor: pointer; transition: all .15s ease;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.nav-item .icon { width: 17px; height: 17px; flex: none; }
.nav-item.active .icon { color: var(--brand); }

/* ── 3. 页面头部 ────────────────────────────────────────────────── */
.portal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.portal-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.portal-title .icon { color: var(--brand); width: 20px; height: 20px; }
.portal-sub { color: var(--muted); font-weight: 400; font-size: 12px; }
.portal-desc { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; line-height: 1.6; }

/* ── 4. 卡片 / 网格 ─────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.panel, .card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.panel h3, .card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel h3 .icon, .card h3 .icon { width: 16px; height: 16px; color: var(--brand); }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title-row h3 { margin: 0; }

/* ── 5. 统计卡（图标 + 数字） ───────────────────────────────────── */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-weak); color: var(--brand);
}
.stat-card .stat-icon .icon { width: 20px; height: 20px; }
.stat-card .stat-body { min-width: 0; }
.stat-card .stat-value { font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card .stat-value.accent { color: var(--brand); }
.stat-card .stat-value.success { color: var(--success); }
.stat-card .stat-value.warn { color: var(--warn); }
.stat-card .stat-value.danger { color: var(--danger); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── 6. 进度条（额度/用量可视化） ───────────────────────────────── */
.progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.progress-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.progress-row .label { color: var(--muted); }
.progress-row .value { font-variant-numeric: tabular-nums; }
.progress {
  height: 8px; border-radius: 99px; background: var(--surface-2);
  border: 1px solid var(--border); overflow: hidden;
}
.progress .bar {
  height: 100%; border-radius: 99px; background: var(--brand);
  transition: width .4s ease;
}
.progress .bar.warn { background: var(--warn); }
.progress .bar.danger { background: var(--danger); }

/* ── 7. Tab（胶囊页签） ─────────────────────────────────────────── */
.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-tabs .pill {
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13px;
  cursor: pointer; transition: all .15s ease; font-weight: 500;
}
.pill-tabs .pill:hover { border-color: var(--brand); color: var(--brand); }
.pill-tabs .pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill-tabs .pill .cnt { opacity: .75; font-size: 12px; margin-left: 4px; }

/* ── 8. 搜索框 / 筛选 ───────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box {
  position: relative; flex: 1; min-width: 180px; max-width: 320px;
}
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search-box input {
  width: 100%; padding: 8px 12px 8px 34px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 13px; box-sizing: border-box; transition: border-color .15s;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.toolbar .spacer { flex: 1; }

/* ── 9. 表格（卡片内嵌，hover 反馈） ────────────────────────────── */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-wrap { overflow-x: auto; }
.table-card .table-wrap { margin: 0; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-card thead th {
  background: var(--surface-2); color: var(--muted); font-weight: 600;
  text-align: left; padding: 10px 14px; font-size: 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table-card tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-card tbody tr:last-child td { border-bottom: none; }
.table-card tbody tr { transition: background .12s ease; }
.table-card tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-card .empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── 10. 空状态（图标 + 文案 + 引导） ───────────────────────────── */
.empty-state {
  padding: 40px 20px; text-align: center; color: var(--muted);
}
.empty-state .empty-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
}
.empty-state .empty-icon .icon { width: 24px; height: 24px; color: var(--muted); }
.empty-state .empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state .empty-desc { font-size: 12.5px; line-height: 1.6; }
.empty-state .empty-action { margin-top: 14px; }

/* ── 11. Toast 分级提示 ─────────────────────────────────────────── */
#portal-notice { border-radius: 10px; font-size: 13px; padding: 10px 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
#portal-notice.success { background: var(--success-weak); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
#portal-notice.error { background: var(--danger-weak); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
#portal-notice.warn { background: var(--warn-weak); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* ── 12. 确认弹窗（替换原生 confirm） ───────────────────────────── */
.modal-card { border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; }
.modal-card h2 { font-size: 15px !important; display: flex; align-items: center; gap: 8px; }
.confirm-body { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0 8px; }
.confirm-body .confirm-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.confirm-body .confirm-icon .icon { width: 20px; height: 20px; }
.confirm-body .confirm-icon.danger { background: var(--danger-weak); color: var(--danger); }
.confirm-body .confirm-icon.warn { background: var(--warn-weak); color: var(--warn); }
.confirm-body .confirm-icon.info { background: var(--brand-weak); color: var(--brand); }
.confirm-body .confirm-text { font-size: 13.5px; line-height: 1.7; }
.confirm-body .confirm-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ── 13. 骨架屏 ─────────────────────────────────────────────────── */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s infinite; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.skeleton-card .skeleton { margin-bottom: 10px; }
.skeleton-card .skeleton:last-child { margin-bottom: 0; }

/* ── 14. 页码分页 ───────────────────────────────────────────────── */
.page-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px 14px; flex-wrap: wrap; }
.page-pager .page-info { margin-right: auto; color: var(--muted); font-size: 12.5px; }
.page-pager .page-size-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.page-pager .page-size { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--text); font-size: 12.5px; }
.page-pager .page-num {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 12.5px; cursor: pointer; transition: all .15s;
}
.page-pager .page-num:hover { border-color: var(--brand); color: var(--brand); }
.page-pager .page-num.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-pager .page-num:disabled { opacity: .4; cursor: default; }

/* ── 15. 更多操作菜单（⋯） ─────────────────────────────────────── */
.more-wrap { position: relative; display: inline-block; }
.more-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
.more-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.more-btn .icon { width: 16px; height: 16px; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 60;
  min-width: 150px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; display: none;
}
.more-menu.open { display: block; }
.more-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; border-radius: 7px;
  color: var(--text); font-size: 13px; cursor: pointer; text-align: left;
}
.more-menu button:hover { background: var(--surface-2); }
.more-menu button .icon { width: 15px; height: 15px; color: var(--muted); }
.more-menu button.danger { color: var(--danger); }
.more-menu button.danger .icon { color: var(--danger); }

/* ── 16. 徽标 / 标签 ────────────────────────────────────────────── */
.tag { border-radius: 6px; font-size: 12px; padding: 2px 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.badge.brand { background: var(--brand-weak); color: var(--brand); }
.badge.success { background: var(--success-weak); color: var(--success); }
.badge.danger { background: var(--danger-weak); color: var(--danger); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.info { background: var(--info-weak); color: var(--info); }
.badge.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ── 17. 键值信息列表（详情/概览用） ────────────────────────────── */
.kv-list { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13px; }
.kv-list .kv-label { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.kv-list .kv-value { word-break: break-all; }

/* ── 18. 价格卡片（套餐购买）：一行 4-5 个，宽屏 5 列、常规 4 列、小屏递减 ── */
.price-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (min-width: 1280px) { .price-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .price-grid { grid-template-columns: 1fr; } }
.price-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px; position: relative; display: flex; flex-direction: column; gap: 10px;
  transition: all .18s ease; box-shadow: var(--shadow-sm); min-width: 0;
}
.price-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.price-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
.price-card .pc-name { font-size: 15px; font-weight: 700; }
.price-card .pc-price { display: flex; align-items: baseline; gap: 4px; }
.price-card .pc-price .num { font-size: 26px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.price-card .pc-price .unit { font-size: 13px; color: var(--muted); }
.price-card.current .pc-price .num { color: var(--brand-strong); }
.price-card .pc-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.price-card .pc-features li { font-size: 12.5px; color: var(--muted); display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.price-card .pc-features li .icon { width: 14px; height: 14px; color: var(--success); flex: none; margin-top: 2px; }
.price-card .pc-badge { position: absolute; top: -9px; right: 14px; }

/* ── 19. 会话详情：时间线 + 消息气泡 ────────────────────────────── */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline .tl-item { position: relative; margin-bottom: 14px; }
.timeline .tl-item::before {
  content: ''; position: absolute; left: -21px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
}
.timeline .tl-item.input::before { border-color: var(--brand); }
.timeline .tl-item.output::before { border-color: var(--success); }
.timeline .tl-item.tool::before { border-color: var(--warn); }
.timeline .tl-item.approval::before { border-color: var(--danger); }
.chat-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.7;
  border: 1px solid var(--border); background: var(--surface-2); white-space: pre-wrap; word-break: break-word;
}
.chat-bubble.user { background: var(--brand-weak); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.chat-bubble.assistant { background: var(--surface); border-color: var(--border); }
.chat-bubble .bubble-head { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.audit-row { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }

/* ── 20. 表单（分组卡片内） ─────────────────────────────────────── */
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 5px; display: block; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 13px; box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak);
}
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.form-card h3 { margin: 0 0 12px; font-size: 14px; }
.form-section { margin-bottom: 18px; }
.form-section:last-child { margin-bottom: 0; }
.form-section .sec-title { font-size: 13px; font-weight: 600; margin: 0 0 4px; }
.form-section .sec-desc { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

/* ── 20b. 企业配置：客户端行为与品牌（双行紧凑：客户端行为 3 项一行、品牌下发 2 项一行，注释置底） ── */
.brand-form .brand-cat {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 2px 0 8px; letter-spacing: .02em;
}
.brand-form .brand-cat + .brand-cat { margin-top: 8px; }
.brand-form .brand-cat-row {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.brand-form .brand-cat-row .field { flex: 1 1 220px; min-width: 0; }
.brand-form .field label { margin-bottom: 6px; font-size: 12.5px; }
.brand-form .field input, .brand-form .field select { padding: 9px 12px; font-size: 13px; }
.brand-form .field input[type="color"] { padding: 3px 5px; height: 40px; width: 78px; }
.brand-form .brand-logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand-form .brand-notes {
  margin: 4px 0 14px; padding: 12px 14px;
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 10px; font-size: 12px; color: var(--muted); line-height: 1.7;
}

/* ── 21. 按钮微调 ───────────────────────────────────────────────── */
.btn { border-radius: var(--radius-xs); font-size: 13px; padding: 8px 14px; transition: all .15s ease; }
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-strong); }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }

/* ── 22. 输入卡片行内提示 / 说明 ────────────────────────────────── */
.notice { border-radius: 10px; font-size: 12.5px; }

/* ── 23. 响应式微调 ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 12px 14px; }
  .toolbar .search-box { max-width: none; }
}

/* ── 24. 仪表盘 Tab 面板 / 配额网格 ─────────────────────────────── */
.dash-pane { display: none; }
.dash-pane.active { display: block; }
.ent-pane { display: none; }
.ent-pane.active { display: block; }
.quota-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .quota-grid { grid-template-columns: 1fr; } }

/* ── 25. 时间线内的普通事件行（圆点 + 卡片） ────────────────────── */
.timeline .audit-row { position: relative; margin-bottom: 12px; }
.timeline .audit-row::before {
  content: ''; position: absolute; left: -21px; top: 12px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
}
.timeline .audit-row.input::before { border-color: var(--brand); }
.timeline .audit-row.output::before { border-color: var(--success); }
.timeline .audit-row.tool::before { border-color: var(--warn); }
.timeline .audit-row.approval::before { border-color: var(--danger); }
.timeline .audit-row.request::before { border-color: var(--info); }

/* ── 26. 自有渠道卡片（对齐全局设计系统） ───────────────────────── */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.channel-card { display: flex; flex-direction: column; gap: 12px; }
.channel-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--brand-weak); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.channel-name { font-weight: 700; font-size: 14.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.channel-url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; word-break: break-all; }
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.card-actions .btn { flex: 1; justify-content: center; }

/* ── 27. 企业账户：总览卡 / 付款信息 ────────────────────────────── */
.account-summary {
  display: flex; align-items: center; gap: 28px;
  padding: 24px 28px; margin-bottom: 16px; flex-wrap: wrap;
}
.as-main { display: flex; align-items: center; gap: 16px; }
.as-icon {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  background: var(--brand-weak); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.as-icon .icon { width: 28px; height: 28px; }
.as-balance { min-width: 0; }
.as-num { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.as-yuan { font-size: 17px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.as-divider { width: 1px; height: 58px; background: var(--border); }
.as-info { display: flex; gap: 28px; flex-wrap: wrap; flex: 1; min-width: 260px; }
.as-item { display: flex; flex-direction: column; gap: 4px; }
.as-item strong { font-size: 14px; }
.as-item .badge { align-self: flex-start; }
@media (max-width: 680px) {
  .as-divider { display: none; }
  .account-summary { gap: 18px; padding: 20px; }
}

/* ── 28. 内容区宽度分层：2K 基准 / 4K 居中 / 1K 全宽 / 平板手机沿用断点 ── */
@media (min-width: 1920px) {
  .content {
    max-width: 1600px;      /* 2K 基准内容宽度：4K/2K 屏均保持此宽度 */
    margin: 0 auto;         /* 超宽屏居中，左右留白对称 */
    padding: 24px 32px;
  }
}
@media (min-width: 1024px) and (max-width: 1919px) {
  .content { max-width: none; padding: 20px 24px; }
}
/* 表单主按钮限宽（内容区限宽后仍避免整行拉伸） */
#p-inv-submit { max-width: 420px; }
@media (min-width: 1024px) { #p-inv-submit { max-width: 420px; } }

/* ── 29. 表格防堆积错位（2K/4K 宽屏）：单元格不换行，长内容由容器横向滚动兜底 ── */
.table-card th, .table-card td { white-space: nowrap; }
.table-card td .tag { display: inline-block; margin: 1px 2px; vertical-align: middle; }
.table-card td .mono { font-size: 12px; }
/* 筛选表单：宽屏一行排列（日期/员工/令牌/查询），窄屏自动换行 */
.form-card .form-row { flex-wrap: wrap; }
.form-card .form-row .field { min-width: 0; }
@media (min-width: 1200px) {
  .form-card .form-row { flex-wrap: nowrap; }
  .form-card .form-row .field { flex: 1 1 auto; }
}

/* ── 30. 表格紧凑化（2K/4K 宽屏减少横向滚动，不删任何字段） ────── */
.table-card td { padding: 10px 9px; }
.table-card th { padding: 9px 9px; }
.table-card td .tag { font-size: 11px; padding: 1px 5px; }
.table-card td .mono { font-size: 11.5px; }
.table-card td.num { font-size: 12px; }
.table-card td .btn.small { padding: 4px 8px; font-size: 12px; }

/* ── 31. 模型列：固定宽度，内容换行显示，悬停可看完整（防止撑宽整表） ── */
.table-card td.models-col {
  max-width: 280px;
  min-width: 140px;
  white-space: normal;      /* 允许换行（覆盖全局 nowrap） */
  line-height: 1.8;
}
.table-card td.models-col .tag { margin: 1px 3px 1px 0; }

/* ── 32. 安全风控提示区（令牌调用审计） ─────────────────────────── */
.risk-area { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.risk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6;
}
.risk-bar .icon { width: 16px; height: 16px; flex: none; }
.risk-bar.danger { background: var(--danger-weak); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.risk-bar.warn { background: var(--warn-weak); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.risk-bar.safe { background: var(--success-weak); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent); }
.risk-bar .tag { cursor: pointer; background: var(--surface); }

/* ── 工作质量研判（AI 研判卡 + 员工画像） ────────────────────────── */
/* Tab 面板显隐（会话详情 pill-tabs / 令牌审计页签等共用）：
   此前缺失该规则导致所有 tab 面板同时渲染堆叠（文字挤向两侧、内容互相遮挡）。 */
.tabpane { display: none; }
.tabpane.active { display: block; }
/* 研判卡容器（.card 已提供 18px/20px 内边距；不得再覆盖 padding 否则内容贴边） */
.analysis-card { }
/* 长文本换行防护（防证据/建议/解读溢出被遮挡） */
.analysis-summary, .analysis-dim-note, .analysis-manager, .analysis-timing-note,
.analysis-suggestions li, .analysis-disclaimer, .analysis-goal, .analysis-status-note {
  word-break: break-word; overflow-wrap: anywhere;
}
.analysis-timing-value { min-width: 84px; }
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.analysis-title { font-size: 15px; font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.analysis-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.analysis-empty-body p { margin: 8px 0; line-height: 1.7; }
.analysis-empty-body .btn { margin-top: 10px; }
.analysis-overview {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-weak, rgba(127,165,255,.08)); margin-bottom: 14px;
}
.analysis-composite { font-size: 14px; }
.analysis-composite b { font-size: 22px; color: var(--brand); margin: 0 2px; }
.analysis-summary { flex: 1 1 260px; font-size: 13.5px; line-height: 1.6; }
.analysis-goal, .analysis-status-note { width: 100%; font-size: 13px; color: var(--muted, #6b7280); }
.analysis-dims { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.analysis-dim-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.analysis-dim-name { font-size: 13.5px; font-weight: 700; min-width: 88px; }
.analysis-dim-hint { font-size: 12px; color: var(--muted, #6b7280); flex: 1; }
.analysis-dim-score { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.analysis-bar { height: 7px; border-radius: 4px; background: rgba(127,127,127,.18); overflow: hidden; }
.analysis-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.analysis-dim-note { font-size: 12.5px; color: var(--muted, #6b7280); margin-top: 6px; line-height: 1.6; }
.analysis-evidence { margin-top: 8px; font-size: 12.5px; }
.analysis-evidence summary { cursor: pointer; color: var(--brand); user-select: none; }
.analysis-evidence ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.analysis-evidence li { color: var(--muted, #6b7280); line-height: 1.6; border-left: 2px solid rgba(127,127,127,.3); padding-left: 8px; }
.analysis-timing { border-top: 1px dashed rgba(127,127,127,.3); padding-top: 12px; margin-bottom: 12px; }
.analysis-timing-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.analysis-timing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 18px; }
.analysis-timing-item { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.analysis-timing-label { color: var(--muted, #6b7280); }
.analysis-timing-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.analysis-timing-note {
  font-size: 13px; color: var(--muted, #6b7280); background: var(--bg-weak, rgba(127,165,255,.08));
  border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.7;
}
.analysis-manager {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13.5px; font-weight: 600; line-height: 1.7;
  background: var(--warn-weak, rgba(247,144,9,.1)); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
}
.analysis-suggestions { margin-bottom: 12px; }
.analysis-suggest-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.analysis-suggestions ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.analysis-suggestions li { font-size: 13px; line-height: 1.6; }
.analysis-disclaimer { font-size: 12px; color: var(--muted, #6b7280); border-top: 1px dashed rgba(127,127,127,.3); padding-top: 10px; }

.card-list { display: flex; flex-direction: column; gap: 12px; }
.employee-card { padding: 16px 18px; }
.employee-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.employee-identity { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.employee-name { font-size: 16px; font-weight: 800; }
.employee-metrics { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.employee-status { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.employee-dims { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 18px; margin-top: 12px; }
.analysis-mini-dim { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.analysis-mini-label { min-width: 66px; color: var(--muted, #6b7280); }
.analysis-mini-dim .analysis-bar { flex: 1; height: 6px; }
.analysis-mini-dim b { min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── 33. 商务风格（2026-09-29 商业运营化改造）：企业级视觉收敛 ─────────
   原则：描边优先、阴影扁平、深商务蓝主导、圆角与徽章方角化、数据表更像报表。 */

/* 顶栏：LOGO 由 .topbar-title .brand-mark（汇流 mark，见 app.css）承担，勿再加伪元素图标 */
.topbar-title > span:first-of-type { letter-spacing: .02em; font-weight: 700; }
.topbar-sub { border-left: 1px solid var(--border-strong); padding-left: 10px; margin-left: 2px; }

/* 侧栏：激活项左侧 2px 品牌竖条 + 更克制的底色；分组标签更小更稳 */
.nav-item { border-radius: 7px; position: relative; }
.nav-item.active { background: var(--brand-weak); }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 20%; bottom: 20%;
  width: 3px; border-radius: 2px; background: var(--brand);
}
.nav-group { text-transform: none; letter-spacing: .1em; font-size: 10.5px; }

/* 卡片：描边优先，弱化投影 */
.panel, .card, .table-card { border-color: var(--border); box-shadow: none; }
.panel h3, .card h3 { letter-spacing: .01em; }

/* 统计卡：图标方块化 + 数字加重（报表感） */
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--brand-weak); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.stat-card .stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.stat-card .stat-label { letter-spacing: .02em; }

/* 表格：报表化表头（浅底 + 600 字重），行线更轻 */
.table-card thead th {
  background: var(--surface-2);
  font-weight: 600; color: var(--muted); letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
}
.table-card tbody td { border-bottom: 1px solid var(--border); }

/* 徽章方角化（胶囊→圆角矩形，企业报表风格） */
.badge { border-radius: 5px; font-weight: 600; }
.tag { border: 1px solid var(--border-strong); background: var(--surface-2); }

/* 登录视图：卡片收敛 + 主按钮加重 */
.relay-login-card { border-radius: 12px; box-shadow: var(--shadow-lg); }
.relay-login-card .btn.primary { font-weight: 600; letter-spacing: .06em; }
