/* ===== 全局 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== 主容器 ===== */
#console {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  min-width: 850px;
  gap: 3px;
  padding: 4px;
  background: #0a0a0c;
  color: #ccc;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

/* ===== 顶行1: UTC / LST ===== */
#top-row1 {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ===== 顶行2: RA / Dec ===== */
#top-row2 {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* ===== 七段数码管占位 ===== */
.seg-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px;
  border: 1px solid #333;
  background: #0d0d0d;
  border-radius: 4px;
  min-width: 160px;
}
.seg-label {
  font-size: 12px;
  color: #666;
  letter-spacing: 2px;
  margin-bottom: 2px;
}
.seg-box {
  display: block;
  height: 44px;
  border-radius: 3px;
  padding: 2px 8px;
}
/* 顶行 黄色 LED */
#top-row1 .seg-box { background: #1a1000; }
#top-row1 .seg-placeholder { border-color: #332200; }
#top-row2 .seg-box { background: #1a1000; }
#top-row2 .seg-placeholder { border-color: #332200; }

/* ===== 主内容区 ===== */
#main-row {
  display: grid;
  grid-template-columns: 1fr 2.5fr 1.5fr;
  gap: 4px;
  min-height: 0;
}

/* ===== 左侧: HA 表盘 + Alt/Az 合图 ===== */
#left-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #0a0f0a;
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  padding: 4px;
}

.gauge-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d100d;
  border: 1px solid #1a2a1a;
  border-radius: 4px;
  padding: 8px;
}
.gauge-title {
  font-size: 14px;
  color: #33ff33;
  letter-spacing: 3px;
}
.gauge-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  max-height: 100%;
}

/* HA 大表盘 */
.ha-big {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Alt/Az 极坐标环形图 */
.altaz-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0d100d;
  border: 1px solid #1a2a1a;
  border-radius: 4px;
  padding: 6px;
}
.altaz-title {
  font-size: 12px;
  color: #33ff33;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 4px;
}

.altaz-stack {
  position: relative;
  margin: 0 auto;
}

.altaz-aladin {
  border-radius: 50%;
  overflow: hidden;
}

.altaz-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 环形图容器 */
.altaz-ring {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
}

/* 三层同心圆 */
.ring-outer {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 100%;
  border-radius: 50%;
  border: 1px solid #1a3a1a;
}
.ring-mid {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px solid #0f2a0f;
}
.ring-inner {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px solid #0f2a0f;
  background: radial-gradient(circle, #081008 0%, #020502 100%);
}

/* 十字线 */
.cross-h, .cross-v {
  position: absolute;
  background: #0f2a0f;
}
.cross-h {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}
.cross-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

/* NESW 标签 */
.altaz-labels {
  position: relative;
  height: 0;
}
.altaz-label {
  position: absolute;
  font-size: 10px;
  color: #1a5a1a;
  transform: translate(-50%, -50%);
}
.label-n { top: 6px;  left: 50%; }
.label-e { top: 50%;  right: 4px; transform: translate(50%, -50%); }
.label-s { bottom: 2px; left: 50%; }
.label-w { top: 50%;  left: 4px; }

/* 目标光点 */
.altaz-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #33ff33;
  box-shadow: 0 0 8px #33ff33;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* 数值行 */
.altaz-row {
  display: flex;
  justify-content: space-around;
  font-size: 13px;
  color: #33ff33;
  margin-top: 4px;
}

/* ===== 中央: CRT 日志 ===== */
#crt-panel {
  padding: 8px;
  background: #08080a;
  border: 1px solid #222;
  border-radius: 6px;
  min-height: 0;
}

.crt-bezel {
  width: 100%;
  height: 100%;
  background: #1a1a1e;
  border: 3px solid #2a2a30;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.8),
    0 0 10px rgba(0,0,0,0.5);
  min-height: 0;
}

.crt-screen {
  flex: 1;
  width: 100%;
  background: #001a00;
  border: 2px solid #0a2a0a;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}
.crt-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.08) 3px,
    rgba(0,0,0,0.08) 6px
  );
  pointer-events: none;
  border-radius: 6px;
}

.crt-label {
  font-size: 12px;
  color: #1a5a1a;
  letter-spacing: 3px;
  margin-bottom: 8px;
  border-bottom: 1px solid #1a3a1a;
  padding-bottom: 4px;
}

.crt-content {
  flex: 1;
  color: #33ff33;
  font-family: 'Microsoft YaHei', '微软雅黑', monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-y: auto;
  overflow-x: hidden;
}
  overflow-y: auto;
}

.crt-brand {
  margin-top: 8px;
  font-size: 11px;
  color: #333;
  letter-spacing: 2px;
}

/* ===== 右侧面板 ===== */
#right-panel {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.rpanel {
  background: #0a0a10;
  border: 1px solid #1a1a3a;
  border-radius: 4px;
  padding: 4px 8px;
}
.rpanel-title {
  font-size: 12px;
  color: #4488ff;
  letter-spacing: 2px;
  border-bottom: 1px solid #1a1a3a;
  padding-bottom: 2px;
  margin-bottom: 4px;
}
.rpanel-body {
  font-size: 13px;
  color: #aac;
  line-height: 1.6;
}

.val {
  color: #ffb000;
}

.target-layout {
  display: flex;
  gap: 8px;
}
.target-main {
  flex: 2;
}
.target-sun {
  flex: 1;
  border-left: 1px solid #1a1a3a;
  padding-left: 8px;
}

/* 曝光倒计时占位 */
.drum-ph {
  font-family: 'Courier New', monospace;
  color: #ffb000;
  font-size: 18px;
  text-align: center;
  padding: 6px;
}

/* 状态灯 */
.lamp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
}
.lamp {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lamp.green  { background: #33ff33; box-shadow: 0 0 4px #33ff33; }
.lamp.amber  { background: #ffaa00; box-shadow: 0 0 4px #ffaa00; }
.lamp.red    { background: #ff3333; box-shadow: 0 0 4px #ff3333; }
.lamp.off    { background: #333; box-shadow: none; }

/* 拨杆指示 */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.toggle {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 5px;
  flex-shrink: 0;
}
.toggle.on  { background: #33ff33; box-shadow: 0 0 4px #33ff33; }
.toggle.off { background: #333; box-shadow: none; }

/* CCD 区两个小指针表并排 */
.ccd-gauges {
  display: flex;
  justify-content: space-around;
  margin-top: 6px;
}
.mini-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 45%;
}
.mini-gauge .gauge-canvas {
  width: 100%;
}
.mini-gauge-label {
  font-size: 11px;
  color: #4488ff;
  margin-top: 2px;
}

/* TEMP 两列纯文本 */
.temp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 12px;
}

/* ===== 底部 ===== */
#bottom-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  padding: 4px 16px;
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  font-size: 13px;
  color: #888;
}
.bot-sep {
  color: #333;
}
