/* ========== 综合驾驶舱三栏环抱式布局 ========== */
#page-cockpit.active { display: grid !important; grid-template-columns: 1fr; gap: 0; padding: 0; }

.cockpit-crown {
  grid-column: 1 / -1; padding: 18px 24px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.08) 0%, rgba(0, 240, 255, 0.04) 50%, rgba(0, 240, 255, 0.08) 100%);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.cockpit-crown-title {
  flex: 1; text-align: center; font-size: 18px; font-weight: 600; letter-spacing: 3px;
  background: linear-gradient(90deg, #00F0FF 0%, #00F0FF 50%, #00F0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cockpit-crown-title::before, .cockpit-crown-title::after { content: '—'; display: inline; margin: 0 12px; opacity: 0.6; }
.cockpit-crown-title-en { display: block; font-size: 12px; margin-top: 4px; font-family: 'Inter', 'JetBrains Mono', monospace; letter-spacing: 2px; color: rgba(0, 240, 255, 0.6); }

.cockpit-gis-btn { padding: 8px 16px; background: rgba(0, 240, 255, 0.15); color: #00F0FF; border: 1px solid rgba(0, 240, 255, 0.4); border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.28s ease; white-space: nowrap; }
.cockpit-gis-btn:hover { background: rgba(0, 240, 255, 0.28); box-shadow: 0 0 12px rgba(0, 240, 255, 0.4); }

/* ========== 三栏主体 ========== */
.cockpit-main { grid-column: 1 / -1; display: grid; grid-template-columns: 24% 52% 24%; gap: 16px; padding: 16px 16px 0; align-items: stretch; }

.cockpit-left, .cockpit-center, .cockpit-right { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.cockpit-left { padding-right: 8px; }
.cockpit-right { padding-left: 8px; }

.cockpit-left .card, .cockpit-center .card, .cockpit-right .card {
  background: rgba(22, 25, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 14px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.22), 0 8px 32px rgba(0, 0, 0, 0.45);
}
.cockpit-left .card { flex-shrink: 0; }
/* 左右栏末卡吸收余量，三栏底边平齐 */
.cockpit-left > .card:last-child, .cockpit-right > .card:last-child { flex-grow: 1; }

.cockpit-left .card-title, .cockpit-center .card-title, .cockpit-right .card-title {
  font-size: 16px; font-weight: 600; margin-bottom: 10px;
  background: linear-gradient(90deg, #00F0FF 0%, #00F0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.cockpit-left .card-title::before, .cockpit-center .card-title::before, .cockpit-right .card-title::before { content: '▍'; margin-right: 6px; opacity: 0.8; }
.card-title-en { display: inline-block; font-size: 10px; margin-left: 8px; letter-spacing: 1px; color: rgba(0, 240, 255, 0.5); font-family: 'Inter', monospace; }

/* 左栏内容 */
.profile-brief, .staff-duty { font-size: 12px; line-height: 1.8; color: #F4F4F5; }
.profile-brief-item, .staff-duty-item { display: flex; justify-content: space-between; padding: 4px 0; }

.iot-telemetry { display: flex; gap: 12px; }
.iot-telemetry-col { flex: 1; }
.iot-telemetry-label { font-size: 11px; color: #A1A1AA; margin-bottom: 4px; }
.iot-telemetry-value { font-size: 14px; font-weight: 600; color: #00F0FF; font-family: 'JetBrains Mono', monospace; }
.iot-live-badge { display: inline-block; margin-top: 4px; padding: 2px 6px; background: rgba(239, 68, 68, 0.2); color: #f87171; font-size: 10px; border-radius: 3px; animation: breathLive 1.2s ease-in-out infinite; }

.valve-matrix { font-size: 12px; }
.valve-group { margin-bottom: 10px; }
.valve-group-title { font-size: 11px; color: #A1A1AA; margin-bottom: 6px; }
.valve-switches { display: flex; gap: 4px; flex-wrap: wrap; }

.valve-switch {
  width: 20px; height: 20px; border-radius: 50%; background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.5);
  cursor: pointer; transition: all 0.28s ease; position: relative;
}
.valve-switch::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: rgba(16, 185, 129, 0.8); opacity: 0.8; }
.valve-switch.open { background: rgba(16, 185, 129, 0.3); border-color: #10B981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.valve-switch.closed { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.6); }
.valve-switch.closed::after { background: rgba(239, 68, 68, 0.8); }

/* 中栏内容 */
/* 中栏纵向分配：全景吃掉富余高度，四联实景定高，灌溉进度按内容收口 */
.cockpit-center .card { flex: 0 0 auto; min-height: 0; }
.cockpit-center .card.visual-monitor { flex: 1 1 0%; min-height: 420px; display: flex; flex-direction: column; }
.cockpit-center .card.snapshot-card { flex: 0 0 185px; display: flex; flex-direction: column; }
.cockpit-center .card.irrigation-card { flex: 0 0 auto; height: auto !important; min-height: 0 !important; padding: 14px 18px; }
.visual-monitor-tabs { display: flex; gap: 4px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(0, 240, 255, 0.1); }
.visual-monitor-tab {
  padding: 6px 12px; font-size: 11px; background: rgba(0, 240, 255, 0.08); color: #A1A1AA;
  border: none; border-radius: 4px; cursor: pointer; transition: all 0.28s ease;
}
.visual-monitor-tab.active { background: rgba(0, 240, 255, 0.2); color: #00F0FF; }

.visual-monitor-viewer {
  flex: 1; min-height: 0; background: rgba(0, 0, 0, 0.3); border-radius: 6px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.visual-monitor-viewer img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 12%;
  transform: scale(1.15); display: block;
}
/* 本地交互式全景漫游舱：145% 超采样画布，JS 写 transform 实现巡航/拖拽/缩放 */
#cockpitHeroStage { cursor: grab; user-select: none; }
#cockpitHeroStage.dragging { cursor: grabbing; }
#cockpitHeroStage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2; box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.7); background: radial-gradient(ellipse at 50% 40%, rgba(0, 240, 255, 0.05), transparent 65%); }
.pano-canvas { position: absolute; left: -22.5%; top: -22.5%; width: 145%; height: 145%; display: none; will-change: transform; transform-origin: center; }
#cockpitHeroStage.is-pano .pano-canvas { display: block; }
#cockpitHeroStage.is-pano .pano-fallback { display: none; }
#cockpitHeroStage .pano-img { width: 100%; height: 100%; object-fit: cover; object-position: center 0%; transform: none; filter: contrast(1.08) saturate(1.12) brightness(0.92); pointer-events: none; }
/* AR 热点标牌 + 声呐波纹 */
.pano-spot { position: absolute; z-index: 3; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none; border: 0; cursor: pointer; }
.pano-spot span { order: -1; padding: 5px 10px; font-size: 12px; white-space: nowrap; color: #E4E4E7; background: rgba(14, 19, 31, 0.78); border: 1px solid rgba(0, 240, 255, 0.45); border-radius: 6px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
.pano-spot:hover span { border-color: #00F0FF; color: #FFFFFF; box-shadow: 0 0 14px rgba(0, 240, 255, 0.45); }
.pano-spot.live span { border-color: rgba(16, 185, 129, 0.6); }
.pano-sonar { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #00F0FF; box-shadow: 0 0 8px #00F0FF; }
.pano-spot.live .pano-sonar { background: #10B981; box-shadow: 0 0 8px #10B981; }
.pano-sonar::before, .pano-sonar::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid currentColor; color: inherit; animation: panoSonar 2.4s ease-out infinite; border-color: rgba(0, 240, 255, 0.7); }
.pano-sonar::after { animation-delay: 1.2s; }
@keyframes panoSonar { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }
/* 左下角罗盘 + 重置 */
.pano-compass { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: none; align-items: center; gap: 8px; padding: 6px 10px; font-size: 11px; color: #00F0FF; font-family: 'JetBrains Mono', monospace; background: rgba(14, 19, 31, 0.72); border: 1px solid rgba(0, 240, 255, 0.3); border-radius: 4px; backdrop-filter: blur(8px); }
#cockpitHeroStage.is-pano .pano-compass { display: flex; }
.pano-reset-btn { padding: 2px 8px; font-size: 11px; color: #A1A1AA; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 3px; cursor: pointer; }
.pano-reset-btn:hover { color: #00F0FF; border-color: rgba(0, 240, 255, 0.5); }
.visual-monitor-hud {
  position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; align-items: center; gap: 8px; pointer-events: none;
}
#visualMonitorHud {
  background: rgba(22, 25, 34, 0.72); border: 1px solid rgba(0, 240, 255, 0.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 7px 12px; border-radius: 4px; font-size: 11px; color: #00F0FF;
}
.pano-fullscreen-btn {
  pointer-events: auto; padding: 7px 12px; border-radius: 4px; font-size: 11px; cursor: pointer; white-space: nowrap;
  color: #00F0FF; background: rgba(0, 240, 255, 0.14); border: 1px solid rgba(0, 240, 255, 0.45); backdrop-filter: blur(10px);
}
.pano-fullscreen-btn:hover { background: rgba(0, 240, 255, 0.28); box-shadow: 0 0 12px rgba(0, 240, 255, 0.4); }
.visual-monitor-viewer:not(.is-pano) .pano-fullscreen-btn { display: none; }

.field-snapshots { display: flex; flex-direction: row; gap: 10px; flex: 1; min-height: 0; }
.field-snapshot-card { flex: 1; min-width: 0; background: rgba(0, 0, 0, 0.3); border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.2s; position: relative; border: 1px solid rgba(0, 240, 255, 0.22); }
.field-snapshot-card img { width: 100%; height: 100%; object-fit: cover; display: block; filter: brightness(0.88) contrast(1.06); transition: transform 0.35s ease; }
.field-snapshot-card::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 8, 10,0.18) 0%, rgba(7, 8, 10,0.55) 55%, rgba(7, 8, 10,0.92) 100%); pointer-events: none;
}
.field-snapshot-label {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 8px; z-index: 2; background: linear-gradient(180deg, transparent 0%, rgba(7, 8, 10,0.95) 100%);
  display: flex; flex-direction: column; gap: 3px;
}
.field-snapshot-tag { display: inline-block; width: fit-content; padding: 2px 8px; background: rgba(0, 240, 255,0.25); color: #00F0FF; font-size: 8px; border-radius: 3px; }
.field-snapshot-title { font-size: 11px; font-weight: 600; color: #F4F4F5; }
.field-snapshot-desc { font-size: 9px; color: #A1A1AA; }
.field-snapshot-card:hover img { transform: scale(1.06); }
.field-snapshot-card:hover { border-color: rgba(0, 240, 255,0.5); box-shadow: 0 0 12px rgba(0, 240, 255,0.25); }

.irrigation-timeline { padding: 10px 0; }
.irrigation-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.irrigation-days { min-width: 60px; text-align: center; font-size: 16px; font-weight: 600; color: #00F0FF; font-family: 'JetBrains Mono', monospace; }

.irrigation-bar { flex: 1; height: 24px; background: rgba(0, 240, 255, 0.1); border-radius: 4px; overflow: hidden; position: relative; }
.irrigation-bar-fill { height: 100%; width: 68%; background: linear-gradient(90deg, #00F0FF 0%, #00F0FF 100%); border-radius: 4px; box-shadow: 0 0 12px rgba(0, 240, 255, 0.5); }

.irrigation-timeline-dots { display: flex; justify-content: space-between; font-size: 10px; color: #A1A1AA; margin-top: 8px; }
.timeline-dot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.timeline-dot-mark { width: 8px; height: 8px; border-radius: 50%; background: rgba(0, 240, 255, 0.4); transition: all 0.28s ease; }
.timeline-dot.active .timeline-dot-mark { width: 12px; height: 12px; background: #00F0FF; box-shadow: 0 0 8px rgba(0, 240, 255, 0.6); }

/* 右栏内容 */
.zone-storage { font-size: 12px; line-height: 2; }
.zone-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zone-label { width: 50px; color: #A1A1AA; }
.zone-bar { flex: 1; height: 16px; background: rgba(0, 240, 255, 0.1); border-radius: 3px; overflow: hidden; }
.zone-bar-fill { height: 100%; background: linear-gradient(90deg, #00F0FF 0%, #00F0FF 100%); border-radius: 3px; }
.zone-percent { width: 35px; text-align: right; color: #00F0FF; font-family: 'JetBrains Mono', monospace; }

.recent-link { font-size: 12px; line-height: 1.8; }
.recent-link-item { padding: 6px 0; display: flex; justify-content: space-between; }
.recent-link-value { color: #00F0FF; font-family: 'JetBrains Mono', monospace; }
.recent-updates { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(0, 240, 255, 0.1); font-size: 11px; line-height: 1.6; color: #A1A1AA; max-height: 80px; overflow-y: auto; }

.mini-gis { position: relative; background: rgba(0, 0, 0, 0.2); border-radius: 6px; overflow: hidden; min-height: 120px; }
.mini-gis img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-gis-click { position: absolute; inset: 0; cursor: pointer; transition: all 0.28s ease; }
.mini-gis-click:hover { background: rgba(0, 240, 255, 0.1); }

@keyframes breathLive { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

/* ========== 视图隐藏最高优先级锁：#id:not(.active) 权重 (1,1,0) 压过任何 #page-cockpit 显示规则 ========== */
.content-wrap > .page:not(.active),
.content-wrap > .page[hidden] { display: none !important; }
#page-cockpit:not(.active) { display: none !important; }
