/* Typhoon Dashboard - Dark Big Screen Theme */

* { box-sizing: border-box; }

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.header-bar {
  height: 52px;
  flex-shrink: 0;
  padding: 0 20px;
  border-bottom: 1px solid #334155;
  background: linear-gradient(180deg, #0f172a 0%, #0a0f1a 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.header-left {
  justify-self: start;
  min-width: 0;
}

.header-center {
  justify-self: center;
  min-width: 0;
}

.header-right {
  justify-self: end;
  min-width: 0;
}

.visit-count {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.typhoon-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.typhoon-header-placeholder {
  font-size: 14px;
  color: #64748b;
}

.typhoon-header-number {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.typhoon-header-name {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.typhoon-header-name-en {
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
}

.typhoon-header-divider {
  width: 1px;
  height: 18px;
  background: #334155;
}

.typhoon-header-wind {
  font-size: 20px;
  font-weight: 700;
  color: #22d3ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.typhoon-header-level {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.typhoon-header-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.typhoon-header-switch-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.typhoon-header-select {
  appearance: none;
  min-width: 168px;
  max-width: 240px;
  padding: 6px 32px 6px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.typhoon-header-select:hover {
  border-color: #475569;
}

.typhoon-header-select:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}

.typhoon-header-select option {
  background: #0f172a;
  color: #e2e8f0;
}

.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr 380px;
  overflow: hidden;
}

.left-panel, .right-panel {
  background: #0c1222;
  overflow: hidden;
  min-width: 0;
}

.center-panel {
  background: #0a0e17;
  overflow: hidden;
}

.panel-header {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Typhoon List */
.typhoon-list {
  padding: 8px;
  flex: 1;
  min-height: 0;
}

/* Left panel: metrics & charts (full height) */
.analysis-viz-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a0f1a 0%, #0c1222 100%);
}

.analysis-viz-panel-header {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #1e293b;
}

.analysis-viz-panel .analysis-viz-root {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 12px;
}

.analysis-viz-panel .analysis-overview-title {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.analysis-viz-panel .analysis-metric-value {
  font-size: 17px;
}

.analysis-viz-panel .chart-canvas-wrap {
  height: 140px;
}

.analysis-viz-panel .chart-canvas-wrap.chart-canvas-short {
  height: 120px;
}

.analysis-viz-panel .analysis-charts {
  gap: 8px;
}

.analysis-viz-panel .chart-card {
  padding: 8px 8px 4px;
}

.analysis-viz-panel .analysis-metrics-grid {
  gap: 6px;
  margin-bottom: 10px;
}

.analysis-viz-panel .analysis-metric-card {
  padding: 8px 10px;
}

.typhoon-item {
  padding: 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  background: #111827;
}

.typhoon-item:hover {
  border-color: #334155;
  background: #1a2332;
}

.typhoon-item.active {
  border-color: #06b6d4;
  background: #0c2a3a;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.typhoon-item .name {
  font-weight: 600;
  font-size: 14px;
  color: #e2e8f0;
}

.typhoon-item .meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.typhoon-item .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.badge-ty { background: #7f1d1d; color: #fca5a5; }
.badge-sty { background: #991b1b; color: #fecaca; }
.badge-ts { background: #92400e; color: #fde68a; }
.badge-sts { background: #b45309; color: #fef3c7; }
.badge-td { background: #374151; color: #d1d5db; }
.badge-default { background: #1e3a5f; color: #93c5fd; }

/* Info Panel */
.info-panel .metric {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #1e293b;
  font-size: 13px;
}

.info-panel .metric-label { color: #64748b; }
.info-panel .metric-value { color: #e2e8f0; font-weight: 500; font-family: monospace; }

/* Map */
.map-wrapper {
  min-height: 0;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-container {
  height: 100%;
  width: 100%;
  position: absolute;
  inset: 0;
  z-index: 1;
}

#map {
  height: 100%;
  width: 100%;
  background: #aadaff;
}

.mapTypeList {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 999;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.mapTypeList li {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  color: #333;
}

.mapTypeList li.cur {
  background: #0066cc;
  color: #fff;
}

/* ===== AI 动态播报（地图右侧） ===== */

.ai-broadcast-panel {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 998;
  width: 300px;
  max-height: min(32vh, 280px);
  display: flex;
  flex-direction: column;
  background: rgba(8, 16, 32, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  pointer-events: auto;
}

.ai-broadcast-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(8, 16, 32, 0.4) 100%);
}

.ai-broadcast-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}

.ai-broadcast-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-broadcast-more-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.ai-broadcast-more-btn:hover {
  color: #e2e8f0;
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(14, 116, 144, 0.25);
}

.ai-broadcast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  animation: broadcast-pulse 2s ease-in-out infinite;
}

@keyframes broadcast-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.ai-broadcast-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-gutter: stable;
}

.ai-broadcast-feed::-webkit-scrollbar {
  width: 5px;
}

.ai-broadcast-feed::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

.ai-broadcast-empty {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 24px 8px;
}

.ai-broadcast-item {
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

.ai-broadcast-item.is-latest {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(14, 116, 144, 0.15);
}

.ai-broadcast-time {
  display: block;
  font-size: 10px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 6px;
}

.ai-broadcast-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 6px;
}

.ai-broadcast-meta .ai-broadcast-time {
  display: inline;
  margin-bottom: 0;
  color: #94a3b8;
  font-weight: 500;
}

.ai-broadcast-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: #cbd5e1;
  text-align: justify;
}

/* 播报历史弹层 — 全屏居中 */
.ai-broadcast-history {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.ai-broadcast-history:not(.is-hidden) {
  pointer-events: auto;
}

.ai-broadcast-history.is-hidden {
  display: none;
}

.ai-broadcast-history-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.ai-broadcast-history-panel {
  position: relative;
  z-index: 1;
  width: min(600px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  background: rgba(8, 16, 32, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.ai-broadcast-history-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.ai-broadcast-history-close {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ai-broadcast-history-close:hover {
  background: rgba(148, 163, 184, 0.28);
}

.ai-broadcast-history-list {
  flex: 0 1 auto;
  min-height: 0;
  /* ~3 cards visible: card padding + time + ~2 lines text, plus gaps */
  max-height: min(42vh, calc(3 * (24px + 19px + 2.8em) + 2 * 10px + 24px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.ai-broadcast-history-list::-webkit-scrollbar {
  width: 5px;
}

.ai-broadcast-history-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}

.ai-broadcast-history-list .ai-broadcast-item {
  flex-shrink: 0;
  padding: 12px 14px;
}

.ai-broadcast-history-list .ai-broadcast-item:not(.is-latest) {
  opacity: 0.92;
}

.ai-broadcast-history-list .ai-broadcast-time {
  font-size: 11px;
  margin-bottom: 0;
}

.ai-broadcast-history-list .ai-broadcast-meta {
  margin-bottom: 8px;
}

.ai-broadcast-history-list .ai-broadcast-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
  font-size: 13px;
  line-height: 1.7;
  color: #e2e8f0;
}

/* ===== 地图图层按钮 — 与大屏深色主题统一 ===== */

.rightTopBtnList {
  position: absolute;
  right: 12px;
  top: 48px;
  z-index: 999;
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

.rightTopBtnList li {
  width: 52px;
  cursor: pointer;
  margin: 0;
  position: relative;
  z-index: 1001;
  pointer-events: auto;
}

.layer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 52px;
  height: 58px;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.55);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.layer-btn-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
}

.layer-btn-icon svg {
  width: 22px;
  height: 22px;
}

.layer-btn-label {
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.rightTopBtnList li.loading .layer-btn {
  opacity: 0.45;
  pointer-events: none;
}

.rightTopBtnList li:hover .layer-btn {
  background: rgba(26, 35, 50, 0.95);
  border-color: rgba(148, 163, 184, 0.25);
  transform: translateY(-1px);
}

.rightTopBtnList li:hover .layer-btn-icon,
.rightTopBtnList li:hover .layer-btn-label {
  color: #e2e8f0;
}

.rightTopBtnList li.cur .layer-btn {
  background: rgba(6, 182, 212, 0.14);
  border-color: #06b6d4;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.22);
}

.rightTopBtnList li.cur .layer-btn-icon,
.rightTopBtnList li.cur .layer-btn-label {
  color: #22d3ee;
}

/* 浮动播放器面板 */
.layer-fade {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 1001;
  pointer-events: none;
}

.layer-panel.white_content {
  display: none;
  position: absolute;
  top: 8px;
  left: 2%;
  width: 96%;
  z-index: 1002;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  padding: 0 12px 8px;
  box-sizing: border-box;
}

.topDiv {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topTitle {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.sendDate {
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.layer-close {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  opacity: 0.8;
  cursor: pointer;
  padding: 0 4px;
}

.layer-close:hover {
  opacity: 1;
}

.bottomDiv {
  width: 100%;
  height: 50px;
}

.timeLabelDiv {
  height: 18px;
  width: 100%;
  position: relative;
}

.timeLabel {
  height: 100%;
  position: relative;
}

.handleDiv {
  width: 20px;
  position: absolute;
  top: 0;
  left: 9%;
  transition: left 0.15s ease;
  cursor: grab;
}

.handle-icon {
  display: block;
  width: 16px;
  height: 16px;
  background: #ffd801;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.player {
  display: flex;
  align-items: center;
  width: 100%;
  height: 32px;
}

.playerBtn {
  width: 10%;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.playerBtn.dis {
  display: none;
}

.playerLi {
  flex: 1;
  padding-top: 8px;
  overflow: hidden;
}

.playerLi ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  width: 100%;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.playerLi li {
  flex: 1;
  height: 12px;
  border-left: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
}

.playerLi li.noLeftBorder {
  border-left: none;
}

.playerLi li.curBorderBottom {
  border-bottom: 2px solid #ffd801;
}

.icon-play-top::after { content: '⏮'; color: #fff; font-size: 14px; }
.icon-play-end::after { content: '⏭'; color: #fff; font-size: 14px; }
.icon-play::after { content: '▶'; color: #fff; font-size: 14px; }
.icon-stop::after { content: '⏸'; color: #fff; font-size: 14px; }

.map-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
  padding: 24px;
  line-height: 1.8;
}

.map-error a {
  color: #06b6d4;
}

/* 风场 — 参考站叠层：色斑半透明覆盖，粒子流线自下透出 */
#map.wind-field-active {
  filter: brightness(0.92) saturate(1.05);
}

#map canvas.maskLayer {
  z-index: 2 !important;
  opacity: 1;
}

#map canvas.particleLayer {
  z-index: 1 !important;
}

/* 台风路径点位弹窗 — 偏移显示，不遮挡风圈与路径点 */
.typhoon-popup-layer {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.typhoon-popup-layer:not(.is-hidden) {
  pointer-events: auto;
}

.typhoon-popup-layer.is-hidden {
  display: none;
}

.typhoon-popup-card {
  position: relative;
  width: 280px;
}

.typhoon-map-popup {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.typhoon-map-popup-tail {
  position: absolute;
  width: 0;
  height: 0;
}

/* 默认：弹窗在点位右上方，箭头指向左下 */
.typhoon-popup-layer[data-placement="top-right"] .typhoon-map-popup-tail,
.typhoon-popup-layer:not([data-placement]) .typhoon-map-popup-tail {
  left: 20px;
  bottom: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #fff;
}

.typhoon-popup-layer[data-placement="top-left"] .typhoon-map-popup-tail {
  right: 20px;
  left: auto;
  bottom: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #fff;
}

.typhoon-popup-layer[data-placement="bottom-right"] .typhoon-map-popup-tail {
  left: 20px;
  top: -7px;
  bottom: auto;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #fff;
  border-top: none;
}

.typhoon-popup-layer[data-placement="bottom-left"] .typhoon-map-popup-tail {
  right: 20px;
  left: auto;
  top: -7px;
  bottom: auto;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #fff;
  border-top: none;
}

.typhoon-map-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
}

.typhoon-map-popup-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.typhoon-map-popup-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.typhoon-map-popup-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.typhoon-map-popup-body {
  background: #fff;
  padding: 10px 12px 12px;
}

.typhoon-popup-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  line-height: 1.5;
}

.typhoon-popup-row:last-child {
  border-bottom: none;
}

.typhoon-popup-label {
  flex-shrink: 0;
  width: 56px;
  color: #64748b;
}

.typhoon-popup-value {
  flex: 1;
  color: #0f172a;
  word-break: break-word;
}

.typhoon-popup-location {
  line-height: 1.55;
}

.typhoon-popup-coords {
  color: #94a3b8;
  font-size: 11px;
}

.typhoon-popup-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.typhoon-popup-wind-circles {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.typhoon-popup-wind-circles table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  color: #b0b8c1;
}

.typhoon-popup-wind-circles td {
  padding: 3px 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.typhoon-popup-wind-circles tr:first-child td {
  color: #8899aa;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
}

.typhoon-popup-wind-circles td:first-child {
  text-align: left;
  color: #8899aa;
  font-weight: 500;
}

/* Satellite */
.satellite-panel {
  height: 200px;
  flex-shrink: 0;
}

.satellite-container {
  height: calc(100% - 37px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #060a12;
}

.satellite-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* AI Analysis */
.auto-analysis {
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
  min-width: 0;
  overflow-x: hidden;
}

.analysis-viz-root {
  margin-bottom: 4px;
}

.analysis-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.analysis-overview-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.analysis-overview-hint {
  font-size: 12px;
  color: #64748b;
  margin: 8px 0;
}

.analysis-level-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.analysis-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.analysis-metric-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
}

.analysis-metric-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.analysis-metric-value {
  font-size: 20px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  line-height: 1.2;
}

.analysis-metric-unit {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 2px;
}

.analysis-change-tag {
  font-size: 11px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
}

.analysis-charts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 10px 6px;
}

.chart-card-title {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.chart-canvas-wrap {
  position: relative;
  height: 140px;
}

.chart-canvas-wrap.chart-canvas-short {
  height: 120px;
}

.analysis-charts-empty {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 16px;
  background: #111827;
  border-radius: 8px;
  border: 1px dashed #334155;
  margin-bottom: 8px;
}

.analysis-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #334155, transparent);
  margin: 14px 0;
}

.analysis-text-block {
  padding-bottom: 8px;
  min-width: 0;
  max-width: 100%;
}

.analysis-text-heading {
  font-size: 12px;
  font-weight: 600;
  color: #06b6d4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Markdown 正文 — 研判报告 & 对话 */
.markdown-body {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #334155;
  line-height: 1.4;
}

.markdown-body h2 {
  font-size: 15px;
  font-weight: 600;
  color: #06b6d4;
  margin: 18px 0 8px;
  line-height: 1.45;
}

.markdown-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #38bdf8;
  margin: 14px 0 6px;
  line-height: 1.45;
}

.markdown-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: #7dd3fc;
  margin: 12px 0 4px;
  line-height: 1.45;
}

.markdown-body p {
  margin: 8px 0;
  line-height: 1.75;
}

.markdown-body hr {
  border: none;
  height: 1px;
  margin: 16px 0;
  background: linear-gradient(90deg, transparent, #475569, transparent);
}

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0;
  padding-left: 1.25em;
  list-style-position: outside;
}

.markdown-body ul {
  list-style-type: disc;
}

.markdown-body ol {
  list-style-type: decimal;
}

.markdown-body li {
  display: list-item;
  margin: 4px 0;
  line-height: 1.7;
  padding-left: 0.15em;
}

.markdown-body li > p {
  margin: 4px 0;
}

.markdown-body ul ul,
.markdown-body ol ol,
.markdown-body ul ol,
.markdown-body ol ul {
  margin: 4px 0;
}

.markdown-body strong,
.markdown-body b {
  color: #f1f5f9;
  font-weight: 600;
}

.markdown-body em,
.markdown-body i {
  color: #e2e8f0;
  font-style: italic;
}

.markdown-body blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid #06b6d4;
  background: rgba(6, 182, 212, 0.06);
  border-radius: 0 6px 6px 0;
  color: #94a3b8;
}

.markdown-body blockquote p {
  margin: 4px 0;
}

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: #1e293b;
  color: #fbbf24;
  word-break: break-all;
}

.markdown-body pre {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  overflow-x: auto;
  max-width: 100%;
}

.markdown-body pre code {
  padding: 0;
  background: none;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.markdown-body table {
  width: 100%;
  max-width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 12px;
  display: block;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  padding: 6px 8px;
  border: 1px solid #334155;
  text-align: left;
  word-break: break-word;
}

.markdown-body th {
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
}

.markdown-body tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.5);
}

.markdown-body a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body a:hover {
  color: #7dd3fc;
}

.analysis-markdown {
  font-size: 13px;
}

.chat-markdown {
  font-size: 13px;
}

.chat-markdown h1,
.chat-markdown h2,
.chat-markdown h3 {
  font-size: 13px;
  margin: 8px 0 4px;
  border: none;
  padding: 0;
}

.chat-markdown hr {
  margin: 8px 0;
}

/* Chat */
.chat-panel {
  height: 280px;
  flex-shrink: 0;
}

.chat-history {
  font-size: 13px;
}

.chat-msg {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.5;
  min-width: 0;
  overflow: hidden;
}

.chat-msg .content {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-msg.user {
  background: #1e3a5f;
  margin-left: 20px;
}

.chat-msg.assistant {
  background: #111827;
  margin-right: 20px;
}

.chat-msg .role {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #475569;
}

/* Loading & Empty States */
.loading-state, .empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #64748b;
  font-size: 13px;
}

.loading-state::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #334155;
  border-top-color: #06b6d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
