/* ========================================
   SBTi Roadmap (roadmap.html)
   决策路线图专用样式
   ======================================== */

/* 顶部导航 */
.roadmap-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}
.nav-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  color: var(--text-main);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.nav-card:hover {
  border-color: var(--primary-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.nav-card .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1;
}
.nav-card .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}
.nav-card .sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* 决策 section */
.decision {
  padding: 56px 0 44px;
  scroll-margin-top: 16px;
}
.decision.alt {
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* 决策头部 */
.d-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.d-head .d-num {
  font-size: 48px;
  font-weight: 700;
  color: var(--primary-300);
  line-height: 1;
  flex-shrink: 0;
}
.d-head h2 {
  font-size: 26px;
  margin: 0 0 6px;
}
.d-head .d-tagline {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}
.d-head .d-tagline strong {
  color: var(--text-main);
  font-weight: 600;
}

.d-subtitle {
  font-size: 16px;
  color: var(--text-main);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

/* 前置条件提示 */
.d-precondition {
  background: var(--info-bg);
  border: 1px solid var(--info-bd);
  color: var(--info-fg);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
}
.d-precondition strong { font-weight: 600; }
.d-precondition a { color: var(--info-fg); text-decoration: underline; font-weight: 500; }

/* 警告 callout */
.d-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  color: var(--warn-fg);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.65;
}
.d-warn strong { font-weight: 600; }

/* 工具入口 */
.d-tools {
  background: var(--primary-50);
  border-left: 3px solid var(--primary-500);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--text-main);
}
.d-tools a {
  color: var(--primary-dark);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* 附带选项 / 展开内容 */
.d-extra {
  margin-top: 24px;
  padding: 18px 22px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--text-muted);
}
.d-extra h4 {
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--text-main);
}
.d-extra p {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.65;
  margin: 0 0 6px;
}
.d-extra p:last-child { margin-bottom: 0; }
.d-extra ul {
  margin: 8px 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
}
.d-extra ul li { margin-bottom: 4px; }
.d-extra strong { color: var(--text-main); font-weight: 600; }
.d-extra a { color: var(--primary-dark); text-decoration: underline; }

/* 相关术语 */
.d-related {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}
.d-related .related-label { margin-right: 6px; }
.d-related a {
  display: inline-block;
  padding: 2px 9px;
  margin: 0 4px 4px 0;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all .15s;
}
.d-related a:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-dark);
}

/* 路径卡片 */
.paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}
.path {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-500);
  border-radius: var(--radius-md);
  padding: 18px 20px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.decision.alt .path { background: var(--surface); }
.path.warn { border-left-color: var(--danger-fg); }
.path.success { border-left-color: var(--primary-600); background: var(--primary-50); }

.path-letter {
  position: absolute;
  top: -10px;
  left: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-500);
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.path.warn .path-letter { background: var(--danger-fg); font-size: 13px; }
.path.success .path-letter { background: var(--primary-600); }

.path h3 {
  font-size: 16px;
  margin: 8px 0 0;
  color: var(--text-main);
}
.path .path-cn {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}
.path .path-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.6;
  padding: 4px 0;
}
.path .row-label {
  flex-shrink: 0;
  min-width: 56px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  padding-top: 1px;
}
.path .row-value {
  color: var(--text-main);
  flex: 1;
}
.path .row-value strong { font-weight: 600; }
.path .row-value a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* 回到顶部 */
.back-to-top {
  display: inline-block;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.back-to-top:hover { color: var(--primary-dark); }

/* 决策依赖关系图 */
.decision-deps {
  padding: 48px 0;
}
.decision-deps h2 {
  font-size: 22px;
  margin: 0 0 6px;
}
.deps-diagram {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px 28px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-main);
  margin: 18px 0 0;
  overflow-x: auto;
  white-space: pre;
}

/* 移动端 */
@media (max-width: 720px) {
  .d-head { flex-direction: column; gap: 8px; }
  .d-head .d-num { font-size: 36px; }
  .d-head h2 { font-size: 22px; }
  /* 单列卡片时增大间距，给 path-letter 圆圈（top:-10px）足够呼吸空间 */
  .paths { grid-template-columns: 1fr; gap: 24px; }
  .deps-diagram { font-size: 11px; padding: 14px 18px; }
  /* 决策 section 在窄屏减少上下间距，避免页面过长 */
  .decision { padding: 32px 0 28px; }
  .roadmap-nav { gap: 8px; margin-top: 20px; }
  .nav-card { padding: 12px 14px; }
  .nav-card .num { font-size: 18px; }
  .decision-deps { padding: 32px 0; }
  .decision-deps h2 { font-size: 18px; }
  /* ③④ 内联双列在窄屏上挤，改为单列堆叠 */
  .decision-deps [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}
