/* ==========================================================================
   建筑电气与智能化系统设计说明自动生成系统 —— 全局样式
   风格：工程制图 / 专业克制 / 高信息密度
   ========================================================================== */

:root {
  --brand:        #1b4d8f;
  --brand-dark:   #153c6b;
  --brand-light:  #e8f0fa;
  --ink:          #1f2d3d;
  --ink-2:        #40566f;
  --ink-3:        #77879b;
  --line:         #dde5ee;
  --line-soft:    #eef2f7;
  --bg:           #f2f5f9;
  --panel:        #ffffff;
  --ok:           #157347;
  --warn:         #b8860b;
  --danger:       #b02a37;
  --info:         #0d6efd;
  --sidebar-w:    246px;
  --header-h:     56px;
  --radius:       10px;
  --shadow-sm:    0 1px 2px rgba(21, 45, 84, .06);
  --shadow:       0 4px 16px rgba(21, 45, 84, .08);
  --shadow-lg:    0 12px 40px rgba(21, 45, 84, .12);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); }

/* --------------------------------------------------------------------------
   布局骨架
   -------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #16283f 0%, #12202f 100%);
  color: #c8d6e5;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .22s ease;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: #2c4258; border-radius: 3px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f77c9, #1b4d8f);
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff;
  letter-spacing: -.5px;
}
.brand-text { line-height: 1.25; }
.brand-text .t1 { color: #fff; font-size: 13.5px; font-weight: 600; }
.brand-text .t2 { color: #7d97b3; font-size: 11px; }

.sidebar-nav { padding: 10px 0 26px; }
.nav-group-title {
  padding: 14px 18px 6px;
  font-size: 11px; letter-spacing: .08em;
  color: #5f7893; text-transform: uppercase;
}
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 18px;
  color: #c8d6e5; font-size: 13.5px;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.sidebar-nav .nav-item.active {
  background: rgba(47,119,201,.16);
  border-left-color: #4a9eff;
  color: #fff; font-weight: 500;
}
.sidebar-nav .nav-item .ico { width: 16px; text-align: center; opacity: .8; flex: 0 0 16px; }
.sidebar-nav .nav-item .badge-dot {
  margin-left: auto; font-size: 11px; padding: 1px 7px;
  background: rgba(255,255,255,.12); border-radius: 9px; color: #a9c3dd;
}

.app-main { flex: 1 1 auto; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.app-header {
  height: var(--header-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 1020;
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); min-width: 0; }
.crumb a { color: var(--ink-2); }
.crumb .sep { color: #c3d0de; }
.crumb .cur { color: var(--ink); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.app-content { padding: 20px 22px 46px; flex: 1 1 auto; min-width: 0; }

.sidebar-toggle { display: none; }

/* --------------------------------------------------------------------------
   面板 / 卡片
   -------------------------------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(180deg, #fcfdff, #f8fafd);
}
.panel-head h2, .panel-head h3 {
  margin: 0; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.panel-head .sub { font-size: 12.5px; color: var(--ink-3); }
.panel-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 12px 14px; }
.panel-body.flush { padding: 0; }
.panel-foot {
  padding: 12px 18px; border-top: 1px solid var(--line-soft);
  background: #fbfcfe; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* 页头 */
.page-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.2px; }
.page-head .desc { color: var(--ink-3); font-size: 13px; }
.page-head .acts { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   统计卡片
   -------------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand);
}
.stat-card.ok::before   { background: var(--ok); }
.stat-card.warn::before { background: var(--warn); }
.stat-card.danger::before { background: var(--danger); }
.stat-card .label { font-size: 12.5px; color: var(--ink-3); }
.stat-card .value { font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -.5px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.stat-card .foot { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* --------------------------------------------------------------------------
   表格
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-2);
  background: #f7fafd; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; font-size: 12.5px; letter-spacing: .01em;
}
table.tbl td {
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.tbl td.center, table.tbl th.center { text-align: center; }
table.tbl .row-acts { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
table.tbl.compact td, table.tbl.compact th { padding: 7px 10px; }
table.tbl tfoot td { background: #f7fafd; font-weight: 600; border-top: 2px solid var(--line); }

.empty {
  padding: 44px 20px; text-align: center; color: var(--ink-3);
}
.empty .big { font-size: 34px; opacity: .35; margin-bottom: 10px; }

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
.field label .req { color: var(--danger); margin-left: 3px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 4px; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid #cfdae7; border-radius: 7px;
  background: #fff; color: var(--ink); font-size: 13.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27,77,143,.12);
}
input:disabled, select:disabled, textarea:disabled { background: #f4f7fa; color: var(--ink-3); }
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
textarea.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; }
input[type=file] { font-size: 13px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: flex; align-items: flex-start; gap: 7px; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; }

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px;
  border: 1px solid transparent; background: #fff; color: var(--ink-2);
  font-size: 13.5px; font-family: inherit; line-height: 1.5;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline { border-color: #c7d7ea; color: var(--brand); background: #fff; }
.btn-outline:hover { background: var(--brand-light); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-ghost:hover { background: #eef2f7; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f2129; border-color: #8f2129; color: #fff; }
.btn-outline-danger { border-color: #e6b3b8; color: var(--danger); background: #fff; }
.btn-outline-danger:hover { background: #fdf2f3; }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-success:hover { background: #10592f; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 10px 22px; font-size: 15px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   徽章 / 状态
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.badge-ok      { background: #e6f4ec; color: #10673c; }
.badge-warn    { background: #fdf4e0; color: #8a6300; }
.badge-danger  { background: #fdecee; color: #94212c; }
.badge-info    { background: #e8f0fa; color: #16487f; }
.badge-muted   { background: #eef2f7; color: #5b6b7f; }
.badge-purple  { background: #f0e9fa; color: #5b2d94; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; background: #f2f6fb; border: 1px solid var(--line);
  border-radius: 6px; font-size: 12.5px; color: var(--ink-2); margin: 0 6px 6px 0;
}

/* 引用守卫状态条 */
.guard-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; font-size: 13px; line-height: 1.7; }
.guard-pass { background: #e9f6ef; border: 1px solid #b7e0c8; color: #10673c; }
.guard-warn { background: #fdf6e6; border: 1px solid #f0dca6; color: #8a6300; }
.guard-fail { background: #fdecee; border: 1px solid #f2c2c7; color: #94212c; }
.guard-unknown { background: #f0f3f7; border: 1px solid #dbe3ec; color: #5b6b7f; }

/* --------------------------------------------------------------------------
   提示条 / 空态
   -------------------------------------------------------------------------- */
.alert { padding: 12px 15px; border-radius: 8px; font-size: 13.5px; line-height: 1.7; margin-bottom: 16px; border: 1px solid transparent; }
.alert-info  { background: #eef5fd; border-color: #cfe1f6; color: #14508c; }
.alert-ok    { background: #eaf7f0; border-color: #bfe3cf; color: #10673c; }
.alert-warn  { background: #fdf7e8; border-color: #f0dfae; color: #8a6300; }
.alert-danger{ background: #fdedee; border-color: #f3c6ca; color: #94212c; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert .t { font-weight: 600; }

/* --------------------------------------------------------------------------
   步骤条（项目流程 6 步）
   -------------------------------------------------------------------------- */
.steps { display: flex; gap: 0; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line);
         border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.steps .step {
  flex: 1 1 150px; padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  border-right: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-3);
  text-decoration: none; position: relative; min-width: 0;
}
.steps .step:last-child { border-right: none; }
.steps .step:hover { background: #fafcff; text-decoration: none; }
.steps .step .idx {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: #e7edf5; color: var(--ink-3);
}
.steps .step .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps .step.done .idx { background: #d8ecdf; color: var(--ok); }
.steps .step.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.steps .step.active .idx { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------------------
   Markdown 预览（设计说明正文）
   -------------------------------------------------------------------------- */
.doc-render {
  background: #fff; padding: 40px 48px;
  font-family: "SimSun", "Songti SC", "STSong", serif;
  font-size: 14.5px; line-height: 2.0; color: #1a1a1a;
}
.doc-render h1 { font-family: "SimHei", "Heiti SC", sans-serif; font-size: 22px; text-align: center; margin: 0 0 26px; letter-spacing: 3px; }
.doc-render h2 { font-family: "SimHei", "Heiti SC", sans-serif; font-size: 17px; margin: 30px 0 12px; padding-bottom: 6px; border-bottom: 1px solid #ddd; }
.doc-render h3 { font-family: "SimHei", "Heiti SC", sans-serif; font-size: 15.5px; margin: 22px 0 10px; }
.doc-render h4 { font-size: 14.5px; margin: 18px 0 8px; font-weight: 700; }
.doc-render p { margin: 0 0 12px; text-indent: 2em; text-align: justify; }
.doc-render ul, .doc-render ol { margin: 0 0 14px; padding-left: 2.4em; }
.doc-render li { margin-bottom: 5px; }
.doc-render table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13px; font-family: "SimSun", serif; }
.doc-render th, .doc-render td { border: 1px solid #999; padding: 6px 9px; text-align: left; }
.doc-render th { background: #f0f0f0; font-weight: 700; }
.doc-render blockquote { margin: 12px 0; padding: 8px 16px; border-left: 4px solid #bbb; background: #fafafa; color: #444; }
.doc-render blockquote p { text-indent: 0; }
.doc-render code { background: #f2f2f2; padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: 12.5px; }
.doc-render pre { background: #f6f6f6; padding: 14px; border-radius: 6px; overflow: auto; }
.doc-render pre code { background: none; padding: 0; }
.doc-render hr { border: none; border-top: 1px solid #ddd; margin: 22px 0; }
.doc-render strong { font-weight: 700; }

/* 编辑区 */
.editor-wrap { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.editor-pane { flex: 1 1 50%; min-width: 0; display: flex; flex-direction: column; }
.editor-pane + .editor-pane { border-left: 1px solid var(--line); }
.editor-head {
  padding: 8px 14px; background: #f7fafd; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 10px;
}
.editor-body { flex: 1 1 auto; overflow: auto; max-height: 70vh; }
.editor-body textarea {
  border: none; border-radius: 0; min-height: 70vh; height: 70vh;
  font-family: var(--mono); font-size: 13px; line-height: 1.8; padding: 16px; resize: none;
}
.editor-body textarea:focus { box-shadow: none; }
.editor-body .doc-render { max-height: 70vh; overflow: auto; }

/* --------------------------------------------------------------------------
   版本对比
   -------------------------------------------------------------------------- */
.diff-view { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; background: #fff; }
.diff-line { display: flex; padding: 1px 12px; white-space: pre-wrap; word-break: break-word; }
.diff-line .ln { flex: 0 0 52px; color: #9aa8b8; user-select: none; text-align: right; padding-right: 12px; }
.diff-line .tx { flex: 1 1 auto; min-width: 0; }
.diff-line.add { background: #e9f7ef; }
.diff-line.del { background: #fdecee; }
.diff-line.del .tx { text-decoration: line-through; opacity: .8; }
.diff-line.ctx { color: #5b6b7f; }
.diff-line.hunk { background: #eef4fb; color: #14508c; font-weight: 600; }

/* --------------------------------------------------------------------------
   进度 / 加载
   -------------------------------------------------------------------------- */
.progress { height: 6px; background: #e7edf5; border-radius: 4px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--brand); transition: width .3s ease; }

.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
.spinner-dark { border-color: rgba(27,77,143,.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.stream-box {
  background: #12202f; color: #c8d6e5; border-radius: 8px; padding: 16px 18px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.85;
  max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
#toast-host { position: fixed; top: 18px; right: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 400px; padding: 11px 15px; border-radius: 9px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: 13.5px; line-height: 1.6; display: flex; gap: 9px; align-items: flex-start;
  animation: toast-in .22s ease;
}
.toast.ok     { border-left: 4px solid var(--ok); }
.toast.error  { border-left: 4px solid var(--danger); }
.toast.warn   { border-left: 4px solid var(--warn); }
.toast.info   { border-left: 4px solid var(--brand); }
.toast .close { margin-left: auto; cursor: pointer; color: var(--ink-3); background: none; border: none; font-size: 15px; line-height: 1; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   模态
   -------------------------------------------------------------------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18,32,47,.5);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-box {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 86vh; display: flex; flex-direction: column;
}
.modal-box.wide { max-width: 900px; }
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-head .x { margin-left: auto; background: none; border: none; font-size: 20px; color: var(--ink-3); cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1 1 auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; justify-content: flex-end; background: #fbfcfe; border-radius: 0 0 12px 12px; }

/* --------------------------------------------------------------------------
   认证页
   -------------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: #eef2f7;
}
.auth-brand {
  background: linear-gradient(150deg, #16283f 0%, #1b4d8f 100%);
  color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ''; position: absolute; right: -110px; bottom: -110px;
  width: 340px; height: 340px; border-radius: 50%;
  background: rgba(74,158,255,.13);
}
.auth-brand::before {
  content: ''; position: absolute; right: 60px; top: -70px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(74,158,255,.09);
}
.auth-brand h1 { font-size: 27px; line-height: 1.4; margin: 0 0 14px; letter-spacing: .5px; position: relative; }
.auth-brand .lead { font-size: 14.5px; line-height: 2; color: #c3d6ea; max-width: 470px; position: relative; }
.auth-brand .feats { margin-top: 30px; display: grid; gap: 12px; position: relative; }
.auth-brand .feat { display: flex; gap: 10px; font-size: 13.5px; color: #d5e4f3; line-height: 1.75; }
.auth-brand .feat .dot {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 6px;
  background: rgba(74,158,255,.22); display: grid; place-items: center; font-size: 11px; color: #8cc4ff;
}
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand-sm { font-size: 15px; font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.auth-card .tip { color: var(--ink-3); font-size: 13px; margin-bottom: 24px; }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--ink-3); text-align: center; }

/* --------------------------------------------------------------------------
   系统信息（后台）
   -------------------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 2px 0; font-size: 13.5px; }
.kv > div { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.kv > div:nth-child(odd) { color: var(--ink-3); background: #fafcff; }
.kv .val { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* --------------------------------------------------------------------------
   工具类
   -------------------------------------------------------------------------- */
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.tiny  { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tr { text-align: right; }
.tc { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:18px}.mt-4{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:6px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:18px}.mb-4{margin-bottom:24px}
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.scroll-y { overflow-y: auto; }
.lh-tight { line-height: 1.4; }
.bd-b { border-bottom: 1px solid var(--line-soft); }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .editor-wrap { flex-direction: column; }
  .editor-pane + .editor-pane { border-left: none; border-top: 1px solid var(--line); }
  .editor-body textarea, .editor-body .doc-render { height: auto; min-height: 420px; max-height: 56vh; }
}

@media (max-width: 992px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .app-main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .doc-render { padding: 26px 22px; }
  .kv { grid-template-columns: 120px 1fr; }
}

@media (max-width: 640px) {
  .app-content { padding: 14px 13px 40px; }
  .app-header { padding: 0 13px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .page-head h1 { font-size: 18px; }
  .panel-body { padding: 14px; }
}

@media print {
  .app-sidebar, .app-header, .page-head .acts, .no-print, #toast-host { display: none !important; }
  .app-main { margin-left: 0; }
  .app-content { padding: 0; }
  .doc-render { padding: 0; box-shadow: none; border: none; }
  .panel { border: none; box-shadow: none; }
}

/* ==========================================================================
   视图层补充组件（分页 / 标签页 / 时间线 / 网格 / 行内块）
   ========================================================================== */

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 0 0; }
.pager .info { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
.pager a, .pager span.cur, .pager span.dis {
  display: inline-block; min-width: 32px; text-align: center;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; color: var(--ink-2); text-decoration: none; background: #fff;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pager span.cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager span.dis { color: #b6c2d0; background: #f7f9fc; }

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs .tab {
  padding: 9px 16px; font-size: 13.5px; color: var(--ink-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--brand); text-decoration: none; }
.tabs .tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

/* 网格 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* 时间线 */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -20px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%; background: #c3cfdd; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.tl-item.cur::before { background: var(--brand); }
.tl-item .tl-h { font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.tl-item .tl-m { font-size: 12.5px; color: var(--ink-3); }

/* 行内代码块（提示词 / 原始 Markdown） */
.code-block {
  background: #f7fafd; border: 1px solid var(--line-soft); border-radius: 7px;
  padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; margin: 0;
}

/* 紧凑标签组 */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 12px;
  background: #f2f6fb; border: 1px solid var(--line); color: var(--ink-2); margin-right: 5px;
}

/* 提示清单 */
.hint-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-3); line-height: 1.9; }
.hint-list li { margin-bottom: 2px; }

/* 流式输出头部 */
.stream-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px;
}
.stream-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.stream-head .dot.on { background: var(--ok); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* 文件行 */
.file-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px;
}
.file-row + .file-row { margin-top: 8px; }
.file-row .fname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 面板内嵌小节标题 */
.sub-title {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  margin: 0 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 8px;
}

/* 覆盖层进度（生成中） */
.overlay-mask {
  position: fixed; inset: 0; background: rgba(18,32,47,.42); z-index: 1900;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.overlay-mask.show { display: flex; }
.overlay-box { background: #fff; border-radius: 12px; padding: 22px 26px; box-shadow: var(--shadow-lg); min-width: 280px; text-align: center; }
