/* ===== 控制台样式（亮白主色 · 四套主题） ===== */

/* ---------- 主题令牌 ---------- */
:root,
[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-2: #eef3fa;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --panel-3: #eef2f9;
  --line: rgba(20, 32, 56, 0.08);
  --line-2: rgba(20, 32, 56, 0.14);
  --text: #16203a;
  --text-2: #2b3a57;
  --muted: #66748c;
  --muted-2: #97a3b8;
  --accent: #4f6ef7;
  --accent-2: #0ea5a4;
  --accent-soft: rgba(79, 110, 247, 0.09);
  --grad: linear-gradient(135deg, #4f6ef7 0%, #6f8bff 45%, #0ea5a4 100%);
  --ok: #12a150;
  --warn: #d98a00;
  --danger: #e5484d;
  --ok-soft: rgba(18, 161, 80, 0.1);
  --warn-soft: rgba(217, 138, 0, 0.12);
  --danger-soft: rgba(229, 72, 77, 0.1);
  --shadow: 0 18px 46px rgba(23, 42, 84, 0.1);
  --shadow-sm: 0 2px 8px rgba(23, 42, 84, 0.06);
  --bg-glow: radial-gradient(900px 460px at 6% -12%, rgba(79, 110, 247, 0.13), transparent 62%),
             radial-gradient(760px 420px at 102% -4%, rgba(14, 165, 164, 0.1), transparent 58%);
  --sidebar-bg: linear-gradient(180deg, #ffffff, #f8fbff);
  --bubble-in: #f4f7fd;
  --bubble-out: linear-gradient(135deg, #4f6ef7, #6480f8);
  --bubble-out-text: #ffffff;
  --radius: 16px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-2: #0e1526;
  --panel: #141d31;
  --panel-2: #19233a;
  --panel-3: #1e2a44;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #e9eefb;
  --text-2: #cdd8ee;
  --muted: #94a3bd;
  --muted-2: #64748b;
  --accent: #7c93ff;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(124, 147, 255, 0.14);
  --grad: linear-gradient(135deg, #6d8dff 0%, #2fd6c4 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger-soft: rgba(248, 113, 113, 0.14);
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --bg-glow: radial-gradient(900px 480px at 8% -10%, rgba(109, 141, 255, 0.2), transparent 60%),
             radial-gradient(760px 420px at 100% 0%, rgba(47, 214, 196, 0.13), transparent 55%);
  --sidebar-bg: linear-gradient(180deg, #101a2d, #0c1424);
  --bubble-in: #1b2540;
  --bubble-out: linear-gradient(135deg, #4f6ef7, #3f5ee0);
  --bubble-out-text: #f6f9ff;
}

a { color: var(--accent); text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.18s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--grad);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(79, 110, 247, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { color: var(--text); background: var(--accent-soft); }
.btn-danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.32); background: var(--danger-soft); box-shadow: none; }
.btn-danger:hover { background: rgba(229, 72, 77, 0.16); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .tip { font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }
input, textarea, select {
  width: 100%;
  /* v1.38.0：这三个控件一直是 content-box，width:100% 只约束内容区，
     加上 10/12 的内边距与 1px 边框，实际宽度恒比容器宽 26px。
     卡片里看不出来（溢出部分落在卡片内边距上），但会话列表那种
     只剩 10px 内边距的窄容器里就会顶出面板边界——搜索框「异常变大」、
     压住右边访客信息的根因就在这里。 */
  box-sizing: border-box;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: 0.18s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.65; }select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--panel); color: var(--text); }

/* 密码框：可切换明文显示，避免看不清楚输入内容 */
.pw-field { position: relative; display: flex; align-items: center; }
.pw-field input { padding-right: 40px; }
.pw-field .pw-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: grid; place-items: center;
  border: none; background: transparent; color: var(--muted-2);
  cursor: pointer; border-radius: 8px; padding: 0; line-height: 1;
}
.pw-field .pw-eye svg { width: 16px; height: 16px; }
.pw-field .pw-eye:hover { color: var(--text-2); background: var(--panel-3); }
.pw-field .pw-eye.on { color: var(--accent); }
/* iOS Safari：输入框字号小于 16px 会在聚焦时自动放大页面，导致看不清也难输入 */
@media (max-width: 900px) {
  input, textarea, select { font-size: 16px; }
  .pw-field .pw-eye { width: 36px; height: 36px; }
  .pw-field .pw-eye svg { width: 18px; height: 18px; }
}

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
/* 关态原来几乎看不见：浅底 + 白圆点，在 light 主题下跟背景糊在一起。
   这里给轨道加深色描边、圆点改成灰底，开态再加一圈淡光晕，开关状态一眼可辨。 */
.switch .track {
  width: 42px; height: 23px; border-radius: 23px; background: var(--panel-3);
  border: 1px solid var(--muted); position: relative; transition: 0.2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--text-2); opacity: .55;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: 0.2s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after {
  transform: translateX(19px); background: #fff; opacity: 1;
}
.switch input:checked + .track {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.switch:hover .track { border-color: var(--accent); }
.switch span.lbl { font-size: 12.5px; color: var(--text-2); }
.switch input:checked ~ span.lbl { color: var(--text); }

/* 集成脚本页的「接入参数」是成对的字段（位置+形态、宽+高、主色+文案）。
   之前没有这条规则，两个字段各占整行，下拉框被拉到卡片满宽，看起来像散落的表单。 */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

/* ---------- 多渠道通知编辑器（common.js lcRenderChannels） ---------- */
.ch-row {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; background: var(--panel-2);
}
.ch-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-head select { width: auto; min-width: 152px; flex: 0 0 auto; }
.ch-head .ch-name { flex: 1 1 140px; min-width: 120px; }
.ch-empty { color: var(--muted); font-size: 12.5px; padding: 8px 0 10px; }
.ch-foot { margin-top: 2px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 13px; color: var(--muted); margin: 0 0 14px; font-weight: 600; }

/* ---------- 布局 ---------- */
/* dvh：移动端浏览器地址栏收起/展开时不跳动；不支持则回落到 100vh */
.app { position: relative; z-index: 1; display: flex; height: 100vh; height: 100dvh; }
.sidebar {
  width: 232px;
  flex: 0 0 232px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  transition: background 0.3s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px;
  box-shadow: 0 8px 20px rgba(79, 110, 247, 0.32);
}
/* 品牌区：名字由 /api/brand 注入，长度不可控（最长 60 字），
   侧边栏只有 208px，不截断会把布局顶开。min-width:0 是关键——
   flex 子项默认 min-width:auto，光有 ellipsis 不会生效。 */
.brand-txt { min-width: 0; flex: 1 1 auto; }
.brand-txt b {
  display: block; font-size: 14.5px; letter-spacing: 0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 只认直接子级的副标题（如 SUPER ADMIN）。写成 .brand-txt span 会把
   <b> 里的品牌名 <span data-brand="name"> 也变成块级 10.5px，品牌名一填
   就掉到第二行、字号还比「 · 平台端」小。 */
.brand-txt > span {
  display: block; font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.14em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 品牌名为空（v1.47.2 起新装默认）时，紧跟其后的分隔点一起收起，
   否则会渲染成「 · 平台端」这种以分隔符开头的半截标题 */
.brand-txt b > [data-brand="name"]:empty + .brand-sep { display: none; }
/* 没上传 Logo、也没填品牌名时整个方块收起，不给客户留一个空白渐变块 */
.brand-logo.no-logo { display: none; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 11px;
  border-radius: 11px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: 0.16s;
  user-select: none;
  white-space: nowrap;
}
.nav-ic { width: 17px; height: 17px; display: grid; place-items: center; opacity: 0.85; flex: 0 0 auto; }
.nav-ic svg { width: 17px; height: 17px; }
.nav-item:hover { background: var(--accent-soft); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(79, 110, 247, 0.2);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active .nav-ic { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; border-radius: 20px; padding: 1px 6px; font-weight: 700; }

.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 11px; }
.side-user:hover { background: var(--accent-soft); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 110, 247, 0.2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent);
  flex: 0 0 auto;
}
.side-user b { display: block; font-size: 12.5px; font-weight: 600; }
.side-user span { font-size: 11px; color: var(--muted-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 70px; flex: 0 0 70px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  /* v1.25.0 性能：原来这里是 backdrop-filter 高斯模糊。它是「逐帧重算」的，
     顶栏又常驻可见，只要有任何动画（粒子、页面切换、消息滚动）就会连带
     整条顶栏重新模糊一次——点击卡帧的主因之一。改成高不透明度纯色，
     观感几乎无差，合成层直接省掉。 */
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  /* 顶栏要压在内容之上：里面的公告面板 z-index:80，若顶栏不自建层叠上下文，
     面板会被下方卡片盖住。 */
  position: relative; z-index: 30;
}
.topbar h1 { font-size: 16.5px; margin: 0; font-weight: 650; letter-spacing: 0.01em; }
.topbar p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted-2); }

/* ---------- 套餐到期提示（v1.19.1） ----------
   常驻在顶栏下方而不是弹窗：套餐到期后新访客直接被拦，这件事必须
   在任何页面上都看得见，靠一次性弹窗容易被点掉就忘。 */
.plan-alert {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  background: var(--warn-soft);
  color: var(--text);
}
.plan-alert[hidden] { display: none; }
.plan-alert.danger { background: var(--danger-soft); border-bottom-color: rgba(229, 72, 77, 0.28); }
.plan-alert > i {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-style: normal; font-size: 12px; font-weight: 700;
  background: var(--warn); color: #fff;
}
.plan-alert.danger > i { background: var(--danger); }
.plan-alert .pa-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-alert .pa-txt b { font-size: 12.5px; font-weight: 650; }
.plan-alert .pa-txt span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.plan-alert .btn { flex: 0 0 auto; }
@media (max-width: 640px) {
  .plan-alert { padding: 10px 14px; gap: 8px; align-items: flex-start; }
  .plan-alert .pa-txt span { font-size: 11px; }
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.conn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.conn i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.conn.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.on { color: var(--ok); border-color: rgba(18, 161, 80, 0.24); }

/* 主题切换 */
.theme-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel-2); }
.theme-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  padding: 0; transition: 0.18s; position: relative;
}
.theme-dot:hover { transform: scale(1.1); }
.theme-dot.active { border-color: var(--accent); }

.page { flex: 1; overflow: auto; padding: 22px 24px 30px; display: none; }
.page.active { display: block; }
.page.page-chat { padding: 0; display: none; }
.page.page-chat.active { display: flex; }

/* ---------- 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat::after {
  content: ""; position: absolute; right: -28px; top: -38px; width: 108px; height: 108px;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
}
.stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-val { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; line-height: 1; }
.stat-val small { font-size: 12px; font-weight: 500; color: var(--muted-2); margin-left: 5px; }
.stat-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 9px; }
.stat-sub b { color: var(--accent); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.grid-2.eq { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1160px) { .grid-2, .grid-2.eq, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted-2); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--accent); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* 商户中心操作项较多，保持表格自身滚动，避免中等宽度窗口挤压账号和按钮。 */
.merchant-table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.merchant-table { min-width: 1080px; }
.merchant-table td:last-child { min-width: 310px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--line-2); color: var(--muted);
  background: var(--panel-2);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); border-color: rgba(18, 161, 80, 0.26); background: var(--ok-soft); }
.badge-warn { color: var(--warn); border-color: rgba(217, 138, 0, 0.28); background: var(--warn-soft); }
.badge-danger { color: var(--danger); border-color: rgba(229, 72, 77, 0.26); background: var(--danger-soft); }
.badge-muted { color: var(--muted-2); }
.badge-info { color: var(--accent); border-color: rgba(79, 110, 247, 0.26); background: var(--accent-soft); }
/* 群聊徽章（v1.31.0）：青色，与「进行中」的绿、「待跟进」的橙都不撞色 */
.badge-group { color: var(--accent-2); border-color: rgba(14, 165, 164, 0.3); background: rgba(14, 165, 164, 0.1); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { position: relative; }
/* 高度写死 38px 时纵向内边距必须归零：10px 上下内边距 + 13.5px 字号
   在 38px 里塞不下，文字会被压得贴边（v1.38.0） */
.search input {
  padding: 0 12px 0 32px;
  width: 230px; height: 38px;
  box-sizing: border-box;
}
.search svg { position: absolute; left: 10px; top: 11px; width: 15px; height: 15px; color: var(--muted-2); }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button {
  border: none; background: transparent; color: var(--muted);
  padding: 6px 13px; border-radius: 8px; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: 0.15s;
}
.seg button.active { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- 会话 ---------- */
.chat-wrap { display: flex; width: 100%; min-height: 0; flex: 1; }
.chat-list { width: 282px; flex: 0 0 282px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--panel); }
.chat-list-head { padding: 10px; border-bottom: 1px solid var(--line); }
.chat-list-head .search input { width: 100%; }
.chat-list-head .seg { margin-top: 10px; width: 100%; }
.chat-list-head .seg button { flex: 1; }
.chat-list-head .chat-readall { margin-top: 8px; width: 100%; }
/* v1.35.0 流畅度：
   - overscroll-behavior 是为了掐掉「列表滚到底带着整页一起弹」的联动，
     手机上两手一起滑最容易出现这种错觉「界面在漂」。
   - contain 让这个滚动容器成为一个独立的布局/绘制单元，
     内部行的任何变化不会让外层重新布局。 */
.conv-list {
  flex: 1; overflow: auto;
  overscroll-behavior: contain;
  contain: layout paint;
}
.conv {
  display: flex; gap: 8px; padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; position: relative;
  /* 只过渡背景色。原来写的是 transition: 0.15s，等价 transition: all，
     浏览器会为每一行盯着所有可动画属性；会话多时这是纯浪费。 */
  transition: background-color 0.15s ease;
  /* 会话上百条时，屏幕外的行不必参与布局与绘制。
     contain-intrinsic-size 用 auto 关键字：首次渲染后记住真实高度，
     滚动条长度不会因为估算值反复跳动。 */
  content-visibility: auto;
  contain-intrinsic-size: auto 78px;
}
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--accent-soft); }
.conv.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
.conv-body { min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
/* v1.29.0：昵称长度不可控（访客自填的可能是 30 个字），这里必须允许它收缩。
   少了 min-width:0，flex 子项的最小尺寸是内容宽度，长名字会把右侧时间挤出去、
   甚至撑破整个会话列表列宽。 */
.conv-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 10.5px; color: var(--muted-2); flex: 0 0 auto; }
.conv-last { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.conv-unread {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 20px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 5px;
}
.conv-tag { font-size: 10px; color: var(--muted-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 20px; }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-2); }
.chat-head {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; border-bottom: 1px solid var(--line);
  /* v1.25.0：会话头也常驻可见，同样去掉逐帧高斯模糊 */
  background: var(--panel);
}
.chat-head h3 { margin: 0; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.chat-head-txt { flex: 1; min-width: 0; }
.chat-head .sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.chat-body { flex: 1; overflow: auto; padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
/* position:relative：快捷话术面板要贴着输入区上方浮出，不能撑高布局 */
.chat-foot { position: relative; border-top: 1px solid var(--line); padding: 8px 12px 10px; background: var(--panel); }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
/* 工具按钮组（v1.39.0）：桌面端就是输入行里的几个横排按钮，视觉与拆分前
   完全一致；只有手机端（mobile.css）会把它整组挪到输入框下面一行横滑。 */
.chat-input-row .chat-tools {
  display: flex; align-items: flex-end; gap: 8px;
  flex: 0 0 auto; min-width: 0;
}
/* 平台端那个回形针是纯图标按钮，原来靠内联 style 撑到 46px 与输入框齐平，
   内联样式在手机端没法被 !important 以外的方式覆盖，改成写在这里 */
.chat-input-row .chat-tools > .btn-icon { width: 46px; height: 46px; flex: 0 0 auto; }
.chat-input-row textarea {
  flex: 1; min-height: 40px; max-height: 140px; resize: none;
  border-radius: 11px; padding: 9px 12px; line-height: 1.5;
}
.quick-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 1px; }
.quick-bar::-webkit-scrollbar { height: 0; }
.chip {
  border: 1px solid var(--line-2); background: var(--panel);
  color: var(--muted); font-size: 11.5px; padding: 4px 9px; border-radius: 20px;
  cursor: pointer; white-space: nowrap; font-family: inherit; transition: 0.15s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip.more { color: var(--accent); border-style: dashed; }

/* 快捷回复扩展面板（v1.21.3）：输入框上方常显只放「常显」的话术，
   其余的按分类收进这个浮层，避免话术一多就把输入区挤没了 */
.quick-panel {
  position: absolute; left: 12px; right: 12px; bottom: 66px; z-index: 30;
  max-height: 320px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(16, 24, 48, .18); overflow: hidden;
}
.qp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.qp-head input {
  flex: 1 1 auto; height: 32px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-family: inherit; font-size: 12.5px; padding: 0 10px;
}
.qp-head input:focus { outline: none; border-color: var(--accent); }
.qp-x {
  border: none; background: transparent; color: var(--muted); font-size: 19px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.qp-x:hover { color: var(--text); }
.qp-body { overflow-y: auto; padding: 10px 12px 12px; }
.qp-group { margin-bottom: 10px; }
.qp-group:last-child { margin-bottom: 0; }
.qp-group-title {
  font-size: 11px; color: var(--muted); letter-spacing: .04em; margin: 0 0 6px;
  display: flex; align-items: center; gap: 6px;
}
.qp-group-title::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }
.qp-items { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-item {
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-size: 12px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  font-family: inherit; max-width: 100%; text-align: left; transition: .15s;
}
.qp-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.qp-item .qp-ic { margin-right: 5px; }
.qp-empty { font-size: 12px; color: var(--muted); padding: 12px 2px; }

.msg { display: flex; gap: 8px; max-width: 78%; }
.msg .bubble {
  background: var(--bubble-in); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 4px 13px 13px 13px;
  font-size: 13.2px; line-height: 1.55; word-break: break-word; white-space: pre-wrap;
}
.msg .meta { font-size: 10px; color: var(--muted-2); margin-top: 3px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--bubble-out); border: none; color: var(--bubble-out-text); border-radius: 13px 4px 13px 13px; box-shadow: 0 5px 14px rgba(79, 110, 247, 0.2); }
.msg.me .meta { text-align: right; }
.msg.sys { align-self: center; max-width: 90%; }
.msg.sys .bubble {
  background: var(--panel); border: 1px dashed var(--line-2);
  color: var(--muted); font-size: 11.5px; border-radius: 18px; padding: 5px 12px; text-align: center;
}
.msg.sys .avatar, .msg.sys .meta { display: none; }
.msg .avatar { width: 27px; height: 27px; font-size: 10.5px; }
.msg.ai .bubble { border-color: rgba(14, 165, 164, 0.3); background: var(--accent-soft); }
.msg.ai .avatar { background: rgba(14, 165, 164, 0.14); color: var(--accent-2); border-color: rgba(14, 165, 164, 0.28); }
.day-sep { align-self: center; font-size: 10.5px; color: var(--muted-2); background: var(--panel); padding: 2px 10px; border-radius: 20px; border: 1px solid var(--line); }

.typing { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-2); height: 15px; padding-left: 2px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); animation: bob 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bob { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-info { width: 236px; flex: 0 0 236px; border-left: 1px solid var(--line); padding: 14px 13px; overflow: auto; background: var(--panel); }
.info-block { margin-bottom: 14px; }
.info-block h4 { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); margin: 0 0 8px; font-weight: 600; }
.info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 4px 0; }
.info-row span { color: var(--muted-2); }
.info-row b { font-weight: 500; color: var(--text-2); text-align: right; word-break: break-all; }

/* ---------- 编号步骤（v1.38.0） ----------
 * .info-row 是「左标签 / 右取值」的行，拿它排步骤会把序号与文字甩到两端。
 * 步骤需要的是：序号圆形徽标 + 标题 + 说明，整体左对齐、逐条竖向排列。 */
.wx-steps-card {
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2);
}
.wx-steps-card h4 {
  margin: 0 0 12px; font-size: 12px; font-weight: 600;
  color: var(--text-2); letter-spacing: 0.02em;
}
.wx-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wx-steps li { display: flex; align-items: flex-start; gap: 10px; }
.wx-steps .n {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 700; line-height: 1;
}
.wx-steps li > div { min-width: 0; }
.wx-steps b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.5; }
.wx-steps small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.wx-steps-card > .tip { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted-2); line-height: 1.65; }

/* ---------- 空态 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted-2); padding: 50px 20px; text-align: center; font-size: 12.5px; flex: 1; }
.empty svg { width: 40px; height: 40px; opacity: 0.3; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 26, 46, 0.42); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-mask.show { display: flex; animation: fade 0.18s ease; }
.modal {
  width: 100%; max-width: 460px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-height: 90vh; overflow: auto;
  color: var(--text);
}
.modal.wide { max-width: 640px; }
.modal h3 { margin: 0 0 4px; font-size: 15.5px; }
.modal .modal-sub { font-size: 12px; color: var(--muted-2); margin: 0 0 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@keyframes pop { from { transform: scale(0.96) translateY(6px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--panel); border: 1px solid var(--line-2);
  color: var(--text); padding: 11px 15px; border-radius: 12px; font-size: 12.5px;
  box-shadow: var(--shadow); animation: slideIn 0.22s ease; max-width: 340px;
}
.toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.toast.err i { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(16px); opacity: 0; } }

/* ---------- 登录页 ---------- */
.auth-screen { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; overflow-y: auto; }
.auth-visual {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px; border-right: 1px solid var(--line);
  background: radial-gradient(680px 460px at 12% 12%, rgba(79, 110, 247, 0.14), transparent 62%),
    radial-gradient(560px 460px at 88% 92%, rgba(14, 165, 164, 0.12), transparent 60%), var(--bg-2);
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 45%, #000 22%, transparent 72%);
  opacity: 0.7;
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-copy h2 { font-size: 30px; line-height: 1.38; margin: 0 0 14px; letter-spacing: -0.01em; }
.auth-copy h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: var(--muted); font-size: 13.5px; line-height: 1.9; max-width: 400px; margin: 0; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.auth-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.auth-point i {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
  background: var(--accent-soft); border: 1px solid rgba(79, 110, 247, 0.24);
  display: grid; place-items: center; font-size: 11px; color: var(--accent); font-style: normal;
}
.auth-form-wrap { display: grid; place-items: center; padding: 30px; background: var(--bg); }
.auth-form { width: 100%; max-width: 348px; }
.auth-form h3 { font-size: 20px; margin: 0 0 6px; }
.auth-form .hint { color: var(--muted-2); font-size: 12.5px; margin: 0 0 24px; }
.demo-accounts { margin-top: 22px; border-top: 1px dashed var(--line-2); padding-top: 16px; font-size: 11.5px; color: var(--muted-2); line-height: 2; }
.demo-accounts b { color: var(--text-2); font-weight: 500; }
.form-err { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 8px; }
/* 登录页「保持登录」：与密码框留一点距离，但别把「进入工作台」按钮挤下去 */
.remember-row {
  display: flex; align-items: center; gap: 8px; margin: -4px 0 14px;
  font-size: 12.5px; color: var(--muted-2); cursor: pointer; user-select: none;
}
.remember-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.remember-row:hover { color: var(--text-2); }
@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; overflow-y: auto; }
  .auth-visual { display: none; }
  /* 手机上注册表单更长，留白收紧但仍然可整体滚动 */
  .auth-form-wrap { padding: 26px 18px; align-items: start; }
  .auth-form { max-width: 400px; margin: 0 auto; }
  .auth-form h3 { font-size: 18px; }
}

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 168px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }
.spark-row { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.spark-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.spark-bar { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 3px; transition: 0.3s; opacity: 0.9; }
.spark-bar.dim { background: var(--panel-3); opacity: 1; }
.spark-lbl { font-size: 10px; color: var(--muted-2); }

.rank { display: flex; flex-direction: column; gap: 2px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rank-row:last-child { border-bottom: none; }
.rank-no { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; background: var(--panel-3); color: var(--muted); font-weight: 600; }
.rank-row:nth-child(1) .rank-no { background: rgba(217, 138, 0, 0.18); color: var(--warn); }
.rank-row:nth-child(2) .rank-no { background: rgba(148, 163, 184, 0.22); color: #7f8ea3; }
.rank-row:nth-child(3) .rank-no { background: rgba(180, 120, 60, 0.18); color: #b0793f; }
.rank-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { color: var(--muted-2); font-size: 11.5px; }

.muted { color: var(--muted-2); }
.nowrap { white-space: nowrap; }
.tag-link { font-size: 11.5px; color: var(--accent); cursor: pointer; }

/* ---------- 图片消息 ---------- */
.msg .bubble .pic {
  display: block; max-width: 190px; max-height: 240px; width: auto; height: auto;
  border-radius: 11px; cursor: zoom-in; object-fit: cover;
}
#lightbox {
  position: fixed; inset: 0; background: rgba(10, 16, 30, 0.84);
  display: none; align-items: center; justify-content: center; z-index: 999; padding: 24px;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ---------- 公告 ---------- */
.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--panel);
  transition: 0.18s;
}
.announce:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.announce.pinned { border-left: 3px solid var(--accent); }
.announce-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.announce h4 { margin: 0; font-size: 14px; font-weight: 650; flex: 1; min-width: 0; }
.announce p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.85; white-space: pre-wrap; }
.announce .foot { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted-2); }
.announce .foot .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.announce-empty { text-align: center; color: var(--muted-2); font-size: 12.5px; padding: 40px 10px; }

/* 未读红点 */
.dot-badge { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }

/* ---------- 套餐 ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; }
.plan-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--panel);
  position: relative; transition: 0.2s; display: flex; flex-direction: column;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-card.current::before {
  content: "当前套餐"; position: absolute; top: -10px; right: 14px;
  background: var(--grad); color: #fff; font-size: 10.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
}
.plan-name { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.plan-price { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.plan-price small { font-size: 12px; font-weight: 500; color: var(--muted-2); margin-left: 3px; }
.plan-desc { font-size: 11.5px; color: var(--muted-2); margin: 6px 0 14px; line-height: 1.7; min-height: 34px; }
.plan-feat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; font-size: 12.5px; color: var(--text-2); }
.plan-feat div { display: flex; gap: 7px; align-items: center; }
.plan-feat i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); flex: 0 0 auto; }

/* 用量进度 */
.meter { margin-bottom: 14px; }
.meter-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.meter-top span { color: var(--muted); }
.meter-top b { font-weight: 600; }
.meter-bar { height: 7px; border-radius: 7px; background: var(--panel-3); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 7px; background: var(--grad); transition: width 0.4s ease; }
.meter-fill.warn { background: linear-gradient(135deg, #f0a91c, #e2683c); }
.meter-fill.full { background: linear-gradient(135deg, #e5484d, #f0716f); }

/* ---------- 竖向 key-value ---------- */
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row span { color: var(--muted); }
.kv-row b { font-weight: 550; color: var(--text-2); text-align: right; }

/* ---------- 粒子画布 ---------- */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---------- 首页 ---------- */
.landing-wrap { position: relative; z-index: 1; min-height: 100vh; overflow-y: auto; overflow-x: hidden; }
.landing { max-width: 1120px; margin: 0 auto; padding: 40px 28px 70px; position: relative; z-index: 2; }
.top-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-nav .links { display: flex; align-items: center; gap: 8px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-top: 58px; }
.hero-copy { flex: 1; min-width: 320px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(79, 110, 247, 0.22); padding: 5px 12px; border-radius: 22px; font-weight: 500;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.hero h1 { font-size: 50px; line-height: 1.16; margin: 20px 0 18px; letter-spacing: -0.035em; font-weight: 750; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 520px; margin: 0; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-meta b { display: block; font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.hero-meta span { font-size: 11.5px; color: var(--muted-2); }
.hero-art {
  flex: 0 0 396px; position: relative; height: 384px;
  border-radius: 24px; border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.hero-art-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.hero-art-head .dots3 { display: flex; gap: 5px; }
.hero-art-head .dots3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.hero-art-head b { font-size: 12.5px; font-weight: 600; margin-left: 4px; }
.hero-art-body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 11px; overflow: hidden; }
.demo-bubble { max-width: 82%; padding: 9px 13px; border-radius: 4px 14px 14px 14px; background: var(--bubble-in); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; animation: rise 0.5s ease both; }
.demo-bubble.me { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-text); border: none; border-radius: 14px 4px 14px 14px; }
.demo-bubble.ai { background: var(--accent-soft); border-color: rgba(14, 165, 164, 0.28); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 64px; }
.entry {
  display: block; text-decoration: none; color: inherit; position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px 22px;
  transition: 0.22s ease; box-shadow: var(--shadow-sm);
}
.entry:hover { transform: translateY(-4px); border-color: rgba(79, 110, 247, 0.32); box-shadow: var(--shadow); }
.entry-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid rgba(79, 110, 247, 0.2); color: var(--accent); }
.entry-ic svg { width: 20px; height: 20px; }
.entry h3 { margin: 16px 0 8px; font-size: 16px; }
.entry p { margin: 0; color: var(--muted-2); font-size: 12.5px; line-height: 1.8; min-height: 46px; }
.entry .go { margin-top: 14px; font-size: 12.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.entry .acct { margin-top: 14px; font-size: 11.5px; color: var(--muted-2); padding-top: 13px; border-top: 1px dashed var(--line-2); line-height: 1.9; }
.entry .acct b { color: var(--text-2); font-weight: 550; }
/* 用 button 实现的入口卡片（用于唤起客服等交互，避免暴露内部路径） */
.entry-btn { width: 100%; text-align: left; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; }

/* 后台路径输入行 */
.ap-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ap-row input { flex: 1 1 220px; min-width: 0; }
.ap-row .btn { flex: 0 0 auto; }
@media (max-width: 640px) {
  .ap-row .btn { flex: 1 1 100%; }
}

.feats { margin-top: 64px; }
.feats h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 8px; }
.feats p.sub { color: var(--muted-2); font-size: 13px; margin: 0 0 26px; }
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feat {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.feat .fi { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); margin-bottom: 12px; }
.feat .fi svg { width: 16px; height: 16px; }
.feat b { display: block; font-size: 13px; margin-bottom: 6px; }
.feat span { font-size: 11.5px; color: var(--muted-2); line-height: 1.75; }

.foot { margin-top: 56px; font-size: 11.5px; color: var(--muted-2); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 22px; border-top: 1px solid var(--line); }

@media (max-width: 960px) {
  .entries { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 34px; }
  .hero-art { flex: 1 1 100%; height: 320px; }
  .landing { padding: 28px 18px 50px; }
}

/* ---------- 通知气泡（站内公告弹层） ---------- */
.announce-pop {
  position: fixed; right: 22px; bottom: 22px; width: 340px; z-index: 70;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px 18px; animation: slideIn 0.28s ease;
}
.announce-pop h4 { margin: 0 0 6px; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.announce-pop p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.75; max-height: 110px; overflow: auto; white-space: pre-wrap; }
.announce-pop .close { position: absolute; top: 10px; right: 12px; border: none; background: none; color: var(--muted-2); cursor: pointer; font-size: 15px; }
.announce-pop .acts { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

/* ===== 官网悬浮客服 / 炫彩时钟 / 站点状态 ===== */
.chroma-clock {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.chroma-clock .ck-ic {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.chroma-clock .ck-ic svg { width: 18px; height: 18px; }
.chroma-clock .ck-body { display: flex; flex-direction: column; line-height: 1.15; }
.chroma-time {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(92deg, #4f6ef7 0%, #0ea5a4 26%, #f472b6 52%, #f59e0b 74%, #4f6ef7 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* v1.25.0：渐变文字流动每帧重绘整行，改静态渐变；观感差异极小 */
  background-position: 30% 50%;
}
.chroma-date { font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; margin-top: 3px; }
@keyframes chromaFlow { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }

/* 站点状态小胶囊 */
.site-status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 11.5px; color: var(--muted);
}
.site-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.16); }
.site-status.warn i { background: var(--warn); box-shadow: 0 0 0 3px rgba(217, 138, 0, 0.18); }
.site-status b { color: var(--text); font-weight: 600; }

/* 悬浮客服 */
.site-widget { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.site-dock { display: flex; align-items: center; gap: 10px; }
.site-fab {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 16px 34px rgba(79, 110, 247, 0.38);
  transition: transform 0.2s, box-shadow 0.2s;
}
.site-fab:hover { transform: scale(1.06); box-shadow: 0 20px 44px rgba(79, 110, 247, 0.55); }
/* 原来是两层无限扩散光环（fabRing infinite×2）：常驻合成 + 每帧重绘，
   手机上看官网一直在烧 CPU。改为静态微光环，交互时才给反馈 */
.site-fab::before {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(79, 110, 247, 0.28);
}
.site-fab::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(79, 110, 247, 0); transition: border-color 0.24s;
}
.site-fab:hover::after { border-color: rgba(79, 110, 247, 0.45); }
.site-fab svg { width: 25px; height: 25px; }
.site-fab .fab-badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-style: normal;
  display: grid; place-items: center; box-shadow: 0 0 0 2.5px var(--panel);
}
.site-fab .fab-tip {
  position: absolute; right: 72px; top: 50%; transform: translate(6px, -50%);
  white-space: nowrap; font-style: normal; font-size: 12px; padding: 7px 11px; border-radius: 10px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none; transition: 0.22s;
}
.site-fab:hover .fab-tip { opacity: 1; transform: translate(0, -50%); }
/* fabBreath / fabRing 两个无限动画已移除（常驻重绘），保留 hover 反馈 */

.site-panel {
  width: 372px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 130px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); display: none; flex-direction: column; overflow: hidden;
  transform: translateY(12px) scale(0.98); opacity: 0; transition: 0.22s ease;
}
.site-panel.show { display: flex; transform: none; opacity: 1; }
.site-panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  background: var(--grad); color: #fff;
}
.site-panel-head .sp-logo {
  width: 34px; height: 34px; border-radius: 11px; background: rgba(255, 255, 255, 0.2);
  display: grid; place-items: center; font-weight: 700;
}
.site-panel-head b { font-size: 13.5px; display: block; }
.site-panel-head span { font-size: 11px; opacity: 0.88; display: flex; align-items: center; gap: 5px; }
.site-panel-head span i { width: 6px; height: 6px; border-radius: 50%; background: #a7f3d0; }
.site-panel-head .sp-acts { margin-left: auto; display: flex; gap: 4px; }
.site-panel-head .sp-acts button {
  width: 26px; height: 26px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 14px; line-height: 1;
}
.site-panel-head .sp-acts button:hover { background: rgba(255, 255, 255, 0.3); }
.site-panel-notice {
  padding: 7px 14px; font-size: 11px; color: var(--muted); background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.site-panel-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.site-panel-body::-webkit-scrollbar { width: 6px; }
.site-panel-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.sp-msg { display: flex; gap: 8px; max-width: 88%; }
.sp-msg .sp-av {
  width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-size: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.sp-msg .sp-bubble {
  padding: 9px 12px; border-radius: 13px; background: var(--bubble-in); color: var(--text);
  font-size: 13px; line-height: 1.65; word-break: break-word; white-space: pre-wrap;
}
.sp-msg .sp-time { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.sp-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.sp-msg.me .sp-bubble { background: var(--bubble-out); color: var(--bubble-out-text); }
.sp-msg.me .sp-av { background: var(--panel-3); color: var(--muted); }
.sp-msg.me .sp-time { text-align: right; }
.sp-msg.sys { align-self: center; max-width: 100%; }
.sp-msg.sys .sp-bubble {
  background: var(--panel-2); color: var(--muted); font-size: 11.5px; border-radius: 10px;
  text-align: center; border: 1px dashed var(--line-2);
}
.sp-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.sp-quick button {
  font-size: 11.5px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2);
  transition: 0.16s;
}
.sp-quick button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.site-panel-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.site-panel-foot .sp-row { display: flex; gap: 8px; align-items: flex-end; }
.site-panel-foot textarea {
  flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px;
  font-size: 13px; font-family: var(--font); background: var(--panel-2); color: var(--text);
  max-height: 96px; line-height: 1.5; outline: none;
}
.site-panel-foot textarea:focus { border-color: var(--accent); background: var(--panel); }
.site-panel-foot .sp-send {
  width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--grad); color: #fff; display: grid; place-items: center; flex: none;
}
.site-panel-foot .sp-send:disabled { opacity: 0.5; cursor: not-allowed; }
.site-panel-foot .sp-send svg { width: 18px; height: 18px; }
.site-panel-foot .sp-note { font-size: 10.5px; color: var(--muted-2); margin-top: 6px; text-align: center; }

@media (max-width: 560px) {
  .site-widget { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .site-panel {
    width: calc(100vw - 28px);
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
    max-height: none;
    border-radius: 16px;
  }
  .site-fab { width: 54px; height: 54px; }
  .chroma-clock { padding: 10px 14px; }
}

/* 嵌入代码展示 */
.code-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px dashed var(--line-2);
}
.code-box code {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--text-2); word-break: break-all; line-height: 1.7;
  user-select: all;
}

/* ================= v1.5.0 新增组件 ================= */

/* ---- 图片头像 ---- */
.avatar img,
.brand-logo img,
.shop-logo img,
.wlogo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
.avatar.has-img,
.brand-logo.has-img,
.shop-logo.has-img,
.wlogo.has-img { padding: 0; overflow: hidden; background: var(--panel-3); }
.avatar.has-img img { border-radius: inherit; }

.avatar-picker { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar-picker .av-preview {
  width: 62px; height: 62px; border-radius: 20px; flex: none; overflow: hidden;
  display: grid; place-items: center; font-size: 24px; font-weight: 700;
  color: #fff; background: var(--grad); box-shadow: var(--shadow-sm);
}
.avatar-picker .av-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker .av-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-picker .av-tip { font-size: 11.5px; color: var(--muted-2); width: 100%; line-height: 1.7; }

/* ---- 顶栏公告铃铛 ---- */
.notify-wrap { position: relative; display: inline-flex; }
.notify-bell {
  position: relative; width: 36px; height: 36px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2);
  display: grid; place-items: center; transition: 0.16s;
}
.notify-bell:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.notify-bell svg { width: 17px; height: 17px; }
.notify-bell .ndot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--panel);
  animation: bellIn 0.24s ease-out;
}
/* 一次性淡入即可，不做循环闪烁（长时间值守的后台不需要一直闪） */
@keyframes bellIn {
  from { transform: scale(0.4); opacity: 0; }
}
.notify-panel {
  position: absolute; top: 46px; right: 0; width: 348px; max-width: calc(100vw - 32px);
  max-height: 440px; overflow: auto; padding: 8px; z-index: 80;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); display: none;
}
.notify-panel.show { display: block; animation: nfIn 0.18s ease; }
@keyframes nfIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notify-panel .np-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 10px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.notify-panel .np-all {
  border: 0; background: transparent; color: var(--accent); font-size: 11.5px;
  cursor: pointer; padding: 2px 4px; font-weight: 600;
}
.np-item {
  display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  padding: 10px 11px; border-radius: 12px; background: transparent; color: var(--text);
  transition: 0.14s;
}
.np-item:hover { background: var(--panel-2); }
.np-item b { display: block; font-size: 12.8px; font-weight: 600; line-height: 1.5; }
.np-item span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.np-item .np-meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.np-item .np-meta i { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
.np-empty { padding: 26px 12px; text-align: center; color: var(--muted-2); font-size: 12px; }

/* ---- 公告受众标签 ---- */
.aud-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  background: var(--panel-3); color: var(--muted);
}
.aud-tag.merchant { background: rgba(79, 110, 247, 0.12); color: var(--accent); }
.aud-tag.visitor { background: rgba(18, 161, 80, 0.12); color: var(--ok); }
.aud-tag.all { background: rgba(217, 138, 0, 0.14); color: var(--warn); }

/* ---- 登录 / 注册切换 ---- */
.auth-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.auth-tabs button {
  flex: 1; border: 0; background: transparent; cursor: pointer; padding: 9px 0;
  border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted);
  font-family: var(--font); transition: 0.16s;
}
.auth-tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.trial-hint {
  margin: 4px 0 16px; padding: 10px 12px; border-radius: 12px; font-size: 12px; line-height: 1.7;
  background: linear-gradient(135deg, rgba(79, 110, 247, 0.1), rgba(14, 165, 164, 0.1));
  border: 1px solid rgba(79, 110, 247, 0.18); color: var(--text-2);
}
.trial-hint b { color: var(--accent); }

/* 自助入驻的套餐选择卡（v1.21.3）：一行一张，选中描边高亮 */
.signup-plans { display: flex; flex-direction: column; gap: 7px; max-height: 210px; overflow-y: auto; }
.sp-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 11px; padding: 9px 11px;
  background: var(--panel-2); transition: .15s;
}
.sp-item:hover { border-color: var(--accent); }
.sp-item.on { border-color: var(--accent); background: var(--accent-soft); }
.sp-item .sp-main { flex: 1 1 auto; min-width: 0; }
.sp-item .sp-name { font-size: 13px; font-weight: 600; }
.sp-item .sp-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sp-item .sp-price { font-size: 13px; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---- 订单 / 支付 ---- */
.order-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pay-box {
  border: 1px dashed var(--line-2); border-radius: 14px; padding: 14px;
  background: var(--panel-2); margin-bottom: 14px;
}
.pay-box .pay-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px;
  font-weight: 700; letter-spacing: 0.5px; color: var(--accent); word-break: break-all;
}
.pay-box .pay-amt { font-size: 26px; font-weight: 800; margin: 8px 0; color: var(--text); }
.pay-box .pay-tip { font-size: 12px; color: var(--muted); line-height: 1.8; white-space: pre-wrap; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pay-method {
  border: 1.5px solid var(--line-2); border-radius: 14px; padding: 12px 14px;
  cursor: pointer; background: var(--panel); transition: 0.16s;
}
.pay-method:hover { border-color: var(--accent); }
.pay-method.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-method b { display: block; font-size: 13px; margin-bottom: 3px; }
.pay-method span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.plan-card .plan-buy {
  display: block; width: 100%; margin-top: 10px; border: 0; cursor: pointer;
  padding: 10px 0; border-radius: 11px; font-size: 13px; font-weight: 600;
  background: var(--grad); color: #fff; font-family: var(--font); transition: 0.16s;
}
.plan-card .plan-buy:hover { filter: brightness(1.06); transform: translateY(-1px); }
.plan-card .plan-buy.ghost { background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line-2); }

/* ---- 特效开关 ---- */
.fx-btn { min-width: 36px; }
.fx-btn.off { opacity: 0.55; }

/* ---- 我的头像（侧边栏） ---- */
.side-user .avatar { overflow: hidden; }

/* ---- 移动端 ---- */
@media (max-width: 900px) {
  .notify-panel { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
  .pay-methods { grid-template-columns: 1fr; }
  .avatar-picker { align-items: flex-start; }
}

/* ============================================================
   v1.5.1 关键字自动回复 / 公告已读
   ============================================================ */

/* 触发模式：卡片式单选 */
.ar-modes { display: flex; flex-direction: column; gap: 9px; }
.ar-mode {
  display: block; position: relative; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px 11px 40px; background: var(--panel-2);
  transition: 0.16s;
}
.ar-mode:hover { border-color: var(--line-2); }
.ar-mode input { position: absolute; opacity: 0; pointer-events: none; }
.ar-mode::before {
  content: ""; position: absolute; left: 14px; top: 15px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.6px solid var(--line-2); background: var(--panel);
  transition: 0.16s;
}
.ar-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.ar-mode.on::before {
  border-color: var(--accent); border-width: 4.5px; background: var(--panel);
}
.ar-mode-t { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ar-mode-d { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; line-height: 1.6; }
.ar-mode.on .ar-mode-t { color: var(--accent); }

.ar-tip {
  margin-top: 13px; font-size: 11.5px; line-height: 1.8; color: var(--muted-2);
  border-top: 1px dashed var(--line); padding-top: 11px;
}
.ar-tip code, .ar-hint code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; background: var(--panel-3); color: var(--accent);
  padding: 1px 5px; border-radius: 5px;
}
.ar-hint { font-size: 11px; color: var(--muted-2); margin-top: 6px; line-height: 1.7; }

/* 关键词标签 */
.kw-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.kw-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  font-size: 11.5px; border-radius: 7px; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(79, 110, 247, 0.18);
}

/* 命中测试结果 */
.ar-test { margin-top: 13px; font-size: 12.5px; min-height: 20px; }
.ar-miss {
  color: var(--muted); font-size: 12px; line-height: 1.7;
  background: var(--panel-2); border: 1px dashed var(--line-2);
  border-radius: 10px; padding: 10px 12px;
}
.ar-hit {
  border: 1px solid rgba(18, 161, 80, 0.22); background: var(--ok-soft);
  border-radius: 12px; padding: 11px 13px;
}
.ar-hit-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ar-hit-body {
  font-size: 12.5px; line-height: 1.85; color: var(--text-2);
  white-space: pre-wrap; padding-left: 2px;
}
.ar-hit .ar-miss { margin-top: 9px; background: rgba(255, 255, 255, 0.5); }

/* 公告未读 */
.announce.unread { border-color: rgba(79, 110, 247, 0.26); background: linear-gradient(180deg, var(--accent-soft), var(--panel) 55%); }
.ann-new {
  display: inline-flex; align-items: center; height: 17px; padding: 0 6px;
  margin-right: 6px; vertical-align: 1px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; background: var(--grad); border-radius: 5px;
}
.ann-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger); margin-right: 6px; vertical-align: 1px;
}

@media (max-width: 900px) {
  .kw-chip { font-size: 11px; }
}

/* ============================================================
   自适应布局：中屏图标条 / 窄屏单列 / 手机底部弹层
   —— 任何窗口宽度、任意缩放比例下都不出现横向溢出
   ============================================================ */

/* 返回按钮：仅窄屏出现（基础样式，媒体查询里再打开显示） */
.chat-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
}
.chat-back:hover { border-color: var(--accent); color: var(--accent); }
.chat-back svg { width: 17px; height: 17px; }

/* ---------- 中屏（小笔记本、平板横屏）：侧栏收成图标条 ---------- */
@media (min-width: 861px) and (max-width: 1180px) {
  .sidebar {
    width: 68px;
    flex: 0 0 68px;
    padding: 14px 9px;
    align-items: center;
  }
  .brand { padding: 2px 0 16px; justify-content: center; }
  .brand-logo { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  .brand-txt { display: none; }
  .nav { width: 100%; gap: 4px; overflow: visible; }
  .nav-item {
    position: relative;
    justify-content: center;
    padding: 0;
    gap: 0;
  }
  .nav-item > span:not(.nav-ic) { display: none; }
  .nav-badge { position: absolute; top: 3px; right: 5px; margin: 0; padding: 0 4px; }
  /* 悬浮提示改成文字气泡，图标条也能看清叫什么 */
  .nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    padding: 5px 10px;
    border-radius: 9px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
  }
  .side-foot { width: 100%; display: flex; justify-content: center; }
  .side-user { padding: 4px; gap: 0; }
  .side-user > div:not(.avatar) { display: none; }
  .side-user #logoutBtn { display: none; }
  .page { padding: 18px 18px 26px; }
  .topbar { padding: 0 18px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .search input { width: 190px; }
}

/* ---------- 窄屏（平板竖屏 / 手机）：导航横置顶部，内容单列 ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    padding-top: max(8px, env(safe-area-inset-top));
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    overflow: visible;
  }
  .brand { padding: 0; gap: 8px; }
  .brand-logo { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
  .brand-txt { display: none; }
  .nav {
    flex-direction: row;
    gap: 4px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 0 0 auto; height: 32px; padding: 0 10px; font-size: 12px; gap: 6px; }
  .nav-item .nav-ic { width: 14px; height: 14px; }
  .nav-item .nav-ic svg { width: 14px; height: 14px; }
  .nav-item.active::before { top: 4px; bottom: 4px; }
  .nav-item:hover::after { content: none; }
  .side-foot { margin: 0; border-top: none; padding: 0; flex: 0 0 auto; }
  .side-user { padding: 0; gap: 6px; }
  .side-user > div:not(.avatar) { display: none; }
  .side-user .avatar { width: 28px; height: 28px; }

  .main { flex: 1 1 auto; min-height: 0; }
  .topbar { height: 54px; flex: 0 0 54px; padding: 0 12px; gap: 8px; }
  .topbar h1 { font-size: 14px; }
  .topbar p { display: none; }
  .top-actions { gap: 6px; }
  .conn span { display: none; }
  .page { padding: 12px; }

  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .grid-2, .grid-3, .grid-4, .grid-2.eq { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .modal { padding: 16px; max-width: none; }
  .modal-foot { flex-wrap: wrap; }
  .toolbar { gap: 8px; }
  .toolbar .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .toolbar .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 0 0 auto; white-space: nowrap; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }

  /* 表格：让内容自己撑开，卡片内部横向滑动；列再多也不会把整页顶宽 */
  .page .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { width: max-content; min-width: 100%; }
  .table th, .table td { white-space: nowrap; padding: 11px 9px; }
  .table th { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
  .table td { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
  .table td .badge, .table td .row-actions { white-space: nowrap; }

  /* 会话页：列表与聊天各占一屏，点进会话后整屏显示聊天（带返回按钮） */
  .page.page-chat { flex-direction: column; }
  .chat-wrap { flex-direction: column; position: relative; flex: 1 1 auto; min-height: 0; }
  .chat-list {
    width: 100%;
    flex: 1 1 auto;
    border-right: none;
    border-bottom: none;
    max-height: none;
  }
  .chat-info { display: none; }
  .chat-main { display: none; flex: 1 1 auto; min-height: 0; }
  .chat-wrap.show-chat .chat-list { display: none; }
  .chat-wrap.show-chat .chat-main { display: flex; }
  .chat-back { display: inline-flex; }
  .chat-head { height: 56px; flex: 0 0 56px; padding: 0 12px; gap: 10px; }
  .chat-head h3 { font-size: 13.5px; }
  .chat-head .sub { display: none; }
  .chat-body { padding: 14px 12px 8px; }
  .chat-foot { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .chat-input-row textarea { min-height: 42px; }
  .chat-input-row .btn { height: 42px !important; padding: 0 14px !important; }
  .msg { max-width: 84%; }
}

/* ---------- 手机：两列统计、底部弹层、更紧的间距 ---------- */
@media (max-width: 560px) {
  .page { padding: 10px; }
  .topbar { height: 50px; flex: 0 0 50px; }
  .topbar h1 { font-size: 13.5px; }
  #fxBtn { display: none; }
  .conn { padding: 4px 8px; }
  /* 顶栏多了公告铃铛，窄屏再收紧一点，避免把整页顶宽 */
  .btn-sm { padding: 0 10px; }
  .notify-bell { width: 32px; height: 32px; border-radius: 10px; }
  .notify-bell svg { width: 16px; height: 16px; }
  /* 顶栏：标题可省略、右侧按钮条可横向滑动。
     手机上顶栏要放主题、接客状态、连接状态、公告铃、声音、访客入口，
     硬塞进 390px 只有两种结果：挤成两行或者把整页顶宽。
     这里让标题让位、按钮条自己滚动，整页永远不横向溢出。 */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar p { display: none; }
  .top-actions {
    flex: 0 1 auto; min-width: 0; gap: 6px;
    max-width: 62vw; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
    padding-bottom: 1px;
  }
  .top-actions::-webkit-scrollbar { display: none; }
  .top-actions > * { flex: 0 0 auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 13px 14px; }
  .stat-val { font-size: 23px; }
  .card { padding: 12px; border-radius: 14px; }
  .page .toolbar > .muted { display: none; }
  .toolbar .spacer { flex: 1 1 100%; }
  .btn { height: 36px; padding: 0 12px; }
  .btn-sm { height: 30px; }

  /* 弹窗从底部推入，接近原生 App 的操作习惯 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    animation: sheetUp 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.05);
  }
  .modal-foot { position: sticky; bottom: 0; background: var(--panel); padding-top: 10px; margin-top: 14px; }
  .modal-foot .btn { flex: 1 1 auto; }
  @keyframes sheetUp { from { transform: translateY(26px); opacity: 0.5; } }

  .toast-wrap { top: auto; bottom: 16px; left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; }
  .avatar-picker { gap: 10px; }
  .pay-box .pay-amt { font-size: 22px; }
}

/* 超窄屏（iPhone SE 320 一类）：顶栏按钮只留图标，避免把整页顶宽 */
@media (max-width: 380px) {
  .topbar > div:first-child { min-width: 0; overflow: hidden; }
  .topbar h1 { max-width: 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #goH5, #soundBtn { width: 34px; padding: 0; font-size: 0; text-align: center; }
  #goH5::before { content: '↗'; font-size: 14px; }
  #soundBtn::before { content: '🔊'; font-size: 13px; }
  .notify-bell { width: 30px; height: 30px; }
  .top-actions { gap: 4px; }
}

/* 超宽屏：内容不被拉成长条，居中留白更好读 */
@media (min-width: 1700px) {
  .page { width: 100%; max-width: 1680px; margin: 0 auto; }
  /* 数据概览独占整屏：指标树按可用宽度自动加列，右侧不再留一大片空白 */
  #page-dashboard { max-width: none; }
}

/* ---------- 三端拆分（v1.25.0）：客服台 + 商户监控条 ---------- */

/* 卡片头部：标题在左，操作在右 */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .card-title { margin: 0; }

/* 会话页要竖排：监控条在上，聊天区占满剩余高度 */
#page-chats.active { flex-direction: column; }

/* 商户后台「实时会话监控」顶部条：在线坐席数 + 客服台入口 */
.monitor-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin: 8px 10px 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); font-size: 11.5px; color: var(--muted);
}
.monitor-bar b { color: var(--text); font-weight: 600; }
.monitor-bar .mb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
.monitor-bar .mb-spacer { margin-left: auto; }
.monitor-bar .seg { width: auto; }
.monitor-bar .seg button { flex: none; padding: 3px 8px; font-size: 11px; }
.monitor-bar code { font-family: inherit; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

/* 坐席筛选下拉（店主专用） */
.monitor-select {
  width: 100%; height: 30px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel); color: var(--text); font-family: inherit; font-size: 12px;
}
.monitor-select:focus { outline: none; border-color: var(--accent); }

/* 客服台话术页 */
.quick-list-page { display: flex; flex-direction: column; gap: 8px; }
.quick-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2);
}
.quick-row-main { min-width: 0; flex: 1; }
.quick-row-main b { display: block; font-size: 12.8px; font-weight: 600; margin-bottom: 4px; }
.quick-row-main span { display: block; font-size: 12px; color: var(--muted); line-height: 1.65; word-break: break-word; }
.quick-row-act { display: flex; gap: 6px; flex: none; }

/* 客服台公告页 */
.ann-row { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.ann-row:last-child { border-bottom: 0; }
.ann-row.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); border-radius: 10px; padding-left: 12px; padding-right: 12px; }
.ann-row-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ann-row-h b { font-size: 13px; font-weight: 650; }
.ann-row-c { font-size: 12.6px; color: var(--text-2); line-height: 1.75; word-break: break-word; }

/* 输入区提示（会话已结束 / 他人接待） */
.composer-tip { font-size: 11.5px; color: var(--warn); padding: 4px 2px 0; }
.composer-tip:empty { display: none; }

/* ---------- 性能兜底：移动端 / 低端设备 ---------- */
/* backdrop-filter 是逐帧重算的高斯模糊，顶栏和会话头常驻可见，
   在小屏设备上滚动时非常吃 GPU，改成高不透明度纯色，观感几乎无差 */
@media (max-width: 860px) {
  .topbar { backdrop-filter: none; background: var(--panel); }
  .chat-head { backdrop-filter: none; }
  .site-status { backdrop-filter: none; background: var(--panel); }
  .modal-mask { backdrop-filter: none; background: rgba(10, 16, 30, 0.72); }
  .site-panel { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28); }
  .site-fab { box-shadow: 0 10px 22px rgba(79, 110, 247, 0.34); }
  /* 渐变文字流动每帧都要重绘整行，小屏关掉 */
  .chroma-time { animation: none; background-position: 30% 50%; }
}

/* 系统开启「减少动态效果」时，全部装饰动画停掉 */
@media (prefers-reduced-motion: reduce) {
  .chroma-time, .lc-loader, .lc-loader-dots i, .dots i { animation: none !important; }
  .msg, .card, .page.active { animation: none !important; }
}

/* ===== 服务器监控 ===== */
/* 顶栏状态胶囊：任何页面都能一眼看到服务器是否正常 */
.sv-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel-2);
  cursor: pointer; white-space: nowrap;
  transition: 0.16s;
}
.sv-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.sv-pill.ok { color: var(--ok); border-color: rgba(18, 161, 80, 0.24); }
.sv-pill.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.sv-pill.warn { color: var(--warn); border-color: rgba(217, 138, 0, 0.28); }
.sv-pill.warn i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sv-pill.bad { color: var(--danger); border-color: rgba(229, 72, 77, 0.28); }
.sv-pill.bad i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); animation: svPulse 1.6s infinite; }
.sv-pill.unknown i { background: var(--muted-2); }
.sv-pill:hover { filter: brightness(0.98); transform: translateY(-1px); }

/* 侧栏导航上的异常小红点 */
.sv-nav-dot {
  margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft);
  flex: 0 0 auto; animation: svPulse 1.6s infinite;
}
.sv-nav-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

@keyframes svPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* 顶部结论条 */
.sv-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.sv-hero::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--ok); opacity: 0.9;
}
.sv-hero.warn::before { background: var(--warn); }
.sv-hero.bad::before { background: var(--danger); }
.sv-hero-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sv-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto;
  background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft);
}
.sv-dot.warn { background: var(--warn); box-shadow: 0 0 0 5px var(--warn-soft); }
.sv-dot.bad { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); animation: svPulse 1.6s infinite; }
.sv-hero-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sv-hero-txt b { font-size: 16px; letter-spacing: -0.2px; }
.sv-hero-txt span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.sv-hero-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sv-updated { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.sv-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.sv-auto input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* 指标卡网格 */
.sv-grid {
  display: grid; gap: 12px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
}
.sv-metric {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 15px 12px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
  transition: 0.18s;
}
.sv-metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sv-m-label { font-size: 12px; color: var(--muted); }
.sv-m-val {
  font-size: 25px; font-weight: 700; letter-spacing: -0.6px;
  color: var(--text); font-variant-numeric: tabular-nums;
  line-height: 1.15; word-break: break-all;
}
.sv-m-val i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.sv-metric.warn .sv-m-val { color: var(--warn); }
.sv-metric.bad .sv-m-val { color: var(--danger); }
.sv-bar { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.sv-bar span { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width 0.45s ease; }
.sv-metric.warn .sv-bar span { background: linear-gradient(90deg, var(--warn), #f0b445); }
.sv-metric.bad .sv-bar span { background: linear-gradient(90deg, var(--danger), #f5737a); }
.sv-spark { width: 100%; height: 26px; display: block; }
.sv-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; opacity: 0.75; }
.sv-metric.warn .sv-spark polyline { stroke: var(--warn); }
.sv-metric.bad .sv-spark polyline { stroke: var(--danger); }
.sv-m-sub { font-size: 11.5px; color: var(--muted-2); line-height: 1.55; }

/* 服务探活 + 运行信息 */
.sv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.sv-card { padding: 14px 16px 8px; }
.sv-svc { display: flex; flex-direction: column; }
.sv-svc-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 2px; border-bottom: 1px dashed var(--line);
  font-size: 13px; min-width: 0;
}
.sv-svc-row:last-child { border-bottom: 0; }
.sv-svc-row b { font-weight: 600; flex: 0 0 auto; }
.sv-svc-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.sv-svc-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.sv-svc-detail { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-svc-ms { margin-left: auto; color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.sv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; margin: 6px 0 8px; }
.sv-fact { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.sv-fact dt { font-size: 12px; color: var(--muted); flex: 0 0 66px; }
.sv-fact dd { font-size: 12.5px; margin: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sv-empty { padding: 22px 0; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.sv-note { margin-top: 14px; font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }

@media (max-width: 1100px) {
  .sv-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sv-hero { padding: 15px 16px; }
  .sv-hero-txt b { font-size: 15px; }
  .sv-hero-r { width: 100%; justify-content: space-between; }
  .sv-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .sv-m-val { font-size: 21px; }
  .sv-facts { grid-template-columns: 1fr; }
  .sv-pill span { display: none; }
  .sv-pill { padding: 6px; }
}

/* ---------- 消息撤回 ---------- */
/* 撤回按钮：默认透明，鼠标悬停到自己发的气泡才显现，避免干扰阅读 */
.msg .revoke-btn {
  align-self: center; flex: 0 0 auto; opacity: 0; border: 0; background: transparent;
  color: var(--muted-2); font-size: 11px; cursor: pointer; padding: 5px 7px;
  border-radius: 7px; font-family: inherit; transition: 0.15s; white-space: nowrap;
}
.msg.me:hover .revoke-btn { opacity: 1; }
.msg .revoke-btn:hover { color: var(--danger); background: var(--danger-soft); }
.msg .revoke-btn:disabled { cursor: default; opacity: 0.45; }
@media (hover: none) { .msg.me .revoke-btn { opacity: 0.5; } }

/* 被撤回的气泡：虚线占位，双方都看不到原文 */
.msg.revoked .bubble {
  background: transparent !important; border: 1px dashed var(--line-2) !important;
  color: var(--muted-2) !important; box-shadow: none !important; font-style: italic;
}
.msg.revoked .meta { opacity: 0.85; }

/* 平台审计视图：原文保留，但用红框明确标出「这条被商户撤过」 */
.msg.audit-revoked .bubble {
  border: 1px solid rgba(229, 72, 77, 0.4) !important;
  background: var(--danger-soft) !important; color: var(--text) !important;
  box-shadow: none !important;
}
.msg.audit-revoked .bubble .pic { border-radius: 10px; }
.revoke-tag {
  display: inline-block; margin-left: 6px; font-size: 10px; padding: 1px 7px;
  border-radius: 20px; background: rgba(229, 72, 77, 0.14); color: var(--danger);
  font-weight: 650; vertical-align: 1px; letter-spacing: 0.02em;
}

/* 撤回记录页 */
.rv-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.rv-bar .search { flex: 1; min-width: 200px; }
.rv-item {
  border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px;
  margin-bottom: 10px; background: var(--panel); transition: 0.15s;
}
.rv-item.unread { border-color: rgba(229, 72, 77, 0.35); background: linear-gradient(0deg, var(--danger-soft), var(--danger-soft)), var(--panel); }
.rv-item:hover { border-color: var(--line-2); }
.rv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.rv-head b { color: var(--text); font-size: 13px; font-weight: 650; }
.rv-time { margin-left: auto; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.rv-body {
  margin-top: 9px; font-size: 13px; line-height: 1.7; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word; background: var(--panel-2);
  border-radius: 9px; padding: 10px 12px; border: 1px dashed var(--line-2);
}
.rv-body img { max-width: 180px; border-radius: 8px; display: block; }
.rv-foot { margin-top: 9px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rv-foot .muted { font-size: 11px; }
.rv-new { font-size: 10px; padding: 1px 7px; border-radius: 20px; background: var(--danger); color: #fff; font-weight: 650; }

/* ---------- 接客状态 / 处理进度 / 备注 / 文件 / 话术置顶 ---------- */
.presence-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.presence-btn .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok, #30a46c); box-shadow: 0 0 0 3px rgba(48, 163, 108, .16); }
.presence-btn.online { color: var(--ok, #30a46c); border-color: rgba(48, 163, 108, .35); background: rgba(48, 163, 108, .1); }
.presence-btn.offline { color: var(--muted); }
.presence-btn.offline .pdot { background: var(--muted-2); box-shadow: none; }

.badge-warn { color: var(--warn); border-color: rgba(217, 138, 0, 0.28); background: var(--warn-soft); }
.badge-done { color: var(--ok, #30a46c); border-color: rgba(48, 163, 108, .3); background: rgba(48, 163, 108, .12); }

/* 会话头部的进度切换器：三选一无确认，点了立刻生效 */
.stage-seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; margin-right: 4px; }
.stage-seg button {
  border: 0; background: transparent; color: var(--muted); font-family: inherit;
  font-size: 11.5px; padding: 4px 9px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.stage-seg button:hover { color: var(--text); }
.stage-seg button.active { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-sm); }

/* 备注输入框 */
.remark-input {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 62px;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  font-family: inherit; font-size: 12.5px; line-height: 1.7;
  background: var(--panel-2); color: var(--text); outline: none;
}
.remark-input:focus { border-color: var(--accent); background: var(--panel); }

/* 文件气泡：图标 + 文件名 + 大小 */
.file-card {
  display: inline-flex; align-items: center; gap: 10px; min-width: 168px; max-width: 260px;
  padding: 9px 11px; border-radius: 11px; background: var(--panel-2);
  border: 1px solid var(--line); text-decoration: none; color: inherit; transition: .15s;
}
.file-card:hover { border-color: var(--accent); background: var(--panel); }
.file-card.broken { color: var(--muted-2); font-size: 12px; }
.file-ic {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft, rgba(79, 110, 247, .12)); color: var(--accent);
  font-size: 9.5px; font-weight: 700; letter-spacing: -.02em;
}
.file-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.file-meta b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta em { font-style: normal; font-size: 11px; color: var(--muted-2); }

/* 话术置顶标记 */
.pin-tag {
  display: inline-block; margin-right: 6px; font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: var(--accent-soft, rgba(79, 110, 247, .12)); color: var(--accent); font-weight: 600; vertical-align: 1px;
}
tr.quick-pinned td { background: rgba(79, 110, 247, .03); }

/* 超管：坐席接客状态切换按钮 + 代客回复身份下拉 */
.presence-on { color: var(--ok, #30a46c); border-color: rgba(48, 163, 108, .35); background: rgba(48, 163, 108, .1); font-weight: 600; }
.presence-off { color: var(--muted); }
.as-staff {
  height: 28px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-family: inherit; font-size: 11.5px;
  padding: 0 8px; max-width: 170px; margin-right: 6px;
}

/* ---------------- 网站分组 / 黑名单（v1.14.0） ---------------- */
/* 分组色点：落在表格首列，用背景色区分不同站点入口 */
.group-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(127, 127, 127, .08);
}
/* 分组链接：输入框撑满剩余空间，复制按钮贴着右边，避免长链接把表格撑破 */
.link-cell { display: flex; gap: 6px; align-items: center; max-width: 380px; }
.link-cell input {
  flex: 1 1 auto; min-width: 0; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px; padding: 0 9px; text-overflow: ellipsis;
}
.link-cell .btn { flex: 0 0 auto; }

/* 坐席弹窗里的分组勾选：两列自适应，分组多的时候不会拉成一长条 */
.group-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 10px; margin-bottom: 6px; }
.gchk {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer;
  font-size: 12.5px; transition: .15s; min-width: 0;
}
.gchk:hover { border-color: var(--accent); }
.gchk input { accent-color: var(--accent); flex: 0 0 auto; }
.gchk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gchk:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, rgba(79, 110, 247, .1)); }

/* 会话列表上的分组 / 拉黑标记：和普通 conv-tag 区分开，扫一眼能看出来源 */
.conv-tag.tag-group { color: var(--accent); border-color: rgba(79, 110, 247, .35); }
.conv-tag.tag-block { color: var(--danger, #e5484d); border-color: rgba(229, 72, 77, .4); }

/* 分组筛选条：与会话状态筛选同款，但允许横向滚动（分组可能很多） */
.seg.seg-group { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.seg-group::-webkit-scrollbar { display: none; }
.seg.seg-group button { white-space: nowrap; }

/* 紧凑表格：黑名单列表行数多，不需要常规表格那么高的行距 */
.table-compact th { padding: 9px 8px; font-size: 11.5px; }
.table-compact td { padding: 9px 8px; font-size: 12.5px; }
.table-compact .badge { font-size: 10.5px; }

/* ---------- 分组「配置覆写」区块（v1.16.0） ----------
   十几项配置塞进一个弹窗会很长，默认折叠；已经填过覆写的分组自动展开，
   免得用户点进编辑却看不到自己上次填了什么。 */
.ov-box {
  margin: 4px 0 2px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel-2);
}
.ov-box > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.ov-box > summary::-webkit-details-marker { display: none; }
.ov-box > summary::before {
  content: '▸'; font-size: 10px; color: var(--muted-2); transition: transform 0.15s;
}
.ov-box[open] > summary::before { transform: rotate(90deg); }
.ov-hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.7; margin: 8px 0 12px; }
.ov-box .field:last-child, .ov-box .field-row:last-child .field { margin-bottom: 0; }
.ov-box textarea.mono, .ov-box input.mono { font-family: var(--mono, ui-monospace, Menlo, monospace); font-size: 12px; }

/* 多条欢迎语编辑器（v1.40.0）
   一条欢迎语 = 访客窗口里的一个气泡，所以按「条目」排，序号 + 正文 + 上移/下移/删除。
   图片条目给缩略图预览：只显示一行路径的话，配错图基本看不出来。 */
.wv-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.wv-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.wv-no {
  flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%;
  background: var(--accent, #4f6ef7); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center;
}
.wv-body { flex: 1; min-width: 0; }
.wv-body textarea { width: 100%; margin: 0; }
.wv-img { display: flex; align-items: center; gap: 10px; }
.wv-img img {
  width: 78px; height: 78px; flex: none; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2);
}
.wv-img-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.wv-img-meta .muted { font-size: 11.5px; line-height: 1.6; }
.wv-ops { flex: none; display: flex; flex-direction: column; gap: 4px; }
.wv-ops .btn { width: 28px; height: 24px; padding: 0; line-height: 1; font-size: 12px; }
.wv-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wv-actions .muted { font-size: 11.5px; }
.wv-none {
  font-size: 12px; color: var(--muted-2); padding: 10px 12px;
  border: 1px dashed var(--line-2); border-radius: 10px;
}

/* 自动回复配图缩略图（v1.40.0）：最多 3 张，横向排 */
.ar-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.ar-img { position: relative; width: 72px; height: 72px; }
.ar-img img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.ar-img button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 50%; background: var(--danger, #e5484d); color: #fff;
  font-size: 11px; line-height: 20px; cursor: pointer;
}
/* 分组表格里的「已覆写 N 项」小标签 */
.ov-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; background: var(--accent-soft, rgba(79,110,247,.14)); color: var(--accent, #4f6ef7);
}

/* ---------- 集成脚本页的代码块（v1.16.0） ---------- */
.integ-code {
  margin: 0; padding: 14px 16px; border-radius: 12px; overflow: auto;
  background: var(--code-bg, #0f1422); color: #d6e2ff;
  font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 12px; line-height: 1.75; white-space: pre; tab-size: 2;
  border: 1px solid var(--line);
}
[data-theme="light"] .integ-code { background: #101728; color: #d8e3ff; }
.integ-code::-webkit-scrollbar { height: 8px; width: 8px; }
.integ-code::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 6px; }

/* ---------- 会话监控：已读状态与撤回按钮（v1.16.0） ---------- */
.read-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px;
  font-size: 10.5px; line-height: 1.6; vertical-align: 1px;
}
.read-tag.ok { color: #1f9d55; background: rgba(31, 157, 85, 0.12); }
.read-tag.no { color: var(--muted-2); background: rgba(120, 130, 150, 0.14); }
/* 客服工作台的气泡已读标签（v1.19.0）：跟监控页的 read-tag 同一套观感，
   但挂在消息 meta 行里，所以单独一个类名，避免影响监控页既有样式 */
.msg-read {
  display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 5px;
  font-size: 10px; line-height: 1.6; vertical-align: 1px;
}
.msg-read.ok { color: #1f9d55; background: rgba(31, 157, 85, 0.12); }
.msg-read.no { color: var(--muted-2); background: rgba(120, 130, 150, 0.14); }
.revoke-mini {
  margin-left: 8px; padding: 0 6px; border-radius: 6px; cursor: pointer;
  font-size: 10.5px; line-height: 1.6; font-family: inherit;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  opacity: 0; transition: opacity 0.12s, color 0.12s, border-color 0.12s;
}
/* 平时藏起来，鼠标停在气泡上才出现：撤回是低频且危险的操作，不该常驻视线 */
.msg:hover .revoke-mini { opacity: 1; }
.revoke-mini:hover { color: #e5484d; border-color: #e5484d; }

/* ================= v1.17.0 ================= */

/* ---------- 消息引用 ---------- */
/* 引用按钮和撤回按钮同款：hover 才出现，避免每条消息下面挂一排小按钮 */
.q-btn {
  margin-left: 8px; padding: 0 6px; border-radius: 6px; cursor: pointer;
  font-size: 10.5px; line-height: 1.6; font-family: inherit;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  opacity: 0; transition: opacity 0.12s, color 0.12s, border-color 0.12s;
}
.msg:hover .q-btn { opacity: 1; }
.q-btn:hover { color: var(--accent); border-color: var(--accent); }
@media (hover: none) { .q-btn { opacity: 0.6; } }

/* 气泡内的引用块：左侧竖线 + 两行截断。
   引用是「快照」，原消息被删也不会消失，所以这里永远只有文字，没有跳转依赖。 */
.quote-ref {
  display: block; margin: 0 0 6px; padding: 4px 0 4px 8px;
  border-left: 3px solid var(--accent); border-radius: 3px;
  background: rgba(120, 130, 150, 0.1);
  font-size: 11.5px; line-height: 1.5; cursor: pointer;
  transition: background 0.15s;
}
.quote-ref:hover { background: rgba(120, 130, 150, 0.18); }
.quote-ref b { display: block; font-weight: 600; color: var(--accent); font-size: 11px; margin-bottom: 1px; }
.quote-ref span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--muted); word-break: break-word;
}
/* 自己的气泡里底色已经够深，引用块改成半透明白，避免糊成一片 */
.msg.me .quote-ref { background: rgba(255, 255, 255, 0.16); border-left-color: rgba(255, 255, 255, 0.7); }
.msg.me .quote-ref b { color: #fff; }
.msg.me .quote-ref span { color: rgba(255, 255, 255, 0.86); }

/* 点引用块跳回原消息时的短暂高亮 */
@keyframes lcHl {
  0% { box-shadow: 0 0 0 0 rgba(79, 110, 247, 0.5); }
  100% { box-shadow: 0 0 0 10px rgba(79, 110, 247, 0); }
}
.msg.hl .bubble { animation: lcHl 1.1s ease-out 2; }

/* 输入框上方的引用条：一条竖线 + 谁 + 摘要 + 关闭 */
.quote-bar {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 8px; padding: 7px 10px;
  background: var(--accent-soft); border: 1px solid rgba(79, 110, 247, 0.22);
  border-radius: 10px;
}
.quote-bar .qb-line { width: 3px; align-self: stretch; border-radius: 3px; background: var(--accent); flex: 0 0 3px; }
.quote-bar .qb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.quote-bar .qb-main b { font-size: 11px; color: var(--accent); font-weight: 650; }
.quote-bar .qb-main span {
  font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quote-bar .qb-x {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer; font-family: inherit;
  display: grid; place-items: center; transition: 0.15s;
}
.quote-bar .qb-x:hover { background: rgba(120, 130, 150, 0.18); color: var(--text); }

/* ---------- 会话列表：商户 / 分组筛选 ---------- */
/* 分组标签用强调色描边，和上面灰色的商户标签区分开 */
.conv-tag-g { color: var(--accent); border-color: rgba(79, 110, 247, 0.32); background: var(--accent-soft); }
.conv-filters { display: flex; gap: 6px; margin-top: 8px; }
.conv-filters .filter-sel { flex: 1 1 0; min-width: 0; }
.filter-sel {
  height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text-2); font-size: 11.5px; font-family: inherit;
  text-overflow: ellipsis; cursor: pointer; transition: 0.15s;
}
.filter-sel:hover { border-color: var(--accent); }
.filter-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* 会话信息栏里的分组分配下拉：整行宽，跟 kv 行对齐 */
.chat-info .filter-sel { height: 32px; }

/* ---------- 数据清理页 ---------- */
.cl-check {
  display: flex; align-items: center; gap: 7px; margin-top: 9px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; line-height: 1.6;
}
.cl-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.cl-num { color: var(--accent); font-size: 14px; font-weight: 650; }
.cl-warn {
  padding: 12px 14px; border-radius: 12px;
  background: var(--danger-soft); border: 1px solid rgba(229, 72, 77, 0.28);
  font-size: 12.5px; line-height: 1.85; color: var(--text);
}
.cl-warn b { color: var(--danger); font-size: 14px; }

/* 窄屏：两个筛选下拉换行占满，避免各挤成 40px 读不出字 */
@media (max-width: 640px) {
  .conv-filters { flex-wrap: wrap; }
  .conv-filters .filter-sel { flex: 1 1 100%; }
  .page#page-cleanup .grid-2 { grid-template-columns: 1fr; }
  .quote-bar { padding: 6px 9px; }
  .quote-bar .qb-main span { font-size: 11px; }
}

/* ---------- 版本更新（v1.18.0） ---------- */
/* 顶部横幅沿用服务器监控那套「左侧色条 + 圆环图标」，让运维类页面的观感一致 */
.upd-hero {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow-sm); overflow: hidden;
}
.upd-hero::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--muted-2);
}
.upd-hero.ok::before { background: var(--ok); }
.upd-hero.warn::before { background: var(--warn); }
.upd-hero.bad::before { background: var(--danger); }
.upd-hero-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.upd-ring {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 17px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}
.upd-hero.ok .upd-ring { background: var(--ok-soft); color: var(--ok); }
.upd-hero.warn .upd-ring { background: var(--warn-soft); color: var(--warn); }
.upd-hero.bad .upd-ring { background: var(--danger-soft); color: var(--danger); }
.upd-hero-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.upd-hero-txt b { font-size: 16px; font-weight: 600; }
.upd-hero-txt span {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62ch;
}
.upd-hero-r { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.upd-chip {
  font-size: 12px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.upd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.upd-card { margin-top: 14px; }
.upd-cols .upd-card { margin-top: 0; }
.upd-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; word-break: break-all;
}
.upd-soft { color: var(--muted-2); font-size: 12px; font-weight: 400; }
.upd-hint { font-size: 12px; color: var(--muted-2); line-height: 1.8; margin: 0 0 10px; }
.upd-hint code, .upd-note code {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; font-size: 11.5px;
}
.upd-src {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 74px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text-2); font-size: 12px; line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.upd-src:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.upd-src-actions { display: flex; gap: 8px; margin-top: 10px; }
.upd-tip { margin-top: 12px; }
.upd-tip .tip, .upd-attempts + .tip { font-size: 12px; line-height: 1.9; color: var(--muted); }
.upd-tip > .tip:not(.bad) {
  padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid rgba(79, 110, 247, 0.18);
}
.upd-tip > .tip.bad {
  padding: 10px 12px; border-radius: 10px;
  background: var(--danger-soft); border: 1px solid rgba(229, 72, 77, 0.2); color: var(--text-2);
}
.upd-attempts { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.upd-attempts li { word-break: break-all; }
.upd-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.upd-notes-head .card-title { margin: 0; }
.upd-rel { border-top: 1px dashed var(--line); padding: 14px 0; }
.upd-rel:first-child { border-top: 0; padding-top: 0; }
.upd-rel:last-child { padding-bottom: 0; }
.upd-rel-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.upd-rel-top b { font-size: 14px; }
.upd-rel-top span { font-size: 13px; color: var(--text-2); }
.upd-rel-top em { margin-left: auto; font-style: normal; }
.upd-rel-items { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.95; color: var(--muted); }
.upd-rel-items li { margin-bottom: 4px; }
.upd-note { margin-top: 14px; font-size: 11.5px; color: var(--muted-2); line-height: 1.85; }

@media (max-width: 1100px) {
  .upd-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .upd-hero { flex-direction: column; align-items: flex-start; padding: 15px 16px; }
  .upd-hero-r { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .upd-hero-txt b { font-size: 15px; }
  .upd-hero-txt span { white-space: normal; max-width: none; }
  .upd-notes-head { flex-direction: column; align-items: flex-start; }
}

/* ---------- 配置同步（v1.19.0） ---------- */
/* 左侧参数表 + 右侧下级程序两栏，窄屏自动堆叠 */
.sync-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sync-head .card-title { margin: 0; }
.sync-ver {
  font-size: 11.5px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sync-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.sync-row {
  display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2);
}
.sync-row.off, .sync-peer.off { opacity: 0.62; }
.sync-row-main { flex: 1; min-width: 0; }
.sync-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync-k { font-size: 12px; font-weight: 600; word-break: break-all; }
.sync-g {
  font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 0 6px; line-height: 1.7;
}
.sync-off { font-size: 10.5px; color: var(--danger); }
.sync-v { font-size: 12.5px; margin-top: 3px; word-break: break-word; overflow-wrap: anywhere; }
.sync-note { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.sync-row-act { display: flex; gap: 6px; flex: 0 0 auto; }
.sync-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sync-token {
  margin-top: 14px; padding: 12px; border: 1px dashed rgba(79, 110, 247, 0.5);
  border-radius: 10px; background: var(--accent-soft);
}
.sync-token b { font-size: 12px; color: var(--accent); }
.sync-token-val { margin: 8px 0; word-break: break-all; }
.sync-token-val code { font-size: 12px; }
.sync-token-actions { display: flex; gap: 8px; }
.sync-peers { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sync-peer { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.sync-peer-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.sync-tok {
  font-size: 11px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sync-peer-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 4px; }
.sync-vs { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; }
.sync-logs { display: flex; flex-direction: column; font-size: 12px; }
.sync-log-head, .sync-log-row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) 132px 96px; gap: 8px; padding: 6px 0;
}
.sync-log-head { color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.sync-log-row { border-bottom: 1px dashed var(--line); }
.sync-log-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-log-row .ok { color: var(--ok); }
.sync-log-row .bad { color: var(--danger); }
@media (max-width: 760px) {
  .sync-form-row { grid-template-columns: 1fr; }
  .sync-log-head, .sync-log-row { grid-template-columns: 1fr 1fr; }
  .sync-row { flex-direction: column; }
  .sync-row-act { align-self: flex-end; }
}

/* ---------- 引用与移动端长内容（v1.19.0） ----------
   根因不是「气泡不够宽」，而是 flex 子项的自动最小宽度：
   .msg 是 flex 容器，子项默认 min-width:auto（= max-content），
   一条没有空格的超长串（URL、订单号、连续英文）会把子项撑到内容宽度，
   气泡就顶出容器，窄屏上直接变成横向滚动。给子项 min-width:0 才是解法，
   再配 overflow-wrap:anywhere 让长串能断在任意字符处。 */
.msg { min-width: 0; }
.msg > div { min-width: 0; max-width: 100%; }
.msg .bubble { max-width: 100%; overflow-wrap: anywhere; }
.chat-body { overflow-x: hidden; }
/* 引用块：整块限宽 + 两行截断，发送者名字过长也不许撑破 */
.quote-ref { max-width: 100%; overflow: hidden; }
.quote-ref b {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quote-ref span { overflow-wrap: anywhere; word-break: break-word; }
.msg .bubble .file-card { max-width: 100%; }
.msg .bubble pre { max-width: 100%; overflow-x: auto; }
.msg .bubble code { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  /* 窄屏多留一点宽度：左右边距本身已经很挤，86% 会让长消息变成「窄高条」 */
  .msg { max-width: 92%; }
  .msg.sys { max-width: 96%; }
}

/* ---------- 主页快捷导航（v1.21.3） ---------- */
.quick-nav {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.qn-item {
  display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); cursor: pointer; transition: 0.18s; text-decoration: none; color: inherit;
}
.qn-item b { display: block; font-size: 13px; margin-bottom: 3px; color: var(--text); }
.qn-item span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.qn-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
/* WxPusher 教程列表 */
.tut-list { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; line-height: 1.9; color: var(--text-2); }
.tut-list code { font-size: 11.5px; padding: 1px 4px; border-radius: 4px; background: var(--panel-3); }

/* ---- 宽表在窄屏的处理（v1.21.5） ----
   账号管理 8 列、服务统计 10 列。之前窄屏只有「缩小字号」这一条路，
   结果列挤成一坨没法读，操作按钮还被压成两行。现在给容器横向滚动、
   单元格 nowrap：手机上左右滑一下就能看全，列宽该多宽就多宽。 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.table-scroll .table td:last-child .btn { white-space: nowrap; }

@media (max-width: 900px) {
  .table-scroll { padding-left: 10px; padding-right: 10px; }
  .table-scroll .table { min-width: 780px; }
  .table-scroll .table th,
  .table-scroll .table td { padding: 11px 9px; white-space: nowrap; }
  /* 搜索框固定 230px：手机上要么把工具栏顶到第二行，要么把自己压成一条线 */
  .page .search { flex: 1 1 180px; min-width: 140px; }
  .page .search input { width: 100%; }
}

@media (max-width: 560px) {
  .page { padding: 16px 14px 24px; }
  .table-scroll .table { min-width: 720px; font-size: 12.5px; }
  .table-scroll .table th,
  .table-scroll .table td { padding: 10px 8px; }
  .toolbar { gap: 8px; }
  .toolbar .btn { font-size: 12.5px; padding: 8px 12px; }
  .seg button { padding: 6px 10px; font-size: 12px; }
}

/* ===== 无顶栏控制台：所有全局操作归入左侧导航 ===== */
.sidebar {
  position: relative;
  z-index: 100;
  height: 100vh;
  height: 100dvh;
}
.sidebar .nav { flex: 1 1 auto; min-height: 0; }
.main { height: 100vh; height: 100dvh; overflow: hidden; }
.side-current {
  margin: 0 4px 10px;
  padding: 10px 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  min-width: 0;
}
.side-current span,
.side-current small { display: block; color: var(--muted-2); }
.side-current span { margin-bottom: 4px; font-size: 9.5px; letter-spacing: .08em; }
.side-current b { display: block; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.side-current small { margin-top: 3px; overflow: hidden; font-size: 10.5px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.side-tools {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
  padding: 10px 4px 0;
  border-top: 1px solid var(--line);
}
.side-tools-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.side-tools-row > .btn { flex: 1 1 auto; min-width: 0; padding-inline: 8px; }
.side-tools-theme .theme-switch { width: 100%; justify-content: center; }
.side-tool-wide { width: 100%; justify-content: center; }
.side-tools .conn,
.side-tools .sv-pill { min-width: 0; padding: 5px 8px; }
.side-tools .conn { flex: 1 1 auto; }
.side-tools .conn span,
.side-tools .sv-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-tools .notify-panel { top: auto; right: auto; bottom: calc(100% + 8px); left: 0; }
.sidebar-trigger,
.sidebar-scrim { display: none; }
.sidebar-trigger-icon,
.sidebar-trigger-icon::before,
.sidebar-trigger-icon::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.sidebar-trigger-icon { position: relative; }
.sidebar-trigger-icon::before,
.sidebar-trigger-icon::after { content: ''; position: absolute; left: 0; }
.sidebar-trigger-icon::before { top: -5px; }
.sidebar-trigger-icon::after { top: 5px; }

@media (min-width: 861px) and (max-width: 1180px) {
  .sidebar { width: 184px; flex-basis: 184px; align-items: stretch; padding: 14px 10px; }
  .brand { justify-content: flex-start; padding: 2px 4px 12px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-txt { display: block; }
  .side-current { display: block; }
  .nav { overflow-y: auto; }
  .nav-item { justify-content: flex-start; gap: 8px; padding: 0 9px; }
  .nav-item > span:not(.nav-ic) { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .nav-item:hover::after { content: none; }
  .side-tools { display: flex; }
  .side-foot { display: block; }
  .side-user { padding: 5px; gap: 7px; }
  .side-user > div:not(.avatar) { display: block; overflow: hidden; }
  .side-user #logoutBtn { display: inline-flex; }
}

@media (max-width: 860px) {
  .app { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    max-width: 320px;
    padding: max(16px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    border-right: 1px solid var(--line-2);
    border-bottom: 0;
    box-shadow: 18px 0 44px rgba(0, 0, 0, .32);
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .brand { padding: 0 4px 14px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-txt { display: block; }
  .side-current { display: block; }
  .nav {
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .nav-item { flex: 0 0 40px; height: 40px; padding: 0 11px; font-size: 13px; gap: 10px; }
  .nav-item .nav-ic,
  .nav-item .nav-ic svg { width: 17px; height: 17px; }
  .side-tools { display: flex; flex: 0 0 auto; }
  .side-tools .notify-panel { position: fixed; top: 12px; right: 12px; bottom: auto; left: 12px; }
  .side-foot { display: block; flex: 0 0 auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .side-user { padding: 5px; gap: 8px; }
  .side-user > div:not(.avatar) { display: block; overflow: hidden; }
  .side-user .avatar { width: 30px; height: 30px; }
  .main { width: 100%; height: 100vh; height: 100dvh; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    border: 0;
    background: rgba(4, 9, 18, .58);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .app.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar-trigger {
    display: inline-flex;
    position: fixed;
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 85;
    min-width: 76px;
    height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: var(--shadow);
    font: 600 12.5px var(--font);
  }
  .plan-alert { border-top: 0; }
  #fxBtn { display: inline-flex; }
  #goH5, #soundBtn { width: auto; padding: 0 8px; font-size: 12px; }
  #goH5::before, #soundBtn::before { content: none; }
}

/* 客户端更新 */
.client-release-toolbar .filter-sel { min-width: 138px; }
.client-release-summary { font-size: 12.5px; }
#page-client-releases .table { min-width: 1080px; }
#page-client-releases .table th:nth-child(1) { width: 110px; }
#page-client-releases .table th:nth-child(2) { width: 180px; }
#page-client-releases .table th:nth-child(3) { width: 160px; }
#page-client-releases .table th:nth-child(4) { width: 160px; }
#page-client-releases .table th:nth-child(5) { min-width: 260px; }
#page-client-releases .table th:nth-child(6) { width: 180px; }
#page-client-releases .table th:nth-child(7) { width: 260px; text-align: right; }
.client-release-channel { margin-top: 4px; font-size: 11.5px; }
.client-release-version { font-weight: 600; }
.client-release-notes {
  max-width: 240px;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-release-link {
  max-width: 320px;
  overflow: hidden;
  color: var(--accent);
  font: 11.5px/1.6 var(--mono, monospace);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-release-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.client-release-time { white-space: nowrap; }
.client-release-actions { flex-wrap: wrap; justify-content: flex-end; }
.client-release-inspect-row { display: flex; align-items: stretch; gap: 8px; }
.client-release-inspect-row input { min-width: 0; flex: 1; }
.client-release-inspect-row .btn { flex: 0 0 auto; min-width: 88px; }
.client-release-inspect-status { min-height: 18px; margin-top: 6px; font-size: 11.5px; line-height: 1.5; }
.client-release-inspect-status.pending { color: var(--warn); }
.client-release-inspect-status.loading { color: var(--accent); }
.client-release-inspect-status.success { color: var(--ok); }
.client-release-inspect-status.error { color: var(--danger); }
.client-release-switches { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 2px; }
.client-release-published { margin: 14px 0 0; font-size: 11.5px; }
.client-release-error { color: var(--danger); }

@media (max-width: 860px) {
  .client-release-toolbar .filter-sel { flex: 1 1 150px; min-width: 0; }
  .client-release-summary { flex: 1 1 100%; order: 3; }
  #page-client-releases .table { min-width: 1030px; }
}

@media (max-width: 560px) {
  .client-release-toolbar .spacer { display: none; }
  .client-release-toolbar .btn { flex: 1 1 calc(50% - 4px); }
  .client-release-inspect-row { align-items: stretch; flex-direction: column; }
  .client-release-inspect-row .btn { width: 100%; }
  .client-release-switches { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .sidebar, .sidebar-scrim { transition: none !important; }
  .theme-dot:hover, .nav-item:hover, .btn:hover, .sv-pill:hover { transform: none !important; }
  .sv-pill.bad i, .sv-dot.bad, .sv-hero.bad .sv-dot, .msg.hl .bubble { animation: none !important; }
}

/* ---------------------------------------------------------------------------
   访客显示名（v1.29.0）

   编号化的匿名访客名字比「访客zajj」短，但商户可以自定前缀、站点名可能很长，
   所以列表项与聊天头都必须能截断。头像里放编号时字号要压小一点，
   否则三位数字在 32px 圆里会顶到边。
--------------------------------------------------------------------------- */

/* 头像里显示编号（而不是首字「访」）：三位数字要更小的字号与等宽字形，
   列表滚动时同一列的编号才对齐。 */
.avatar.is-num {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   群聊标识（v1.31.0）

   群会话复用访客会话的渲染路径，头像、名字、时间戳位置完全一样，只有这里的
   一点点配色差异能让客服在长列表里快速认出「这是群」。字号沿用编号头像的
   小号，避免「群」字在 32px 圆里显得比旁边的名字还抢眼。
--------------------------------------------------------------------------- */

.avatar.is-group {
  font-size: 12px;
  font-weight: 700;
  background: rgba(14, 165, 164, 0.14);
  color: var(--accent-2);
  border-color: rgba(14, 165, 164, 0.3);
}

.conv-tag.tag-chatgroup {
  color: var(--accent-2);
  border-color: rgba(14, 165, 164, 0.32);
  background: rgba(14, 165, 164, 0.08);
}

/* 聊天头标题：昵称 + 状态徽章 + 进度徽章，昵称过长时只压缩昵称这一段 */
.chat-head h3 { min-width: 0; }
.chat-head-txt { min-width: 0; }
#chatTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 后台设置页的「会话列表里长这样」预览：模拟真实列表项的排布，
   而不是干巴巴一行文字——商户改完前缀能一眼看出会不会被截断 */
.vname-preview {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin: 4px 0 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.vname-preview .vp-label { font-size: 11.5px; color: var(--muted-2); flex: 0 0 auto; }
.vname-preview .vp-list { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.vname-preview .vp-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px 4px 4px; max-width: 100%;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.vname-preview .vp-av {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.vname-preview .vp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 额度提示条（v1.35.0） ----------------
 * 用于「自动回复 / 离线回复条数已满」这类需要引导升级的场合。
 * 单独一个类而不是复用 .tip：这是要让人看见的（明黄底 + 边框），
 * 和字段下方那种小灰字提示不是一回事。 */
.quota-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.32);
  background: rgba(217, 119, 6, 0.08);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
}
.quota-tip b { color: #b45309; }
.quota-tip .btn { margin-left: auto; }
.quota-tip.is-ok {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}
.quota-tip.is-ok b { color: var(--text); }

/* ================= v1.36.0 ================= */

/* ---- 侧栏：行距拉开 + 金色光幕 ---- */
/* 原来 gap 3px / 行高 40px，二十来个菜单项挤成一坨，手机上点错的概率很高。
   放宽到 6px / 46px 之后，三端侧栏的节奏一致，也更好按。
   移动端的 44px 写在 mobile.css 里（它最后加载），不在这里重复。 */
.nav { gap: 6px; }
.nav-item {
  height: 46px;
  position: relative;
  overflow: hidden;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
/* 点击时一道金色光幕从左扫到右。用伪元素 + transform 而不是背景动画：
   只触发合成层，不会让整个侧栏重排。 */
.nav-item.nav-flash::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg,
    rgba(255, 214, 102, 0) 0%,
    rgba(255, 214, 102, 0) 28%,
    rgba(255, 226, 150, 0.55) 46%,
    rgba(255, 248, 214, 0.85) 50%,
    rgba(255, 226, 150, 0.55) 54%,
    rgba(255, 214, 102, 0) 72%,
    rgba(255, 214, 102, 0) 100%);
  transform: translateX(-130%);
  animation: navGoldSweep 0.72s cubic-bezier(0.3, 0.7, 0.3, 1) forwards;
}
@keyframes navGoldSweep {
  to { transform: translateX(130%); }
}
/* 当前所在页给一条金色竖条：光幕是一瞬间的，位置感需要常驻信号 */
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 3px; height: 20px;
  margin-top: -10px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #ffd666, #f5a623);
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.55);
}

/* ---- 超管：群聊管理 ---- */
.agc-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.agc-stat {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.agc-stat b { font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.agc-stat span { font-size: 11.5px; color: var(--muted); }
.agc-stat.on b { color: var(--ok, #16a34a); }
.agc-stat.off b { color: var(--danger); }

.agc-detail { display: flex; flex-direction: column; gap: 16px; }
.agc-facts {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--panel-2);
}
.agc-facts b { color: var(--text); font-weight: 600; }
.agc-sec h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.agc-members { display: flex; flex-wrap: wrap; gap: 6px; }
.agc-member {
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: var(--accent-soft); color: var(--text);
}
.agc-msgs {
  max-height: 46vh; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px;
}
.agc-msg { padding: 7px 9px; border-radius: 8px; }
.agc-msg:nth-child(odd) { background: var(--panel-2); }
.agc-msg-h { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.agc-msg-h b { color: var(--text); font-weight: 600; font-size: 12px; }
.agc-msg-h i { margin-left: auto; font-style: normal; font-size: 11px; }
.agc-msg-b { font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; margin-top: 3px; }

/* ---------------- 会话监控 · 群聊分类汇总条（v1.36.0） ----------------
 * 只在实际切到「群聊」时出现，所以不占常态布局。
 * 用 flex + 竖分隔线而不是独立的卡片：这一条是「上下文信息」，
 * 做成卡片会和下面的会话列表抢视觉主角。 */
.mon-group-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0;
  padding: 8px 14px; margin: 0 0 2px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12px; color: var(--muted);
}
.mgb-cell {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 0 12px;
  border-right: 1px solid var(--line);
}
.mgb-cell:first-child { padding-left: 0; }
.mgb-cell b { font-size: 14px; font-weight: 700; color: var(--text); }
.mgb-cell.ok b { color: var(--ok, #16a34a); }
.mgb-cell.warn b { color: var(--danger); }
.mgb-loading { padding: 0 2px; }
.mgb-more { margin-left: auto; }
@media (max-width: 720px) {
  /* 手机上横排六个数字会挤成两行还看不清，改成自动换行但保留分隔线 */
  .mon-group-bar { gap: 6px 0; padding: 8px 10px; }
  .mgb-cell { padding: 0 9px; }
  .mgb-cell b { font-size: 13px; }
  .mgb-more { margin-left: 0; }
}

/* ==================== 套餐炫彩（v1.37.0） ====================
   等级由服务端按「价格从低到高」的名次算好（0 = 免费 / 未分配，1..6）：
   1 星辉（银蓝）→ 2 碧光（青）→ 3 鎏金（金）→ 4 幻紫 → 5 极光 → 6 七彩。
   规则只有一条：**越高级，流光越亮、扫动越快**。运营改价后等级自动重排，
   不需要谁去维护第二个字段。

   实现上全部走「两层背景」的渐变描边（padding-box 铺底色 + border-box 铺渐变），
   不用伪元素、不用 mask —— 后者在部分安卓 WebView 上会吃掉圆角。
   颜色一律取半透明/中间调，亮色与暗色两套主题共用。 */

[data-tier="1"] { --t-c1: #6f9dff; --t-c2: #cfe0ff; --t-glow: rgba(111, 157, 255, .30); }
[data-tier="2"] { --t-c1: #1fb3aa; --t-c2: #a6efe7; --t-glow: rgba(31, 179, 170, .28); }
[data-tier="3"] { --t-c1: #d29a12; --t-c2: #ffe4a0; --t-glow: rgba(210, 154, 18, .32); }
[data-tier="4"] { --t-c1: #b157d4; --t-c2: #ffc6ee; --t-glow: rgba(177, 87, 212, .30); }
[data-tier="5"] { --t-c1: #4f63ef; --t-c2: #46d5ff; --t-glow: rgba(79, 99, 239, .34); }
[data-tier="6"] { --t-c1: #ff5f6d; --t-c2: #b16bff; --t-glow: rgba(255, 95, 109, .34); }

/* 侧栏套餐徽章：登录后第一屏就要能看到自己在哪一档 */
.tier-chip {
  display: flex; align-items: center; gap: 8px;
  margin: 0 14px 10px; padding: 8px 11px;
  border: 1px solid transparent; border-radius: 11px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--text-2); min-width: 0;
  background:
    linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    linear-gradient(120deg, var(--t-c1), var(--t-c2), var(--t-c1)) border-box;
  background-size: auto, 240% 100%;
  animation: tierFlow 14s linear infinite;
}
.tier-chip[hidden] { display: none; }
.tier-chip .tier-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--t-c1), var(--t-c2));
  box-shadow: 0 0 0 2px var(--t-glow);
}
.tier-chip span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 套餐名后面的小标签 */
.tier-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 8px; border-radius: 999px; vertical-align: middle;
  font-size: 10.5px; font-weight: 700; line-height: 1.7; white-space: nowrap;
  color: var(--t-c1);
  background: var(--panel-3);
  border: 1px solid var(--t-c1);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .tier-badge {
    background: color-mix(in srgb, var(--t-c1) 12%, var(--panel));
    border-color: color-mix(in srgb, var(--t-c1) 36%, transparent);
  }
}

/* 套餐卡：渐变描边 + 缓慢扫光，等级越高越快 */
.plan-card[data-tier],
.plan-now-card[data-tier] {
  border-color: transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(120deg, var(--t-c1), var(--t-c2), var(--t-c1)) border-box;
  background-size: auto, 240% 100%;
  animation: tierFlow 16s linear infinite;
}
.plan-card[data-tier="2"], .plan-now-card[data-tier="2"] { animation-duration: 14s; }
.plan-card[data-tier="3"], .plan-now-card[data-tier="3"] { animation-duration: 12s; }
.plan-card[data-tier="4"], .plan-now-card[data-tier="4"] { animation-duration: 10s; }
.plan-card[data-tier="5"], .plan-now-card[data-tier="5"] { animation-duration: 8s; }
.plan-card[data-tier="6"], .plan-now-card[data-tier="6"] { animation-duration: 5.5s; }

/* 高档位补一层外发光：卡片从背景里「浮」出来，不用点开也知道这是贵的那档 */
.plan-card[data-tier="4"], .plan-now-card[data-tier="4"] { box-shadow: 0 10px 26px -18px var(--t-glow); }
.plan-card[data-tier="5"], .plan-now-card[data-tier="5"] { box-shadow: 0 12px 30px -16px var(--t-glow); }
.plan-card[data-tier="6"], .plan-now-card[data-tier="6"] { box-shadow: 0 14px 34px -14px var(--t-glow), 0 0 0 1px var(--t-glow); }

/* 最高两档的套餐名走渐变字（星河 / 七彩），其它档位保持纯色 —— 全都渐变会糊成一片 */
.plan-price[data-tier="5"],
.plan-price[data-tier="6"] {
  background: linear-gradient(120deg, var(--t-c1), var(--t-c2), var(--t-c1));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tierText 9s linear infinite;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .plan-price[data-tier="5"], .plan-price[data-tier="6"] { color: var(--t-c1); }
}

@keyframes tierFlow {
  from { background-position: 0 0, 0% 50%; }
  to   { background-position: 0 0, 240% 50%; }
}
@keyframes tierText {
  from { background-position: 0% 50%; }
  to   { background-position: 220% 50%; }
}

/* 无障碍：系统开了「减少动态效果」就停扫光，只留静态渐变描边。
   价格与套餐名必须一直能看清，不能因为动效把字扫没。 */
@media (prefers-reduced-motion: reduce) {
  .tier-chip,
  .plan-card[data-tier],
  .plan-now-card[data-tier],
  .plan-price[data-tier="5"],
  .plan-price[data-tier="6"] { animation: none; }
}

/* ===== 选项卡片：带说明的单选（v1.37.1） =====
   用途：「一键清空公告」这类需要选一个范围、每个范围还要解释后果的地方。
   以前的写法是 .field > label 里塞 display:flex 的 input + span，
   但 .field > label 本身是「输入框上方的小字标签」（12px / muted），
   两套排版叠在一起，圆点与两行文字对不齐，长说明还会把第二行顶到圆点下面。
   这里改成独立组件：网格布局，圆点固定在左上，标题与说明各自成行。 */
.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px 11px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.pick-item:hover { border-color: var(--line-2); }
.pick-item input[type="radio"] {
  /* 原生圆点在某些安卓 WebView 里有 4px 基线偏移，这里统一自绘 */
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.pick-item input[type="radio"]:checked {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent);
}
.pick-item.is-on { border-color: var(--accent); background: var(--accent-soft); }
.pick-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.pick-count {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  white-space: nowrap;
}
.pick-item.is-on .pick-count { background: var(--panel); color: var(--accent); }
.pick-desc {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  word-break: break-word;
}
.pick-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.7;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--text-2);
  margin-bottom: 14px;
}
.pick-note b { color: var(--danger); }
@media (max-width: 520px) {
  .pick-item { padding: 11px 12px; }
  .pick-title { font-size: 13px; }
}

/* App 下载（v1.45.0）：商户端一屏看完版本信息与两个动作 */
.app-dl-lead { font-size: 12.5px; line-height: 1.8; margin: 0 0 4px; }
.app-dl-item {
  display: flex; gap: 16px; align-items: center; justify-content: space-between;
  padding: 16px; border: 1px solid var(--line, #e6e9f0); border-radius: 12px;
}
.app-dl-item + .app-dl-item { margin-top: 12px; }
.app-dl-logo { width: 48px; height: 48px; flex: 0 0 48px; object-fit: cover; border-radius: 8px; }
.app-dl-main { min-width: 0; flex: 1 1 auto; }
.app-dl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.app-dl-head b { font-size: 15px; }
.app-dl-ver { font-size: 12.5px; color: var(--text-2, #5b6472); }
.app-dl-hint { font-size: 12.5px; margin-top: 4px; }
.app-dl-notes {
  margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--text-2, #5b6472);
  white-space: pre-wrap; word-break: break-word; max-height: 4.8em; overflow: auto;
}
.app-dl-acts { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.app-dl-steps {
  margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.9;
  color: var(--text-2, #5b6472);
}
.app-dl-steps li { margin-bottom: 4px; }
.app-dl-tip { font-size: 12px; margin: 12px 0 0; }
@media (max-width: 640px) {
  .app-dl-item { flex-direction: column; align-items: stretch; }
  .app-dl-acts .btn { flex: 1 1 calc(50% - 4px); }
}

/* 超管客户端更新页的「与商户下载中心联动」提示（v1.45.0） */
.client-release-hint {
  margin: -2px 0 12px; font-size: 12.5px; line-height: 1.8;
}

/* ---- 回复中心（v1.46.0） ---- */
.reply-hint {
  margin: -2px 0 14px; font-size: 12.5px; line-height: 1.85; color: var(--muted);
}
.reply-hint code {
  padding: 1px 5px; border-radius: 5px; font-size: 11.5px;
  background: var(--panel-3); color: var(--text-2);
}
.reply-list { display: flex; flex-direction: column; gap: 10px; }
.reply-card {
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); transition: 0.16s;
}
.reply-card:hover { border-color: var(--line-2); }
.reply-card.off { opacity: 0.62; }
.reply-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.reply-head b {
  font-size: 13.5px; font-weight: 650; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-body {
  margin-top: 8px; font-size: 13px; line-height: 1.75; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.reply-body.clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.reply-meta {
  margin-top: 9px; display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted-2);
}
.reply-acts { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reply-kw { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.reply-kw i {
  font-style: normal; font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: var(--panel-3); color: var(--text-2);
}
.reply-empty { padding: 30px 10px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
@media (max-width: 640px) {
  .reply-card { padding: 12px; }
  .reply-acts > .btn { flex: 1 1 auto; justify-content: center; }
  .reply-acts .switch { flex: 1 1 100%; }
}

/* ---- 手机端公告浮层（v1.46.0） ----
   侧栏在手机上是 translateX 定位 + overflow:hidden 的抽屉，
   面板留在抽屉里会被祖先 transform 变成「相对抽屉定位」并被裁切，
   所以窄屏时由 app.js 把它挂到 body 上，按视口做底部浮层。 */
.notify-panel .np-close { display: none; }
@media (max-width: 860px) {
  .notify-panel.floating {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-width: none;
    max-height: min(72vh, 560px);
    padding: 10px 10px calc(14px + env(safe-area-inset-bottom));
    border-radius: 18px;
    z-index: 320;
    box-shadow: 0 18px 52px rgba(4, 9, 18, 0.36);
  }
  .notify-panel.floating .np-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--line-2); background: var(--panel-2);
    color: var(--muted); font: 600 16px/1 var(--font);
  }
  .notify-panel.floating .np-item { padding: 12px; }
}

/* ===== 启动态（v1.47.3）=====
   三端 index.html 的 head 里有一段同步脚本：发现本地有登录票据就先给 <html>
   挂 data-booting。此时登录页与主界面都不渲染，只留一个背景色 + 延迟出现的
   spinner，等 /auth/me 回来再由 app.js 摘掉属性。目的是刷新时不再闪一下登录页。
   没有票据时不挂属性，登录页照常首帧显示；内联脚本没执行（JS 被禁）时同样
   不挂属性，天然降级回原来的行为。 */
#bootSplash { display: none; }
html[data-booting] #authScreen,
html[data-booting] #app { display: none !important; }
html[data-booting] body { background: var(--bg, #f4f7fc); }
html[data-booting] #bootSplash {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.boot-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-2, rgba(20, 32, 56, 0.14));
  border-top-color: var(--accent, #4f6ef7);
  opacity: 0;
  /* 加载够快（<150ms）时 spinner 根本不出现，避免自己再闪一下 */
  animation: bootSpin 0.72s linear infinite, bootFade 0.18s ease 0.15s forwards;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
@keyframes bootFade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .boot-spin { animation: bootFade 0.18s ease 0.15s forwards; }
}
