/* ==========================================================================
 * 导航小助手 · 管理后台 —— 样式表
 * 纯原生 CSS，无外部字体 / 图标 / 框架依赖。
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * 1. 基础与变量
 * -------------------------------------------------------------------------- */
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f1f1f;
  --text-2: #595959;
  --text-3: #8c8c8c;
  --line: #f0f0f0;
  --line-soft: #f5f5f5;
  --blue: #1677ff;
  --blue-soft: #eef5ff;
  --red: #ff4d4f;
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --radius-card: 12px;
  --radius-ctl: 6px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
 * 2. 整体布局
 * -------------------------------------------------------------------------- */
.app {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  min-height: 100vh;
}

.sidebar {
  flex: 0 0 300px;
  width: 300px;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 12px 12px 18px;
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 14px 16px 26px;
  min-height: calc(100vh - 20px);
  position: relative;
}

/* --------------------------------------------------------------------------
 * 3. 左栏：机器人信息
 * -------------------------------------------------------------------------- */
.bot-head { display: flex; align-items: center; gap: 10px; }

.bot-avatar {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #262b36;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bot-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bot-meta { min-width: 0; flex: 1 1 auto; }

.bot-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
 * 4. 左栏：检查 / 中断控制
 * -------------------------------------------------------------------------- */
.side-actions { display: flex; gap: 8px; margin-top: 12px; }

.btn-outline-blue,
.btn-outline-red {
  flex: 1 1 0;
  height: 32px;
  background: #fff;
  border-radius: var(--radius-ctl);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background-color .15s ease;
}

.btn-outline-blue { border: 1px solid var(--blue); color: var(--blue); }
.btn-outline-red { border: 1px solid var(--red); color: var(--red); }
.btn-outline-blue:hover { background: #f2f8ff; }
.btn-outline-red:hover { background: #fff2f2; }
.btn-outline-blue:disabled,
.btn-outline-red:disabled { opacity: .6; cursor: not-allowed; }

/* --------------------------------------------------------------------------
 * 5. 左栏：操作群
 * -------------------------------------------------------------------------- */
.group-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }

.group-label { flex: 0 0 auto; font-size: 12px; color: var(--text-3); }

.group-select-wrap { position: relative; flex: 1 1 auto; min-width: 0; }

.group-select {
  width: 100%;
  height: 32px;
  appearance: none;
  -webkit-appearance: none;
  background: #f5f5f5;
  border: 1px solid #ededed;
  border-radius: var(--radius-ctl);
  padding: 0 26px 0 8px;
  font-size: 12px;
  color: #333;
  text-overflow: ellipsis;
  cursor: pointer;
  outline: none;
}
.group-select:focus { border-color: var(--blue); }
.group-select:disabled { color: #b5b5b5; cursor: not-allowed; }

.group-select-wrap .chev {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: #9c9c9c;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
 * 6. 左栏：菜单
 * -------------------------------------------------------------------------- */
.menu { margin-top: 6px; }

.menu-group {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 10px;
}

.menu-group-title {
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 6px 6px;
  text-align: left;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .15s ease;
  user-select: none;
}
.menu-item:hover { background: #f7f9fc; }
.menu-item.active { background: var(--blue-soft); }

.menu-ico {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.menu-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: #262626;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-chev { flex: 0 0 auto; display: flex; color: #c8c8c8; }

/* --------------------------------------------------------------------------
 * 7. 右栏：标题区
 * -------------------------------------------------------------------------- */
.main-head { position: relative; padding: 10px 0 12px; }

.main-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.main-sub {
  margin-top: 6px;
  font-size: 11px;
  color: #9b9b9b;
  text-align: center;
  line-height: 1.4;
  word-break: break-all;
  padding: 0 96px;
}

.link-btn {
  position: absolute;
  right: 0;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 2px 4px;
  font-size: 12px;
  color: var(--blue);
  cursor: pointer;
  white-space: nowrap;
}
.link-btn:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
 * 8. 右栏：通用按钮 / 说明
 * -------------------------------------------------------------------------- */
.btn-primary {
  display: block;
  width: 100%;
  height: 44px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn-primary:hover { background: #0f6ae8; }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; }

.btn-danger-outline {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 15px;
  border-radius: var(--radius-ctl);
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn-danger-outline:hover { background: #fff5f5; }
.btn-danger-outline:disabled { opacity: .65; cursor: not-allowed; }

.panel-hint {
  font-size: 12px;
  color: #9c9c9c;
  margin: 2px 0 8px;
}

.qa-desc {
  font-size: 13px;
  color: var(--text-3);
  margin: 2px 0 12px;
  line-height: 1.6;
}

.list-loading {
  padding: 22px 0;
  text-align: center;
  font-size: 13px;
  color: #b0b0b0;
}

/* --------------------------------------------------------------------------
 * 9. 右栏：问答 / 指令列表
 * -------------------------------------------------------------------------- */
.qa-list { margin-top: 14px; }

.qa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background-color .15s ease;
}
.qa-row:hover { background: #fafcff; }

.badge {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.badge-on { background: var(--green-soft); color: var(--green); }
.badge-off { background: #f2f2f2; color: #9a9a9a; }
.badge-busy { opacity: .5; }

.qa-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #262626;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qa-acts { flex: 0 0 auto; display: flex; gap: 8px; }

.btn-mini {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-ctl);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-mini-blue { background: #fff; border: 1px solid var(--blue); color: var(--blue); }
.btn-mini-blue:hover { background: #f2f8ff; }
.btn-mini-red { background: var(--red); border: 1px solid var(--red); color: #fff; }
.btn-mini-red:hover { background: #f53f41; }
.btn-mini:disabled { opacity: .6; cursor: not-allowed; }

.btn-more {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 12px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: var(--radius-ctl);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.btn-more:hover { background: #fafafa; }
.btn-more:disabled { opacity: .65; cursor: not-allowed; }

/* 空状态 / 施工中 */
.empty { text-align: center; padding: 34px 0 20px; }
.empty-text { margin-top: 10px; font-size: 13px; color: #b5b5b5; }

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 16px 40px;
  text-align: center;
}
.placeholder-title { font-size: 16px; font-weight: 600; color: var(--text-2); }
.placeholder-desc { font-size: 13px; color: #a6a6a6; }

/* --------------------------------------------------------------------------
 * 10. 右栏：表单 / 表格 / 预览
 * -------------------------------------------------------------------------- */
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #262626;
  margin: 6px 0 4px;
  padding-left: 8px;
  border-left: 3px solid var(--blue);
  line-height: 1.2;
}
.section-title + .section-desc { margin-top: 6px; }

.section-desc { font-size: 12px; color: var(--text-3); margin: 0 0 10px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }

.btn {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-ctl);
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-default { background: #fff; border-color: #d9d9d9; color: #404040; }
.btn-default:hover { background: #fafafa; }
.btn-primary-sm { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary-sm:hover { background: #0f6ae8; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #f53f41; }

.input {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-ctl);
  padding: 8px 10px;
  font-size: 13px;
  color: #262626;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22, 119, 255, .12); }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.6; }
.input-sm { padding: 5px 8px; font-size: 12px; }
.input-file { font-size: 12px; color: var(--text-2); max-width: 100%; }

.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-row-inline { display: flex; align-items: center; gap: 10px; }
.form-label-inline { margin-bottom: 0; }

.seg { display: inline-flex; border: 1px solid #e0e0e0; border-radius: var(--radius-ctl); overflow: hidden; }
.seg-btn {
  padding: 6px 14px;
  font-size: 13px;
  background: #fff;
  border: none;
  border-right: 1px solid #e0e0e0;
  color: var(--text-2);
  cursor: pointer;
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active { background: #e8f2ff; color: var(--blue); font-weight: 600; }

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #d9d9d9;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color .15s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: left .15s ease;
}
.switch.on { background: var(--blue); }
.switch.on::after { left: 22px; }
.switch-sm { width: 36px; height: 20px; }
.switch-sm::after { width: 16px; height: 16px; }
.switch-sm.on::after { left: 18px; }

/* 缩略图 */
.thumb-wrap { margin-top: 8px; }
.thumb-empty { font-size: 12px; color: #b5b5b5; }
.thumb-box { position: relative; display: inline-block; }
.thumb {
  display: block;
  max-width: 160px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid #eee;
  object-fit: cover;
}
.thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* 多图缩略图行（回复图片） */
.thumb-tip { margin-top: 6px; font-size: 12px; color: #b5b5b5; }

/* 问答 / 群内指令编辑器 */
.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.form-label-row .form-label { margin-bottom: 0; }

.size-badge {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.6;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  white-space: nowrap;
}
.size-badge-over { background: #fdecec; color: #ef4444; }

textarea.input.content-textarea { min-height: 168px; }

.insert-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.insert-label { font-size: 12px; color: var(--text-3); }

.btn-dashed {
  height: 30px;
  padding: 0 12px;
  border: 1px dashed #c9d2de;
  border-radius: var(--radius-ctl);
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-dashed:hover { border-color: var(--blue); color: var(--blue); background: #f5f9ff; }
.btn-dashed:disabled { opacity: .6; cursor: not-allowed; }

/* 输入框 + 按钮同一行（插入图片弹窗的「图片URL + 上传」） */
.input-with-btn { display: flex; align-items: center; gap: 8px; }
.input-with-btn .input { flex: 1 1 auto; min-width: 0; }
.input-with-btn .btn { flex: 0 0 auto; }

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.check-line input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }

.md-preview {
  margin-top: 8px;
  padding: 12px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-size: 13px;
  line-height: 1.7;
  color: #262626;
  white-space: pre-wrap;
  word-break: break-word;
}
.md-preview-img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid #eee;
}
.md-preview-link { color: var(--blue); text-decoration: underline; word-break: break-all; }
.preview-mode { font-size: 12px; color: var(--text-3); }

/* 入群提示面板 */
.welcome-form { max-width: 720px; }
.welcome-top { display: flex; justify-content: flex-end; margin-bottom: 12px; }

.switch-lg { width: 56px; height: 28px; border-radius: 14px; }
.switch-lg::after { width: 24px; height: 24px; }
.switch-lg.on::after { left: 30px; }

.button-bar {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid #d8e4f5;
  border-radius: 8px;
  background: #f3f8ff;
  color: var(--blue);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.button-bar:hover { border-color: var(--blue); }
.button-bar-empty { border-style: dashed; color: #9aa3af; background: #fafbfc; }
.button-bar-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.button-bar-remove {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.button-bar-remove:hover { background: var(--red); }
.button-bar-remove svg { width: 12px; height: 12px; }

.ops-icon-add { font-size: 15px; line-height: 1; }

.btn-add-row {
  height: 30px;
  margin-top: 8px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
}
.btn-add-row:hover { background: #f2f8ff; }
.btn-add-row:disabled { color: #bfbfbf; cursor: not-allowed; background: transparent; }

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.welcome-actions .btn { min-width: 96px; height: 38px; font-size: 14px; }

/* 表格 */
.table-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}
.table { width: 100%; min-width: 780px; border-collapse: collapse; font-size: 12px; }
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-3);
  background: #fafafa;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .input, .table select.input { min-width: 96px; }
.cell-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.ops-icon {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-ctl);
  border: 1px solid #e0e0e0;
  background: #fff;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.ops-icon:hover { background: #f5f5f5; }
.ops-icon:disabled { opacity: .45; cursor: not-allowed; }

/* 输出控制布局 */
.output-wrap { display: flex; gap: 18px; align-items: flex-start; margin-top: 6px; }
.output-form { flex: 1 1 56%; min-width: 0; }
.output-preview { flex: 1 1 44%; min-width: 0; position: sticky; top: 10px; }

.preview-card {
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fbfcfe;
  padding: 14px 14px 16px;
  font-size: 14px;
  color: #262626;
}
.preview-footer { white-space: pre-wrap; word-break: break-word; line-height: 1.75; min-height: 22px; }
.preview-buttons { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.preview-button {
  border: 1px solid #d8e4f5;
  background: #f3f8ff;
  color: var(--blue);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-link {
  margin-top: 12px;
  font-size: 13px;
  color: var(--blue);
  word-break: break-all;
  line-height: 1.6;
}
.preview-tip { margin-top: 8px; font-size: 11px; color: #b5b5b5; }

.button-rows { display: flex; flex-direction: column; gap: 8px; }
.button-row { display: flex; gap: 8px; align-items: center; }
.button-row .input { flex: 1 1 0; min-width: 0; }

/* 关于我们 */
.about-wrap { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; max-width: 640px; }

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px 16px;
}

.card-title { font-size: 14px; font-weight: 700; color: #262626; margin-bottom: 10px; }

.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { flex: 0 0 84px; font-size: 12px; color: var(--text-3); }
.info-value { flex: 1 1 auto; min-width: 0; color: #262626; word-break: break-all; }
.info-status { display: inline-flex; align-items: center; gap: 6px; }
.info-note { margin-top: 10px; font-size: 12px; color: #a6a6a6; line-height: 1.6; }
.form-err { min-height: 18px; margin: 2px 0 10px; font-size: 12px; color: #ef4444; }

/* --------------------------------------------------------------------------
 * 11. 弹窗
 * -------------------------------------------------------------------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .12s ease;
}
.modal-mask.open { opacity: 1; }
.modal-mask.closing { opacity: 0; }

.modal-card {
  width: min(560px, 92vw);
  max-height: 88vh;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  transform: translateY(8px);
  transition: transform .12s ease;
}
.modal-mask.open .modal-card { transform: none; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 8px;
}
.modal-title { margin: 0; font-size: 16px; font-weight: 700; }
.modal-close {
  border: none;
  background: none;
  color: #9c9c9c;
  cursor: pointer;
  padding: 2px;
  display: flex;
  line-height: 0;
}
.modal-close:hover { color: #595959; }

.modal-body { padding: 6px 16px 8px; overflow: auto; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px 16px;
}

.confirm-text { font-size: 13px; color: var(--text-2); line-height: 1.7; word-break: break-word; }

/* 检查弹窗 */
.check-status-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}
.status-chip .status-ver { color: #b0b0b0; }

.check-list { display: flex; flex-direction: column; }
.check-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.check-row:last-child { border-bottom: none; }
.check-name { flex: 0 0 auto; color: #262626; }
.check-detail { flex: 1 1 auto; min-width: 0; color: var(--text-3); font-size: 12px; word-break: break-word; }
.check-empty { padding: 18px 0; text-align: center; color: #b5b5b5; font-size: 13px; }

.dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }
.dot-yellow { background: #faad14; }
.dot-gray { background: #bfbfbf; }
.dot-red { background: var(--red); }

/* 中断控制 */
.interrupt-body { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 0 10px; }
.interrupt-body .btn { flex: 1 1 0; min-width: 96px; height: 40px; }

/* 预览图 */
.preview-wrap { text-align: center; }
.preview-img { max-width: 100%; border-radius: 8px; border: 1px solid #eee; }

/* --------------------------------------------------------------------------
 * 12. Toast
 * -------------------------------------------------------------------------- */
.toast-host {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
  max-width: min(340px, 80vw);
  word-break: break-word;
  opacity: 1;
  transition: opacity .2s ease;
}
.toast-out { opacity: 0; }
.toast-success { background: var(--green); }
.toast-error { background: #ef4444; }

/* --------------------------------------------------------------------------
 * 13. Loading 转圈 / 登录层 / 抽屉
 * -------------------------------------------------------------------------- */
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: .75;
  animation: spin .7s linear infinite;
  vertical-align: -2px;
  margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-layer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  width: min(360px, 92vw);
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .08);
  padding: 26px 22px 20px;
}
.login-title { margin: 0; font-size: 17px; font-weight: 700; text-align: center; }
.login-desc { margin: 8px 0 18px; font-size: 12px; color: var(--text-3); text-align: center; }
.login-submit { margin-top: 14px; }
.login-err { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: #ef4444; text-align: center; }

.hamburger {
  display: none;
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 900;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #ececec;
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.logout-btn {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 800;
  height: 22px;
  padding: 0 8px;
  border: none;
  background: transparent;
  color: #b8b8b8;
  font-size: 11px;
  cursor: pointer;
}
.logout-btn:hover { color: var(--red); }

.drawer-mask { display: none; }

/* --------------------------------------------------------------------------
 * 14. 窄屏适配（<900px：左栏变抽屉）
 * -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .app { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 288px;
    max-height: none;
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    transform: translateX(-104%);
    transition: transform .2s ease;
    z-index: 950;
    box-shadow: 0 0 26px rgba(0, 0, 0, .12);
  }
  .app.drawer-open .sidebar { transform: none; }

  .drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(0, 0, 0, .32);
  }
  .app.drawer-open .drawer-mask { display: block; }

  .hamburger { display: inline-flex; }

  .main { padding-top: 56px; }
  .main-sub { padding: 0 8px; }
  .link-btn { top: 14px; }

  .output-wrap { flex-direction: column; }
  .output-preview { position: static; width: 100%; }
}

@media (max-width: 560px) {
  .interrupt-body { flex-direction: column; }
  .interrupt-body .btn { flex: 1 1 auto; }
}
