/* ==========================================================================
   1+2+N 安全管理 —— 界面样式
   参考 WorkBuddy 的信息架构：左侧导航 + 会话列表 / 中部工作区 / 状态顶栏
   ========================================================================== */

:root {
  /* —— 能量环设计系统 v3 ——
     品牌基因取自国家电投标志：红→橙→绿旋转能量环
     主绿提亮到 #00A860（年轻化），红 #C7000B 只做能量带与警示 */
  --bg: #fafbfa;
  --bg-sub: #f3f5f3;
  --bg-side: #f2f5f2;
  --bg-hover: #e9ede9;
  --line: #e6e9e6;
  --line-strong: #d5dad5;

  --text: #171a1e;
  --text-2: #565e58;
  --text-3: #878f88;
  --text-4: #a9b0aa;

  --brand: #00a860;
  --brand-600: #00833e;
  --brand-700: #00622e;
  --brand-soft: #e5f6ec;
  --brand-soft-2: #cbeedb;

  --energy: linear-gradient(90deg, #f18c00 0%, #e8590c 18%, #c7000b 38%, #3aa935 68%, #00833e 100%);
  --fire: #c7000b;
  --fire-soft: #fdeeed;

  --teal: #0e9c8d;
  --teal-soft: #e4f5f2;

  --danger: #d9363e;
  --danger-soft: #fdeceb;
  --warn: #c97a09;
  --warn-soft: #fdf3e2;
  --ok: #00a860;
  --ok-soft: #e5f6ec;

  --shadow-sm: 0 1px 2px rgba(23, 26, 30, .05), 0 1px 6px rgba(23, 26, 30, .04);
  --shadow-md: 0 4px 14px rgba(23, 26, 30, .07), 0 1px 4px rgba(23, 26, 30, .05);
  --shadow-lg: 0 16px 48px rgba(23, 26, 30, .13), 0 2px 8px rgba(23, 26, 30, .06);
  --shadow-brand: 0 4px 14px rgba(0, 131, 62, .28);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sidebar-w: 268px;
  --topbar-h: 52px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d7de; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bfc9; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 布局骨架 ============================ */

.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================ 侧边栏 ============================ */

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 10px 8px;
  user-select: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 12px;
}

.brand-mark { display: flex; }

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text);
  line-height: 1.3;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
  margin-top: 1px;
}

.new-task {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(18, 87, 201, .3);
  transition: background .15s, transform .1s;
}

.new-task:hover { background: var(--brand-600); }
.new-task:active { transform: translateY(1px); }

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
}

.nav-item svg { flex: 0 0 auto; opacity: .8; }

.nav-item:hover { background: var(--bg-hover); color: var(--text); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.sessions {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .5px;
}

.mini-btn {
  font-size: 12px;
  color: var(--text-3);
  padding: 1px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .15s, background .15s;
}

.sessions:hover .mini-btn { opacity: 1; }
.mini-btn:hover { background: var(--bg-hover); color: var(--danger); }

.session-list {
  overflow-y: auto;
  padding-right: 2px;
  flex: 1;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s;
}

.session-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item:hover { background: var(--bg-hover); }
.session-item.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

.session-empty {
  padding: 10px;
  font-size: 13px;
  color: var(--text-4);
  line-height: 1.7;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 6px;
}

.foot-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text-2);
}

.foot-btn:hover { background: var(--bg-hover); }

.foot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 2px;
  font-size: 12px;
  color: var(--text-3);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-4);
  flex: 0 0 auto;
}

.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot.busy { background: var(--brand); animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ============================ 主区 ============================ */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }

.crumb {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

.mode-switch {
  display: flex;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.mode-switch button {
  height: 24px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-2);
  transition: all .15s;
}

.mode-switch button:hover { color: var(--text); }

.mode-switch button.active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 20px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--text-2);
  transition: background .15s, color .15s;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ============================ 对话视图 ============================ */

.chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-inner {
  max-width: 896px;
  margin: 0 auto;
  padding: 28px 28px 12px;
}

.chat-inner.is-empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 48px;
}

.hero { padding: 32px 0 8px; }

.hero h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  margin: 0 0 8px;
  color: var(--text);
}

.hero p {
  margin: 0 0 26px;
  color: var(--text-3);
  font-size: 14px;
}

.hero-tags { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }

.hero-tag {
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
}

.hero-tag.t2 { background: var(--teal-soft); color: var(--teal); }
.hero-tag.t3 { background: var(--bg-sub); color: var(--text-2); border: 1px solid var(--line); }

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-card {
  text-align: left;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  transition: all .16s;
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.quick-card:hover {
  border-color: var(--brand-soft-2);
  background: #fcfdff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.quick-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: 0 0 auto;
  background: var(--brand-soft);
  color: var(--brand);
}

.quick-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}

.quick-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

/* ---------- 消息 ---------- */

.msg-list { padding-bottom: 8px; }

.msg { display: flex; gap: 12px; margin-bottom: 26px; }

.msg-user { justify-content: flex-end; }

.msg-user .msg-body {
  max-width: 76%;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-2);
  border-radius: var(--r-lg) var(--r-lg) 3px var(--r-lg);
  padding: 10px 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #14315e;
}

.avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2b7cf0, #0d4aa8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
  box-shadow: 0 1px 3px rgba(13, 74, 168, .3);
}

.msg-ai .msg-body { flex: 1; min-width: 0; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.msg-meta .who { font-weight: 600; color: var(--text-2); font-size: 13px; }

.msg-meta .tag {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  font-size: 12px;
}

.thinking {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-sub);
  margin-bottom: 10px;
  overflow: hidden;
}

.thinking summary {
  cursor: pointer;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-3);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.thinking summary::-webkit-details-marker { display: none; }

.thinking[open] summary { border-bottom: 1px solid var(--line); }

.thinking .t-body {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
  line-height: 1.65;
}

.citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.cite-label { font-size: 12px; color: var(--text-3); margin-right: 2px; align-self: center; }

.cite {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all .14s;
}

.cite:hover { border-color: var(--brand-soft-2); background: var(--brand-soft); color: var(--brand); }

.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity .15s;
}

.msg-ai:hover .msg-actions { opacity: 1; }

.act-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-3);
}

.act-btn:hover { background: var(--bg-sub); color: var(--text); }

/* ---------- 输入器 ---------- */

.composer-wrap {
  flex: 0 0 auto;
  padding: 6px 28px 16px;
  background: linear-gradient(to top, #fff 65%, rgba(255, 255, 255, 0));
}

.queue-bar {
  display: none;
  margin: 0 auto 6px;
  max-width: 860px;
  padding: 5px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg-sub);
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.composer {
  max-width: 840px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: 0 2px 12px rgba(16, 24, 40, .06);
  transition: border-color .18s, box-shadow .18s;
}

.composer:focus-within {
  border-color: #b9d0f7;
  box-shadow: 0 0 0 3px rgba(18, 87, 201, .09), 0 4px 18px rgba(16, 24, 40, .07);
}

.composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 14px 16px 4px;
  font-size: 14px;
  line-height: 1.62;
  max-height: 190px;
  background: transparent;
  color: var(--text);
}

.composer textarea::placeholder { color: var(--text-4); }

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 9px 12px;
  gap: 8px;
}

.c-left, .c-right { display: flex; align-items: center; gap: 6px; }

.chip-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--text-2);
  transition: all .14s;
  white-space: nowrap;
}

.chip-btn:hover { background: var(--bg-sub); border-color: var(--line-strong); }

.chip-btn.on {
  background: var(--brand-soft);
  border-color: var(--brand-soft-2);
  color: var(--brand);
  font-weight: 600;
}

.chip-btn svg { opacity: .8; }

/* 右侧多了上传按钮后这一行更容易被挤断，明确不换行 */
.hint { font-size: 12px; color: var(--text-4); margin-right: 4px; white-space: nowrap; }

.send-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
  flex: 0 0 auto;
}

.send-btn:hover { background: var(--brand-600); }
.send-btn:active { transform: scale(.95); }

.send-btn:disabled {
  background: #c9d3e3;
  cursor: not-allowed;
}

.send-btn.stop { background: var(--danger); }

/* ---------- 流式光标 ---------- */

.cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--brand);
  vertical-align: -2px;
  margin-left: 2px;
  border-radius: 1px;
  animation: blink .95s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ============================ Markdown ============================ */

.md { font-size: 14px; line-height: 1.78; color: var(--text); word-break: break-word; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }

.md h1, .md h2, .md h3, .md h4 {
  margin: 20px 0 9px;
  font-weight: 680;
  line-height: 1.4;
  letter-spacing: -.2px;
}

.md h1 { font-size: 22px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.md h2 { font-size: 18px; }
.md h3 { font-size: 14px; }
.md h4 { font-size: 14px; color: var(--text-2); }

.md p { margin: 9px 0; }
.md ul, .md ol { margin: 9px 0; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li > ul, .md li > ol { margin: 3px 0; }

.md strong { font-weight: 680; color: #0d1b2e; }
.md em { font-style: italic; color: var(--text-2); }

.md a { color: var(--brand); text-decoration: none; border-bottom: 1px solid var(--brand-soft-2); }
.md a:hover { border-bottom-color: var(--brand); }

.md code {
  background: #f2f4f7;
  padding: 1.5px 5px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
  color: #b5385c;
  border: 1px solid #e9ecf1;
}

.md pre {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin: 11px 0;
  overflow: hidden;
}

.md pre .pre-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: #f5f7f9;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}

.md pre .copy-code {
  font-size: 12px;
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 4px;
}

.md pre .copy-code:hover { background: #e8ebf0; color: var(--text); }

.md pre code {
  display: block;
  padding: 11px 13px;
  overflow-x: auto;
  background: none;
  border: none;
  color: #26303d;
  font-size: 13px;
  line-height: 1.65;
}

.md blockquote {
  margin: 11px 0;
  padding: 7px 14px;
  border-left: 3px solid var(--brand-soft-2);
  background: #fafbfd;
  color: var(--text-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.md blockquote p { margin: 3px 0; }

.md table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.md th {
  background: var(--bg-sub);
  font-weight: 650;
  text-align: left;
  color: var(--text-2);
}

.md th, .md td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px 11px;
  vertical-align: top;
}

.md tr:last-child td { border-bottom: none; }
.md th:last-child, .md td:last-child { border-right: none; }
.md tbody tr:hover { background: #fafbfd; }

.md hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* 数学公式（离线降级渲染） */
.math {
  font-family: "Cambria Math", "Times New Roman", Georgia, serif;
  font-size: 14px;
  background: #f7f9fc;
  border-radius: 4px;
  padding: 1px 5px;
  color: #1d3557;
  white-space: nowrap;
}

.math.block {
  display: block;
  white-space: normal;
  text-align: center;
  padding: 10px 14px;
  margin: 9px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 16px;
  line-height: 1.9;
}

.math sub, .math sup { font-size: 12px; }

/* ============================ 通用页面头 ============================ */

.page { height: 100%; overflow-y: auto; }
.page-inner { max-width: 1080px; margin: 0 auto; padding: 26px 32px 40px; }

.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 22px; font-weight: 700; margin: 0 0 5px; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--text-3); font-size: 14px; }

.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

/* ============================ 专家中心 ============================ */

.expert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}

.expert-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  background: #fff;
  transition: all .16s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expert-card:hover {
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.expert-top { display: flex; align-items: center; gap: 10px; }

.expert-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 36px;
}

.expert-name { font-size: 14px; font-weight: 650; }
.expert-role { font-size: 13px; color: var(--text-3); margin-top: 1px; }

.expert-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.62;
  flex: 1;
}

.expert-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag-pill {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-sub);
  color: var(--text-3);
  border: 1px solid var(--line);
}

/* ============================ 知识库 ============================ */

.kb-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  transition: all .16s;
}

.search-box:focus-within {
  border-color: #b9d0f7;
  box-shadow: 0 0 0 3px rgba(18, 87, 201, .08);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 14px;
}

.search-box svg { color: var(--text-4); flex: 0 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}

.btn:hover { background: var(--brand-600); }
.btn.ghost { background: #fff; border: 1px solid var(--line-strong); color: var(--text-2); font-weight: 500; }
.btn.ghost:hover { background: var(--bg-sub); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.kb-layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 16px;
  align-items: start;
}

.tree-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  position: sticky;
  top: 0;
}

.tree-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-3);
  background: var(--bg-sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tree-body { max-height: calc(100vh - 260px); overflow-y: auto; padding: 6px; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}

.tree-node:hover { background: var(--bg-sub); }
.tree-node.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.tree-node span { overflow: hidden; text-overflow: ellipsis; }
.tree-node .ti { flex: 0 0 auto; opacity: .55; font-size: 12px; }

.result-list { display: flex; flex-direction: column; gap: 9px; }

.result-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}

.result-card:hover { border-color: var(--brand-soft-2); box-shadow: var(--shadow-sm); }

.result-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--brand);
  margin-bottom: 4px;
}

.result-snippet {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-meta {
  display: flex;
  gap: 10px;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-4);
}

.result-meta b { font-weight: 600; color: var(--text-3); }

.doc-view {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 20px 24px;
  min-height: 300px;
}

.doc-view .md { font-size: 14px; }

.kb-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-4);
  font-size: 14px;
}

/* ============================ 报告工坊 ============================ */

.studio-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  align-items: start;
}

.form-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 16px;
  position: sticky;
  top: 0;
}

.field { margin-bottom: 13px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}

.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: all .15s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #b9d0f7;
  box-shadow: 0 0 0 3px rgba(18, 87, 201, .08);
}

.field textarea { resize: vertical; min-height: 64px; line-height: 1.6; }

.tpl-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.tpl-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
  transition: all .14s;
}

.tpl-item:hover { border-color: var(--line-strong); background: var(--bg-sub); }

.tpl-item.active {
  border-color: var(--brand-soft-2);
  background: var(--brand-soft);
}

.tpl-item .tn { font-size: 14px; font-weight: 620; color: var(--text); }
.tpl-item.active .tn { color: var(--brand); }
.tpl-item .td { font-size: 12px; color: var(--text-3); margin-top: 1px; }

.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sub);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.preview-head .ph-title { font-size: 13px; font-weight: 650; color: var(--text-2); }
.preview-body { padding: 22px 26px; flex: 1; overflow-y: auto; max-height: calc(100vh - 230px); }

/* ---- Office 导出条 ---- */

.export-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-sub);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.export-bar .eb-label {
  font-size: 13px;
  font-weight: 620;
  color: var(--text-3);
  letter-spacing: .02em;
}

.export-bar .eb-btn {
  height: 26px;
  padding: 0 12px;
  font-size: 13px;
}

.export-bar .eb-btn:disabled { opacity: .42; cursor: not-allowed; }

.export-bar .eb-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46%;
}

/* ---- 模板库条目 ---- */

.of-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.of-item.busy { opacity: .55; pointer-events: none; }

.of-badge {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-num, Arial), sans-serif;
}

.of-docx { background: #1C5CBF; }
.of-pptx { background: #C7000B; }
.of-xlsx { background: #00833E; }

.of-text { min-width: 0; }
.of-text .td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================ 服务监控 ============================ */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.svc-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 16px 16px 15px;
  display: flex;
  flex-direction: column;
}

.svc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.svc-name { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 7px; }

.svc-port {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-sub);
  color: var(--text-3);
  font-family: Consolas, monospace;
  border: 1px solid var(--line);
}

.svc-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.svc-badge.ok { background: var(--ok-soft); color: var(--ok); }
.svc-badge.bad { background: var(--danger-soft); color: var(--danger); }
.svc-badge.warn { background: var(--warn-soft); color: var(--warn); }

.svc-rows { display: flex; flex-direction: column; gap: 7px; }

.svc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-3);
}
/* 标签不换行、值可收缩——否则字号放大后「入口主机」会被拆成两行，卡片高度失控 */
.svc-row > span { flex: 0 0 auto; white-space: nowrap; }

.svc-row b {
  font-weight: 500;
  color: var(--text-2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  overflow: hidden;
  margin-bottom: 16px;
}

.panel-head {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sub);
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-body { padding: 14px 15px; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-sub);
  color: var(--text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

table.data td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

table.data tr:last-child td { border-bottom: none; }
table.data td.num { font-family: Consolas, monospace; }

.stat-row { display: flex; gap: 22px; flex-wrap: wrap; }

.stat { display: flex; flex-direction: column; gap: 1px; }
.stat .k { font-size: 12px; color: var(--text-3); }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.4px; color: var(--text); }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 2px; }

/* ============================ 弹层 / 提示 ============================ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .32);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.overlay.show { display: flex; }

.modal {
  width: 480px;
  max-width: calc(100vw - 40px);
  max-height: 84vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px;
}

.modal h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.modal .m-sub { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }

.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.modal-row:last-of-type { border-bottom: none; }
.modal-row .ml { color: var(--text-2); }
.modal-row .mv { color: var(--text-3); font-size: 13px; font-family: Consolas, monospace; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 16px);
  background: #1f2530;
  color: #fff;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition: all .22s;
  z-index: 200;
  box-shadow: var(--shadow-md);
  max-width: 70vw;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #8c1f24; }

/* 加载态 */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand-soft-2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-3);
  padding: 4px 0;
}

.empty-note {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-4);
  font-size: 14px;
  line-height: 1.8;
}

/* 高亮检索词 */
mark {
  background: #fff2b8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* ==========================================================================
   Electron 桌面外壳
   ========================================================================== */

.drag-region { -webkit-app-region: drag; }
.no-drag { -webkit-app-region: no-drag; }

/* 顶栏右侧给系统窗口按钮留位置（titleBarOverlay 高 52） */
.topbar {
  padding-right: 148px;
  -webkit-app-region: drag;
}

.topbar .mode-switch,
.topbar .status-chip,
.topbar .icon-btn {
  -webkit-app-region: no-drag;
}

.sidebar .brand { -webkit-app-region: drag; }

body { user-select: none; }
.md, .msg-body, .doc-view, textarea, input { user-select: text; }

/* ==========================================================================
   工具调用
   ========================================================================== */

.tool-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0;
}

.tool-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-sub);
  font-size: 13px;
  color: var(--text-2);
  max-width: 100%;
  overflow: hidden;
}

.tool-chip .ti-ico {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.tool-chip .tname { font-weight: 600; color: var(--text); flex: 0 0 auto; }

.tool-chip .targ {
  font-family: Consolas, monospace;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tool-chip .tstat { font-size: 12px; color: var(--text-4); flex: 0 0 auto; }

.tool-chip.running { border-color: var(--brand-soft-2); background: #f7faff; }
.tool-chip.running .tstat { color: var(--brand); }
.tool-chip.err { border-color: #f3c9c7; background: var(--danger-soft); }
.tool-chip.err .tstat { color: var(--danger); }

.tool-chip details { flex: 1; min-width: 0; }
.tool-chip summary { cursor: pointer; list-style: none; display: flex; gap: 7px; align-items: center; }
.tool-chip summary::-webkit-details-marker { display: none; }
.tool-chip pre {
  margin: 6px 0 0;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 运行态 */
.msg-ai .run-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.2s infinite;
}

/* ==========================================================================
   能量环重塑层 · Energy Loop Restyle
   设计基因：国家电投标志的红→橙→绿旋转能量环 × 年轻化（20–35）视觉语言
   —— 大圆角 / 软阴影 / 悬浮反馈 / 能量带点缀 / 清爽留白
   本层整体覆盖前面的同名规则，保持结构不动、只动观感
   ========================================================================== */

/* ---------- 全局 ---------- */
body { letter-spacing: .1px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cfc9; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aeb6ae; background-clip: content-box; }

::selection { background: var(--brand-soft-2); }

/* 能量带：品牌签名细节，用于导航激活、卡片悬停、标题强调 */
.energy-line {
  height: 3px;
  border-radius: 2px;
  background: var(--energy);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  background: linear-gradient(180deg, #f7faf7 0%, #f1f5f1 100%);
  border-right: 1px solid rgba(0, 131, 62, .07);
}

.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.brand-sub { color: var(--brand-600); opacity: .75; font-weight: 500; }

.new-task {
  background: linear-gradient(135deg, #00b45a 0%, #00833e 100%);
  border-radius: var(--r-md);
  font-weight: 700;
  box-shadow: var(--shadow-brand);
  transition: filter .15s, transform .1s, box-shadow .15s;
}
.new-task:hover {
  background: linear-gradient(135deg, #00a454 0%, #007838 100%);
  box-shadow: 0 6px 18px rgba(0, 131, 62, .34);
}
.new-task:active { transform: translateY(1px) scale(.99); }

.nav { gap: 3px; }

.nav-item {
  height: 37px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  gap: 10px;
  transition: background .14s, color .14s, transform .1s;
}
.nav-item:hover { background: rgba(0, 131, 62, .07); transform: translateX(1px); }
.nav-item:active { transform: translateX(1px) scale(.985); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 700;
}

/* 激活态左沿：能量带（品牌 DNA 的旋转渐变） */
.nav-item.active::before {
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--energy);
}

.session-item { height: 33px; border-radius: 9px; font-size: 14px; }
.session-item:hover { background: rgba(0, 131, 62, .06); }
.session-item.active {
  background: #fff;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--brand-soft-2);
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(250, 251, 250, .82);
  border-bottom: 1px solid rgba(0, 131, 62, .06);
  backdrop-filter: blur(14px) saturate(1.4);
}

.crumb { font-weight: 750; letter-spacing: -.1px; }

.mode-switch {
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2.5px;
}
.mode-switch button { border-radius: 8px; font-weight: 500; }
.mode-switch button.active {
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

.status-chip { border-radius: 999px; }

/* ---------- 对话 ---------- */

/* 欢迎区 */
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.25;
}

.hero-tag { border-radius: 999px; font-weight: 600; }

.quick-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #fff;
  transition: transform .16s cubic-bezier(.2, .7, .3, 1.2), box-shadow .16s, border-color .16s;
  position: relative;
  overflow: hidden;
}
.quick-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--energy);
  opacity: 0;
  transition: opacity .16s;
}
.quick-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
}
.quick-card:hover::before { opacity: 1; }

.quick-ico { border-radius: 12px; }

/* 消息气泡 */
.msg { margin-bottom: 24px; }

.msg-user .msg-body {
  background: linear-gradient(135deg, #e5f6ec 0%, #dcf2e6 100%);
  border: 1px solid var(--brand-soft-2);
  border-radius: 16px 16px 5px 16px;
}

.avatar {
  background: linear-gradient(135deg, #00b45a 0%, #00622e 100%);
  border-radius: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 131, 62, .25);
}

.msg-meta .tag { border-radius: 999px; }

.cite {
  border-radius: 999px;
  transition: all .13s;
}
.cite:hover { transform: translateY(-1px); }

.thinking {
  border-radius: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-2);
}

/* 工具胶囊 */
.tool-chip {
  border-radius: 999px;
  font-weight: 500;
}
.tool-chip.running {
  border-color: var(--brand-soft-2);
  background: linear-gradient(90deg, #fff 0%, var(--brand-soft) 100%);
}

/* ---------- 输入区 ---------- */
.composer {
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(0, 168, 96, .13), var(--shadow-md);
}

.chip-btn {
  border-radius: 999px;
  font-weight: 500;
  transition: all .13s;
}
.chip-btn.on {
  background: var(--brand-soft);
  border-color: var(--brand-soft-2);
  color: var(--brand-700);
  font-weight: 600;
}

.send-btn {
  background: linear-gradient(135deg, #00b45a 0%, #00833e 100%);
  box-shadow: var(--shadow-brand);
  transition: filter .14s, transform .1s;
}
.send-btn:hover { filter: brightness(1.06); background: linear-gradient(135deg, #00b45a 0%, #00833e 100%); }

.queue-bar {
  border: 1px dashed var(--brand-soft-2);
  background: var(--brand-soft);
  color: var(--brand-700);
  border-radius: 999px;
  max-width: 420px;
}

/* ---------- Markdown ---------- */
.md h1 { border-bottom: 2px solid var(--brand-soft-2); border-radius: 2px; }
.md strong { color: #0e3d24; }
.md a { color: var(--brand-600); }
.md pre { border-radius: 14px; }
.md code { border-radius: 6px; }
.md blockquote {
  border-left: 3px solid var(--brand);
  background: linear-gradient(90deg, var(--brand-soft) 0%, rgba(229, 246, 236, 0) 90%);
  border-radius: 0 10px 10px 0;
}
.md table { border-radius: 12px; overflow: hidden; }
.md th { background: var(--brand-soft); color: var(--brand-700); }

/* ---------- 通用页面 ---------- */
.page-head h2 {
  font-weight: 800;
  letter-spacing: -.4px;
  position: relative;
  padding-left: 14px;
}
/* 页面标题左沿能量带 */
.page-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 3px;
  background: var(--energy);
}

/* ---------- 专家中心 ---------- */
.expert-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: #fff;
  transition: transform .16s cubic-bezier(.2, .7, .3, 1.2), box-shadow .16s, border-color .16s;
  position: relative;
  overflow: hidden;
}
.expert-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--energy);
  opacity: 0;
  transition: opacity .16s;
}
.expert-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-md);
}
.expert-card:hover::before { opacity: 1; }

.expert-ico { border-radius: 12px; }
.tag-pill { border-radius: 999px; }

/* ---------- 知识库 ---------- */
.search-box { border-radius: 12px; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 168, 96, .12); }

.btn {
  border-radius: 12px;
  background: linear-gradient(135deg, #00b45a 0%, #00833e 100%);
  font-weight: 600;
  box-shadow: var(--shadow-brand);
}
.btn:hover { background: linear-gradient(135deg, #00a454 0%, #007838 100%); }

.tree-node.active { border-radius: 9px; }
.result-card {
  border-radius: 14px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.result-card:hover { transform: translateY(-2px); }

/* ---------- 报告工坊 ---------- */
.form-panel, .preview-panel { border-radius: var(--r-lg); }
.field input, .field select, .field textarea { border-radius: 10px; }
.tpl-item { border-radius: 12px; }
.tpl-item.active { border-color: var(--brand); background: var(--brand-soft); }
.export-bar { border-radius: 12px; }
.export-bar .eb-btn { border-radius: 10px; }

/* ---------- 服务监控 ---------- */
.svc-card {
  border-radius: var(--r-lg);
  transition: transform .15s, box-shadow .15s;
}
.svc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.svc-badge { border-radius: 999px; font-weight: 600; }
.svc-port { border-radius: 999px; }
.panel { border-radius: var(--r-lg); }
.stat .v { font-weight: 800; letter-spacing: -.6px; }

/* ---------- 弹层 ---------- */
.modal { border-radius: var(--r-xl); }

/* ---------- 状态点 ---------- */
.dot.busy { background: var(--brand); }

/* ---------- 尊重系统级减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
