/* ============================================================================
   ✦ 喵老师的小站 —— 2D 复古数字工作台样式 (Desktop 2D System)
   极致流畅 · 零 GPU 负担 · 1:1 还原 3D 物品场景、动效与微交互
   ========================================================================== */

#bm-2d-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #07080d;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 1;
}

#bm-2d-root.active {
  opacity: 1;
  pointer-events: auto;
}

/* 保持 2560 x 1066 的等比复古画幅舞台 */
.bm2d-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #07080d url("assets/tex/still.jpg") center center / auto 100% no-repeat;
  container-type: size;
  --k: calc(100cqh / 1066);
}

/* 放大特写全屏暗色遮罩 */
.bm2d-zoom-scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 25;
}

.bm2d-zoom-scrim.open {
  opacity: 1;
  pointer-events: auto;
}

/* CRT 广播监视器外壳容器 (支持平滑特写放大 Zoom In/Out) */
.bm2d-tv-box {
  position: absolute;
  left: calc(50% - 182 * var(--k));
  top: calc(475.2 * var(--k));
  width: calc(309.3 * var(--k));
  height: calc(231.2 * var(--k));
  border-radius: calc(4 * var(--k));
  overflow: hidden;
  box-shadow: inset 0 0 calc(12 * var(--k)) rgba(0, 0, 0, 0.8),
              0 0 calc(18 * var(--k)) rgba(0, 255, 204, 0.12);
  cursor: pointer;
  background: #060914;
  transition: all 0.42s cubic-bezier(0.2, 0.85, 0.25, 1);
  z-index: 10;
}

/* 放大特写模式 (Zoomed State) */
.bm2d-tv-box.zoomed {
  position: fixed;
  left: 50% !important;
  top: 48% !important;
  width: min(88vw, calc(72vh * 4 / 3), 960px) !important;
  height: min(66vw, 72vh, 720px) !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0, 255, 204, 0.5),
              0 24px 80px rgba(0, 0, 0, 0.95),
              0 0 40px rgba(0, 255, 204, 0.25) !important;
  z-index: 30;
  cursor: default;
}

.bm2d-tv-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 屏幕复古扫描线与玻璃反光 */
.bm2d-tv-glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08) 0%, transparent 35%),
              repeating-linear-gradient(to bottom, rgba(5, 10, 30, 0.2) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 calc(16 * var(--k)) calc(4 * var(--k)) rgba(3, 6, 24, 0.7);
}

/* 放大状态下的退出特写提示按钮 */
.bm2d-tv-unzoom-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: rgba(12, 16, 28, 0.88);
  border: 1px solid #00ffcc;
  color: #00ffcc;
  font-family: var(--osd, monospace);
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bm2d-tv-box.zoomed .bm2d-tv-unzoom-btn {
  display: block;
}

.bm2d-tv-unzoom-btn:hover {
  background: #00ffcc;
  color: #0a0e18;
}

/* CRT 监视器硬件按钮栏 */
.bm2d-tv-controls {
  position: absolute;
  left: calc(50% - 186 * var(--k));
  top: calc(712 * var(--k));
  width: calc(318 * var(--k));
  height: calc(28 * var(--k));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(8 * var(--k));
  gap: calc(4 * var(--k));
  transition: all 0.42s cubic-bezier(0.2, 0.85, 0.25, 1);
  z-index: 12;
}

.bm2d-tv-controls.zoomed {
  position: fixed;
  left: 50% !important;
  top: calc(48% + min(33vw, 36vh, 360px) + 8px) !important;
  width: min(88vw, calc(72vh * 4 / 3), 960px) !important;
  height: 38px !important;
  transform: translateX(-50%) !important;
  z-index: 32;
  background: rgba(10, 14, 24, 0.95);
  border: 1px solid rgba(0, 255, 204, 0.3);
  border-radius: 4px;
  padding: 0 16px;
}

.bm2d-btn {
  background: rgba(18, 22, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  color: #a29fae;
  font-family: var(--osd, monospace);
  font-size: calc(11 * var(--k));
  line-height: 1;
  padding: calc(3 * var(--k)) calc(6 * var(--k));
  cursor: pointer;
  transition: all 0.15s ease;
}

.bm2d-tv-controls.zoomed .bm2d-btn {
  font-size: 15px;
  padding: 5px 12px;
}

.bm2d-btn:hover {
  color: #00ffcc;
  border-color: #00ffcc;
  background: rgba(0, 255, 204, 0.12);
}

.bm2d-btn.active {
  color: #10121a;
  background: #00ffcc;
  border-color: #00ffcc;
  font-weight: bold;
}

/* 桌面物品微交互热区：完全透明，绝无任何发光边框或方框穿模 */
.bm2d-hotspot {
  position: absolute;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.bm2d-hotspot:hover,
.bm2d-hotspot:active,
.bm2d-hotspot:focus {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* 随身听 CD Player (左下桌角) */
.bm2d-cd {
  left: calc(50% - 920 * var(--k));
  top: calc(860 * var(--k));
  width: calc(220 * var(--k));
  height: calc(110 * var(--k));
  z-index: 5;
}

/* 桌面计算器 (台灯前侧) */
.bm2d-calc {
  left: calc(50% - 650 * var(--k));
  top: calc(815 * var(--k));
  width: calc(150 * var(--k));
  height: calc(80 * var(--k));
  z-index: 5;
}

/* 咖啡杯 (CRT 屏幕左侧) */
.bm2d-mug {
  left: calc(50% - 390 * var(--k));
  top: calc(790 * var(--k));
  width: calc(150 * var(--k));
  height: calc(150 * var(--k));
  z-index: 5;
}

/* 桌面黄色便签本 (CRT 屏幕右下方) */
.bm2d-notepad {
  left: calc(50% + 310 * var(--k));
  top: calc(820 * var(--k));
  width: calc(340 * var(--k));
  height: calc(120 * var(--k));
  z-index: 5;
}

/* 桌面专栏卡带架 (左侧 5 盒专栏) */
.bm2d-tapes-left {
  left: calc(50% + 225 * var(--k));
  top: calc(685 * var(--k));
  width: calc(175 * var(--k));
  height: calc(135 * var(--k));
  z-index: 5;
}

/* 桌面技术卡带架 (右侧 6 盒技术) */
.bm2d-tapes-right {
  left: calc(50% + 405 * var(--k));
  top: calc(645 * var(--k));
  width: calc(185 * var(--k));
  height: calc(155 * var(--k));
  z-index: 5;
}

/* 桌面致谢卡片名片盒 */
.bm2d-credits {
  left: calc(50% - 640 * var(--k));
  top: calc(640 * var(--k));
  width: calc(120 * var(--k));
  height: calc(110 * var(--k));
  z-index: 5;
}

/* 统一轻巧的悬浮提示条 (像 3D 一样跟随光标，无浏览器黄底重叠) */
#bm2d-tip {
  position: fixed;
  z-index: 999;
  background: rgba(10, 12, 18, 0.94);
  border: 1px solid rgba(0, 255, 204, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 6px rgba(0, 255, 204, 0.2);
  color: #f1ead8;
  font-family: var(--osd, monospace);
  font-size: 15px;
  padding: 3px 10px;
  border-radius: 3px;
  pointer-events: none;
  transform: translate(14px, 18px);
  white-space: nowrap;
  display: none;
}

/* 2D 弹起式复古计算器浮层 */
.bm2d-calc-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 320px;
  background: #1c1d22;
  border: 2px solid #3e4252;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 0, 0, 0.5);
  padding: 18px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  color: #efe9dc;
  font-family: var(--osd, monospace);
}

.bm2d-calc-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.bm2d-calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}

.bm2d-calc-header span {
  font-size: 14px;
  color: #a29fae;
  letter-spacing: 0.1em;
}

.bm2d-calc-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #a29fae;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.bm2d-calc-close:hover {
  color: #ff5555;
  border-color: #ff5555;
}

.bm2d-calc-lcd {
  background: #7d9178;
  color: #121811;
  font-family: var(--osd, monospace);
  font-size: 38px;
  text-align: right;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  margin-bottom: 16px;
  letter-spacing: 0.08em;
  min-height: 58px;
  line-height: 1;
  overflow: hidden;
}

.bm2d-calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bm2d-calc-key {
  background: #2a2c36;
  border: 1px solid #4a4e61;
  color: #f4f5ff;
  font-family: var(--osd, monospace);
  font-size: 20px;
  padding: 10px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: center;
}

.bm2d-calc-key:hover {
  background: #393c4a;
  border-color: #00ffcc;
}

.bm2d-calc-key:active {
  transform: translateY(2px);
  background: #1c1d24;
}

.bm2d-calc-key.op {
  background: #3c3328;
  border-color: #6d5b45;
  color: #ffb867;
}

.bm2d-calc-key.clear {
  background: #4a2121;
  border-color: #8c3535;
  color: #ff8888;
}

/* ============================================================================
   顶部 3D / 2D 模式复古工控硬件拨档开关 (Vintage Hardware Rocker Toggle)
   替换原刺眼赛博胶囊，100% 融入 80s/90s 模拟广播监视器与工作台实景
   ========================================================================== */

.mode-hw-toggle {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  transition: transform 0.12s ease;
}

.mode-hw-toggle:active {
  transform: scale(0.97) translateY(1px);
}

.mode-hw-toggle:focus-visible {
  outline: 2px solid #ffb867;
  outline-offset: 2px;
  border-radius: 4px;
}

.hw-plate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 7px;
  background: linear-gradient(180deg, #282b35 0%, #1b1c24 55%, #121318 100%);
  border: 1px solid #3e4352;
  border-top-color: #5d647a;
  border-bottom-color: #0b0c0f;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  position: relative;
}

.mode-hw-toggle:hover .hw-plate {
  border-color: #555d73;
  border-top-color: #7b84a1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* 沉头铆钉螺丝 */
.hw-rivet {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3a3d49;
  border: 0.5px solid #16171d;
  box-shadow: inset 0 0.5px 1px rgba(0, 0, 0, 0.9), 0 0.5px 0.5px rgba(255, 255, 255, 0.15);
  position: relative;
}

.hw-rivet::after {
  content: "";
  position: absolute;
  left: 0.5px;
  top: 1.5px;
  width: 3px;
  height: 1px;
  background: #111216;
  transform: rotate(45deg);
}

/* 沉入式机械开关滑槽 */
.hw-switch-bay {
  display: inline-flex;
  align-items: center;
  position: relative;
  background: #090a0e;
  border: 1px solid #1c1d25;
  border-radius: 3px;
  padding: 2px 3px;
  height: 18px;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.95), 0 0.5px 0.5px rgba(255, 255, 255, 0.08);
}

/* 档位文字雕刻 */
.hw-opt {
  font-family: var(--osd, monospace);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 0 4px;
  color: #5d6375;
  z-index: 2;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* 真实金属滚花物理滑块 */
.hw-rocker {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 22px;
  left: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #6c7385 0%, #464a57 52%, #2c2f38 100%);
  border: 1px solid #7d869c;
  border-bottom-color: #1a1c22;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  z-index: 1;
  transition: transform 0.22s cubic-bezier(0.2, 0.85, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 滑块表面的复古防滑滚花槽纹 */
.hw-knurl {
  width: 10px;
  height: 8px;
  background: repeating-linear-gradient(90deg, #24262f 0 1px, #7d869c 1px 2px);
  opacity: 0.7;
  border-radius: 1px;
}

/* 3D 状态 */
.mode-hw-toggle.mode-3d .hw-rocker {
  transform: translateX(0);
}
.mode-hw-toggle.mode-3d #hw-lbl-3d {
  color: #ffdda8;
  text-shadow: 0 0 6px rgba(255, 184, 103, 0.6);
}

/* 2D 状态：滑块平移至右侧 2D 档位 */
.mode-hw-toggle.mode-2d .hw-rocker {
  transform: translateX(25px);
}
.mode-hw-toggle.mode-2d #hw-lbl-2d {
  color: #bbf7d0;
  text-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* 复古信号透镜指示灯 (Pilot Lamp) */
.hw-pilot-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: background-color 0.25s, box-shadow 0.25s;
}

.mode-hw-toggle.mode-3d .hw-pilot-light {
  background-color: #f59e0b;
  box-shadow: 0 0 7px #f59e0b, 0 0 2px #fff;
}

.mode-hw-toggle.mode-2d .hw-pilot-light {
  background-color: #10b981;
  box-shadow: 0 0 7px #10b981, 0 0 2px #fff;
}

/* 模式状态小标签 */
.hw-tag {
  font-family: var(--osd, monospace);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #8f95a5;
  padding-left: 1px;
  line-height: 1;
}

.mode-hw-toggle.mode-3d .hw-tag {
  color: #ffb867;
}

.mode-hw-toggle.mode-2d .hw-tag {
  color: #4ade80;
}

/* 2D 卡带选择面板弹窗 */
.bm2d-tapes-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: min(90vw, 720px);
  max-height: 80vh;
  background: #141724;
  border: 2px solid #00ffcc;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9), 0 0 24px rgba(0, 255, 204, 0.3);
  padding: 24px;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bm2d-tapes-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.bm2d-tapes-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 255, 204, 0.3);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.bm2d-tapes-modal h3 {
  margin: 0;
  font-size: 20px;
  color: #00ffcc;
  font-family: var(--osd, monospace);
}

.bm2d-tapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

.bm2d-tape-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm2d-tape-card:hover {
  border-color: #00ffcc;
  background: rgba(0, 255, 204, 0.08);
  transform: translateY(-2px);
}

.bm2d-tape-card .tape-title {
  font-size: 16px;
  font-weight: bold;
  color: #f1ead8;
}

.bm2d-tape-card .tape-year {
  font-size: 12px;
  color: #a29fae;
  font-family: var(--osd, monospace);
}

.bm2d-tape-card .tape-desc {
  font-size: 13px;
  color: #c7c3d1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 顶部导航文字阴影，保证在任何背景下字迹清爽锐利 */
nav.menu a {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.7);
}
