:root {
  --accent: #1f4e79;
  --accent-light: #e8f0f8;
  --border: #d8dee6;
  --bg: #f5f7fa;
  --error: #d33a2c;
  --warning: #c98a00;
  --info: #2f6fb3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: #2b2f36;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 28px; color: var(--accent); }
.brand-text h1 { font-size: 20px; color: var(--accent); letter-spacing: .5px; }
.brand-text p { font-size: 12px; color: #7a8494; }

.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ctl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4a5362; }
.ctl select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
}
.ctl input[type=checkbox] { accent-color: var(--accent); }
.btn {
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { opacity: .88; }
.stats { font-size: 13px; font-weight: 600; }
.stats .err { color: var(--error); }
.stats .warn { color: var(--warning); }
.stats .inf { color: var(--info); }

/* ---------- 主区域 ---------- */
.layout { flex: 1; display: flex; min-height: 0; }
.editor-pane { flex: 1; min-width: 0; display: flex; background: #fff; }
.editor-pane .CodeMirror { flex: 1; height: auto; font-size: 14px; }

.sidebar {
  width: 400px;
  min-width: 320px;
  background: #fff;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 13px;
  color: #7a8494;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; flex: 1; overflow-y: auto; padding: 10px 12px; }
.tab-panel.active { display: block; }

/* ---------- 问题列表 ---------- */
.problem {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .12s;
}
.problem:hover { box-shadow: 0 2px 8px rgba(31, 78, 121, .15); }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; }
.dot.error { background: var(--error); }
.dot.warning { background: var(--warning); }
.dot.info { background: var(--info); }
.problem .body { flex: 1; min-width: 0; }
.problem .head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  white-space: nowrap;
}
.badge.sev-error { background: #fdecea; color: var(--error); }
.badge.sev-warning { background: #fff6e0; color: var(--warning); }
.badge.sev-info { background: #e7f1fa; color: var(--info); }
.problem .msg { font-size: 13px; line-height: 1.5; }
.problem .loc { font-size: 11px; color: #9aa3b2; margin-top: 2px; }

.empty { text-align: center; color: #9aa3b2; font-size: 13px; padding: 40px 0; }

/* ---------- 分类报告 ---------- */
.report-cat { margin-bottom: 18px; }
.report-cat h3 {
  font-size: 14px;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.type-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #fff;
}
.type-card .row1 { display: flex; align-items: center; gap: 8px; }
.type-card .name { font-size: 13px; font-weight: 600; }
.count {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 0 7px;
  line-height: 18px;
}
.type-card .desc { font-size: 12px; color: #5a6472; margin: 4px 0; line-height: 1.5; }
.type-card .hint { font-size: 12px; color: var(--info); margin-bottom: 6px; }
.line-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  color: #4a5362;
}
.chip:hover { background: var(--accent-light); color: var(--accent); }

/* ---------- 状态栏 ---------- */
.statusbar {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 5px 16px;
  background: var(--accent);
  color: #dbe6f2;
  font-size: 12px;
}
.statusbar .spacer { flex: 1; }
.statusbar .warn { color: #ffd98a; }

/* 跳转高亮 */
.CodeMirror .sg-flash { background: rgba(255, 196, 0, .35); }
