/* 科技风：深空底色、霓虹青强调色、玻璃拟态面板、网格与光晕、等宽数字 */
:root {
  color-scheme: dark;
  --bg: #060a13;
  --bg-soft: #0b1322;
  --bg-elev: #101a2e;
  --fg: #e8f1ff;
  --fg-dim: #94a9c9;
  --fg-faint: #5d7392;
  --line: rgba(88, 152, 224, .16);
  --line-strong: rgba(88, 152, 224, .32);
  --accent: #22d3ee;
  --accent-strong: #06b6d4;
  --accent-soft: rgba(34, 211, 238, .10);
  --accent-ink: #041419;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --ok-soft: rgba(52, 211, 153, .09);
  --ok-line: rgba(52, 211, 153, .38);
  --danger-soft: rgba(248, 113, 113, .09);
  --danger-line: rgba(248, 113, 113, .45);
  --internal-bg: rgba(99, 102, 241, .07);
  --internal-line: rgba(129, 140, 248, .35);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .45);
  --ring: 0 0 0 3px rgba(34, 211, 238, .18);
  --glow: 0 0 0 1px rgba(34, 211, 238, .25), 0 0 24px rgba(34, 211, 238, .14);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 主题表面色：随夜间 / 白天模式整体切换 */
  --page-glow-1: rgba(34, 211, 238, .13);
  --page-glow-2: rgba(99, 102, 241, .14);
  --page-glow-3: rgba(14, 165, 233, .08);
  --grid-line: rgba(88, 152, 224, .045);
  --topbar-bg: rgba(6, 10, 19, .78);
  --surface: rgba(16, 26, 46, .6);
  --surface-soft: rgba(16, 26, 46, .5);
  --surface-strong: rgba(16, 26, 46, .9);
  --surface-chip: rgba(16, 26, 46, .55);
  --panel-a: rgba(16, 26, 46, .72);
  --panel-b: rgba(11, 19, 34, .72);
  --panel-strong-a: rgba(16, 26, 46, .78);
  --panel-strong-b: rgba(11, 19, 34, .78);
  --field-bg: rgba(6, 10, 19, .6);
  --field-bg-focus: rgba(6, 10, 19, .85);
  --inset-bg: rgba(6, 10, 19, .45);
  --code-bg: rgba(6, 10, 19, .7);
  --hover-bg: rgba(34, 211, 238, .05);
  --hover-bg-2: rgba(34, 211, 238, .08);
  --grad-1: #22d3ee;
  --grad-2: #0ea5e9;
  --grad-3: #6366f1;
  --btn-a: rgba(34, 211, 238, .92);
  --btn-b: rgba(14, 165, 233, .92);
  --btn-line: rgba(34, 211, 238, .55);
  --btn-glow: rgba(34, 211, 238, .22);
  --btn-glow-hover: rgba(34, 211, 238, .38);
  --glow-soft: rgba(34, 211, 238, .16);
  --glow-mid: rgba(34, 211, 238, .5);
  --glow-strong: rgba(34, 211, 238, .85);
  --qq-ic-bg: rgba(4, 20, 25, .82);
  --qq-ic-fg: #22d3ee;

  /* 后台操作按钮 / 状态胶囊 */
  --info: #7dd3fc;
  --info-soft: rgba(56, 189, 248, .12);
  --info-line: rgba(56, 189, 248, .42);
  --btn-edit-a: #3b82f6;
  --btn-edit-b: #2563eb;
  --btn-del-a: #ef4444;
  --btn-del-b: #dc2626;
  --btn-reset-a: #f59e0b;
  --btn-reset-b: #d97706;
  --btn-solid-ink: #ffffff;
  --pill-super-soft: rgba(168, 85, 247, .14);
  --pill-super-line: rgba(168, 85, 247, .45);
  --pill-super-fg: #d8b4fe;
}

/* 白天模式：覆盖表面色与文字色，结构样式完全复用 */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3fa;
  --bg-soft: #ffffff;
  --bg-elev: #ffffff;
  --fg: #0e1c31;
  --fg-dim: #4a5f7d;
  --fg-faint: #7386a0;
  --line: rgba(20, 60, 120, .14);
  --line-strong: rgba(20, 60, 120, .24);
  --accent: #0e7f9e;
  --accent-strong: #0b6a85;
  --accent-soft: rgba(14, 127, 158, .10);
  --accent-ink: #ffffff;
  --ok: #047857;
  --warn: #b45309;
  --danger: #dc2626;
  --ok-soft: rgba(4, 120, 87, .08);
  --ok-line: rgba(4, 120, 87, .34);
  --danger-soft: rgba(220, 38, 38, .08);
  --danger-line: rgba(220, 38, 38, .4);
  --internal-bg: rgba(79, 70, 229, .06);
  --internal-line: rgba(79, 70, 229, .28);
  --shadow: 0 1px 2px rgba(15, 40, 80, .07), 0 8px 24px rgba(15, 40, 80, .08);
  --shadow-md: 0 2px 4px rgba(15, 40, 80, .09), 0 16px 40px rgba(15, 40, 80, .12);
  --ring: 0 0 0 3px rgba(14, 127, 158, .18);
  --glow: 0 0 0 1px rgba(14, 127, 158, .22), 0 0 24px rgba(14, 127, 158, .12);

  --page-glow-1: rgba(14, 127, 158, .10);
  --page-glow-2: rgba(99, 102, 241, .09);
  --page-glow-3: rgba(14, 165, 233, .07);
  --grid-line: rgba(20, 60, 120, .05);
  --topbar-bg: rgba(255, 255, 255, .84);
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, .8);
  --surface-strong: #ffffff;
  --surface-chip: rgba(255, 255, 255, .9);
  --panel-a: #ffffff;
  --panel-b: #f6f9fd;
  --panel-strong-a: #ffffff;
  --panel-strong-b: #f6f9fd;
  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --inset-bg: rgba(238, 243, 250, .85);
  --code-bg: rgba(238, 243, 250, .9);
  --hover-bg: rgba(14, 127, 158, .06);
  --hover-bg-2: rgba(14, 127, 158, .10);
  --grad-1: #0e7f9e;
  --grad-2: #0b6a85;
  --grad-3: #4f46e5;
  --btn-a: #0e7f9e;
  --btn-b: #0b6a85;
  --btn-line: #0e7f9e;
  --btn-glow: rgba(14, 127, 158, .24);
  --btn-glow-hover: rgba(14, 127, 158, .36);
  --glow-soft: rgba(14, 127, 158, .16);
  --glow-mid: rgba(14, 127, 158, .42);
  --glow-strong: rgba(14, 127, 158, .55);
  --qq-ic-bg: rgba(255, 255, 255, .2);
  --qq-ic-fg: #ffffff;

  --info: #0369a1;
  --info-soft: rgba(3, 105, 161, .10);
  --info-line: rgba(3, 105, 161, .34);
  --pill-super-soft: rgba(126, 34, 206, .10);
  --pill-super-line: rgba(126, 34, 206, .32);
  --pill-super-fg: #7e22ce;
}

/* 白天模式下工单状态色需加深，保证浅底可读 */
:root[data-theme="light"] .st-submitted { color: #b45309; border-color: rgba(180, 83, 9, .32); background: rgba(245, 158, 11, .14); }
:root[data-theme="light"] .st-accepted { color: #0369a1; border-color: rgba(3, 105, 161, .30); background: rgba(14, 165, 233, .12); }
:root[data-theme="light"] .st-processing { color: #4338ca; border-color: rgba(67, 56, 202, .28); background: rgba(99, 102, 241, .12); }
:root[data-theme="light"] .st-replied { color: #0f766e; border-color: rgba(15, 118, 110, .30); background: rgba(20, 184, 166, .13); }
:root[data-theme="light"] .st-resolved { color: #047857; border-color: rgba(4, 120, 87, .30); background: rgba(16, 185, 129, .13); }
:root[data-theme="light"] .st-rejected { color: #dc2626; border-color: rgba(220, 38, 38, .32); background: rgba(239, 68, 68, .12); }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -8%, var(--page-glow-1), transparent 62%),
    radial-gradient(760px 460px at 92% 4%, var(--page-glow-2), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, var(--page-glow-3), transparent 62%);
  background-attachment: fixed;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 背景网格层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 28%, #000 0%, transparent 78%);
}

a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: color .14s ease, border-color .14s ease; }
a:hover { border-bottom-color: var(--accent); color: var(--accent); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------- 顶栏 ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner { display: flex; align-items: center; gap: 26px; height: 52px; }

/* 品牌：图标 + 双行文字 */
.brand {
  border: 0; color: var(--fg); flex: 0 1 auto; min-width: 0;
  display: inline-flex; align-items: center; gap: 9px;
}
.brand:hover { color: var(--fg); border: 0; }
.brand-mark {
  width: 27px; height: 27px; border-radius: 7px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--grad-1), var(--grad-2));
  color: var(--accent-ink);
  box-shadow: 0 2px 8px var(--btn-glow);
}
.brand-mark svg { width: 16px; height: 16px; display: block; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.16; min-width: 0; }
.brand-name { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--fg-faint); font-weight: 400; white-space: nowrap; }

/* 主导航：图标 + 胶囊选中态 */
.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  border: 0; color: var(--fg-dim); font-size: 13.5px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  transition: color .14s ease, background .14s ease;
}
.nav a svg { width: 15px; height: 15px; flex: none; opacity: .85; }
.nav a:hover { color: var(--accent); background: var(--hover-bg); border: 0; }
.nav a.on { color: var(--accent); background: var(--accent-soft); font-weight: 550; }
.nav a.on svg { opacity: 1; }

/* 右侧：主题切换 + 用户菜单 */
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-dim); flex: none; }
.theme-toggle {
  width: 30px; height: 30px; flex: none; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-dim);
  font: inherit; cursor: pointer;
  transition: color .14s ease, border-color .14s ease, background .14s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle-ic { font-size: 13px; line-height: 1; }
:root[data-theme="dark"] .theme-toggle-ic::before { content: "\263C"; }
:root[data-theme="light"] .theme-toggle-ic::before { content: "\263E"; }
/* 跟随系统：半明半暗图标 + 虚线圈 */
:root[data-theme-mode="auto"] .theme-toggle-ic::before { content: "\25D1"; }
:root[data-theme-mode="auto"] .theme-toggle { border-style: dashed; }

.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 8px 3px 3px; border: 1px solid transparent; border-radius: 999px;
  background: none; color: var(--fg); font: inherit; font-size: 13.5px; cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.user-btn:hover, .user-menu.open .user-btn { background: var(--hover-bg); border-color: var(--line); }
.avatar {
  width: 27px; height: 27px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--grad-1), var(--grad-3));
  color: #fff; font-size: 13px; font-weight: 600; line-height: 1;
}
.user-name { font-weight: 500; }
.user-caret {
  width: 0; height: 0; flex: none; margin-left: 1px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--fg-faint);
  transition: transform .16s ease;
}
.user-menu.open .user-caret { transform: rotate(180deg); }

.user-drop {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 30;
  min-width: 208px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-strong); box-shadow: var(--shadow-md);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.user-drop-head { padding: 9px 11px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-drop-name { font-size: 14px; font-weight: 600; color: var(--fg); }
.user-drop-mail { font-size: 12px; color: var(--fg-faint); word-break: break-all; }
.user-drop-role { margin-top: 5px; font-size: 11px; color: var(--accent); }
.user-drop form { margin: 0; }
.user-drop-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 11px; border: 0; border-radius: 8px;
  background: none; color: var(--fg-dim); font: inherit; font-size: 13px;
  text-align: left; cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.user-drop-item svg { width: 15px; height: 15px; flex: none; opacity: .85; }
.user-drop-item:hover { background: var(--hover-bg); color: var(--accent); border: 0; }
.user-drop-out:hover { color: var(--danger); background: var(--danger-soft); }

.badge {
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 1px 9px; font-size: 12px; color: var(--accent); background: var(--accent-soft);
}
.badge-ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--fg-dim); cursor: pointer; border-bottom: 1px solid transparent;
  transition: color .14s ease, border-color .14s ease;
}
.linkbtn:hover { color: var(--danger); border-bottom-color: var(--danger-line); }
.inline { display: inline; }

/* ---------- 页头 ---------- */
main { padding: 40px 20px 64px; position: relative; z-index: 1; }
h1 { font-size: 24px; font-weight: 650; margin: 0 0 8px; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.sub { color: var(--fg-dim); font-size: 14px; margin: 0 0 28px; }

/* ---------- 工具条 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 13px;
  font-size: 13px; color: var(--fg-dim); background: var(--surface-chip);
  transition: all .14s ease;
}
.chip.on {
  border-color: var(--btn-line); color: var(--accent);
  background: var(--accent-soft); box-shadow: 0 0 16px var(--glow-soft);
}
.chip:hover { border-color: var(--btn-line); color: var(--accent); }

/* ---------- 列表 ---------- */
.tickets { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 16px; padding: 18px 14px;
  border-bottom: 1px solid var(--line); margin: 0 -14px; border-radius: var(--radius);
  transition: background .14s ease, box-shadow .14s ease;
}
.row:hover { background: var(--hover-bg); box-shadow: inset 2px 0 0 var(--accent); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 16px; font-weight: 550; display: block; border: 0; color: var(--fg); }
.row-title:hover { color: var(--accent); border: 0; }
.row-meta { color: var(--fg-faint); font-size: 12.5px; margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.row-no { font-family: var(--mono); font-size: 12px; color: var(--fg-faint); }
.row-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- 状态 ---------- */
.st {
  font-size: 12px; white-space: nowrap; border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 2px 10px; color: var(--fg-dim);
  background: var(--surface);
}
.st-submitted { color: #fcd34d; border-color: rgba(252, 211, 77, .38); background: rgba(252, 211, 77, .10); }
.st-accepted { color: #7dd3fc; border-color: rgba(125, 211, 252, .38); background: rgba(125, 211, 252, .10); }
.st-processing { color: #a5b4fc; border-color: rgba(165, 180, 252, .40); background: rgba(165, 180, 252, .12); }
.st-replied { color: #5eead4; border-color: rgba(94, 234, 212, .38); background: rgba(94, 234, 212, .10); }
.st-resolved { color: #6ee7b7; border-color: rgba(110, 231, 183, .38); background: rgba(110, 231, 183, .10); }
.st-closed { color: var(--fg-faint); }
.st-rejected { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }

.pr { font-size: 12px; color: var(--fg-faint); }
.pr-high, .pr-urgent { color: var(--danger); }

/* ---------- 表单 ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
label.f { display: block; margin-bottom: 20px; }
.lab { font-size: 13.5px; font-weight: 550; display: block; margin-bottom: 6px; }
.lab .req { color: var(--danger); margin-left: 3px; }
.hint { font-size: 12.5px; color: var(--fg-faint); margin-top: 5px; }

input[type=text], input[type=number], input[type=tel], input[type=date],
input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); font: inherit; font-size: 14.5px;
  background: var(--field-bg); color: var(--fg);
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--accent); box-shadow: var(--ring);
  background: var(--field-bg-focus);
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
select {
  appearance: none; background-image: none; padding-right: 30px; cursor: pointer;
}
select option { background: var(--bg-soft); color: var(--fg); }

.opts { display: flex; flex-direction: column; gap: 7px; }
.opt { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; }
.opt input { width: auto; margin-top: 5px; flex: none; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* 文件 / 图片上传控件 */
input[type=file].upload {
  width: 100%; padding: 9px 11px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); font: inherit; font-size: 14px;
  background: var(--inset-bg); color: var(--fg-dim); cursor: pointer;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input[type=file].upload::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface-strong); color: var(--fg);
  font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .14s ease;
}
input[type=file].upload::file-selector-button:hover { border-color: var(--accent); color: var(--accent); }
input[type=file].upload:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--hover-bg-2); }

/* 详情页附件列表 */
.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  max-width: 100%; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.attach:hover { border-color: var(--accent); color: var(--accent); }
.attach-size { color: var(--fg-faint); font-size: 12.5px; }
.attach-thumb { max-width: 220px; max-height: 160px; border-radius: var(--radius); display: block; border: 1px solid var(--line); }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: var(--radius);
  border: 1px solid var(--btn-line);
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  color: var(--accent-ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 0 20px var(--btn-glow), var(--shadow);
  transition: box-shadow .16s ease, filter .16s ease;
}
.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 30px var(--btn-glow-hover), var(--shadow-md);
}
.btn-ghost {
  background: var(--surface); color: var(--fg); border-color: var(--line-strong);
  box-shadow: none; font-weight: 500;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); filter: none; box-shadow: 0 0 18px var(--glow-soft); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger {
  background: var(--danger-soft); color: var(--danger);
  border-color: var(--danger-line); box-shadow: none; font-weight: 500;
}
.btn-danger:hover { border-color: var(--danger); background: rgba(248, 113, 113, .16); color: var(--danger); filter: none; box-shadow: 0 0 18px rgba(248, 113, 113, .2); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.rowform { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.rowform > label.f { margin-bottom: 0; flex: 1; min-width: 160px; }

/* ---------- 流程图 ---------- */
.steps { display: flex; align-items: flex-start; margin: 8px 0 32px; }
.step { flex: 1; text-align: center; position: relative; }
.step::before {
  content: ""; position: absolute; top: 11px; left: -50%; width: 100%;
  height: 1px; background: var(--line-strong);
}
.step:first-child::before { display: none; }
.step.done::before { background: linear-gradient(90deg, var(--glow-soft), var(--accent)); box-shadow: 0 0 8px var(--glow-mid); }
.dot {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--bg-soft); margin: 0 auto 8px; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--fg-faint); font-family: var(--mono);
  transition: all .16s ease;
}
.step.done .dot {
  border-color: var(--accent); background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 14px var(--glow-mid);
}
.step.current .dot {
  box-shadow: 0 0 0 4px var(--glow-soft), 0 0 18px var(--glow-mid);
  border-color: var(--accent); color: var(--accent); background: var(--bg-soft);
}
.step-label { font-size: 12.5px; color: var(--fg-faint); }
.step.done .step-label, .step.current .step-label { color: var(--fg); }

/* 时间轴 */
.tl { border-left: 1px solid var(--line-strong); margin-left: 5px; padding-left: 20px; }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--bg-soft);
  border: 1px solid var(--line-strong);
}
.tl-item.key::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--glow-strong); }
.tl-head { font-size: 13.5px; }
.tl-time { font-size: 12px; color: var(--fg-faint); margin-left: 8px; font-family: var(--mono); }
.tl-body { font-size: 13.5px; color: var(--fg-dim); margin-top: 3px; }

/* ---------- 答复 ---------- */
.reply {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 12px; background: linear-gradient(180deg, var(--surface), var(--panel-b));
}
.reply.internal { background: var(--internal-bg); border-style: dashed; border-color: var(--internal-line); }
.reply-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--fg-dim); margin-bottom: 8px; }
.reply-body { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.tag { font-size: 11.5px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 7px; color: var(--fg-faint); }

/* ---------- 详情 ---------- */
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px;
  margin: 20px 0 8px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-soft), var(--panel-b));
}
.meta-k { font-size: 12px; color: var(--fg-faint); }
.meta-v { font-size: 14px; }
.answers { border-top: 1px solid var(--line); margin-top: 24px; }
.qa { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.qa-k { width: 150px; flex: none; font-size: 13.5px; color: var(--fg-dim); }
.qa-v { flex: 1; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 提示 ---------- */
.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px; margin-bottom: 24px;
  background: var(--accent-soft); color: var(--fg-dim);
}
.notice.err { border-left-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.notice.ok { border-left-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.notice.draft-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-left-color: var(--warn, var(--accent)); background: var(--warn-soft, var(--accent-soft));
}
.notice.draft-bar .draft-txt { flex: 1; min-width: 0; }
.empty { color: var(--fg-faint); padding: 48px 0; text-align: center; font-size: 14px; }

.pager { display: flex; gap: 14px; justify-content: center; margin-top: 28px; font-size: 13.5px; color: var(--fg-dim); }
.pager span { font-family: var(--mono); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { color: var(--fg-faint); font-weight: 500; font-size: 12.5px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre.json { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; margin: 4px 0 0; color: var(--fg-dim); }

.stat {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 28px; box-shadow: var(--shadow);
}
.stat-i { background: linear-gradient(180deg, var(--panel-strong-a), var(--panel-strong-b)); padding: 16px 18px; }
.stat-n { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-family: var(--mono); color: var(--accent); text-shadow: 0 0 18px var(--glow-soft); }
.stat-k { font-size: 12.5px; color: var(--fg-faint); margin-top: 2px; }

.foot {
  border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; padding-bottom: 40px;
  font-size: 12.5px; color: var(--fg-faint);
}
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot-status { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
}

/* ---------- 问卷编辑器 ---------- */
.qn-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.qn-list { display: flex; flex-direction: column; gap: 12px; }
.field-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--inset-bg); }
.fr-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fr-top > input[data-k=label] { flex: 1; min-width: 140px; }
.fr-top > select[data-k=type] { width: auto; min-width: 108px; flex: none; }
.fr-idx { font-size: 12px; color: var(--fg-faint); font-family: var(--mono); min-width: 16px; }
.fr-req { white-space: nowrap; font-size: 13.5px; }
.fr-btns { display: flex; gap: 6px; margin-left: auto; }
.fr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; margin-top: 12px; }
.fr-grid > label.f { margin-bottom: 10px; }
.fr-grid textarea { min-height: 72px; }
.qn-empty { padding: 24px 0; }
.qn-history { margin: 14px 0 4px; }
.qn-history > summary { font-size: 13px; color: var(--fg-dim); cursor: pointer; }
.qn-history > summary:hover { color: var(--accent); }

/* ---------- 分类与问卷 ---------- */
.cat-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 24px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-name { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.cat-name::before { content: "▍"; color: var(--accent); margin-right: 6px; text-shadow: 0 0 12px var(--glow-strong); }
.cat-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-faint); }
.cat-meta .dot { color: var(--line-strong); }
.email-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.email-row label.f { flex: 1; margin: 0; }
.qn-form .actions { margin-top: 16px; }
.fr-adv { margin-top: 12px; }
.fr-adv summary { font-size: 12.5px; color: var(--fg-dim); cursor: pointer; user-select: none; }
.fr-adv summary:hover { color: var(--accent); }
.fr-adv[open] summary { margin-bottom: 2px; }

@media (max-width: 640px) {
  .fr-top > input[data-k=label] { min-width: 100%; }
  .fr-btns { margin-left: 0; }
}

/* ---------- 分组表单 ---------- */
.fsec { margin-bottom: 34px; }
.fsec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fsec-no {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--btn-a), var(--grad-3));
  color: var(--accent-ink); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px var(--glow-mid);
}
.fsec-title { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.fsec-hint { font-size: 12.5px; color: var(--fg-faint); margin: 2px 0 0; }
.fsec-body { padding: 24px 24px 8px; }
.fsec-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.fsec-grid .f--full { grid-column: 1 / -1; }
.fsec-grid > label.f:last-child { margin-bottom: 0; }

/* 配置状态总览：绿点已就绪 / 灰点未配置 */
.cfg-status { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 30px; }
.cfg-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13.5px;
}
.cfg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--fg-faint); }
.cfg-k { font-weight: 600; white-space: nowrap; }
.cfg-v { color: var(--fg-faint); }
.cfg-item.on { border-color: var(--ok-line); }
.cfg-item.on .cfg-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.cfg-item.on .cfg-v { color: var(--fg-dim); }
.cfg-item.off .cfg-k { color: var(--fg-dim); }

@media (max-width: 640px) {
  .cfg-status { grid-template-columns: 1fr; }
}

/* 上传区：拖拽感 + 预览 */
.upload-box { position: relative; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.upload-preview img { max-width: 140px; max-height: 110px; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.upload-preview .pv-file {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13.5px; color: var(--fg-dim); background: var(--surface);
}
.upload-preview .pv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.upload-preview .pv-size { color: var(--fg-faint); font-size: 12px; flex: none; }

/* ---------- 登录 ---------- */
.login-box { max-width: 380px; margin: 8vh auto 0; }
.login-box h1 { text-align: center; }
.login-box > .sub { text-align: center; }
.login-box form.card > .btn { display: block; width: 100%; text-align: center; }
.login-alt { text-align: center; color: var(--fg-faint); font-size: 12.5px; margin: 22px 0 10px; }
.login-tip { text-align: center; }
.captcha-row { display: flex; align-items: stretch; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img {
  width: 120px; height: 44px; flex: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-inset); object-fit: cover;
}
.captcha-img:hover { border-color: var(--accent); }
.qq-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--btn-line); border-radius: var(--radius);
  padding: 12px; font-size: 15px; font-weight: 600; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 0 22px var(--btn-glow), var(--shadow);
  transition: box-shadow .16s ease, filter .16s ease;
}
.qq-btn:hover {
  color: var(--accent-ink); filter: brightness(1.08);
  box-shadow: 0 0 34px var(--btn-glow-hover), var(--shadow-md);
}
/* QQ 优先入口 */
.login-primary { position: relative; margin-bottom: 8px; }
.login-rec {
  position: absolute; top: -9px; left: 12px; z-index: 1;
  padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; color: var(--accent-ink);
  background: linear-gradient(135deg, var(--grad-1), var(--grad-3));
  box-shadow: 0 0 14px var(--glow-mid);
}
.qq-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  font-size: 10px; font-weight: 700; font-family: var(--mono);
  background: var(--qq-ic-bg); color: var(--qq-ic-fg);
}
.login-note { text-align: center; color: var(--fg-faint); font-size: 12.5px; margin: 0 0 18px; }
/* 次要登录方式 */
.login-more { margin-top: 4px; }
.login-more > summary {
  list-style: none; cursor: pointer; text-align: center;
  font-size: 13px; color: var(--fg-dim); padding: 9px 0;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  transition: color .14s ease, border-color .14s ease;
}
.login-more > summary::-webkit-details-marker { display: none; }
.login-more > summary::before { content: "▸ "; color: var(--accent); }
.login-more[open] > summary::before { content: "▾ "; }
.login-more > summary:hover { color: var(--accent); border-color: var(--btn-line); }
.login-more-body { padding-top: 16px; }
.login-more-body .login-alt { margin-top: 14px; }

/* ---------- 处理操作台 ---------- */
.op-head {
  display: flex; gap: 40px; flex-wrap: wrap;
  padding: 16px 18px; margin: 4px 0 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--hover-bg-2);
}
.op-tip { font-size: 12.5px; color: var(--fg-dim); margin-left: 8px; }
.op-sec { margin-bottom: 24px; }
.op-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.op-sec-head h3 { margin: 0; }
.op-no {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-a), var(--grad-3));
  color: var(--accent-ink); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px var(--glow-mid);
}
.op-sec .card > label.f:last-of-type { margin-bottom: 0; }

/* ---------- 工作台 ---------- */
.wb-group { margin-bottom: 32px; }
.wb-group > h2 { display: flex; align-items: baseline; gap: 10px; }
.wb-count { font-size: 12.5px; color: var(--fg-faint); font-weight: 400; }

/* ================= 移动端适配 ================= */
@media (max-width: 900px) {
  .wrap { padding: 0 18px; }
  main.wrap { padding-bottom: 48px; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 18px; padding-bottom: 40px; }
  h1 { font-size: 21px; }
  h2 { margin-top: 26px; }

  /* 顶栏：品牌与用户信息一行，导航独占一行可横向滚动 */
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; gap: 0 10px; }
  .brand-name { font-size: 14px; max-width: 62vw; }
  .brand-sub { display: none; }
  .who { margin-left: auto; gap: 6px; }
  .user-name { display: none; }
  .user-btn { padding: 2px; gap: 0; }
  .user-caret { display: none; }
  .user-drop { top: calc(100% + 8px); }
  .nav {
    order: 3; flex: 1 0 100%; gap: 4px;
    margin: 4px -16px 0; padding: 0 16px 4px;
  }
  .nav a { font-size: 13.5px; padding: 5px 10px; }

  /* 表单与按钮：避免 iOS 聚焦缩放，控件铺满 */
  input[type=text], input[type=number], input[type=tel], input[type=date],
  input[type=email], input[type=password], input[type=search], select, textarea { font-size: 16px; }
  .card { padding: 18px 16px; }
  .btn { padding: 10px 16px; }
  .filters { gap: 6px; }
  .filters-search { margin-left: 0; width: 100%; }
  .filters-search input, .filters-search select { width: 100%; min-width: 0; flex: 1; }
  .filters-search .btn { flex: none; }
  .rowform > label.f, .inline-form > label.f { flex: 1 1 100%; min-width: 0; }
  .actions { gap: 8px; }
  .actions .btn { flex: 1 1 auto; text-align: center; }

  /* 工单列表行：状态徽章换行不挤压标题 */
  .row { flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; padding: 15px 12px; margin: 0 -12px; }
  .row-main { flex: 1 1 100%; }
  .row-title { font-size: 15.5px; }
  .row-meta { gap: 8px 12px; }

  /* 流程条与时间轴 */
  .steps { margin: 6px 0 26px; }
  .step::before { top: 9px; }
  .dot { width: 19px; height: 19px; font-size: 10px; margin-bottom: 6px; }
  .step-label { font-size: 11px; }
  .tl { padding-left: 16px; }
  .tl-item::before { left: -21px; }
  .reply { padding: 14px; }
  .reply-head { flex-wrap: wrap; gap: 6px 10px; }

  /* 详情 / 分组表单 */
  .qa { flex-direction: column; gap: 2px; }
  .qa-k { width: auto; }
  .meta-grid { padding: 14px 16px; gap: 12px 18px; }
  .fsec-body { padding: 18px 16px 4px; }
  .fsec-grid { grid-template-columns: 1fr; }
  .cat-card { padding: 16px; }
  .cat-meta { margin-left: 0; width: 100%; }
  .email-row { flex-direction: column; align-items: stretch; }
  .email-row .btn { width: 100%; }
  .op-head { gap: 16px; padding: 14px 16px; }
  .upload-preview img { max-width: 104px; }
  .attach-thumb { max-width: 100%; }

  /* 统计与页脚 */
  .stat-i { padding: 13px 15px; }
  .stat-n { font-size: 19px; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .err-code { font-size: 44px; }

  /* 登录页 */
  .login-box { margin-top: 3vh; }
  .login-alt { margin: 18px 0 8px; }
}

/* ================= 管理后台 ================= */
.wrap-wide { max-width: 1240px; }

.adm { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; }
.adm-side {
  position: sticky; top: 76px; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-strong-a), var(--panel-strong-b));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
/* 侧栏品牌区 */
.adm-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px 12px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.adm-brand-mark {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px;
  color: var(--accent-ink); background: linear-gradient(135deg, var(--grad-1), var(--grad-3));
  box-shadow: 0 0 16px var(--glow-soft);
}
.adm-brand-txt { display: flex; flex-direction: column; min-width: 0; }
.adm-brand-name { font-size: 14.5px; font-weight: 600; color: var(--fg); line-height: 1.2; }
.adm-brand-sub {
  font-size: 10px; letter-spacing: .12em; color: var(--fg-faint);
  font-family: var(--mono); text-transform: uppercase;
}

.adm-nav { display: flex; flex-direction: column; gap: 2px; }
.adm-nav a, .adm-group > summary {
  padding: 7px 10px; border: 0; border-radius: 7px;
  font-size: 14px; color: var(--fg-dim);
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.adm-nav a { display: flex; align-items: center; gap: 8px; }
.adm-nav a:hover { background: var(--hover-bg-2); color: var(--accent); }
.adm-nav a.on {
  background: var(--accent-soft); color: var(--accent); font-weight: 550;
  box-shadow: inset 2px 0 0 var(--accent), 0 0 18px var(--glow-soft);
}
.adm-nav-ic { flex: none; width: 14px; text-align: center; font-size: 12px; opacity: .85; }

/* 侧栏分组（可折叠） */
.adm-group > summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; user-select: none;
}
.adm-group > summary::-webkit-details-marker { display: none; }
.adm-group > summary:hover { background: var(--hover-bg-2); color: var(--accent); }
.adm-caret {
  margin-left: auto; width: 6px; height: 6px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .16s ease;
}
.adm-group[open] > summary .adm-caret { transform: rotate(45deg); }
.adm-group-body { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px 22px; }
.adm-group-body a { font-size: 13.5px; padding: 6px 10px; }

.adm-side-foot {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--fg-faint); line-height: 1.5;
}

.adm-main { min-width: 0; }
.adm-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding-bottom: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
  position: relative;
}
.adm-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 90px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 12px var(--glow-mid);
}
.adm-head h1 { margin: 0; }
.adm-head .sub { margin: 4px 0 0; }
.adm-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 面板 */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel + .panel { margin-top: 24px; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: var(--inset-bg);
}
.panel-head h2 { margin: 0; font-size: 14.5px; }
.panel-head h2::before { content: "▍"; color: var(--accent); margin-right: 6px; }
.panel-count { margin-left: auto; font-size: 12.5px; color: var(--fg-faint); font-family: var(--mono); }
.panel-body { padding: 18px; }
.panel-body > label.f:last-child, .panel-body > .actions:last-child { margin-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
table.tbl.zebra tbody tr:hover { background: var(--hover-bg); }
table.tbl th { white-space: nowrap; }
table.tbl td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* 后台工具条（搜索 / 筛选） */
.adm-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--inset-bg);
}
.adm-toolbar input[type=search] { flex: 1 1 260px; width: auto; max-width: 420px; }
.adm-toolbar select { flex: none; width: 150px; }
.adm-toolbar .btn { flex: none; padding: 8px 20px; font-size: 13.5px; }

/* 后台列表表格（浅灰表头、横向分隔线、无竖线） */
table.tbl.adm-tbl thead th {
  background: var(--inset-bg); color: var(--fg-dim);
  font-size: 12.5px; font-weight: 550; letter-spacing: .02em;
  padding: 11px 14px; border-bottom: 1px solid var(--line-strong);
}
table.tbl.adm-tbl tbody td {
  padding: 12px 14px; vertical-align: middle; border-bottom: 1px solid var(--line);
}
table.tbl.adm-tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl.adm-tbl tbody tr:hover { background: var(--hover-bg); }
.adm-user { display: flex; flex-direction: column; gap: 2px; }
.adm-user-sub { font-size: 12px; color: var(--fg-faint); font-family: var(--mono); }
.adm-ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.adm-op-form { display: inline-flex; margin: 0; }
.adm-edit-row > td { background: var(--inset-bg); padding: 14px 18px; }
.adm-edit-row .inline-form { align-items: flex-end; }

/* 状态 / 角色胶囊 */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-chip);
  color: var(--fg-dim); font-size: 12px; white-space: nowrap;
}
.pill-info { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.pill-super { color: var(--pill-super-fg); border-color: var(--pill-super-line); background: var(--pill-super-soft); }

/* 彩色实心操作按钮 */
.btn-edit, .btn-del, .btn-reset { color: var(--btn-solid-ink); font-weight: 550; }
.btn-edit { background: linear-gradient(135deg, var(--btn-edit-a), var(--btn-edit-b)); border-color: var(--btn-edit-b); box-shadow: 0 0 14px rgba(37, 99, 235, .24); }
.btn-del { background: linear-gradient(135deg, var(--btn-del-a), var(--btn-del-b)); border-color: var(--btn-del-b); box-shadow: 0 0 14px rgba(220, 38, 38, .24); }
.btn-reset { background: linear-gradient(135deg, var(--btn-reset-a), var(--btn-reset-b)); border-color: var(--btn-reset-b); box-shadow: 0 0 14px rgba(217, 119, 6, .24); }
.btn-edit:hover, .btn-del:hover, .btn-reset:hover { filter: brightness(1.08); }

.adm-grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.adm-grid2 .panel + .panel { margin-top: 0; }

/* 快捷入口 */
.quick { display: flex; flex-direction: column; gap: 2px; }
.quick a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: 7px; transition: background .14s ease;
}
.quick a:hover { background: var(--hover-bg-2); }
.quick-k { font-size: 14px; font-weight: 550; color: var(--fg); }
.quick a:hover .quick-k { color: var(--accent); }
.quick-v { font-size: 12.5px; color: var(--fg-faint); }

/* 危险区 */
.danger-sep { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--danger-line); }

/* 后台工具类 */
.is-hidden { display: none !important; }
.txt-danger { color: var(--danger); }
.txt-ok { color: var(--ok); }
.txt-warn { color: var(--warn); }
.txt-dim { color: var(--fg-dim); }
.txt-faint { color: var(--fg-faint); }
.cell-nowrap { white-space: nowrap; }
.actions-end { margin-left: auto; }
.sortnum { font-variant-numeric: tabular-nums; font-family: var(--mono); }
.w-110 { width: 110px; }
.w-130 { width: 130px; }
.w-150 { width: 150px; }
.w-180 { width: 180px; }
.w-190 { width: 190px; }
.w-200 { width: 200px; }
.w-230 { width: 230px; }
.w-260 { width: 260px; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--fg-dim); white-space: nowrap; }
.chk input { width: auto; margin: 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form > label.f { margin-bottom: 0; }
.filters-end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lab-flush { margin: 0; }
.qn-empty-state { padding: 24px 0; text-align: center; color: var(--fg-faint); font-size: 14px; }
.qn-hist-name { margin: 12px 0 6px; font-size: 13.5px; color: var(--fg-dim); }
.sec-title { margin: 32px 0 12px; font-size: 15px; font-weight: 600; }
.sec-title::before { content: "▍"; color: var(--accent); margin-right: 6px; }
.cat-jump { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
details > summary.link-sum { cursor: pointer; color: var(--fg-dim); font-size: 13px; }
details > summary.link-sum:hover { color: var(--accent); }

/* 通用工具类（替代内联样式） */
.back { margin: 0 0 10px; }
.back a { border: 0; color: var(--fg-dim); font-size: 13.5px; }
.back a:hover { color: var(--accent); }
.sub-tight { margin-bottom: 14px; }
.ml-8 { margin-left: 8px; }
.ml-auto { margin-left: auto; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.fs-125 { font-size: 12.5px; }
.empty-sm { padding: 24px 0; }
.empty-xs { padding: 20px 0; }
.empty-link { border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.card-danger { border-color: var(--danger-line); }
/* 危险操作分组：红色序号与标题 */
.fsec-no-danger { background: linear-gradient(135deg, var(--btn-del-a), var(--btn-del-b)); color: var(--btn-solid-ink); box-shadow: 0 0 16px rgba(220, 38, 38, .28); }
.fsec-title-danger { color: var(--danger); }
.card-danger.fsec-body { padding-bottom: 24px; }
.note { margin: 0 0 12px; color: var(--fg-dim); font-size: 13.5px; }
.h2-count { color: var(--fg-faint); font-weight: 400; font-size: 13px; font-family: var(--mono); }
.reply-name { color: var(--fg); }
.filters-search { margin-left: auto; display: flex; gap: 8px; }

/* ---------- 问题公开大厅 ---------- */
.hall-row { align-items: flex-start; }
.hall-snippet {
  margin: 8px 0 0; font-size: 12.5px; color: var(--fg-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hall-side {
  flex: none; display: flex; flex-direction: column; align-items: flex-end;
  gap: 8px; padding-top: 2px;
}
.hall-side form { margin: 0; }
.tag-mine {
  color: var(--accent); border-color: var(--btn-line);
  background: var(--accent-soft);
}
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; font-family: inherit;
  color: var(--fg-dim); background: var(--surface-chip);
  cursor: pointer; white-space: nowrap;
  transition: all .14s ease;
}
.like-btn:hover { border-color: var(--btn-line); color: var(--accent); }
.like-btn.on {
  border-color: var(--btn-line); color: var(--accent);
  background: var(--accent-soft); box-shadow: 0 0 16px var(--glow-soft);
}
.like-ic { font-size: 9px; line-height: 1; }
.like-num { font-family: var(--mono); font-size: 12px; }

/* 大厅公开问答条目 */
.qa-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.qa-item:last-child { border-bottom: 0; padding-bottom: 0; }
.qa-q { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.qa-a {
  margin-top: 6px; font-size: 13.5px; line-height: 1.7;
  color: var(--fg-dim); white-space: pre-wrap;
}
.qa-meta {
  margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--fg-faint);
}

@media (max-width: 640px) {
  .hall-row { flex-wrap: wrap; }
  .hall-side { flex-direction: row; align-items: center; width: 100%; padding-top: 0; }
}
.err-page { padding: 60px 0; text-align: center; }
.err-code {
  font-size: 56px; font-weight: 700; letter-spacing: -.03em; font-family: var(--mono);
  color: var(--accent); text-shadow: 0 0 40px var(--glow-mid);
}
.err-page .sub { margin-top: 8px; }

/* ---------- 个人中心 ---------- */
.me { max-width: 960px; margin: 0 auto; }
.me-head h1 { margin-bottom: 6px; }
.me-head .sub { margin-bottom: 20px; }
.me-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px; align-items: start;
}
.me-grid .panel + .panel { margin-top: 0; }

.me-summary { display: flex; gap: 16px; align-items: flex-start; }
.me-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  text-transform: uppercase;
}
.me-summary-body { min-width: 0; flex: 1; }
.me-name { font-size: 16px; font-weight: 600; color: var(--fg); }
.me-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.me-meta { margin: 14px 0 0; display: grid; gap: 8px; }
.me-meta > div { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.me-meta dt { flex: none; width: 76px; color: var(--fg-faint); }
.me-meta dd {
  margin: 0; color: var(--fg-dim); min-width: 0;
  overflow-wrap: anywhere;
}
.me-bind-state { margin: 0 0 10px; }
.me-back { margin-top: 22px; }

@media (max-width: 760px) {
  .me-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .adm-side { position: static; }
  .adm-side-foot { display: none; }
  .adm-grid2 { grid-template-columns: minmax(0, 1fr); }
  .adm-head-actions { margin-left: 0; width: 100%; }
}

@media (max-width: 640px) {
  .adm-side { padding: 10px; }
  .adm-brand { padding: 4px 6px 10px; }
  .adm-head { gap: 10px; margin-bottom: 18px; }
  .adm-head-actions .btn { flex: 1 1 auto; text-align: center; }
  .adm-toolbar { padding: 12px 14px; }
  .adm-toolbar input[type=search] { flex: 1 1 100%; max-width: none; }
  .adm-toolbar select { flex: 1 1 100%; width: auto; }
  .adm-toolbar .btn { flex: 1 1 auto; text-align: center; }
  .panel-head { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  table.tbl { font-size: 13px; }
  table.tbl th, table.tbl td { padding: 8px; }
  table.tbl.adm-tbl thead th, table.tbl.adm-tbl tbody td { padding: 9px 10px; }
  .adm-edit-row > td { padding: 12px 14px; }
  .w-110, .w-130, .w-150, .w-180, .w-190, .w-200, .w-230, .w-260 { width: auto; }
}

/* ---------------------------------------------------------------- AI 助手 */

.ai-widget { position: fixed; right: 24px; bottom: 24px; z-index: 60; }

.ai-fab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--btn-line);
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  color: var(--accent-ink); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-md), 0 0 20px var(--btn-glow);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
}
.ai-fab:hover { transform: translateY(-1px); box-shadow: var(--shadow-md), 0 0 28px var(--btn-glow-hover); }
.ai-fab svg { width: 18px; height: 18px; }
.ai-widget.open .ai-fab { display: none; }

.ai-panel {
  position: absolute; right: 0; bottom: 0;
  width: 360px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--panel-strong-a), var(--panel-strong-b));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.ai-panel[hidden] { display: none; }

.ai-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.ai-title { font-size: 15px; font-weight: 600; }
.ai-sub { margin-top: 3px; font-size: 12px; color: var(--fg-faint); }
.ai-close {
  border: 0; background: transparent; color: var(--fg-dim);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.ai-close:hover { color: var(--fg); }

.ai-log {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-msg {
  max-width: 86%; padding: 9px 12px; border-radius: var(--radius);
  font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.ai-msg-bot { align-self: flex-start; background: var(--inset-bg); border: 1px solid var(--line); }
.ai-msg-user { align-self: flex-end; background: var(--accent-soft); border: 1px solid var(--line-strong); }
.ai-ticket-link {
  align-self: flex-start; font-size: 13px; color: var(--accent);
  text-decoration: none; border-bottom: 1px dashed var(--line-strong);
}

.ai-human { padding: 0 16px 10px; }
.ai-human[hidden] { display: none; }

/* 处理人版助手：底部操作区 */
.ai-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-soft);
}
.ai-actions .btn { flex: 1; min-width: 120px; text-align: center; text-decoration: none; }
.ai-actions .btn[disabled] { opacity: .6; cursor: default; }
.ai-msg-note { font-size: 12px; color: var(--fg-faint); }

.ai-input {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: var(--surface-soft);
}
.ai-input input {
  flex: 1; min-width: 0; padding: 9px 12px; font-size: 13.5px;
  color: var(--fg); background: var(--field-bg);
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.ai-input input:focus {
  border-color: var(--line-strong); box-shadow: var(--ring); background: var(--field-bg-focus);
}

/* 学生助手：对话里上传现场照片（可选，每单 1 张） */
.ai-photo {
  display: flex; align-items: center; gap: 8px;
  margin: 0 16px 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--inset-bg); font-size: 12.5px; color: var(--fg-faint);
}
.ai-photo[hidden] { display: none; }
.ai-photo-thumb {
  width: 40px; height: 40px; object-fit: cover; flex: none;
  border: 1px solid var(--line); border-radius: 6px;
}
.ai-photo-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-photo-del {
  flex: none; width: 22px; height: 22px; line-height: 1; cursor: pointer;
  font-size: 14px; color: var(--fg-faint);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
}
.ai-photo-del:hover { color: var(--fg); border-color: var(--line-strong); }
.ai-input input[type="file"] { display: none; }
.ai-photo-btn { flex: none; white-space: nowrap; }

/* 学生助手 · 页面化快捷问题（不同页面给出不同的问题，用过即收起） */
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ai-chips[hidden] { display: none; }
.ai-chip {
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  color: var(--fg-dim); background: var(--surface-soft);
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.ai-chip:hover { color: var(--fg); border-color: var(--accent); background: var(--accent-soft); }

/* 学生助手 · 「我要反馈」分步向导（独立于对话，一步一问） */
.ai-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ai-wf-open {
  padding: 4px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--line-strong); border-radius: 999px;
}
.ai-wf-open:hover { color: var(--fg); border-color: var(--accent); }
/* 向导打开时收起对话相关区域，让向导独占面板 */
.ai-widget.wf .ai-log,
.ai-widget.wf .ai-human,
.ai-widget.wf .ai-photo,
.ai-widget.wf .ai-input { display: none; }

.ai-wizard { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-wizard[hidden] { display: none; }
.ai-wizard-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 16px 8px;
}
.ai-wizard-step { font-size: 12px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }
.ai-wizard-exit {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font-size: 12.5px; color: var(--accent);
}
.ai-wizard-exit:hover { color: var(--fg); }
.ai-wizard-track {
  height: 4px; margin: 0 16px 10px; border-radius: 999px; overflow: hidden;
  background: var(--inset-bg);
}
.ai-wizard-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  transition: width .2s ease;
}
.ai-wizard-body { flex: 1; overflow-y: auto; padding: 0 16px 12px; }
.ai-wf-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.ai-wf-hint2 { margin: 4px 0 14px; font-size: 12px; line-height: 1.6; color: var(--fg-faint); }
.ai-wf-f { display: block; margin-bottom: 14px; }
.ai-wf-lab { display: block; margin-bottom: 5px; font-size: 12.5px; color: var(--fg-dim); }
.ai-wf-f input[type="text"],
.ai-wf-f input[type="tel"],
.ai-wf-f input[type="number"],
.ai-wf-f input[type="date"],
.ai-wf-f textarea,
.ai-wf-f select {
  width: 100%; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  color: var(--fg); background: var(--field-bg);
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.ai-wf-f textarea { resize: vertical; line-height: 1.6; }
.ai-wf-f input:focus, .ai-wf-f textarea:focus, .ai-wf-f select:focus {
  border-color: var(--line-strong); box-shadow: var(--ring); background: var(--field-bg-focus);
}
.ai-wf-opts { display: flex; flex-direction: column; gap: 8px; }
.ai-wf-opt {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13.5px; line-height: 1.6; color: var(--fg); cursor: pointer;
}
.ai-wf-opt input { flex: none; margin-top: 3px; }
.ai-wf-hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--fg-faint); }
.ai-wf-err { margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: var(--danger); }
.ai-wf-err[hidden] { display: none; }
.ai-wf-photo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-wf-thumb {
  width: 44px; height: 44px; object-fit: cover; flex: none;
  border: 1px solid var(--line); border-radius: 6px;
}
.ai-wf-thumb[hidden] { display: none; }
.ai-wf-photoname {
  flex: 1; min-width: 0; font-size: 12px; color: var(--fg-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-wizard-foot {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: var(--surface-soft);
}
.ai-wizard-foot .btn { flex: 1; text-align: center; }
.ai-wizard-foot .btn[disabled] { opacity: .55; cursor: default; }

/* 工单详情 · 处理预测卡片 */
.pred-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pred-h { margin: 0; }
.pred-sum { font-size: 13.5px; line-height: 1.7; color: var(--fg); }
.pred-grid {
  display: grid; gap: 10px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.pred-box {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.pred-k { font-size: 11.5px; color: var(--fg-faint); }
.pred-v { margin-top: 3px; font-size: 13.5px; color: var(--fg); }
.pred-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pred-stage {
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  color: var(--fg-dim); background: var(--inset-bg); border: 1px solid var(--line);
}
.pred-risk { margin-top: 12px; font-size: 12.5px; line-height: 1.7; color: var(--fg-dim); }
.pred-risk.is-warn { color: var(--danger); }
.pred-tips { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.8; color: var(--fg-dim); }
.pred-basis { margin-top: 10px; font-size: 11.5px; color: var(--fg-faint); }

/* 师傅端 AI 提醒卡片 */
.ai-note {
  margin: 22px 0 6px; padding: 14px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.ai-note-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-note-badge {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line-strong);
}
.ai-note-body { font-size: 13.5px; line-height: 1.7; color: var(--fg); white-space: pre-wrap; }

/* 答复区 · AI 辅助 */
.ai-reply-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 18px; }
.ai-reply-hint { flex: 1; min-width: 200px; }
.ai-reply-tip { font-size: 12.5px; color: var(--fg-faint); }
.ai-reply-tip.err { color: var(--danger); }

/* 处理操作台 · AI 办理建议 */
.ai-assist { margin-bottom: 20px; border-left: 3px solid var(--accent); }
.ai-assist-body { white-space: pre-wrap; }

/* 语音输入：麦克风按钮 + 录音/识别状态提示 */
.voice-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 36px; height: 36px; padding: 0 8px;
  color: var(--fg-muted, var(--fg)); background: var(--field-bg);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.voice-btn:hover { border-color: var(--line-strong); color: var(--accent); }
.voice-btn svg { width: 18px; height: 18px; }
.voice-txt { font-size: 12px; font-variant-numeric: tabular-nums; }
.voice-btn.is-rec {
  color: #fff; background: var(--danger); border-color: var(--danger);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.voice-btn.is-busy { opacity: .6; cursor: default; }
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, .45); }
  50% { box-shadow: 0 0 0 6px rgba(214, 69, 69, 0); }
}
/* 工单表单里的麦克风：跟在输入框右下角，不撑破栅格 */
.f .voice-btn { margin-top: 6px; }
.voice-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  max-width: min(90vw, 420px); padding: 10px 16px;
  font-size: 13px; line-height: 1.6; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.voice-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.voice-toast.is-err { color: var(--danger); border-color: var(--danger); }

@media (max-width: 640px) {
  .ai-widget { right: 14px; bottom: 14px; }
  .ai-fab-txt { display: none; }
  .ai-fab { padding: 13px; }
  .ai-panel { width: calc(100vw - 28px); height: 70vh; }
}

/* ---------- 待分配池（/admin/dispatch）：批量分单 ---------- */
.chk-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fg-dim); cursor: pointer; }
.dispatch-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.dispatch-status { font-size: 13px; color: var(--fg-dim); }
.dispatch-status.ok { color: var(--ok); }
.dispatch-status.err { color: var(--danger); }
.dispatch-reason { font-size: 12.5px; color: var(--fg-dim); max-width: 260px; line-height: 1.5; }
.w-40 { width: 40px; }

/* ---------- 工单详情 · 答复台增强 ---------- */
.tpl-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 12px; }
.tpl-bar-k { font-size: 12.5px; color: var(--fg-dim); }
.ai-rw-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-rw-k { font-size: 12.5px; color: var(--fg-dim); }
.ai-cite-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-assist-body { max-height: 260px; overflow-y: auto; }

/* ---------- 处理人助手 · 指令确认卡 ---------- */
.staff-ai-proposal { border: 1px solid var(--accent); background: var(--accent-soft); }
.staff-ai-proposal[hidden] { display: none; }
.staff-ai-proposal .ai-note-body { font-family: inherit; }
.ai-widget--staff .ai-msg-note { color: var(--fg-dim); font-size: 12.5px; }

/* ---------- 工单详情 · 处理操作台（分段标签页） ---------- */
.op-console { border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.op-strip { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.op-strip-item { display: inline-flex; align-items: center; gap: 6px; }
.op-strip-k { color: var(--fg-dim); font-size: 12.5px; }
.op-strip-end { margin-left: auto; }
.op-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.op-tab { appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: 13.5px; color: var(--fg-dim); padding: 9px 16px;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s; }
.op-tab:hover { color: var(--fg); background: var(--hover-bg); }
.op-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.op-panes { padding: 20px; }
.op-pane[hidden] { display: none; }
.op-pane .card { margin-bottom: 14px; }
.op-pane > *:last-child { margin-bottom: 0; }
.op-pane form.card:last-of-type { margin-bottom: 0; }
.op-hint { font-size: 12.5px; color: var(--fg-dim); margin: 12px 0 0; line-height: 1.6; }
.op-pane .hint { margin-top: 10px; }
@media (max-width: 720px) {
  .op-strip { gap: 6px 14px; }
  .op-strip-end { margin-left: 0; }
  .op-panes { padding: 14px; }
  .op-tab { padding: 8px 12px; font-size: 13px; }
}

/* ---------- 我的待办 · 概览条与超时告警 ---------- */
.wb-overview { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px; }
.wb-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--surface-chip); }
.wb-chip:hover { color: var(--fg); border-color: var(--line-strong); background: var(--hover-bg); }
.wb-chip-n { font-size: 12px; font-weight: 600; color: var(--fg);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
.wb-chip-danger { border-color: var(--danger-line); color: var(--danger); }
.wb-chip-danger .wb-chip-n { color: var(--danger); background: var(--danger-soft); }
.wb-badge-danger { font-size: 11.5px; color: var(--danger); border: 1px solid var(--danger-line);
  background: var(--danger-soft); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.row-danger { box-shadow: inset 3px 0 0 var(--danger-line); }
.row-danger:hover { box-shadow: inset 3px 0 0 var(--danger); }
.wb-group { scroll-margin-top: 90px; }

.dispatch-count { font-size: 12.5px; color: var(--fg-dim); }

/* ---------- 工单详情 · 处理人两栏布局（工单内容在左，处理操作台在右常驻） ---------- */
.tk-cols { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 24px; align-items: start; }
.tk-cols > .tk-block { grid-column: 1; min-width: 0; }
.tk-cols > .tk-side { grid-column: 2; grid-row: 1 / span 2; align-self: start;
  position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; padding-right: 2px; }
@media (max-width: 1240px) {
  .tk-cols { grid-template-columns: 1fr; }
  .tk-cols > .tk-block, .tk-cols > .tk-side { grid-column: auto; grid-row: auto; }
  .tk-cols > .tk-side { position: static; max-height: none; overflow: visible; }
}

/* ---------- AI 办理助手（内嵌在答复页，自带起草 / 建议状态 / 改写 / 依据） ---------- */
.ai-assist { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px;
  background: var(--surface-soft); overflow: hidden; }
.ai-assist .ai-note-head { align-items: center; padding: 12px 16px; margin: 0;
  border-bottom: 1px solid var(--line); }
.ai-assist .ai-note-body { padding: 14px 16px; }
.ai-assist-refresh { margin-left: auto; flex: none; }
.ai-assist-tools { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-chip); }
.ai-assist-tools .ai-reply-hint { width: 100%; margin-bottom: 10px; }
.ai-assist-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.ai-assist .ai-cite-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.op-sug { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  border: 1px solid var(--ok-line, var(--line)); border-radius: 999px; padding: 3px 6px 3px 12px;
  background: var(--ok-soft, var(--surface-chip)); }
.op-sug[hidden] { display: none; }
.op-sug-k { color: var(--fg-dim); }
.op-sug-v { font-weight: 600; }
.op-sug-why { color: var(--fg-dim); max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.op-sug .btn { padding: 2px 8px; }

/* ---------- 答复台「一键闭环」 ---------- */
.op-quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.op-quick-k { font-size: 12.5px; color: var(--fg-dim); }
.op-quick .hint { margin: 0; flex: 1 1 200px; }

/* ---------- AI 办理助手（精简版：默认只露出建议摘要与一个主操作） ---------- */
.ai-assist { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px;
  background: var(--surface-soft); overflow: hidden; }
.ai-assist .ai-note-head { align-items: center; padding: 12px 16px; margin: 0;
  border-bottom: 1px solid var(--line); }
.ai-assist-refresh { margin-left: auto; flex: none; }
.ai-assist-body { max-height: none; overflow: visible; padding: 14px 16px; }
.ai-advice { font-size: 13.5px; line-height: 1.7; color: var(--fg); white-space: pre-wrap; }
/* 未展开时只露 3 行，避免建议正文把整屏占满 */
.ai-advice:not(.open) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; }
.ai-more-toggle { appearance: none; border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 12.5px; color: var(--accent); padding: 8px 0 0; text-align: left; }
.ai-more-toggle:hover { text-decoration: underline; }
.ai-more-toggle[hidden] { display: none; }
.ai-assist-body .ai-reply-hint { width: 100%; margin-top: 10px; }
.ai-assist-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 10px; }
.ai-assist-row[hidden] { display: none; }
.ai-assist .ai-cite-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- AI 建议状态：贴着「答复后流转到」下拉，一键采纳 ---------- */
.op-sug { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 12px;
  background: var(--surface-chip); max-width: 100%; }
.op-sug[hidden] { display: none; }
.op-sug-k { color: var(--fg-dim); flex: none; }
.op-sug-v { font-weight: 600; flex: none; }
.op-sug-why { color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; }
.op-sug .btn { padding: 3px 10px; flex: none; }

/* ---------- 移动端适配（≤900px 平板、≤640px 手机） ---------- */
@media (max-width: 900px) {
  .op-console { margin-bottom: 18px; }
  .op-strip { padding: 10px 14px; font-size: 12.5px; }
  .op-panes { padding: 14px; }
  .ai-assist-body, .ai-assist .ai-note-head { padding: 12px 14px; }
}
@media (max-width: 640px) {
  /* 操作台内边距收紧，标签横向可滑，不再挤压换行 */
  .op-console { margin-bottom: 14px; }
  .op-strip { padding: 10px 12px; gap: 4px 12px; font-size: 12px; }
  .op-strip-k { font-size: 12px; }
  .op-tabs { padding: 8px 12px 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap; flex-wrap: nowrap; scrollbar-width: none; }
  .op-tabs::-webkit-scrollbar { display: none; }
  .op-tab { padding: 9px 12px; font-size: 13px; flex: none; }
  .op-panes { padding: 12px; }
  .op-pane .card { padding: 14px; }

  /* 卡片与 AI 助手：全部控件占满宽度，触控区 ≥ 40px */
  .ai-assist .ai-note-head { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .ai-assist-refresh { margin-left: 0; order: 3; width: 100%; }
  .ai-assist .ai-note-head .ai-reply-tip { flex: 1 1 100%; order: 2; }
  .ai-assist-body { padding: 12px; }
  .ai-assist-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .ai-assist-row .ai-rw-group { justify-content: space-between; }
  .ai-rw-group .btn, .ai-cite-group .btn { flex: 1 1 auto; }
  .ai-more-toggle { padding: 10px 0 0; font-size: 13px; }

  /* 答复表单：单列堆叠，按钮通栏，输入框 16px 防 iOS 自动放大 */
  .op-pane .rowform { flex-direction: column; align-items: stretch; gap: 12px; }
  .op-pane .rowform .f, .op-pane .rowform select, .op-pane .rowform input,
  .op-pane textarea, .ai-assist-body input { width: 100%; }
  .op-pane textarea { font-size: 16px; min-height: 132px; }
  .op-pane .rowform input[type="text"], .op-pane .rowform select { height: 42px; }
  .op-pane .rowform button[type="submit"] { width: 100%; height: 44px; }
  .tpl-bar { margin: -2px 0 12px; gap: 6px; }
  .tpl-bar .chip { padding: 8px 12px; font-size: 13px; }
  .op-sug { width: 100%; border-radius: var(--radius); padding: 8px 10px; }
  .op-sug-why { flex: 1 1 auto; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 38px; }
  /* 悬浮助手按钮会盖住底部内容，给页面留出空间 */
  main.wrap { padding-bottom: 84px; }
  .tk-cols { gap: 16px; }
}

/* ---------- 移动端适配：我的待办 / 工单列表 / 待分配池 ---------- */
@media (max-width: 640px) {
  /* 待办概览胶囊：单行横向滑动，不再换行占掉半屏 */
  .wb-overview { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; margin: 14px -16px 18px; padding: 2px 16px; }
  .wb-overview::-webkit-scrollbar { display: none; }
  .wb-chip { flex: none; padding: 7px 13px; }
  .wb-group { scroll-margin-top: 76px; }
  .wb-group h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .wb-count { flex: 1 1 100%; }

  /* 行内操作区：按钮单独一行，触控区不小于 40px */
  .row-ops { width: 100%; justify-content: flex-start; }
  .row-ops .btn { flex: 0 0 auto; }

  /* AI 提醒卡：徽标与刷新同一行，提示文字独占下一行 */
  .ai-note .ai-note-head { gap: 8px; }
  .ai-note .ai-note-head .btn { order: 2; margin-left: auto; }
  .ai-note .ai-note-head .ai-reply-hint { order: 3; flex: 1 1 100%; min-width: 0; }

  /* 待分配池工具条：按钮两列排布，状态与计数各占一行 */
  .dispatch-bar { padding: 12px; gap: 8px; }
  .dispatch-bar .btn { flex: 1 1 44%; text-align: center; }
  .dispatch-bar .dispatch-status, .dispatch-bar .dispatch-count { flex: 1 1 100%; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
}
