* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 品牌配色（同时同步 Element Plus 主色，登录 el-* 与全局一致） */
  --pri: #2563eb; --pri-d: #1e40af; --pri-l: #eff4ff;
  --grad-pri: linear-gradient(135deg, #3b82f6, #2563eb);
  --grad-ok: linear-gradient(135deg, #22c55e, #16a34a);
  --grad-warn: linear-gradient(135deg, #fb923c, #ea580c);
  --text: #1f2430; --sub: #8792a6; --line: #e8ebf1; --canvas: #f5f7fb;
  --ok: #16a34a; --warn: #ea580c; --warn-bg: #fff5e9;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 16px rgba(16,24,40,.05);
  --shadow-lg: 0 8px 30px rgba(16,24,40,.10);
  --r: 12px; --r-sm: 9px;

  /* Element Plus 主色对齐 */
  --el-color-primary: #2563eb;
  --el-color-primary-light-3: #5b8cf5;
  --el-color-primary-light-5: #8db0f8;
  --el-color-primary-light-7: #bfd4fb;
  --el-color-primary-light-8: #d7e3fd;
  --el-color-primary-light-9: #eff4ff;
  --el-color-primary-dark-2: #1e40af;
  --el-border-radius-base: 9px;
}

[v-cloak] { display: none; }
html, body { width: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 500px at 100% -10%, #e8effb 0%, transparent 60%),
              radial-gradient(900px 420px at -10% 0%, #eef6ee 0%, transparent 55%),
              var(--canvas);
  background-attachment: fixed;
  color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased;
}

/* ===== 登录 ===== */
.login { max-width: 380px; margin: 12vh auto 0; padding: 0 24px; text-align: center; }
.login .logo { font-size: 40px; line-height: 1.4; margin-bottom: 22px; }
.login-card { max-width: 340px; margin: 0 auto; border-radius: 16px; }
.login .el-form-item { margin-bottom: 16px; }
.login-btn { width: 100%; font-weight: 600; letter-spacing: 2px; }
.login .hint { margin-top: 16px; font-size: 13px; color: var(--sub); }

/* ===== 通用按钮 ===== */
.btn { display: inline-block; padding: 12px 18px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--text); font-size: 15px; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, box-shadow .18s ease, background-color .18s, border-color .18s, color .18s;
  box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.btn:hover { border-color: var(--pri); color: var(--pri); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-pri); color: #fff; border: none; box-shadow: 0 4px 14px rgba(37,99,235,.28); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(37,99,235,.36); filter: brightness(1.03); color: #fff; }
.btn.primary:active { transform: translateY(1px); }
.btn.ghost { background: var(--pri-l); color: var(--pri); border-color: transparent; }
.btn.ghost:hover { background: #e2ebff; color: var(--pri-d); }
.btn.danger { background: #fff; color: #d64545; border-color: #f0d3d3; }
.btn.danger:hover { border-color: #d64545; color: #d64545; background: #fff5f5; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[disabled]:active { transform: none; }

/* ===== 应用骨架 ===== */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px;
  background: var(--grad-pri); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar .brand .ic { font-size: 20px; }
.topbar .who { font-size: 13px; color: var(--sub); display: flex; align-items: center; gap: 4px; }
.topbar .who a { margin-left: 10px; color: var(--pri); text-decoration: none; font-weight: 600; }
.topbar .who a:hover { text-decoration: underline; }

.main { flex: 1; padding: 18px; padding-bottom: 76px; max-width: 920px; margin: 0 auto; width: 100%; }
.page h3 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.page h3::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--grad-pri); }

/* ===== 首页 ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card { background: var(--card, #fff); border-radius: var(--r); padding: 16px 10px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.6); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card b { display: block; font-size: 22px; color: var(--pri-d); font-weight: 800; }
.card.acc b { background: var(--grad-pri); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card span { font-size: 12px; color: var(--sub); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.quick .q { background: #fff; border-radius: var(--r); padding: 22px 0; text-align: center;
  font-size: 26px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s; border: 1px solid rgba(255,255,255,.6); }
.quick .q:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.quick .q span { display: block; font-size: 14px; color: var(--text); margin-top: 6px; }

/* —— 首页近 7 天营收小图 —— */
.trend { background: #fff; border-radius: var(--r); padding: 16px; margin-top: 16px; box-shadow: var(--shadow); }
.trend h4 { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.trend-bars { display: flex; gap: 8px; align-items: flex-end; height: 120px; }
.tb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.tb .bar { width: 100%; height: 78px; background: var(--bg); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.tb .bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--pri), var(--pri-d)); border-radius: 8px 8px 0 0; min-height: 2px; transition: height .6s ease; }
.tb.today .bar i { background: linear-gradient(180deg, #f59e0b, #d97706); }
.tb em { font-style: normal; font-size: 11px; color: var(--sub); white-space: nowrap; }
.tb span { font-size: 10px; color: var(--sub); }
.tb:first-child span, .tb:last-child span { color: var(--text); }

.pending { background: linear-gradient(180deg, #fff, #fbfcff); border-radius: var(--r); padding: 14px;
  margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.pending .row { display: flex; justify-content: space-between; padding: 6px 0; }
.pending b { color: var(--pri-d); }
.pending .go { color: var(--pri); font-size: 13px; text-decoration: none; font-weight: 600; }

/* ===== 上传 / 报表 ===== */
.upload { background: #fff; border: 2px dashed #d8dee9; border-radius: var(--r); padding: 34px 16px;
  text-align: center; color: var(--sub); margin-bottom: 12px; cursor: pointer; transition: border-color .18s, background .18s; }
.upload:hover { border-color: var(--pri); background: var(--pri-l); }
.upload img.preview { max-width: 100%; max-height: 240px; border-radius: var(--r-sm); }
.upload span { display: block; margin-top: 6px; }
.parsed { margin-top: 18px; }
.parsed h4 { font-size: 14px; color: var(--sub); margin-bottom: 8px; }

/* ===== 表格 ===== */
.tblwrap { overflow-x: auto; background: #fff; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 420px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7f9fc; color: var(--sub); font-weight: 600; font-size: 12px; letter-spacing: .3px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: none; }
tr.warn td { background: var(--warn-bg); color: var(--warn); }
table .cell-actions button { margin: 0 4px; }
table .em { font-style: normal; color: var(--sub); }

/* ===== 月份选择栏 ===== */
.monthbar { display: flex; gap: 10px; margin-bottom: 12px; }
.monthbar input { flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; background: #fff; }
.monthbar input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.monthbar .btn { flex: 0 0 auto; }

/* ===== 状态文本 / 提示 ===== */
.ok { color: var(--ok); margin-top: 12px; font-weight: 600; }
.err { color: #d64545; margin-top: 12px; font-size: 14px; }
.hint { color: var(--sub); font-size: 13px; margin-top: 12px; }
.msg { margin-top: 10px; font-size: 14px; }
.msg.ok { color: var(--ok); } .msg.err { color: #d64545; }

/* ===== 底部导航（仅手机显示；桌面默认隐藏） ===== */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); z-index: 30; }
.tabbar { display: none; }   /* 默认隐藏，手机端显示（见下方媒体查询） */
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 7px 0 9px; font-size: 11px; color: var(--sub); text-decoration: none; }
.tabbar a .tab-ic { font-size: 20px; line-height: 1; }
.tabbar a.on { color: var(--acc-d); font-weight: 600; }

/* 「更多」全部功能网格 */
/* ===== 顶部导航（药丸） ===== */
.topnav { position: sticky; top: 0; z-index: 19; background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 6px; padding: 8px 12px; }
.topnav a { flex: none; padding: 9px 16px; font-size: 14px; color: var(--sub); text-decoration: none; border-radius: 999px; transition: background .15s, color .15s; white-space: nowrap; }
.topnav a:hover { color: var(--pri); background: var(--pri-l); }
.topnav a.on { color: #fff; font-weight: 700; background: var(--grad-pri); box-shadow: 0 4px 10px rgba(37,99,235,.25); }

/* ===== 子导航 ===== */
.subnav { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.subnav button { flex: none; border: 1px solid var(--line); background: #fff; color: var(--sub); border-radius: 999px; padding: 8px 16px; font-size: 13px; cursor: pointer; transition: all .15s; font-family: inherit; }
.subnav button:hover { border-color: var(--pri); color: var(--pri); }
.subnav button.on { background: var(--grad-pri); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(37,99,235,.22); }

/* ===== 表单 ===== */
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.form label { display: block; font-size: 13px; color: var(--sub); margin: 12px 0 4px; }
.form input, .form select, .form textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; background: #fff; transition: border-color .15s, box-shadow .15s; font-family: inherit; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cardset { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cardsel { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; cursor: pointer; text-align: center; font-size: 13px; transition: all .15s; background: #fff; }
.cardsel.on { border-color: var(--pri); background: var(--pri-l); color: var(--pri-d); font-weight: 600; }

/* ===== 顶部提示横幅 ===== */
.banner { background: var(--warn-bg); color: var(--warn); border: 1px solid #f3ddb0; border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.banner.ok { background: #eaf7ee; color: #1f8a4c; border-color: #bfe6cc; }

/* ===== 底部抽屉 / 弹层 ===== */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.42); z-index: 50; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); }
.sheet { position: relative; width: 100%; max-width: 460px; background: #fff; border-radius: 18px 18px 0 0; padding: 20px 18px 28px; animation: up .2s ease; box-shadow: var(--shadow-lg); }
@keyframes up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h3 { font-size: 17px; margin: 0 0 6px; }
.sheet .x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 24px; color: var(--sub); cursor: pointer; }
.sheet .amt { font-size: 32px; font-weight: 800; color: #173f2f; margin: 8px 0 16px; }
.sheet .qr { display: block; width: 200px; height: 200px; margin: 6px auto 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ===== 列表卡片 ===== */
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; box-shadow: var(--shadow); overflow: hidden; }
.list .li { padding: 12px 14px; border-bottom: 1px solid var(--line); transition: background .12s; }
.list .li:last-child { border-bottom: none; }
.list .li:hover { background: #fafbff; }
.list .lh { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.list .ld { font-size: 13px; color: var(--sub); margin-top: 3px; }
.list .lb { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
/* 列表行下方的操作按钮组（收银/改/删…）。模板里一直在用 .acts，但样式表里没有这条，
   于是按钮直接贴在信息行下沿、没有上边距。跟上面的 .lb 同一套间距，保持一致。 */
.list .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
/* 次要信息（单号、备注等）压暗。em 默认斜体，这里连同斜体一起去掉 */
.muted { font-style: normal; color: var(--sub); }

/* ===== 状态徽标 ===== */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.pending { background: var(--warn-bg); color: var(--warn); margin: 0; box-shadow: none; }
.chip.confirmed { background: #e8f6ee; color: #16a34a; }
.chip.cancelled { background: #fdeeee; color: #d64545; }

/* ===== 盘点网格 ===== */
.stocktake-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stocktake-grid .sg { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); }
.sg .nm { font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.sg input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; }
.sg input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ===== AI 管家 ===== */
.butler { display: flex; flex-direction: column; min-height: 46vh; }
.butler .chat { flex: 1; overflow-y: auto; max-height: 52vh; padding: 6px 2px 10px; display: flex; flex-direction: column; gap: 10px; }
.butler .b { display: flex; }
.butler .b.me { justify-content: flex-end; }
.butler .bubble { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.butler .bubble.who { background: #f2ede3; color: #333; border-top-left-radius: 4px; }
.butler .bubble.me { background: var(--grad-pri); color: #fff; border-top-right-radius: 4px; box-shadow: 0 4px 10px rgba(37,99,235,.22); }
.butler .qrow { display: flex; gap: 8px; margin-top: 10px; }
.butler .qrow input { flex: 1; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; }
.butler .qrow input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ===== 商品维护：材料配方 ===== */
.recipe-rows { display: flex; flex-direction: column; gap: 8px; }
.rrow { display: flex; gap: 8px; align-items: center; }
.rrow select { flex: 1.4; padding: 9px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; background: #fff; }
.rrow input { flex: 0.9; padding: 9px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; }

/* ===== 设置 / 上传控件 ===== */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.imgrow { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
img.thumb { width: 52px; height: 44px; object-fit: cover; border-radius: 8px; background: #f2f4f7; }
.env-thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 8px; background: #f2f4f7; }
.sheet.wide { max-width: 560px; }

/* ===== 手机端（置于末尾，保证覆盖优先生效） ===== */
@media (max-width: 800px) {
  .topnav { display: none; }
  .tabbar { display: flex; }
  .main { padding-bottom: 88px; }
  .topbar { padding: 10px 14px; }
  .topbar .brand { font-size: 15px; }
  .topbar .who { font-size: 12px; }
}

/* ===== AI 管家：工具确认卡 ===== */
.tc-text { white-space: pre-wrap; }
.tool-card { margin-top: 10px; border: 1px solid var(--pri-l); background: #f7faff;
  border-radius: 12px; padding: 12px; text-align: left; }
.tc-head { font-weight: 700; color: var(--pri-d); font-size: 14px; }
.tc-args { margin: 6px 0 8px; font-size: 13px; color: var(--text); }
.tc-ops { display: flex; gap: 8px; }
.tc-btn { flex: 1; } .tc-btn.ok { background: var(--grad-pri); color: #fff; }
.tc-op-state { color: var(--sub); font-size: 13px; }
.tc-done { color: var(--ok); font-size: 13px; white-space: pre-wrap; }
.tc-cancel { color: var(--sub); font-size: 13px; }

/* =====================================================================
   OpenCode 风格 · AI-first 移动工作台（首页工作台 + 底部 AI 中央 + agent 视图）
   借鉴 local opencode：蓝 accent、灰阶中性、13px 正文、440/530 字重、tracking 收紧
   ===================================================================== */
:root {
  --acc: #3b5cf6; --acc-d: #2f46c8; --acc-l: #eef1ff;
  --ink: #1a1d27; --ink-2: #6b7280; --ink-3: #9ca3af;
  --line2: rgba(70,80,100,.12); --card2: #fff;
  --fh: 13px; --tracking: -0.04px;
}

/* —— 首页 · 工作台 —— */
.page-home { padding-top: 4px; }
.stat-strip { display: grid; grid-template-columns: 3fr 2fr 2fr; gap: 10px; margin-bottom: 14px; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; padding: 16px 14px; box-shadow: var(--shadow); }
.stat-strip .s { text-align: center; }
.stat-strip .s + .s { border-left: 1px solid var(--line2); }
.stat-strip b { display: block; font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: var(--tracking); }
.stat-strip b.big { font-size: 22px; background: linear-gradient(135deg, var(--acc), var(--acc-d)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-strip span { font-size: 11px; color: var(--ink-2); }
.wkt-title { font-size: 14px; color: var(--ink-2); margin: 20px 0 10px; }
.wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wcard { background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 16px 8px 14px; text-align: center; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.wcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--acc); }
.wcard .wic { font-size: 24px; line-height: 1; }
.wcard b { font-size: 13px; color: var(--ink); font-weight: 530; letter-spacing: var(--tracking); }
.wcard small { font-size: 11px; color: var(--ink-3); }

/* —— 底部导航：AI 中央凸起（小药丸，行内不破高度）—— */
.tabbar a.center { position: relative; flex: 1.1; color: var(--acc-d); font-weight: 640; padding: 6px 0 4px; }
.tabbar a.center .tab-ic { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 26px; border-radius: 13px; font-size: 18px; }
.tabbar a.center::before { content:""; position:absolute; top:4px; left:50%; transform:translateX(-50%); width:42px; height:26px; border-radius:13px; background:linear-gradient(135deg,var(--acc),var(--acc-d)); box-shadow:0 6px 14px rgba(59,92,246,.35); z-index:0; }
.tabbar a.center.on::before { box-shadow:0 7px 16px rgba(59,92,246,.5); }
.tabbar a.more { flex: 0 0 auto; }

/* —— Agent 视图（opencode 式）—— */
.page-agent { display: flex; flex-direction: column; height: calc(100vh - 118px); padding: 0 2px; }
.agent-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.agent-h { font-size: 16px; margin-bottom: 8px; }
.agent-h .em { font-size: 12px; font-weight: 400; }
.conv-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.conv-title { font-size: 13px; color: var(--ink-2); background: var(--card2); border: 1px solid var(--line2); border-radius: 20px; padding: 4px 12px; }
.conv-new { background: var(--acc); color: #fff; border: none; border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.conv-new:hover { opacity: .9; }
.conv-picker { position: relative; }
.conv-cur { cursor: pointer; font-size: 13px; color: var(--acc-d); padding: 4px 10px; border-radius: 20px; }
.conv-menu { position: absolute; z-index: 20; left: auto; right: 0; top: calc(100% + 6px); min-width: 220px; max-width: min(320px, calc(100vw - 24px)); max-height: 300px; overflow-y: auto; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 8px 24px rgba(20,25,40,.14); padding: 6px; }
.conv-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.conv-item:hover { background: var(--line2); }
.conv-item.on { background: var(--acc); color: #fff; }
.conv-item .ct { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.conv-item .cm { font-size: 11px; opacity: .7; }
.conv-item .c-del { background: none; border: none; color: inherit; font-size: 14px; cursor: pointer; opacity: .6; }
.conv-item .c-del:hover { opacity: 1; }
.conv-empty { padding: 10px; font-size: 13px; color: var(--ink-3); text-align: center; }
.kb-draw { background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; }
.kb-draw summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 4px 0; }
.kb-draw .form { border: none; box-shadow: none; padding: 10px 0 4px; margin-bottom: 0; }
.kb-draw .list { margin-bottom: 8px; }

.amessages { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 2px 8px; display: flex; flex-direction: column; gap: 16px; }
.ahint { color: var(--ink-3); font-size: 13px; padding: 22px 4px; text-align: center; line-height: 1.6; }
.ahint.think { color: var(--acc-d); }
.amsg { width: 100%; }
.amsg.me .meta { text-align: right; }
.amsg .meta { font-size: 11px; color: var(--ink-3); letter-spacing: var(--tracking); margin-bottom: 8px; }
.ablock { width: 100%; }
.atext .md { font-size: var(--chat-fs, 17px); line-height: 1.68; color: var(--ink); white-space: pre-wrap; word-break: break-word; letter-spacing: var(--tracking); }
.atext .caret { color: var(--acc); animation: caretblink .9s step-start infinite; }
@keyframes caretblink { 50% { opacity: 0; } }
/* 照片识别中 · 小旋转指示 */
.mkspin { display: inline-block; width: 13px; height: 13px; margin-right: 7px; vertical-align: -2px; border: 2px solid rgba(230,86,26,.22); border-top-color: #e0561a; border-radius: 50%; animation: mkspin .7s linear infinite; }
@keyframes mkspin { to { transform: rotate(360deg); } }

/* 工具块：查询 chip + 写操作确认卡 */
.atools { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.toolchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); background: #f6f7fb; border: 1px solid var(--line2); border-radius: 999px; padding: 4px 11px; width: fit-content; }
.toolchip .ti { font-size: 12px; }
.toolchip .tstat { font-size: 11px; color: var(--ink-2); }
.toolchip .tstat.done { color: var(--ok); }
.atools .tool-card { margin-top: 4px; }

/* composer 输入卡 */
.composer { background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 4px 16px rgba(20,25,40,.08); padding: 10px 12px; margin-top: 8px; }
.c-input textarea { width: 100%; border: 0; outline: 0; resize: none; font-size: 14px; line-height: 1.6; color: var(--ink); font-family: inherit; background: transparent; min-height: 26px; max-height: 120px; letter-spacing: var(--tracking); }
.c-input textarea::placeholder { color: var(--ink-3); }
.c-bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.c-ic { border: 0; background: transparent; font-size: 20px; cursor: pointer; padding: 4px; line-height: 1; }
.c-ic.on { filter: drop-shadow(0 0 4px var(--acc)); }
.c-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.c-chips .chip { border: 1px solid var(--line2); background: var(--acc-l); color: var(--acc-d); border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit; transition: all .15s; }
.c-chips .chip:hover { border-color: var(--acc); }
.c-send { flex: 0 0 auto; margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--acc); color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 4px 10px rgba(59,92,246,.35); transition: all .15s; }
.c-send:hover { background: var(--acc-d); }
.c-send:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.c-voice { margin-top: 10px; border-top: 1px solid var(--line2); padding-top: 10px; }
.c-voice textarea { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; font-size: 14px; font-family: inherit; resize: none; }
.c-voice .btn { margin-top: 8px; }
/* 语音识别框下面那两个按钮（询问 AI / 存为备注）。.btn 是 inline-block，
   不排一行的话两个按钮会紧贴在一起、还跟着文字基线晃 */
.c-voice-btns { display: flex; align-items: center; gap: 8px; }
.c-voice-btns .btn { margin-top: 8px; }

/* —— 拍照/AI 汇总：composer 附照 + 消息图片 —— */
.c-photo { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.c-photo img { width: 52px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); }
.c-photo .chip { font-size: 11px; }
.c-photo .x { margin-left: auto; border: 0; background: transparent; color: var(--ink-3); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.am-photo { display: block; max-width: min(46vw, 200px); border-radius: 10px; border: 1px solid var(--line2); margin: 2px 0 4px; }
.amsg.me .am-photo { margin-left: auto; }

/* 确认卡参数列表（罗列字段，供成员核对） */
.tc-args { display: flex; flex-direction: column; gap: 4px; }
.tc-kv { display: flex; gap: 8px; font-size: 13px; }
.tc-kv .k { color: var(--ink-2); flex: 0 0 78px; }
.tc-kv .v { color: var(--ink); flex: 1; word-break: break-word; }

/* 确认卡可编辑表单（AI 弹卡后可再次填写/修改，提交后只读） */
.tc-args .tc-field { display: flex; align-items: flex-start; gap: 8px; margin-top: 2px; }
.tf-label { flex: 0 0 78px; font-size: 13px; color: var(--ink-2); padding-top: 6px; }
.tf-label .req { color: #e34; margin-right: 2px; }
.tf-ctl { flex: 1; min-width: 0; }
.tf-ctl input[type="text"], .tf-ctl input[type="number"], .tf-ctl input[type="date"], .tf-ctl select, .tf-ctl textarea {
  width: 100%; box-sizing: border-box; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--pri-l); border-radius: 6px; background: #fff; color: var(--ink);
}
.tf-ctl textarea { resize: vertical; }
.tf-ctl input:disabled, .tf-ctl select:disabled, .tf-ctl textarea:disabled { background: #f2f4f7; color: var(--ink-2); }
.tf-ctl .tf-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); padding-top: 6px; }
.tf-ctl .tf-check input { width: 16px; height: 16px; }
.tf-empty { font-size: 12px; color: var(--ink-2); padding: 4px 0; }

/* —— AI 待审批页 —— */
.page-approve { padding-top: 6px; }
.page-h { font-size: 16px; }
.page-h small { font-size: 12px; font-weight: 400; color: var(--ink-2); }
.appr-photo { display: block; width: 100%; max-width: 260px; border-radius: 10px; border: 1px solid var(--line2); margin-bottom: 8px; }
.appr-photo-sm { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); margin: 2px 0 4px; }
/* —— 收银机指令队列（管理员审核 第三个 tab）—— */
.cmd-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
/* —— 报销列表：单据图缩略图（点开看大图） —— */
.exp-thumb-link { display: inline-block; vertical-align: middle; margin: 2px 0 0 2px; }
.exp-thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line2); background: #f5f6f8; cursor: zoom-in; }
.exp-thumb:hover { border-color: var(--pri); }

/* —— 确认卡：单据图（可更换） —— */
.tc-photo { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.tf-photo-img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); background: #f5f6f8; }
.tf-photo-btn { flex: 0 0 auto; font-size: 12px; padding: 5px 10px; border: 1px solid var(--pri); color: var(--pri-d);
  background: #fff; border-radius: 6px; cursor: pointer; }
.tf-photo-btn:active { background: var(--pri-l); }

/* —— 报表/文档导出页 —— */
.page-export { padding-top: 6px; }
.exp-family { margin-bottom: 18px; }
.exp-fam-h { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.exp-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.exp-type { display: flex; align-items: center; gap: 6px; padding: 12px 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card2); color: var(--ink); font-size: 13px; cursor: pointer; text-align: left; transition: all .15s; font-family: inherit; }
.exp-type:hover { border-color: var(--acc); }
.exp-type.on { border-color: var(--acc); background: var(--acc-l); color: var(--acc-d); font-weight: 600; }
.exp-type .xicon { font-size: 18px; line-height: 1; }
.exp-type.lock { opacity: .5; cursor: not-allowed; }
.exp-type .xlock { margin-left: auto; font-size: 12px; opacity: .7; }
.exp-filter { margin-top: 14px; border-top: 1px solid var(--line2); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ef-row { display: flex; flex-direction: column; gap: 4px; }
.ef-row label { font-size: 12px; color: var(--ink-2); }
.ef-row input, .ef-row select { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 10px; font-size: 14px; font-family: inherit; }
.exp-go { width: 100%; }
/* 聊天流里的 /export/ 下载链接 */
.exp-link { color: var(--acc); text-decoration: none; font-weight: 600; border-bottom: 1px dashed var(--acc); }
.exp-link:hover { color: var(--acc-d); }

/* 员工账号·行内编辑 */
.ed-card { margin-top: 10px; padding: 12px; background: var(--bg2, #f7f8fa); border: 1px solid var(--line2, #e6e8eb); border-radius: 10px; }
.ed-card > div { margin-bottom: 8px; }
.ed-card label { font-size: 13px; color: var(--muted, #8b93a1); display: block; margin-bottom: 3px; }
.ed-card .ck { display: flex; align-items: center; gap: 6px; color: var(--text, #333); }
.ed-card input[type="text"], .ed-card input[type="password"] { width: 100%; }
.ed-acts { display: flex; gap: 8px; margin-top: 6px; }
.page-staff .ed-card .el-select { width: 100%; }

/* —— 知识库记忆（page-kb）—— */
.kb-search { width: 100%; padding: 9px 12px; border: 1px solid var(--line2, #e6e8eb); border-radius: 10px; margin: 12px 0 10px; font-size: 14px; background: var(--bg); }
.page-kb .ed-card label.chk, .page-kb .ed-card .c-card .chk { display: block; }
.page-kb .ed-card .chk { display: flex; align-items: center; gap: 6px; }
.page-kb .ed-card input[type="text"], .page-kb .ed-card input, .page-kb .ed-card textarea { width: 100%; }

/* —— 语音会议（page-meetings）—— */
.meet-upload-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pe .meet-upload-row .btn, .meet-upload-row .btn { flex: 1; }
.pm { margin-top: 8px; border-top: 1px solid var(--line2, #e6e8eb); padding-top: 8px; }
.pm-sec { font-weight: 600; font-size: 13px; color: var(--ink-2, #444); margin: 8px 0 4px; }
.pm-pre { white-space: pre-wrap; word-break: break-word; background: var(--bg2, #f7f8fa); border: 1px solid var(--line2, #e6e8eb); border-radius: 8px; padding: 10px; font-size: 13px; max-height: 300px; overflow: auto; }
.pm-md { font-size: 14px; line-height: 1.7; }
.pm-md h4 { margin: 8px 0 4px; font-size: 14px; }
.pm-md strong { font-weight: 700; }
.meet-spn { width: 76px; padding: 5px 6px; border: 1px solid var(--line2, #e6e8eb); border-radius: 8px; font-size: 13px; }

/* 说话人对话 + 每人发言统计 */
.sp-dlg { margin: 4px 0 8px; }
.sp-line { display: flex; align-items: flex-start; gap: 6px; padding: 4px 6px; border-radius: 8px; margin-bottom: 2px; font-size: 13.5px; line-height: 1.55; }
.sp-line:nth-child(even) { background: var(--bg2, #f7f8fa); }
.sp-tag { flex: none; min-width: 46px; text-align: center; color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.sp-text { word-break: break-word; }
.sp-stats { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.sp-stat { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sp-stat-name { flex: none; width: 48px; color: var(--ink-2, #444); font-weight: 600; }
.sp-stat-dur { flex: none; color: var(--ink-3, #888); }
.sp-bar { flex: 1; height: 10px; background: var(--bg2, #f7f8fa); border: 1px solid var(--line2, #e6e8eb); border-radius: 999px; overflow: hidden; }
.sp-fill { height: 100%; background: #cbd5e1; border-radius: 999px; min-width: 4px; transition: width .3s; }

/* 说话人配色：speaker_id 0..9；负数归到 sp9（灰） */
.sp0 { background: #2563eb; } .sp1 { background: #16a34a; } .sp2 { background: #ea580c; }
.sp3 { background: #9333ea; } .sp4 { background: #0d9488; } .sp5 { background: #dc2626; }
.sp6 { background: #ca8a04; } .sp7 { background: #db2777; } .sp8 { background: #4f46e5; }
.sp9 { background: #6b7280; }
.sp-tag.sp0, .sp-tag.sp1, .sp-tag.sp2, .sp-tag.sp3, .sp-tag.sp4,
.sp-tag.sp5, .sp-tag.sp6, .sp-tag.sp7, .sp-tag.sp8, .sp-tag.sp9 { color: #fff; }

/* —— 长文档记忆—— */
.kb-docs { margin-top: 18px; border-top: 1px solid var(--line2, #e6e8eb); padding-top: 12px; }
.docs-h { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--ink-2, #444); }
.doc-up { display: flex; flex-direction: column; gap: 8px; }
.doc-up input { padding: 9px 12px; border: 1px solid var(--line2, #e6e8eb); border-radius: 10px; font-size: 14px; background: var(--bg); }

/* —— 我的（个人中心） —— */
.page-me { max-width: 560px; }
.me-card { display: flex; align-items: center; gap: 14px; padding: 18px 16px;
  background: var(--bg2, #fff); border: 1px solid var(--line2, #e6e8eb); border-radius: 16px; }
.me-ava { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #f59e0b, #ef4444); }
.me-info { display: flex; flex-direction: column; }
.me-name { font-size: 17px; color: var(--ink, #222); }
.me-role { font-size: 13px; color: var(--ink-2, #666); margin-top: 2px; }
.me-role em { font-style: normal; color: #ef4444; margin-left: 4px; }
.me-list { margin-top: 16px; background: var(--bg2, #fff); border: 1px solid var(--line2, #e6e8eb); border-radius: 16px; overflow: hidden; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 15px 16px; color: var(--ink, #222);
  text-decoration: none; font-size: 15px; }
.me-row + .me-row { border-top: 1px solid var(--line2, #e6e8eb); }
.me-row:active { background: rgba(0,0,0,.03); }
.me-ic { font-size: 18px; }
.me-arrow { margin-left: auto; color: var(--ink-2, #999); font-size: 18px; }
.me-tip { margin-top: 18px; font-size: 12px; line-height: 1.7; color: var(--ink-2, #888); text-align: center; }
/* 「我的」页：管家字号调档（小/中/大） */
.me-font { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.me-font .fbtn { border: 1px solid var(--line2, #e3e6ea); background: var(--bg2, #fff); color: var(--ink-2, #555);
  min-width: 38px; padding: 6px 0; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; line-height: 1; transition: all .15s; }
.me-font .fbtn.on { border-color: var(--pri, #2563eb); background: var(--pri, #2563eb); color: #fff; }

/* 移动端微调：agent 视口撑满去掉底部 padding 干扰 */
@media (max-width: 800px) {
  .page-agent { height: calc(100vh - 92px); }
  .stat-strip { padding: 13px 10px; }
  .tc-kv { font-size: 12px; }
  .tc-kv .k { flex: 0 0 68px; }
  .tf-label { flex: 0 0 68px; }
}

/* —— 聊天气泡 · 交互式（2026-09-02 管家消息左侧浅气泡 / 老板消息右侧橙气泡，勿改上方旧规则）—— */
.amsg { display: flex; flex-direction: column; }
.amsg.ai { align-items: flex-start; }   /* 管家消息靠左 */
.amsg.me { align-items: flex-end; }     /* 老板消息靠右 */

/* 管家消息：左侧，头一个小厨 + 浅色圆角气泡（尾部在左） */
.amsg.ai .meta { text-align: left; }
.amsg.ai .ablock.atext {
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--ink); max-width: 82%; width: fit-content; margin-right: auto;
}
.amsg.ai .ablock.atext::before {
  content: "🧑‍🍳"; flex: 0 0 auto; font-size: 19px; line-height: 1; margin-top: 2px;
}
.amsg.ai .ablock.atext .md {
  background: #eef2f9; border: 1px solid #e2e8f4; border-radius: 16px; border-top-left-radius: 6px;
  padding: 9px 13px; box-shadow: 0 1px 4px rgba(20,25,40,.06); min-width: 0;
}
.amsg.ai .md strong, .amsg.ai .md em { color: #e0561a; }
.amsg.ai .md strong { font-weight: 700; }

/* 老板消息：右侧，头像戴墨镜 + 暖橙渐变圆角气泡（尾部在右） */
.amsg.me .meta { text-align: right; }
.amsg.me .ablock.atext {
  display: flex; gap: 8px; align-items: flex-start; flex-direction: row-reverse;
  max-width: 82%; width: fit-content; margin-left: auto;
}
.amsg.me .ablock.atext::before {
  content: "🧑‍💼"; flex: 0 0 auto; font-size: 20px; line-height: 1; margin-top: 2px;
}
.amsg.me .ablock.atext .md {
  background: linear-gradient(135deg, #f67b1d, #ff9a3c); color: #fff;
  border-radius: 16px; border-top-right-radius: 6px; padding: 9px 13px;
  box-shadow: 0 2px 10px rgba(246,123,29,.22); min-width: 0;
}
.amsg.me .ablock.atext .md .caret { color: #fff; }

/* —— 会话抽屉（猫导式：左上 ☰ 拉出，含新建会话 + 聊天记录） —— */
.agent-head { display: flex; align-items: center; gap: 10px; }
.agent-menu { flex: 0 0 auto; background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 4px 10px; font-size: 16px; line-height: 1; cursor: pointer; }
.agent-menu:hover { border-color: var(--acc); }
.drawer-mask { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); }
.drawer { position: fixed; left: 0; top: 0; bottom: 0; width: min(80vw, 340px); z-index: 41; background: #fff; box-shadow: 4px 0 24px rgba(0,0,0,.16); display: flex; flex-direction: column; padding: 0 0 6px; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.drawer-avatar { font-size: 24px; }
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-x { margin-left: auto; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--ink-3); cursor: pointer; }
.drawer-new { margin: 14px 16px; width: calc(100% - 32px); padding: 10px; border-radius: 22px; font-size: 14px; }
.drawer-section { font-size: 12px; color: var(--ink-3); padding: 2px 18px 6px; }
.drawer-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.drawer-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.drawer-item:hover { background: var(--line2); }
.drawer-item.on { background: var(--acc); color: #fff; }
.drawer-item .ct { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.drawer-item .cm { font-size: 11px; opacity: .7; }
.drawer-item .c-del { background: none; border: none; color: inherit; font-size: 15px; cursor: pointer; opacity: .6; }
.drawer-item .c-del:hover { opacity: 1; }
.drawer-foot { padding: 12px 18px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line2); }
.fade-enter-active, .fade-leave-active { transition: opacity .2s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.drawer-enter-active, .drawer-leave-active { transition: transform .25s ease, opacity .25s ease; }
.drawer-enter-from, .drawer-leave-to { transform: translateX(-100%); opacity: .5; }

/* —— 聊天流 markdown（.md-chat，white-space:normal + renderMd 输出块级） —— */
.atext .md.md-chat { white-space: normal; }
.md-chat h4 { font-size: 15px; margin: 10px 0 4px; }
.md-chat ul { margin: 0 0 8px; padding-left: 22px; }
.md-chat li { margin: 2px 0; }
.md-chat code { background: var(--line2, #eef0f3); padding: 1px 5px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md-chat .exp-link, .md-chat a.xlink { color: var(--acc-d); text-decoration: underline; cursor: pointer; }
.md-chat pre { background: #f6f7fb; border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 8px; }
.md-chat pre code { background: transparent; padding: 0; font-size: 12px; }
.md-chat table { border-collapse: collapse; margin: 0 0 8px; width: 100%; font-size: 13px; }
.md-chat th, .md-chat td { border: 1px solid var(--line2); padding: 6px 9px; text-align: left; white-space: normal; }
.md-chat th { background: #f6f7fb; }
.md-chat blockquote { margin: 0 0 8px; padding: 4px 12px; border-left: 3px solid var(--line2); color: var(--ink-2); }
.md-chat del { color: var(--ink-3); }
.md-chat input[type=checkbox] { margin-right: 6px; }
.md-chat p { margin: 0 0 8px; }
.md-chat > :last-child { margin-bottom: 0; }

/* —— 确认卡日期：快捷今天/昨天/明天 + 自研日历弹层（跨浏览器可靠） —— */
.tf-date { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tf-date-quick { display: flex; gap: 8px; }
.tf-date-quick button {
  flex: 1; padding: 7px 0; font-size: 14px; color: #444; background: #fff;
  border: 1px solid var(--line2, #e5e8ef); border-radius: 8px; cursor: pointer;
}
.tf-date-quick button.on { color: #fff; background: #e0561a; border-color: #e0561a; font-weight: 600; }
.tf-date-field {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--line2, #e5e8ef); border-radius: 8px;
  background: #fff; font-size: 15px; color: #222; cursor: pointer;
}
.tf-date-field .ph { color: var(--ink-3, #aaa); }
.tf-date-field i { font-style: normal; color: var(--ink-3, #aaa); }
.tf-date-field.off { background: #f5f6f9; color: #999; cursor: not-allowed; }

.tfcal-mask { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center; }
.tfcal { width: min(420px, 92vw); background: #fff; border-radius: 18px 18px 0 0;
  padding: 14px 16px 22px; }
.tfcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tfcal-title { font-size: 17px; font-weight: 700; color: #222; }
.tfcal-btn { font-size: 15px; color: #888; background: none; border: none; padding: 6px 10px; cursor: pointer; }
.tfcal-ok { color: #e0561a; font-weight: 600; }
.tfcal-quick { display: flex; gap: 8px; margin-bottom: 10px; }
.tfcal-quick button { flex: 1; padding: 8px 0; font-size: 14px; color: #444;
  border: 1px solid var(--line2, #e5e8ef); border-radius: 8px; background: #fff; cursor: pointer; }
.tfcal-quick button:active { background: #f0f2f7; }
.tfcal-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.tfcal-now { font-size: 12px; color: #999; }
.tfcal-week { display: grid; grid-template-columns: repeat(7,1fr); text-align: center;
  font-size: 12px; color: #999; padding: 4px 0 6px; }
.tfcal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.tfcal-d { height: 40px; border: none; background: none; font-size: 15px; color: #333;
  cursor: pointer; border-radius: 8px; }
.tfcal-d.blank { visibility: hidden; }
.tfcal-d.sel { background: #e0561a; color: #fff; font-weight: 700; }
.tfcal-d:not(.blank):active { background: #f0f2f7; }
.tfcal-enter-active, .tfcal-leave-active { transition: opacity .2s ease, transform .2s ease; }
.tfcal-enter-from, .tfcal-leave-to { opacity: 0; transform: translateY(24px); }

/* P0/P1：错误边界降级提示（该区域渲染/生命周期异常时显示，页面其他部分存活） */
.eb-fail { margin: 10px 12px; padding: 12px 14px; border: 1px solid #ffd8a8; border-left: 4px solid #e0561a;
  background: #fff7ed; border-radius: 10px; color: #9a4b12; font-size: 13px; line-height: 1.5; }

/* =====================================================================
   Agent 视图：锁定一屏，composer 吸底
   ---------------------------------------------------------------------
   旧方案用魔法数 `height: calc(100vh - 118/92px)`，在微信/手机地址栏伸缩时
   100vh 偏大，且没扣掉 .main 自己的上下内边距 → 正文略微超出一屏 → 整页可滚动
   → 输入框跟着页面跑（"聊天框不固定"）。
   改为：给应用根容器（agent 视图生效时）锁 100dvh + 隐藏整页滚动，让
   .page-agent 填满剩余可用高，只有 .amessages 内部滚动；.composer 靠 flex:none
   钉在底部。dvh 实时跟踪地址栏，避免偏移。
   ===================================================================== */
.app-agent { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.app-agent .main { flex: 1; min-height: 0; }
/* 覆盖上面移动/桌面两条 calc()：page-agent 填满 .main 内容区，不再超一屏 */
.app-agent .page-agent { height: 100%; }
/* 长消息不把兄弟挤压成一条缝，直接让容器溢出出滚动条 */
.amsg { flex: none; }
/* 桌面端无底栏，收紧 .main 底部留白，避免 composer 距屏幕底过高 */
@media (min-width: 801px) { .app-agent .main { padding-bottom: 12px; } }

/* =====================================================================
   聊天消息防横向溢出（"左右摇摆"）
   ---------------------------------------------------------------------
   AI 回复经 renderMd 渲染成 markdown，里面命中两条全局泄漏导致消息区可横向滚动：
     1) 全局 `table { min-width:420px }` —— 聊天里一张宽表把气泡撑破；
     2) markdown 里的 `<img>` 没有任何 max-width —— 一张宽图整个溢出去。
   溢出冒到 `.amessages`（overflow-x 由 auto 计算），于是消息区能左右滑动。
   以下把消息内表格/图片/代码块都约束在气泡内，并给 `.amessages` 加 x 剪切做兜底。
   ===================================================================== */
.ablock.atext { min-width: 0; }
.ablock.atext .md.md-chat { min-width: 0; max-width: 100%; }
.ablock.atext .md.md-chat table {
  min-width: 0; max-width: 100%; display: block; overflow-x: auto; }
.ablock.atext .md.md-chat img { max-width: 100%; height: auto; display: block; }
.ablock.atext .md.md-chat pre { max-width: 100%; }
.amessages { overflow-x: hidden; }

/* —— 图片上传中的即时预览态 —— */
.c-photo img.uploading { opacity: .55; }
.chip.uploading { background: #eef2ff; color: #5b6cf5;
  display: inline-flex; align-items: center; gap: 5px; }
.chip.uploading::before { content: ""; width: 10px; height: 10px;
  border: 2px solid #c9d3ff; border-top-color: #5b6cf5; border-radius: 50%;
  animation: chipspin .7s linear infinite; }
@keyframes chipspin { to { transform: rotate(360deg); } }

/* —— 对客单：金额用 flex 排布，避免 float 在窄屏重叠 —— */
.list .ld.lrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.list .ld.lrow .xt { min-width: 0; overflow-wrap: anywhere; }
.list .ld .amt { color: var(--pri-d); font-weight: 700; white-space: nowrap; float: none; }

/* —— 页面自说明备注：让人一眼知道这页干嘛的 —— */
.page-lead { font-size: 12.5px; line-height: 1.65; color: var(--sub);
  background: #f5f8ff; border: 1px solid var(--line2); border-left: 3px solid var(--acc);
  border-radius: 8px; padding: 9px 12px; margin: 0 0 14px; }
.page-lead b { color: var(--ink); }
.sec-note { font-size: 12px; font-weight: 400; color: var(--sub); margin-left: 8px; }
.sec-gap { margin-top: 22px; }

/* —— 列表空态：居中、留白，别再挤在卡片角落 —— */
.list .empty { padding: 30px 16px; text-align: center; color: var(--sub); font-size: 13px; }
/* 有的 subnav 用 <a>（如对客单页），跟 <button> 同款胶囊，避免裸文本 */
.subnav a { flex: none; border: 1px solid var(--line); background: #fff; color: var(--sub);
  border-radius: 999px; padding: 8px 16px; font-size: 13px; text-decoration: none; cursor: pointer; transition: all .15s; white-space: nowrap; }
.subnav a:hover { border-color: var(--pri); color: var(--pri); }
.subnav a.on { background: var(--grad-pri); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(37,99,235,.22); }

/* —— 员工聊天记录（老板专属，我的页入口）—— */
.page-chats .head-row { justify-content: flex-start; gap: 10px; }
.page-chats .back { color: var(--pri); font-weight: 600; cursor: pointer; font-size: 14px;
  text-decoration: none; white-space: nowrap; }
.page-chats .back:hover { text-decoration: underline; }
.page-chats .head-row h3 { margin: 0; }
.page-chats .chat-log { gap: 10px; padding-bottom: 12px; }
.page-chats .chat-log .bubble .who { display: block; font-size: 11px; color: var(--sub);
  margin-bottom: 3px; font-weight: 600; }

/* ===== 拍整月账本 ===== */
.page-ledger .lvd-warn { background: #f0f5ff; color: #2563eb; padding: 10px 12px; border-radius: 8px;
  margin-bottom: 12px; font-size: 13px; line-height: 1.6; }
.page-ledger .ledger-month { margin: 10px 0 12px; }
.page-ledger .ledger-month label { font-size: 13px; color: #6b7280; margin-right: 8px; }
.page-ledger .ledger-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-ledger .ledger-top .ledger-month-in { border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.page-ledger .ledger-meta { font-size: 13px; color: #6b7280; }
.page-ledger .lvd-bad { color: #dc2626; }
.page-ledger .lvd-low { color: #d97706; }
.page-ledger .ledger-review { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ledger-photo { width: 176px; max-height: 460px; object-fit: contain; border: 1px solid #e5e7eb;
  border-radius: 8px; flex-shrink: 0; background: #fafafa; }
.ledger-scroll { overflow: auto; max-height: 70vh; flex: 1; }
.ledger-table { border-collapse: collapse; min-width: max-content; font-size: 13px; }
.ledger-table th, .ledger-table td { border: 1px solid #e5e7eb; padding: 2px 4px; white-space: nowrap; text-align: center; }
.ledger-table th { background: #f3f4f6; position: sticky; top: 0; z-index: 1; font-weight: 600; }
.ledger-table th.nb, .ledger-table td.nb { color: #9ca3af; background: #fafafa; }
.ledger-table tr.total td { background: #fff7ed; font-weight: 600; }
.ledger-table tr.nr td { color: #9ca3af; }
.cell-in { width: 74px; text-align: right; padding: 2px 5px; border: 1px solid #d1d5db;
  border-radius: 4px; font-size: 13px; box-sizing: border-box; }
.cell-in.cell-low { background: #fef3c7; border-color: #f59e0b; }
.cell-in.cell-bad { background: #fee2e2; border-color: #dc2626; }
.ledger-table tr.total .cell-in { background: #ffedd5; }
.cellflag { color: #dc2626; font-weight: 700; margin-left: 2px; }
.col-tag { font-size: 10px; color: #9ca3af; margin-left: 4px; }
.ledger-done { text-align: center; padding: 40px 20px; }
.ledger-done h4 { font-size: 18px; margin-bottom: 10px; color: #16a34a; }
