/* css/style.css —— 极简未来无尘超级工厂 HUD 界面样式 */
:root {
  --bg-panel: #1c1c1e;
  --border-panel: #3a3a3c;
  --accent-blue: #0a84ff;
  --accent-blue-hover: #409cff;
  --text-main: #f5f5f7;
  --text-sub: #a1a1a6;
  --btn-bg: #2c2c2e;
  --btn-hover: #3a3a3c;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0d1218;
  font-family: var(--font-family);
  color: var(--text-main);
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0d1218;
  transition: opacity 260ms ease, visibility 260ms ease;
}

#loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  width: min(440px, calc(100vw - 40px));
  padding: 24px;
  border: 1px solid var(--border-panel);
  border-radius: 8px;
  background: var(--bg-panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.loading-kicker {
  color: #64a8ff;
  font: 700 10px/1.3 Consolas, "Microsoft YaHei", monospace;
}

.loading-card h1 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.35;
}

.loading-card p {
  margin: 9px 0 0;
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.55;
}

.loading-track {
  height: 4px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--border-panel);
}

.loading-track i {
  display: block;
  width: 8%;
  height: 100%;
  background: var(--accent-blue);
  transition: width 220ms ease;
}

#loading-screen.is-error .loading-kicker {
  color: #ff6961;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

canvas#c {
  width: 100%;
  height: 100%;
  display: block;
}

/* 底部功能视点切换坞 */
.controls-dock {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  padding: 7px 11px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: calc(100vw - 24px);
}

.view-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: calc(100vw - 56px);
}

.dock-btn {
  background: var(--btn-bg);
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.dock-btn:hover {
  background: var(--btn-hover);
  border-color: #48484a;
  color: var(--text-main);
  box-shadow: none;
}

.dock-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: none;
}

.dock-divider {
  width: 1px;
  height: 24px;
  background: #3a3a3c;
}

.action-group {
  display: flex;
  gap: 5px;
}

/* 交互提示 */
.hint-badge {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.5px;
  pointer-events: none;
}

.teaching-session-active .view-group,
.teaching-session-active #btnTour,
.first-person-active .view-group,
.first-person-active .hint-badge {
  display: none;
}

.first-person-active .controls-dock {
  gap: 6px;
  padding: 6px 9px;
}

html.quality-medium .controls-dock,
html.quality-medium .hint-badge {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition-duration: 120ms;
}

html.quality-lowfx .controls-dock,
html.quality-lowfx .dock-btn,
html.quality-lowfx .hint-badge {
  box-shadow: none;
  filter: none;
  backdrop-filter: none;
  transition: none;
}
