:root {
  --bg: #f6f3ee;
  --bg-elevated: #fbf9f6;
  --bg-stone: #ece6dd;
  --ink: #1f1d1a;
  --ink-muted: #665f56;
  --ink-light: #91887c;
  --accent: #b88446;
  --accent-soft: rgba(184, 132, 70, 0.14);
  --walnut: #4b3627;
  --sage: #3d7560;
  --border: rgba(31, 29, 26, 0.1);
  --border-strong: rgba(31, 29, 26, 0.18);
  --hud-bg: rgba(18, 16, 14, 0.88);
  --hud-border: rgba(255, 244, 226, 0.16);
  --hud-text: #f4efe8;
  --hud-muted: rgba(244, 239, 232, 0.66);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-soft: 0 12px 36px rgba(24, 20, 16, 0.08);
  --shadow-hud: 0 14px 40px rgba(0, 0, 0, 0.34);
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Didot", "Georgia", "Songti SC", "STSong", serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: rgba(246, 243, 238, 0.96);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  z-index: 100;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-logo-slot {
  display: inline-flex;
  align-items: center;
  min-width: 92px;
  height: 26px;
  color: var(--ink);
}

.brand-logo-svg {
  display: block;
  height: 100%;
  width: auto;
}

.brand-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--bg-stone);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-stone);
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.nav-tab {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover {
  color: var(--ink);
}

.nav-tab.active {
  background: var(--ink);
  color: #faf7f2;
  box-shadow: 0 4px 12px rgba(24, 20, 16, 0.18);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline {
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-outline:hover {
  background: var(--ink);
  color: #faf7f2;
  border-color: var(--ink);
}

/* ==================== 主视图切换容器 ==================== */
.main-shell {
  padding-top: 62px;
  min-height: 100vh;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ==================== 3D 展厅视图 ==================== */
.viewer-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - 62px);
  overflow: hidden;
  background: #17191d;
  user-select: none;
}

#canvas-3d {
  width: 100%;
  height: 100%;
  position: relative;
  touch-action: none;
}

#canvas-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  cursor: grab;
}

#canvas-3d canvas:active {
  cursor: grabbing;
}

/* 3D 空间热点图钉 */
.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 12;
}

.hotspot-pin {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate3d(-999px, -999px, 0);
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 99px;
  border: 1.5px solid rgba(255, 240, 215, 0.55);
  background: rgba(20, 18, 16, 0.86);
  color: #f6efe6;
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, padding 0.2s ease, gap 0.2s ease;
  margin-left: -13px;
  margin-top: -13px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.hotspot-tip {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width 0.22s ease, opacity 0.18s ease;
}

.hotspot-pin:hover,
.hotspot-pin:focus-visible {
  background: rgba(184, 132, 70, 0.95);
  border-color: #fff2dc;
  padding: 3px 11px 3px 3px;
  gap: 6px;
  z-index: 25;
}

.hotspot-pin:hover .hotspot-tip,
.hotspot-pin:focus-visible .hotspot-tip {
  max-width: 140px;
  opacity: 1;
}

.hotspot-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e6c38d;
  color: #1b1612;
  font-weight: 700;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 3D 顶部快捷机位条 */
.hud-camera-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 25;
  max-width: calc(100% - 350px);
}

.hud-pill {
  border: 1px solid var(--hud-border);
  background: var(--hud-bg);
  color: var(--hud-text);
  font-family: inherit;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hud-pill:hover {
  border-color: rgba(232, 196, 139, 0.65);
  background: rgba(34, 30, 26, 0.92);
}

.hud-pill.active {
  background: #e6c38d;
  color: #1b1713;
  border-color: #f4d8ab;
  font-weight: 600;
}

/* 3D 左侧迷你状态提示 & 导航模式 */
.hud-left-stack {
  position: absolute;
  top: 64px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 24;
  max-width: 265px;
}

.hud-card-mini {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  color: var(--hud-text);
  box-shadow: var(--shadow-hud);
}

.hud-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.hud-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--hud-muted);
  font-family: inherit;
  font-size: 11.5px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.hud-mode-btn.active {
  background: #e6c38d;
  color: #1b1713;
  border-color: transparent;
  font-weight: 600;
}

.hud-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--hud-muted);
}

.walk-pad {
  display: none;
  margin-top: 9px;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.walk-pad.visible {
  display: grid;
}

.walk-pad button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 7px;
  padding: 6px 0;
  font-size: 12px;
  cursor: pointer;
}

.walk-pad button:hover {
  background: rgba(230, 195, 141, 0.35);
}

/* 3D 热点详情浮卡 */
.hotspot-card {
  position: absolute;
  left: 16px;
  bottom: 108px;
  width: 340px;
  background: rgba(20, 18, 16, 0.94);
  border: 1px solid rgba(230, 195, 141, 0.38);
  border-radius: var(--radius-md);
  padding: 15px 17px;
  color: var(--hud-text);
  box-shadow: var(--shadow-hud);
  z-index: 30;
  display: none;
  animation: fadeSlideUp 0.22s ease;
}

.hotspot-card.open {
  display: block;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hotspot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.hotspot-tag {
  font-size: 10.5px;
  color: #e6c38d;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.hotspot-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.hotspot-close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.hotspot-card p {
  margin: 9px 0 11px;
  font-size: 12.5px;
  line-height: 1.62;
  color: rgba(244, 239, 232, 0.84);
}

.hotspot-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hotspot-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(230, 195, 141, 0.16);
  border: 1px solid rgba(230, 195, 141, 0.3);
  color: #f3d7aa;
}

/* 3D 右侧可折叠方案与灯光控制台 */
.hud-right-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 304px;
  max-height: calc(100% - 124px);
  overflow-y: auto;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: var(--radius-md);
  color: var(--hud-text);
  box-shadow: var(--shadow-hud);
  z-index: 28;
  transition: transform 0.25s ease;
}

.hud-right-panel.collapsed .hud-panel-body {
  display: none;
}

.hud-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.hud-panel-header strong {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.hud-panel-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.hud-section-label {
  font-size: 11px;
  color: var(--hud-muted);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.hud-seg-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 239, 232, 0.8);
  font-family: inherit;
  font-size: 11.5px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  line-height: 1.3;
}

.hud-seg-btn small {
  display: block;
  font-size: 10px;
  opacity: 0.72;
  margin-top: 2px;
}

.hud-seg-btn.active {
  background: rgba(230, 195, 141, 0.2);
  border-color: #e6c38d;
  color: #fff3de;
  font-weight: 600;
}

/* 灯光四路开关网格 */
.light-switches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.light-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  cursor: pointer;
  color: var(--hud-text);
}

.light-toggle input {
  accent-color: #e6c38d;
  cursor: pointer;
}

/* 快捷功能按钮行 */
.hud-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.hud-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--hud-text);
  font-family: inherit;
  font-size: 11.5px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.hud-action-btn.active {
  background: #e6c38d;
  color: #1b1713;
  border-color: #f3d7aa;
  font-weight: 600;
}

/* 实时同步 KPI 迷你条 */
.hud-live-summary {
  background: rgba(230, 195, 141, 0.1);
  border: 1px solid rgba(230, 195, 141, 0.26);
  border-radius: 10px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
}

.hud-live-summary strong {
  display: block;
  font-size: 14px;
  color: #f5d8aa;
  margin-top: 2px;
}

/* 3D 底部全天候光影时间轴栏 */
.hud-time-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 32px));
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: var(--radius-lg);
  padding: 9px 16px;
  color: var(--hud-text);
  box-shadow: var(--shadow-hud);
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.time-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.time-readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.time-clock {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #f4d6a4;
  letter-spacing: 0.04em;
}

.time-phase-name {
  font-size: 12px;
  color: var(--hud-text);
  font-weight: 500;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-presets {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.time-preset-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--hud-muted);
  font-family: inherit;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.time-preset-btn:hover {
  color: #fff;
  border-color: rgba(230, 195, 141, 0.5);
}

.time-preset-btn.active {
  background: #e6c38d;
  color: #1b1713;
  border-color: #f3d7aa;
  font-weight: 600;
}

.time-play-btn {
  border: 1px solid rgba(230, 195, 141, 0.55);
  background: rgba(230, 195, 141, 0.16);
  color: #f5d8aa;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
  cursor: pointer;
}

.time-play-btn.playing {
  background: #e6c38d;
  color: #1b1713;
}

.time-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #35476e 0%, #92b6dc 18%, #f2e8d4 40%, #eba862 63%, #253b68 78%, #0f1629 100%);
  outline: none;
  cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff6e6;
  border: 3px solid #c9924b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.time-desc-inline {
  font-size: 11.5px;
  color: var(--hud-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

/* ==================== 内容页面通用版式 ==================== */
.page-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 26px 72px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* 同步选项控制药丸（跨页共享） */
.sync-control-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
}

.sync-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-group-label {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.pill-toggle-group {
  display: inline-flex;
  background: var(--bg-stone);
  padding: 3px;
  border-radius: 99px;
}

.pill-toggle {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill-toggle.active {
  background: var(--ink);
  color: #faf7f2;
  font-weight: 500;
}

/* ==================== 多角度效果图与日夜对比滑块 ==================== */
.compare-hero {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 34px;
}

.compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.compare-header h2 {
  margin: 0;
  font-size: 18px;
}

.compare-hint {
  font-size: 12.5px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 500;
}

.compare-slider-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  background: #141414;
}

.compare-slider-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.compare-overlay-wrap {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #fff;
}

.compare-overlay-wrap img {
  width: 100%;
  height: 100%;
  max-width: none;
  /* 动态由 JS 设置为与父框同宽 */
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(24, 22, 20, 0.86);
  border: 2px solid #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.compare-badge {
  position: absolute;
  top: 16px;
  padding: 6px 13px;
  border-radius: 99px;
  background: rgba(20, 18, 16, 0.72);
  backdrop-filter: blur(8px);
  color: #f6f1ea;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.compare-badge.left {
  left: 16px;
}

.compare-badge.right {
  right: 16px;
}

/* 效果图画廊网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.render-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.render-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(24, 20, 16, 0.12);
}

.render-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: zoom-in;
  background: #1f1d1a;
}

.render-thumb.loading img {
  opacity: 0;
}

.render-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: transform 0.4s ease, opacity 0.2s ease;
}

.render-card:hover .render-thumb img {
  transform: scale(1.03);
}

.render-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(20, 18, 16, 0.74);
  backdrop-filter: blur(6px);
  color: #f5dfb8;
  font-size: 11px;
  font-weight: 500;
}

.render-body {
  padding: 16px 18px 18px;
}

.render-body h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
}

.render-sub {
  margin: 5px 0 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.render-points {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #46413b;
}

.render-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.render-mini-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.render-mini-btn:hover {
  background: var(--bg-stone);
}

.render-mini-btn.primary {
  background: var(--ink);
  color: #faf7f2;
  border-color: var(--ink);
}

.render-mini-btn.primary:hover {
  background: var(--walnut);
  border-color: var(--walnut);
}

/* ==================== 2D 建筑图纸 ==================== */
.cad-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.cad-sheet-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cad-sheet-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cad-sheet-btn.active {
  background: var(--ink);
  color: #faf7f2;
  border-color: var(--ink);
  font-weight: 500;
}

.cad-layer-toggles {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.cad-layer-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.cad-layer-toggles input {
  accent-color: var(--accent);
}

.cad-board {
  background: #f7f4ef;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

.cad-svg {
  width: 100%;
  height: auto;
  display: block;
  min-width: 780px;
}

/* SVG 建筑制图字体样式 */
.cad-sheet-title {
  font-size: 16px;
  font-weight: 700;
  fill: #24211e;
  letter-spacing: 0.04em;
}
.cad-sheet-sub {
  font-size: 11.5px;
  fill: #6a6258;
}
.cad-title {
  font-size: 11.5px;
  font-weight: 600;
  fill: #2b2723;
}
.cad-title-light {
  font-size: 10.5px;
  font-weight: 600;
  fill: #f6efe6;
}
.cad-sub {
  font-size: 9.5px;
  fill: #605950;
}
.cad-sub-warm {
  font-size: 10px;
  font-weight: 600;
  fill: #a36c28;
}
.cad-micro {
  font-size: 8.8px;
  fill: #4c463f;
}
.cad-micro-light {
  font-size: 8.8px;
  fill: #f8f2ea;
}
.cad-micro-warm {
  font-size: 8.8px;
  font-weight: 600;
  fill: #a86e24;
}
.cad-dim-txt {
  font-size: 11px;
  font-weight: 600;
  fill: #332f2b;
}
.cad-dim-small {
  font-size: 9.5px;
  fill: #5d564e;
}
.cad-dim-warm {
  font-size: 9.5px;
  font-weight: 600;
  fill: #a86e24;
}
.cad-legend {
  font-size: 10.5px;
  fill: #45403a;
}

/* ==================== 坪效、容量与动线分析 ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.kpi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.kpi-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.kpi-value span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 4px;
}

.kpi-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sage);
}

.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 24px;
}

.editorial-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}

.editorial-card h3 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.journey-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
}

.journey-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.journey-step h4 {
  margin: 6px 0;
  font-size: 14.5px;
}

.journey-step p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.ergo-bar-wrap {
  margin-top: 14px;
}

.ergo-bar {
  display: flex;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  font-size: 11.5px;
  font-weight: 600;
}

.ergo-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

/* ==================== 材质、灯光与造价清单 ==================== */
.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.mat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.mat-swatch {
  height: 92px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 14px;
}

.mat-code {
  background: rgba(20, 18, 16, 0.72);
  color: #f4eee6;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
}

.mat-ratio {
  background: rgba(255, 255, 255, 0.85);
  color: #24211d;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
}

.mat-body {
  padding: 15px 16px 17px;
}

.mat-body h4 {
  margin: 0;
  font-size: 15px;
}

.mat-hex {
  font-size: 11px;
  color: var(--ink-light);
  margin: 2px 0 10px;
}

.mat-detail {
  font-size: 12.2px;
  line-height: 1.62;
  color: #46413b;
  margin: 0 0 8px;
}

.mat-tip {
  font-size: 11.8px;
  color: var(--walnut);
  background: var(--accent-soft);
  padding: 7px 10px;
  border-radius: 8px;
  line-height: 1.5;
}

/* 专业表格（灯光 / 造价） */
.spec-table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
  overflow-x: auto;
}

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

.spec-table th {
  background: var(--bg-stone);
  text-align: left;
  padding: 13px 16px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.spec-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.58;
}

.spec-table tr.row-highlight {
  background: rgba(184, 132, 70, 0.08);
}

.spec-table tfoot td {
  background: #23201d;
  color: #faf6f0;
  font-weight: 600;
  font-size: 14.5px;
}

.price-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  color: var(--walnut);
}

.spec-table tfoot .price-cell {
  color: #f4d39d;
  font-size: 17px;
}

/* 施工拆改避坑网格 */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.check-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--accent);
  border-radius: 12px;
  padding: 16px 18px;
}

.check-card h4 {
  margin: 0 0 7px;
  font-size: 14.5px;
}

.check-issue {
  font-size: 12.2px;
  color: var(--ink-muted);
  margin: 0 0 6px;
}

.check-action {
  font-size: 12.6px;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
}

/* ==================== 全屏图片灯箱 ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 11, 10, 0.92);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: 1180px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-inner img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f4efe8;
  gap: 14px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(30, 28, 26, 0.7);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 1180px) {
  .time-desc-inline,
  .time-phase-name {
    display: none;
  }
}

@media (max-width: 1080px) {
  .kpi-grid,
  .journey-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand-badge {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .nav-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .nav-tab {
    padding: 6px 10px;
    font-size: 12px;
  }
  .topbar-actions {
    display: none;
  }
  .hud-camera-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: calc(100% - 32px);
    scrollbar-width: none;
  }
  .hud-camera-bar::-webkit-scrollbar {
    display: none;
  }
  .hud-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hud-left-stack {
    display: none;
  }
  .gallery-grid,
  .two-col-grid,
  .checklist-grid,
  .material-grid {
    grid-template-columns: 1fr;
  }
  .hud-right-panel {
    top: 58px;
    width: 248px;
  }
  .time-presets {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .time-desc-inline {
    display: none;
  }
}

/* ==================== 一键导出 / 打印客户汇报 PDF 模式 ==================== */
.print-cover {
  display: none;
}

@media print {
  .topbar,
  .hud-camera-bar,
  .hud-left-stack,
  .hud-right-panel,
  .hud-time-bar,
  .hotspot-card,
  .sync-control-strip,
  .cad-toolbar,
  .lightbox,
  .compare-hint {
    display: none !important;
  }
  .main-shell {
    padding-top: 0;
  }
  .print-cover {
    display: block;
    padding: 28px 0 20px;
    border-bottom: 2px solid #24211e;
    margin-bottom: 24px;
  }
  .tab-panel {
    display: block !important;
    page-break-after: always;
  }
  #tab-3d {
    display: none !important; /* 3D WebGL 由写实效果图替代呈现于纸面PDF */
  }
  .page-container {
    padding: 12px 0;
  }
}
