/* ============================================================
   lessons/11-architecture/architecture.css — 建筑史滑动对比
   布局沿 lesson 09/10 惯例：lesson-head / hint / note 本地定义；
   舞台 16:9 双层图，分割线擦除（左=早、右=晚），触控归位：
   横向拖动归滑块、纵向归页面滚动（touch-action: pan-y）。
   ============================================================ */

.arch-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 calc(var(--sp) * 3) calc(var(--sp) * 6);
}

.lesson-head { padding: calc(var(--sp) * 5) 0 calc(var(--sp) * 3); }
.kicker {
  font-size: var(--fs-sm);
  letter-spacing: .14em;
  margin-bottom: var(--sp);
  color: var(--gold);
}
.lesson-head h1 { font-size: var(--fs-xl); margin-bottom: calc(var(--sp) * 2); }
.intro { max-width: 680px; color: var(--ink-soft); }

/* ---------- 舞台 ---------- */

.arch-stage { margin: calc(var(--sp) * 1) 0 calc(var(--sp) * 4); }

.arch-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-3);
  box-shadow: 0 3px 18px rgba(58, 47, 36, 0.14);
  touch-action: pan-y;          /* 横向归滑块、纵向归页面 */
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
}

.arch-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: opacity .18s ease;
}
/* 组间切换：JS 加 .switching 淡出换图后移除 */
.arch-frame.switching .arch-img { opacity: 0; }
/* 上层=较早朝代，JS 内联 clip-path: inset(0 calc(100% - X%) 0 0) */
.arch-over { z-index: 2; }
.arch-under { z-index: 1; }

.arch-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 248, 234, 0.92);
  box-shadow: 0 0 6px rgba(58, 47, 36, 0.55);
  z-index: 4;
  pointer-events: none;
}

.arch-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 248, 234, 0.95);
  background: var(--zhu);
  color: #fff8ea;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 5;
  cursor: ew-resize;
  box-shadow: 0 2px 10px rgba(58, 47, 36, 0.45);
  touch-action: none;
  padding: 0;
}
.arch-handle .icon { width: 15px; height: 15px; }
.arch-handle:focus-visible {
  outline: 3px solid var(--huang);
  outline-offset: 2px;
}

/* 朝代铭牌：两上角 */
.arch-era {
  position: absolute;
  top: calc(var(--sp) * 1.5);
  z-index: 4;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(58, 47, 36, 0.72);
  color: #fff8ea;
  font-size: var(--fs-sm);
  letter-spacing: .1em;
  pointer-events: none;
}
.arch-era-l { left: calc(var(--sp) * 1.5); }
.arch-era-r { right: calc(var(--sp) * 1.5); }

/* 标记点：数字圆点 + 脉冲环；被裁切侧隐藏 */
.arch-hotspot {
  position: absolute;
  z-index: 3;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 2px solid #fff8ea;
  background: var(--qing);
  color: #fff8ea;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-num);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(58, 47, 36, 0.5);
  padding: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.arch-hotspot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255, 248, 234, 0.75);
  animation: arch-pulse 2.2s ease-out infinite;
}
@keyframes arch-pulse {
  0%   { transform: scale(.6); opacity: 1; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
.arch-hotspot:hover { transform: scale(1.12); }
.arch-hotspot:focus-visible {
  outline: 3px solid var(--huang);
  outline-offset: 2px;
}
.arch-hotspot.off {
  opacity: 0;
  pointer-events: none;
}

/* ---------- 时间轴 ---------- */

.arch-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: calc(var(--sp) * 2) auto calc(var(--sp) * 1);
  padding: 0 calc(var(--sp) * 1);
}

.arch-tl-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  min-width: 44px;              /* 触控热区 */
}
/* 连接线 */
.arch-tl-item::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line-dim);
  z-index: 0;
}
.arch-tl-item:first-child::before { display: none; }

.arch-tl-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--ink-soft);
  background: var(--paper-2);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.arch-tl-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .06em;
}
.arch-tl-item:hover .arch-tl-dot { border-color: var(--zhu); }
.arch-tl-item:hover .arch-tl-label { color: var(--zhu-deep); }
.arch-tl-item.on .arch-tl-dot {
  background: var(--zhu);
  border-color: var(--zhu-deep);
  transform: scale(1.25);
}
.arch-tl-item.on .arch-tl-label {
  color: var(--zhu-deep);
  font-weight: 700;
}
.arch-tl-item:focus-visible {
  outline: 2px solid var(--huang);
  outline-offset: 2px;
  border-radius: 6px;
}

.arch-pairname {
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  margin: calc(var(--sp) * 1) 0 0;
}
.arch-pairname b { color: var(--ink); }

.arch-controls {
  display: flex;
  justify-content: center;
  margin: calc(var(--sp) * 2) 0 0;
}
.arch-hint { color: var(--ink-soft); font-size: var(--fs-sm); }

.arch-note {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  text-align: center;
  padding-bottom: calc(var(--sp) * 2);
}

/* ---------- 移动端 ---------- */

@media (max-width: 760px) {
  .arch-main { padding: 0 calc(var(--sp) * 2) calc(var(--sp) * 5); }
  .arch-era { font-size: 12.5px; padding: 2px 9px; }
  .arch-handle { width: 40px; height: 40px; }
  /* 时间轴窄屏横向滚动，不折行溢出 */
  .arch-timeline {
    overflow-x: auto;
    justify-content: flex-start;
    gap: calc(var(--sp) * 2);
    padding-bottom: var(--sp);
    scrollbar-width: thin;
  }
  .arch-tl-item { flex: 0 0 auto; }
}

/* ---------- 弱动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  .arch-img { transition: none; }
  .arch-hotspot,
  .arch-hotspot::after,
  .arch-tl-dot { transition: none; }
  .arch-hotspot::after { animation: none; opacity: 0; }
}
