/* 临床管线竞争格局管理系统 — 全局样式 */
:root {
  --c-primary: #2f6fed;
  --c-bg: #f5f7fa;
  --c-sidebar: #1f2a44;
  --c-sidebar-hover: #2b3856;
  --c-text: #1f2733;
  --c-muted: #7a8699;
  --c-border: #e4e8ef;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

#app { height: 100vh; }
.layout { height: 100vh; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  background: var(--c-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f8ef7, #2f6fed);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  letter-spacing: .5px;
}

.brand-title { color: #fff; font-size: 15px; font-weight: 600; line-height: 1.2; }
.brand-sub { color: #8c9ab4; font-size: 11px; margin-top: 2px; }

.side-menu { border-right: none; background: transparent; flex: 1; }
.side-menu .el-menu-item {
  color: #b9c3d6;
  height: 44px;
  line-height: 44px;
  margin: 4px 10px;
  border-radius: 8px;
}
.side-menu .el-menu-item:hover { background: var(--c-sidebar-hover); color: #fff; }
.side-menu .el-menu-item.is-active { background: var(--c-primary); color: #fff; }
.side-menu .el-menu-item.is-disabled { opacity: .4; }

/* 菜单分组标题：与 el-menu 的 item 视觉区分，不可点击 */
.menu-group-title {
  padding: 14px 20px 6px;
  font-size: 11px;
  letter-spacing: .5px;
  color: #5f6d88;
  user-select: none;
}

.sidebar-footer { padding: 12px 18px; color: #61708c; font-size: 11px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.topbar-title { font-size: 16px; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip {
  cursor: pointer;
  font-size: 13px;
  color: var(--c-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  outline: none;
}
.user-chip .caret { font-size: 10px; color: var(--c-muted); }

.main { padding: 20px; overflow-y: auto; }

/* ---------------- 通用卡片 ---------------- */
.panel {
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  padding: 18px 20px;
}
.panel + .panel { margin-top: 16px; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.panel-title { font-size: 15px; font-weight: 600; }
.panel-desc { font-size: 12px; color: var(--c-muted); margin-top: 4px; }

/* ---------------- 统计卡 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 18px 20px;
}
.stat-label { font-size: 12px; color: var(--c-muted); }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; color: var(--c-primary); }
.stat-value.neutral { color: var(--c-text); }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef3fd 0%, #e3ecfb 50%, #eaf0fe 100%);
}
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 34px 34px 26px;
  box-shadow: 0 18px 48px rgba(31, 42, 68, .12);
}
.login-head { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f8ef7, #2f6fed);
  color: #fff; font-weight: 700; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 19px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--c-muted); margin-top: 6px; }
.login-foot { text-align: center; font-size: 11px; color: #9aa6b8; margin-top: 18px; }

/* ---------------- 树页面 ---------------- */
.tree-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tree-layout { grid-template-columns: 1fr; } }

.tree-node { display: flex; align-items: center; gap: 8px; width: 100%; padding-right: 8px; }
.tree-node .node-name { flex: 1; }
.tree-node .node-ops { opacity: 0; transition: opacity .15s; }
.tree-node:hover .node-ops { opacity: 1; }
.node-ops .el-button + .el-button { margin-left: 4px; }

/* 治疗领域：界面合成的虚拟顶层，不是真实适应症。
   用浅色底 + 加粗与真实节点区分，让人一眼看出这是「分类」。 */
.tree-node.area-node .area-name {
  font-weight: 700; color: #1f3a63; letter-spacing: .2px;
}
.tree-node.area-node .area-count {
  margin-left: 8px; font-size: 11px; font-weight: 400;
  color: #6b7d99; background: #e8eef7;
  border-radius: 9px; padding: 1px 8px;
}
/* 领域行整体淡底，加强「分组标题」的观感 */
.el-tree > .el-tree-node > .el-tree-node__content {
  background: #f5f8fc;
  border-radius: 6px;
  margin-bottom: 2px;
}
.el-tree > .el-tree-node > .el-tree-node__content:hover { background: #eaf1fa; }

.custom-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #f0a020; margin-left: 6px; vertical-align: middle;
}

.hint-box {
  font-size: 12px; color: var(--c-muted); line-height: 1.7;
}
.hint-box b { color: var(--c-text); }

.empty-tip { color: var(--c-muted); font-size: 13px; padding: 30px 0; text-align: center; }

/* ---------------- 同义异名提醒 ---------------- */
.similar-box {
  background: #fff8e6;
  border: 1px solid #ffe1a8;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
}
.similar-title { font-weight: 600; color: #a86b00; margin-bottom: 6px; }
.similar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 0; color: #5c4a1f;
}
.similar-path { color: #8a7a55; font-size: 11px; flex: 1; }
.similar-sim { color: #a86b00; font-size: 11px; }

/* ---------------- 批量移动 ---------------- */
.bulk-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 12px;
  background: #f0f7ff; border: 1px solid #cfe4ff; border-radius: 8px;
  font-size: 13px; color: var(--c-text);
}
.bulk-count { color: #1667d1; font-weight: 600; }
.bulk-bar .bulk-spacer { flex: 1; }

.dialog-tip {
  font-size: 12px; color: var(--c-muted); line-height: 1.8;
  background: #f7f9fc; border-radius: 6px; padding: 9px 11px;
  margin-bottom: 12px;
}
.dialog-tip b { color: var(--c-text); }
.dialog-tip .tip-warn { color: #c45656; }

.conflict-box {
  background: #fef0f0; border: 1px solid #fbc4c4; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 12px; color: #a13b3b;
}
.conflict-title { font-weight: 600; margin-bottom: 6px; }
.conflict-box ul { margin: 0; padding-left: 18px; line-height: 1.8; }

/* 树勾选框与节点名对齐 */
.el-tree-node__content { height: 34px; }

/* ---------------- 通用小工具类（v0.3.0） ---------------- */
.muted { color: var(--c-muted); }
/* el-select 选项里角色名的补充说明 */
.opt-desc { float: right; color: var(--c-muted); font-size: 12px; margin-left: 18px; }

/* 审计日志：变更前后值对照 */
.diff-cell { display: flex; flex-direction: column; gap: 4px; }
.diff-old {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  color: #a13b3b; background: #fef0f0; border-radius: 4px;
  padding: 2px 6px; word-break: break-all;
}
.diff-new {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  color: #2b7a3d; background: #f0f9eb; border-radius: 4px;
  padding: 2px 6px; word-break: break-all;
}
.diff-null { color: var(--c-muted); font-style: italic; }
.action-tag { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; }

/* 日志页签外层 */
.log-panel { background: #fff; border: 1px solid #ebeef5; border-radius: 6px; padding: 16px; }
.pager { display: flex; justify-content: flex-end; margin-top: 14px; }
