/* 科室工作台样式 —— 紫色系仪表盘风格 */
:root {
  /* 语义色 */
  --primary: #6a5df9;
  --primary-dark: #584ae0;
  --primary-weak: #f4f3fd;
  --primary-soft: #edecfa;
  --primary-soft-hover: #e2e0f7;
  --primary-border: #cfc8f5;
  --primary-ring: rgba(106, 93, 249, .18);
  --primary-shadow: rgba(106, 93, 249, .35);
  --grad: linear-gradient(135deg, #9d8bff 0%, #6a5df9 100%);
  --grad-hover: linear-gradient(135deg, #8d7bff, #584ae0);
  --sidebar-bg: #171530;
  --side-w: 212px;
  --bg: #f3f3fb;
  --card: #ffffff;
  --border: #e9e7f6;
  --text: #2b2a3d;
  --muted: #8a89a6;
  --red: #e5484d;
  --danger-weak: #feecec;
  --danger-weak-hover: #fde0e0;
  --danger-border: #f6c8c8;
  --amber: #d97706;
  --green: #12a150;
  /* 圆角 */
  --radius: 16px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 20px;
  /* 控件 */
  --control-h: 38px;
  --control-h-sm: 30px;
  --control-font: 13px;
  --transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
  /* 表格 */
  --table-head-bg: #f6f5fd;
  --row-hover: #fafafe;
  /* 列表 / 对话 */
  --list-hover-bg: #f4f3fd;
  --list-active-bg: #efecff;
  --bubble-ai-bg: #f7f6fd;
  /* 其他容器 */
  --toast-bg: #262350;
  --detail-bg: #fafaff;
  --track-bg: #edecfa;
  /* 阴影 */
  --shadow: 0 10px 30px rgba(93, 84, 164, .10);
  --shadow-sm: 0 3px 10px rgba(93, 84, 164, .14);
  /* 主题结构差异（蓝主题覆盖） */
  --seg-active-bg: #fff;
  --seg-active-fg: var(--primary);
  --tab-active-bg: var(--grad);
  --tab-border-color: transparent;
  --tab-shadow: var(--shadow);
  --chip-active-bg: var(--grad);
  --chip-shadow: var(--shadow);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #171530 0%, #4a3fbf 55%, #7a5cf0 100%);
}
.login-card {
  background: #fff; border-radius: 20px; padding: 44px 46px; width: 380px;
  box-shadow: 0 30px 80px rgba(10, 8, 40, .45);
}
.login-card h1 { margin: 0 0 8px; font-size: 23px; text-align: center; color: var(--text); }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.login-err { color: var(--red); min-height: 20px; margin: 8px 0 2px; font-size: 13px; }

/* ---------- 整体布局 ---------- */
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w);
  background: var(--sidebar-bg); padding: 22px 0 18px; z-index: 10;
  display: flex; flex-direction: column;
}
.side .logo {
  font-size: 16px; font-weight: bold; color: #fff; padding: 0 20px 20px;
  letter-spacing: 1px; display: flex; align-items: center; gap: 9px;
}
.side .logo-dot {
  width: 26px; height: 26px; border-radius: 9px; background: var(--grad);
  display: inline-block; flex: none; box-shadow: 0 4px 12px rgba(122, 92, 240, .6);
}
.side nav { flex: 1; }
.side nav a {
  display: flex; align-items: center; gap: 8px;
  margin: 3px 12px; padding: 10px 14px; border-radius: 11px;
  color: #a9a5cf; font-size: 14px;
}
.side nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #e8e6ff; }
.side nav a.active {
  background: var(--grad); color: #fff; font-weight: bold;
  box-shadow: 0 6px 18px rgba(106, 93, 249, .45);
}
.side-tip {
  margin: 14px 16px 0; padding: 13px 14px; border-radius: 13px;
  background: var(--grad); color: #fff; font-size: 12px; line-height: 1.8;
  box-shadow: 0 8px 22px rgba(106, 93, 249, .35);
}
.side-tip b { font-size: 12.5px; }
.main { margin-left: var(--side-w); min-height: 100vh; }
.topbar {
  padding: 20px 28px 6px; display: flex; align-items: center; justify-content: flex-end;
}
.topbar .ops { display: flex; align-items: center; gap: 10px; }

/* 顶栏用户菜单：头像 + 用户名，修改密码/退出收入下拉 */
.user-menu { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 32px;
  padding: 0 8px 0 3px; border: 1px solid transparent; border-radius: var(--radius-pill);
  background: transparent; color: var(--text); font-family: inherit; font-size: 13px;
  cursor: pointer; transition: var(--transition);
}
.user-trigger:hover { background: var(--primary-weak); border-color: var(--primary-border); }
.user-trigger:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-trigger .avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 13px; font-weight: bold;
}
.user-trigger .user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger .caret { color: var(--muted); font-size: 10px; transform: translateY(1px); }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px;
  padding: 6px; display: none; z-index: 60;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow);
}
.user-menu.open .user-drop { display: block; }
.user-drop-head {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px 9px; margin-bottom: 5px; border-bottom: 1px solid var(--border);
}
.user-drop-head .user-drop-name { font-size: 13px; font-weight: bold; }
.user-drop-head .muted { font-size: 12px; color: var(--muted); }
.user-item {
  display: block; width: 100%; padding: 8px 10px; text-align: left;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer;
  transition: var(--transition);
}
.user-item:hover { background: var(--primary-weak); }
.user-item.danger { color: var(--red); }
.user-item.danger:hover { background: var(--danger-weak); }
.user-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.view { padding: 12px 20px 60px; }
/* 右侧内容区卡片化（首页已是卡片网格，不套外层卡片） */
.view-card {
  margin: 8px 20px 24px; padding: 18px 20px 24px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.view-card .draft-page { height: calc(100vh - 210px); }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: var(--control-font); font-family: inherit; line-height: 1;
  cursor: pointer; background: var(--primary-soft); color: var(--text);
  white-space: nowrap; text-decoration: none; transition: var(--transition);
}
.btn:hover { background: var(--primary-soft-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary {
  background: var(--grad); color: #fff; font-weight: bold;
  box-shadow: 0 6px 16px var(--primary-shadow);
}
.btn-primary:hover { background: var(--grad-hover); }
.btn-danger { background: var(--danger-weak); color: var(--red); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-weak-hover); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--primary-weak); border-color: var(--primary-border); }
.btn-sm {
  height: var(--control-h-sm); padding: 0 11px;
  font-size: 12px; border-radius: var(--radius-sm);
}
.btn[disabled], .btn:disabled {
  opacity: .5; cursor: not-allowed; pointer-events: none; transform: none;
}
input, select, textarea {
  font-family: inherit; font-size: var(--control-font); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 8px 12px; background: #fff; transition: var(--transition);
}
input:not([type="checkbox"]):not([type="radio"]), select { height: var(--control-h); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--primary-border);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
input:disabled, select:disabled, textarea:disabled {
  background: #f4f4f8; color: var(--muted); cursor: not-allowed;
}
textarea { resize: vertical; }
label.fl { display: block; margin: 13px 0 5px; font-size: 13px; color: var(--muted); }
label.fl b.req { color: var(--red); margin-left: 2px; }
.fl input, .fl select, .fl textarea { width: 100%; }

/* ---------- 提示条与统计 ---------- */
.banner {
  border-radius: var(--radius-lg); padding: 13px 18px; margin-bottom: 18px;
  background: #fff7e8; border: 1px solid #f3e0b3; color: #8a6116;
}
.banner.strong {
  background: linear-gradient(135deg, #fff1f0, #ffe9e8); border-color: #f6c6c6;
  color: #b02620; font-weight: bold;
}
.banner a { color: inherit; text-decoration: underline; }
/* 首页卡片 */
.stat-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.stat-card .stat-label { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.stat-card .stat-val { font-size: 26px; line-height: 1.1; font-weight: bold; color: var(--primary-dark); }
.stat-card .stat-val.warn { color: var(--amber); }
.stat-card .stat-val.bad { color: var(--red); }
.stat-card .stat-val.ok { color: var(--green); }
.ck-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-bottom: 18px; }
.ck-block, .dash-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 18px 20px; margin-bottom: 18px;
}
.ck-block { margin-bottom: 0; }
.ck-block .sec-title, .dash-card .sec-title { margin-top: 0; }
.ck-tbl td { font-size: 13px; }
.ck-bar { height: 8px; background: var(--track-bg); border-radius: 6px; overflow: hidden; }
.ck-bar-fill { height: 100%; background: var(--grad); border-radius: 6px; min-width: 0; }
.sec-title { font-size: 15px; margin: 6px 0 12px; }
.sem-line { margin-bottom: 24px; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-block; border-radius: var(--radius-pill); padding: 2.5px 11px;
  font-size: 12px; white-space: nowrap; vertical-align: middle;
}
.b-line-专业建设 { background: #e8eafc; color: #4a54d8; }
.b-line-课程建设 { background: #e2f7ec; color: #0f8f5b; }
.b-line-创新教育 { background: #fdf1dc; color: #c07608; }
.b-line-教研教改 { background: #f3ecfd; color: #7a3fe0; }
.b-line- { background: #eeeef4; color: #8a89a6; }
.b-st-未排期 { background: #eeeef4; color: #6d6c88; }
.b-st-进行中 { background: #e8eafc; color: #4a54d8; }
.b-st-已完成 { background: #e2f7ec; color: #0f8f5b; }
/* 完成情况/成效总结：默认只读文字，点击进入编辑 */
.cell-status[data-edit] { cursor: pointer; user-select: none; }
.cell-status[data-edit]:hover .badge { box-shadow: 0 0 0 2px var(--primary-ring); }
.cell-status .st-select { height: 30px; padding: 0 8px; font-size: 12.5px; }
.cell-sum[data-edit] { cursor: text; }
.cell-sum[data-edit]:hover { background: var(--row-hover); }
.b-due { background: #fdf1dc; color: #c07608; }
.b-overdue { background: #feecec; color: #e5484d; font-weight: bold; }
.b-doc { background: #eeeef4; color: #55547a; }
.b-week { background: var(--grad); color: #fff; font-weight: bold; }
.b-arch { background: #ececec; color: #666; }

/* 任务分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.pager .muted { font-size: 12.5px; }

/* ---------- 周视图 / 任务卡片 ---------- */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .spacer { flex: 1; }
.week-title {
  font-size: 15px; font-weight: bold; min-width: 200px; text-align: center;
  background: var(--card); border-radius: var(--radius-lg); padding: 8px 14px;
  box-shadow: var(--shadow);
}
.seg {
  display: inline-flex; border-radius: var(--radius-md); overflow: hidden;
  background: var(--primary-soft); padding: 3px;
}
.seg button {
  border: 0; background: transparent; padding: 0 18px; height: var(--control-h-sm);
  cursor: pointer; font-size: var(--control-font); font-family: inherit;
  color: var(--muted); border-radius: var(--radius-sm); transition: var(--transition);
}
.seg button:hover { color: var(--text); background: rgba(255, 255, 255, .55); }
.seg button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.seg button.active {
  background: var(--seg-active-bg); color: var(--seg-active-fg); font-weight: bold;
  box-shadow: var(--shadow-sm);
}
/* ---------- 通用表格 ---------- */
.tbl-wrap { overflow-x: auto; margin-bottom: 16px; }
table.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.tbl th, .tbl td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.tbl th { color: var(--muted); font-weight: 600; background: var(--table-head-bg); white-space: nowrap; }
/* 表头全站统一：略高、深色字 */
.tbl thead th { padding-top: 11px; padding-bottom: 11px; color: #3a394d; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--row-hover); }
.nowrap { white-space: nowrap; }
.cell-title .tt { font-weight: normal; color: #111; }
/* 序号列：任务表与来文表共用的窄列样式 */
.tbl thead th.th-no { width: 1%; text-align: center; }
.tbl .cell-no {
  color: var(--muted); text-align: center; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cell-title .sub {
  font-size: 12px; color: var(--muted); max-width: 300px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 事项名称/成效总结/支撑材料按百分比分配宽度，其余列收缩到刚好够用 */
.task-tbl thead th { width: 1%; }
.task-tbl thead th.th-title { width: 26%; }
.task-tbl thead th.th-cat { width: 8%; }
.task-tbl thead th.th-owner { width: 5.5%; }
.task-tbl thead th.th-status { width: 9.5%; }
.task-tbl thead th.th-plan { width: 6.5%; }
.task-tbl thead th.th-sum { width: 30%; min-width: 20%; }
.task-tbl thead th.th-att { width: 9%; }
.cell-sum textarea.r-input {
  width: 100%; min-width: 140px; min-height: 38px; padding: 6px 10px;
  line-height: 1.5; resize: none; overflow: auto; field-sizing: content;
}
.cell-sum .sum-text {
  display: block; white-space: pre-wrap;
  overflow-wrap: anywhere; word-break: break-word; line-height: 1.5;
}
.cell-att .t-atts { margin: 0; }
.cell-ops { white-space: nowrap; }
.cell-ops .btn { padding: 0 9px; }
.t-atts { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.att {
  display: inline-flex; align-items: center; gap: 5px; background: var(--primary-weak);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 10px;
  font-size: 12px;
}
.att .del { cursor: pointer; color: var(--red); padding: 0 2px; }
.empty {
  text-align: center; color: var(--muted); padding: 46px 0;
  border: 1px dashed var(--border); border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .45);
}

/* ---------- 排期 ---------- */
.inline-schedule { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- 来文/发文 ---------- */
.doc-expander { cursor: pointer; }
.doc-expander:hover .tt { color: var(--primary); }
.expander {
  display: inline-block; color: var(--muted); margin-right: 4px;
  transition: transform .15s; vertical-align: -1px;
}
tr.doc-row.open .expander { transform: rotate(90deg); }
.doc-detail td { background: var(--detail-bg); }
.doc-detail .d-sec { margin-bottom: 14px; }
.doc-detail .sec-t { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.task-mini {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px dashed #e5e2f4; font-size: 13px;
}
.tab-row { display: flex; gap: 6px; margin-bottom: 16px; }
.tab-row button {
  border: 1px solid var(--tab-border-color); background: #fff;
  height: var(--control-h); padding: 0 22px; font-size: 14px; cursor: pointer;
  color: var(--muted); border-radius: var(--radius-lg); font-family: inherit;
  box-shadow: var(--tab-shadow); transition: var(--transition);
}
.tab-row button:hover { color: var(--primary); }
.tab-row button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tab-row button.active {
  background: var(--tab-active-bg); color: #fff; font-weight: bold;
  box-shadow: 0 6px 16px var(--primary-shadow);
}

/* ---------- AI 拆任务 / 系统配置 ---------- */
.modal.wide { width: 800px; }
.ai-grid { display: grid; grid-template-columns: 92px 1fr; column-gap: 12px; align-items: center; }
.ai-grid label.fl { margin: 9px 0 0; }
.ai-grid input, .ai-grid select { width: 100%; margin-bottom: 9px; }
.ai-tbl th, .ai-tbl td { padding: 6px 8px; }
.ai-tt { min-width: 260px; }
.ai-tt input { width: 100%; margin-bottom: 4px; }
.ai-tt input.ai-detail { margin-bottom: 0; font-size: 12px; color: var(--muted); }
.ai-preview { margin-top: 12px; font-size: 12px; }
.ai-preview summary { cursor: pointer; color: var(--muted); }
.ai-err { color: var(--red); min-height: 18px; margin-top: 8px; font-size: 13px; }

/* ---------- 月度简报 ---------- */.report-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: var(--radius-pill);
  padding: 6px 16px; cursor: pointer; font-size: var(--control-font);
  box-shadow: var(--chip-shadow); transition: var(--transition);
}
.chip:hover { border-color: var(--primary-border); color: var(--primary); }
.chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip.active { background: var(--chip-active-bg); color: #fff; border-color: transparent; }
.report-doc {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 48px 58px; min-height: 420px; line-height: 2.05; font-size: 15px;
  font-family: "SimSun", "Songti SC", serif;
}
.report-doc:focus { outline: 2px solid #d6cffb; }
.report-doc h2 { text-align: center; font-size: 20px; margin: 0 0 22px; font-family: inherit; }
.report-doc h3 { font-size: 16px; margin: 20px 0 8px; font-family: inherit; }
.report-doc p { margin: 8px 0; text-indent: 2em; }
.report-doc p:first-of-type { text-indent: 0; text-align: center; }

/* ---------- 用户管理（表格样式见「通用表格」） ---------- */

/* ---------- 弹窗 ---------- */
.modal-ov {
  position: fixed; inset: 0; background: rgba(20, 16, 56, .5); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px;
  backdrop-filter: blur(3px);
}
.modal {
  background: #fff; border-radius: var(--radius-xl); padding: 26px 30px; width: 490px;
  max-width: 96vw; max-height: 82vh; overflow: auto;
  box-shadow: 0 24px 70px rgba(10, 8, 40, .35);
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal .m-ops { margin-top: 22px; text-align: right; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg); color: #fff; border-radius: var(--radius-lg); padding: 11px 24px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  box-shadow: 0 12px 34px rgba(10, 8, 40, .4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b3362e; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 1100px) {
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .side { position: static; width: auto; padding: 10px; }
  .side .logo { padding: 6px 12px 12px; }
  .side nav { display: flex; overflow-x: auto; }
  .side nav a { white-space: nowrap; padding: 9px 13px; }
  .side-tip { display: none; }
  .main { margin-left: 0; }
  .view { padding: 14px 16px 50px; }
  .view-card { margin: 8px 12px 18px; padding: 14px 14px 20px; }
  .topbar { padding: 14px 16px 4px; }
  .ck-grid { grid-template-columns: 1fr; }
}

/* ---------- AI 智稿 ---------- */
.draft-page {
  max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column;
  height: calc(100vh - 150px); min-height: 520px;
}
.draft-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.draft-head h3 { margin: 0; font-size: 18px; }
.draft-head select { width: auto; padding: 6px 10px; }
.draft-head .spacer { flex: 1; }
.draft-body { flex: 1; display: flex; gap: 14px; min-height: 0; }
.draft-history {
  width: 230px; flex: none; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); display: flex;
  flex-direction: column; overflow: hidden;
}
.draft-history-head {
  padding: 12px 14px; font-size: 13px; font-weight: bold;
  border-bottom: 1px solid var(--border);
}
.draft-history-list { flex: 1; overflow-y: auto; padding: 6px; }
.draft-conv {
  display: flex; align-items: flex-start; gap: 6px; padding: 8px 9px;
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
}
.draft-conv:hover { background: var(--list-hover-bg); }
.draft-conv.active { background: var(--list-active-bg); }
.draft-conv-main { flex: 1; min-width: 0; }
.draft-conv .t {
  font-size: 13px; line-height: 1.5; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.draft-conv .d { font-size: 11px; color: var(--muted); margin-top: 2px; }
.draft-conv .del {
  color: var(--muted); font-size: 12px; padding: 1px 4px;
  border-radius: 5px; visibility: hidden;
}
.draft-conv:hover .del { visibility: visible; }
.draft-conv .del:hover { color: var(--red); background: #feecec; }
.draft-conv-empty { padding: 10px; font-size: 12px; }
.draft-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.draft-chat {
  flex: 1; overflow-y: auto; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.draft-empty { text-align: center; padding: 36px 16px; }
.draft-empty-icon { font-size: 40px; }
.draft-empty h3 { margin: 10px 0 6px; }
.draft-empty p { max-width: 560px; margin: 0 auto; line-height: 1.8; }
.draft-examples { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 18px auto 0; }
.draft-example {
  text-align: left; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 14px; cursor: pointer;
  color: var(--text); font-size: var(--control-font); font-family: inherit;
  transition: var(--transition);
}
.draft-example:hover { border-color: var(--primary); color: var(--primary); }
.draft-example:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.draft-msg { display: flex; flex-direction: column; margin-bottom: 18px; }
.draft-msg.user { align-items: flex-end; }
.draft-msg.ai { align-items: flex-start; }
.bubble {
  max-width: 86%; padding: 12px 16px; border-radius: 12px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
}
.draft-msg.user .bubble {
  background: var(--grad); color: #fff; border-bottom-right-radius: 4px;
}
.draft-msg.ai .bubble {
  background: var(--bubble-ai-bg); border: 1px solid var(--border); color: var(--text);
  border-bottom-left-radius: 4px;
}
.draft-msg.ai .bubble.doc-text {
  font-family: "宋体", "SimSun", serif; font-size: 15px; line-height: 2;
  max-width: 100%; width: 100%; padding: 20px 24px;
}
.draft-msg.ai .bubble.doc-text { white-space: normal; }
.doc-text p { margin: 0 0 10px; white-space: pre-wrap; }
.doc-text p:last-child { margin-bottom: 0; }
.doc-table { margin: 10px 0; overflow-x: auto; }
.doc-table table {
  width: 100%; border-collapse: collapse; font-family: inherit; font-size: 14px;
  line-height: 1.6; background: #fff;
}
.doc-table th, .doc-table td {
  border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top;
}
.doc-table th { background: var(--table-head-bg); font-weight: 600; }
.bubble.pending { color: var(--muted); }
.bubble.err { color: var(--red); background: #fff5f5 !important; border-color: #f6c8c8 !important; }
.msg-ops { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: 12px; }
.draft-warn { color: var(--amber); }
.draft-input { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.draft-input textarea {
  flex: 1; resize: vertical; min-height: 70px; max-height: 220px; line-height: 1.7;
}
.draft-input .btn { height: 44px; white-space: nowrap; }
.draft-pick-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.draft-pick-bar input { flex: 1; min-width: 220px; }
.draft-pick-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.draft-pick-cols h4 { margin: 0 0 8px; font-size: 14px; }
.draft-pick-list {
  max-height: 320px; overflow: auto; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 6px;
}
.draft-pick-item {
  display: flex; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm);
  cursor: pointer; align-items: flex-start; transition: var(--transition);
}
.draft-pick-item:hover { background: var(--list-hover-bg); }
.draft-pick-item input { margin-top: 3px; }
.draft-pick-item span { display: flex; flex-direction: column; font-size: 13px; }
.draft-pick-item em { font-style: normal; color: var(--muted); font-size: 12px; margin-top: 2px; }
.modal.modal-wide { width: 760px; }
@media (max-width: 760px) {
  .draft-page { height: auto; }
  .draft-body { flex-direction: column; }
  .draft-history { width: auto; max-height: 180px; }
  .draft-history-list { max-height: 130px; }
  .draft-pick-cols { grid-template-columns: 1fr; }
  .bubble { max-width: 95%; }
}
