/* ==========================================================================
   UK MASTER FENG SHUI · BÀN GIẢI PHẪU 3D ISOMETRIC & TRA CỨU 117 THƯỚC LỖ BAN
   Phong cách Anatomy Interactive Isometric Studio + Chuẩn Chân Xích 42,94 cm
   ========================================================================== */

:root {
  --bg-page: #F6F1E6;
  --bg-card: #FAF6EE;
  --bg-stage: #EFE9DA;
  --bg-panel: #F5EFE2;
  --bg-inset: #FBF8F2;
  --ink-main: #231C16;
  --ink-sub: #5C4F42;
  --ink-muted: #847566;
  --line-soft: #DFD5C3;
  --line-strong: #C5B69E;
  --cat-red: #9E221E;
  --cat-red-bright: #C12B25;
  --cat-red-soft: #F9E5E3;
  --cat-border: #D98B86;
  --hung-dark: #2E2925;
  --hung-soft: #E8E3DC;
  --gold-accent: #B38228;
  --gold-soft: #F6ECD6;
  --jade-ok: #1E6B4B;
  --jade-soft: #E3F3EC;
  --jade-border: #84C5A8;
  --shadow-card: 0 12px 34px rgba(38, 28, 18, 0.08);
  --shadow-pill: 0 3px 10px rgba(35, 25, 16, 0.13);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --font-sans: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "Noto Serif", Georgia, serif;
  --font-mono: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--ink-main);
  font-family: var(--font-sans);
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Top Navigation Bar (Đồng bộ nhận diện trang tổng UK MASTER FENG SHUI) ── */
.lb-topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(251, 246, 236, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid #DFCFAF;
  box-shadow: 0 4px 18px rgba(60, 40, 10, 0.07);
  padding: 8px 18px;
  font-family: var(--font-sans);
}

.lb-topbar-inner {
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-main);
  flex-shrink: 0;
  min-width: 0;
}

.lb-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #B8862F;
  background: #8C1F14;
  box-shadow: 0 3px 10px rgba(122, 26, 18, 0.22);
  flex-shrink: 0;
}

.lb-brand-text {
  min-width: 0;
}

.lb-brand-text strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: #7A1A12;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.lb-brand-text span {
  display: block;
  font-size: 11.2px;
  color: #6E5D4F;
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.lb-nav-links::-webkit-scrollbar {
  display: none;
}

.lb-nav-links a {
  text-decoration: none;
  color: #3A2E25;
  font-size: 12.2px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.lb-nav-links a:hover {
  background: rgba(122, 26, 18, 0.08);
  color: #7A1A12;
}

.lb-top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.lb-top-actions a.lb-btn-laban,
.lb-nav-links a.lb-btn-laban {
  text-decoration: none;
  background: var(--gold-soft);
  color: #7A5210;
  border: 1px solid #DFC286;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.lb-top-actions a.lb-btn-laban:hover,
.lb-nav-links a.lb-btn-laban:hover {
  background: #EFE0BC;
  color: #5C3B08;
}

.lb-top-actions a.lb-btn-lang,
.lb-nav-links a.lb-btn-lang {
  text-decoration: none;
  background: #FFF9EE;
  color: #7A1A12;
  border: 1.5px solid #C8A24A;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.lb-top-actions a.lb-btn-lang:hover,
.lb-nav-links a.lb-btn-lang:hover {
  background: #7A1A12;
  color: #FFF9EE;
  border-color: #7A1A12;
}

/* ── Main Container & Hero Intro ── */
.lb-wrap {
  max-width: 1460px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.lb-hero-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #FAF6EE 0%, #F1E9D8 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.lb-hero-title-box {
  max-width: 880px;
}

.lb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--cat-red);
  background: var(--cat-red-soft);
  border: 1px solid var(--cat-border);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.lb-hero-title-box h1 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.5vw, 31px);
  line-height: 1.24;
  color: var(--ink-main);
}

.lb-hero-title-box p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-sub);
}

.lb-hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-stat-pill {
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 132px;
}

.lb-stat-pill small {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  font-weight: 700;
}

.lb-stat-pill b {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--cat-red);
}

/* ==========================================================================
   PHẦN 1: BÀN GIẢI PHẪU TƯƠNG TÁC 3D ISOMETRIC (ANATOMY MACHINE STUDIO)
   Bố cục chuẩn 2 cột đối xứng theo đúng mẫu Anatomy Isometric
   ========================================================================== */

.anatomy-machine-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(370px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 36px;
}

@media (max-width: 1120px) {
  .anatomy-machine-grid {
    grid-template-columns: 1fr;
  }
}

/* Thanh chọn nhanh 6 cấu kiện 3D trên Mobile & Tablet (ẩn ở Desktop 2 cột) */
.anatomy-model-tabs-mobile {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

@media (max-width: 1120px) {
  .anatomy-model-tabs-mobile {
    display: grid;
  }
  .anatomy-right-card > .anatomy-ctrl-head,
  .anatomy-right-card > #anaModelTabs {
    display: none;
  }
}

/* ── Cột Trái: Khung Isometric 3D + Callout số 1..8 + Hộp 6 Trạm + Thanh Giải Thích ── */
.anatomy-left-card {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.anatomy-stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.anatomy-stage-title {
  font-size: 13.5px;
  color: var(--ink-main);
}

.anatomy-stage-title b {
  color: var(--cat-red);
  font-weight: 800;
}

.anatomy-stage-hint {
  font-size: 12px;
  color: var(--ink-muted);
}

.anatomy-stage-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}

.anatomy-pill-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
  color: var(--ink-main);
  font-family: var(--font-sans);
  font-size: 11.8px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.anatomy-pill-btn:hover {
  border-color: var(--cat-red);
  color: var(--cat-red);
}

.anatomy-pill-btn.active {
  background: var(--cat-red);
  color: #FFF9F0;
  border-color: var(--cat-red);
}

/* ── Khung bao Sân khấu Isometric 3D & Hộp 6 Trạm ── */
.anatomy-stage-box {
  position: relative;
  margin: 12px 0;
}

/* ── Sân khấu Isometric 3D ở giữa Cột Trái ── */
.anatomy-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  min-height: 450px;
  background: #DFD8C8;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  user-select: none;
}

.anatomy-model3d-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

/* Lớp SVG đường dẫn vuông góc (orthogonal leader lines) + tia laser đo kích thước động */
.anatomy-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

/* Các thẻ Callout đánh số [1] tới [8] giống hệt mẫu Anatomy */
.anatomy-pins-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.anatomy-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  background: rgba(251, 248, 242, 0.96);
  border: 1.5px solid #6E5D4F;
  border-radius: 8px;
  padding: 2px 9px 2px 3px;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: all 0.18s ease;
  max-width: 245px;
  white-space: nowrap;
}

.anatomy-pin:hover {
  transform: translate(-50%, -50%) scale(1.04);
  border-color: var(--cat-red);
  z-index: 12;
}

.anatomy-pin.active {
  background: var(--cat-red);
  border-color: #6B110E;
  color: #FFF8EE;
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 6px 18px rgba(158, 34, 30, 0.36);
  z-index: 15;
}

.anatomy-pin-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #3B3026;
  color: #FFF8EE;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.anatomy-pin.active .anatomy-pin-num {
  background: #FFF8EE;
  color: var(--cat-red);
}

.anatomy-pin.is-cat:not(.active) .anatomy-pin-num {
  background: var(--cat-red);
}

.anatomy-pin-label {
  font-size: 11.8px;
  font-weight: 700;
  color: var(--ink-main);
  overflow: hidden;
  text-overflow: ellipsis;
}

.anatomy-pin.active .anatomy-pin-label {
  color: #FFF8EE;
}

/* ── Hộp phụ bên trái Sân khấu (giống "LÁ SAU TỪNG BƯỚC · OOLONG") ── */
.anatomy-step-inset {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 8;
  width: 226px;
  background: rgba(251, 248, 242, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 9px 10px;
  box-shadow: 0 6px 20px rgba(32, 24, 15, 0.12);
}

@media (max-width: 720px) {
  .anatomy-step-inset {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}

.anatomy-step-inset-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--ink-sub);
  margin-bottom: 6px;
}

.anatomy-step-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.anatomy-step-mini {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 5px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anatomy-step-mini:hover {
  border-color: var(--cat-red);
}

.anatomy-step-mini.active {
  background: #F4FBF7;
  border: 1.5px solid var(--jade-ok);
  box-shadow: 0 2px 6px rgba(30, 107, 75, 0.16);
}

.anatomy-step-mini svg {
  width: 26px;
  height: 20px;
  display: block;
  margin: 0 auto 2px;
}

.anatomy-step-mini span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-main);
  line-height: 1.15;
}

/* ── Hộp Giải Thích Chi Tiết Điểm Đang Chọn ở Đáy Cột Trái ── */
.anatomy-bottom-explainer {
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.anatomy-exp-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cat-red);
  color: #FFF8EE;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.anatomy-exp-body {
  flex: 1;
}

.anatomy-exp-body h4 {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-main);
}

.anatomy-exp-body p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-sub);
  line-height: 1.5;
}

/* ── Cột Phải: Bảng Điều Khiển Cấu Kiện, Thanh Trượt Đỏ/Đen & Thẻ Chỉ Số ── */
.anatomy-right-card {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.anatomy-ctrl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.anatomy-ctrl-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-main);
}

.anatomy-ctrl-head span {
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* 6 Nút Chọn Cấu Kiện 3D (giống "Chọn loại trà: Trà xanh | Bạch trà | Oolong | Hồng trà") */
.anatomy-model-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.anatomy-model-tab {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
  color: var(--ink-main);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  transition: all 0.16s ease;
}

.anatomy-model-tab:hover {
  border-color: var(--cat-red);
  color: var(--cat-red);
}

.anatomy-model-tab.active {
  background: var(--cat-red);
  border-color: var(--cat-red);
  color: #FFF8EE;
  box-shadow: 0 3px 10px rgba(158, 34, 30, 0.25);
}

/* Khối "Đường đi của phép đo · theo 8 điểm" */
.anatomy-route-box {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 10px 12px;
}

.anatomy-route-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.anatomy-route-chain {
  font-size: 12.2px;
  font-weight: 800;
  color: var(--ink-main);
  line-height: 1.45;
  margin-bottom: 5px;
}

.anatomy-route-chain span {
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.anatomy-route-chain span.active {
  background: var(--cat-red);
  color: #FFF8EE;
}

.anatomy-route-desc {
  font-size: 11.8px;
  color: var(--ink-sub);
  margin: 0;
}

/* 3 Thanh Trượt Tương Tác Kèm Dải Cung Đỏ Cát Trên Rãnh Trượt */
.anatomy-sliders-wrap {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.anatomy-slider-group {
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 9px 12px;
}

.anatomy-slider-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.anatomy-slider-top label {
  font-size: 12.8px;
  font-weight: 800;
  color: var(--ink-main);
}

.anatomy-slider-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: var(--cat-red);
}

.anatomy-slider-track-wrap {
  position: relative;
  padding: 4px 0 2px;
}

.anatomy-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9E221E 0%, #9E221E 12.5%, #3A322C 12.5%, #3A322C 37.5%, #9E221E 37.5%, #9E221E 62.5%, #3A322C 62.5%, #3A322C 87.5%, #9E221E 87.5%, #9E221E 100%);
  outline: none;
  cursor: pointer;
  border: 1px solid rgba(35, 28, 22, 0.25);
}

.anatomy-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FFF9F0;
  border: 3px solid var(--cat-red);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  cursor: grab;
}

.anatomy-slider-presets {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.anatomy-slider-presets small {
  font-size: 11px;
  color: var(--ink-muted);
  margin-right: 2px;
}

.anatomy-preset-chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  color: var(--ink-sub);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.anatomy-preset-chip:hover,
.anatomy-preset-chip.active {
  background: var(--cat-red-soft);
  border-color: var(--cat-red);
  color: var(--cat-red);
}

/* 3 Nút Hành Động: Chạy dây chuyền | Tháo rời | Về mốc gợi ý */
.anatomy-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.anatomy-btn-primary {
  appearance: none;
  border: none;
  background: var(--cat-red);
  color: #FFF8EE;
  font-family: var(--font-sans);
  font-size: 12.8px;
  font-weight: 800;
  padding: 9px 15px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(158, 34, 30, 0.28);
  transition: all 0.16s ease;
}

.anatomy-btn-primary:hover {
  background: #7E1916;
}

.anatomy-btn-secondary {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-inset);
  color: var(--ink-main);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.anatomy-btn-secondary:hover,
.anatomy-btn-secondary.active {
  border-color: var(--cat-red);
  color: var(--cat-red);
  background: var(--cat-red-soft);
}

/* 2 Thẻ Tóm Tắt Thông Số Chân Xích & Chừa Tường ở Đáy Cột Phải */
.anatomy-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.anatomy-metric-card {
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 9px 11px;
}

.anatomy-metric-card small {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-muted);
  margin-bottom: 3px;
}

.anatomy-metric-card strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-main);
}

.anatomy-metric-card span {
  display: block;
  font-size: 11.2px;
  color: var(--ink-sub);
  margin-top: 2px;
}

/* Hộp Trạng Thái Kiểm Định (Xanh Ngọc Cát / Đỏ Cảnh Báo) */
.anatomy-status-banner {
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 12.4px;
  line-height: 1.48;
  background: var(--jade-soft);
  border: 1.5px solid var(--jade-border);
  color: #154D35;
}

.anatomy-status-banner.is-warn {
  background: var(--cat-red-soft);
  border-color: var(--cat-border);
  color: #6E1512;
}

/* ==========================================================================
   PHẦN 2, 3, 4, 5: CÁC CHUYÊN MỤC HỌC THUẬT & BẢNG TRA 117 THƯỚC (3.744 TIỂU CUNG)
   ========================================================================== */

.lb-section {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 26px 28px;
  margin-bottom: 28px;
}

.lb-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.lb-sec-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.1vw, 26px);
  color: var(--ink-main);
}

.lb-sec-head p {
  margin: 4px 0 0;
  font-size: 13.8px;
  color: var(--ink-sub);
  max-width: 820px;
}

/* ── Bảng Đối Chiếu La Bàn Pro vs Chân Xích 42,94 cm ── */
.lb-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 960px) {
  .lb-compare-grid {
    grid-template-columns: 1fr;
  }
}

.lb-compare-box {
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.lb-compare-box h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  color: var(--cat-red);
}

.lb-compare-box p,
.lb-compare-box li {
  font-size: 13.4px;
  color: var(--ink-sub);
}

.lb-compare-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* ── Bộ Sưu Tập Ảnh Hồ Sơ Gốc Trong Thư Mục OneDrive Của Thầy ── */
.lb-archive-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.lb-archive-card {
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.lb-archive-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(35, 25, 16, 0.14);
  border-color: var(--cat-red);
}

.lb-archive-card img {
  width: 100%;
  height: 148px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line-soft);
}

.lb-archive-card div {
  padding: 8px 10px;
}

.lb-archive-card strong {
  display: block;
  font-size: 12.2px;
  color: var(--ink-main);
}

.lb-archive-card small {
  font-size: 11px;
  color: var(--ink-muted);
}

/* ── Bảng Quy Đổi Cửa Lỗ Ban 2 Cánh & Khuôn Bao 4,5cm / 6,0cm ── */
.lb-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-inset);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lb-table th,
.lb-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.lb-table th {
  background: var(--bg-panel);
  font-weight: 800;
  color: var(--ink-main);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lb-table tr:last-child td {
  border-bottom: none;
}

.lb-table tr.row-cat td {
  background: rgba(249, 229, 227, 0.42);
}

.lb-badge-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 4px 12px;
  min-height: 26px;
  border-radius: 999px;
  background: var(--cat-red);
  color: #FFF8EE;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.25;
  vertical-align: middle;
}

.lb-badge-hung {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  padding: 4px 12px;
  min-height: 26px;
  border-radius: 999px;
  background: var(--hung-dark);
  color: #EAE4DC;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.25;
  vertical-align: middle;
}

/* ── Bộ Tra Cứu Toàn Văn 117 Thước Lỗ Ban (3.744 Tiểu Cung) ── */
.lb-explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.lb-explorer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-explorer-controls label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-main);
}

.lb-select,
.lb-input-num {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-inset);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-main);
}

.lb-input-num {
  width: 135px;
  font-family: var(--font-mono);
}

/* Thước Kéo Trực Quan 3 Hệ (Ruler Tape Visualizer) */
.lb-tape-box {
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.lb-tape-row {
  display: grid;
  grid-template-columns: 210px 1fr 220px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.lb-tape-row:last-child {
  border-bottom: none;
}

@media (max-width: 900px) {
  .lb-tape-row {
    grid-template-columns: 1fr;
  }
}

.lb-tape-bar {
  display: grid;
  height: 32px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--ink-main);
}

.lb-tape-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #F4EFE6;
  background: var(--hung-dark);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  position: relative;
}

.lb-tape-cell.cat {
  background: var(--cat-red);
}

.lb-tape-cell.active {
  outline: 3px solid #FFD166;
  outline-offset: -3px;
  z-index: 2;
}

/* Lightbox Xem Ảnh Hồ Sơ Gốc */
.lb-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 11, 0.86);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lb-lightbox.open {
  display: flex;
}

.lb-lightbox-inner {
  max-width: 1100px;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lb-lightbox-inner img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
}

/* ==========================================================================
   ĐỒNG BỘ SỐ LIỆU TABULAR-NUMS & TỐI ƯU TOÀN DIỆN TRẢI NGHIỆM MOBILE
   ========================================================================== */

.anatomy-slider-val,
.anatomy-preset-chip,
.lb-input-num,
.lb-table td {
  font-variant-numeric: tabular-nums;
}

.anatomy-range-input {
  touch-action: pan-y;
}

/* ── Tablet & Mobile Header (<= 1120px) ── */
@media (max-width: 1120px) {
  .lb-topbar {
    padding: 8px 12px;
  }
  .lb-topbar-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .lb-brand {
    flex: 1 1 auto;
    max-width: calc(100% - 140px);
  }
  .lb-top-actions {
    order: 2;
    margin-left: auto;
  }
  .lb-nav-links {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    justify-content: flex-start;
    padding-top: 4px;
    border-top: 1px dashed rgba(197, 182, 158, 0.55);
  }
}

/* ── Mobile & Phablet (<= 768px) ── */
@media (max-width: 768px) {
  .lb-wrap {
    padding: 12px 10px 44px;
  }
  .lb-brand-logo {
    width: 34px;
    height: 34px;
  }
  .lb-brand-text strong {
    font-size: 13.5px;
  }
  .lb-brand-text span {
    font-size: 10.5px;
  }
  .lb-top-actions a.lb-btn-laban {
    font-size: 11.5px;
    padding: 5px 9px;
  }
  .lb-top-actions a.lb-btn-lang {
    font-size: 11.5px;
    padding: 4px 9px;
  }
  .lb-nav-links a {
    font-size: 12px;
    padding: 5px 10px;
    background: rgba(239, 233, 218, 0.65);
  }
  .lb-hero-strip {
    padding: 14px 14px;
    margin-bottom: 14px;
    gap: 12px;
  }
  .lb-hero-title-box h1 {
    font-size: 21px;
    line-height: 1.28;
  }
  .lb-hero-title-box p {
    font-size: 13.2px;
    line-height: 1.55;
  }
  .lb-hero-badges {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .lb-stat-pill {
    min-width: 0;
    padding: 7px 10px;
  }
  .lb-stat-pill b {
    font-size: 13.8px;
  }

  /* Sân khấu 3D trên Mobile: giữ chuẩn tỷ lệ 16:10.5 không cắt xén hình 3D */
  .anatomy-left-card,
  .anatomy-right-card {
    padding: 12px 12px 14px;
    border-radius: 14px;
  }
  .anatomy-stage-hint {
    display: none;
  }
  .anatomy-stage-toggles {
    width: 100%;
    justify-content: space-between;
  }
  .anatomy-pill-btn {
    flex: 1 1 48%;
    justify-content: center;
    padding: 6px 8px;
    font-size: 11.5px;
  }
  .anatomy-viewport {
    min-height: 0;
    aspect-ratio: 16 / 10.5;
  }
  .anatomy-step-inset {
    position: static;
    width: 100%;
    margin-top: 8px;
    padding: 8px 9px;
  }
  .anatomy-step-mini-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }
  .anatomy-step-mini {
    padding: 4px 2px;
  }
  .anatomy-step-mini span {
    font-size: 9.5px;
  }

  /* Nút chọn mô hình 3D và thanh trượt dễ chạm bằng ngón cái */
  .anatomy-model-tabs-mobile .anatomy-model-tab {
    font-size: 11.5px;
    padding: 8px 6px;
  }
  .anatomy-range-input {
    height: 12px;
  }
  .anatomy-range-input::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }
  .anatomy-preset-chip {
    padding: 4px 9px;
    font-size: 11.5px;
    min-height: 28px;
  }
  .anatomy-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .anatomy-action-row .anatomy-btn-primary {
    grid-column: 1 / -1;
    width: 100%;
    padding: 10px 14px;
    font-size: 13.2px;
  }
  .anatomy-action-row .anatomy-btn-secondary {
    width: 100%;
    padding: 9px 10px;
    font-size: 12px;
    text-align: center;
  }
  .anatomy-metrics-row {
    grid-template-columns: 1fr;
  }

  /* Các chuyên mục bên dưới */
  .lb-section {
    padding: 16px 14px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  .lb-sec-head h2 {
    font-size: 19px;
  }
  .lb-explorer-toolbar {
    padding: 12px;
    gap: 10px;
  }
  .lb-explorer-controls {
    width: 100%;
  }
  .lb-select,
  .lb-input-num {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
  }
  .lb-table th,
  .lb-table td {
    padding: 8px 9px;
    font-size: 12.2px;
  }
}

/* ── Điện thoại màn hình nhỏ (<= 640px): Thu gọn Pin 1..8 trên ảnh 3D để không che khuất mô hình ── */
@media (max-width: 640px) {
  .lb-brand {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }
  .lb-brand-text strong {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lb-top-actions {
    gap: 4px;
  }
  .lb-top-actions a.lb-btn-laban {
    display: none;
  }
  .anatomy-pin:not(.active) {
    padding: 2px;
    border-radius: 50%;
    background: rgba(251, 248, 242, 0.95);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.25);
  }
  .anatomy-pin:not(.active) .anatomy-pin-label {
    display: none;
  }
  .anatomy-pin:not(.active) .anatomy-pin-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11.5px;
  }
  .anatomy-pin.active {
    max-width: 176px;
    padding: 2px 8px 2px 3px;
    z-index: 20;
  }
  .anatomy-pin.active .anatomy-pin-label {
    font-size: 10.8px;
  }
  .anatomy-pin.active.pin-left {
    transform: translate(-14px, -50%) scale(1.03);
  }
  .anatomy-pin.active.pin-right {
    transform: translate(calc(-100% + 14px), -50%) scale(1.03);
  }
  .anatomy-step-mini-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .lb-tape-bar {
    height: 36px;
  }
  .lb-tape-cell {
    font-size: 9.5px;
    line-height: 1.1;
    text-align: center;
    padding: 1px 2px;
  }
}

/* ── Chân Trang Liên Thông Hệ Sinh Thái Phong Thủy ── */
.lb-fs-footer {
  background: #4E0D09;
  color: #EAD7B7;
  border-top: 2px solid #D4AF37;
  padding: 22px 18px;
  font-family: var(--font-sans);
}

.lb-fs-footer-in {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.lb-fs-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-fs-footer-brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid #D4AF37;
  object-fit: cover;
  background: #8C1F14;
}

.lb-fs-footer-brand strong {
  display: block;
  font-family: var(--font-serif);
  color: #FFF4D6;
  font-size: 15px;
}

.lb-fs-footer-brand span {
  display: block;
  font-size: 12.2px;
  color: #DFC9A6;
}

.lb-fs-footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lb-fs-footer-links a {
  text-decoration: none;
  color: #FFE599;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.42);
  font-size: 12.2px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  transition: all 0.16s ease;
}

.lb-fs-footer-links a:hover {
  background: #D4AF37;
  color: #2B120C;
}

.fs-chan-tong {
  min-height: 120px;
}
