:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-soft: #6b7280;
  --border: #e5e7eb;
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============ 登录 / 注册 ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #eaf2fc 0%, #f5f7fa 55%, #eef6f3 100%);
}
.auth-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%; max-width: 412px;
  background: var(--card); border-radius: 18px; padding: 40px 34px 28px;
  box-shadow: 0 18px 60px rgba(15, 40, 90, 0.14);
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand-logo {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; background: var(--primary-light);
}
.auth-org { font-size: 21px; font-weight: 700; color: var(--primary-dark); letter-spacing: 0.5px; }
.auth-sys { margin-top: 7px; font-size: 14px; color: var(--text-soft); letter-spacing: 3px; }

.auth-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 22px;
  background: #eef1f6; border-radius: 10px;
}
.tab {
  flex: 1; padding: 10px; border: none; background: transparent; border-radius: 8px;
  cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text-soft); transition: all 0.18s;
}
.tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

/* 字段 */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.field-icon { position: absolute; left: 12px; color: var(--text-soft); pointer-events: none; }
.input-wrap input, .input-wrap select {
  width: 100%; padding: 12px 12px 12px 40px; font-size: 15px;
  border: 1.5px solid var(--border); border-radius: 10px; color: var(--text); background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input-wrap input:focus, .input-wrap select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.input-wrap select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}

/* 工号校验状态 */
.field-hint { font-size: 12px; color: var(--text-soft); margin-top: 6px; line-height: 1.5; }
.field-hint.ok { color: var(--success); }
.field-hint.err { color: var(--danger); }
.input-wrap input.ok { border-color: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
.input-wrap input.err { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
.req { color: var(--danger); }

.btn-block { width: 100%; margin-top: 8px; padding: 13px; font-size: 15px; }

/* 登录页「忘记密码」入口 */
.auth-forgot { text-align: right; margin-top: 10px; font-size: 13px; }
.auth-forgot a { color: var(--primary); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }
/* 列表：主要问题「整格」可点击预览 */
.problem-link { color: var(--primary); text-decoration: none; }
.problem-link:hover { text-decoration: underline; }
/* 列表：主要问题 / 类型 两个单元格整格可点，唤起工单预览（手机上点按区域更大） */
.cell-view { cursor: pointer; }
.cell-view:hover { background: #eef4fd; }
/* 列表：删除按钮（危险操作） */
.link-btn.danger { color: var(--danger); }
/* 工单预览弹窗（只读） */
.preview-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.preview-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.preview-section h3 { font-size: 14px; color: var(--primary-dark); margin-bottom: 10px; }
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
.pv-item { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.pv-label { font-size: 12px; color: var(--text-soft); }
.pv-value { font-size: 14px; color: var(--text); word-break: break-all; white-space: pre-wrap; }
.pv-sub { font-size: 13px; color: var(--text-soft); margin: 10px 0 6px; }
.pv-meta { font-size: 12px; color: var(--text-soft); margin-top: 12px; }

/* 消息中心 */
.msg-btn { position: relative; }
.msg-badge {
  display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 5px;
  background: var(--danger); color: #fff; border-radius: 99px;
  font-size: 11px; line-height: 16px; text-align: center; vertical-align: middle;
}
.msg-toolbar { text-align: right; margin-bottom: 8px; }
.msg-list { max-height: 380px; overflow-y: auto; }
/* 注意：整条消息不再整体可点 —— 只有「标题」与下方「查看工单」按钮两个入口会置为已读，
   避免鼠标划过或随手点空白处就误清未读提示 */
.msg-item { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.msg-item:hover { background: var(--primary-light); }
.msg-item.unread { border-left: 3px solid var(--primary); background: rgba(37, 99, 235, 0.04); }
.msg-item.unread .msg-title { font-weight: 700; color: var(--primary-dark); }
.msg-title { font-size: 14px; color: var(--text); cursor: pointer; }
.msg-title:hover { text-decoration: underline; }
.msg-content { font-size: 13px; color: var(--text-soft); margin-top: 4px; white-space: pre-wrap; word-break: break-all; }
.msg-meta { font-size: 12px; color: var(--text-soft); margin-top: 5px; }
/* 工单入口按钮：标题之外的第二个已读入口 */
.msg-ticket-btn {
  display: inline-block; margin-top: 8px; padding: 4px 10px; font-size: 12px;
  color: var(--primary); background: var(--primary-light);
  border: 1px solid #c7dbfb; border-radius: 6px; cursor: pointer;
}
.msg-ticket-btn:hover { background: #dbe9fd; }
.msg-empty { text-align: center; color: var(--text-soft); padding: 26px 0; font-size: 13px; }

/* 找回密码：密保问题展示条 */
.forgot-question {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
}

/* 登录卡片底部提示区：演示账号 / 备案信息共用（居中 + 上方分隔线） */
.auth-demo, .auth-beian {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
  text-align: center; font-size: 12.5px; color: var(--text-soft); line-height: 1.7;
}

.modal-body label {
  display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 14px;
}
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #fff;
}
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============ 主界面 ============ */
.app-wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding: 8px 0 16px;
}
.app-title {
  text-align: center; flex: 1 1 100%; font-size: 24px; font-weight: 700;
  color: var(--primary-dark); letter-spacing: 1px;
}
.app-subtitle {
  text-align: center; flex: 1 1 100%; font-size: 15px; font-weight: 500;
  color: var(--text-soft); letter-spacing: 2px; margin-top: 4px;
}
.app-user { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: flex-end; font-size: 14px; }
.app-user span { color: var(--text-soft); }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); text-align: center;
}
.stat-num { font-size: 30px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.progress { height: 6px; background: var(--border); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--success); transition: width 0.4s; }

/* 工具栏 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 200px; }
.toolbar .filter { flex: 0 1 140px; }
.search, .filter {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff;
}

/* 表格 */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
thead th {
  background: var(--primary-light); color: var(--primary-dark); text-align: left;
  padding: 12px 10px; font-weight: 600; white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 10px; border-top: 1px solid var(--border); vertical-align: middle; }
/* 工单列表整行可点：打开工单预览并扣减该工单的未读消息（见 app.js renderTickets） */
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fafbfc; }
/* 列表：类型徽标强制单行，不换行；过长时省略号（如「程序升级工单」在窄列下会被折断） */
.badge {
  display: inline-block; vertical-align: middle;
  padding: 2px 8px; border-radius: 99px; font-size: 12px;
  white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}
.badge-BUG { background: #fee2e2; color: var(--danger); }
.badge-需求 { background: #e0f2fe; color: #0369a1; }
.badge-程序升级工单 { background: #ede9fe; color: #6d28d9; }
.status-pending { color: var(--warn); font-weight: 600; white-space: nowrap; }
.status-completed { color: var(--success); font-weight: 600; white-space: nowrap; }
/* ===== 底部状态展示区（本次 UI 优化）=====
   问题：原来状态行与其它字段混排、且状态用普通文本呈现，与列表里的状态列观感不一致。
   改法：状态单独成行（flex 对齐、间距统一）+ 药丸式展示，颜色复用同一套 .status-* 色板。 */
/* 中智问题确认区：刻意不用 fieldset —— 无 legend 的 fieldset 仍会画出边框，
   看起来像"多出一层标题"。改用普通 div，与其它字段行的观感一致。 */
.zz-confirm-block { margin: 0 0 12px; }
/* 【本次优化·二次】底部状态栏：标题在上、居中且醒目；状态框在下、铺满编辑区宽度。
   布局要点：
   · 纵向排列（flex-direction: column）→ 标题与状态框分两行；
   · 状态框 width:100% + box-sizing:border-box → 宽度跟随编辑区，
     padding 不会把元素撑出容器（这是窄屏/高分屏下不错位的关键）；
   · min-width:0 允许在极窄屏下正常收缩；不写固定宽度，避免缩放时溢出。 */
.status-row { width: 100%; }
.status-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex: 1;             /* 在 .row（flex）里占满整行 */
  min-width: 0;
}
.status-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  text-align: center;
}
.status-pill {
  width: 100%;
  box-sizing: border-box;   /* 关键：否则 padding 会让它超出容器宽度 */
  text-align: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}
/* 审核中：中智已提交完成、等待医院审核 —— 用主色区分，既非进行中也非闭环 */
.status-under_review { color: var(--primary); font-weight: 700; white-space: nowrap; }
.status-rejected { color: var(--danger); font-weight: 600; white-space: nowrap; }
/* 医院信息科审核状态字体配色
   （优先级配色见文件末尾「优先级配色」区块，勿在此重复定义，否则两套色值会互相覆盖） */
/* 列表「医院审核」列三态配色：
   完成=绿（review-done）/ 待审核=主色（review-waiting）/ 退回·待处理=红（review-pending）。
   review-pending 原用橙色告警色，与「退回」语义不符，已按要求改为红色。 */
.review-pending { color: var(--danger); font-weight: 600; white-space: nowrap; }
.review-waiting { color: var(--primary); font-weight: 600; white-space: nowrap; }
.review-done { color: var(--success); font-weight: 600; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 13px; }
.link-btn.danger { color: var(--danger); }
.empty { text-align: center; color: var(--text-soft); padding: 30px; }

/* ============ 按钮 ============ */
.btn-primary, .btn-secondary, .btn-ghost {
  padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled, .btn-primary.btn-disabled {
  background: #b8c2d0; cursor: not-allowed; opacity: 0.7;
}
.btn-primary:disabled:hover, .btn-primary.btn-disabled:hover { background: #b8c2d0; }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-card { background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 18px; color: var(--primary-dark); }
.modal-close { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--text-soft); line-height: 1; }
.modal-body { padding: 20px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 16px; }
legend { padding: 0 8px; font-weight: 600; color: var(--primary-dark); font-size: 14px; }
/* 【样式统一】中智问题确认的标题：与「中智软件公司填写」等 legend 标签**完全一致**
   （font-weight 600 / --primary-dark / 14px）。该区块已不是 fieldset、没有 legend，
   故用本类显式对齐，保证同页不同区块的标题观感统一。 */
.zz-title { font-weight: 600; color: var(--primary-dark); font-size: 14px; }
.row { display: flex; gap: 12px; }
.row > label { flex: 1; }
/* 【尺寸回归·必读】.sl-host 是 .row 的直接子元素（限高下拉把原 <label> 换成了 <div.sl-host>），
   而 .row > label 只命中 <label> → .sl-host 拿不到 flex:1，宽度会从「平分整行」塌缩成
   「按内容收缩」，表现为**下拉框变窄了**。这里把同一条规则补给它，宽度恢复与改造前一致。
   ⚠️ 这一条只解决「宽度/尺寸」，与面板限高滚动（.sl-panel 的 max-height / overflow-y）无关，
      两件事互不影响，改这条不会动到滚动条。 */
.row > .sl-host { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text) !important; font-size: 14px !important; }
.check.inline { margin-top: 22px; }
.check input { width: auto !important; margin: 0 !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.auth-msg { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 6px; }
.auth-msg.ok { color: var(--success); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ============ 响应式（手机 / 平板） ============ */
@media (max-width: 860px) {
  .auth-card { padding: 34px 26px 24px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 26px 16px 20px; border-radius: 14px; }
  .auth-org { font-size: 19px; }
  .auth-sys { letter-spacing: 2px; }
}
@media (max-width: 768px) {
  .stats { grid-template-columns: 1fr; }
  .app-title { font-size: 20px; }
  .toolbar .search, .toolbar .filter { flex: 1 1 100%; }
  .toolbar .btn-primary, .toolbar .btn-secondary { flex: 1 1 45%; }
  .row { flex-direction: column; gap: 0; }
  .check.inline { margin-top: 0; }
  .app-user { justify-content: center; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

/* ============ 备案页脚 ============ */
.site-footer {
  text-align: center;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-soft);
  padding: 14px 16px;
  flex-shrink: 0;
}
.app-footer {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

/* ============ 工单图片列表 ============ */
.images-fields input[type="file"] {
  display: block;
  width: 100%;
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--text-soft);
}
.image-list { display: flex; flex-direction: column; gap: 8px; }
.img-loading, .img-empty { font-size: 13px; color: var(--text-soft); padding: 4px 0; }
.img-item {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 12px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fafbfc;
}
.img-name { font-size: 13px; color: var(--text); word-break: break-all; flex: 1; min-width: 0; }
.img-size { color: var(--text-soft); font-size: 12px; }
.img-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* 附件预览：图片缩略图 */
.attach-thumb {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
  flex-shrink: 0; background: #fff;
}
/* 附件预览：文件卡片 */
.file-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 6px; border: 1px solid var(--border); background: #fff;
}
.file-badge { font-size: 11px; color: #fff; background: #5b8def; padding: 1px 6px; border-radius: 4px; }
.file-ext { font-size: 11px; color: var(--text-soft); margin-top: 2px; letter-spacing: 0.5px; }

/* ============ 表单文本框：禁止拉动 + 超出换行 + 滚动条 ============ */
/* 注：fMainProblem 已从多行 textarea 改为单行「问题名称」input，不再需要这些文本域规则 */
#fReject {
  resize: none;            /* 禁止用户拖动改变大小 */
  overflow-y: auto;        /* 内容过多时显示滚动条 */
  white-space: pre-wrap;   /* 保留换行并按宽度自动折行 */
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 需求驳回备注：红色加粗显示 */
#fReject {
  color: #e53935;
  font-weight: 700;
}
/* 需求驳回备注 标题：红色加粗 */
.modal-body label.reject-label {
  color: #e53935;
  font-weight: 700;
}
/* 问题名称 标题：红色加粗（工单核心必填字段） */
.modal-body label.main-problem-label {
  color: #e53935;
  font-weight: 700;
}

/* ============ 附件选择按钮（替代原生 file 控件的「选择文件」文案） ============ */
/* 原生 <input type="file"> 的按钮文字由浏览器决定，CSS 无法修改，
   故把原生控件视觉隐藏（不用 display:none —— 保证 label 转发点击在各 WebView 版本都可靠），
   由 <label for> 作为可见按钮，文案完全可控。 */
.file-input-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; border: 0; margin: -1px;
  overflow: hidden; opacity: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.pick-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.file-pick-btn {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--primary); border-radius: 8px;
  color: var(--primary); background: var(--primary-light);
  font-size: 15px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.file-pick-btn:active { background: #dbe9fd; }

/* 主按钮（上传图片）：实底 + 加粗 + 阴影，明显比次要按钮醒目，便于一眼识别 */
.file-pick-btn.pick-primary {
  color: #fff;
  background: linear-gradient(180deg, #3b82f6, var(--primary));
  border-color: var(--primary);
  font-weight: 700;
  letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .35);
}
.file-pick-btn.pick-primary:active {
  background: var(--primary-dark);
  box-shadow: 0 1px 4px rgba(37, 99, 235, .3);
  transform: translateY(1px);
}
/* 已上传 / 待上传视频卡片 */
.video-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.video-thumb {
  width: 96px; height: 62px; border-radius: 6px;
  background: #111 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; cursor: pointer;
  border: 1px solid var(--border);
}

/* ============ 问题名称 / 问题描述 ============ */
/* 表单里的描述触发行：「填写 / 编辑问题描述」按钮 + 当前填写状态 */
.desc-trigger {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -6px 0 14px;
}
.desc-status { font-size: 12px; color: var(--text-soft); }
/* 描述弹窗：多行输入框与提示文案 */
.desc-hint { font-size: 12px; color: var(--text-soft); margin-bottom: 8px; }
#fProblemDesc { min-height: 180px; resize: vertical; line-height: 1.6; }
/* 预览页「问题描述」：单独占满整行（两列网格里跨列），保留换行 */
.pv-desc-item { grid-column: 1 / -1; }
.pv-desc-item .pv-value { word-break: break-word; white-space: pre-wrap; }
.reject-reason {
  color: #e53935;
  font-weight: 700;
  max-width: 240px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============ 优先级配色（工单列表单元格 + 详情页 pv-value）============
   注意：下拉框 <option> 的固定颜色不在这里，而是写在 index.html 中各 option 的
   行内样式上 —— 只给 <select> 设颜色会让展开后的所有选项一起继承同一颜色。 */
.prio-P0 { color: #e53935; font-weight: 700; }  /* P0 红色加粗 */
.prio-P1 { color: #f9a825; font-weight: 700; }  /* P1 黄色 */
.prio-P2 { color: #2e7d32; font-weight: 700; }  /* P2 绿色 */
.prio-P3 { color: #0288d1; font-weight: 700; }  /* P3 天蓝色 */



/* ============ 科室管理弹窗 ============ */
.dept-hint {
  margin: 0 0 12px; font-size: 13px; line-height: 1.6;
  color: var(--text-soft);
  background: var(--bg);
  border-left: 3px solid var(--primary);
  padding: 8px 10px; border-radius: 4px;
}
.dept-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
/* width:auto 是必须的：.modal-body input 的通用规则给了 width:100%，
   在 flex 行里会让输入框撑满整行、把「新增科室」按钮挤出容器。 */
.dept-add-row input {
  flex: 1 1 auto; width: auto; min-width: 0; margin-top: 0;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 14px; box-sizing: border-box;
}
/* 科室管理弹窗需要更宽的卡片（4 列：名称 / 排序 / 状态 / 操作），
   默认 max-width:560px 会把操作按钮挤成两行。 */
#deptModal .modal-card { max-width: 720px; }
.dept-add-row .btn-primary { flex: 0 0 auto; white-space: nowrap; }

/* 表头与数据行使用同一套列宽（名称自适应 / 排序 / 状态 / 操作），
   保证纵向对齐；列宽用 em 固定，避免窗口缩放时错位。 */
.dept-list-head, .dept-row {
  display: flex; align-items: center; gap: 8px;
}
.dept-list-head {
  font-size: 12px; color: var(--text-soft); font-weight: 600;
  padding: 0 6px 6px; border-bottom: 1px solid var(--border);
}
.dept-list-head span:nth-child(1) { flex: 1 1 auto; }
.dept-list-head span:nth-child(2) { flex: 0 0 4em; text-align: center; }
.dept-list-head span:nth-child(3) { flex: 0 0 4em; text-align: center; }
.dept-list-head span:nth-child(4) { flex: 0 0 11em; text-align: center; }

.dept-list { max-height: 45vh; overflow-y: auto; }
.dept-row {
  padding: 6px; border-bottom: 1px solid var(--border);
}
.dept-row.dept-off .dept-name-input { color: var(--text-soft); text-decoration: line-through; }
.dept-name-input {
  flex: 1 1 auto; width: auto; min-width: 0; margin-top: 0;
  padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 14px; box-sizing: border-box;
}
/* flex-basis 与 width 都写 4em：flex 布局下以 flex-basis 为准，
   但 width 也要覆盖 .modal-body input 的 width:100%，否则窄屏会溢出。 */
.dept-sort-input {
  flex: 0 0 4em; width: 4em; margin-top: 0; box-sizing: border-box;
  padding: 6px 4px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 14px; text-align: center;
}
.dept-status-tag {
  flex: 0 0 4em; text-align: center; font-size: 13px;
  color: var(--success);
}
.dept-row.dept-off .dept-status-tag { color: var(--text-soft); }
.dept-actions {
  flex: 0 0 11em; display: flex; gap: 4px; justify-content: flex-end;
}
.btn-mini {
  padding: 5px 8px; font-size: 12px; line-height: 1.2;
  border: 1px solid var(--border); background: #fff;
  color: var(--text); border-radius: 4px; cursor: pointer;
  white-space: nowrap;
}
.btn-mini:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-mini:disabled { opacity: .5; cursor: not-allowed; }
.btn-mini-warn:hover:not(:disabled) { border-color: #f9a825; color: #f9a825; }
.btn-mini-danger:hover:not(:disabled) { border-color: #e53935; color: #e53935; }
.dept-empty { text-align: center; color: var(--text-soft); font-size: 13px; padding: 16px 0; margin: 0; }

/* 窄屏（手机 APP / 小窗口）：操作列换行，避免按钮被挤出可视区 */
@media (max-width: 560px) {
  .dept-list-head { display: none; }
  .dept-row { flex-wrap: wrap; }
  .dept-actions { flex: 1 0 100%; justify-content: flex-start; }
}

/* 基础配置：标签页（升级类型 / 升级场景 / 反馈科室）。多级字典共用同一列表区，靠标签切换数据源。 */
.dept-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dept-tab {
  padding: 8px 16px; font-size: 14px; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-soft); border-bottom: 2px solid transparent;
  margin-bottom: -1px; border-radius: 0;
}
.dept-tab:hover { color: var(--primary); }
.dept-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================================================================
   ========== 限高下拉：展开面板最多可视 5 条，超出则面板内部滚动 ==========
   ============================================================================
   【需求】反馈科室 / 升级类型 / 升级场景 三个下拉，展开后可视区最多 5 条，
           >5 条时在**下拉容器内部**出垂直滚动条；≤5 条完整展示、无滚动条。
   【为什么必须自绘】原生 <select> 的展开列表是浏览器/系统绘制的独立弹层
           （不在页面 DOM 里），max-height / overflow 对它完全无效；
           size=N 的列表框形态在 Chrome 实测同样被忽略。两条路都走不通。

   【外观要求·用户明确】与原生下拉**完全一致**，且**不得改动下拉框大小**。
   → .sl-trigger 的**字体/内边距/边框/圆角/颜色**不硬编码：
     app.js 的 applyNativeLook() 会从真实的原生 select 上读取计算样式并写成内联样式。
   → .sl-trigger 的**宽度**则由 CSS 负责（width:100%），不靠 JS 回填：
     原生 select 是 display:none，getBoundingClientRect() 恒为 0，量不到宽度。
     ⚠️ 关键：宽度必须走 `.row > .sl-host { flex: 1 }`（已在 .row 规则处定义）——
        因为限高下拉把 .row 的直接子元素从 <label> 换成了 <div class="sl-host">，
        而 `.row > label { flex: 1 }` 不再命中，否则下拉框会从「平分整行」塌缩变窄。
     ⚠️ 不要在这里给 .sl-trigger 写 padding / font-size / border-radius ——
        会被内联样式覆盖，写了也是死代码，还容易让人误以为能在这里调外观。

   【高度公式】max-height 由 JS 直接写内联 px（= min(选项数,5) × 单行高 + 8），
     **刻意不使用 CSS 自定义变量 var()** ——
     CSS 变量是"继承"语义，只从祖先往后代传，父节点取不到子节点上的值；
     上一版就是因为把 var() 用在了取不到值的元素上，导致整条 calc() 非法、
     max-height 被整条丢弃，滚动条永远不出现。这里用内联 px 从根上绕开该坑。
   -------------------------------------------------------------------------- */

/* 定位基准：面板是 absolute，需要一个 relative 祖先 */
.sl-host { position: relative; }

/* 【布局】.sl-host 内的 <label> 只包住标题文字 + 隐藏的 select，
   触发按钮与面板是它的兄弟。而 .modal-body label 自带 margin-bottom:14px，
   会把触发按钮整体推下去 14px、与其它字段错位 —— 这里清零，
   改由 .sl-host 自己提供字段级下边距，视觉与其它字段对齐。 */
.sl-host { margin-bottom: 14px; }
.sl-host > label { margin-bottom: 0; }

/* 原生 select 只当数据源：display:none 彻底移出渲染。
   【为什么不像常见做法那样用 position:absolute + opacity:0 隐藏】
     那种"视觉隐藏"会留下一个占位盒参与层叠，且 getBoundingClientRect()
     量到的宽度可能受定位影响 —— 而我们正是靠这个宽度来让按钮与原生等宽的。 */
.sl-host > label > select { display: none; }

/* 触发按钮：尺寸/字体/边框全部由 app.js 的 applyNativeLook() 内联复刻原生。
   这里只负责"原生 CSS 表达不了"的箭头与交互态。
   ⚠️ 必须是 position:relative —— 箭头 .sl-arrow 是它的绝对定位子元素。 */
.sl-trigger {
  display: block; width: 100%; position: relative;
  text-align: left; cursor: pointer;
  /* 箭头由 .sl-arrow 子元素绘制（不用 background-image）：
     背景图会与 text-overflow 的省略号、以及内联复刻的 background-color 互相干扰。
     多留出右侧空间给箭头，与原生 select 的 padding-right:34px 语义一致。 */
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
/* 占位态（未选）用柔和色，与原生「请选择」观感一致 */
.sl-trigger.sl-placeholder { color: var(--text-soft); }
.sl-trigger:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.sl-trigger.sl-open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
/* 禁用态：跟随原生 select（由 app.js 的 MutationObserver 同步 disabled 属性） */
.sl-trigger:disabled {
  background-color: #f3f4f6; color: var(--text-soft);
  cursor: not-allowed; opacity: 0.85;
}
/* 箭头：与 .modal-body select 用同一张 SVG、同一位置（右侧 12px、垂直居中）。
   独立元素承载，不参与 text-overflow 截断，也不与内联回填的 background 冲突。 */
.sl-arrow {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

/* 展开面板 */
.sl-panel {
  position: absolute; left: 0; right: 0; z-index: 60;
  margin-top: 4px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  /* max-height 由 JS 写内联值（min(选项数,5) × 单行高 + 8） */
  overflow-y: auto;
  overscroll-behavior: contain;          /* 面板滚到底时不把滚动"传染"给页面 */
  -webkit-overflow-scrolling: touch;     /* iOS/Android 惯性滚动 */
}
/* 向上弹：触发按钮下方空间不足时贴按钮上沿向上展开（类由 app.js 的 slPlace 加减） */
.sl-panel.sl-up {
  top: auto; bottom: 100%;
  margin-top: 0; margin-bottom: 4px;
  max-height: min(var(--sl-up-max, 100vh), 100vh);
}

.sl-list { list-style: none; margin: 0; padding: 4px 0; }
.sl-option {
  padding: 8px 12px; font-size: 15px; line-height: 1.4;
  color: var(--text); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sl-option:hover { background: var(--primary-light); }
.sl-option.sl-selected { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.sl-option.sl-placeholder { color: var(--text-soft); }
/* 量行高用的探针：不参与视觉，仅用于 getBoundingClientRect 量一行实际高度 */
.sl-option.sl-probe { visibility: hidden; }
