/* ==========================================================================
   企业智能中枢系统 · v8 视觉方向（01 财务运营型 + 07 中国智能办公 + 02 AI 内容工作室）
   说明：本文件是全站唯一新增的视觉层，按「变量 → 外壳 → 通用组件 → 页面类型 → 响应式」
   组织，不按页面堆补丁。基础结构仍由 styles-v5.css / styles-v6.css 提供。
   ========================================================================== */

:root {
  /* 侧栏配色（当前：浅灰蓝 + 信息蓝选中；改下面 8 个变量即可切换）：
     浅灰蓝 + 信息蓝选中（当前） #eef3f9 · #f9fbfe · #2f6bd8 · #e3edfb · #2c3a4a
     暖灰白 + 灰底选中           #f7f6f3 · #faf9f6 · #155f50 · #ecebe6 · #3d3c39
     冷灰白 + 薄荷选中           #f5f8f9 · #fbfcfc · #155f50 · #e4f2ec · #3d4a44
     深色冷灰蓝（备选）          #232838 · #1b2030 · #7aa2ff · rgba(122,162,255,.16)
  */
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --surface-3: #eef2f5;
  --ink: #17201d;
  --ink-2: #36413c;
  --muted: #68766f;
  --faint: #7b8882;
  --line: #e3e8ee;
  --line-strong: #d3dae2;

  --brand: #155f50;
  --brand-dark: #0f4a3e;
  --brand-soft: #dff1ea;
  --brand-2: #1f7a66;

  --info: #2f6bd8;
  --info-soft: #e8f0ff;
  --blue: #2f6bd8;
  --blue-soft: #e8f0ff;
  --green: #2c7a63;
  --green-soft: #e4f6ee;
  --orange: #a2652a;
  --orange-soft: #fff0dc;
  --red: #c04a44;
  --red-soft: #fdecea;

  --ai: #6b5bd2;
  --ai-soft: #eceafb;
  --ai-line: #e3defa;

  --shell: #eef3f9;
  --shell-2: #f9fbfe;
  --shell-text: #2c3a4a;
  --shell-muted: #64748b;
  --shell-accent: #2f6bd8;
  --shell-active: #e3edfb;
  --shell-hover: rgba(47, 107, 216, 0.06);
  --shell-line: #dfe7f1;

  --rail: 64px;
  --context: 220px;
  --topbar: 56px;

  --r-lg: 14px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow: 0 12px 30px rgba(28, 43, 37, 0.08);
  --shadow-sm: 0 4px 14px rgba(28, 43, 37, 0.06);
}

/* --------------------------------------------------------------------------
   1. 外壳：深森林绿导航 + 浅灰蓝工作区
   -------------------------------------------------------------------------- */

.app-shell {
  grid-template-rows: var(--topbar) minmax(0, 1fr);
  background: var(--bg);
}

.global-rail {
  background: var(--shell);
  border-right: 1px solid var(--shell-line);
  padding: 12px 7px;
}

.context-nav {
  background: var(--shell-2);
  color: var(--shell-text);
  border-right: 1px solid var(--shell-line);
}

.context-head {
  border-bottom: 1px solid var(--shell-line);
  padding: 12px 16px;
}

.context-head strong {
  color: var(--shell-text);
  font-size: 13px;
}

.context-head span {
  color: var(--shell-muted);
  font-size: 11px;
}

.context-scroll {
  padding: 10px 8px;
}

.nav-label {
  color: var(--shell-muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.nav-item {
  height: 36px;
  border-radius: 9px;
  color: var(--shell-muted);
  font-size: 12.5px;
}

.nav-item:hover {
  background: var(--shell-hover);
  color: var(--shell-text);
}

.nav-item.active {
  background: var(--shell-active);
  color: var(--shell-accent);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--shell-accent);
}

.nav-item.active .icon {
  color: var(--shell-accent);
}

.nav-count {
  background: #fff;
  color: var(--shell-accent);
}

.context-foot {
  border-top: 1px solid var(--shell-line);
}

.permission-note {
  color: var(--shell-muted);
  font-size: 10.5px;
}

.rail-btn {
  color: var(--shell-muted);
  border-radius: 9px;
}

.rail-btn:hover {
  background: var(--shell-hover);
  color: var(--shell-text);
}

.rail-btn.active {
  background: var(--shell-active);
  color: var(--shell-accent);
}

.rail-env {
  color: var(--shell-muted);
}

.topbar {
  height: var(--topbar);
  gap: 12px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.top-title {
  gap: 8px;
}

.top-title strong {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.top-title span {
  font-size: 12px;
  color: var(--faint);
}

.search-btn {
  width: min(32vw, 400px);
  height: 34px;
  border-radius: 10px;
  border-color: var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
}

.search-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.env-tag {
  display: none;
}

/* 账号入口（左上角） */

.rail-user {
  display: flex;
  justify-content: center;
  padding: 2px 0 14px;
}

.rail-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--shell-line);
  border-radius: 50%;
  overflow: hidden;
  background: var(--shell-active);
  color: var(--shell-accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.rail-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rail-avatar:hover {
  background: #fff;
  border-color: #bcd3ee;
}

.rail-avatar:active {
  transform: translateY(1px);
}

.rail-avatar[aria-expanded='true'] {
  border-color: var(--shell-accent);
  box-shadow: 0 0 0 3px var(--shell-active);
}

.mobile-avatar {
  display: none;
}

.account-popover {
  top: 8px;
  right: auto;
  left: 74px;
  width: 264px;
  padding: 7px;
  border-radius: 12px;
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  background: #fff;
}

.account-popover .popover-profile {
  padding: 10px 10px 12px;
}

.account-popover .popover-scope {
  margin-top: 5px;
  color: var(--brand-dark);
}

.account-popover button {
  min-height: 34px;
  border-radius: 8px;
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   2. 页面骨架与标题
   -------------------------------------------------------------------------- */

.workspace {
  padding: 22px 26px 30px;
  background: var(--bg);
}

.page {
  animation: none;
}

.page-head {
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 25px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.page-head p {
  margin-top: 6px;
  max-width: 78ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.page-actions {
  gap: 9px;
}

.scope {
  height: 32px;
  border-radius: 9px;
  background: #fff;
  border-color: var(--line);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   3. 按钮、表单、控件
   -------------------------------------------------------------------------- */

.btn {
  height: 36px;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.12s;
}

.btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: none;
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.icon-btn {
  border-radius: 9px;
}

.input,
.search-input,
.field input,
.field select,
.field textarea {
  border-radius: 9px;
  border-color: var(--line);
  background: #fff;
}

.input,
.field input,
.field select {
  height: 38px;
}

.search-input {
  height: 36px;
}

.input:focus,
.search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 95, 80, 0.1);
}

.tab {
  min-height: 36px;
  font-size: 12.5px;
  border-radius: 8px 8px 0 0;
}

.tab.active {
  color: var(--brand-dark);
  font-weight: 600;
}

.chip {
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   4. 卡片、指标与数据展示
   -------------------------------------------------------------------------- */

.surface,
.v6-panel,
.tile,
.summary,
.error-state,
.v6-register-main,
.v6-workbench {
  border-radius: var(--r-lg);
  border-color: var(--line);
  box-shadow: none;
}

.surface {
  background: #fff;
}

.surface-header {
  min-height: 60px;
  padding: 14px 18px;
  border-bottom-color: var(--line);
}

.surface-header h2 {
  font-size: 15px;
  font-weight: 650;
}

.surface-header p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--faint);
}

.surface-body {
  padding: 18px;
}

.summary-band {
  gap: 14px;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
}

.summary {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.summary:first-child {
  border-color: #cfe7dd;
  background: var(--brand-soft);
}

.summary label {
  font-size: 12px;
  color: var(--muted);
}

.summary strong {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.summary small {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--faint);
}

.v6-fact-strip {
  gap: 14px;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
}

.v6-fact {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

.v6-fact:last-child {
  border-right: 1px solid var(--line);
}

.v6-fact:first-child {
  border-color: #cfe7dd;
  background: var(--brand-soft);
}

.v6-fact span {
  font-size: 12px;
  color: var(--muted);
}

.v6-fact strong {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.v6-fact small {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--faint);
}

.v6-work-summary,
.v6-portal-strip {
  gap: 14px;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
}

.v6-work-summary > div,
.v6-portal-strip > div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

.v6-work-summary > div:first-child,
.v6-portal-strip > div:first-child {
  border-color: #cfe7dd;
  background: var(--brand-soft);
}

.v6-work-summary > div:last-child,
.v6-portal-strip > div:last-child {
  border-right: 1px solid var(--line);
}

.v6-work-summary strong,
.v6-portal-strip strong {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.v6-work-summary .v6-summary-alert {
  background: var(--orange-soft);
  border-color: #f0ddc2;
}

/* --------------------------------------------------------------------------
   5. 表格、工具栏、分页
   -------------------------------------------------------------------------- */

.data-table th {
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.sort-btn {
  height: 40px;
  font-size: 11.5px;
}

.data-table td {
  height: 48px;
  padding: 9px 16px;
  border-bottom: 1px solid #edf1ef;
  color: var(--ink-2);
  font-size: 12.5px;
}

.data-table tbody tr {
  transition: background 0.14s;
}

.data-table tbody tr:hover {
  background: #f3faf6;
}

.data-table tbody tr:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .primary {
  font-weight: 600;
  color: var(--ink);
}

.table-toolbar {
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
}

.v6-search {
  height: 36px;
  width: min(320px, 42vw);
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.v6-search:focus-within {
  border-color: var(--brand);
  background: #fff;
}

.pagination {
  padding: 12px 16px;
}

.pagination button {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
}

.pagination button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.v6-register-views > button {
  min-height: 36px;
  border-radius: 9px;
}

/* --------------------------------------------------------------------------
   6. 状态、标签、提示
   -------------------------------------------------------------------------- */

.status {
  font-size: 12px;
}

.status:before {
  width: 6px;
  height: 6px;
}

.v6-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink-2);
}

.v6-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.v6-state.warn i {
  background: var(--orange);
}

.v6-state.bad i {
  background: var(--red);
}

.tag {
  border-radius: 7px;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.alert-strip {
  border-color: #f0ddc2;
  background: var(--orange-soft);
}

.alert-strip strong {
  color: #7d5420;
}

.kv-block > div,
.kv > span {
  border-color: var(--line);
}

/* --------------------------------------------------------------------------
   7. 详情抽屉、弹窗、命令面板
   -------------------------------------------------------------------------- */

.drawer {
  width: min(440px, 94vw);
  background: #fff;
  box-shadow: -18px 0 50px -28px rgba(16, 32, 27, 0.4);
}

.drawer-head {
  min-height: 56px;
  padding: 0 14px 0 20px;
  background: #fff;
}

.drawer-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.drawer-tags {
  margin-top: 8px;
}

.drawer-body {
  padding: 20px;
}

.drawer-section h3 {
  font-size: 12px;
  color: var(--muted);
}

.drawer-section + .drawer-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.drawer-foot {
  min-height: 62px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.command-box {
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.command-item {
  border-radius: 9px;
}

.popover {
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   8. 空状态
   -------------------------------------------------------------------------- */

.empty-state {
  padding: 52px 24px;
}

.empty-visual {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border-color: var(--line);
  background: var(--surface-2);
}

.empty-visual:after {
  inset: 17px;
  border-radius: 30%;
  border-color: var(--line-strong);
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 650;
}

.empty-state p {
  font-size: 12.5px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   9. 管理驾驶舱：主指标 + 决策列表 + 经营变化 + 脉搏表
   -------------------------------------------------------------------------- */

.cockpit .v6-metric-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.v6-metric {
  position: relative;
  min-width: 0;
  min-height: 112px;
  padding: 16px 18px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  transition:
    transform 0.16s,
    box-shadow 0.16s,
    border-color 0.16s;
}

.v6-metric:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.v6-metric .metric-label,
.v6-metric .metric-value,
.v6-metric .metric-note {
  display: block;
}

.v6-metric .metric-label {
  font-size: 12px;
  color: var(--muted);
}

.v6-metric .metric-value {
  margin-top: 5px;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.v6-metric .metric-note {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--faint);
}

.metric-primary {
  border-color: #0f4a3e;
  background: #155f50;
}

.metric-primary .metric-label {
  color: rgba(255, 255, 255, 0.76);
}

.metric-primary .metric-value {
  color: #fff;
}

.metric-primary .metric-note {
  color: rgba(255, 255, 255, 0.72);
}

.metric-spark {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34px;
  pointer-events: none;
}

.metric-spark svg {
  width: 100%;
  height: 100%;
}

.metric-spark .spark-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
}

.metric-spark .spark-area {
  fill: rgba(255, 255, 255, 0.1);
  stroke: none;
}

.metric-cash {
  border-color: #cddff7;
  background: #e8f0ff;
}

.metric-cash .metric-label {
  color: #3f5f86;
}

.metric-cash .metric-value {
  color: #1c3a5e;
}

.metric-cash .metric-note {
  color: #557194;
}

.metric-margin {
  border-color: #c9e6da;
  background: #e4f6ee;
}

.metric-margin .metric-label {
  color: #35624f;
}

.metric-margin .metric-value {
  color: #174f3f;
}

.metric-margin .metric-note {
  color: #4c7361;
}

.metric-ring {
  position: absolute;
  right: 18px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  pointer-events: none;
}

.metric-ring svg {
  width: 100%;
  height: 100%;
}

.metric-ring .ring-track {
  fill: none;
  stroke: rgba(23, 79, 63, 0.16);
  stroke-width: 3.2;
}

.metric-ring .ring-val {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3.2;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 22px 22px;
}

.metric-attention {
  border-color: #f0ddc2;
  background: #fff0dc;
}

.metric-attention .metric-label {
  color: #7d5a30;
}

.metric-attention .metric-value {
  color: #a85a1c;
}

.metric-attention .metric-note {
  color: #8a6739;
}

.cockpit .v6-exec-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.78fr);
  gap: 16px;
  margin-bottom: 18px;
  align-items: stretch;
}

.cockpit .v6-panel {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.cockpit .v6-panel > header {
  min-height: 62px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.cockpit .v6-panel > header h2 {
  font-size: 15px;
  font-weight: 650;
}

.cockpit .v6-panel > header p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--faint);
}

.cockpit .v6-panel > header button {
  color: var(--brand);
  font-size: 12px;
}

.cockpit .v6-decision-row {
  min-height: 74px;
  padding: 10px 18px;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}

.cockpit .v6-decision-row:hover,
.cockpit .v6-decision-row:focus-visible {
  background: #f3faf6;
  box-shadow: inset 2px 0 0 var(--brand);
}

.cockpit .v6-decision-main strong {
  font-size: 13.5px;
  font-weight: 600;
}

.cockpit .v6-decision-main small {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.cockpit .v6-decision-owner b,
.cockpit .v6-decision-value b {
  font-size: 12px;
}

.cockpit .v6-decision-owner small,
.cockpit .v6-decision-value small {
  font-size: 10.5px;
}

.cockpit .v6-exec-side {
  background: #f7f9fb;
  border-color: var(--line);
}

.cockpit .v6-trend-rows {
  padding: 14px 18px;
}

.cockpit .v6-trend-rows > div {
  padding: 8px 0;
}

.cockpit .v6-trend-rows span,
.cockpit .v6-trend-rows b {
  font-size: 12px;
}

.cockpit .v6-trend-rows i {
  height: 4px;
  border-radius: 2px;
}

.cockpit .v6-exec-note {
  margin: 0 18px 18px;
  padding: 13px;
  border-color: #f0ddc2;
  border-radius: 10px;
  background: var(--orange-soft);
}

.cockpit .v6-exec-note strong {
  font-size: 12.5px;
  color: #7d5420;
}

.cockpit .v6-exec-note p {
  color: #7a6247;
  font-size: 11.5px;
}

.cockpit .v6-exec-note button {
  color: #a2652a;
  font-size: 11.5px;
}

.cockpit .v6-pulse {
  box-shadow: var(--shadow-sm);
}

.cockpit .v6-pulse-head {
  min-height: 38px;
  padding: 0 18px;
  background: var(--surface-2);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.cockpit .v6-pulse-row {
  min-height: 52px;
  padding: 0 18px;
  transition: background 0.15s;
}

.cockpit .v6-pulse-row:hover,
.cockpit .v6-pulse-row:focus-visible {
  background: #f3faf6;
}

.cockpit .v6-pulse-row strong {
  font-weight: 600;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   10. AI 工作台：三栏内容工作室
   -------------------------------------------------------------------------- */

.ai-page {
  height: 100%;
}

.ai-workbench {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.ai-rail {
  background: #f7f9fb;
  border-right: 1px solid var(--line);
}

.ai-rail-head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.ai-rail-title-row strong {
  font-size: 13px;
  font-weight: 650;
}

.ai-new {
  height: 38px;
  border-radius: 10px;
  background: var(--brand);
  border-color: var(--brand);
  font-size: 13px;
}

.ai-new:hover {
  background: var(--brand-dark);
}

.ai-search {
  height: 34px;
  border-radius: 9px;
  background: #fff;
}

.ai-group-label {
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.ai-session {
  padding: 9px 11px;
  border-radius: 9px;
}

.ai-session:hover {
  background: #fff;
  border-color: var(--line);
}

.ai-session.is-active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
}

.ai-session.is-active .ai-session-title {
  color: var(--brand-dark);
  font-weight: 600;
}

.ai-session-title {
  font-size: 12.5px;
}

.ai-session-meta {
  font-size: 11px;
  color: var(--faint);
}

.ai-rail-foot {
  font-size: 11px;
  color: var(--faint);
}

.ai-main {
  background: #fffdf9;
  border-right: 1px solid var(--line);
}

.ai-head {
  background: rgba(255, 253, 249, 0.96);
  border-bottom: 1px solid var(--line);
}

.ai-head-copy h1 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ai-head-copy p {
  font-size: 11.5px;
  color: var(--muted);
}

.ai-sessions-btn {
  border-radius: 9px;
}

.ai-thread-inner {
  max-width: 800px;
  padding: 22px 26px 12px;
}

.ai-user-row {
  margin-bottom: 16px;
}

.ai-user-msg {
  max-width: 540px;
  padding: 10px 13px;
  border: 1px solid #e6e2d9;
  border-radius: 10px;
  background: #f4f1eb;
}

.ai-user-tag {
  color: #8a8478;
  font-size: 11px;
}

.ai-user-msg p {
  font-size: 13.5px;
  line-height: 1.6;
  color: #2a2a26;
}

.ai-answer {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ece7dd;
}

.ai-answer-head h2 {
  font-size: 21px;
  font-weight: 650;
  line-height: 1.42;
  letter-spacing: -0.022em;
  color: #211f1b;
}

.ai-answer-badge {
  color: #8a8478;
  font-size: 11px;
}

.ai-answer-badge .icon {
  color: var(--ai);
}

.ai-answer-meta {
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #7c766b;
}

.ai-state {
  color: #4b473f;
}

.ai-state i {
  background: var(--green);
}

.ai-state-warn i {
  background: var(--orange);
}

.ai-state-bad i {
  background: var(--red);
}

.ai-block {
  margin-top: 16px;
}

.ai-block h3 {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: #8a8478;
}

.ai-block h3::after {
  background: #ece7dd;
}

.ai-block-note {
  color: #8a8478;
  font-size: 11.5px;
}

.ai-lead {
  margin-top: 9px;
  font-size: 14.5px;
  line-height: 1.85;
  color: #2b2924;
}

.ai-findings,
.ai-actions {
  gap: 8px;
  margin-top: 9px;
}

.ai-findings li,
.ai-actions li {
  gap: 11px;
  font-size: 14px;
  line-height: 1.75;
  color: #3a3730;
}

.ai-find-no {
  flex: 0 0 20px;
  padding-top: 3px;
  font-size: 11.5px;
  color: #a09a8d;
}

.ai-answer-foot {
  margin-top: 14px;
  gap: 4px;
}

.ai-act {
  min-height: 30px;
  border-radius: 8px;
  color: #7c766b;
  font-size: 11.5px;
}

.ai-act:hover {
  border-color: #e6e2d9;
  background: #f6f2ec;
  color: #2b2924;
}

.ai-act[aria-pressed='true'] {
  border-color: var(--ai-line);
  background: var(--ai-soft);
  color: #5142b8;
}

.ai-foot-split {
  background: #e6e2d9;
}

.ai-suggests {
  margin-top: 14px;
}

.ai-suggests-label {
  color: #8a8478;
  font-size: 11.5px;
}

.ai-suggest {
  min-height: 30px;
  border: 1px solid #e6e2d9;
  border-radius: 8px;
  background: #fff;
  color: #4b473f;
  font-size: 11.5px;
}

.ai-suggest:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.ai-suggest.is-current {
  border-color: #cfe7dd;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.ai-empty h2 {
  font-size: 17px;
  color: #211f1b;
}

.ai-empty p {
  color: #6f6a60;
  font-size: 13.5px;
}

/* 生成步骤 */

.ai-progress {
  margin-top: 14px;
  padding: 13px 15px;
  border: 1px solid #e6e2d9;
  border-radius: 10px;
  background: #f8f5ef;
}

.ai-progress-title {
  font-size: 12.5px;
  color: #3a3730;
}

.ai-progress-dot {
  background: var(--ai);
}

.ai-step {
  grid-template-columns: 14px 70px minmax(0, 1fr) 48px;
  font-size: 11.5px;
  color: #9a9487;
}

.ai-step i {
  border-color: #d8d2c6;
}

.ai-step.done i {
  border-color: var(--brand);
  background: var(--brand);
}

.ai-step.active i {
  border-color: var(--ai);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(107, 91, 210, 0.12);
}

.ai-step-name {
  color: #4b473f;
}

.ai-step.active .ai-step-name {
  color: #5142b8;
  font-weight: 600;
}

.ai-step.done .ai-step-state {
  color: var(--green);
}

.ai-step.active .ai-step-state {
  color: #5142b8;
}

/* 写作结果：文章式排版 */

.ai-doc {
  padding-bottom: 16px;
}

.ai-doc-lead {
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.9;
  color: #2b2924;
}

.ai-doc-section {
  margin-top: 18px;
}

.ai-doc-section h3 {
  font-size: 14.5px;
  font-weight: 650;
  color: #211f1b;
  letter-spacing: -0.01em;
}

.ai-doc-section p {
  margin-top: 7px;
  font-size: 14.5px;
  line-height: 1.9;
  color: #35322c;
}

.ai-doc-note {
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px dashed #e6e2d9;
  font-size: 11.5px;
  color: #8a8478;
}

.ai-refine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
}

.ai-refine-label {
  margin-right: 4px;
  font-size: 11.5px;
  color: #8a8478;
}

.ai-cite-links {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  font-size: 11.5px;
  color: #8a8478;
}

.ai-cite-links button {
  min-width: 21px;
  height: 21px;
  border: 1px solid #e0d9cd;
  border-radius: 6px;
  background: #fff;
  color: #7c766b;
  font-size: 11px;
}

.ai-cite-links button:hover {
  border-color: var(--ai);
  color: #5142b8;
}

/* 输入区 */

.ai-composer-wrap {
  padding: 0 26px 14px;
  background: #fffdf9;
}

.ai-composer {
  max-width: 800px;
  border: 1px solid #e0d9cd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px -24px rgba(60, 48, 28, 0.45);
}

.ai-composer:focus-within {
  border-color: var(--brand);
  box-shadow:
    0 0 0 3px rgba(21, 95, 80, 0.1),
    0 10px 30px -26px rgba(60, 48, 28, 0.4);
}

.ai-composer textarea {
  min-height: 60px;
  font-size: 14px;
  line-height: 1.65;
}

.ai-composer textarea::placeholder {
  color: #9a9487;
}

.ai-modes {
  gap: 5px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee9e0;
}

.ai-modes button {
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  color: #7c766b;
}

.ai-modes button[aria-pressed='true'] {
  border-color: var(--ai-line);
  background: var(--ai-soft);
  color: #5142b8;
  font-weight: 600;
}

.ai-write-opts {
  gap: 7px 14px;
  margin-bottom: 7px;
}

.ai-write-prompts .ai-suggest {
  min-height: 28px;
  padding: 4px 10px;
}

.ai-write-bar label {
  font-size: 11.5px;
  color: #8a8478;
}

.ai-write-bar select {
  height: 28px;
  border-color: #e0d9cd;
  border-radius: 7px;
  font-size: 11.5px;
  color: #4b473f;
}

.ai-composer-bar {
  border-top: 1px solid #eee9e0;
}

.ai-tool {
  color: #7c766b;
}

.ai-context {
  border-color: #e6e2d9;
  background: #f8f5ef;
  color: #7c766b;
  font-size: 11.5px;
}

.ai-send {
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  border-color: var(--brand);
  font-size: 13px;
}

.ai-send:hover:not(:disabled) {
  background: var(--brand-dark);
}

.ai-note {
  margin-top: 7px;
  color: #8a8478;
  font-size: 11px;
}

.ai-error {
  color: var(--red);
  font-size: 11.5px;
}

/* 右栏：引用与口径 */

.ai-side {
  background: #fbfcfe;
  border-left: 1px solid var(--line);
  padding: 16px;
}

.ai-side-head h2 {
  font-size: 13px;
  font-weight: 650;
}

.ai-side-head span {
  font-size: 11px;
  color: var(--faint);
}

.ai-side-sub {
  font-size: 11px;
  color: var(--faint);
}

.ai-ref {
  border-radius: 9px;
}

.ai-ref:hover {
  background: #fff;
  border-color: var(--line);
}

.ai-ref-no {
  border-color: #dcd6ca;
  border-radius: 6px;
  color: #8a8478;
  font-size: 11px;
}

.ai-ref-body strong {
  font-size: 12.5px;
  color: #2b2924;
}

.ai-ref-body span {
  font-size: 11px;
  color: #8a8478;
}

.ai-limits div {
  border-bottom-color: #ece7dd;
  font-size: 11.5px;
}

.ai-limits dt {
  color: #8a8478;
}

.ai-limits dd {
  color: #4b473f;
}

.ai-cites-inline {
  border-color: #e6e2d9;
  background: #f8f5ef;
}

/* --------------------------------------------------------------------------
   11. 其他页面类型的轻量区分
   -------------------------------------------------------------------------- */

.v6-workbench {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.v6-list-row:hover {
  background: #f3faf6;
}

.v6-object-row:hover {
  background: #f3faf6;
}

.v6-inspector {
  background: #fff;
}

.v6-register-main {
  box-shadow: none;
}

.report-card,
.v6-report-card {
  border-radius: var(--r-lg);
}

.timeline-row {
  padding-block: 10px;
}

/* 运维页：高密度但保留同一个品牌外壳 */

.v6-log-row,
.log-row {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   12. 响应式：桌面 → 中等宽度 → 手机
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .cockpit .v6-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cockpit .v6-exec-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cockpit .v6-decision-owner {
    display: none;
  }

  .cockpit .v6-decision-row {
    grid-template-columns: 32px minmax(0, 1fr) 96px 76px;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar: 54px;
  }

  .workspace {
    padding: 16px 14px 26px;
  }

  .page-head {
    margin-bottom: 14px;
  }

  .page-head h1 {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  .page-head p {
    margin-top: 4px;
    font-size: 12px;
  }

  .page-actions {
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .page-actions .btn {
    flex: 0 0 auto;
  }

  .summary-band,
  .v6-fact-strip,
  .v6-work-summary,
  .v6-portal-strip {
    gap: 10px;
    margin-bottom: 14px;
  }

  .summary,
  .v6-fact,
  .v6-work-summary > div,
  .v6-portal-strip > div {
    padding: 13px 15px;
  }

  .summary strong,
  .v6-fact strong,
  .v6-work-summary strong,
  .v6-portal-strip strong {
    font-size: 22px;
  }

  .cockpit .v6-metric-grid {
    gap: 10px;
    margin-bottom: 14px;
  }

  .v6-metric {
    min-height: 100px;
    padding: 13px 15px;
  }

  .v6-metric .metric-value {
    font-size: 22px;
  }

  .cockpit .v6-exec-grid {
    gap: 12px;
    margin-bottom: 14px;
  }

  .cockpit .v6-panel {
    box-shadow: none;
  }

  .cockpit .v6-decision-row {
    padding-inline: 15px;
  }

  .cockpit .v6-pulse-head,
  .cockpit .v6-pulse-row {
    padding-inline: 15px;
  }

  .mobile-avatar {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    font-size: 13px;
    border-color: rgba(21, 95, 80, 0.28);
    background: var(--brand-soft);
    color: var(--brand-dark);
  }

  .account-popover {
    top: 52px;
    left: 10px;
    width: min(280px, calc(100vw - 20px));
  }

  .topbar {
    padding-inline: 12px;
    gap: 8px;
  }

  .ai-composer-wrap {
    padding: 8px 0 10px;
    border-top: 1px solid var(--line);
    background: #fffdf9;
  }

  .ai-thread-inner {
    padding: 16px 14px 10px;
  }

  .ai-answer-head h2 {
    font-size: 19px;
  }

  .ai-head-inner {
    padding: 10px 14px;
  }
}

@media (max-width: 520px) {
  .workspace {
    padding: 12px 12px 24px;
  }

  .page-head h1 {
    font-size: 18.5px;
  }

  .summary-band,
  .v6-fact-strip,
  .v6-work-summary,
  .v6-portal-strip {
    gap: 8px;
  }

  .summary,
  .v6-fact,
  .v6-work-summary > div,
  .v6-portal-strip > div {
    padding: 11px 12px;
  }

  .summary strong,
  .v6-fact strong,
  .v6-work-summary strong,
  .v6-portal-strip strong {
    font-size: 19px;
  }

  .summary label,
  .summary small,
  .v6-fact span,
  .v6-fact small {
    font-size: 11px;
  }

  .v6-metric {
    min-height: 92px;
    padding: 12px 13px;
  }

  .v6-metric .metric-value {
    font-size: 19px;
  }

  .v6-metric .metric-label {
    font-size: 11px;
  }

  .v6-metric .metric-note {
    font-size: 10.5px;
  }

  .metric-ring,
  .metric-spark {
    display: none;
  }

  .cockpit .v6-decision-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 82px;
  }

  .cockpit .v6-decision-main {
    grid-column: 2 / 4;
  }

  .cockpit .v6-decision-value {
    display: none;
  }

  .cockpit .v6-decision-row .v6-state {
    grid-column: 2 / 4;
  }

  .surface-header {
    min-height: 52px;
    padding: 11px 14px;
  }

  .surface-body,
  .drawer-body {
    padding: 14px;
  }

  .data-table th,
  .data-table td {
    padding-inline: 12px;
  }

  .ai-thread-inner {
    padding: 14px 12px 8px;
  }

  .ai-answer-head h2 {
    font-size: 17.5px;
  }

  .ai-lead,
  .ai-findings li,
  .ai-actions li,
  .ai-doc-section p,
  .ai-doc-lead {
    font-size: 14px;
    line-height: 1.8;
  }

  .ai-user-msg {
    max-width: 100%;
  }

  .ai-composer {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .v6-metric,
  .v6-metric:hover,
  .ai-session,
  .btn {
    transition: none;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   13. 台账视图栏与列表细节
   -------------------------------------------------------------------------- */

.v6-register {
  grid-template-columns: 190px minmax(0, 1fr);
  border-radius: var(--r-lg);
  border-color: var(--line);
}

.v6-register-views {
  padding: 12px 8px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}

.v6-register-views > button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.v6-register-views > button.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: inset 2px 0 0 var(--brand);
}

.v6-register-views > div {
  min-height: 32px;
}

.v6-register-main {
  border: 0;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   14. 写作主题引导与参数条
   -------------------------------------------------------------------------- */

.ai-write-prompts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 2px 0 14px;
}

.ai-write-prompts .ai-suggest {
  min-height: 30px;
  padding: 5px 11px;
}

.ai-composer-wrap .ai-write-bar {
  max-width: 800px;
  margin: 0 auto 7px;
  padding: 0;
}

/* --------------------------------------------------------------------------
   15. 侧栏式列表与门户宽度修正
   -------------------------------------------------------------------------- */

.v6-register {
  grid-template-columns: 200px minmax(0, 1fr);
}

.v6-register-views > button {
  white-space: nowrap;
}

.v6-register-views > button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v6-portal-grid {
  grid-template-columns: 190px minmax(360px, 1.35fr) minmax(300px, 0.9fr);
}

.v6-portal-nav > button {
  white-space: nowrap;
}

.v6-portal-nav > button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   16. 输入区与正文的分离边界
   -------------------------------------------------------------------------- */

@media (min-width: 901px) {
  .ai-composer-wrap {
    border-top: 1px solid #ece7dd;
    padding-top: 10px;
  }
}

.ai-thread-inner {
  padding-bottom: 16px;
}

/* --------------------------------------------------------------------------
   17. 三栏工作台视图栏
   -------------------------------------------------------------------------- */

.v6-workbench {
  grid-template-columns: 190px minmax(300px, 0.82fr) minmax(400px, 1.18fr);
}

.v6-view-rail > button,
.v6-view-rail button {
  white-space: nowrap;
}

.v6-view-head,
.v6-saved {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   18. AI 画布布局 v2：头部模式切换、建议问题随文滚动、输入区收敛
   -------------------------------------------------------------------------- */

.ai-workbench {
  grid-template-columns: 232px minmax(0, 1fr) 268px;
}

.ai-head-inner {
  padding: 12px 20px;
  align-items: center;
}

.ai-head-copy h1 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.ai-head-copy p {
  margin-top: 3px;
  font-size: 11.5px;
}

.ai-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.ai-head .ai-modes {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid #eee9e0;
  border-radius: 9px;
  background: #f6f2ec;
}

.ai-head .ai-modes button {
  height: 26px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #7c766b;
  font-size: 11.5px;
}

.ai-head .ai-modes button[aria-pressed='true'] {
  border-color: var(--ai-line);
  background: #fff;
  color: #5142b8;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(40, 34, 22, 0.06);
}

.ai-new-icon {
  display: grid;
  width: 30px;
  height: 30px;
  border: 1px solid #e6e2d9;
  border-radius: 8px;
  background: #fff;
  color: #7c766b;
}

.ai-new-icon:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.ai-thread-inner {
  padding: 20px 24px 14px;
}

.ai-suggests {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e6e2d9;
}

.ai-suggests-label {
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.ai-composer-wrap {
  padding: 9px 24px 13px;
  border-top: 1px solid #ece7dd;
}

.ai-composer textarea {
  min-height: 54px;
}

.ai-note {
  margin-top: 6px;
}

@media (max-width: 1240px) {
  .ai-workbench {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .ai-side {
    display: none;
  }

  .ai-cites-inline {
    display: block;
  }
}

@media (max-width: 900px) {
  .ai-head .ai-modes {
    padding: 2px;
  }

  .ai-head .ai-modes button {
    height: 24px;
    padding: 0 9px;
    font-size: 11px;
  }

  .ai-new-icon {
    display: none;
  }

  .ai-head-inner {
    padding: 10px 14px;
  }

  .ai-head-actions {
    gap: 6px;
  }

  .ai-thread-inner {
    padding: 16px 14px 10px;
  }

  .ai-suggests {
    margin-top: 12px;
    padding-top: 10px;
  }
}

@media (max-width: 520px) {
  .ai-head-copy h1 {
    font-size: 14.5px;
  }

  .ai-head .ai-modes button {
    padding: 0 8px;
  }

  .ai-head-copy p .ai-scene {
    display: none;
  }

  .ai-thread-inner {
    padding: 14px 12px 10px;
  }
}

/* --------------------------------------------------------------------------
   19. AI 内容工作室细节：场景入口、结论强调、动作卡、内联引用
   -------------------------------------------------------------------------- */

.ai-empty {
  padding: 22px 0 8px;
}

.ai-empty-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.ai-empty-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ai-line);
  border-radius: 9px;
  background: var(--ai-soft);
  color: #5142b8;
}

.ai-empty-badge .icon {
  width: 16px;
  height: 16px;
}

.ai-empty h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.ai-empty p {
  flex: 1 1 100%;
  max-width: 64ch;
  margin-top: 2px;
  color: #6f6a60;
  font-size: 13px;
  line-height: 1.7;
}

.ai-scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.ai-scene-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 84px;
  padding: 13px 14px;
  border: 1px solid #e6e2d9;
  border-radius: 11px;
  background: #fff;
  text-align: left;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}

.ai-scene-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(28, 43, 37, 0.06);
  transform: translateY(-1px);
}

.ai-scene-card strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #211f1b;
}

.ai-scene-card span {
  font-size: 11.5px;
  line-height: 1.55;
  color: #8a8478;
}

.ai-block-lead {
  padding: 12px 0 12px 14px;
  border-left: 2px solid var(--brand);
}

.ai-block-lead h3 {
  margin-bottom: 2px;
}

.ai-block-lead h3::after {
  display: none;
}

.ai-block-lead .ai-lead {
  margin-top: 6px;
}

.ai-block-action {
  padding: 12px 14px 14px;
  border: 1px solid #cfe7dd;
  border-radius: 11px;
  background: #f3faf6;
}

.ai-block-action h3 {
  color: #2f6553;
}

.ai-block-action h3::after {
  background: #d8ebe1;
}

.ai-block-action .ai-actions {
  margin-top: 6px;
}

.ai-block-action .ai-block-note {
  color: #6f8a7d;
}

.ai-inline-cite {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0 4px;
  border: 1px solid #dfe9e3;
  border-radius: 5px;
  background: #fff;
  color: #4f7f6e;
  font-size: 10px;
  vertical-align: 1px;
}

.ai-inline-cite:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.ai-doc-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #9a9487;
}

@media (max-width: 900px) {
  .ai-scene-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ai-scene-card {
    min-height: 68px;
  }
}

/* --------------------------------------------------------------------------
   20. AI 空态与文本密度微调
   -------------------------------------------------------------------------- */

.ai-empty + .ai-suggests {
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}

.ai-block-lead {
  padding-top: 10px;
  padding-bottom: 10px;
}

.ai-findings li,
.ai-actions li {
  line-height: 1.7;
}

.ai-block-action {
  padding: 11px 13px 12px;
}

.ai-composer textarea {
  min-height: 50px;
}

/* --------------------------------------------------------------------------
   21. 建议动作双列与首屏密度
   -------------------------------------------------------------------------- */

.ai-block-action .ai-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 16px;
}

.ai-block {
  margin-top: 13px;
}

.ai-user-row {
  margin-bottom: 12px;
}

.ai-answer-head h2 {
  font-size: 20px;
}

.ai-thread-inner {
  padding-bottom: 18px;
}

.ai-composer-wrap {
  padding: 7px 24px 11px;
}

.ai-composer textarea {
  min-height: 46px;
}

.ai-note {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .ai-block-action .ai-actions {
    grid-template-columns: 1fr;
  }

  .ai-composer-wrap {
    padding: 7px 0 9px;
  }
}

/* --------------------------------------------------------------------------
   22. 首屏密度：动作卡标签化、行距与输入区收敛
   -------------------------------------------------------------------------- */

.ai-block-tag {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid #cfe7dd;
  border-radius: 4px;
  color: #6f8a7d;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.ai-block-action h3 {
  gap: 8px;
}

.ai-block-action h3::after {
  display: none;
}

.ai-block-action .ai-actions {
  margin-top: 8px;
}

.ai-lead {
  line-height: 1.78;
}

.ai-findings li,
.ai-actions li {
  line-height: 1.62;
}

.ai-findings,
.ai-actions {
  gap: 6px;
}

.ai-answer-head h2 {
  font-size: 19px;
}

.ai-user-msg {
  padding: 8px 12px;
}

.ai-user-row {
  margin-bottom: 10px;
}

.ai-answer-meta {
  margin-top: 6px;
}

.ai-thread-inner {
  padding-top: 16px;
}

.ai-composer-wrap {
  padding: 6px 24px 9px;
}

.ai-composer textarea {
  min-height: 44px;
}

.ai-note {
  margin-top: 3px;
  font-size: 10.5px;
}

@media (max-width: 900px) {
  .ai-composer-wrap {
    padding: 6px 0 8px;
  }
}

/* --------------------------------------------------------------------------
   23. 侧栏收起 / 展开
   -------------------------------------------------------------------------- */

@media (min-width: 901px) {
  .app-shell {
    transition: grid-template-columns 0.18s ease;
  }

  .app-shell.side-collapsed {
    --context: 0px;
  }

  .app-shell.side-collapsed .context-nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .rail-collapse {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   24. 后端接入状态：流式生成、保存提示
   -------------------------------------------------------------------------- */

.ai-stream {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #e6e2d9;
  border-left: 2px solid var(--brand);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  line-height: 1.85;
  color: #2b2924;
  white-space: pre-wrap;
}

.ai-stream::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  background: var(--brand);
  vertical-align: -2px;
  animation: ai-caret 1s steps(2, start) infinite;
}

@keyframes ai-caret {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-stream::after {
    animation: none;
  }
}

.api-offline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 3px 8px;
  border: 1px solid #f0ddc2;
  border-radius: 6px;
  background: var(--orange-soft);
  color: #8a5423;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   25. 核心闭环表单、会话操作与离线状态
   仅复用现有色彩与组件，不新增覆盖层。
   -------------------------------------------------------------------------- */

.login-offline {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.login-offline p {
  margin: 0 0 9px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

.boot-panel {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 14px;
}

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

.field textarea {
  height: auto;
  min-height: 88px;
  padding: 9px 11px;
  line-height: 1.65;
  resize: vertical;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

.field-error {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--red);
}

.drawer-body .error-state {
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(20, 36, 30, 0.38);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 89;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.modal-panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head strong {
  font-size: 13px;
  font-weight: 600;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.ai-session-menu {
  top: 64px;
  right: 28px;
  width: 180px;
  z-index: 130;
}

.ai-send.is-stop {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f3cdc9;
}

.ai-send.is-stop:hover {
  background: #fbe0dd;
}

.ai-aborted-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.activity-head strong {
  font-size: 12px;
}

.activity-head time {
  font-size: 11px;
  color: var(--muted);
}

.activity-row p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
    border-radius: var(--r-lg);
  }

  .ai-session-menu {
    top: 58px;
    right: 12px;
  }

  .drawer {
    width: 100vw;
  }
}

/* --------------------------------------------------------------------------
   26. 企业知识库与引用原文
   仅作用域样式，复用既有 surface / table / drawer / field。
   -------------------------------------------------------------------------- */

.knowledge-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.knowledge-search {
  flex: 1 1 260px;
  max-width: 420px;
}

.knowledge-spaces {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.knowledge-spaces button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
}

.knowledge-spaces button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}

.knowledge-status {
  width: 140px;
  height: 36px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.knowledge-main {
  min-width: 0;
  overflow: hidden;
}

.knowledge-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.knowledge-list-head h2 {
  font-size: 15px;
  font-weight: 650;
}

.knowledge-list-head p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.knowledge-mode {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}

.knowledge-row-sub {
  display: block;
  max-width: 460px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.knowledge-side-card {
  padding: 14px 16px;
}

.knowledge-side-card .surface-header {
  padding: 0 0 10px;
  border: 0;
}

.knowledge-side-card .btn {
  width: 100%;
  margin-top: 10px;
}

.knowledge-coverage > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.knowledge-coverage > div:last-child {
  border-bottom: 0;
}

.knowledge-recent,
.knowledge-todo {
  display: grid;
}

.knowledge-recent button,
.knowledge-todo button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.knowledge-recent button:last-child,
.knowledge-todo button:last-child {
  border-bottom: 0;
}

.knowledge-recent strong,
.knowledge-todo button {
  font-size: 12.5px;
}

.knowledge-recent span,
.knowledge-todo span {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-drawer {
  width: min(620px, 100vw);
}

.knowledge-content p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.knowledge-doc-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.knowledge-doc-section:last-child {
  border-bottom: 0;
}

.knowledge-doc-section h3 {
  margin-bottom: 5px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.knowledge-doc-section.is-cited {
  margin: 4px 0;
  padding: 10px 12px;
  border: 1px solid var(--brand);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--brand-soft);
}

.knowledge-citation {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
}

.knowledge-citation strong {
  font-size: 12.5px;
}

.knowledge-citation p {
  margin: 4px 0 0;
  color: var(--ink-2);
  line-height: 1.65;
}

.knowledge-drawer .drawer-body.has-citation {
  padding-top: 0;
}

.knowledge-drawer .drawer-body.has-citation .knowledge-citation {
  margin: 0 -22px 12px;
  padding: 10px 22px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

@media (max-width: 900px) {
  .knowledge-drawer .drawer-body.has-citation .knowledge-citation {
    margin-inline: -14px;
    padding-inline: 14px;
  }
}

.knowledge-versions {
  display: grid;
  gap: 6px;
}

.knowledge-version-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.knowledge-version-row:last-child {
  border-bottom: 0;
}

.knowledge-version-row span {
  color: var(--muted);
  font-size: 11px;
}

.knowledge-form-note {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.knowledge-index-page {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.knowledge-index-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.knowledge-index-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.knowledge-index-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.knowledge-index-kv {
  margin: 8px 0 12px;
}

.knowledge-empty {
  padding: 42px 20px;
}

@media (max-width: 1100px) {
  .knowledge-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 900px) {
  .knowledge-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .knowledge-status {
    width: 100%;
  }

  .knowledge-spaces {
    width: 100%;
  }

  .knowledge-spaces button {
    flex: 1 1 auto;
    min-height: 36px;
  }

  .knowledge-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .knowledge-row-sub {
    max-width: none;
    white-space: normal;
  }

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

  .knowledge-drawer {
    width: 100vw;
  }
}

@media (max-width: 1500px) {
  .knowledge-table th:nth-child(4),
  .knowledge-table td:nth-child(4) {
    display: none;
  }

  .knowledge-row-sub {
    max-width: 320px;
  }
}

@media (max-width: 1200px) {
  .knowledge-table th:nth-child(3),
  .knowledge-table td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 900px) {
  .knowledge-table th:nth-child(3),
  .knowledge-table td:nth-child(3),
  .knowledge-table th:nth-child(4),
  .knowledge-table td:nth-child(4) {
    display: flex;
  }

  .knowledge-table td.primary {
    display: block;
    height: auto;
    min-height: 48px;
    padding-bottom: 9px;
  }

  .knowledge-table td.primary .knowledge-row-sub {
    margin-top: 4px;
  }
}

/* --------------------------------------------------------------------------
   27. 报告中心：列表、三段式编辑器、引用/版本/审批、订阅
   仅新增 .report-* 作用域，复用既有 surface / table / form / modal / drawer。
   -------------------------------------------------------------------------- */

.report-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.report-search {
  flex: 1 1 260px;
  max-width: 420px;
}

.report-status {
  width: 150px;
  height: 36px;
}

.report-count {
  color: var(--muted);
  font-size: 12px;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.report-main {
  min-width: 0;
  overflow: hidden;
}

.report-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.report-side-card {
  padding: 14px 16px;
}

.report-side-card .surface-header {
  padding: 0 0 10px;
  border: 0;
}

.report-side-card .btn {
  width: 100%;
  margin-top: 10px;
}

.report-row-sub {
  display: block;
  max-width: 420px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-template-list {
  display: grid;
}

.report-template-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.report-template-list button:last-child {
  border-bottom: 0;
}

.report-template-list span,
.report-sub-mini span {
  color: var(--muted);
  font-size: 11px;
}

.report-sub-mini {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.report-sub-mini:last-child {
  border-bottom: 0;
}

.report-empty {
  padding: 44px 20px;
}

/* 编辑器 */
.report-editor-page .page-head {
  margin-bottom: 10px;
}

.report-editor-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.report-editor-status > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-editor-meta {
  color: var(--muted);
  font-size: 12px;
}

.report-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-editor-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.report-outline,
.report-inspector {
  position: sticky;
  top: 14px;
  min-width: 0;
}

.report-outline-list {
  display: grid;
  gap: 4px;
  padding: 4px 0 10px;
}

.report-outline-list button {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
}

.report-outline-list button:hover {
  background: var(--surface-2);
}

.report-outline-list span {
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.report-outline-foot {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-outline-foot > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.report-editor-main {
  min-width: 0;
  padding: 16px;
}

.report-field {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.report-field > span,
.report-field > label {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.report-field .input {
  width: 100%;
}

.report-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.report-editor-toolbar button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
}

.report-editor-toolbar button:disabled {
  opacity: 0.45;
}

.report-editor-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.report-content-input {
  min-height: 380px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.85;
  resize: vertical;
}

.report-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.report-tabs {
  display: flex;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.report-tabs button {
  flex: 1;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.report-tabs button.active {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}

.report-source-list,
.report-version-list {
  display: grid;
  gap: 6px;
  padding: 10px 0;
}

.report-source {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.report-source:disabled {
  opacity: 1;
}

.report-source:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.report-source-type {
  color: var(--brand-dark);
  font-size: 10.5px;
}

.report-source strong {
  font-size: 12px;
}

.report-source > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.report-version-list button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.report-version-list button > span {
  grid-row: span 2;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
}

.report-version-list strong {
  font-size: 11.5px;
}

.report-version-list em {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
}

.report-approval-list {
  display: grid;
  gap: 12px;
  padding: 12px 0;
}

.report-approval-list > div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
}

.report-approval-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  background: var(--surface);
}

.report-approval-list strong {
  font-size: 12px;
}

.report-approval-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.report-approval-list blockquote {
  margin: 5px 0 0;
  padding: 7px 9px;
  border-left: 2px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.65;
}

.report-inspector-meta {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.report-ai-note {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11.5px;
}

.report-ai-note strong,
.report-ai-note span {
  display: block;
}

.report-ai-note span {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 11px;
}

.report-confirm-text {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.75;
}

.report-version-summary {
  color: var(--muted);
  font-size: 12px;
}

.report-version-content {
  max-height: 52vh;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre-wrap;
}

/* 订阅与模板 */
.report-sub-list {
  display: grid;
}

.report-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.report-sub-row:last-child {
  border-bottom: 0;
}

.report-sub-row strong,
.report-sub-row span {
  display: block;
}

.report-sub-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.report-sub-row > div:last-child {
  display: flex;
  gap: 6px;
}

.report-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-template-card {
  padding: 16px;
}

.report-template-card ol {
  margin: 8px 0 12px;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.8;
}

.report-template-card .btn {
  width: 100%;
}

@media (max-width: 1500px) {
  .report-table th:nth-child(5),
  .report-table td:nth-child(5) {
    display: none;
  }

  .report-row-sub {
    max-width: 300px;
  }
}

@media (max-width: 1280px) {
  .report-editor-grid {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .report-inspector {
    position: static;
    grid-column: 1 / -1;
  }

  .report-inspector .report-tabs {
    max-width: 360px;
  }
}

@media (max-width: 1100px) {
  .report-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 900px) {
  .report-search,
  .report-status {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }

  .report-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-outline,
  .report-inspector {
    position: static;
  }

  .report-outline {
    order: 2;
  }

  .report-editor-main {
    order: 1;
  }

  .report-inspector {
    order: 3;
  }

  .report-side,
  .report-template-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-row-sub {
    max-width: none;
    white-space: normal;
  }

  .report-table td.primary {
    display: block;
    height: auto;
    min-height: 48px;
    padding-bottom: 9px;
  }

  .report-table td.primary .report-row-sub {
    margin-top: 4px;
  }

  .report-sub-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-sub-row > div:last-child {
    width: 100%;
  }

  .report-sub-row > div:last-child .btn {
    flex: 1;
  }

  .report-editor-toolbar span {
    width: 100%;
    margin-left: 0;
  }

  .report-editor-actions {
    width: 100%;
  }

  .report-editor-actions .btn {
    flex: 1;
  }

  .report-editor-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

.report-mobile-tools {
  display: none;
}

.report-inspector-head {
  display: none;
}

@media (max-width: 900px) {
  .report-mobile-tools {
    display: flex;
    gap: 6px;
    width: 100%;
  }

  .report-mobile-tools button {
    flex: 1;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 11.5px;
  }

  .report-inspector-head {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 4px;
  }

  .report-inspector {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: none;
    width: min(380px, 100vw);
    max-width: 100vw;
    border-radius: 0;
    overflow: auto;
    padding: 14px;
  }

  .report-inspector.is-open {
    display: block;
  }

  .report-inspector-backdrop {
    position: fixed;
    inset: 0;
    z-index: 69;
    background: rgba(16, 28, 22, 0.32);
  }
}

/* --------------------------------------------------------------------------
   28. 审批中心与决策中心（v6.5）
   请求材料 / 流程 / 对话三段式；策略快照和审批动作可追溯。
   -------------------------------------------------------------------------- */
.approval-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.approval-tabs button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.approval-tabs button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
}
.approval-tabs em {
  margin-left: 5px;
  color: var(--brand-dark);
  font-size: 10px;
  font-style: normal;
}
.approval-list-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.approval-list-main {
  min-width: 0;
  overflow: hidden;
}
.approval-side {
  display: grid;
  gap: 12px;
}
.approval-side-card {
  padding: 14px 16px;
}
.approval-side-card .surface-header {
  padding: 0 0 10px;
  border: 0;
}
.approval-side-card .btn {
  width: 100%;
  margin-top: 10px;
}
.approval-count-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.approval-count-grid div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.approval-count-grid strong {
  display: block;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.approval-count-grid span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}
.approval-row-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.approval-unread {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 10px;
  vertical-align: middle;
}
.approval-statusbar,
.decision-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.approval-statusbar > div,
.decision-statusbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.approval-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.approval-detail-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
.approval-material,
.approval-flow,
.approval-conversation {
  min-width: 0;
}
.approval-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  padding: 4px 16px 14px;
}
.approval-fields > div {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.approval-fields span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
}
.approval-fields strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.approval-source {
  margin: 0 16px 14px;
  padding: 10px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-soft);
  text-align: left;
}
.approval-source span {
  display: block;
  color: var(--brand-dark);
  font-size: 10.5px;
}
.approval-source strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}
.approval-source p {
  margin: 4px 0 2px;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.65;
}
.approval-source em {
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
}
.approval-source-link {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-size: 11px;
  text-align: left;
}
.approval-attachments {
  padding: 0 16px 14px;
}
.approval-attachments h3 {
  font-size: 12px;
  margin: 0 0 4px;
}
.approval-policy-line {
  margin: 0 16px 8px;
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--brand-dark);
  font-size: 11.5px;
}
.approval-steps {
  padding: 0 16px 12px;
}
.approval-step {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.approval-step:last-child {
  border-bottom: 0;
}
.approval-step-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
}
.approval-step.is-active .approval-step-dot {
  border-color: var(--brand);
  background: var(--brand);
}
.approval-step.is-done .approval-step-dot {
  border-color: var(--green);
  background: var(--green);
}
.approval-step strong {
  font-size: 12px;
}
.approval-step p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.approval-step em {
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
}
.approval-actions-history {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.approval-actions-history h3 {
  font-size: 12px;
  margin-bottom: 6px;
}
.approval-actions-history > div {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.approval-actions-history strong {
  margin-right: 6px;
}
.approval-actions-history span {
  color: var(--muted);
  font-size: 10.5px;
}
.approval-actions-history p {
  margin: 3px 0 0;
  color: var(--ink-2);
  line-height: 1.6;
}
.approval-messages {
  max-height: 420px;
  overflow: auto;
  padding: 10px 14px;
}
.approval-msg {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.approval-msg:last-child {
  border-bottom: 0;
}
.approval-msg-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.approval-msg-head strong {
  font-size: 11.5px;
}
.approval-msg-head span {
  color: var(--faint);
  font-size: 10px;
}
.approval-msg-head em {
  color: var(--brand-dark);
  font-size: 9.5px;
  font-style: normal;
}
.approval-msg p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.approval-msg small {
  color: var(--faint);
  font-size: 10px;
}
.approval-msg.is-system {
  margin: 4px 0;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: var(--surface-2);
}
.approval-msg.is-system p {
  color: var(--muted);
  font-size: 11.5px;
}
.approval-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
}
.approval-composer textarea {
  min-height: 42px;
  resize: vertical;
}
.approval-preview,
.approval-sim-result {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 11.5px;
}
.approval-preview ol,
.approval-sim-result ol {
  margin: 5px 0;
  padding-left: 18px;
  line-height: 1.7;
}
.approval-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.approval-policy-card {
  padding: 14px 16px;
}
.approval-policy-card .surface-header {
  padding: 0 0 8px;
  border: 0;
}
.approval-policy-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.approval-policy-nodes span {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10.5px;
}
.approval-policy-card > .btn {
  width: 100%;
  margin-top: 8px;
}

.decision-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}
.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.decision-card {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}
.decision-card:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.decision-card:hover {
  background: var(--surface-2);
}
.decision-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.decision-card h2 {
  margin: 7px 0 3px;
  font-size: 14px;
}
.decision-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}
.decision-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--faint);
  font-size: 10.5px;
}
.decision-side {
  padding-bottom: 14px;
}
.decision-rules {
  margin: 0;
  padding: 0 16px 14px 30px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.9;
}
.decision-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px 270px;
  gap: 14px;
  align-items: start;
}
.decision-context,
.decision-options,
.decision-steps {
  min-width: 0;
}
.decision-trigger {
  padding: 10px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  line-height: 1.7;
}
.decision-risk {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
}
.decision-context > p {
  padding: 0 16px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.75;
}
.decision-context h3 {
  padding: 0 16px;
  font-size: 12px;
}
.decision-option-list {
  display: grid;
  gap: 7px;
  padding: 0 16px 10px;
}
.decision-option {
  display: flex;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.decision-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.decision-option input {
  margin-top: 3px;
}
.decision-option strong {
  display: block;
  font-size: 12px;
}
.decision-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}
.decision-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 14px;
}
.decision-comments {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}
.decision-comments h3 {
  font-size: 12px;
  margin-bottom: 6px;
}
.decision-comments > div {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.decision-comments strong {
  margin-right: 6px;
  font-size: 11.5px;
}
.decision-comments span {
  color: var(--muted);
  font-size: 10.5px;
}
.decision-comments p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.6;
}
.decision-step {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 7px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.decision-step > span {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
}
.decision-step.is-done > span {
  border-color: var(--green);
  background: var(--green);
}
.decision-step strong {
  font-size: 11.5px;
}
.decision-step p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

@media (max-width: 1360px) {
  .approval-detail-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .approval-conversation {
    grid-column: 1 / -1;
  }
  .decision-detail-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .decision-steps {
    grid-column: 1 / -1;
  }
}
@media (max-width: 1100px) {
  .approval-list-layout,
  .decision-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .approval-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .decision-side {
    display: none;
  }
}
@media (max-width: 900px) {
  .approval-detail-grid,
  .decision-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .approval-conversation,
  .decision-steps {
    grid-column: auto;
  }
  .approval-side {
    grid-template-columns: minmax(0, 1fr);
  }
  .approval-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .approval-statusbar,
  .decision-statusbar {
    align-items: flex-start;
  }
  .approval-statusbar > div {
    width: 100%;
  }
  .approval-actions .btn {
    flex: 1;
  }
  .approval-policy-grid,
  .decision-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .decision-card:nth-child(odd) {
    border-right: 0;
  }
  .approval-messages {
    max-height: 320px;
  }
  .approval-composer {
    grid-template-columns: minmax(0, 1fr);
  }
  .approval-composer .btn {
    width: 100%;
  }
}

.report-unified-approval {
  margin: 8px 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-soft);
}
.report-unified-approval > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.report-unified-approval strong {
  font-size: 11.5px;
}
.report-unified-approval span {
  color: var(--muted);
  font-size: 10.5px;
}
.report-unified-approval ol {
  margin: 6px 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.7;
}
.report-unified-approval li.is-active {
  font-weight: 650;
  color: var(--brand-dark);
}
.report-unified-approval em {
  margin-left: 5px;
  color: var(--muted);
  font-style: normal;
}
.report-unified-approval .btn {
  width: 100%;
}

.approval-mobile-tabs {
  display: none;
}
@media (max-width: 900px) {
  .approval-mobile-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }
  .approval-mobile-tabs button {
    flex: 1;
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
  }
  .approval-mobile-tabs button.active {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 650;
  }
  .approval-detail-grid > .approval-mobile-section {
    display: none;
  }
  .approval-detail-grid > .approval-mobile-section.is-mobile-active {
    display: block;
  }
}

/* 团队工位工作记录与消息 */
.floor-record-drawer {
  width: min(520px, 100vw);
}
.floor-record-list {
  display: grid;
  gap: 0;
}
.floor-record-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.floor-record-item time {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.floor-record-item strong {
  font-size: 12.5px;
}
.floor-record-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}
.floor-record-deals {
  display: grid;
  gap: 7px;
}
.floor-record-deals > div {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.floor-record-deals strong,
.floor-record-deals span {
  display: block;
}
.floor-record-deals strong {
  font-size: 12px;
}
.floor-record-deals span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.floor-quick-messages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 10px;
}
.floor-quick-messages button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
}
.floor-message-history {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.floor-message-history h3 {
  font-size: 12px;
  margin-bottom: 6px;
}
.floor-message-history > div {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.floor-message-history strong {
  margin-right: 6px;
  font-size: 11.5px;
}
.floor-message-history span {
  color: var(--ink-2);
  font-size: 11.5px;
}
.floor-message-history small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}
@media (max-width: 900px) {
  .floor-record-drawer {
    width: 100vw;
  }
  .floor-record-item {
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .floor-record-item > .tag {
    display: none;
  }
}

/* 账号与工位头像图片 */
.floor-canvas .av img,
.person-head .av img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.floor-canvas .av,
.person-head .av {
  overflow: hidden;
}
