/* 信捷杯轻量工单系统 - 工单专属样式（卡片列表 / 时间线 / 上传 / 统计块联动） */
/* 配色沿用主项目 CSS 变量：--xinje-blue #0a5cb8 等，见 admin.css */

/* ---------- 学生端布局（student-header 沿用 student.css，这里补主内容容器） ---------- */
.stu-main-wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; }
.stu-open-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.open-card { background: var(--card, #fff); border-radius: 14px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(31,39,51,.06); display: flex; align-items: center; gap: 12px; }
.open-card.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border .12s ease; border: 1px solid transparent; }
.open-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(10,92,184,.14); }
.open-card.clickable.active { border-color: var(--xinje-blue, #0a5cb8); }
.open-card .oc-num { font-size: 30px; font-weight: 700; color: var(--xinje-blue, #0a5cb8); line-height: 1; }
.open-card.oc-warn .oc-num { color: #d9534f; }
.open-card .oc-label { font-size: 13px; color: var(--ink-sub, #6b7686); }

.stu-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.stu-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stu-tab { border: 1px solid #dfe5ee; background: #fff; color: var(--ink-sub, #6b7686); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s; }
.stu-tab:hover { border-color: var(--xinje-blue, #0a5cb8); color: var(--xinje-blue, #0a5cb8); }
.stu-tab.active { background: var(--xinje-blue, #0a5cb8); border-color: var(--xinje-blue, #0a5cb8); color: #fff; }

/* ---------- 工单卡片列表 ---------- */
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-item { background: var(--card, #fff); border-radius: 14px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(31,39,51,.06); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.ticket-item:hover { box-shadow: 0 4px 16px rgba(10,92,184,.14); transform: translateY(-1px); }
.ti-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ti-id { font-family: Consolas, monospace; font-size: 12px; color: var(--ink-sub, #6b7686); }
.ti-title { font-size: 15px; font-weight: 600; color: var(--ink, #1f2733); margin: 6px 0 4px; }
.ti-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-sub, #6b7686); flex-wrap: wrap; }
.ti-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 18px; }
.ti-badge.cat { background: rgba(10,92,184,.08); color: var(--xinje-blue, #0a5cb8); }
.ti-badge.st-待分配 { background: #fff4e5; color: #c77c11; }
.ti-badge.st-待解决 { background: rgba(10,92,184,.1); color: var(--xinje-blue, #0a5cb8); }
.ti-badge.st-处理中 { background: rgba(10,92,184,.1); color: var(--xinje-blue, #0a5cb8); } /* 历史数据兼容 */
.ti-badge.st-已解决 { background: #e6f6ec; color: #1e8e4e; }
.ti-badge.st-已关闭 { background: #eef0f4; color: #6b7686; }
/* 两态展示徽章（学生/工程师视角）：进行中 / 已完成 */
.ti-badge.st-进行中 { background: rgba(10,92,184,.1); color: var(--xinje-blue, #0a5cb8); }
.ti-badge.st-已完成 { background: #e6f6ec; color: #1e8e4e; }
.ti-assignee { color: var(--ink-sub, #6b7686); }
.ti-assignee b { color: var(--ink, #1f2733); font-weight: 600; }
/* 待行动红点：学生待反馈 / 工程师待回复 / admin 待分配 */
.ti-dot { display: inline-block; width: 9px; height: 9px; background: #e5484d; border-radius: 50%; margin-left: 4px; vertical-align: middle; animation: tiDotPulse 1.6s ease-in-out infinite; }
@keyframes tiDotPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.ticket-empty { text-align: center; color: var(--ink-sub, #6b7686); padding: 48px 0; font-size: 14px; background: transparent; }

/* ---------- 详情弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-mask[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.modal-card.modal-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--ink, #1f2733); }
.modal-close { border: none; background: none; font-size: 22px; color: var(--ink-sub, #6b7686); cursor: pointer; line-height: 1; padding: 4px; }
.modal-close:hover { color: var(--ink, #1f2733); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.td-info { background: #f7f9fc; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; color: var(--ink, #1f2733); }
/* 学生等待提示条（追问制状态引导） */
.td-wait-tip { background: rgba(10,92,184,.07); color: var(--xinje-blue, #0a5cb8); border-radius: 10px; padding: 9px 14px; font-size: 12.5px; line-height: 1.6; margin: -6px 0 12px; }
.td-info .td-line { margin: 3px 0; }
.td-info .td-line b { color: var(--ink-sub, #6b7686); font-weight: 500; margin-right: 4px; }
.td-info .td-content { white-space: pre-wrap; margin-top: 6px; line-height: 1.6; }
.td-info .td-image { max-width: 100%; border-radius: 8px; margin-top: 8px; cursor: zoom-in; }

.td-replies { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; max-height: 320px; overflow-y: auto; }
.td-reply { display: flex; flex-direction: column; align-items: flex-start; }
/* 自己发的消息：右侧蓝色气泡（微信式） */
.td-reply.self-mine { align-items: flex-end; }
.td-reply.self-mine .td-reply-bubble { background: var(--xinje-blue, #0a5cb8); color: #fff; }
.td-reply.self-mine .td-reply-meta { text-align: right; }
.td-reply.self-student { align-items: flex-end; }
.td-reply-bubble { max-width: 82%; background: #f2f5f9; border-radius: 12px; padding: 8px 12px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.td-reply.eng .td-reply-bubble, .td-reply.role-admin .td-reply-bubble { background: rgba(10,92,184,.09); }
/* 自己发的消息优先于角色配色（右对齐蓝色），角色仅影响他人气泡 */
.td-reply.self-mine.role-admin .td-reply-bubble,
.td-reply.self-mine.role-engineer .td-reply-bubble,
.td-reply.self-mine.role-student .td-reply-bubble { background: var(--xinje-blue, #0a5cb8); color: #fff; }
.td-reply-meta { font-size: 11px; color: var(--ink-sub, #6b7686); margin: 4px 4px 0; }
.td-reply-bubble img { max-width: 220px; border-radius: 8px; margin-top: 6px; cursor: zoom-in; display: block; }
/* 系统消息（认领/分配/结单等）：居中无气泡，优先于左右对齐 */
.td-reply.system { align-items: center !important; }
.td-reply.system .td-reply-meta { text-align: center; }
/* 系统消息（认领/分配/结单等）：任何发送者/查看者组合都强制黑色文字透明底，
   color 也要 !important —— 否则被 .self-mine.role-xxx 的白字规则（更高优先级）覆盖成白字 */
.td-reply.system .td-reply-bubble,
.td-reply.self-mine.system .td-reply-bubble {
  background: transparent !important; color: #1f2733 !important; font-size: 12px; padding: 2px 8px;
}

.td-reply-input { margin-top: 14px; }
.td-composer {
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.td-composer:focus-within { border-color: var(--xinje-blue, #0a5cb8); box-shadow: 0 0 0 3px rgba(10,92,184,.06); }
.td-reply-input textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  max-height: 180px;
  border: 0;
  border-radius: 0;
  padding: 12px 14px 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.td-reply-input textarea:focus { outline: none; }
.td-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 4px 8px 5px 10px;
}
.td-composer-tools { display: flex; align-items: center; }
.td-file-input { display: none; }
.td-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: #788392;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.td-tool-btn svg { width: 20px; height: 20px; }
.td-tool-btn:hover { background: var(--xinje-blue-soft, rgba(10,92,184,.08)); color: var(--xinje-blue, #0a5cb8); }
.td-composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
/* 提问弹窗复用 composer：textarea 直接内嵌（无 .td-reply-input 包装层） */
.nt-composer textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  max-height: 220px;
  border: 0;
  border-radius: 0;
  padding: 12px 14px 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  background: transparent;
  color: var(--ink, #1f2733);
}
.nt-composer textarea:focus { outline: none; }
.nt-composer .td-composer-bar { justify-content: flex-start; }
.td-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #f5f7fa;
}
.td-attachment-preview[hidden] { display: none; }
.td-attachment-preview .upload-preview { flex-shrink: 0; border: 0; }
.td-attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--ink-sub, #6b7686); }
.td-attachment-remove { flex-shrink: 0; margin-left: auto; border: 0; background: none; color: #8b95a3; font-size: 17px; line-height: 1; cursor: pointer; padding: 3px; }
.td-attachment-remove:hover { color: #d9534f; }

.td-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.td-actions:empty { display: none; }
/* 对话框底部独立动作按钮行（追问/完成等），不随输入框显隐 */
.td-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}
.td-actions-bar:empty { display: none; }
/* 已结单只读标记条（替代被隐藏的回复输入框） */
.td-closed-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 10px 14px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #f4f8fd;
  color: var(--ink-sub, #6b7686);
  font-size: 13px;
}
.td-closed-mark .cm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #2e9e5b;
  color: #fff;
  font-size: 12px;
  flex: 0 0 auto;
}
.td-closed-mark .cm-meta { margin-left: auto; font-size: 12px; color: #9aa5b5; }
.td-actions-bar .btn-primary, .td-actions-bar .btn-success, .td-actions-bar .btn-danger, .td-actions-bar .btn-ghost {
  min-height: 34px; height: 34px; padding: 0 18px; font-size: 13px; min-width: 96px;
}
.td-actions .btn-primary,
.td-actions .btn-danger,
.td-actions .btn-ghost,
.td-actions .btn-success {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
}
.td-composer-actions > #tdReplyBtn { min-height: 30px; height: 30px; min-width: 64px; padding: 0 15px; border-radius: 6px; font-size: 12px; }
.td-actions .btn-ghost { background: #f7f9fc; }
.td-actions .btn-ghost:hover { background: var(--xinje-blue-soft, rgba(10,92,184,.08)); }

/* ---------- 上传 ---------- */
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-input { font-size: 12px; color: var(--ink-sub, #6b7686); width: auto; max-width: 100%; padding: 0; border: 0; background: transparent; }
.upload-input::file-selector-button {
  appearance: none;
  margin-right: 10px;
  padding: 5px 12px;
  border: 1px solid #dfe5ee;
  border-radius: 7px;
  background: #f7f9fc;
  color: var(--ink, #1f2733);
  font: inherit;
  cursor: pointer;
}
.upload-input::file-selector-button:hover { border-color: var(--xinje-blue, #0a5cb8); color: var(--xinje-blue, #0a5cb8); background: var(--xinje-blue-soft, rgba(10,92,184,.08)); }
.upload-input::-webkit-file-upload-button {
  appearance: none;
  margin-right: 10px;
  padding: 5px 12px;
  border: 1px solid #dfe5ee;
  border-radius: 7px;
  background: #f7f9fc;
  color: var(--ink, #1f2733);
  font: inherit;
  cursor: pointer;
}
.upload-input::-webkit-file-upload-button:hover { border-color: var(--xinje-blue, #0a5cb8); color: var(--xinje-blue, #0a5cb8); background: var(--xinje-blue-soft, rgba(10,92,184,.08)); }
.upload-preview { max-height: 96px; border-radius: 8px; border: 1px solid #e3e8f0; }
.upload-preview-sm { max-height: 48px; }

/* ---------- 表单控件（modal 内） ---------- */
.field { margin-bottom: 12px; }
.field-select, .field-input, .field-textarea { width: 100%; border: 1px solid #dfe5ee; border-radius: 10px; padding: 9px 12px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink, #1f2733); box-sizing: border-box; }
.field-select:focus, .field-input:focus, .field-textarea:focus { outline: none; border-color: var(--xinje-blue, #0a5cb8); }
.field-textarea { resize: vertical; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-tip { font-size: 12px; color: #d9534f; min-height: 16px; margin: 4px 0; }
.form-tip:empty { margin: 0; min-height: 0; }

/* ---------- admin 统计块 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-block { background: var(--card, #fff); border-radius: 14px; padding: 14px 16px; text-align: center; box-shadow: 0 2px 10px rgba(31,39,51,.06); cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.stat-block:hover { border-color: rgba(10,92,184,.35); }
.stat-block.active { border-color: var(--xinje-blue, #0a5cb8); }
.stat-block .sb-num { font-size: 26px; font-weight: 700; color: var(--ink, #1f2733); line-height: 1.2; }
.stat-block .sb-label { font-size: 12px; color: var(--ink-sub, #6b7686); margin-top: 2px; }
.stat-block.sb-pending .sb-num { color: #c77c11; }
.stat-block.sb-processing .sb-num { color: var(--xinje-blue, #0a5cb8); }
.stat-block.sb-resolved .sb-num { color: #1e8e4e; }
.stat-block.sb-closed .sb-num { color: #6b7686; }

/* ---------- admin 视图骨架（.layout/.sidebar/.content 沿用 admin.css） ---------- */
.side-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line, #e6ebf2); }
.side-footer .logout-btn { width: 100%; justify-content: center; }
.view-sub { margin: -8px 0 14px; font-size: 13px; color: var(--ink-sub, #6b7686); padding: 0 4px; }
.admin-view[hidden] { display: none; }
.table-toolbar { display: flex; gap: 10px; margin-bottom: 12px; justify-content: space-between; flex-wrap: wrap; }
.search-input { border: 1px solid #dfe5ee; border-radius: 10px; padding: 8px 12px; font-size: 13px; min-width: 220px; }
.search-input:focus { outline: none; border-color: var(--xinje-blue, #0a5cb8); }
.table-wrap { padding: 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 11px 14px; color: var(--ink-sub, #6b7686); font-weight: 500; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f4f6fa; color: var(--ink, #1f2733); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.op-btn { border: 1px solid #dfe5ee; background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; margin-right: 6px; color: var(--xinje-blue, #0a5cb8); }
.op-btn:hover { border-color: var(--xinje-blue, #0a5cb8); }
.op-btn.danger { color: #d9534f; }
.op-btn.danger:hover { border-color: #d9534f; }
.op-btn:disabled { color: #b8c0cc; cursor: not-allowed; border-color: #eef1f6; }

/* ---------- 分类管理 ---------- */
.cat-manage { background: #fff; border-radius: 14px; padding: 18px 22px; box-shadow: 0 2px 10px rgba(31,39,51,.06); }
/* 提问额度配置卡 */
.quota-manage { background: #fff; border-radius: 14px; padding: 18px 22px; box-shadow: 0 2px 10px rgba(31,39,51,.06); }
/* 设置区统一行布局：标签 + 控件 + 提示 */
.set-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.set-row:last-child { margin-bottom: 0; }
.set-row > .set-label {
  font-size: 13px;
  color: var(--ink, #1f2733);
  min-width: 150px;
  flex-shrink: 0;
}
.set-row .search-input { width: 140px; }
.set-row .quota-unit { color: var(--ink-sub, #6b7686); font-size: 13px; }
/* 时间输入框宽度统一 */
.set-row input[type="time"].search-input { width: 130px; }
.quota-input { width: 140px; }
.quota-unit { color: var(--ink-sub, #6b7686); font-size: 13px; }
.quota-tip { color: #1e8e4e; font-size: 13px; margin-left: 8px; }
/* 未保存提示小字（琥珀色圆点 + 文案，保存后消失） */
.dirty-tip { color: #c77c11; font-size: 12px; margin-left: 8px; }
.dirty-tip::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #c77c11; margin-right: 4px; vertical-align: 1px; }
/* 上班时段设置：每周上班日复选 */
.ws-days { display: flex; gap: 14px; flex-wrap: wrap; }
.ws-days label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink, #1f2733); cursor: pointer; }
.cat-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(10,92,184,.08); color: var(--xinje-blue, #0a5cb8); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.cat-chip .chip-x { cursor: pointer; font-weight: 700; line-height: 1; }
.cat-chip .chip-x:hover { color: #d9534f; }
.cat-add { display: flex; gap: 10px; }
.cat-add .search-input { width: 260px; }
.cat-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink, #1f2733); background: #f5f7fb; border-radius: 8px; padding: 5px 10px; cursor: pointer; }

/* ---------- 分配弹窗 ---------- */
.assign-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.assign-item { display: flex; justify-content: space-between; align-items: center; border: 1px solid #eef1f6; border-radius: 10px; padding: 10px 14px; }
.assign-item .ai-name { font-size: 14px; color: var(--ink, #1f2733); font-weight: 600; }
.assign-item .ai-cats { font-size: 12px; color: var(--ink-sub, #6b7686); margin-top: 2px; }

/* ---------- 通用按钮 ---------- */
.btn-primary, .btn-ghost, .btn-danger, .btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { background: var(--xinje-blue, #0a5cb8); color: #fff; border: 1px solid var(--xinje-blue, #0a5cb8); }
.btn-primary:hover { background: var(--xinje-blue-deep, #084a96); border-color: var(--xinje-blue-deep, #084a96); }
.btn-primary:disabled { background: #a9c4e4; border-color: #a9c4e4; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink-sub, #6b7686); border: 1px solid #dfe5ee; }
.btn-ghost:hover { color: var(--xinje-blue, #0a5cb8); border-color: rgba(10,92,184,.55); }
.btn-danger { background: #fff; color: #d9534f; border: 1px solid #e7b8b6; }
.btn-danger:hover { background: #fff5f4; border-color: #d9534f; }
/* 语义色按钮：成功类操作用绿色（确认/标记解决），在原色按钮基础上加类名即可 */
.btn-success { background: #1e8e4e; color: #fff; border: 1px solid #1e8e4e; }
.btn-success:hover { background: #176e3c; border-color: #176e3c; }
/* 幽灵按钮语义色：文字着色，底色极浅 */
.btn-ghost.btn-success-ghost { color: #1e8e4e; border-color: #b5dfc5; }
.btn-ghost.btn-success-ghost:hover { background: #e6f6ec; border-color: #1e8e4e; color: #176e3c; }
.modal-foot .btn-primary, .modal-foot .btn-ghost, .modal-foot .btn-danger { min-width: 76px; }
.modal-card .btn-primary:focus-visible, .modal-card .btn-ghost:focus-visible, .modal-card .btn-danger:focus-visible { outline: 2px solid rgba(10,92,184,.28); outline-offset: 2px; }
.link-btn { border: none; background: none; color: var(--xinje-blue, #0a5cb8); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.link-btn:hover { text-decoration: underline; }
/* 学生端退出按钮沿用后台 logout-btn 样式（student.css 无此类，这里补齐） */
.student-header .logout-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; height: 36px;
  background: rgba(212, 56, 13, 0.06); color: #d4380d; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s ease;
}
.student-header .logout-btn:hover { background: rgba(212, 56, 13, 0.10); }

/* ---------- toast ---------- */
/* 三份样式都含 .toast，用更高优先级统一最终几何属性，禁止 top+bottom 同时生效 */
#toast {
  position: fixed;
  top: 28px;
  bottom: auto;
  left: 50%;
  width: auto;
  min-width: 0;
  max-width: min(80vw, 560px);
  height: auto;
  min-height: 0;
  padding: 10px 22px;
  border-radius: 8px;
  background: rgba(31, 39, 51, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 400;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 导航红点 ---------- */
.nav-dot { display: inline-block; width: 8px; height: 8px; background: #e5484d; border-radius: 50%; margin-left: 6px; vertical-align: middle; border: 1.5px solid #fff; box-sizing: content-box; }
.nav-item .nav-dot[hidden] { display: none; }

/* ---------- 图片放大遮罩 ---------- */
.img-zoom-mask { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 300; cursor: zoom-out; }
.img-zoom-mask img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---------- 个人中心（学生 / 工程师） ---------- */
button.header-user-name {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  padding: 2px 3px;
  border-radius: 5px;
}
button.header-user-name:focus-visible { outline: 2px solid rgba(10,92,184,.35); outline-offset: 2px; }
.profile-modal-card { max-width: 460px; }
.profile-account {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  background: #f5f8fc;
  border: 1px solid #e5edf7;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--xinje-blue, #0a5cb8);
  background: rgba(10,92,184,.1);
}
.profile-avatar svg { width: 26px; height: 26px; }
.profile-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.profile-identity strong { font-size: 16px; color: var(--ink, #1f2733); overflow-wrap: anywhere; }
.profile-role { flex: 0 0 auto; color: var(--xinje-blue, #0a5cb8); background: rgba(10,92,184,.09); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.profile-details { grid-column: 1 / -1; margin: 0; padding-top: 11px; border-top: 1px solid #e3eaf3; font-size: 13px; }
.profile-details > div { display: flex; gap: 10px; margin-top: 5px; }
.profile-details dt { color: var(--ink-sub, #6b7686); flex: 0 0 52px; }
.profile-details dd { margin: 0; color: var(--ink, #1f2733); overflow-wrap: anywhere; }
.profile-details > div[hidden] { display: none; }
.profile-section-title { margin: 0 0 13px; font-size: 14px; font-weight: 600; color: var(--ink, #1f2733); }
.profile-security-tip { color: var(--ink-sub, #6b7686); font-size: 12px; line-height: 1.6; margin: 0 0 6px; }

/* ---------- 公安备案：所有视图的页面底部 ---------- */
.beian-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 18px 16px 20px;
  margin-top: auto;
  position: relative;
  z-index: 2;
}
.beian-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #6b7686;
  font-size: 12px;
  line-height: 22px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.beian-link:hover { color: var(--xinje-blue, #0a5cb8); }
.beian-link img { width: 20px; height: 20px; flex: 0 0 20px; object-fit: contain; }
.beian-link:focus-visible { outline: 2px solid rgba(10,92,184,.35); outline-offset: 4px; border-radius: 3px; }
body { min-height: 100vh; display: flex; flex-direction: column; }
#loginView, #studentView, #adminView { flex: 1 0 auto; }
#loginView .page { min-height: calc(100vh - 62px); }
#adminView .layout { min-height: calc(100vh - 130px); }
#studentView .stu-main-wrap { padding-bottom: 20px; }
@media (max-width: 640px) {
  .beian-footer { padding: 14px 12px 18px; }
  .beian-link { font-size: 11px; }
}

/* 桌面悬浮球下载入口，基础样式 */
.desktop-download-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--xinje-blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.desktop-download-link:hover { background: var(--xinje-blue-soft); border-color: var(--xinje-blue); }
.desktop-download-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.header-user { display: flex; align-items: center; gap: 12px; }
.header-download-link { padding: 7px 10px; font-size: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .form-row2 { grid-template-columns: 1fr; }
  .stu-toolbar { flex-direction: column; align-items: stretch; }
  .btn-new-ticket { width: 100%; }
  .desktop-download-link { justify-content: center; }
  .header-download-link { padding: 7px; }
  .header-download-link span { display: none; }
  .layout { flex-direction: column; padding: 10px; }
  .sidebar { width: 100%; position: static; height: auto; }
}
