/* ==========================================================================
   《青禾书店 · 登录判断》V3 中英双语线上版 · 零代码侧边栏 + 极简毛玻璃 UI 样式表
   上方 88%+ 全画幅留给「左浏览器 ⇄ 中网络双管 ⇄ 右 Y 型路由分流站 + 三柜」3D 微缩世界
   顶部仅左右两枚 <= 34px 悬浮胶囊，底部控件统一收拢至 <= 132px 一体坞
   ========================================================================== */

:root {
  --parchment: rgba(250, 247, 240, 0.94);
  --qinghe-deep: #154233;
  --qinghe: #1f5e49;
  --qinghe-soft: #e6f2ed;
  --brass: #b4955e;
  --brass-light: #dfc48f;
  --brass-dark: #7d6030;
  --ink: #182721;
  --ink-muted: #52635b;
  --crimson: #c53030;
  --crimson-soft: #fdeaea;
  --emerald: #237a4b;
}

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

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ece6da;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ---------------- 0. 顶部统一极简悬浮胶囊（严格 <= 34px，零遮挡 3D 主画布） ---------------- */
.top-pill {
  position: fixed;
  top: 12px;
  z-index: 24;
  height: 32px;
  max-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(250, 247, 240, 0.88);
  border: 1px solid rgba(180, 149, 94, 0.76);
  box-shadow: 0 4px 14px rgba(17, 38, 30, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--qinghe-deep);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.top-pill-left {
  left: 16px;
  padding: 0 13px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.top-pill-left:hover {
  background: var(--qinghe);
  border-color: var(--qinghe-deep);
  color: #ffffff;
  transform: translateY(-1px);
}

.top-pill-right {
  right: 16px;
  padding: 2px 4px;
  gap: 2px;
}

.lang-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  height: 26px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--qinghe-deep);
  background: rgba(31, 94, 73, 0.09);
}

.lang-btn.active {
  background: linear-gradient(180deg, #246c54 0%, #184f3d 100%);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(21, 66, 51, 0.25);
}

.lang-sep {
  font-size: 11px;
  color: rgba(125, 96, 48, 0.55);
  padding: 0 1px;
}

/* ---------------- 1. 全画幅纯净 3D 视口与 CSS2D 浮签层 ---------------- */
#stageViewport {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 42%, #f7f3ea 0%, #dfd7c6 100%);
}

#webglMount {
  position: absolute;
  inset: 0;
}

#webglMount canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#webglMount canvas:active {
  cursor: grabbing;
}

.css2d-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

/* ---------------- 2. 空间超短 CSS2D 浮签（最多 2 个） ---------------- */
.q-lbl {
  pointer-events: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(252, 249, 242, 0.95);
  border: 1.5px solid var(--qinghe);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(20, 42, 33, 0.18);
}

.q-lbl.brass {
  background: linear-gradient(180deg, #e7cf9d 0%, #c6a366 100%);
  border-color: #7c5f30;
  color: #16362a;
}

.q-lbl.ok {
  background: var(--emerald);
  border-color: #9ae6b4;
  color: #ffffff;
}

.q-lbl.err {
  background: var(--crimson);
  border-color: #feb2b2;
  color: #ffffff;
}

/* ---------------- 3. 单击微距指哪对焦哪准星 ---------------- */
.focus-reticle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 22;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.15);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.focus-reticle.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.reticle-corners {
  width: 46px;
  height: 46px;
  position: relative;
}

.reticle-corners i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #f2cb78;
  border-style: solid;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.reticle-corners .tl { top: 0; left: 0; border-width: 2.5px 0 0 2.5px; }
.reticle-corners .tr { top: 0; right: 0; border-width: 2.5px 2.5px 0 0; }
.reticle-corners .bl { bottom: 0; left: 0; border-width: 0 0 2.5px 2.5px; }
.reticle-corners .br { bottom: 0; right: 0; border-width: 0 2.5px 2.5px 0; }

.reticle-caption {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 5px;
  background: rgba(21, 60, 46, 0.94);
  border: 1px solid var(--brass-light);
  color: #ffefc4;
  font-size: 12px;
  font-weight: 600;
}

/* ---------------- 4. 底部唯一低矮毛玻璃控制坞（总高严格 <= 132px） ---------------- */
.bottom-dock {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 10px;
  max-height: 130px;
  z-index: 18;
  background: var(--parchment);
  border: 1px solid rgba(180, 149, 94, 0.72);
  border-top: 3px solid var(--qinghe);
  border-radius: 12px;
  padding: 7px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 10px 28px rgba(17, 38, 30, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.dock-row.hidden {
  display: none !important;
}

/* 第一行：分幕丸 + 一句话极简白话解说 */
.dock-row-top {
  justify-content: space-between;
  gap: 12px;
}

.act-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.act-pills::-webkit-scrollbar {
  display: none;
}

.act-pills button {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #b8c6be;
  background: #ffffff;
  color: var(--qinghe-deep);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.act-pills button:hover {
  border-color: var(--qinghe);
  background: var(--qinghe-soft);
}

.act-pills button.active {
  background: linear-gradient(180deg, #246c54 0%, #19513e 100%);
  border-color: #144031;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(21, 66, 51, 0.25);
}

.act-pills button.trap-tab.active {
  background: linear-gradient(180deg, #cf3838 0%, #a52424 100%);
  border-color: #8c1d1d;
}

.plain-desc {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--qinghe-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex: 1;
  user-select: text;
}

.plain-desc.warn-text {
  color: var(--crimson);
}

/* 第 6 幕单行紧凑实验条 */
.sandbox-strip {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(31, 94, 73, 0.07);
  border: 1px dashed rgba(180, 149, 94, 0.65);
  overflow-x: auto;
  scrollbar-width: none;
}

.sandbox-strip::-webkit-scrollbar {
  display: none;
}

.strip-sep {
  width: 1px;
  height: 20px;
  background: rgba(180, 149, 94, 0.55);
  flex-shrink: 0;
}

.action-pill {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.brass-btn {
  background: linear-gradient(180deg, #e5cc99 0%, #c4a062 100%);
  border: 1px solid var(--brass-dark);
  color: #17382b;
}

.brass-btn:hover {
  filter: brightness(1.04);
}

.qinghe-btn {
  background: linear-gradient(180deg, #277358 0%, #1b5440 100%);
  border: 1px solid #133e2f;
  color: #ffffff;
}

.qinghe-btn:hover {
  filter: brightness(1.07);
}

.mini-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.mini-field input {
  width: 82px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #adc0b6;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.mini-field input:focus {
  border-color: var(--qinghe);
}

.preset-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.preset-pill {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #9abaa9;
  background: #ffffff;
  color: var(--qinghe-deep);
  cursor: pointer;
  white-space: nowrap;
}

.preset-pill.active,
.preset-pill:hover {
  background: var(--qinghe);
  border-color: var(--qinghe);
  color: #ffffff;
}

.preset-pill.warn {
  border-color: #dfb2b2;
  color: #9b2c2c;
}

.preset-pill.warn.active,
.preset-pill.warn:hover {
  background: var(--crimson);
  border-color: var(--crimson);
  color: #ffffff;
}

.mode-toggle {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #b5c3bc;
  margin-left: auto;
  flex-shrink: 0;
}

.mode-pill {
  font-family: inherit;
  font-size: 11.8px;
  font-weight: 600;
  padding: 3px 8px;
  border: none;
  background: #ffffff;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
}

.mode-pill.active {
  background: var(--qinghe-soft);
  color: var(--qinghe-deep);
  font-weight: 700;
}

.mode-pill.trap.active {
  background: var(--crimson-soft);
  color: var(--crimson);
  font-weight: 700;
}

/* 第二行：播放进度 + 视角快切 + 光学与帧率 */
.dock-row-bottom {
  justify-content: space-between;
  gap: 12px;
}

.transport-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 240px;
}

.dock-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #9cb1a6;
  background: #ffffff;
  color: var(--qinghe-deep);
  cursor: pointer;
  white-space: nowrap;
}

.dock-btn:hover {
  background: var(--qinghe-soft);
  border-color: var(--qinghe);
}

.dock-btn.primary {
  background: var(--qinghe);
  border-color: var(--qinghe-deep);
  color: #ffffff;
  font-weight: 700;
}

.dock-btn.active {
  background: #23493a;
  border-color: #23493a;
  color: #faf7f0;
}

.timeline-track {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #d8d1c2;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.timeline-track i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--qinghe) 0%, var(--brass) 100%);
  border-radius: 999px;
}

.time-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  min-width: 78px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cam-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cam-pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid #c6bca8;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.cam-pill:hover {
  border-color: var(--qinghe);
  color: var(--qinghe);
}

.cam-pill.active {
  background: linear-gradient(180deg, #dec38d 0%, #b89559 100%);
  border-color: var(--brass-dark);
  color: #16362a;
  font-weight: 700;
}

.optics-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lens-pill {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--brass);
  background: #fdf9f0;
  color: var(--qinghe-deep);
  cursor: pointer;
  white-space: nowrap;
}

.lens-pill.hd-clear {
  background: var(--qinghe);
  border-color: var(--qinghe-deep);
  color: #ffffff;
}

.aperture-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

.aperture-box.disabled {
  opacity: 0.38;
  pointer-events: none;
}

#sliderAperture {
  width: 58px;
  accent-color: var(--qinghe);
  cursor: pointer;
}

.fps-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(31, 94, 73, 0.12);
  border: 1px solid rgba(31, 94, 73, 0.35);
  color: var(--qinghe-deep);
  font-size: 11.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.asset-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ab872;
}

.asset-dot.loading {
  background: #e3a83b;
  animation: dotPulse 1.1s infinite ease-in-out;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.22); opacity: 1; }
}

.fatal-alert {
  position: fixed;
  left: 20px;
  right: 20px;
  top: 52px;
  z-index: 99;
  background: var(--crimson);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
}

@media (max-width: 1380px) {
  .plain-desc {
    font-size: 12.8px;
  }
}
