/* DMD AI Practice Operations - AI 控制台专属样式 + 紧凑化覆写 */
:root { --radius: 8px; }

/* ===== 紧凑化 ===== */
body { font-size: 13.5px; line-height: 1.5; }
table { font-size: 12.5px; }
th, td { padding: 6px 8px; }
.sec-title { font-size: 16px; }
.sec-sub { font-size: 11.5px; }
.sec-note { font-size: 11px; }

/* ===== 顶栏 ===== */
.topbar {
  background: linear-gradient(120deg, #0d3154, #14508c 60%, #0e6f62);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(13, 49, 84, 0.18);
}
.tb-row { display: flex; align-items: center; gap: 14px; padding: 7px 16px; flex-wrap: wrap; height: 30px; }
.tb-left { display: flex; align-items: baseline; gap: 10px; }
.topbar .h-brand { color: #fff; font-size: 15px; letter-spacing: 0.4px; }
.topbar .h-title { color: rgba(255, 255, 255, 0.78); font-size: 12px; }
.tb-nav { max-width: none; margin: 0; padding: 0; gap: 6px; }
.tb-link {
  color: rgba(255, 255, 255, 0.78); text-decoration: none; font-size: 12.5px;
  padding: 4px 12px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.22);
}
.tb-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tb-link.active { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.45); font-weight: 600; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tb-tenant { font-size: 12px; color: rgba(255, 255, 255, 0.85); display: flex; align-items: center; gap: 6px; }
.tb-tenant select {
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 6px;
  padding: 3px 8px; font-size: 12px;
}
.tb-tenant select option { color: var(--ink); background: #fff; }
.tb-status { font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.tb-status.ok { color: #8fe6c0; }
.tb-status.warn { color: #ffd88a; }
.tb-status.bad { color: #ffa3a3; }
#lang-toggle { border-color: rgba(255, 255, 255, 0.3) !important; color: rgba(255, 255, 255, 0.85) !important; }

/* ===== 布局：左聊天 + 右工具 ===== */
.app-layout { display: flex; gap: 14px; padding: 14px 16px 40px; align-items: flex-start; }
.chat-panel {
  width: 340px; flex: 0 0 340px; background: var(--bg2);
  border: 1px solid var(--rule); border-radius: var(--radius);
  display: flex; flex-direction: column;
  position: sticky; top: 58px; height: calc(100vh - 88px); min-height: 480px;
  box-shadow: 0 1px 6px rgba(22, 35, 58, 0.05);
}
.cp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 4px; }
.cp-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.cp-clear {
  border: 1px solid var(--rule); background: var(--bg); border-radius: 6px;
  font-size: 11.5px; color: var(--muted); padding: 3px 10px; cursor: pointer;
}
.cp-clear:hover { color: var(--danger); border-color: var(--danger); }
.cp-sub { padding: 0 12px 8px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.chat-panel .fn-chips { padding: 8px 12px 2px; }
.chat-panel .fn-chat-log { flex: 1; min-height: 160px; max-height: none; margin: 8px 12px; }
.chat-panel .fn-chat-input { margin: 0 12px 12px; }

/* ===== 右侧主区 ===== */
.console-main { flex: 1; min-width: 0; }
.c-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 0 0; margin-bottom: 10px;
  position: sticky; top: 44px; z-index: 50; background: var(--bg);
  border-bottom: 1px solid var(--rule); padding-bottom: 8px;
}
.c-tab {
  border: 1px solid var(--rule); background: var(--bg2); border-radius: 7px 7px 0 0;
  padding: 6px 16px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.c-tab:hover { color: var(--accent); border-color: var(--accent); }
.c-tab.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 面板内 sec-head 紧凑化 */
.tab-panel .sec-head { margin-bottom: 8px; padding-bottom: 6px; }
.tab-panel .ops-grid, .tab-panel .qc-layout { margin-top: 2px; }

/* 紧凑化卡片 */
.ops-card, .chart-card, .score-card, .fn-card { padding: 12px 14px; }
.ops-card h3, .fn-title { font-size: 13.5px; }
.fn-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 10px; }
.fn-card .fn-form { gap: 8px; }
.fn-run { padding: 6px 14px; font-size: 12px; }
.fn-result { font-size: 12px; max-height: 420px; }

/* QC 紧凑化 */
.qc-head { padding: 6px 4px; }
.qc-detail { padding: 2px 4px 10px 78px; }
.qc-layout { grid-template-columns: 220px 1fr; }

/* MCP 直连：上下堆叠 */
.dc-main { grid-template-columns: 1fr; }
.dc-tool { padding: 5px 8px; }
.dc-cat-head { font-size: 12px; padding: 6px 2px 3px; }

/* 发票中心紧凑化 */
.inv-tab { padding: 5px 12px; font-size: 12.5px; }

@media (max-width: 1024px) {
  .app-layout { flex-direction: column; }
  .chat-panel { width: 100%; flex: none; position: static; height: 480px; }
  .qc-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .tb-row { gap: 8px; }
  .fn-grid { grid-template-columns: 1fr; }
}

/* ===== 归整：滚动限制 / 徽章 / 紧凑微调 ===== */
/* 收件箱卡片：限制高度，避免撑爆运营面板 */
.email-list-box { max-height: 380px; overflow-y: auto; }
.email-item { padding: 6px 8px; }
/* MCP 直连：工具列表限高，保证表单可见 */
#dc-tools { max-height: 460px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 6px; padding: 0 6px; }
/* 文档库内容视图限高 */
#docs-view { max-height: 320px; overflow-y: auto; }
/* 写操作确认提示 → 徽章样式 */
.tab-panel .fn-tenant {
  margin-left: auto; font-size: 11px; color: var(--warn);
  background: rgba(194, 120, 10, 0.09); border: 1px solid rgba(194, 120, 10, 0.28);
  padding: 2px 10px; border-radius: 10px; white-space: nowrap;
}
/* 面板头部更紧凑一致 */
.tab-panel .sec-head { gap: 10px; }
.tab-panel .sec-head .sec-sub, .tab-panel .sec-head .sec-note { align-self: center; }
/* 快捷提问 chips 紧凑 */
.chat-panel .fn-chip { font-size: 11.5px; padding: 3px 10px; }
/* 欢迎语 */
.chat-msg.welcome { background: linear-gradient(120deg, rgba(20,80,140,0.05), rgba(14,143,126,0.06)); border: 1px dashed var(--rule); }
/* 工具结果滚动条美化（webkit） */
.fn-result::-webkit-scrollbar, .email-list-box::-webkit-scrollbar, #dc-tools::-webkit-scrollbar { width: 6px; }
.fn-result::-webkit-scrollbar-thumb, .email-list-box::-webkit-scrollbar-thumb, #dc-tools::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

/* ===== AI 助手：写操作开关 + 工具步骤气泡 ===== */
.cp-write {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px 8px; font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none;
}
.cp-write input { accent-color: var(--danger); cursor: pointer; }
.cp-write:has(input:checked) { color: var(--danger); font-weight: 600; }
.chat-msg.step {
  max-width: 92%; margin-bottom: 6px; margin-right: auto;
  padding: 4px 10px; border-radius: 8px; font-size: 11.5px; line-height: 1.4;
  background: var(--bg); border: 1px dashed var(--rule); color: var(--muted);
  white-space: normal; word-break: break-all;
}
.chat-msg.step code { font-family: 'JetBrainsMono', monospace; color: var(--accent); font-size: 11px; }

/* ===== AI 任务清单 ===== */
#task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row { background: var(--bg2); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.task-row.open { border-color: var(--accent); box-shadow: 0 1px 8px rgba(20, 80, 140, 0.08); }
.task-head { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; user-select: none; }
.task-head:hover { background: rgba(20, 80, 140, 0.03); }
.task-status { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 10px; white-space: nowrap; min-width: 64px; text-align: center; }
.task-status.st-pending { color: var(--muted); background: var(--bg); border: 1px solid var(--rule); }
.task-status.st-run { color: var(--accent); background: rgba(20, 80, 140, 0.08); border: 1px solid rgba(20, 80, 140, 0.35); animation: taskPulse 1.1s infinite; }
.task-status.st-done { color: #fff; background: var(--ok); border: 1px solid var(--ok); }
@keyframes taskPulse { 50% { opacity: 0.55; } }
.task-name { font-weight: 700; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.task-desc { font-size: 11.5px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-tag { font-size: 10px; font-weight: 700; color: var(--danger); border: 1px solid rgba(194, 59, 59, 0.45); padding: 0 6px; border-radius: 8px; flex: none; }
.task-time { font-size: 11px; color: var(--muted); font-family: 'JetBrainsMono', monospace; white-space: nowrap; }
.task-caret { color: var(--muted); font-size: 11px; transition: transform 0.15s; flex: none; }
.task-row.open .task-caret { transform: rotate(90deg); }
.task-body { display: none; padding: 2px 14px 14px 88px; border-top: 1px dashed var(--rule); }
.task-row.open .task-body { display: block; }
.task-body .fn-result { max-height: 480px; }
.task-body textarea, .task-body select { width: 100%; border: 1px solid var(--rule); border-radius: 7px; padding: 9px; font-size: 12.5px; background: var(--bg2); color: var(--ink); font-family: inherit; }
@media (max-width: 680px) {
  .task-desc { display: none; }
  .task-body { padding-left: 14px; }
}

/* ===== EvoCore 风格：活力橙 · 白色卡片 · 柔和投影 ===== */
:root {
  --accent: #f97316;
  --accent2: #ea580c;
  --ok: #22c55e;
  --warn: #d97706;
  --danger: #ef4444;
  --na: #9ca3af;
  --bg: #f0f5fa;
  --bg2: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --rule: #e5e7eb;
  --radius: 12px;
}
body {
  font-family: Inter, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: linear-gradient(135deg, #f0f5fa 0%, #ffffff 100%);
}

/* 顶栏：白色 + 橙色 logo 方块 + 下划线式导航 */
.topbar {
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.tb-left { align-items: center; }
.tb-left::before {
  content: 'D';
  width: 30px; height: 30px; flex: none;
  border-radius: 10px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.topbar .h-brand { color: var(--ink); font-size: 15px; }
.topbar .h-title { color: var(--muted); font-size: 12px; }
.tb-nav { gap: 20px; }
.tb-link {
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 6px 2px; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent;
}
.tb-link:hover { color: var(--accent); background: transparent; border: none; border-bottom: 2px solid transparent; }
.tb-link.active { color: var(--accent); font-weight: 700; border-bottom: 2px solid var(--accent); background: transparent; }
.tb-tenant { color: var(--muted); }
.tb-tenant select { background: #fff; color: var(--ink); border: 1px solid var(--rule); }
.tb-status { color: var(--muted); }
.tb-status.ok { color: var(--ok); }
.tb-status.warn { color: var(--warn); }
.tb-status.bad { color: var(--danger); }
#lang-toggle { border-color: var(--rule) !important; color: var(--muted) !important; }

/* 聊天面板：白色卡片 */
.chat-panel {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  color: var(--ink);
}
.cp-title { color: var(--ink); }
.cp-clear { background: var(--muted); border-color: transparent; color: #fff; opacity: 0.75; }
.cp-clear:hover { opacity: 1; color: #fff; border-color: transparent; }
.cp-sub { color: var(--muted); border-bottom-color: var(--rule); }
.chat-panel .fn-chip { background: #fff7ed; border: 1px solid #ffedd5; color: #c2410c; }
.chat-panel .fn-chip:hover { border-color: var(--accent); background: #ffedd5; color: #9a3412; }
.chat-panel .fn-chat-log { background: #fafbfd; border-color: var(--rule); }
.chat-msg.user { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3); }
.chat-msg.bot { background: #fff; border: 1px solid var(--rule); color: var(--ink); }
.chat-msg.bot .src { color: var(--muted); border-top-color: var(--rule); }
.chat-msg.bot h4, .chat-msg.bot h5 { color: #c2410c; }
.chat-msg.bot b { color: var(--ink); }
.chat-msg.bot table th, .chat-msg.bot table td { border-color: var(--rule); }
.chat-msg.bot hr { border-top-color: var(--rule); }
.chat-msg.bot code { background: #f3f4f6; color: var(--ink); }
.chat-msg.loading { color: var(--muted); }
.chat-msg.step { background: #fafbfd; border-color: var(--rule); color: var(--muted); }
.chat-msg.step code { color: #c2410c; }
.chat-msg.welcome { background: linear-gradient(120deg, #fff7ed, #fff); border: 1px dashed #ffedd5; color: var(--ink); }
.fn-chat-input input { background: #fff; border-color: var(--rule); color: var(--ink); }
.fn-chat-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); outline: none; }
.fn-chat-input input::placeholder { color: #9ca3af; }
.fn-chat-input button { background: var(--accent); box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25); border-radius: 999px; }
.fn-chat-input button:hover { background: var(--accent2); }
.cp-write { color: var(--muted); }
.cp-write:has(input:checked) { color: var(--danger); }

/* 标签页：EvoCore 下划线式导航 */
.c-tabs { gap: 22px; padding-top: 10px; background: #fff; }
.c-tab {
  border: none; background: transparent; box-shadow: none; border-radius: 0;
  padding: 6px 2px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.c-tab:hover { color: var(--accent); border: none; border-bottom: 2px solid transparent; }
.c-tab.active {
  color: var(--accent); background: transparent; border: none;
  border-bottom: 2px solid var(--accent); box-shadow: none;
}

/* 任务行：白色圆角卡片 + 着色徽章 */
.task-row { border-radius: 16px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.task-row:hover { border-color: #ffedd5; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08); }
.task-row.open { border-color: var(--accent); box-shadow: 0 8px 26px rgba(249, 115, 22, 0.14); }
.task-row.open .task-head { background: #fff7ed; }
.task-status.st-pending { color: var(--muted); background: #f3f4f6; border: none; }
.task-status.st-run { color: var(--accent); background: #fff7ed; border: none; animation: taskPulse 1.1s infinite; }
.task-status.st-done { color: #16a34a; background: #f0fdf4; border: none; box-shadow: none; }
.task-name { color: var(--ink); }
.task-tag { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.task-body { border-top-color: var(--rule); }
.task-caret { color: var(--muted); }

/* sec-head 橙色强调条 */
.sec-head::before { background: linear-gradient(180deg, var(--accent), var(--accent2)); }
.sec-title { color: var(--ink); }
.sec-num { color: var(--accent); }

/* 卡片统一 EvoCore 质感 */
.ops-card, .fn-card, .chart-card, .score-card, .metrics-card, .insight-card, .doc-view, .qc-side, .qc-main {
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
/* 主按钮：橙色 */
.fn-run, .live-btn:not(.ghost) {
  background: var(--accent); color: #fff; border: none;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}
.fn-run:hover, .live-btn:not(.ghost):hover { background: var(--accent2); color: #fff; }
.fn-run.run-write { background: var(--danger); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25); }
.fn-run.run-write:hover { background: #dc2626; }
/* QC chips 激活：橙色调 */
.chip.active { background: #fff7ed !important; border-color: var(--accent) !important; color: #c2410c !important; }
/* 徽章类橙色调 */
.tab-panel .fn-tenant { color: #c2410c; background: #fff7ed; border-color: #ffedd5; }
.ops-badge.warn { color: #c2410c; background: #fff7ed; }
/* 焦点环橙色 */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12); }

/* 全局细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ===== EvoCore 布局：问候区 + 统计卡 ===== */
.evo-greet { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.greet-title { font-size: 24px; font-weight: 700; color: var(--ink); margin: 0 0 4px; line-height: 1.25; }
.greet-sub { font-size: 13px; color: var(--muted); margin: 0; }
.greet-sub b { color: var(--ink); font-weight: 700; }
.sum-row { display: flex; gap: 12px; flex-wrap: wrap; }
.sum-card {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--rule); border-radius: 16px;
  padding: 10px 16px; min-width: 128px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  cursor: pointer; user-select: none;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.sum-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.sum-card.active { border-color: var(--accent); box-shadow: 0 4px 20px rgba(249, 115, 22, 0.16); }
.sc-ico {
  width: 30px; height: 30px; border-radius: 999px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.sc-green { background: #f0fdf4; color: #22c55e; }
.sc-orange { background: #fff7ed; color: #f97316; }
.sc-gray { background: #f3f4f6; color: #6b7280; }
.sc-red { background: #fef2f2; color: #ef4444; }
.sc-label { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.3; white-space: nowrap; }
.sc-num { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.2; }
@media (max-width: 1024px) {
  .evo-greet { flex-direction: column; align-items: flex-start; }
}

/* ===== EvoCore 功能对齐：日期 / 统计 / 筛选 / 动态 / 建议 / 提示 / 铃铛 ===== */
.greet-date {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--rule); border-radius: 12px;
  padding: 7px 12px; font-size: 12.5px; color: var(--ink);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); white-space: nowrap;
}
.greet-date svg { color: var(--muted); }

.sc-blue { background: #eff6ff; color: #3b82f6; }
.sc-purple { background: #faf5ff; color: #a855f7; }
.sc-orange2 { background: #fff7ed; color: #f97316; }

/* 任务筛选 chips */
.task-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tf-chip {
  border: 1px solid var(--rule); background: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer;
  transition: all 0.12s ease;
}
.tf-chip:hover { border-color: var(--accent); color: var(--accent); }
.tf-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 最近动态 */
.recent-card {
  background: #fff; border: 1px solid var(--rule); border-radius: 16px;
  padding: 16px 18px; margin-top: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.rc-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.rc-head svg { color: var(--muted); }
.rc-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--ink); }
.rc-time { font-size: 11px; color: var(--muted); font-family: 'JetBrainsMono', monospace; width: 40px; flex: none; }
.rc-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.rc-dot.rc-green { background: #22c55e; }
.rc-dot.rc-orange { background: #f97316; }
.rc-dot.rc-red { background: #ef4444; }
.rc-dot.rc-blue { background: #3b82f6; }
.rc-empty { font-size: 12px; color: var(--muted); padding: 4px 0; }

/* AI 建议动作列表（聊天面板） */
.sug-list { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px 4px; }
.sug-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 10px; padding: 6px 8px; cursor: pointer;
  transition: background 0.12s ease;
}
.sug-row:hover { background: #fff7ed; }
.sug-row:hover .sug-chev { color: var(--accent); transform: translateX(2px); }
.sug-ico {
  width: 30px; height: 30px; border-radius: 999px; flex: none;
  background: #fff7ed; color: #f97316;
  display: flex; align-items: center; justify-content: center;
}
.sug-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.3; }
.sug-desc { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.3; }
.sug-chev { color: #d1d5db; font-size: 16px; margin-left: auto; flex: none; transition: all 0.12s ease; }

/* AI 提示卡 */
.ai-tip { margin: 0 12px 8px; background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 9px 12px; }
.tip-head { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.tip-head svg { color: var(--accent); }
.tip-body { font-size: 11.5px; color: var(--ink); margin: 0; line-height: 1.5; }

/* 通知铃铛 */
.bell-wrap { position: relative; }
.tb-bell {
  background: transparent; border: none; cursor: pointer; color: var(--muted);
  padding: 4px; border-radius: 999px; position: relative;
}
.tb-bell:hover { color: var(--accent); background: #fff7ed; }
.bell-dot {
  position: absolute; top: -2px; right: -4px;
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #fff;
}
.bell-menu {
  position: absolute; top: 34px; right: 0; width: 260px;
  background: #fff; border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); z-index: 120; overflow: hidden;
}
.bm-head { font-size: 12px; font-weight: 700; color: var(--ink); padding: 10px 14px 6px; }
.bm-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  padding: 8px 14px; font-size: 12.5px; color: var(--ink); cursor: pointer;
  border-top: 1px solid #f3f4f6;
}
.bm-item:hover { background: #fff7ed; }
.bm-item .bm-tag { color: var(--accent); font-weight: 700; font-size: 11px; margin-right: 6px; }
.bm-empty { padding: 8px 14px 12px; font-size: 12px; color: var(--muted); }

/* ===== EvoCore 布局 1:1 ===== */
/* 顶栏 64px */
.evo-hd {
  height: 64px; background: #fff; border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 100;
}
.evo-hd-in {
  max-width: 1280px; margin: 0 auto; height: 100%; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.evo-hd-left { display: flex; align-items: center; gap: 40px; height: 100%; }
.evo-logo { display: flex; align-items: center; gap: 10px; }
.evo-logo-ico {
  width: 32px; height: 32px; border-radius: 10px; background: #f97316;
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.evo-logo-txt { display: flex; align-items: baseline; gap: 6px; }
.evo-logo-txt b { font-size: 17px; font-weight: 700; color: #1f2937; }
.evo-logo-txt span { font-size: 13px; color: #6b7280; }
.evo-nav { display: flex; align-items: center; gap: 24px; height: 64px; }
.evo-nav-a {
  height: 100%; display: flex; align-items: center;
  font-size: 14px; font-weight: 400; color: #6b7280; text-decoration: none;
  border-bottom: 2px solid transparent;
}
.evo-nav-a:hover { color: #f97316; }
.evo-nav-a.active { color: #f97316; font-weight: 600; border-bottom-color: #f97316; }
.evo-hd-right { display: flex; align-items: center; gap: 20px; }
/* 头像 */
.avatar {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; cursor: pointer; padding: 0;
}
.av-ico {
  width: 36px; height: 36px; border-radius: 999px; background: #f3f4f6;
  color: #1f2937; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.av-txt { text-align: left; line-height: 1.3; }
.av-txt b { display: block; font-size: 13px; color: #1f2937; font-weight: 600; }
.av-txt small { display: block; font-size: 11px; color: #6b7280; }
.avatar svg { color: #6b7280; }
.avatar-wrap { position: relative; }
.avatar-menu {
  position: absolute; top: 46px; right: 0; width: 240px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12); z-index: 120; padding: 6px 0;
}
.am-row { padding: 8px 14px; font-size: 12.5px; color: #1f2937; display: flex; align-items: center; gap: 8px; }
.am-row select { flex: 1; border: 1px solid #e5e7eb; border-radius: 6px; padding: 4px 6px; font-size: 12px; color: #1f2937; }

/* 主区 65/35 双栏 */
.evo-main { max-width: 1280px; margin: 0 auto; padding: 24px 32px; }
.evo-grid { display: grid; grid-template-columns: 65% 35%; gap: 24px; align-items: start; }
.evo-col-l, .evo-col-r { display: flex; flex-direction: column; gap: 24px; }
#view-accounting { display: flex; flex-direction: column; gap: 24px; }
#view-accounting[hidden] { display: none; }

/* 卡片 */
.evo-card {
  background: #fff; border-radius: 16px; padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.evo-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.evo-card-head h2 { font-size: 16px; font-weight: 600; color: #1f2937; margin: 0; }
.evo-card-head svg { color: #6b7280; }
.evo-card-head .evo-ic-orange { color: #f97316; }
.evo-sub { font-size: 12px; color: #6b7280; }
.evo-badge {
  background: #fff7ed; color: #f97316; border-radius: 999px;
  padding: 2px 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
}
.evo-empty { font-size: 12.5px; color: #9ca3af; padding: 6px 2px; }
.evo-cta {
  margin-top: 16px; width: 100%; height: 48px;
  background: #f97316; color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}
.evo-cta:hover { background: #ea580c; }
.evo-tip { font-size: 13.5px; color: #1f2937; margin: 0; line-height: 1.6; }

/* 列表内任务行 → 扁平条目 */
#done-list .task-row, #att-list .task-row {
  border: none; border-radius: 0; box-shadow: none;
  border-bottom: 1px solid #f3f4f6; background: transparent;
}
#done-list .task-row:last-child, #att-list .task-row:last-child { border-bottom: none; }
#done-list .task-row.open, #att-list .task-row.open { border-color: #f3f4f6; box-shadow: none; }
#done-list .task-row.open .task-head, #att-list .task-row.open .task-head { background: #fff7ed; border-radius: 8px; }
#done-list .task-head, #att-list .task-head { padding: 9px 2px; }
#done-list .task-row:hover, #att-list .task-row:hover { border-color: #f3f4f6; box-shadow: none; }
.task-body { border-top-color: #f3f4f6; }
#att-list .task-status.st-pending { color: #c2410c; background: #fff7ed; }

/* 统计行 5 列 */
.sum-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.sum-card { min-width: 0; padding: 16px 14px; gap: 8px; }
.sum-card .sc-ico { width: 34px; height: 34px; }
.sc-num { font-size: 20px; }

/* 问 AI 卡片内聊天 */
.evo-card .fn-chat-log { max-height: 380px; margin: 10px 0 0; }
.evo-card .fn-chat-input { margin-top: 8px; }
.evo-card .fn-chat-input button { width: 40px; height: 40px; padding: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex: none; }
.evo-card .cp-write { padding: 4px 0 6px; }
/* 视图内容卡片间距 */
#view-sales, #view-ops, #view-cs, #view-direct { display: flex; flex-direction: column; gap: 16px; }
#view-cs .evo-card { padding: 20px; }
#view-audit .qc-layout { margin-top: 4px; }

/* ===== 视图卡片统一（公用 EvoCore 卡片） ===== */
#view-sales .evo-card, #view-direct .evo-card { padding: 20px 24px; }
#view-ops .ops-card {
  padding: 20px 24px; border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
#view-cs .ops-card { background: transparent; border: none; box-shadow: none; padding: 0; }
#view-cs .ops-card h3 { margin-top: 0; }
#view-sales .sec-head, #view-ops .sec-head, #view-direct .sec-head, #view-audit .sec-head { padding-left: 0; }
#view-sales .sec-head::before, #view-ops .sec-head::before, #view-direct .sec-head::before { display: none; }

/* ===== 严格还原参考稿样式（完整对照） ===== */
/* 问候：30px 标题 + 14px 副标题 */
.greet-title { font-size: 30px; line-height: 36px; }
.greet-sub { font-size: 14px; margin-top: 4px; }
/* 日期胶囊：12px 内边距 · 14px 字 */
.greet-date { padding: 8px 12px; font-size: 14px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); }
/* 卡片头部：20px 下边距 + 查看链接 */
.evo-card-head { margin-bottom: 20px; }
.evo-link { margin-left: auto; font-size: 12px; font-weight: 500; color: #f97316; text-decoration: none; }
.evo-link:hover { text-decoration: underline; }
/* CTA：20px 上边距 */
.evo-cta { margin-top: 20px; }
/* 统计卡：竖排居中（参考稿 grid-cols-5：图标在上、标签居中、数字 24px） */
.sum-card { flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 24px; }
.sum-card > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sum-card .sc-ico { width: 40px; height: 40px; }
.sc-label { font-size: 12px; }
.sc-num { font-size: 24px; line-height: 32px; }
/* 最近动态：条目 16px 间距 · 时间列 48px · 8px 圆点 · 14px 文本 */
#recent-list { display: flex; flex-direction: column; gap: 16px; }
.rc-item { padding: 0; gap: 12px; font-size: 14px; }
.rc-time { width: 48px; font-size: 12px; }
.rc-dot { width: 8px; height: 8px; }
/* 建议动作：行间距 16px · 40px 图标圆 · 14px/12px 文案 */
.sug-list { gap: 16px; padding: 0; }
.sug-row { padding: 0; }
.sug-row:hover { background: transparent; }
.sug-ico { width: 40px; height: 40px; }
.sug-title { font-size: 14px; }
.sug-desc { font-size: 12px; }
/* 问 AI：36px 圆形发送按钮 */
.evo-card .fn-chat-input button { width: 36px; height: 36px; }
/* 列表条目：24px 图标圆 + 14px 标题 + 12px 描述 + 右侧 12px 状态徽章 */
#done-list, #att-list { display: flex; flex-direction: column; gap: 16px; }
#done-list .task-row, #att-list .task-row { border-bottom: none; }
#done-list .task-head, #att-list .task-head { padding: 4px 2px; gap: 12px; }
.task-head::before {
  content: ''; width: 24px; height: 24px; border-radius: 999px; flex: none;
  background: #f3f4f6; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.task-row:has(.task-status.st-done) .task-head::before { content: '✓'; background: #f0fdf4; color: #22c55e; }
.task-row:has(.task-status.st-run) .task-head::before { content: '●'; background: #fff7ed; color: #f97316; }
.task-row:has(.task-status.st-pending) .task-head::before { content: '›'; background: #fff7ed; color: #f97316; }
.task-head .task-status { order: 10; margin-left: auto; font-size: 12px; padding: 2px 10px; border-radius: 999px; min-width: 0; }
.task-head .task-time { order: 11; }
.task-head .task-caret { order: 12; }
.task-head .task-tag { order: 4; }
.task-name { font-size: 14px; font-weight: 500; }
.task-desc { font-size: 12px; }

/* 合并卡分隔线 */
.evo-divider { border-top: 1px solid #f3f4f6; margin: 20px 0; }

/* hidden 属性强制生效（防止 display:flex 覆盖导致所有视图堆叠在首页） */
[hidden] { display: none !important; }

/* Management 内嵌看板 */
#view-mgmt { display: block; }
.mgmt-frame {
  width: 100%; height: calc(100vh - 120px);
  border: none; border-radius: 16px;
  background: #fff; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ===== 写操作密码弹窗 ===== */
.pw-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.pw-modal {
  background: #fff; border-radius: 16px; padding: 28px 30px;
  width: 360px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.pw-head { font-size: 17px; font-weight: 700; color: #1f2937; }
.pw-sub { font-size: 12.5px; color: #6b7280; margin: 6px 0 14px; }
.pw-modal input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 14px; font-size: 15px; letter-spacing: 4px; text-align: center;
}
.pw-modal input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); outline: none; }
.pw-err { color: #ef4444; font-size: 12px; margin-top: 8px; }
.pw-actions { display: flex; gap: 10px; margin-top: 16px; }
.pw-btn {
  flex: 1; border: 1px solid #e5e7eb; background: #fff; color: #6b7280;
  border-radius: 10px; padding: 9px 0; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.pw-btn.primary {
  background: #f97316; border-color: #f97316; color: #fff;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}
.pw-btn.primary:hover { background: #ea580c; }

/* ===== 添加租户 ===== */
.am-add { border-top: 1px solid #f3f4f6; margin-top: 4px; padding-top: 8px; }
.add-tenant-btn {
  width: 100%; border: 1px dashed #f97316; background: #fff7ed; color: #f97316;
  border-radius: 8px; padding: 7px 0; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.add-tenant-btn:hover { background: #ffedd5; }
.at-modal { width: 420px; text-align: left; }
.at-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.at-row label { font-size: 12.5px; color: #6b7280; white-space: nowrap; }
.at-row input {
  flex: 1; box-sizing: border-box;
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.at-row input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15); outline: none; }
.at-link-box {
  display: flex; align-items: center; gap: 8px;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px;
}
.at-link-box code { flex: 1; font-size: 12px; word-break: break-all; color: #374151; }
#at-copy {
  flex: none; border: none; background: #f97316; color: #fff;
  border-radius: 6px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
}
#at-copy:hover { background: #ea580c; }
#at-copy.copied { background: #22c55e; }
.at-modal .pw-actions { margin-top: 14px; }
