/* 简聊站长控制台（与管理后台共用样式基础）：与 Windows 客户端同一套视觉语言（冷白、石墨灰侧栏、小面积蓝色操作、14px 连续面板），
   按 ui/v2/设计方向-定稿.md：内容优先、克制、动效只解释真实操作、中文正常字距。字体与客户端相同（OFL）。 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/Inter-latin.woff2") format("woff2"); unicode-range: U+0000-017F, U+2000-206F, U+20AC, U+2122, U+2190-2193; }
@font-face { font-family: "Noto Sans SC"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/assets/fonts/NotoSansSC-subset.woff2") format("woff2"); }
:root {
  --canvas: #f5f6f8; --paper: #fff; --rail: #f0f2f5; --ink: #25272c; --secondary: #626875; --muted: #7a818d;
  --line: #e7e9ee; --line-strong: #dfe3ea; --blue: #2869dc; --blue-deep: #1f58c0; --blue-wash: #edf3ff;
  --green: #258361; --amber: #a97220; --red: #c8473f; --ease: cubic-bezier(.2, .75, .25, 1);
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, b, strong, th { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }
.hidden-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
:focus-visible { outline: 3px solid #a9c5f5; outline-offset: 2px; border-radius: 6px; }
.tnum, td.num, .facts dd { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 12px; }
svg.icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.65; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* 原 logo 裁切显示，不重绘、不改色 */
.brand-mark { position: relative; display: block; width: 36px; height: 33px; overflow: hidden; flex: none; mix-blend-mode: multiply; }
.brand-mark img { position: absolute; width: 83px; max-width: none; left: -23px; top: -13px; }

/* 按钮与输入（与客户端一致） */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 15px; border-radius: 9px; font-size: 13px; font-weight: 550; white-space: nowrap;
  transition: background-color .18s ease, box-shadow .22s ease, transform .22s var(--ease), opacity .2s ease; }
.btn:active:not(:disabled) { transform: scale(.965); }
.btn:disabled { cursor: default; opacity: .55; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(31, 88, 192, .25); }
.btn.primary:hover:not(:disabled) { background: var(--blue-deep); }
.btn.soft { background: #fff; border: 1px solid var(--line-strong); color: #3a404b; box-shadow: 0 1px 2px rgba(32, 46, 75, .05); }
.btn.soft:hover:not(:disabled) { background: #f8f9fb; }
.btn.danger { color: var(--red); border: 1px solid #efd3d0; background: #fff; }
.btn.danger:hover:not(:disabled) { background: #fdf4f3; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; height: 42px; font-size: 14px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(40, 105, 220, .35); border-top-color: var(--blue); animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; } /* 同一行字段高度不同时，多出来的高度不要分给标签行（否则输入框会往下错位） */
.field > span { font-size: 12px; color: var(--secondary); }
.field input, .field select, .field textarea, .bar input, .bar select {
  height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; outline: none; min-width: 0;
  transition: border-color .18s ease, box-shadow .2s ease; }
.list select { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; outline: none; min-width: 160px; }
.list select:focus { border-color: #9dbbea; box-shadow: 0 0 0 3px #eaf1fc; }
.field textarea { height: auto; min-height: 240px; padding: 10px 12px; line-height: 1.75; resize: vertical; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus, .bar input:focus, .bar select:focus { border-color: #9dbbea; box-shadow: 0 0 0 3px #eaf1fc; }
.field small { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 550; background: #eef1f5; color: var(--secondary); white-space: nowrap; }
.pill.ok { background: #e7f4ee; color: var(--green); }
.pill.warn { background: #fbf1e3; color: var(--amber); }
.pill.bad { background: #fbecea; color: var(--red); }
.pill.blue { background: var(--blue-wash); color: var(--blue); }

/* ---------- 登录 ---------- */
/* 网格列用 minmax(0,1fr)：否则固定宽度的框会把列撑开，手机上输入框和按钮超出屏幕（2026-11-12 用户手机截图） */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 40px 20px; }
.auth-box { width: 100%; max-width: 360px; min-width: 0; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 26px; }
.auth-brand small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 2px; }
.auth h1 { font-size: 22px; margin-bottom: 6px; }
.auth p.lead { font-size: 13px; color: var(--secondary); margin-bottom: 22px; line-height: 1.8; }
.auth form { display: grid; gap: 14px; }
.auth .code input { letter-spacing: .3em; font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.auth .form-error { min-height: 20px; font-size: 12.5px; color: var(--red); }
.auth .back { font-size: 12.5px; color: var(--secondary); justify-self: center; }
.auth .back:hover { color: var(--ink); }
.auth .note { font-size: 12px; color: var(--muted); margin-top: 28px; line-height: 1.8; }

/* ---------- 框架 ---------- */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--rail); border-right: 1px solid #e6e9ee; padding: 18px 12px 14px; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 6px; padding: 0 8px 18px; font-size: 14px; font-weight: 600; }
.side-brand small { font-weight: 400; color: var(--muted); font-size: 12px; }
.nav { position: relative; display: grid; gap: 2px; }
.nav-item { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 9px; font-size: 13px; color: var(--secondary); text-align: left; transition: color .18s ease; }
.nav-item:hover { color: var(--ink); }
.nav-item[aria-current="page"] { color: var(--blue); font-weight: 600; }
.nav-glide { position: absolute; left: 0; right: 0; top: 0; height: 38px; border-radius: 9px; background: #e2eaf8; transition: transform .3s var(--ease); z-index: 0; }
.side-foot { margin-top: auto; border-top: 1px solid #e3e6eb; padding-top: 12px; display: grid; gap: 8px; }
.me { display: grid; padding: 6px 8px; margin: 0 -0px; border-radius: 9px; font-size: 12.5px; line-height: 1.5; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.me:hover { background: rgba(37, 39, 44, .05); }
.me small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 30px 36px 60px; min-width: 0; }
.main > .page { max-width: 1120px; margin: 0 auto; display: grid; gap: 16px; }
.page.entering { animation: page-in .32s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-head h1 { font-size: 22px; line-height: 1.5; }
.page-head p { font-size: 13px; color: var(--secondary); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex: none; }
.crumb { font-size: 12.5px; color: var(--secondary); display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.crumb:hover { color: var(--blue); }

/* 面板与事实条 */
.panel { background: var(--paper); border: 1px solid #e2e6ec; border-radius: 14px; padding: 18px 20px; box-shadow: 0 8px 26px -22px rgba(51, 70, 104, .35); min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 30px; }
.panel.flush .panel-head { padding: 14px 20px 0; }
.panel-head h2 { font-size: 14px; }
.panel-head .muted { font-weight: 400; }
.panel-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: #fff; border: 1px solid #e2e6ec; border-radius: 14px; box-shadow: 0 8px 26px -22px rgba(51, 70, 104, .35); }
.facts > div { padding: 14px 20px; min-width: 0; border-left: 1px solid var(--line); }
.facts > div:first-child { border-left: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin-top: 4px; font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts dd small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.facts dd.sm { font-size: 15px; font-weight: 550; }
.stack { display: grid; gap: 16px; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* 定义列表 */
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.health { display: grid; }
.health li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.health li:first-child { border-top: 0; padding-top: 2px; }
.health li > span:first-of-type { flex: 1; min-width: 0; }
.health small { color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c4cad3; flex: none; }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); } .dot.warn { background: #d29a3c; }

/* 筛选条与表格 */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.bar .search { flex: 1 1 240px; }
.bar label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--secondary); cursor: pointer; }
.bar .count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; padding: 10px 14px; white-space: nowrap; background: #fafbfc; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.num, th.num { text-align: right; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
td.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.link { cursor: pointer; transition: background-color .15s ease; }
tr.link:hover td { background: #f8f9fb; }
.empty { font-size: 12.5px; color: var(--muted); padding: 30px 20px; text-align: center; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.bar-meter { height: 6px; border-radius: 6px; background: #eef1f5; overflow: hidden; margin-top: 8px; }
.bar-meter i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 6px; transition: width .4s var(--ease); }
.bar-meter i.warn { background: #d29a3c; }
code, .mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12.5px; }
.list { display: grid; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; min-width: 0; }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

/* 对话框 */
dialog { border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100% - 32px)); box-shadow: 0 30px 80px -30px rgba(30, 42, 66, .45); color: var(--ink); }
dialog::backdrop { background: rgba(37, 39, 44, .28); }
dialog[open] { animation: dlg-in .26s var(--ease) both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.dlg { padding: 22px 24px 20px; display: grid; gap: 14px; }
.dlg h2 { font-size: 16px; }
.dlg p { font-size: 13px; color: var(--secondary); line-height: 1.8; }
.dlg .error { font-size: 12.5px; color: var(--red); min-height: 18px; }
dialog.wide { width: min(820px, calc(100% - 32px)); }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 14px); opacity: 0; pointer-events: none; max-width: calc(100% - 40px);
  background: #2f333b; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 10px; transition: opacity .2s ease, transform .3s var(--ease); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a83a33; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; gap: 6px; }
  .side-brand { padding: 0 6px; }
  /* 手机上导航排成一行左右滑，不占半屏 */
  .sidebar { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; }
  .nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav .nav-item { flex: none; white-space: nowrap; }
  .nav-glide { display: none; }
  .nav-item[aria-current="page"] { background: #e2eaf8; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .me { display: none; }
  .main { padding: 20px 14px 50px; }
  .cols, .grid2, .grid3 { grid-template-columns: 1fr; }
  td, th { white-space: nowrap; }
  td:first-child { white-space: normal; min-width: 170px; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 站长控制台专用 ---------- */
.auth-box.wide { max-width: 400px; }
/* 字段里"输入框 + 按钮"一行：不额外加上边距，和旁边单独的输入框顶端对齐、等高 */
.input-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.input-row input { flex: 1; min-width: 0; }
.input-row .btn, .code-line .btn { height: 38px; flex: none; }
.auth .switch-line { font-size: 13px; color: var(--secondary); text-align: center; }
.auth .switch-line a, .auth .link { color: var(--blue); cursor: pointer; }
.auth .ok-msg { font-size: 13px; color: var(--green); min-height: 20px; }
.nav-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #d9463b; color: #fff; font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.seg { display: inline-flex; background: #eceef2; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; color: var(--secondary); transition: background-color .18s ease, color .18s ease; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(32, 46, 75, .08); }
.setup-list { display: grid; }
.setup-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.setup-list li:first-child { border-top: 0; }
.setup-dot { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid #cfd5de; display: grid; place-items: center; color: #fff; font-size: 12px; }
.setup-list li.need .setup-dot { border-color: #e0a24a; }
.setup-list li.done .setup-dot { background: var(--green); border-color: var(--green); }
.setup-list .grow { flex: 1; min-width: 0; display: grid; }
.setup-list .grow small { color: var(--secondary); font-size: 12px; }
/* 会话 */
.chats { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 520px; padding: 0; overflow: hidden; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-side .bar { padding: 12px; gap: 8px; }
.chat-side .bar input { width: 100%; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; transition: background-color .15s ease; }
.chat-item:hover { background: #f8f9fb; }
.chat-item[aria-current="true"] { background: var(--blue-wash); }
.chat-item .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; background: #6b8fd6; }
.chat-item .av.ext { background: #6aa58c; }
.chat-item b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item time { font-size: 11.5px; color: var(--muted); align-self: start; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-main .head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.chat-main .head .grow { flex: 1; min-width: 0; }
.chat-main .head small { display: block; color: var(--muted); font-size: 12px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px 20px; display: grid; gap: 8px; align-content: start; background: #fbfbfc; }
.bubble { max-width: 74%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { justify-self: start; background: #eef1f5; border-top-left-radius: 4px; }
.bubble.ai { justify-self: end; background: var(--blue-wash); color: #2f5690; border-top-right-radius: 4px; }
.bubble.human { justify-self: end; background: #eaf5ef; color: #22654b; border-top-right-radius: 4px; }
.bubble-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.bubble-wrap { display: grid; }
.bubble-wrap.right { justify-items: end; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 160px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); font-size: 13.5px; line-height: 1.6; outline: none; }
.composer textarea:focus { border-color: #9dbbea; box-shadow: 0 0 0 3px #eaf1fc; }
.chat-empty { display: grid; place-items: center; color: var(--muted); flex: 1; font-size: 13px; }
/* 数据图表 */
.chart { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 6px; align-items: end; height: 180px; padding-top: 8px; }
.chart .col { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.chart i { display: block; width: 40%; max-width: 14px; border-radius: 4px 4px 0 0; background: #c9d6ee; min-height: 2px; }
.chart i.ai { background: var(--blue); }
.chart-axis { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 6px; font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--secondary); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #c9d6ee; margin-right: 5px; vertical-align: -1px; }
.legend i.ai { background: var(--blue); }
/* 试一试 */
.try { display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; padding: 0; overflow: hidden; }
.qr { width: 176px; height: 176px; border-radius: 10px; border: 1px solid var(--line-strong); padding: 6px; background: #fff; }
.pay-box { display: flex; gap: 20px; align-items: center; }
@media (max-width: 900px) {
  .chats { grid-template-columns: 1fr; height: auto; }
  .chat-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 300px; }
  .chat-msgs { min-height: 320px; }
  .chat-main:has(> .chat-empty) { display: none; } /* 手机上没选客户时不留一大块空白 */
  .chat-side .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .chat-side .seg button { flex: none; }
  .composer { flex-wrap: wrap; }
  .composer textarea { flex-basis: 100%; }
  .composer .composer-actions { flex-direction: row; margin-left: auto; }
}
a { color: inherit; text-decoration: none; }
.form-error { font-size: 12.5px; color: var(--red); min-height: 18px; }
.ok-msg { font-size: 12.5px; color: var(--green); }
.bar.flat { padding: 12px 0 0; border: 0; }
.bar.flat input { flex: 1; }
.panel > .seg { margin-bottom: 14px; }
.panel .muted { line-height: 1.8; }
.pay-box .grow { flex: 1; min-width: 0; }
.panel .list li { flex-wrap: wrap; }
/* 面板内容之间留出呼吸（说明文字、表单、提示） */
.panel > * + *:not(.panel-foot):not(.table-wrap) { margin-top: 12px; }
.panel > .panel-head + * { margin-top: 0; }
.panel.flush > .panel-head + * { margin-top: 12px; }

/* 会员未生效的提示条 / 续费提醒 */
.lock-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #f3f6fc; border-color: #d9e3f5; }
.lock-bar > .icon { width: 22px; height: 22px; color: var(--blue); flex: none; }
.lock-bar.warn { background: #fff8ec; border-color: #f1dfbd; }
.lock-bar.warn > .icon { color: #b26b00; }
.lock-bar .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lock-bar small { color: var(--secondary); font-size: 12.5px; }
.page :disabled { cursor: not-allowed; }

/* 横向条形（转人工原因、渠道） */
.bars { list-style: none; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(96px, 30%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.bar-label { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.bar-num { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.bar-num small { color: var(--muted); }

/* 消息 */
.list li.unread b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 7px; vertical-align: 2px; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 注册：邮箱验证码 */
.code-line { display: flex; gap: 8px; }
.code-line input { flex: 1; min-width: 0; letter-spacing: .12em; }
.code-line .btn { flex: none; white-space: nowrap; min-width: 108px; }
.field.code-row > span { display: block; }

/* 注册勾选同意协议、账号页注销 / 联系我们（2026-11-12） */
.agree { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--secondary); line-height: 1.6; cursor: pointer; }
.agree input { margin: 2px 0 0; width: 15px; height: 15px; flex: none; accent-color: var(--blue); }
.agree a { color: var(--blue); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.danger-zone p { font-size: 13px; color: var(--secondary); max-width: 44em; }
.btn.danger-soft { background: #fff; border: 1px solid #efc9c4; color: var(--red); }
.btn.danger-soft:hover { background: #fdf3f2; }

/* 2026-11-12：知识库（待审核 / 效果 / 检索测试）、回复设置、开关行 */
.tabs-bar { padding: 0 0 4px; }
.tabs-bar .seg { flex-wrap: wrap; }
.switch-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-of-type { border-top: 0; }
.switch-row input { margin-top: 3px; }
.switch-row b { display: block; font-size: 13.5px; font-weight: 600; }
.switch-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.list > li.review { align-items: flex-start; }
.review .answer { margin: 4px 0 2px; color: var(--secondary); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; flex: none; }
.inline-link { color: var(--blue); text-decoration: none; }
.inline-link:hover { text-decoration: underline; }
.clamp { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.style-box { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: #f6f7f9; font: inherit; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: var(--secondary); }
.sub-title { margin: 18px 0 2px; font-size: 13px; font-weight: 600; color: var(--secondary); }
.panel-foot.sticky-foot { position: sticky; bottom: 0; z-index: 2; margin: 0 0 16px; padding: 12px 20px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid #e2e6ec; border-radius: 14px; }
.panel-foot.sticky-foot .form-error { margin-right: auto; }
.list > li.diag b { font-weight: 550; }
.switch-row > .grow { display: block; flex: 1; min-width: 0; }
.switch-row > .grow small { display: block !important; }
/* 对话工作台：客户信息条、AI 建议、协作拦下、存为知识 */
.chat-info { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 20px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chat-info .diag-line { color: var(--secondary); }
.composer-actions { display: flex; flex-direction: column; gap: 8px; }
.link-btn { margin-left: 8px; padding: 0; border: 0; background: none; font-size: 12px; color: var(--blue); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.warn { color: #b26b00; font-weight: 600; }
.bubble.held { opacity: .55; text-decoration: line-through; }
.chat-side .seg { flex-wrap: wrap; }
.chat-side .seg button { flex: none; white-space: nowrap; }
.chat-info { line-height: 1.6; }
/* 会员与账单：优惠码、发票 */
.coupon-bar { padding: 0 0 12px; align-items: center; }
.coupon-bar input { flex: 0 1 260px !important; }
.stack-sm { display: grid; gap: 6px; padding-top: 4px; }
.stack-sm .check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
#wm { position: fixed; inset: 0; z-index: 9990; pointer-events: none; background-repeat: repeat; }
@media print { #wm { position: fixed; } }

.ctl-box { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex: none; }
.num-in { width: 96px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; outline: none; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.num-in:focus { border-color: #9dbbea; box-shadow: 0 0 0 3px #eaf1fc; }
.ctl-box select { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; }
.unit { min-width: 44px; font-size: 13px; color: var(--secondary); }
.unit.sm { min-width: 0; }
.wrap { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; display: inline-block; max-width: 420px; }
/* 复选框 / 单选框不要套用输入框的样式（高度、边框、内边距），否则变成一个大方框（2026-11-12 用户截图） */
.field input[type=checkbox], .field input[type=radio], .bar input[type=checkbox], .bar input[type=radio], label.check input {
  width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; border: 0; border-radius: 4px; box-shadow: none; flex: none; accent-color: var(--blue); vertical-align: -3px; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin: 4px 0 8px; }

/* 客户群页（2026-11-14 用户：排版太乱）：每行同样的列宽，控件上下对齐 */
.cg-list li.cg-row-g { display: grid; grid-template-columns: minmax(0, 1fr) 108px 120px 108px 96px; align-items: center; column-gap: 14px; }
.cg-row-g.off .cg-name b { color: var(--muted); }
.cg-name { min-width: 0; display: grid; gap: 3px; }
.cg-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-name small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* .list select 有 min-width:160px，会压到「自动回复」上（2026-11-14 用户截图）：这里按格子宽度来 */
.cg-list select.cg-kind { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border-radius: 8px; }
.cg-auto { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--secondary); white-space: nowrap; cursor: pointer; }
.cg-row-g.off .cg-auto { cursor: default; opacity: .55; }
/* 开关（原来是系统自带的小方框勾选） */
input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0;
  border-radius: 999px; background: #d4d7dd; cursor: pointer; transition: background .18s ease; vertical-align: middle; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .18s ease; }
input.switch:checked { background: var(--blue); }
input.switch:checked::after { transform: translateX(14px); }
input.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input.switch:disabled { opacity: .45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }
.cg-row-g .btn { width: 100%; justify-content: center; white-space: nowrap; }
li.cg-unsure-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); column-gap: 16px; align-items: start; }
li.cg-unsure-row .cg-name small { white-space: normal; }
.cg-unsure-row .cg-text { margin: 0; line-height: 1.7; }
@media (max-width: 760px) {
  .cg-list li.cg-row-g { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .cg-list li.cg-row-g .cg-name { grid-column: 1 / -1; }
  li.cg-unsure-row { grid-template-columns: 1fr; }
}

/* 一键自检（2026-11-14） */
.check-list li { align-items: flex-start; }
.check-list small { white-space: normal; line-height: 1.7; }
