:root {
  --primary: #1a5cf0;
  --primary-dark: #0f47cc;
  --primary-soft: #eaf1ff;
  --accent: #ff8a1f;
  --accent-dark: #d96f0c;
  --accent-soft: #fff4e8;
  --bg: #f4f7fd;
  --card: #ffffff;
  --text: #1b2233;
  --muted: #79839b;
  --border: #e4e9f4;
  --danger: #e5484d;
  --warn: #e6a23c;
  --ok: #2fa84f;
  --shadow: 0 6px 24px rgba(26, 60, 140, .07);
  /* 控件统一规格：全站按钮 / 输入框 / 下拉框 同一高度、同一左右内边距 */
  --ctl-h: 36px;
  --ctl-px: 10px;
  --ctl-fs: 13.5px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.view { min-height: 100vh; }
/* 主应用：顶栏 + 页面区纵向排布（顶栏高度自适应，手机上会折成两行） */
#view-app { flex-direction: column; }

/* ---------- 登录 ---------- */
#view-login, #view-denied, #view-loading {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(26,92,240,.13), transparent 60%),
    radial-gradient(760px 380px at 92% 108%, rgba(255,138,31,.16), transparent 62%),
    var(--bg);
}
/* 启动恢复登录态的过渡卡片 */
.boot-card .login-sub { margin-bottom: 18px; }
.boot-spinner {
  width: 30px; height: 30px; margin: 0 auto; border-radius: 50%;
  border: 3px solid #e6edfb; border-top-color: var(--primary);
  animation: bootSpin .8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
/* 登录/注册按钮的加载反馈：按钮内显示小转圈 + 文案，禁用态防重复提交 */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px;
  margin: -9px 0 0 -9px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  animation: bootSpin .7s linear infinite;
}
.btn.is-loading::before {
  content: attr(data-loading-text); position: absolute; left: calc(50% + 16px); top: 50%;
  transform: translateY(-50%); color: #fff; font-size: 14px; white-space: nowrap;
}
.btn.is-loading[data-loading-text=""]::before { display: none; }
.login-card {
  position: relative; overflow: hidden;
  width: 400px; max-width: 100%; background: var(--card); border-radius: 18px;
  padding: 38px 32px; box-shadow: 0 18px 44px rgba(20, 40, 90, .12); text-align: center;
}
.login-card::before {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--primary), #5a9bff 48%, var(--accent));
}
.login-logo {
  width: 66px; height: 66px; margin: 0 auto; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #4d8dff); color: #fff;
  font-size: 21px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 24px rgba(26, 92, 240, .28);
}
/* 登录页品牌标（透明底 AVC 字标，原图配色） */
.login-logo-img {
  display: block; width: 86px; height: auto; margin: 2px auto 12px;
  object-fit: contain;
}
/* 侧栏 / 欢迎页同款字标 */
.brand-logo-img {
  width: 52px; height: auto; flex-shrink: 0; object-fit: contain;
}
.hero-avatar-img {
  width: 74px; height: auto; flex-shrink: 0; object-fit: contain; margin-top: 6px;
}
.denied-card .login-logo {
  background: linear-gradient(135deg, #ffb264, var(--accent));
  box-shadow: 0 12px 24px rgba(255, 138, 31, .28); font-size: 26px;
}
.login-card h1 { font-size: 22px; margin: 8px 0 4px; }
.login-sub { color: var(--muted); margin-bottom: 20px; }
.login-note { color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.7; }
.denied-card h2 { margin: 8px 0 10px; }
.denied-card p { color: var(--muted); margin-bottom: 20px; line-height: 1.7; }

.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  flex: 1; height: var(--ctl-h); padding: 0 var(--ctl-px); background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; line-height: 1;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

label { display: block; text-align: left; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
/* 单行控件（input / select）统一高度与内边距；textarea 只统一左右内边距，高度按行数自适应 */
input, select {
  width: 100%; height: var(--ctl-h); margin-top: 6px; padding: 0 var(--ctl-px);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: var(--ctl-fs); font-family: inherit; background: #fbfcfe; color: var(--text);
}
textarea {
  width: 100%; margin-top: 6px; padding: 9px var(--ctl-px);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: var(--ctl-fs); line-height: 1.6; font-family: inherit;
  background: #fbfcfe; color: var(--text); resize: vertical;
}
/* 下拉框：抹掉系统箭头，换成统一的内联 SVG 折线箭头。
   系统箭头默认贴着右边框（视觉上"太靠右"），且各浏览器位置不一致；
   这里固定 right 12px、图标 11×7，右侧留 32px 内边距给箭头让位。 */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 32px; cursor: pointer;
  background-color: #fbfcfe;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.2 1.6 6 6.2l4.8-4.6' fill='none' stroke='%2379839b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px 7px;
  text-overflow: ellipsis;
}
select:hover { border-color: #c8d4e8; }
select:disabled { opacity: .6; cursor: not-allowed; }
select[multiple] { padding-right: var(--ctl-px); background-image: none; }
input[type="checkbox"], input[type="radio"] {
  width: 15px; height: 15px; padding: 0; margin-top: 0; accent-color: var(--primary);
}
/* 文件选择框：外框同高，内部浏览器原生按钮也收成统一尺寸 */
input[type="file"] { padding: 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1; }
input[type="file"]::file-selector-button {
  height: 26px; margin: 0 8px 0 0; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  color: var(--text); font-family: inherit; font-size: 12.5px; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); color: var(--accent-dark); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,92,240,.1); }
.code-row { display: flex; gap: 10px; align-items: flex-end; }
.code-row .btn { white-space: nowrap; margin-bottom: 0; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; text-align: left; margin-bottom: 8px; }

/* 所有按钮同一高度、同一左右内边距（--ctl-h / --ctl-px），图标按钮只改宽度 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--ctl-h); min-height: var(--ctl-h); padding: 0 var(--ctl-px);
  box-sizing: border-box; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer; font-size: var(--ctl-fs); line-height: 1; color: var(--text); transition: .16s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3d84ff);
  border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(26,92,240,.24);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #2f74ee); color: #fff; }
.btn-ghost { border: none; background: none; color: var(--muted); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
/* 小号只缩字号，不再改高度和内边距，避免一行里高低不齐 */
.btn-sm { font-size: 13px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 62px; flex: 0 0 auto;
  background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 12px rgba(26, 60, 140, .04);
}
/* 顶栏品牌：logo + 名称 + 副标题 */
.topbar-title { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.topbar-logo { width: 46px; height: auto; flex-shrink: 0; object-fit: contain; }
.topbar-brand { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.topbar-brand strong { font-size: 15px; font-weight: 700; letter-spacing: .3px; color: var(--text); }
.topbar-sub { font-size: 11.5px; color: var(--muted); }
/* 两段导航：员工导航紧跟品牌靠左，管理导航与用户区一起贴到右侧 */
.topbar-nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 0; flex: 1 1 auto; min-width: 0; }
.topbar-nav { display: flex; gap: 0; flex: 0 1 auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  display: inline-flex; align-items: center;
  height: var(--ctl-h); padding: 0 var(--ctl-px); border: none; background: none; cursor: pointer; border-radius: 8px;
  color: var(--muted); font-size: var(--ctl-fs); line-height: 1; transition: .16s; white-space: nowrap;
}
.nav-btn:hover { background: var(--accent-soft); color: var(--accent-dark); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
/* 导航上的「待处理」数字徽标 */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1; font-style: normal; vertical-align: 1px;
}
.count-hint { margin-left: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.topbar-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
/* 顶栏姓名只做展示（姓名/部门由管理员在白名单维护），不再可点改 */
.user-name { cursor: default; }
.role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark);
}

@media (max-width: 1400px) {
  .topbar-sub { display: none; }
  .nav-btn { font-size: 12.5px; }
}

/* ---------- 布局 ---------- */
.pane { height: calc(100vh - 62px); overflow: hidden; }
.panel { max-width: 980px; margin: 0 auto; padding: 24px 20px; height: 100%; overflow-y: auto; }
.panel h2 { font-size: 18px; margin-bottom: 4px; }
.panel h3 { font-size: 15px; margin: 20px 0 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* 下拉框和按钮统一成同一高度/字号/圆角（全站统一走 --ctl-h / --ctl-px） */
.filter-row select,
.filter-row input,
.filter-row .btn {
  height: var(--ctl-h); min-height: var(--ctl-h); margin-top: 0;
  padding: 0 var(--ctl-px); font-size: var(--ctl-fs); line-height: 1; border-radius: 8px;
}
.filter-row select { width: auto; min-width: 104px; padding-right: 32px; }
/* 预警页：部门筛选 + 条数提示（提示吃掉中间空白，按钮仍靠右） */
.filter-row #alert-dept { min-width: 132px; }
.alert-count { flex: 1 1 auto; font-size: 12.5px; text-align: right; white-space: nowrap; }
.filter-row input { width: auto; }
.filter-row .btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.filter-row .btn-sm { height: var(--ctl-h); padding: 0 var(--ctl-px); font-size: 13px; }
/* 制度库标题旁的总量：标题字号里不能跟着变 18px，压成小号灰字 */
.panel-head h2 .policy-count { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.policy-sort-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; margin-bottom: 0; line-height: 1; }
/* 制度名称筛选框：和旁边的下拉、按钮同一行同高，不撑开工具条 */
.filter-row #policy-search {
  width: 190px; min-width: 150px; max-width: 100%;
  background: #fff;
}
.filter-row #btn-policy-search-clear { flex: 0 0 auto; }
/* 「排序」标签 + 下拉固定成一组：屏幕窄换行时一起走，不会只剩标签单独一行 */
.policy-sort-group {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 1 auto; min-width: 0;
}
.policy-sort-group select { margin-top: 0; width: auto; min-width: 118px; flex: 0 1 auto; }
.muted { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
/* 行内提示（#rank-sync-tip / #dept-rank-tip 等）是 span，不是段落：不占段落间距，
   否则在 flex 工具条里会被 12px 下边距顶偏 */
span.muted { margin-bottom: 0; }

/* ---------- 侧边栏 ---------- */
.chat-pane { display: flex; }
.session-list {
  width: 275px; border-right: 1px solid var(--border); background: var(--card);
  overflow: hidden; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.side-scroll { flex: 1; overflow-y: auto; padding: 16px 12px 10px; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: #dfe5f2; border-radius: 3px; }

.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 14px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #4d8dff); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(26, 92, 240, .28);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-text strong { font-size: 14px; }
.brand-text em { font-size: 11px; color: var(--muted); font-style: normal; }

#btn-new-chat { margin-bottom: 16px; }

.side-section { margin-bottom: 14px; }
.side-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: #4b5670; letter-spacing: .3px;
  margin-bottom: 9px; padding-left: 8px; position: relative;
}
.side-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ffb264);
}

.side-policy-list { display: flex; flex-direction: column; gap: 8px; }
.side-policy {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  background: #fff; transition: .16s;
}
.side-policy:hover { border-color: #ffd7ae; background: #fffdfa; box-shadow: 0 4px 12px rgba(255, 138, 31, .1); }
.sp-title { font-size: 12.5px; font-weight: 600; line-height: 1.5; color: var(--text); }
.sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.sp-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #ffe2c4;
}
.sp-no { font-size: 10.5px; color: var(--muted); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
/* 知识库覆盖：纯展示，不响应点击 */
.cloud-tag {
  font-size: 11.5px; padding: 4px 9px; border-radius: 8px; cursor: default;
  background: var(--primary-soft); color: #2a55a8; border: 1px solid #d8e4ff;
  user-select: none;
}
.cloud-tag-empty { font-size: 12px; color: var(--muted); }

.side-section-sessions { margin-bottom: 12px; }
.session-item {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: #4b5670;
  margin-bottom: 3px; display: flex; align-items: center; gap: 6px;
}
.sp-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-del {
  flex-shrink: 0; width: 18px; height: 18px; border: none; border-radius: 50%;
  background: transparent; color: #b3bccc; font-size: 15px; line-height: 16px;
  cursor: pointer; opacity: .45; transition: .15s; padding: 0;
}
.session-item:hover .sp-del { opacity: 1; }
.sp-del:hover { background: #ffe9ec; color: #e5484d; }
.session-item:hover { background: var(--accent-soft); color: var(--accent-dark); }
.session-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.session-item.active .sp-del { opacity: .7; }

.side-footer {
  flex-shrink: 0;
  background: linear-gradient(180deg, #fbfcff, #fff 42%);
  border-top: 1px dashed var(--border);
  padding: 10px 16px 14px; font-size: 10.5px; line-height: 1.75; color: #9aa4ba;
}
.side-footer b { color: var(--accent-dark); font-weight: 600; }
/* 窄屏副本：宽屏用侧边栏底部那份，≤860px 用聊天区底部这份（样式见移动端适配段） */
.side-footer-mobile { display: none; }

/* ---------- 聊天 ---------- */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background:
  radial-gradient(760px 340px at 78% -12%, rgba(26,92,240,.055), transparent 62%),
  radial-gradient(680px 320px at 8% 104%, rgba(255,138,31,.06), transparent 62%),
  var(--bg);
}
.chat-messages { flex: 1; overflow-y: auto; padding: 26px 28px; }
.chat-messages.is-empty { display: flex; align-items: flex-start; justify-content: center; padding: 22px 28px 26px; }
.chat-messages.is-empty .hero { width: 100%; }
.msg { display: flex; margin-bottom: 18px; gap: 10px; }
.msg .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; font-size: 15px; background: var(--primary-soft);
  color: var(--primary); font-weight: 700;
}
.msg.ai .avatar { background: var(--accent-soft); color: var(--accent-dark); }
.msg .bubble {
  max-width: 72%; padding: 12px 15px; border-radius: 12px; line-height: 1.75;
  background: var(--card); border: 1px solid var(--border); word-break: break-word;
  box-shadow: 0 3px 12px rgba(26, 60, 140, .04);
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble {
  background: linear-gradient(135deg, var(--primary), #3d84ff); color: #fff;
  border-color: transparent; box-shadow: 0 6px 16px rgba(26,92,240,.22);
}
.msg .bubble strong { font-weight: 700; }
.disclaimer { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.msg.user .disclaimer { color: rgba(255,255,255,.85); }
/* 转人工提示条：只是「已生成工单、HR 会跟进」，不带警示意味，用浅绿而非橙色 */
.escalate-banner {
  background: #eefaf1; border: 1px solid #b8e5c6; color: #1f6b3c; padding: 12px 14px;
  border-radius: 10px; margin-bottom: 18px; line-height: 1.7;
}
.emergency-banner {
  background: #fdecec; border: 1px solid #f3b8ba; color: #a02020; padding: 12px 14px;
  border-radius: 10px; margin-bottom: 18px; line-height: 1.7; font-weight: 600;
}

/* ---------- 主区空状态 / 引导卡片 ---------- */
.hero {
  position: relative; overflow: hidden; max-width: 880px; margin: 0 auto;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border); border-radius: 18px; padding: 28px 30px 24px;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--primary), #6aa4ff 46%, var(--accent));
}
.hero-head { display: flex; gap: 16px; align-items: flex-start; }
.hero-avatar {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #4d8dff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 8px 18px rgba(26, 92, 240, .26);
}
.hero h2 { font-size: 21px; margin-bottom: 9px; letter-spacing: .3px; }
.hero p { color: var(--muted); line-height: 1.85; font-size: 13.5px; }
.hero-scope { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.scope-chip {
  font-size: 11.5px; padding: 3px 10px; border-radius: 10px;
  background: var(--primary-soft); color: #2a55a8; border: 1px solid #dde8ff;
}
.scope-chip.warm { background: var(--accent-soft); color: var(--accent-dark); border-color: #ffe2c4; }

/* 建议提问：标题 + 卡片 */
.suggest-title {
  display: flex; align-items: center; gap: 8px;
  margin: 24px 0 12px; font-size: 13.5px; font-weight: 700; color: #35405a; letter-spacing: .2px;
}
.suggest-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.suggest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 首页推荐问题：卡片式按钮，同样走 --ctl-h，长问题右侧省略号 */
.suggest-card {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  height: var(--ctl-h); padding: 0 38px 0 var(--ctl-px); border: 1px solid #e6ecf8; border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
  cursor: pointer; font-size: 13px; color: #2b3550;
  font-family: inherit; line-height: 1; transition: .18s; overflow: hidden;
}
.suggest-card > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-card::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); box-shadow: 0 0 0 3px rgba(26, 92, 240, .10);
}
.suggest-card::after {
  content: '›'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: #c2cee2; font-size: 18px; line-height: 1; transition: .18s;
}
.suggest-card:hover {
  border-color: #bcd4ff; background: #fff; color: var(--primary);
  box-shadow: 0 8px 20px rgba(26, 92, 240, .12); transform: translateY(-2px);
}
.suggest-card:hover::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 138, 31, .14); }
.suggest-card:hover::after { color: var(--primary); transform: translate(2px, -50%); }
.suggest-card:active { transform: translateY(0); }

.hero-steps {
  display: flex; gap: 14px; margin-top: 20px; padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.step { flex: 1; display: flex; gap: 9px; align-items: flex-start; }
.step-no {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-dark);
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.step b { display: block; font-size: 12.5px; margin-bottom: 2px; font-weight: 600; }
.step span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.chat-input-bar {
  border-top: 1px solid var(--border); background: var(--card); padding: 12px 22px 16px;
}
/* 输入框容器：文字与发送按钮同一个边框内 */
.chat-input-box {
  display: flex; align-items: flex-end; gap: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: #fbfcff;
  padding: 6px 10px 6px 14px; transition: .16s;
}
.chat-input-box:focus-within {
  border-color: #b9d0ff; background: #fff; box-shadow: 0 0 0 3px rgba(26, 92, 240, .08);
}
.chat-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; flex-shrink: 0; }
#chat-input {
  flex: 1; width: auto; margin: 0; padding: 8px 0; border: none; background: transparent;
  resize: none; box-shadow: none; font-size: 13.5px; line-height: 1.6;
}
#chat-input:focus { outline: none; box-shadow: none; background: transparent; border: none; }

/* ---------- 列表/卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 制度卡片的元信息：文档编号 · 字数 · 添加时间（年月日时分秒），日期与时间不被折行拆开 */
.policy-meta { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 640px) { .policy-meta { white-space: normal; } }
/* 时间戳整体不拆行：窄屏下整段换行，而不是把「日期 时分秒」切成两半 */
.dt { white-space: nowrap; }
.card-title { font-weight: 600; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 6px;
}
.tag.pending { background: var(--accent-soft); color: var(--accent-dark); }
.tag.processing { background: var(--primary-soft); color: var(--primary-dark); }
.tag.resolved { background: #e8f5ec; color: #20713a; }
.tag.emergency { background: #fdecec; color: #a02020; }
.card-body { color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.7; white-space: pre-wrap; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
/* 我的工单：顶部新增按钮 / 内联编辑框 / 每条工单的操作行 */
.ticket-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.ticket-new {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 14px;
}
.ticket-new textarea, .ticket-edit textarea {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px var(--ctl-px); font-size: var(--ctl-fs); font-family: inherit; color: var(--text);
  background: var(--bg, #fff); resize: vertical; line-height: 1.6;
}
.ticket-new textarea:focus, .ticket-edit textarea:focus { outline: none; border-color: var(--primary); }
.ticket-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ticket-edit { margin-top: 8px; }
.tag.closed { background: #eef0f3; color: #6b7280; }
.inline-form { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.inline-form input { width: 220px; margin-top: 0; }
.inline-form .btn { height: var(--ctl-h); padding: 0 var(--ctl-px); }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.stat {
  flex: 1; min-width: 130px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; text-align: center;
}
.stat .num { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; }

.alert-card { border-left: 4px solid var(--border); }
.alert-card.level-高 { border-left-color: var(--danger); }
.alert-card.level-中 { border-left-color: var(--warn); }
.alert-card.level-低 { border-left-color: var(--primary); }
.alert-status { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f0f2f7; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,25,50,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* 弹窗统一为「头 / 体 / 脚」三段：头和脚固定，只有中间内容滚动 */
.modal {
  position: relative;
  background: var(--card); border-radius: 14px; width: 480px; max-width: 100%;
  max-height: 90vh; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-wide { width: 680px; }
.modal-head {
  position: relative; flex: 0 0 auto;
  padding: 20px 56px 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--card); border-radius: 14px 14px 0 0;
}
.modal-head h3 { margin: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 24px; }
.modal-body > :first-child { margin-top: 0; }
.modal-x {
  position: absolute; top: 13px; right: 14px; width: var(--ctl-h); height: var(--ctl-h);
  border: none; border-radius: 50%; background: #f0f2f7; color: #5a6478;
  font-size: 18px; line-height: 1; padding: 0; cursor: pointer; transition: .15s; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: var(--accent-soft); color: var(--accent-dark); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  flex: 0 0 auto; margin: 0;
  padding: 14px 24px; border-top: 1px solid var(--border);
  background: var(--card); border-radius: 0 0 14px 14px;
}
.detail-block { background: #f7f8fb; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.detail-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
/* 工单详情：只有中间链路滚动，底部「根因标签 / HR 回复」常驻，长记录里也能随时改 */
.ticket-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ticket-detail-scroll { flex: 1 1 auto; min-height: 80px; overflow-y: auto; overflow-x: hidden; padding: 16px 24px 8px; }
.ticket-detail-scroll > :first-child { margin-top: 0; }
.ticket-pin { flex: 0 0 auto; padding: 12px 24px 14px; border-top: 1px solid var(--border); background: #fafbfe; }
.ticket-pin label { margin-bottom: 10px; }
.ticket-pin label:last-child { margin-bottom: 0; }
.ticket-pin textarea { min-height: 60px; max-height: 150px; }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #2b3550; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
}
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; line-height: 2; }

@media (max-width: 1080px) {
  .session-list { width: 240px; }
  .suggest-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .session-list { display: none; }
  .topbar { gap: 12px; padding: 0 14px; }
  .topbar-sub { display: none; }
  .chat-messages { padding: 16px; }
  .hero { padding: 20px 18px; }
  .hero h2 { font-size: 18px; }
  .hero-steps { flex-direction: column; gap: 10px; }
}

/* ---------- 主区：统计条与分类速查 ---------- */
.hero-stats {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.hero-stat {
  flex: 1; min-width: 108px; text-align: center;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px 9px; box-shadow: 0 2px 8px rgba(26, 60, 140, .04);
}
.hero-stat .num { font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: .3px; }
.hero-stat .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hero-block-title { font-size: 13px; font-weight: 700; color: var(--accent-dark); margin-top: 20px; }
.quick-topics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 10px;
}
@media (max-width: 1180px) { .quick-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .quick-topics { grid-template-columns: 1fr; } }
.q-topic {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  transition: .15s;
}
.q-topic:hover { border-color: #ffd9b0; box-shadow: 0 4px 14px rgba(255, 138, 31, .08); }
.q-topic h4 { font-size: 13px; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.q-topic .q-ico {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.q-topic ul { list-style: none; }
.q-topic li {
  font-size: 12px; color: #5a6478; padding: 3px 5px; margin: 1px -5px;
  cursor: pointer; border-radius: 6px; transition: .12s;
}
.q-topic li::before { content: '·'; color: var(--accent); font-weight: 700; margin-right: 5px; }
.q-topic li:hover { color: var(--primary); background: var(--primary-soft); }

/* ---------- 登录：短信开通步骤 ---------- */
.activate-tip {
  text-align: left; font-size: 12.5px; line-height: 1.75; color: var(--accent-dark);
  background: var(--accent-soft); border: 1px solid #ffe2c4; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px;
}

/* ---------- 登录/注册切换 ---------- */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; background: #f2f5fb; border-radius: 10px; padding: 4px; }
.auth-tab {
  flex: 1; height: var(--ctl-h); padding: 0 var(--ctl-px); border: none; border-radius: 8px; background: none;
  font-size: 14.5px; line-height: 1; color: var(--muted); cursor: pointer; transition: .16s;
}
.auth-tab.active {
  background: #fff; color: var(--primary); font-weight: 700;
  box-shadow: 0 2px 8px rgba(26, 92, 240, .12);
}
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.btn-outline:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 会话中：继续提问推荐 ---------- */
.followup {
  margin: 4px 0 8px 44px; padding: 16px 18px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(26, 92, 240, .06);
}
.followup-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.followup-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--accent-soft);
}
.followup-head b { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.followup-head em { font-style: normal; font-size: 12px; color: var(--muted); }
.followup-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.followup-chip {
  height: var(--ctl-h); padding: 0 var(--ctl-px); border-radius: 999px; cursor: pointer;
  border: 1px solid #dbe4f7; background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-family: inherit; line-height: 1; transition: .16s;
  display: inline-flex; align-items: center;
}
.followup-chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.followup-topics {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px dashed var(--border);
}
.followup-topic {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  height: var(--ctl-h); padding: 0 var(--ctl-px); border-radius: 8px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--border); background: #fff; color: #4a5365; transition: .16s;
}
.followup-topic:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

/* ---------- 管理员：用工风险识别 ---------- */
.risk-templates { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.risk-chip {
  height: var(--ctl-h); padding: 0 var(--ctl-px); border-radius: 999px; cursor: pointer; font-family: inherit;
  border: 1px dashed #cfdcf6; background: #fff; color: #4a5878; font-size: 12.5px; transition: .16s;
}
.risk-chip:hover { border-style: solid; border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.risk-input {
  width: 100%; padding: 9px var(--ctl-px); border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: var(--ctl-fs); line-height: 1.75; background: #fbfcfe; color: var(--text);
  resize: vertical;
}
.risk-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,92,240,.1); }
.risk-actions { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }

.risk-card { margin-top: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.risk-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.risk-level-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.risk-level-desc { font-size: 12.5px; margin-top: 6px; }
.risk-score { font-weight: 700; color: var(--text); }
.risk-badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
}
.risk-badge.high { background: #fdeceb; color: #b3261e; }
.risk-badge.mid { background: var(--accent-soft); color: var(--accent-dark); }
.risk-badge.low { background: #eef4ff; color: var(--primary-dark); }
.risk-badge.none { background: #e8f5ec; color: #20713a; }

.risk-items { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.risk-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fcfdff; }
.risk-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
.risk-tag { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.risk-tag.high { background: #fdeceb; color: #b3261e; }
.risk-tag.mid { background: var(--accent-soft); color: var(--accent-dark); }
.risk-tag.low { background: var(--primary-soft); color: var(--primary-dark); }
.risk-row { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.7; color: #4b5567; margin-top: 4px; }
.risk-k { flex-shrink: 0; width: 34px; color: var(--muted); }

.risk-ai { margin-top: 14px; border-radius: 12px; background: var(--primary-soft); padding: 12px 14px; }
.risk-ai-title { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.risk-ai-body { font-size: 13px; line-height: 1.8; color: #33405c; }
.risk-note { margin-top: 12px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
@media (max-width: 640px) {
  .risk-card { padding: 14px; }
  .risk-item-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- 白名单批量导入 ---------- */
.wl-import {
  border: 1px dashed #cfdcf6; border-radius: 12px; background: #fbfcff;
  padding: 14px 16px; margin-bottom: 6px;
}
.wl-import-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wl-import-head b { font-size: 13.5px; color: var(--primary-dark); }
.wl-import-head .muted { font-size: 12px; }
.wl-import-text {
  width: 100%; padding: 9px var(--ctl-px); border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: var(--ctl-fs); line-height: 1.7; background: #fff; color: var(--text);
  resize: vertical;
}
.wl-import-text:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,92,240,.1); }
/* 导入操作条：四个元素同一条线、同高同宽同色（上传是 label，必须和 button 长得一模一样） */
.wl-import-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: nowrap; }
.wl-import-actions .btn,
.wl-import-actions label.btn {
  height: var(--ctl-h); min-width: 116px; padding: 0 var(--ctl-px); margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--ctl-fs); line-height: 1; border-radius: 8px; box-sizing: border-box;
  white-space: nowrap; flex: 0 0 auto; cursor: pointer;
}
.wl-import-actions label.btn { border: 1px solid var(--border); background: #fff; color: var(--text); }
.wl-import-actions label.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.wl-import-actions .btn-primary { border-color: transparent; color: #fff; }
.wl-import-actions > span.muted,
.wl-import-actions #wl-import-tip,
.wl-import-actions #faq-import-tip {
  font-size: 12px; color: var(--muted); flex: 1 1 auto; min-width: 0;
  height: var(--ctl-h); line-height: var(--ctl-h); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 白名单查询条 */
.wl-toolbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.wl-toolbar input[type="search"] {
  height: var(--ctl-h); margin-top: 0; padding: 0 var(--ctl-px); font-size: var(--ctl-fs); border-radius: 8px;
  width: 280px; max-width: 100%; box-sizing: border-box;
}
.wl-toolbar .btn { height: var(--ctl-h); padding: 0 var(--ctl-px); font-size: var(--ctl-fs); display: inline-flex; align-items: center; }
.wl-toolbar #wl-count { font-size: 12px; color: var(--muted); margin-left: auto; }
/* 白名单条目：姓名 + 部门标签，第二行手机号 */
.wl-item .card-title { display: inline-flex; align-items: center; gap: 8px; }
.wl-dept {
  font-size: 11.5px; font-weight: 400; color: var(--primary-dark);
  background: var(--primary-soft); border-radius: 999px; padding: 2px 8px;
}
.wl-dept-missing { color: #9aa4bb; background: #f1f3f8; }
.wl-ops { display: inline-flex; gap: 8px; flex: 0 0 auto; }
.wl-phone { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); }
/* 新增表单三个输入框等宽 */
.wl-add-form input { width: 200px; }
/* 导入弹窗：格式说明块 + 示例 */
.wl-format-tip {
  border: 1px dashed #cfdcf6; border-radius: 10px; background: #f7faff;
  padding: 10px 12px; margin-bottom: 12px;
  font-size: 12.5px; line-height: 1.75; color: #4a5670;
}
.wl-format-tip b { color: var(--primary-dark); }
.wl-format-eg {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #fff;
  border: 1px solid var(--border);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-all;
}
#modal-wl-import .wl-import-text { margin-top: 0; }

/* ---------- 问题分析：关注度与热点条款 ---------- */
.focus-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.focus-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fcfdff; margin-bottom: 8px; }
.focus-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.focus-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.focus-count { font-size: 12px; color: var(--primary-dark); white-space: nowrap; }
.focus-bar { height: 7px; border-radius: 4px; background: #eef2fb; margin-top: 7px; overflow: hidden; }
.focus-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), #5a9bff 60%, var(--accent)); transition: width .4s; }
.focus-samples { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.focus-clause { font-size: 12px; color: #4b5567; margin-top: 6px; line-height: 1.65; }

/* ---------- 问题分析：部门 / 个人 AI 自助解决榜（ECharts） ---------- */
.rank-chart {
  width: 100%; min-height: 180px; margin: 4px 0 6px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 6px 8px;
}
.rank-chart .empty-tip { padding: 34px 0; }
/* 榜单标题右边的同步状态：轻量一行，不抢标题 */
.rank-sync { margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--muted); }
/* 图表下方的口径说明（根因归类的横轴刻度） */
.chart-note { font-size: 11.5px; line-height: 1.6; color: #9aa4bb; margin: -2px 0 4px; }
.rank-chart-tools { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.rank-chart-tools .muted { font-size: 12px; margin-right: auto; }
/* 标题行：标题文字 + 同步状态 + 导出按钮，按钮紧跟标题后面 */
.rank-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.rank-title .rank-sync { margin-left: 0; }
.rank-export { margin-left: 2px; }
/* 榜单统计周期筛选：按月 / 按年 + 具体周期 */
.rank-filter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 2px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #f8faff;
}
.rank-filter-label { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.rank-filter select { width: auto; flex: 0 0 auto; min-width: 112px; margin-top: 0; padding-right: 32px; }
.rank-filter .muted { font-size: 12px; }

/* 直答消息里的 AI 解读按钮 */

/* ---------- AI 回答阶段进度 ---------- */
.ai-progress { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.prog-step {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: #f1f4fb; color: var(--muted); transition: .25s;
}
.prog-step.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; animation: progPulse 1.1s ease-in-out infinite; }
.prog-step.done { background: #e8f5ec; color: #20713a; }
.prog-step.done::after { content: '✓'; margin-left: 2px; font-size: 10.5px; }
@keyframes progPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.done-chip {
  display: inline-block; margin-top: 8px; margin-left: 6px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #e8f5ec; color: #20713a; vertical-align: middle;
}

/* ---------- 知识库自动解析状态条 ---------- */
.kb-auto-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 8px 12px; border-radius: 10px;
  background: #f4f7ff; border: 1px solid #dce6fb;
}
.kb-auto-bar .muted { font-size: 12.5px; line-height: 1.5; flex: 1 1 auto; }
.kb-auto-bar .btn { flex: 0 0 auto; }
.kb-auto-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d4e8; flex: 0 0 auto; }
.kb-auto-dot.ok { background: #2aa15a; }
.kb-auto-dot.running { background: #e0a11b; animation: progPulse 1.2s ease-in-out infinite; }
.kb-auto-dot.error { background: #d6482f; }

/* ---------- 自定义标准回答 ---------- */
.faq-panel { border: 1px solid #d6e2fb; border-radius: 12px; background: #fbfcff; padding: 14px 16px; margin-bottom: 18px; }
.faq-panel-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.faq-panel-head b { font-size: 13.5px; color: var(--primary-dark); }
.faq-panel-head .muted { font-size: 12px; line-height: 1.6; }
.faq-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.faq-form input, .faq-form textarea {
  width: 100%; padding: 9px var(--ctl-px); border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: var(--ctl-fs); background: #fff; color: var(--text); resize: vertical;
}
.faq-form input { height: var(--ctl-h); padding: 0 var(--ctl-px); }
.faq-form input:focus, .faq-form textarea:focus { outline: none; border-color: var(--primary); }
.faq-form .btn { align-self: flex-start; }
.faq-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fff; margin-bottom: 8px; }
.faq-item.off { opacity: .55; }
.faq-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.faq-kws { display: flex; flex-wrap: wrap; gap: 5px; }
.faq-kw { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.faq-ops { display: flex; gap: 6px; }
.faq-q { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.faq-a { font-size: 12.5px; color: #4b5567; line-height: 1.7; white-space: pre-wrap; }

.auto-flag {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  font-size: 10.5px; background: #eef3ff; color: #5d70a8; vertical-align: 1px;
}


/* ---------- 工单：批量工具栏 + 卡片（管理员 / 我的工单共用） ---------- */
.ticket-tools {
  display: flex; align-items: center; gap: 12px;
  background: #fbfcff; border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.ticket-tools .tools-spacer { flex: 1; }
.check-all {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 13px; color: var(--text); user-select: none;
  padding: 4px 12px 4px 8px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border); transition: .16s;
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
}
.check-all:hover { border-color: #c9d6f0; box-shadow: 0 2px 8px rgba(26,60,140,.06); }
/* 与工具条里的按钮等高（全站 --ctl-h），一行里不再一高一矮 */
.check-all { min-height: var(--ctl-h); padding: 0 12px 0 10px; }
.check-all input, .tc-check input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
/* 全局 input 有 margin-top:6px，会把勾选框顶低，这里压回 0 保证和「全选」文字居中对齐 */
.check-all input, .tc-check input { margin-top: 0; }
.sel-hint { font-size: 12.5px; color: var(--muted); transition: .16s; }
.sel-hint.on { color: var(--primary); font-weight: 600; }
.btn-danger-o { color: var(--danger); border-color: #f3cdcf; background: #fff; }
.btn-danger-o:hover { background: #fdf3f3; border-color: var(--danger); color: var(--danger); }

/* ---------- 预警建议：批量删除工具栏 + 卡片勾选框 ---------- */
.alert-tools { margin-bottom: 12px; }
/* 勾选框排在标题左侧，不能抢走 card-title 的剩余宽度（否则右侧时间会被挤到下一行） */
.alert-check {
  display: inline-flex; align-items: center; flex: 0 0 auto;
  margin: 0; padding: 0; cursor: pointer; line-height: 1;
}
.alert-check input { margin: 0; width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.alert-card .card-head { justify-content: flex-start; }
/* 标题撑满中间，时间靠右 */
.alert-card .card-head .card-title { flex: 1 1 auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.alert-card.is-checked { border-color: #f3cdcf; background: #fffafa; }
@media (max-width: 640px) {
  .alert-tools { flex-wrap: wrap; }
  .alert-tools .tools-spacer { flex-basis: 100%; height: 0; }
  .alert-tools #btn-alert-batch-del { width: 100%; }
}

.ticket-card { padding: 14px 16px; transition: box-shadow .18s, border-color .18s; }
.ticket-card:hover { box-shadow: 0 8px 24px rgba(26,60,140,.08); border-color: #dbe4f6; }
.ticket-card.is-closed { background: #fcfdff; }
.tc-top { display: flex; align-items: flex-start; gap: 10px; }
.tc-check { display: flex; align-items: center; padding-top: 7px; cursor: pointer; }
.tc-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-soft), #dfeaff);
  color: var(--primary-dark); font-weight: 700; font-size: 14px;
}
.tc-who { flex: 1; min-width: 0; }
.tc-nameline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-name { font-size: 14px; color: var(--text); }
.tc-phone { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 姓名后面的部门：来自管理员导入的白名单，弱化显示不抢姓名的视觉重心 */
.tc-dept { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.tc-sub { font-size: 12px; color: #9aa4bb; margin-top: 3px; }
.tc-question {
  margin: 10px 0 0 44px; font-size: 14px; line-height: 1.7; color: var(--text);
  background: #f7f9fe; border-left: 3px solid #cddcfb; border-radius: 0 8px 8px 0;
  padding: 8px 12px; white-space: pre-wrap; word-break: break-word;
}
.tc-meta { margin: 10px 0 0 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-pill {
  font-size: 11.5px; color: #55617a; background: #f0f3fa; border-radius: 999px; padding: 3px 10px;
}
.tc-reply {
  margin: 10px 0 0 44px; font-size: 13px; line-height: 1.7; color: #2c3a55;
  background: #f2fbf4; border-left: 3px solid #b7e3c4; border-radius: 0 8px 8px 0;
  padding: 8px 12px; word-break: break-word;
}
.tc-actions { display: flex; gap: 8px; margin: 12px 0 0 44px; flex-wrap: wrap; }
.tc-actions .btn { border-radius: 8px; }
.ticket-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.ticket-bar-hint { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .tc-question, .tc-meta, .tc-reply, .tc-actions { margin-left: 0; }
}
/* 无头像形态（员工端「我的工单」）：内容不再缩进，信息占满整行 */
.ticket-card.no-avatar .tc-question,
.ticket-card.no-avatar .tc-meta,
.ticket-card.no-avatar .tc-reply,
.ticket-card.no-avatar .tc-actions { margin-left: 0; }
/* 「我的工单」：提问直接作为卡片标题行，与状态标签同一行——去掉重复的类别标题后，
   提问本身就该是第一眼看到的东西。标签靠右不压缩，长提问正常换行。 */
.ticket-card.no-avatar .tc-nameline { align-items: flex-start; flex-wrap: nowrap; }
.tc-nameline > .tc-question {
  margin: 0; padding: 0; background: none; border-left: 0; border-radius: 0;
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; line-height: 1.65; font-weight: 600; color: var(--text);
}
.tc-nameline > .tag { flex: 0 0 auto; margin-top: 2px; }
@media (max-width: 640px) {
  .ticket-card.no-avatar .tc-nameline { flex-wrap: wrap; }
  .tc-nameline > .tc-question { flex: 1 1 100%; }
  .tc-nameline > .tag { margin-top: 6px; }
}

/* ---------- 公司文件 / 人事制度 ---------- */
/* ---------- 公司文件 / 人事制度（独立页面） ---------- */
.files-meta-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 10px 2px; flex-wrap: wrap; }
.files-meta-bar .muted { margin-bottom: 0; font-size: 12px; color: #9aa4bb; }
.files-meta-bar .files-order-tip { margin-left: auto; }
.files-meta-bar .muted.is-error { color: #b3241f; }
/* 保存结果条：成功/降级/失败都常驻在列表上方，不会像 toast 一样闪一下就没 */
.files-banner {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.65; word-break: break-word;
}
.files-banner.ok { background: #f2fbf4; border: 1px solid #bfe6cb; color: #1f7a41; }
.files-banner.info { background: #f4f7ff; border: 1px solid #dce6fb; color: #2a4a86; }
.files-banner.warn { background: #fffaf0; border: 1px solid #f3ddae; color: #8a6100; }
.files-banner.error { background: #fdf3f3; border: 1px solid #f3cdcf; color: #b3241f; }
.filter-row #files-search-company,
.filter-row #files-search-hr { width: 220px; min-width: 160px; max-width: 100%; background: #fff; }
.file-item.is-new { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,60,140,.12); }
.files-admin-bar { margin-bottom: 10px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
/* 文件弹框的名称搜索 */
.files-search-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.files-search-row input {
  flex: 1; width: auto; height: var(--ctl-h); margin-top: 0; padding: 0 var(--ctl-px);
  font-size: var(--ctl-fs); border-radius: 8px;
}
.files-search-row .btn { height: var(--ctl-h); padding: 0 var(--ctl-px); font-size: 13px; flex: 0 0 auto; }
.files-result-tip { font-size: 12px; color: #9aa4bb; margin: 0 0 8px 2px; }
.files-order-tip { font-size: 12px; color: #9aa4bb; margin-right: auto; }
/* 管理员排序：序号 + 上移/下移（员工端不渲染这块） */
.file-order { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; padding-top: 1px; }
.file-order-num { font-size: 11.5px; color: #9aa4bb; min-width: 12px; text-align: center; line-height: 1; }
.ord-btn {
  width: 30px; height: var(--ctl-h); line-height: 1; font-size: 13px; font-weight: 700; padding: 0;
  border: 1px solid #d7def0; background: #fbfcff; color: #3d4a66;
  border-radius: 6px; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.ord-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ord-btn:disabled { opacity: .32; cursor: not-allowed; }
.file-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.file-item-main { flex: 1; min-width: 0; }
.file-item-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
.file-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #eef3ff; color: #5d70a8; font-weight: 400; }
/* 附件数与主文件用不同底色：一眼分得清「这条有文件」和「这条还挂了几个附件」 */
.file-badge.is-att { background: #eefaf1; color: #1f6b3c; }
.file-item-desc { font-size: 12.5px; color: #4b5567; margin-top: 5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.file-item-meta { font-size: 12px; color: #9aa4bb; margin-top: 5px; }
/* 操作区：四个按钮统一宽度、统一高度，避免「编辑 / 上传附件」字数不同把列挤得参差不齐；
   主按钮去掉外投影，否则它视觉上比旁边几个大一圈，右对齐时更明显 */
.file-item-ops { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex: 0 0 auto; }
.file-item-ops .btn { width: 76px; padding: 0; border-radius: 8px; }
.file-item-ops .btn-primary { box-shadow: none; }
/* 表单里的附件区：一行标题 + 「＋ 附件上传」按钮，下面是可移除的附件清单（一行一个，名字过长省略） */
.file-input-hidden { display: none; }
.file-att-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; }
.file-att-label { font-size: 13px; color: var(--text); font-weight: 500; }
.file-att-label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.file-att-head .btn { margin-left: auto; }
.file-pick-list { display: flex; flex-direction: column; gap: 6px; }
.file-pick {
  display: flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 6px 8px 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: #fbfcff; font-size: 12.5px;
}
.file-pick-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-pick-size { flex: 0 0 auto; color: #9aa4bb; font-size: 11.5px; }
.file-pick-tag { flex: 0 0 auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #eef3ff; color: #5d70a8; }
.file-pick-tag.is-new { background: #eefaf1; color: #1f6b3c; }
.file-pick-del {
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0; line-height: 1;
  border: 0; border-radius: 6px; background: transparent; color: #9aa4bb;
  font-size: 15px; cursor: pointer;
}
.file-pick-del:hover { background: #fdecec; color: var(--danger); }
.file-pick-empty { font-size: 12px; color: var(--muted); padding: 4px 2px 2px; }
@media (max-width: 520px) {
  .file-att-head .btn { margin-left: 0; flex: 1 1 100%; }
}
.file-detail-meta { font-size: 12.5px; color: var(--muted); margin: -4px 0 10px; }
.file-detail-desc {
  font-size: 13.5px; line-height: 1.8; color: var(--text); white-space: pre-wrap; word-break: break-word;
  background: #f7f9fe; border-left: 3px solid #cddcfb; border-radius: 0 8px 8px 0;
  padding: 10px 14px; margin-bottom: 12px;
}
.file-preview-frame { width: 100%; height: 62vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.file-preview-img { max-width: 100%; max-height: 60vh; border-radius: 10px; border: 1px solid var(--border); display: block; margin: 0 auto; }
.modal-tall { max-height: 90vh; overflow-y: auto; }



/* 查不到时的工单提示（单独一行，不混进答复正文） */
.answer-note { font-size: 12.5px; color: #8b95ab; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }

/* ==================== 移动端适配（≤860px 主力，≤480px 兜底） ====================
   之前顶栏是「一行 + 固定 62px 高」，手机上导航被挤没了，员工根本切不了页面；
   聊天输入条也被顶出屏幕。这里把顶栏拆成两行、导航整条横向滚动，
   页面高度改用 flex 分配（不再写死 calc(100vh - 62px)），内容才不会被裁。 */
@media (max-width: 860px) {
  /* 主视图纵向布局：顶栏自适应高度，页面区吃掉剩余空间 */
  #view-app { flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { flex: 0 0 auto; height: auto; padding: 8px 12px 6px; gap: 6px 8px; flex-wrap: wrap; }
  .pane { flex: 1 1 auto; min-height: 0; height: auto; }

  /* 第一行：品牌 + 用户；第二行：整条导航横向滚动 */
  .topbar-title { order: 1; min-width: 0; gap: 7px; }
  .topbar-logo { width: 28px; }
  .topbar-brand { min-width: 0; }
  .topbar-brand strong { font-size: 14px; }
  .topbar-sub, .role-badge { display: none; }
  .topbar-user { order: 2; margin-left: auto; gap: 4px; }
  .user-name { font-size: 13px; max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .topbar-nav-wrap {
    order: 3; width: 100%; flex: 0 0 auto; justify-content: flex-start;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 0 -12px; padding: 0 12px;
  }
  .topbar-nav-wrap::-webkit-scrollbar { display: none; }
  .topbar-nav { flex: 0 0 auto; }
  .nav-btn { font-size: 13px; padding: 0 11px; }

  /* 页面容器：收紧留白，表格类内容不再被边缘裁到 */
  .panel { padding: 14px 12px 28px; }
  .panel h2 { font-size: 17px; }
  .panel h3 { font-size: 14.5px; margin: 16px 0 8px; }
  .panel-head { margin-bottom: 12px; gap: 8px; }
  .panel-head h2 .policy-count { margin-left: 6px; font-size: 12px; }
  .policy-sort-label { font-size: 12px; }
  .muted { font-size: 12.5px; }
  .card { padding: 13px 13px; }
  .empty-tip { padding: 28px 8px; }

  /* 聊天页 */
  .chat-messages { padding: 14px 12px; }
  .chat-messages.is-empty { padding: 14px 12px 18px; }
  .chat-input-bar { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .chat-input-box { padding: 4px 8px 4px 12px; border-radius: 12px; }
  #chat-input { font-size: 16px; line-height: 1.5; padding: 6px 0; max-height: 108px; }
  .chat-actions { padding-bottom: 2px; gap: 6px; }
  #btn-send, #btn-stop { min-width: 60px; }
  .hero { padding: 16px 14px; }
  .hero h2 { font-size: 17px; }
  .hero-stats { gap: 8px; margin-top: 12px; }
  .hero-stat { min-width: calc(50% - 4px); padding: 9px 8px; }
  .hero-stat .num { font-size: 18px; }
  .hero-steps { flex-direction: column; gap: 8px; }
  .suggest-grid { gap: 8px; }
  .msg { max-width: 92%; }
  .msg-body { font-size: 14px; }

  /* 统计卡与筛选条 */
  .stat-row { gap: 8px; }
  .stat { min-width: calc(50% - 4px); padding: 11px 8px; }
  .stat .num { font-size: 21px; }
  .filter-row { gap: 8px; width: 100%; }
  .filter-row select, .filter-row input { flex: 1 1 120px; min-width: 0; width: auto; }
  .filter-row .btn { flex: 0 0 auto; }
  /* 排序组在窄屏占满一整行，标签与下拉仍并排 */
  .policy-sort-group { flex: 1 1 100%; }
  .policy-sort-group select { flex: 1 1 auto; min-width: 0; }
  .alert-count { flex: 1 1 100%; text-align: left; }
  .ticket-bar { gap: 8px; }

  /* 白名单：三个输入各占一行，两个按钮并排等宽 */
  .wl-add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wl-add-form input { grid-column: 1 / -1; width: 100%; }
  .wl-add-form .btn { width: 100%; }
  .wl-toolbar { flex-wrap: wrap; gap: 8px; }
  .wl-toolbar input[type="search"] { width: 100%; flex: 1 1 100%; }
  .files-search-row { flex-wrap: wrap; }
  .wl-item .card-head { align-items: flex-start; }
  .wl-ops { flex: 0 0 auto; }

  /* 弹窗：占满可用宽度、贴底展示，按钮区不被键盘顶掉 */
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal, .modal-wide { width: 100%; max-width: 100%; max-height: 90dvh; border-radius: 14px; }
  .modal-head { padding: 16px 52px 12px 16px; }
  .modal-body { padding: 12px 16px; }
  /* 工单详情由内部滚动区负责内边距，外层不再重复加 */
  .ticket-body { padding: 0; }
  .ticket-detail-scroll { padding: 12px 16px 6px; min-height: 64px; }
  .ticket-pin { padding: 10px 16px 12px; }
  .modal-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .modal-actions .btn { flex: 1 1 0; }
  .wl-format-tip { font-size: 12px; }
  .wl-format-eg { font-size: 11.5px; overflow-x: auto; }

  /* 文件列表行与工单操作 */
  .file-item { gap: 8px; flex-wrap: wrap; }
  /* 窄屏下「序号+上移/下移」与 4 个操作按钮会把标题列挤成 0 宽（一个字一行），
     操作按钮整行下移，标题列恢复可读宽度 */
  .file-order { flex: 0 0 auto; order: 1; }
  .file-item-main { order: 2; }
  .file-item-ops { order: 3; flex: 1 1 100%; justify-content: flex-end; margin-top: 2px; }
  .tc-actions { flex-wrap: wrap; gap: 6px; }
  .tc-question, .tc-meta, .tc-reply { margin-left: 0; }
  .detail-block { font-size: 12.5px; }
  .rank-chart { padding: 2px 4px; }
  .rank-chart-tools { gap: 8px; }
  .rank-chart-tools .muted { font-size: 11.5px; }
  .rank-filter { gap: 6px; padding: 8px 10px; }
  .rank-filter select { flex: 1 1 auto; min-width: 0; }
  .rank-filter .muted { flex: 1 1 100%; }

  /* 侧边栏整块收起后，免责声明改挂聊天区底部，否则手机上完全看不到 */
  .side-footer-mobile {
    display: block; flex: 0 0 auto;
    padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
    background: #fbfcff; border-top: 1px dashed var(--border);
    text-align: center; font-size: 11px; line-height: 1.65; color: #9aa4ba;
  }
  /* 底部安全区交给上面这条声明承担，输入条不再重复留白，否则中间会空出一条 */
  .chat-pane .chat-input-bar { padding-bottom: 8px; }
}

@media (max-width: 520px) {
  /* 小屏操作区整行平分：四颗按钮等宽，360px 也不会折行；员工端单个按钮保持常规宽度靠右 */
  .file-item-ops { justify-content: stretch; }
  .file-item-ops .btn { width: auto; flex: 1 1 0; min-width: 0; }
  .file-item-ops.ops-single { justify-content: flex-end; }
  .file-item-ops.ops-single .btn { flex: 0 0 auto; width: 96px; }
}

@media (max-width: 480px) {
  .topbar-brand strong { font-size: 13.5px; }
  .hero-stat .num { font-size: 17px; }
  .hero-stat .lbl { font-size: 10.5px; }
  .panel { padding: 12px 10px 26px; }
  .card { padding: 12px; }
  .rank-chart-tools { flex-wrap: wrap; }
  .rank-chart-tools .btn { width: 100%; }
  .rank-title { font-size: 15px; gap: 2px 8px; }
  .rank-title .rank-export { width: auto; }
  .filter-row select, .filter-row input { flex: 1 1 100%; }
  .filter-row .btn { flex: 1 1 0; }
}
