/* ============================================================
   个人数据中枢 · 作品详情页专用样式
   只被 /portfolio/projects/personal-data-hub.html 引入。
   所有选择器都收在 .hub-scope 下，不碰 site.css 与其他页面。
   通用件（副标题 / 行动区 / 截图卡骨架）来自 shots.css。
   引入顺序：site.css → shots.css → personal-data-hub.css
   ============================================================ */

.hub-scope { --hub: #4338ca; --hub-soft: #eef0fe; }

/* ---------- 数据九宫格 ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.hub-cell {
  padding: 16px 17px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color .22s ease, transform .22s ease;
}

.hub-cell:hover {
  border-color: #d3d8e6;
  transform: translateY(-2px);
}

.hub-cell .hub-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hub-cell h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.hub-cell .hub-n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hub);
  background: var(--hub-soft);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.hub-cell .hub-when {
  margin: 7px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
}

.hub-cell p {
  margin: 8px 0 0;
  font-size: 12.8px;
  line-height: 1.68;
  color: var(--text-2);
}

/* ---------- 架构流向条 ---------- */
.hub-pipe {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
}

.hub-pipe .hub-node {
  flex: 1 1 140px;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.hub-node .hub-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hub);
}

.hub-node h4 {
  margin: 7px 0 0;
  font-size: 14px;
  font-weight: 630;
  letter-spacing: -.01em;
}

.hub-node p {
  margin: 7px 0 0;
  font-size: 12.6px;
  line-height: 1.7;
  color: var(--text-2);
}

.hub-node code {
  font-family: var(--mono);
  font-size: .86em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

/* ---------- 强调引用块（方法论金句） ---------- */
.hub-quote {
  margin: 22px 0 0;
  padding: 18px 22px;
  border-left: 3px solid var(--hub);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(100deg, var(--hub-soft), rgba(238, 240, 254, .25));
}

.hub-quote p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text);
  font-weight: 520;
}

.hub-quote p + p { margin-top: 9px; }

.hub-quote .hub-quote-by {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 450;
  color: var(--text-3);
}

/* ---------- 审计案例列表 ---------- */
.hub-cases {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: hubcase;
}

.hub-cases li {
  position: relative;
  padding: 14px 0 14px 42px;
  border-bottom: 1px solid var(--line);
  counter-increment: hubcase;
}

.hub-cases li:last-child { border-bottom: 0; }

.hub-cases li::before {
  content: counter(hubcase, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 15px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--hub);
}

.hub-cases h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 630;
  letter-spacing: -.01em;
}

.hub-cases p {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--text-2);
}

.hub-cases strong { color: var(--text); font-weight: 600; }

/* ---------- 边界清单（编号 + 说明） ---------- */
.hub-limits {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.hub-limits li {
  position: relative;
  padding: 13px 0 13px 0;
  border-bottom: 1px solid var(--line);
}

.hub-limits li:last-child { border-bottom: 0; }

.hub-limits h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 630;
  letter-spacing: -.01em;
}

.hub-limits h4::before {
  content: "—";
  color: var(--hub);
  margin-right: 8px;
  font-weight: 700;
}

.hub-limits p {
  margin: 6px 0 0 22px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--text-2);
}

/* ---------- 仓库规划卡（获取方式区） ---------- */
.hub-repo-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.hub-repo-note strong { color: var(--text); font-weight: 600; }

/* ---------- 架构总览门面图 ---------- */
.hub-figure-wide { margin: 0 0 4px; }

/* ---------- 正文插图（对比图） ---------- */
.hub-figure {
  margin: 22px 0 26px;
  text-align: center;
}

.hub-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.hub-figure figcaption {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
  letter-spacing: .01em;
}

/* ---------- 四个应用模块卡 ---------- */
.hub-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.hub-feature {
  padding: 18px 18px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color .22s ease, transform .22s ease;
}

.hub-feature:hover {
  border-color: #d3d8e6;
  transform: translateY(-2px);
}

.hub-feature h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.hub-feature-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--hub-soft);
  color: var(--hub);
  flex-shrink: 0;
}

.hub-feature-ico svg { width: 15px; height: 15px; }

.hub-feature p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
}

/* ---------- 使用效果卡（场景 → 动作 → 结果） ---------- */
.hub-effects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.hub-effect {
  padding: 17px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hub-effect h4 {
  margin: 0 0 11px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.hub-effect p {
  margin: 0 0 7px;
  font-size: 12.8px;
  line-height: 1.7;
  color: var(--text-2);
}

.hub-effect p:last-child { margin-bottom: 0; }

.hub-effect p span {
  display: inline-block;
  min-width: 52px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hub);
  letter-spacing: .02em;
}

/* ---------- 仓库清单（去哪找代码） ---------- */
.hub-repo-list {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.hub-repo-list li { margin-bottom: 11px; padding-left: 2px; }
.hub-repo-list li:last-child { margin-bottom: 0; }
.hub-repo-list strong { color: var(--text); font-weight: 600; }
.hub-repo-list span { font-size: 11.5px; color: var(--text-3); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .hub-grid,
  .hub-feature-grid,
  .hub-effects { grid-template-columns: 1fr; }
  .hub-pipe .hub-node { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-cell:hover { transform: none; }
}
