/* JwCode 数字工程师 —— 终端 TUI 风（黑底琥珀等宽，参照 html_demo/02-terminal-tui.html；用户 2026-10-31 选定） */
:root {
  --bg: #0d0904;
  --card: #120d06;
  --card2: #1a1206;   /* 标题栏 / 表头 / 悬浮层 */
  --border: #5a4014;
  --border-dim: #3a2c10;
  --text: #ffb454;
  --bright: #ffd08a;
  --muted: #8a6a35;
  --accent: #ffb454;
  --accent-soft: rgba(255, 180, 84, .13);
  --green: #7fbf7f;
  --green-soft: rgba(127, 191, 127, .12);
  --red: #e07a6a;
  --radius: 0px;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #070503; /* 桌面底色：窗口外的暗背景 */
  color: var(--text);
  font: 13.5px/1.65 Consolas, "Courier New", "Microsoft YaHei", monospace;
  padding: 16px 14px 28px;
}
/* 整站 = 一台居中的终端窗口（demo 02 窗口形式）：边框 + 圆角 + 阴影，内容超高时窗口随内容变高整页滚动 */
.term {
  max-width: 1240px;
  margin: 0 auto;
  border: 1px solid #7a5a1e;
  border-radius: 10px;
  overflow: clip;          /* 裁圆角但不产生滚动容器，保住内部 sticky */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 44px);
  box-shadow: 0 0 60px rgba(255,180,84,.06), 0 24px 60px rgba(0,0,0,.6);
}
/* CRT 扫描线（纯装饰，不挡交互、不在最顶层挡弹窗） */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 900;
  background: repeating-linear-gradient(0deg, rgba(255,180,84,.025) 0 1px, transparent 1px 3px);
}
::selection { background: var(--accent); color: #120d06; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 19px; margin: 0; font-weight: 700; }
h2 { font-size: 13px; margin: 0 0 10px; color: var(--muted); font-weight: 700; letter-spacing: .06em; }
h2::before { content: "▍ "; color: var(--accent); }
small { font-weight: 400; }
button { font-family: inherit; }
input::placeholder { color: #6a5228; }
/* 表单控件统一终端化（各表单类未逐一设置背景/文字色的兜底） */
input[type="text"], input[type="search"], input[type="password"], input[type="time"],
input[type="date"], input[type="number"], input[type="url"], input[type="datetime-local"],
textarea, select {
  background: var(--card); color: var(--text);
  border: 1px dashed var(--border); border-radius: 0;
}

/* 顶栏 = 终端标题栏（三点 + 品牌 + 主机名），随窗口滚动 */
.topbar { background: var(--card2); border-bottom: 1px solid #7a5a1e; }
.topbar-inner { max-width: none; padding: 0 16px; height: 46px; display: flex; align-items: center; gap: 14px; }
.term-dots { position: relative; width: 44px; height: 11px; flex: none; }
.term-dots::before {
  content: ""; position: absolute; left: 0; top: 0; width: 11px; height: 11px; border-radius: 50%;
  background: #ff5f56; box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f;
}
.brand { font-size: 15px; font-weight: 700; color: var(--bright); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-logo { width: 20px; height: 20px; display: block; }
.brand:hover { text-decoration: none; }
.term-host { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 底部 tmux 状态条（窗口内 sticky：长页滚动时始终钉在视口底，短页沉到窗口底边）：
   导航窗口（CSS counter 编号）+ 页脚信息 */
.statusbar {
  position: sticky; bottom: 0; z-index: 30; margin-top: auto;
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px;
  background: var(--card2); border-top: 1px solid #7a5a1e;
}
.nav { display: flex; gap: 2px; counter-reset: win; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { counter-increment: win; white-space: nowrap; padding: 6px 11px; color: var(--muted); font-size: 12.5px; }
.nav a::before { content: counter(win) ":"; color: #c98f3d; margin-right: 2px; }
.nav a:hover { color: var(--bright); background: #241a08; text-decoration: none; }
.nav a.active { background: var(--accent); color: #120d06; font-weight: 700; }
.nav a.active::before { color: #120d06; }
.nav a.active::after { content: "*"; }
.nav .nav-admin { color: #e8956a; }
.nav .nav-admin:hover { background: #241a08; color: #ffb08a; }
.status-right { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.status-right a { color: var(--muted); }
.status-right a:hover { color: var(--bright); }

/* 同步条 = 状态行 */
.syncbar { background: var(--bg); border-bottom: 1px solid var(--border-dim); }
.syncbar-inner { max-width: none; padding: 8px 16px; display: flex; align-items: center; gap: 14px; }
.sync-last { font-size: 12px; }
.sync-progress { display: flex; align-items: center; gap: 10px; flex: 1; }
.sync-track { flex: 1; max-width: 320px; height: 6px; background: #241a08; overflow: hidden; }
.sync-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }

/* 页头与筛选 */
.pagebar { background: var(--bg); border-bottom: 1px dashed var(--border-dim); }
.pagebar-inner { max-width: none; padding: 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.count-chip { display: inline-block; background: var(--accent-soft); color: var(--bright); padding: 1px 10px; font-size: 12px; font-weight: 700; vertical-align: 2px; border: 1px solid var(--border); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters input[type="search"], .filters select {
  height: 34px; padding: 0 10px; border: 1px dashed var(--border);
  background: var(--card); color: var(--text); min-width: 160px; font-size: 13px;
}
.filters input[type="search"]:focus, .filters select:focus { outline: none; border-color: var(--accent); border-style: solid; }

/* 按钮 */
.btn {
  display: inline-block; height: 34px; line-height: 32px; padding: 0 14px;
  border: 1px dashed var(--border); background: var(--card);
  color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn:hover { border-color: var(--accent); border-style: solid; color: var(--bright); text-decoration: none; }
.btn:active { background: var(--card2); }
.btn-primary { background: var(--accent); border: 1px solid var(--accent); color: #120d06; font-weight: 700; }
.btn-primary:hover { background: var(--bright); border-color: var(--bright); color: #120d06; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-sm { height: 28px; line-height: 26px; padding: 0 10px; font-size: 12px; }

/* 布局（窗口框 .term 已限宽，container 占满窗口内宽） */
.container { width: 100%; max-width: none; margin: 20px auto 26px; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--border); padding: 16px 18px; margin-bottom: 16px; }
.table-card { padding: 0; overflow-x: auto; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* 表格 */
.bug-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bug-table th, .bug-table td { text-align: left; padding: 9px 12px; border-bottom: 1px dashed var(--border-dim); white-space: nowrap; }
.bug-table th { color: var(--muted); font-weight: 700; background: var(--card2); border-bottom: 1px solid var(--border); }
.bug-table tbody tr:hover { background: var(--card2); }
.bug-table td.bug-subject { white-space: normal; min-width: 240px; max-width: 460px; }
.bug-table td.bug-subject a { color: var(--bright); font-weight: 500; }
.bug-table td.bug-subject a:hover { color: var(--accent); }
.bug-id { font-family: Consolas, Menlo, monospace; font-weight: 700; color: var(--bright); }
.proj-link { color: #d0a050; }
.assignee { display: inline-block; background: var(--bg); border: 1px dashed var(--border-dim); padding: 0 8px; margin: 1px 2px 1px 0; font-size: 12px; }

/* 徽章：[ 方括号 ] 标签 */
.badge { display: inline-block; padding: 1px 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: "["; opacity: .55; }
.badge::after { content: "]"; opacity: .55; }
.badge-open { color: #ffb454; }
.badge-closed { color: var(--green); }
.chip { display: inline-block; background: var(--bg); border: 1px dashed var(--border-dim); padding: 1px 8px; font-size: 12px; color: var(--muted); margin-right: 6px; }
.chip-link { color: var(--accent); }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }

/* 详情页 */
.detail-head { margin-bottom: 14px; }
.detail-meta { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.description { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 5px 10px 5px 0; width: 96px; vertical-align: top; white-space: nowrap; }
.kv-table td { padding: 5px 0; word-break: break-all; }
.attachment-list, .relation-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.attachment-list li, .relation-list li { padding: 5px 0; border-bottom: 1px dashed var(--border-dim); }
.attachment-list li:last-child, .relation-list li:last-child { border-bottom: none; }
.git-line { word-break: break-all; font-size: 13px; }
.git-link { font-size: 12px; word-break: break-all; }

/* 统计条形图 */
.tab-group { display: flex; gap: 4px; background: var(--bg); border: 1px dashed var(--border); padding: 3px; }
.tab { padding: 4px 12px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tab:hover { color: var(--bright); text-decoration: none; }
.tab.active { background: var(--card2); color: var(--accent); font-weight: 700; }
.chart-card { padding: 22px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 130px; align-items: center; gap: 12px; padding: 5px 0; }
.bar-label { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 13px; }
a.bar-label:hover { color: var(--accent); }
.bar-track { height: 16px; background: #241a08; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #c98f3d, var(--accent)); min-width: 2px; }
.bar-value { font-size: 13px; font-weight: 700; color: var(--bright); }
.chart-hint { margin: 14px 0 0; font-size: 12px; }

/* 错误页 / 隐藏工具类 */
.error-card { text-align: center; padding: 60px 20px; }
.error-card h1 { font-size: 44px; color: var(--muted); }

.hidden { display: none !important; }

/* 手机端表格横滚容器（窄屏下列不压扁，整表横滑） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 登录页 */
.login-wrap { display: flex; justify-content: center; padding: 60px 0; }
.login-card { width: 360px; padding: 28px; }
.login-title { text-align: center; margin-bottom: 16px; }
.login-error { background: rgba(224, 122, 106, .12); color: var(--red); border: 1px dashed var(--red); padding: 8px 12px; font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login-form input { height: 36px; padding: 0 10px; border: 1px dashed var(--border); background: var(--card); color: var(--text); font-size: 14px; }
.login-form input:focus { outline: none; border-color: var(--accent); border-style: solid; }
.login-btn { margin-top: 4px; height: 38px; line-height: 36px; }

/* 管理页 */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.inline-form input { height: 34px; padding: 0 10px; border: 1px dashed var(--border); width: 120px; }
.field-label { font-size: 13px; color: var(--muted); }
.state-table { margin-top: 10px; }
.flash { background: var(--green-soft); color: var(--green); border: 1px dashed var(--green); padding: 8px 14px; margin-bottom: 12px; font-size: 13px; }
.flash-error { background: rgba(224, 122, 106, .12); color: var(--red); border-color: var(--red); }
.hint-warn { background: var(--accent-soft); color: var(--bright); border: 1px dashed var(--border); padding: 8px 12px; font-size: 13px; }
.pagebar-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.git-form { display: flex; gap: 6px; }
.git-form input { flex: 1; height: 30px; padding: 0 8px; border: 1px dashed var(--border); font-size: 12px; min-width: 120px; }
.admin-table td { vertical-align: middle; }

/* 帮助页 */
.help-wrap { max-width: 860px; margin: 0 auto; }
.help-wrap h3 { margin: 14px 0 6px; font-size: 13px; color: var(--bright); }
.code { background: #0a0703; color: #d8b070; border: 1px dashed var(--border-dim); padding: 10px 14px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.mcp-url { background: var(--accent-soft); color: var(--bright); padding: 2px 8px; font-weight: 700; border: 1px dashed var(--border); }
.help-examples { margin: 0; padding-left: 20px; font-size: 13px; }
.help-examples li { padding: 3px 0; }

/* 启动自检告警横幅 */
.banner-warn { background: #2a1c08; border-bottom: 1px solid #7a5a1e; color: #ffd08a; font-size: 13px; }
.banner-warn > div { max-width: none; margin: 0 auto; padding: 8px 16px; }

/* 首页看板 */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--border); padding: 14px 16px; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--bright); }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-card.highlight .stat-num { color: var(--accent); }
.stat-card.warn .stat-num { color: var(--red); }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-cols.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .dash-cols, .dash-cols.three { grid-template-columns: 1fr; } }
.trend-chart { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 148px; padding-top: 6px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; height: 100%; }
.trend-bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; width: 100%; justify-content: center; }
.trend-new { width: 42%; min-height: 1px; background: var(--accent); }
.trend-date { font-size: 9px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
/* 趋势「关闭」折线：SVG 叠加柱区（top/height 与柱区精确对齐），vector-effect 保线宽不随拉伸变形 */
.trend-line-svg { position: absolute; top: 6px; left: 0; width: 100%; height: 110px; pointer-events: none; }
.trend-line { fill: none; stroke: var(--green); stroke-width: 2; vector-effect: non-scaling-stroke;
              stroke-linejoin: round; stroke-linecap: round; }
.trend-line-area { fill: var(--green); opacity: .15; stroke: none; }
.legend-dot { display: inline-block; width: 8px; height: 8px; margin: 0 4px 0 10px; }
.legend-dot.new { background: var(--accent); }
.legend-dot.closed { background: var(--green); }

/* AI 问答面板（REPL 风前缀：you> / jwcode>） */
.ai-log { background: #0a0703; border: 1px dashed var(--border); padding: 12px 14px; max-height: 360px; overflow-y: auto; margin-bottom: 10px; }
.ai-line { margin: 4px 0; font-size: 13px; }
.ai-user { color: var(--bright); font-weight: 700; }
.ai-user::before { content: "you> "; color: var(--muted); }
.ai-bot { white-space: pre-wrap; word-break: break-word; }
.ai-bot::before { content: "jwcode> "; color: var(--muted); }
.ai-tool { color: var(--muted); font-size: 12px; min-height: 14px; }
.ai-verdict { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.ai-cite { color: var(--accent); margin-right: 4px; border: 1px dashed var(--border-dim); padding: 0 6px; }
.ai-cite:hover { border-color: var(--accent); text-decoration: none; }
.ai-form { display: flex; gap: 8px; }
.ai-form input { flex: 1; height: 36px; padding: 0 12px; border: 1px dashed var(--border); background: var(--card); color: var(--text); font-size: 14px; }
.ai-form input:focus { outline: none; border-color: var(--accent); border-style: solid; }
.ai-form input:disabled { background: var(--bg); color: var(--muted); }
.ai-prompt-input { width: 100%; padding: 8px 10px; border: 1px dashed var(--border); background: var(--card); color: var(--text); font: 13px/1.6 Consolas, "Microsoft YaHei", monospace; }
.ai-prompt-input:focus { outline: none; border-color: var(--accent); border-style: solid; }

/* AI 问答 markdown 排版（scoped 在 .ai-bot.md；无库回退时保持 pre-wrap 纯文本） */
.ai-bot.md { white-space: normal; }
.ai-bot.md > :first-child { margin-top: 0; }
.ai-bot.md > :last-child { margin-bottom: 0; }
.ai-bot.md h1, .ai-bot.md h2, .ai-bot.md h3, .ai-bot.md h4 {
  font-size: 13.5px; margin: 10px 0 4px; color: var(--bright);
}
.ai-bot.md h1 { font-size: 15px; }
.ai-bot.md h2 { font-size: 14px; }
.ai-bot.md h2::before, .ai-bot.md h1::before, .ai-bot.md h3::before, .ai-bot.md h4::before { content: none; }
.ai-bot.md p { margin: 4px 0; }
.ai-bot.md ul, .ai-bot.md ol { margin: 4px 0; padding-left: 20px; }
.ai-bot.md li { margin: 2px 0; }
.ai-bot.md code {
  background: var(--card2); border: 1px dashed var(--border-dim);
  padding: 0 4px; font: 12px/1.5 Consolas, Menlo, monospace;
}
.ai-bot.md pre {
  background: #0a0703; color: #d8b070; border: 1px dashed var(--border-dim);
  padding: 10px 12px; overflow-x: auto; margin: 6px 0;
}
.ai-bot.md pre code { background: none; border: none; color: inherit; padding: 0; }
.ai-bot.md table {
  display: block; overflow-x: auto; border-collapse: collapse;
  margin: 6px 0; font-size: 12.5px; white-space: nowrap;
}
.ai-bot.md th, .ai-bot.md td {
  border: 1px dashed var(--border-dim); padding: 4px 10px; text-align: left;
}
.ai-bot.md th { background: var(--card2); font-weight: 700; color: var(--bright); }
.ai-bot.md blockquote {
  border-left: 3px solid var(--border); margin: 6px 0; padding: 2px 10px;
  color: var(--muted);
}
.ai-bot.md hr { border: none; border-top: 1px dashed var(--border-dim); margin: 8px 0; }
.ai-bot.md a { color: var(--accent); }
.ai-bot.md img { max-width: 100%; }

/* ===== AI黑灯工厂（剖面图配色由 factory.js 控制，本就深色兼容） ===== */
.factory-layout { display: flex; flex-direction: column; gap: 16px; }
.factory-canvas-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.factory-canvas { width: 100%; height: auto; display: block; border: 1px solid var(--border-dim); background: #12141a; }
.factory-live { display: inline-flex; align-items: center; gap: 5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; animation: live-pulse 1.6s ease-in-out infinite; }
.live-dot.live-err { background: var(--red); animation: none; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.factory-dot-blue, .factory-dot-orange, .factory-dot-yellow { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
.factory-dot-blue { background: #4f9cf9; }
.factory-dot-orange { background: #f59e42; }
.factory-dot-yellow { background: #f5c542; }
.factory-feed { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; } /* 默认 10 条 ≈280px，卡底一屏可见 */
.factory-feed-empty { padding: 14px 4px; }
.factory-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; padding: 3px 8px; background: var(--card2); overflow-wrap: anywhere; }
.factory-row-err { background: rgba(224, 122, 106, .14); }
.f-time { color: var(--muted); font-family: Consolas, monospace; flex: none; }
.f-badge { flex: none; font-weight: 700; font-size: 11.5px; }
.f-web-ai { color: #7fa8ff; }
.f-mcp { color: #f5a95c; }
.f-sync { color: var(--green); }
.f-kind { flex: none; color: var(--muted); }
.f-title { font-weight: 700; color: var(--bright); }
.f-detail { color: var(--muted); flex: 1 1 auto; min-width: 0; }
.f-ok { flex: none; color: var(--green); font-weight: 700; }
.f-ok.f-bad { color: var(--red); }
.f-ms { flex: none; color: var(--muted); font-family: Consolas, monospace; font-size: 11.5px; }
.factory-dot-green { background: #22c55e; }
.f-patrol { color: var(--green); }
.factory-fs-btn { float: right; margin-left: 10px; }
.factory-stage-card:fullscreen { background: #12141a; border: none; padding: 16px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.factory-stage-card:fullscreen .factory-canvas { border: none; margin: 0 auto; }
.factory-stage-card:fullscreen h2, .factory-stage-card:fullscreen .chart-hint { color: #c98f3d; }
.factory-dot-purple { background: #a78bfa; }

/* ===== 访问密码门 ===== */
.login-gate-hint { text-align: center; color: var(--muted); font-size: 13px; margin: -8px 0 12px; }
.footer-sep { margin: 0 6px; }

/* ===== 蒸馏工程师（Git 提交日视图）===== */
.git-status-bar { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); padding: 10px 14px; margin-bottom: 16px; }
.git-status-facts { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.git-fact { font-size: 13px; color: var(--muted); white-space: nowrap; }
.git-fact b { color: var(--bright); font-weight: 700; }
.git-status-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.git-status-hint { flex-basis: 100%; margin: 0; font-size: 12.5px; }
.chip-run { background: var(--accent-soft); color: var(--bright); border-color: var(--border); }
.git-dialog { width: min(560px, 92vw); max-height: 80vh; background: var(--card); color: var(--text); border: 1px solid #7a5a1e; padding: 16px 18px; }
.git-dialog::backdrop { background: rgba(5, 3, 0, .72); }
.git-dialog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.git-dialog-head .muted { flex: 1 1 auto; font-size: 12.5px; }
.git-dialog-x { border: 1px dashed var(--border-dim); background: none; font-size: 15px; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.git-dialog-x:hover { color: var(--bright); }
.git-dialog-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.git-dialog-tools input[type="search"] { flex: 1 1 auto; height: 32px; padding: 0 10px; border: 1px dashed var(--border); font-size: 13px; }
.git-dialog-tools input[type="search"]:focus { outline: none; border-color: var(--accent); border-style: solid; }
.git-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 14px; margin: 0; max-height: 46vh; overflow-y: auto; padding: 2px; }
.git-member { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.git-member input { accent-color: var(--accent); }
.git-member small { overflow: hidden; text-overflow: ellipsis; }
.git-dialog-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-dim); }
.git-dialog-foot-right { margin-left: auto; display: flex; gap: 8px; }
.git-day { margin-bottom: 6px; }
.git-day-head { display: flex; align-items: center; gap: 8px; padding: 8px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.git-day-date { font-weight: 700; font-size: 14px; color: var(--bright); }
/* 提交日视图：列表内部滚动，卡片框/标题/分页一屏完整（终端多面板形态，同 .ai-log/.factory-feed 先例） */
.git-day-scroll { max-height: calc(100vh - 360px); min-height: 220px; overflow-y: auto; }
.git-day-scroll .git-day-head { position: sticky; top: 0; background: var(--card); z-index: 1; }
.git-row { display: flex; align-items: baseline; gap: 10px; padding: 4px 2px; font-size: 13px; }
.git-row:hover { background: var(--card2); }
.git-time { flex: none; color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.git-author { flex: none; font-weight: 700; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bright); }
.git-repo { flex: none; color: var(--accent); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-branch { flex: none; color: var(--muted); font-family: Consolas, monospace; font-size: 12px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-msg { flex: 1 1 auto; min-width: 0; }
.git-msg summary { cursor: pointer; overflow-wrap: anywhere; }
.git-msg summary:hover { color: var(--accent); }
.git-msg pre { margin: 6px 0 2px; padding: 8px 10px; background: #0a0703; border: 1px dashed var(--border-dim); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.git-msg-single { overflow-wrap: anywhere; }
.git-sha { flex: none; color: var(--muted); font-family: Consolas, monospace; font-size: 12px; }
.git-sha:hover { color: var(--accent); }
.ai-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-preset { border: 1px dashed var(--border); background: var(--bg); padding: 4px 12px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.ai-preset:hover { border-color: var(--accent); border-style: solid; color: var(--bright); }
.f-git { color: #b999f5; }   /* 黑灯工厂流水：Git 同步徽章（对应小紫） */

/* ===== 多端响应式：平板 ≤1024 微调 / 手机 ≤700 重组布局 ===== */
@media (max-width: 1024px) {
  .topbar-inner, .syncbar-inner, .pagebar-inner, .banner-warn > div {
    padding-left: 12px; padding-right: 12px;
  }
  .container { padding: 0 12px; }
  .term-host { display: none; }
}

@media (max-width: 700px) {
  body { padding: 10px 8px 18px; }
  .term { border-radius: 8px; min-height: calc(100vh - 28px); }

  /* 顶栏单行（导航已移到底部状态条） */
  .topbar-inner { height: auto; min-height: 42px; gap: 10px; padding: 6px 12px; }

  /* 底部状态条：导航一行横滑 + 页脚信息第二行 */
  .statusbar { flex-wrap: wrap; padding: 0 6px 4px; }
  .nav { flex: 1 1 100%; }
  .nav a { padding: 7px 10px; }
  .status-right { margin: 0 auto; font-size: 10.5px; }

  /* 同步条：进度整行 */
  .syncbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .sync-progress { flex-basis: 100%; order: 3; }
  .sync-track { max-width: none; }

  .pagebar-inner { padding: 12px; }
  .filters input[type="search"], .filters select { flex: 1 1 150px; min-width: 0; }
  .container { margin-top: 12px; padding: 0 12px; }
  .card { padding: 12px; }

  /* 看板：指标卡 2 列、趋势稀疏标日期、条形图收窄 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-num { font-size: 22px; }
  .trend-chart { gap: 2px; }
  .trend-date { visibility: hidden; }
  .trend-col:nth-child(5n+1) .trend-date { visibility: visible; }
  .bar-row { grid-template-columns: 96px 1fr 64px; gap: 8px; }
  .bar-label { font-size: 12px; }

  .bug-table td.bug-subject { min-width: 160px; }
  .detail-head h1 { font-size: 17px; }
  .login-wrap { padding: 32px 0; }
  .ai-log { max-height: 280px; }
  .factory-feed { max-height: 260px; }

  /* 活动流水行 → 两行卡式：第一行=时间+徽章+类型+✓/耗时(右端)，
     第二行=标题整行，第三行=摘要整行（order 重排，不改 JS DOM 顺序） */
  .factory-row { flex-wrap: wrap; row-gap: 2px; }
  .f-ok { margin-left: auto; }
  .f-title { order: 5; flex-basis: 100%; margin-top: 3px; }
  .f-detail { order: 6; flex-basis: 100%; }

  /* 今日统计 chips：两列均分、文字居中 */
  .filters .chip { flex: 1 1 45%; text-align: center; }

  /* 表格横滚：列不挤压；历史页手机隐藏「耗时」列（数据不丢，PC 照旧） */
  .table-scroll .bug-table { min-width: 640px; }
  .history-table th:nth-child(6), .history-table td:nth-child(6) { display: none; }

  /* tab 组横滑（看板时间档/老化档、统计页） */
  .tab-group { overflow-x: auto; scrollbar-width: none; }
  .tab { white-space: nowrap; flex: none; }

  /* 蒸馏工程师：提交行两行卡式（首行=时间+作者+仓库+sha，第二行=说明整行） */
  .git-row { flex-wrap: wrap; row-gap: 2px; }
  .git-sha { margin-left: auto; }
  .git-msg { order: 5; flex-basis: 100%; }
  .git-repo { max-width: 130px; }

  /* 蒸馏工程师：状态栏按钮换行独立成行、弹窗贴边 */
  .git-status-actions { margin-left: 0; flex-basis: 100%; }
  .git-dialog { width: 96vw; max-height: 88vh; padding: 12px; }
  .git-team { grid-template-columns: 1fr; }

  /* .card 收 12px 的规则被 .chart-card 22px 覆盖，这里补齐 */
  .chart-card { padding: 12px; }
}

/* AI监控一屏化（2026-11-01：压缩布局，UI 框完整入屏；仅桌面 ≥701px，手机保持整页滚动）。
   窗口高度锁一屏 + 留白压缩 + 趋势图 vh 自适应；溢出转两分布卡内滚动（.bar-scroll，
   同蒸馏 .git-day-scroll 先例）。规则全部带 .page-dash 前缀，不波及其他页面。 */
@media (min-width: 701px) {
  .page-dash .term { height: calc(100vh - 44px); }  /* 窗口恰一屏：底框线恒在视口内 */
  .page-dash .container { flex: 1; min-height: 0; display: flex; flex-direction: column;
                          margin: 10px auto 12px; overflow-y: auto; } /* 兜底极端矮屏 */
  .page-dash .syncbar-inner { padding: 4px 16px; }
  .page-dash .pagebar-inner { padding: 8px 16px; }
  .page-dash .card { margin-bottom: 12px; }
  .page-dash .stat-grid { gap: 10px; margin-bottom: 12px; }
  .page-dash .stat-card { padding: 8px 14px; }
  .page-dash .stat-num { font-size: 21px; }
  .page-dash .chart-card { padding: 12px 16px; }
  .page-dash .card h2 { margin-bottom: 8px; }
  .page-dash .chart-hint { margin-top: 6px; }
  /* 趋势图 vh 自适应：矮屏让位（svg 叠加层与柱区同值，保持 top:6px 对齐） */
  .page-dash .trend-chart { height: clamp(88px, 15vh, 148px); }
  .page-dash .trend-bars { height: clamp(68px, 11.5vh, 110px); }
  .page-dash .trend-line-svg { height: clamp(68px, 11.5vh, 110px); }
  .page-dash .bar-row { padding: 2px 0; gap: 10px; }
  .page-dash .bar-track { height: 12px; }
  .page-dash .dash-cols { flex: 1; min-height: 0; gap: 12px; margin-bottom: 0; }
  .page-dash .dash-cols .chart-card { display: flex; flex-direction: column;
                                      min-height: 0; margin-bottom: 0; }
  .page-dash .bar-scroll { flex: 1; min-height: 0; overflow-y: auto; }
}

/* 看板点击跳转 Bug 明细（2026-11-02 八·三十八）：统计元素由 div 换 a，样式不变 + hover 反馈 */
a.stat-card { color: inherit; text-decoration: none; }
a.stat-card:hover { border-color: var(--accent); }
a.bar-row { color: inherit; text-decoration: none; }
a.bar-row:hover { background: var(--accent-soft); }
a.trend-col { color: inherit; text-decoration: none; }
a.trend-col:hover .trend-new { opacity: .7; }

/* Bug 列表页：看板跳转带来的筛选提示 chips */
.filter-chips { max-width: none; padding: 0 16px 10px; display: flex; align-items: center;
                gap: 8px; flex-wrap: wrap; font-size: 12px; }
.filter-chips .chip { background: var(--accent-soft); color: var(--bright);
                      padding: 1px 8px; border: 1px solid var(--border); white-space: nowrap; }
.filter-chips a { white-space: nowrap; }
