/* ═══════════════════════════════════════════════════════════
   Architecture page
   ═══════════════════════════════════════════════════════════ */

.page-hero {
  padding: 8rem 3rem 3rem;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text);
  margin: 1.2rem 0 1rem;
}
.page-hero p {
  font-size: 1.1rem;
  color: var(--text-sub);
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.7;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-sub);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--white);
  margin-bottom: 2rem;
  transition: all .25s;
}
.back-link:hover {
  color: var(--text);
  border-color: rgba(0,0,0,.25);
}
.back-link::before { content: '←'; margin-right: 2px; }

/* Architecture diagram wrapper */
.arch-image-wrap {
  max-width: 1600px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  position: relative;
}

/* Stage reserves space for the SVG at its native 14:9 ratio. */
.arch-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 14 / 9;
  min-height: 540px;
  max-height: calc(100vh - 140px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.arch-stage:active { cursor: grabbing; }

/* Toolbar */
.arch-toolbar {
  position: absolute;
  top: 12px;
  right: 2rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow);
}
.arch-tool {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
}
.arch-tool:hover {
  background: var(--bg);
  color: var(--text);
}
.arch-zoom-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-sub);
  font-family: var(--font-body);
  min-width: 42px;
  text-align: center;
  letter-spacing: .04em;
}

/* Stage (zoom/pan container) */
.arch-stage {
  position: relative;
  width: 100%;
  height: 82vh;
  min-height: 640px;
  max-height: 1000px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.arch-stage:active { cursor: grabbing; }

.arch-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1400px;
  height: 900px;
  transform-origin: 0 0;
  will-change: transform;
}
/* Briefly enabled by JS when the canvas hits the boundary, so the clamp
   reads as a small spring-back instead of a hard stop. */
.arch-canvas.smooth {
  transition: transform 180ms cubic-bezier(.22,.61,.36,1);
}
.arch-canvas img {
  display: block;
  width: 1400px !important;
  height: 900px !important;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Section heading */
.arch-section {
  margin-bottom: 5rem;
}
.arch-section:last-child { margin-bottom: 0; }

.arch-num {
  display: inline-flex;
  align-items: center;
  padding: .25rem .7rem;
  border-radius: 5px;
  background: var(--text);
  color: var(--bg);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.arch-eyebrow {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.arch-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
  color: var(--text);
}
.arch-lead {
  font-size: 1.05rem;
  color: var(--text-sub);
  margin-bottom: 2.5rem;
  max-width: 760px;
  line-height: 1.7;
}

/* Loop flow (5 steps) */
.loop-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.loop-step {
  padding: 1.8rem 1.4rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.loop-step:last-child { border-right: none; }
.loop-step-tag {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.loop-step h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.loop-step p {
  font-size: .8rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Ontology grid */
.ontology-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.ontology-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all .3s;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.ontology-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.ontology-card.hl {
  background: linear-gradient(135deg, var(--white), #f7f1e3);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(191,171,144,.15);
}
.ontology-card-wide { grid-column: span 3; }

.ontology-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ontology-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ontology-card.hl .ontology-icon { background: var(--accent-deep); }
.ontology-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.ontology-desc {
  font-size: .85rem;
  color: var(--text-sub);
  line-height: 1.6;
}
.ontology-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}
.ontology-tags li {
  padding: 3px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .7rem;
  color: var(--text-sub);
}
.ontology-foot {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--accent-deep);
  font-weight: 500;
}

/* Memory table */
.memory-table {
  margin-top: 6px;
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}
.memory-table th,
.memory-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.memory-table th {
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.memory-table td { color: var(--text); }
.memory-table tr:last-child td { border-bottom: none; }

/* Method */
.method-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.method-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.7rem;
}
.method-tag {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.method-block h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.method-block p {
  font-size: .85rem;
  color: var(--text-sub);
}

.method-team {
  background: var(--white);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.team-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--text);
  color: var(--bg);
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  white-space: nowrap;
}
.method-team p {
  font-size: .85rem;
  color: var(--text-sub);
  margin: 0;
}

.method-h3 {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .15em;
  margin: 1.5rem 0 1rem;
}
.method-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.method-step {
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border);
  text-align: center;
}
.method-step:last-child { border-right: none; }
.method-step-num {
  width: 32px;
  height: 32px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
}
.method-step h5 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.method-step p {
  font-size: .72rem;
  color: var(--text-sub);
}

.method-result {
  margin-top: 2rem;
  background: linear-gradient(135deg, var(--white), #faf5eb);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
}
.method-result-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-deep);
  color: var(--bg);
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.method-result h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .6rem;
}
.method-result p {
  font-size: .9rem;
  color: var(--text-sub);
}

.arch-callout {
  margin-top: 2rem;
  padding: 1.5rem 1.8rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text-sub);
}
.arch-callout strong { color: var(--text); margin-right: 6px; }

/* 案例例证 · 架构每个模块末尾列出真实命中案例(弱化文本链接) */
.arch-cases {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.arch-cases-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .75rem;
  margin-bottom: .9rem;
}
.arch-cases-eyebrow {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  width: 100%;
  margin-bottom: -.15rem;
}
.arch-cases-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.2;
  max-width: 60%;
  /* 两行紧凑显示:第一行短,第二行长 */
}
.arch-cases-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: auto;
}
.arch-cases-list {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
}
.arch-case-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  padding: .6rem .45rem;
  min-height: 68px;
  background: rgba(255, 255, 255, .25);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.arch-case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, .25);
  background: rgba(255, 255, 255, .7);
}
.arch-case-card-name {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-sub);
  line-height: 1.2;
}
.arch-case-card-where {
  font-size: .6rem;
  color: var(--text-muted);
  line-height: 1.15;
}

@media (max-width: 900px) {
  .loop-flow, .method-steps { grid-template-columns: 1fr; }
  .arch-cases-sub { display: none; }
  .loop-step, .method-step { border-right: none; border-bottom: 1px solid var(--border); }
  .loop-step:last-child, .method-step:last-child { border-bottom: none; }
  .ontology-grid { grid-template-columns: 1fr; }
  .ontology-card-wide { grid-column: span 1; }
  .method-top { grid-template-columns: 1fr; }
  .arch-image-wrap, .container, .page-hero { padding-left: 1.5rem; padding-right: 1.5rem; }
}
