/* ==========================================================================
   dev_lookup_graph.html · 软件开发各阶段图表速查
   页面专属样式：筛选栏、卡片网格、SVG 图示例、放大弹窗
   ========================================================================== */

:root {
  --bg: #f8f9fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent-blue: #2563eb;
  --accent-green: #059669;
  --accent-orange: #d97706;
  --accent-purple: #7c3aed;
  --accent-pink: #db2777;
  --ink: #334155;
  --line: #94a3b8;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 32px 20px 60px;
}

header {
  max-width: 1100px;
  margin: 0 auto 32px;
  text-align: center;
}
header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}
header p {
  color: var(--muted);
  font-size: 14px;
}

/* ===== 阶段筛选栏 ===== */
.filter-bar {
  max-width: 1100px;
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.filter-bar button {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
}
.filter-bar button:hover { border-color: #aaa; }
.filter-bar button.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* ===== 全局切换：一次性展开/收起所有丰富示例 ===== */
.bulk-bar {
  max-width: 1100px;
  margin: -14px auto 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.bulk-bar .bulk-hint {
  font-size: 12.5px;
  color: var(--muted);
}
.bulk-bar button {
  padding: 5px 18px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
}
.bulk-bar button:hover { border-color: #818cf8; }
.bulk-bar button.on {
  background: #4338ca;
  border-color: #4338ca;
  color: #fff;
}

/* ===== 卡片网格 ===== */
.grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transform: translateY(-2px);
}
.card.hidden { display: none; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card-head h3 {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}
.stage-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
  font-weight: 500;
}
.tag-concept   { background: var(--accent-purple); }
.tag-req       { background: var(--accent-blue); }
.tag-design    { background: var(--accent-green); }
.tag-dev       { background: var(--accent-orange); }
.tag-report    { background: var(--accent-pink); }
.card p {
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.65;
}
.card .phase-note {
  font-size: 12px;
  color: var(--muted);
}
/* 卡片底部：左侧阶段备注，右侧「简例 / 丰富示例」切换 */
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 2px;
}
.btn-rich {
  flex-shrink: 0;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--dc);
  background: transparent;
  color: var(--dc);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.btn-rich:hover { background: var(--dc-bg); }
.card.rich .btn-rich {
  background: var(--dc);
  color: #fff;
}

/* ===== 每个阶段的主题色，供图示例取用 ===== */
.card[data-phase="concept"], .modal-body[data-phase="concept"] { --dc: #7c3aed; --dc-bg: #f5f3ff; }
.card[data-phase="req"],     .modal-body[data-phase="req"]     { --dc: #2563eb; --dc-bg: #eff6ff; }
.card[data-phase="design"],  .modal-body[data-phase="design"]  { --dc: #059669; --dc-bg: #ecfdf5; }
.card[data-phase="dev"],     .modal-body[data-phase="dev"]     { --dc: #d97706; --dc-bg: #fffbeb; }
.card[data-phase="report"],  .modal-body[data-phase="report"]  { --dc: #db2777; --dc-bg: #fdf2f8; }

/* ===== 图示例 ===== */
.diagram {
  background: #fbfcfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: zoom-in;
  transition: border-color .18s, background .18s;
}
.diagram:hover { border-color: var(--dc); background: #fff; }
.diagram svg { display: block; width: 100%; height: auto; }

/* 丰富示例：默认隐藏，卡片切到 rich 时与简例互换 */
.diagram-rich { display: none; }
.card.rich .diagram { display: none; }
.card.rich .diagram-rich { display: block; }

/* 切换按钮的提示条，颜色随阶段主题色 */
.diagram-rich::after {
  content: "丰富示例";
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--dc);
  padding: 2px 0 0;
}

/* ===== SVG 通用元素样式 ===== */
.dg-t  { font-size: 10px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.dg-s  { font-size: 8px;  text-anchor: middle; dominant-baseline: central; fill: var(--muted); }
.dg-fl { font-size: 9px;  text-anchor: start;  dominant-baseline: central; fill: var(--ink); }
.dg-tr { font-size: 8px;  text-anchor: end;    dominant-baseline: central; fill: var(--muted); }
.dg-sl { font-size: 8.5px; text-anchor: start; dominant-baseline: central; fill: var(--muted); }
.dg-hd { font-size: 9.5px; text-anchor: middle; dominant-baseline: central; fill: var(--dc); font-weight: 600; }
.dg-pk { font-size: 9px;  text-anchor: start;  dominant-baseline: central; fill: var(--dc); font-weight: 600; }

.dg-box  { fill: #fff; stroke: #cbd5e1; stroke-width: 1.2; }
.dg-hi   { fill: var(--dc-bg); stroke: var(--dc); stroke-width: 1.2; }
.dg-fill { fill: #f1f5f9; stroke: #cbd5e1; stroke-width: 1.2; }
.dg-hdr  { fill: var(--dc-bg); stroke: var(--dc); stroke-width: 1.2; }
.dg-act  { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 1; }
.dg-bar  { fill: var(--dc); fill-opacity: .72; }

.dg-ln   { stroke: var(--line); stroke-width: 1.2; fill: none; }
.dg-ln-d { stroke: var(--line); stroke-width: 1.2; fill: none; stroke-dasharray: 4 3; }
.dg-ln-a { stroke: var(--dc); stroke-width: 1.4; fill: none; }
.dg-life { stroke: #cbd5e1; stroke-width: 1; fill: none; stroke-dasharray: 3 3; }
.dg-thin { stroke: #e2e8f0; stroke-width: 1; fill: none; }
.dg-grid { stroke: #eef2f7; stroke-width: 1; fill: none; }
.dg-dot  { fill: #475569; }

/* ===== 放大查看 ===== */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,23,42,.55);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal.show { display: flex; }
.modal-body {
  background: #fff; border-radius: 12px; padding: 18px 20px 10px;
  width: min(820px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.modal-body svg { display: block; width: 100%; height: auto; }
.modal-cap { text-align: center; font-size: 12px; color: var(--muted); padding-top: 8px; }

/* ===== 页脚 ===== */
footer {
  max-width: 1100px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
}
footer a {
  color: var(--accent-blue);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
