/* 小盾牌原型 - 基础样式（对齐优剪现有系统风格）*/

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f0f2f5;
  min-height: 100vh;
}

/* ── 顶部导航 ── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 48px;
  background: #001529;
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 0;
}
.top-nav .logo {
  color: #fff; font-size: 16px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  min-width: 120px;
}
.top-nav .logo span { color: #1677ff; }
.top-nav nav { display: flex; flex: 1; }
.top-nav nav a {
  color: rgba(255,255,255,0.75);
  padding: 0 14px; height: 48px;
  display: flex; align-items: center;
  text-decoration: none; font-size: 13px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.top-nav nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.top-nav nav a.active { color: #fff; background: #1677ff; }
.top-nav .user {
  color: rgba(255,255,255,0.75); font-size: 13px;
  display: flex; align-items: center; gap: 16px; margin-left: auto;
}
.top-nav .user a { color: rgba(255,255,255,0.75); text-decoration: none; }
.top-nav .user a:hover { color: #fff; }

/* ── 布局框架 ── */
.layout {
  display: flex;
  margin-top: 48px;
  min-height: calc(100vh - 48px);
}

/* ── 左侧导航 ── */
.sidebar {
  width: 160px; min-width: 160px;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  padding: 8px 0;
}
.sidebar a {
  display: block;
  padding: 10px 20px;
  color: #333; text-decoration: none; font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.sidebar a:hover { color: #1677ff; background: #e6f0ff; }
.sidebar a.active {
  color: #1677ff; font-weight: 500;
  background: #e6f0ff;
  border-left-color: #1677ff;
}
.sidebar .group-label {
  padding: 12px 20px 4px;
  font-size: 12px; color: #999; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── 主内容区 ── */
.main {
  flex: 1;
  padding: 16px 20px;
  overflow-x: auto;
}

/* ── 面包屑 ── */
.breadcrumb {
  font-size: 13px; color: #999; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: #999; text-decoration: none; }
.breadcrumb a:hover { color: #1677ff; }
.breadcrumb .sep { color: #ccc; }
.breadcrumb .current { color: #333; }

/* ── 卡片 ── */
.card {
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14px; font-weight: 600; color: #222;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .sub { font-size: 12px; color: #999; font-weight: 400; }

/* ── 筛选栏 ── */
.filter-bar {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 14px 20px;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.filter-bar label { font-size: 13px; color: #666; white-space: nowrap; }
.filter-bar select, .filter-bar input[type=text] {
  border: 1px solid #d9d9d9; border-radius: 4px;
  padding: 5px 10px; font-size: 13px; color: #333;
  background: #fff; outline: none;
  min-width: 120px;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: #1677ff; }
.filter-bar .filter-item { display: flex; align-items: center; gap: 6px; }
.filter-bar .actions { margin-left: auto; display: flex; gap: 8px; }

/* ── 按钮 ── */
.btn {
  padding: 5px 16px; border-radius: 4px; font-size: 13px;
  cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .2s; white-space: nowrap;
}
.btn-primary { background: #1677ff; color: #fff; border-color: #1677ff; }
.btn-primary:hover { background: #4096ff; border-color: #4096ff; }
.btn-default { background: #fff; color: #333; border-color: #d9d9d9; }
.btn-default:hover { color: #1677ff; border-color: #1677ff; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn-link { background: none; border: none; color: #1677ff; padding: 0; cursor: pointer; font-size: 13px; }
.btn-link:hover { color: #4096ff; }
.btn-link.danger { color: #ff4d4f; }
.btn-link.danger:hover { color: #ff7875; }

/* ── 汇总数字区 ── */
.summary-group {
  display: flex; gap: 14px; margin-bottom: 14px;
}
.summary-card {
  flex: 1; background: #fff;
  border: 1px solid #e8e8e8; border-radius: 6px;
  padding: 14px 18px;
}
.summary-card .shield-label {
  font-size: 12px; color: #999; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.summary-card .shield-label .dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.dot-blue { background: #1677ff; }
.dot-green { background: #52c41a; }
.dot-orange { background: #fa8c16; }

.metric-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.metric-item { }
.metric-item .val {
  font-size: 22px; font-weight: 700; color: #222; line-height: 1.2;
}
.metric-item .val .unit { font-size: 13px; font-weight: 400; color: #666; margin-left: 2px; }
.metric-item .label { font-size: 12px; color: #999; margin-top: 2px; }
.metric-item .sub { font-size: 12px; color: #666; margin-top: 2px; }
.metric-item .up { color: #ff4d4f; }
.metric-item .down { color: #52c41a; }
.metric-item .warn { color: #fa8c16; }
.metric-item .alert { color: #ff4d4f; font-weight: 600; }

/* ── 图表区（用 CSS 模拟） ── */
.chart-row { display: flex; gap: 14px; margin-bottom: 14px; }
.chart-col { flex: 1; }
.chart-col.w2 { flex: 2; }
.chart-col.w3 { flex: 3; }

/* 横向条形图 */
.bar-chart { }
.bar-chart .bar-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; font-size: 13px;
}
.bar-chart .bar-label { width: 90px; text-align: right; color: #555; flex-shrink: 0; }
.bar-chart .bar-track { flex: 1; background: #f0f2f5; border-radius: 3px; height: 20px; position: relative; }
.bar-chart .bar-fill {
  height: 100%; border-radius: 3px;
  display: flex; align-items: center; padding-left: 8px;
  font-size: 12px; color: #fff; font-weight: 500;
  transition: width .3s;
}
.bar-chart .bar-count { width: 60px; color: #666; font-size: 12px; }

.bar-blue { background: #1677ff; }
.bar-red { background: #ff4d4f; }
.bar-orange { background: #fa8c16; }
.bar-green { background: #52c41a; }
.bar-teal { background: #13c2c2; }
.bar-purple { background: #722ed1; }
.bar-gray { background: #bfbfbf; }
.bar-light-blue { background: #69b1ff; }

/* 折线图（SVG 内联） */
.line-chart-wrap { width: 100%; }
.line-chart-wrap svg { width: 100%; overflow: visible; }

/* 系统摘要行 */
.summary-line {
  background: #f6f8ff;
  border-left: 3px solid #1677ff;
  border-radius: 0 4px 4px 0;
  padding: 8px 12px;
  font-size: 12px; color: #555;
  margin-top: 10px;
  line-height: 1.6;
}
.summary-line .up-icon { color: #ff4d4f; }
.summary-line .down-icon { color: #52c41a; }
.summary-line .warn-text { color: #fa8c16; font-weight: 500; }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table th {
  background: #fafafa;
  color: #666; font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid #e8e8e8;
  text-align: left; white-space: nowrap;
}
table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  color: #333; vertical-align: middle;
}
table tr:hover td { background: #fafcff; }
table tr:last-child td { border-bottom: none; }
table td.num { font-variant-numeric: tabular-nums; }

/* ── 状态标签 ── */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 3px;
  font-size: 12px; white-space: nowrap;
}
.tag-blue { background: #e6f0ff; color: #1677ff; }
.tag-red { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.tag-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-gray { background: #fafafa; color: #999; border: 1px solid #d9d9d9; }
.tag-purple { background: #f9f0ff; color: #722ed1; }

/* ── 任务进度点 ── */
.status-dot {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
}
.status-dot::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.status-pending::before { background: #fa8c16; }
.status-active::before { background: #1677ff; }
.status-review::before { background: #69b1ff; }
.status-overdue::before { background: #ff4d4f; }
.status-done::before { background: #52c41a; }
.status-overdue { color: #ff4d4f; font-weight: 600; }

/* ── 辅助建议卡 ── */
.advice-card {
  border: 1px solid #e8e8e8; border-radius: 6px;
  padding: 12px 16px; margin-bottom: 10px;
  background: #fff; position: relative;
}
.advice-card.advice-a { border-left: 4px solid #ff4d4f; }
.advice-card.advice-b { border-left: 4px solid #fa8c16; }
.advice-card .advice-type {
  font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 2px; margin-right: 6px;
}
.advice-a .advice-type { background: #fff1f0; color: #ff4d4f; }
.advice-b .advice-type { background: #fff7e6; color: #fa8c16; }
.advice-card .advice-title { font-size: 13px; color: #222; font-weight: 500; }
.advice-card .advice-body { font-size: 12px; color: #555; margin-top: 6px; line-height: 1.7; }
.advice-card .advice-body strong { color: #333; }
.advice-card .advice-actions {
  margin-top: 8px; display: flex; align-items: center; justify-content: flex-end; gap: 12px;
}

/* ── 侧滑面板 ── */
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.35);
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 48px; right: 0; bottom: 0; z-index: 201;
  width: 520px; background: #fff;
  box-shadow: -4px 0 16px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e8e8e8;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.drawer-header h3 { font-size: 15px; font-weight: 600; }
.drawer-close {
  width: 28px; height: 28px; border-radius: 4px;
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #999; display: flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: #f0f0f0; color: #333; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-footer {
  padding: 12px 20px; border-top: 1px solid #e8e8e8;
  display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0;
}

/* ── 快照只读卡 ── */
.snapshot-card {
  background: #fafafa; border: 1px dashed #d9d9d9;
  border-radius: 4px; padding: 10px 14px; margin: 10px 0;
}
.snapshot-card .snapshot-label {
  font-size: 11px; color: #999; margin-bottom: 6px;
  display: flex; align-items: center; gap: 4px;
}
.snapshot-card .snapshot-label::before {
  content: '📸'; font-size: 11px;
}
.snapshot-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.snapshot-item { }
.snapshot-item .sk { font-size: 11px; color: #999; }
.snapshot-item .sv { font-size: 13px; font-weight: 500; color: #333; }

/* ── 步骤进度条 ── */
.steps {
  display: flex; align-items: flex-start; gap: 0;
  margin: 14px 0;
}
.step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative;
}
.step:not(:last-child)::after {
  content: ''; position: absolute;
  top: 14px; left: 50%; width: 100%; height: 2px;
  background: #e8e8e8; z-index: 0;
}
.step.done:not(:last-child)::after { background: #1677ff; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  position: relative; z-index: 1;
  border: 2px solid #e8e8e8; background: #fff; color: #999;
}
.step.done .step-dot { background: #1677ff; border-color: #1677ff; color: #fff; }
.step.current .step-dot { border-color: #1677ff; color: #1677ff; }
.step-label { font-size: 12px; color: #999; margin-top: 6px; text-align: center; }
.step.done .step-label, .step.current .step-label { color: #1677ff; }

/* ── 详情字段组 ── */
.field-group { margin-bottom: 14px; }
.field-group-title {
  font-size: 13px; font-weight: 600; color: #333;
  margin-bottom: 8px; padding-bottom: 6px;
  border-bottom: 1px solid #f0f0f0;
}
.field-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.field-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.field-item { }
.field-item .fk { font-size: 12px; color: #999; margin-bottom: 2px; }
.field-item .fv { font-size: 13px; color: #333; }
.field-item.full { grid-column: 1 / -1; }

/* ── 图例 ── */
.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: #666; margin-top: 8px;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-line { width: 20px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* ── 空状态 ── */
.empty { text-align: center; padding: 32px; color: #bbb; font-size: 13px; }

/* ── 分页 ── */
.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 6px; margin-top: 12px; font-size: 13px; color: #666;
}
.pagination a {
  padding: 3px 10px; border: 1px solid #d9d9d9; border-radius: 4px;
  text-decoration: none; color: #333; background: #fff;
}
.pagination a.active { background: #1677ff; border-color: #1677ff; color: #fff; }
.pagination a:hover:not(.active) { border-color: #1677ff; color: #1677ff; }

/* ── 工具提示（hover） ── */
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff;
  padding: 5px 10px; border-radius: 4px; font-size: 12px;
  white-space: nowrap; z-index: 999; pointer-events: none;
}

/* ── 响应式（仅宽屏优化） ── */
@media (max-width: 1200px) {
  .summary-group { flex-wrap: wrap; }
  .chart-row { flex-wrap: wrap; }
}
