/*
 * 展馆交互细节打磨（V8）。
 * 在各馆样式与 pavilion-shell.css 之后加载，只调整控件外观与动效，不改动布局骨架和内容。
 */
:root { --polish-ease: cubic-bezier(.2, .7, .2, 1); }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- 文塔：视角切换改为单行分段胶囊 ---------- */
.detail-view-controls {
  flex-wrap: nowrap !important;
  max-width: calc(100% - 96px) !important;
  gap: 2px !important;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(250, 247, 240, .82);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 26px rgba(58, 42, 26, .07);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.detail-view-controls::-webkit-scrollbar { display: none; }
.detail-view-controls button {
  flex: 0 0 auto;
  border: 0 !important;
  border-radius: 999px;
  background: transparent !important;
  padding: 6px 12px !important;
  font-size: 11px !important;
  letter-spacing: .08em !important;
  white-space: nowrap;
  transition: background-color .25s var(--polish-ease), color .25s var(--polish-ease), box-shadow .25s var(--polish-ease);
}
.detail-view-controls button:hover { background: rgba(165, 67, 52, .07) !important; color: var(--red); }
.detail-view-controls button.view-active {
  background: var(--red) !important;
  color: #fbf6ec !important;
  box-shadow: 0 3px 10px rgba(155, 50, 41, .22);
}
.detail-view-controls button:last-child {
  position: relative;
  margin-left: 6px;
  color: var(--red);
}
.detail-view-controls button:last-child::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  border-left: 1px solid var(--line);
}
.detail-view-controls button:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

/* 宽屏：竖排于画面左侧，避免遮挡塔刹 */
@media (min-width: 701px) {
  .detail-view-controls {
    flex-direction: column;
    align-items: stretch;
    max-width: none !important;
    padding: 4px;
    border-radius: 18px;
    overflow: visible;
  }
  .detail-view-controls button { text-align: left; border-radius: 14px; padding: 7px 14px !important; }
  .detail-view-controls button:last-child { margin: 5px 0 0; }
  .detail-view-controls button:last-child::before { left: 12px; right: 12px; top: -3px; height: 0; transform: none; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .detail-view-controls { left: 14px !important; right: 14px !important; max-width: none !important; }
  .detail-view-controls button { padding: 6px 10px !important; font-size: 10px !important; }
}

/* ---------- 文塔：右侧工具栏、提示与诊断条 ---------- */
.viewer-tools {
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(250, 247, 240, .7);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(58, 42, 26, .06);
}
.viewer-tools .tool-button { border-radius: 50% !important; transition: background-color .22s var(--polish-ease), color .22s var(--polish-ease), transform .22s var(--polish-ease); }
.viewer-tools .tool-button:hover { background: rgba(165, 67, 52, .08); color: var(--red); }
.viewer-tools .tool-button:active { transform: scale(.94); }
.viewer-tools .tool-button:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

.render-support:not([open]) {
  border-color: transparent;
  background: transparent;
}
.render-support:not([open]) > summary {
  justify-content: center;
  gap: 14px;
  padding: 8px 16px;
  font-size: 11px;
  opacity: .66;
  transition: opacity .25s ease;
}
.render-support:not([open]) > summary:hover { opacity: 1; }
.render-support > summary::-webkit-details-marker { display: none; }
.render-support[open] { border-radius: 4px; box-shadow: 0 10px 30px rgba(58, 42, 26, .06); }

.model-disclaimer { letter-spacing: .08em; }

/* ---------- 长岗坡：画面工具与底部工具条 ---------- */
.stage-tools {
  overflow: hidden;
  border-radius: 24px !important;
  background: rgba(250, 248, 240, .78) !important;
  background: color-mix(in srgb, var(--surface) 78%, transparent) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 26px rgba(40, 52, 36, .08) !important;
}
.stage-tools button { transition: background-color .22s var(--polish-ease), color .22s var(--polish-ease), transform .22s var(--polish-ease); }
.stage-tools button:hover { color: var(--accent); }
.stage-tools button:active { transform: scale(.94); }

.toolbar {
  border-radius: 6px !important;
  background: var(--control-surface, rgba(255, 254, 248, .7)) !important;
  box-shadow: 0 10px 30px rgba(40, 52, 36, .05);
}
.toolbar button,
.toolbar select { border-radius: 4px; transition: background-color .22s var(--polish-ease), color .22s var(--polish-ease); }
.toolbar button[aria-pressed=true] { box-shadow: inset 0 0 0 1px rgba(165, 67, 52, .16); }

.scale-switch { border-radius: 999px !important; }
.scale-switch button { border-radius: 999px; transition: background-color .25s var(--polish-ease), color .25s var(--polish-ease); }

.stage-tools button:focus-visible,
.toolbar button:focus-visible,
.toolbar select:focus-visible,
.scale-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
