* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #ecf0f5;
}
a { text-decoration: none; color: #333; }
ul { list-style: none; }

.wrapper { min-height: 100vh; }
.main-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 220px;
  background: #222d32;
  z-index: 100;
}
.content-wrapper { margin-left: 220px; min-height: 100vh; }

.sidebar-logo {
  height: 50px;
  line-height: 50px;
  text-align: center;
  background: #1a2226;
  color: #fff;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 1px;
}
.sidebar-logo .logo-sm { display: none; }
.sidebar-menu { padding-top: 5px; }
.sidebar-menu .menu-item a {
  display: block;
  padding: 12px 20px;
  color: #b8c7ce;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.sidebar-menu .menu-item a:hover { background: #1e282c; color: #fff; }
.sidebar-menu .menu-item.active a { background: #1e282c; color: #fff; border-left-color: #3c8dbc; }
.sidebar-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 20px;
  color: #8aa4af;
  font-size: 12px;
  border-top: 1px solid #2c3b41;
}
.sidebar-footer .run-state { margin-top: 4px; color: #00a65a; }
.sidebar-footer .run-state.busy { color: #f39c12; }

.main-header {
  height: 50px;
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
}
.breadcrumb { color: #777; }
.breadcrumb span { color: #333; }
.header-right .btn { margin-left: 8px; }

.content { padding: 15px; }
.page { display: none; }
.page.active { display: block; }
.row { display: flex; flex-wrap: wrap; margin: 0 -7.5px; }
.col-4 { width: 33.333%; padding: 0 7.5px; }
.col-6 { width: 50%; padding: 0 7.5px; }
.col-8 { width: 66.667%; padding: 0 7.5px; }
@media (max-width: 900px) {
  .col-4, .col-6, .col-8 { width: 100%; }
}

.box {
  background: #fff;
  border-radius: 2px;
  border-top: 3px solid #3c8dbc;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  margin-bottom: 15px;
}
.box-header {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.box-header h3 { font-size: 15px; font-weight: normal; color: #333; }
.box-tools { font-size: 12px; color: #999; }
.box-body { padding: 15px; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 5px; color: #555; font-size: 13px; }
.form-control {
  width: 100%;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid #d2d6de;
  border-radius: 2px;
  font-size: 13px;
  outline: none;
  background: #fff;
}
.form-control:focus { border-color: #3c8dbc; }
textarea.form-control { height: auto; resize: vertical; }
.tip { color: #999; font-size: 12px; line-height: 1.8; }

.college-picker { position: relative; }
.college-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d2d6de;
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
  z-index: 30;
}
.college-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  color: #333;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.college-option:hover { background: #f5f8fa; color: #3c8dbc; }
.college-option.empty-option { color: #999; cursor: default; }

.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.btn-primary { background: #3c8dbc; border-color: #367fa9; color: #fff; }
.btn-primary:hover { background: #367fa9; }
.btn-warning { background: #f39c12; border-color: #e08e0b; color: #fff; }
.btn-warning:hover { background: #e08e0b; }
.btn-danger { background: #dd4b39; border-color: #d73925; color: #fff; }
.btn-danger:hover { background: #d73925; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn.disabled { opacity: .5; cursor: not-allowed; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 9px 8px;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
  font-size: 13px;
}
.table thead th { background: #f9f9f9; color: #555; font-weight: normal; border-bottom: 1px solid #e0e0e0; }
.table tbody tr:hover { background: #f5f8fa; }
.table .actions { white-space: nowrap; }
.empty { text-align: center; color: #999; padding: 30px 0; }

.label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}
.label-idle, .label-stopped { background: #95a5a6; }
.label-queued, .label-logging { background: #00c0ef; }
.label-learning, .label-exam, .label-certificate, .label-mail { background: #f39c12; }
.label-done { background: #00a65a; }
.label-error { background: #dd4b39; }
.detail { font-size: 12px; color: #999; }

.log-list {
  height: 560px;
  overflow-y: auto;
  background: #1e282c;
  border-radius: 2px;
  padding: 10px 12px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.9;
}
.log-list .log-line { color: #b8c7ce; }
.log-list .log-line .log-time { color: #6d7f86; margin-right: 8px; }
.log-list .log-line.err { color: #f56954; }

/* ============================================================
   管理端追加样式（平台化改造 v2）
   追加于原有 AdminLTE 风格之后，不改动上面任何已有规则
   ============================================================ */

/* ---------- 通用工具类 ---------- */
.muted { color: #999; }
.mono { font-family: Consolas, "Courier New", monospace; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb8 { margin-bottom: 8px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn + .btn { margin-left: 6px; }
.btn-link { background: none; border: 0; color: #3c8dbc; cursor: pointer; padding: 0 4px; font-size: 12px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: #dd4b39; }
.logout-link { color: #8aa4af; }
.logout-link:hover { color: #fff; }

/* ---------- 概览统计卡 ---------- */
.stat-grid { display: flex; flex-wrap: wrap; margin: 0 -7.5px; }
.stat-card {
  flex: 1 1 170px; min-width: 165px;
  background: #fff; border-radius: 2px; border-left: 3px solid #3c8dbc;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  padding: 12px 15px; margin: 0 7.5px 15px;
}
.stat-card .k { color: #8a939c; font-size: 12px; margin-bottom: 6px; }
.stat-card .v { font-size: 22px; color: #333; line-height: 1.2; }
.stat-card .s { font-size: 12px; color: #999; margin-top: 5px; }
.stat-card.green { border-left-color: #00a65a; }
.stat-card.green .v { color: #00a65a; }
.stat-card.blue { border-left-color: #00c0ef; }
.stat-card.blue .v { color: #00a0c6; }
.stat-card.orange { border-left-color: #f39c12; }
.stat-card.orange .v { color: #e08e0b; }
.stat-card.purple { border-left-color: #8e44ad; }
.stat-card.purple .v { color: #8e44ad; }
.stat-card.red { border-left-color: #dd4b39; }
.stat-card.red .v { color: #dd4b39; }
.stat-card.gray { border-left-color: #95a5a6; }

/* ---------- 状态徽标（订单 state 英文枚举 → 中文 + 颜色） ---------- */
.label-pending { background: #95a5a6; }
.label-queued { background: #00c0ef; }
.label-running { background: #f39c12; }
.label-paused { background: #f7d24a; color: #7a6212; }
.label-done { background: #00a65a; }
.label-partial { background: #8e44ad; box-shadow: 0 0 0 2px rgba(142,68,173,.25); }
.label-failed { background: #dd4b39; }
.label-cancelled { background: #95a5a6; }
.label-refunded { background: #7f8c8d; }
.label-open { background: #3c8dbc; }
.label-replied { background: #00a65a; }
.label-closed { background: #95a5a6; }
.label-purple { background: #8e44ad; }
.label-orange { background: #f39c12; }
.label-blue { background: #3c8dbc; }
.label-gray { background: #95a5a6; }
.label-green { background: #00a65a; }
.label-red { background: #dd4b39; }
.label-warn { background: #f39c12; }
.label-partial-pulse { animation: labelPulse 1.6s ease-in-out infinite; }
@keyframes labelPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(142,68,173,.20); }
  50% { box-shadow: 0 0 0 5px rgba(142,68,173,.05); }
}
.state-hint { font-size: 11px; color: #8e44ad; margin-left: 6px; }

/* ---------- 表格包装与分页 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table.table-tight th, .table.table-tight td { padding: 6px 6px; }
.table .nowrap { white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 0 2px; flex-wrap: wrap; }
.pager .muted { margin-right: auto; }
.pager select { height: 26px; border: 1px solid #d2d6de; border-radius: 2px; font-size: 12px; }

/* ---------- 进度条 ---------- */
.progress { height: 10px; background: #eef1f4; border-radius: 5px; overflow: hidden; min-width: 70px; }
.progress > i { display: block; height: 100%; background: #3c8dbc; width: 0; transition: width .3s; }
.progress.green > i { background: #00a65a; }
.progress.orange > i { background: #f39c12; }
.progress.purple > i { background: #8e44ad; }
.progress.red > i { background: #dd4b39; }
.progress-cell { display: flex; align-items: center; gap: 6px; min-width: 130px; }
.progress-cell .pct { font-size: 12px; color: #666; width: 34px; text-align: right; }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 10px; }
.filter-bar .filter-item { min-width: 130px; }
.filter-bar .filter-item label { display: block; font-size: 12px; color: #777; margin-bottom: 4px; }
.filter-bar .filter-item .form-control { height: 32px; font-size: 13px; }
.filter-bar .filter-actions { display: flex; gap: 6px; }
.filter-bar .filter-actions .btn { margin-left: 0; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.45); z-index: 1500;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 50px 15px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 3px; width: 560px; max-width: 100%;
  box-shadow: 0 8px 28px rgba(0,0,0,.3); display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
}
.modal.modal-lg { width: 940px; }
.modal.modal-xl { width: 1100px; }
.modal.modal-sm { width: 420px; }
.modal-header { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 15px; font-weight: normal; }
.modal-close { border: 0; background: none; font-size: 20px; line-height: 1; color: #999; cursor: pointer; }
.modal-close:hover { color: #333; }
.modal-body { padding: 15px; overflow-y: auto; }
.modal-footer { padding: 10px 15px; border-top: 1px solid #f0f0f0; text-align: right; }
.modal-footer .btn { margin-left: 8px; }
.modal .box { box-shadow: none; border: 1px solid #eef1f4; border-top-width: 2px; margin-bottom: 12px; }

/* ---------- 详情抽屉 ---------- */
.drawer-mask { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,.35); z-index: 1400; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 920px; max-width: 97vw;
  background: #f4f6f9; z-index: 1401; display: flex; flex-direction: column;
  box-shadow: -3px 0 14px rgba(0,0,0,.2);
}
.drawer-header {
  height: 52px; background: #fff; border-bottom: 1px solid #e3e6ea;
  display: flex; align-items: center; justify-content: space-between; padding: 0 15px;
}
.drawer-header h3 { font-size: 15px; font-weight: normal; }
.drawer-body { padding: 15px; overflow-y: auto; flex: 1; }
.drawer-section { background: #fff; border-radius: 2px; border-top: 3px solid #3c8dbc; box-shadow: 0 1px 1px rgba(0,0,0,.08); margin-bottom: 15px; }
.drawer-section.danger { border-top-color: #dd4b39; }
.drawer-section.purple { border-top-color: #8e44ad; }
.drawer-section h4 { font-size: 14px; font-weight: normal; padding: 10px 15px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.drawer-section .sec-body { padding: 12px 15px; }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-bar .btn { margin-left: 0; }

/* ---------- 键值列表 ---------- */
.kv { display: flex; flex-wrap: wrap; gap: 6px 0; }
.kv .kv-item { flex: 0 0 33.333%; min-width: 200px; font-size: 13px; padding: 3px 0; }
.kv .kv-item.kv-wide { flex: 0 0 100%; }
.kv .kv-item .kk { color: #8a939c; margin-right: 6px; }
@media (max-width: 900px) { .kv .kv-item { flex: 0 0 100%; } }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; max-height: 260px; overflow-y: auto; }
.timeline:before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: #e9edf1; }
.timeline-item { position: relative; padding-bottom: 12px; font-size: 12px; color: #555; }
.timeline-item:before { content: ''; position: absolute; left: -17px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #3c8dbc; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .tl-time { color: #999; margin-right: 8px; }

/* ---------- 能力开关网格 ---------- */
.cap-grid { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cap-grid label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #555; }
.cap-grid label input { margin: 0; }

/* ---------- 动态表单字段设计器 ---------- */
.fd-row { border: 1px solid #e3e6ea; border-radius: 2px; padding: 8px 10px; margin-bottom: 8px; background: #fafbfc; }
.fd-row .fd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; color: #666; }
.fd-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-grid .fg { flex: 1 1 160px; min-width: 140px; }
.fd-grid .fg.fg-wide { flex: 1 1 100%; }
.fd-grid .fg label { display: block; font-size: 12px; color: #777; margin-bottom: 3px; }
.fd-grid .fg .form-control { height: 30px; font-size: 12px; padding: 4px 8px; }

/* ---------- 密钥 / 敏感信息展示 ---------- */
.key-plain {
  font-family: Consolas, "Courier New", monospace; font-size: 13px;
  background: #1e282c; color: #7ee787; padding: 10px 12px; border-radius: 2px;
  word-break: break-all; line-height: 1.7;
}
.key-warn {
  background: #fff8e1; border: 1px solid #ffe08a; color: #8a6d3b;
  padding: 8px 10px; border-radius: 2px; font-size: 12px; line-height: 1.7;
}
.key-confirm { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: #555; }
.key-confirm label { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- 提示气泡 / 轻提示 ---------- */
.toast-wrap { position: fixed; top: 62px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #333; color: #fff; padding: 10px 14px; border-radius: 3px;
  font-size: 13px; max-width: 420px; line-height: 1.6;
  box-shadow: 0 3px 12px rgba(0,0,0,.28); word-break: break-all;
}
.toast.ok { background: #00a65a; }
.toast.err { background: #dd4b39; }
.toast.warn { background: #f39c12; }
.toast.info { background: #3c8dbc; }

/* ---------- 字段级错误高亮 ---------- */
.input-error { border-color: #dd4b39 !important; background: #fff7f6 !important; }
.field-error-msg { color: #dd4b39; font-size: 12px; margin-top: 3px; }

/* ---------- 选项卡 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e3e6ea; margin-bottom: 12px; }
.tabs .tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 14px; font-size: 13px; color: #666; cursor: pointer;
}
.tabs .tab:hover { color: #3c8dbc; }
.tabs .tab.active { color: #3c8dbc; border-bottom-color: #3c8dbc; }

/* ---------- 告警列表 ---------- */
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 7px 10px; border-radius: 2px; background: #f8f9fa; border-left: 3px solid #95a5a6; }
.alert-item.warn { background: #fff8e1; border-left-color: #f39c12; }
.alert-item.error { background: #fdf0ee; border-left-color: #dd4b39; }
.alert-item.info { background: #f2f8fc; border-left-color: #3c8dbc; }
.alert-item .ai-tag { font-size: 11px; color: #999; white-space: nowrap; }

/* ---------- 调用日志 ---------- */
.req-id { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: #3c8dbc; }
.code-bad { color: #dd4b39; font-weight: bold; }
.code-ok { color: #00a65a; }
.latency-slow { color: #f39c12; }
.latency-very-slow { color: #dd4b39; }

/* ---------- 设置页 ---------- */
.settings-section { margin-bottom: 18px; }
.settings-section > h4 { font-size: 13px; color: #3c8dbc; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px dashed #e3e6ea; }
.settings-grid { display: flex; flex-wrap: wrap; gap: 0 16px; }
.settings-grid .form-group { flex: 1 1 240px; min-width: 220px; }
.settings-grid .form-group.wide { flex: 1 1 100%; }

/* ---------- 对外开发文档 ---------- */
.doc-wrap { display: flex; align-items: flex-start; gap: 15px; }
.doc-nav { flex: 0 0 200px; position: sticky; top: 15px; background: #fff; border-radius: 2px; border-top: 3px solid #3c8dbc; box-shadow: 0 1px 1px rgba(0,0,0,.08); padding: 10px 0; }
.doc-nav a { display: block; padding: 6px 15px; font-size: 13px; color: #555; }
.doc-nav a:hover { background: #f5f8fa; color: #3c8dbc; }
.doc-main { flex: 1 1 auto; min-width: 0; }
.doc-section { margin-bottom: 15px; }
.doc-section h3 { font-size: 15px; font-weight: normal; margin-bottom: 10px; }
.doc-section h4 { font-size: 14px; font-weight: normal; color: #333; margin: 12px 0 6px; }
.doc-p { font-size: 13px; color: #555; line-height: 1.9; }
.doc-p code, .doc-li code { background: #f4f6f9; padding: 1px 5px; border-radius: 2px; font-family: Consolas, monospace; font-size: 12px; color: #c7254e; }
.doc-ul { list-style: disc; padding-left: 22px; }
.doc-ul li { font-size: 13px; color: #555; line-height: 1.9; }
.code-wrap { position: relative; margin: 6px 0 12px; }
pre.code {
  background: #1e282c; color: #d5e2e8; padding: 12px 14px; border-radius: 2px;
  font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.7;
  overflow-x: auto; white-space: pre;
}
pre.code .c-key { color: #7ee787; }
.code-wrap .code-copy { position: absolute; top: 6px; right: 6px; }
.doc-ep { border: 1px solid #eef1f4; border-radius: 2px; padding: 10px 12px; margin-bottom: 10px; }
.doc-ep .ep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.doc-ep .ep-path { font-family: Consolas, monospace; font-size: 13px; color: #3c8dbc; }
.doc-ep .ep-desc { font-size: 12px; color: #777; margin: 6px 0 0; }
.doc-ep .ep-note { font-size: 12px; color: #999; margin-top: 6px; line-height: 1.8; }
.cap-tag { display: inline-block; background: #f2f8fc; color: #3c8dbc; border: 1px solid #d6e9f5; border-radius: 2px; padding: 0 5px; font-size: 11px; margin-left: 4px; }
.cap-tag.off { background: #f7f7f7; color: #999; border-color: #e5e5e5; }

/* ---------- 登录页 ---------- */
.login-body { background: #222d32; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 380px; max-width: 100%; background: #fff; border-radius: 3px; box-shadow: 0 10px 34px rgba(0,0,0,.4); overflow: hidden; }
.login-head { background: #1a2226; color: #fff; padding: 20px; text-align: center; }
.login-head .lt { font-size: 18px; letter-spacing: 1px; }
.login-head .ls { font-size: 12px; color: #8aa4af; margin-top: 6px; }
.login-body-inner { padding: 22px 24px 20px; }
.login-body-inner .form-group label { color: #555; }
.login-tip { min-height: 20px; font-size: 12px; color: #dd4b39; margin-top: 8px; }
.login-footer { text-align: center; color: #6b7c85; font-size: 12px; padding: 10px 0 18px; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 900px) {
  .drawer { width: 100vw; }
  .doc-wrap { flex-direction: column; }
  .doc-nav { position: static; width: 100%; flex: 0 0 auto; }
  .main-sidebar { width: 170px; }
  .content-wrapper { margin-left: 170px; }
}
