/* Scoped disaster weather UI. Canvas colors match the risk legend. */
body.vd-modal-open { overflow: hidden; }
.vd-overlay { position: fixed; inset: 0; z-index: 1300; display: flex; justify-content: center; align-items: center; padding: 24px; background: rgba(3, 12, 22, .76); backdrop-filter: blur(5px); color: #e9f3fa; font-family: 'Microsoft YaHei UI', 'PingFang SC', sans-serif; }
.vd-overlay *, .vd-damage-banner * { box-sizing: border-box; }
.vd-dialog { display: flex; flex-direction: column; width: min(900px, 100%); max-height: min(88vh, 960px); max-height: min(88dvh, 960px); min-width: 0; overflow: hidden; border: 1px solid #365269; border-radius: 20px; background: #101f2d; box-shadow: 0 28px 110px #0009; }
.vd-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 25px 26px 19px; background: linear-gradient(125deg, #17364a, #172435); border-bottom: 1px solid #33495d; flex-shrink: 0; }
.vd-eyebrow { color: #8abacb; font-size: 10px; font-weight: 700; letter-spacing: 2px; margin-bottom: 6px; }
.vd-header h2 { margin: 0; font-size: 25px; line-height: 1.4; color: #f4f8fa; }
.vd-header p { margin: 7px 0 0; font-size: 12px; color: #abc4d2; }
.vd-overlay button { appearance: none; cursor: pointer; font: inherit; color: #dcecf7; border: 1px solid #4a657b; background: #20394d; border-radius: 8px; min-height: 36px; padding: 6px 12px; }
.vd-overlay button:hover { background: #2c4b61; border-color: #8db6ce; }
.vd-overlay button:focus-visible, .vd-table-scroll:focus-visible { outline: 3px solid #8edcfa; outline-offset: 3px; }
.vd-overlay .vd-close { font-size: 13px; line-height: 1; min-width: 72px; min-height: 44px; padding: 0 10px; white-space: nowrap; flex-shrink: 0; }
.vd-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 25px; gap: 12px; border-bottom: 1px solid #2a4052; color: #abc4d2; font-size: 12px; flex-shrink: 0; }
.vd-body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 25px 24px; min-height: 0; scrollbar-gutter: stable; }
.vd-events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vd-event { --vd-risk: #f1ce54; min-width: 0; padding: 18px; border: 1px solid #344a5b; border-top: 3px solid var(--vd-risk); border-radius: 12px; background: #162a3a; }
.vd-risk-medium { --vd-risk: #ff9d45; }.vd-risk-high { --vd-risk: #ff626b; }.vd-risk-extreme { --vd-risk: #c18aff; }
.vd-event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vd-ocean { font-size: 11px; color: #a9c5d4; letter-spacing: 1px; }
.vd-event h3 { margin: 5px 0 0; font-size: 19px; line-height: 1.4; color: #f1f7fb; overflow-wrap: anywhere; }
.vd-risk { color: var(--vd-risk); border: 1px solid var(--vd-risk); padding: 3px 7px; font-size: 11px; white-space: nowrap; border-radius: 5px; }
.vd-phase { margin: 10px 0 14px; color: var(--vd-risk); font-size: 12px; }
.vd-details { margin: 0; font-size: 12px; display: grid; gap: 10px; }
.vd-details > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.vd-details dt { flex-shrink: 0; color: #9fb7c7; }.vd-details dd { margin: 0; text-align: right; color: #e4eef5; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }.vd-details .vd-location { color: #a9e3dd; font-weight: 600; line-height: 1.5; }
.vd-countdown { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin: 17px 0 13px; padding: 11px 10px; background: #0b1d2b; border-radius: 7px; font-size: 12px; color: #b2c6d4; }
.vd-countdown strong { font-size: 20px; color: var(--vd-risk); letter-spacing: 1px; font-variant-numeric: tabular-nums; }.vd-countdown small { color: #9ab6c7; font-size: 10px; }
.vd-effect { color: #d3e5ee; font-size: 12px; line-height: 1.7; margin: 0 0 10px; overflow-wrap: anywhere; }
.vd-warnings { padding-left: 17px; margin: 0; font-size: 12px; line-height: 1.8; color: #a9c1d0; }.vd-warnings li { overflow-wrap: anywhere; }
.vd-table-section { margin-top: 25px; }.vd-table-section h3 { font-size: 15px; margin: 0 0 12px; color: #dcebf5; }
.vd-table-scroll { overflow-x: auto; border: 1px solid #344a5b; border-radius: 9px; }
.vd-table-scroll table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: 12px; text-align: left; }
.vd-table-scroll th, .vd-table-scroll td { padding: 11px 12px; border-bottom: 1px solid #304655; line-height: 1.6; }
.vd-table-scroll thead th { background: #1d3547; color: #b8d0de; font-weight: 500; white-space: nowrap; }
.vd-table-scroll tbody th { color: #e0edf5; font-weight: 400; }.vd-table-scroll tr:last-child > * { border-bottom: 0; }.vd-table-scroll td { color: #bcd0dc; }
.vd-note { font-size: 11px; color: #9fb8c8; line-height: 1.7; margin: 9px 0 0; }
.vd-footer { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 23px; padding-top: 18px; border-top: 1px solid #31495c; font-size: 11px; color: #b7cbd8; }
.vd-footer > span { display: inline-flex; gap: 6px; align-items: center; }.vd-footer p { flex-basis: 100%; line-height: 1.8; margin: 0; color: #94aebe; }
.vd-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }.vd-low { background: #f1ce54; }.vd-medium { background: #ff9d45; }.vd-high { background: #ff626b; }.vd-extreme { background: #c18aff; }
.vd-status { border: 1px solid #3a556b; background: #192f40; border-radius: 10px; padding: 20px; margin: 0 0 16px; color: #bfd2de; line-height: 1.8; font-size: 14px; }
.vd-damage-banner { position: fixed; z-index: 1400; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: #3e2430; border: 1px solid #ec8a8f; border-radius: 12px; box-shadow: 0 8px 40px #0006; color: #ffe0dd; font: 13px/1.7 'Microsoft YaHei UI', sans-serif; }
.vd-damage-banner span { overflow-wrap: anywhere; }.vd-damage-banner button { appearance: none; font: inherit; color: #ffe0dd; background: #603442; padding: 7px 10px; border: 1px solid #c7898b; border-radius: 6px; white-space: nowrap; cursor: pointer; min-height: 36px; }.vd-damage-banner button:focus-visible { outline: 3px solid #ffc6c1; outline-offset: 3px; }
@media (max-width: 620px) {
  .vd-overlay { padding: 10px; align-items: center; }.vd-dialog { max-height: 94vh; max-height: 94dvh; border-radius: 14px; }.vd-header { padding: 20px 16px 16px; }.vd-header h2 { font-size: 22px; }.vd-toolbar { padding: 10px 16px; }.vd-body { padding: 16px; }.vd-events { grid-template-columns: minmax(0, 1fr); gap: 13px; }.vd-event { padding: 15px; }.vd-footer { gap: 10px; }.vd-damage-banner { bottom: max(12px, env(safe-area-inset-bottom)); padding: 12px; gap: 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .vd-overlay *, .vd-damage-banner * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* 当前海域预警：置顶 + 方框持续闪动 + 标题内红色 ATTENTION */
.vd-event.vd-current{border-color:#ff626b;box-shadow:0 0 0 1px rgba(255,98,107,.5);animation:vd-current-flash 1.15s ease-in-out infinite}
@keyframes vd-current-flash{0%,100%{border-color:#ff626b;box-shadow:0 0 0 1px rgba(255,98,107,.35)}50%{border-color:#ff9aa0;box-shadow:0 0 16px 2px rgba(255,98,107,.7)}}
.vd-event.vd-current .vd-ocean{color:#ffd9dc}
.vd-attention{display:inline-block;margin-left:8px;padding:1px 7px;border-radius:4px;background:rgba(255,77,77,.12);color:#ff4d4d;font-size:12px;font-weight:800;letter-spacing:.14em;vertical-align:middle;text-shadow:0 0 8px rgba(255,77,77,.55);animation:vd-attention-blink 1s steps(2,start) infinite}
@keyframes vd-attention-blink{0%,100%{opacity:1}50%{opacity:.4}}

/* ---- Relative ship / hazard inset ---- */
.vd-event-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.vd-event-body.has-rel { grid-template-columns: minmax(0, 1fr) 104px; }
.vd-event-body.has-rel .vd-details { gap: 8px; }
.vd-rel { min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.vd-rel svg { display: block; width: 100%; height: auto; border: 1px solid rgba(126, 199, 214, .26); border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(30, 74, 96, .55), rgba(8, 26, 39, .72) 68%); }
.vd-rel-ring { fill: none; stroke: rgba(150, 205, 225, .34); stroke-width: 1; stroke-dasharray: 2 3; }
.vd-rel-ticks { fill: none; stroke: rgba(170, 220, 240, .45); stroke-width: 1; }
.vd-rel-cross { fill: none; stroke: rgba(126, 199, 214, .14); stroke-width: .8; stroke-dasharray: 2 4; }
.vd-rel-link { stroke: rgba(226, 244, 255, .42); stroke-width: 1; stroke-dasharray: 2 3; }
.vd-rel-zone { fill-opacity: .18; stroke-width: 1.4; stroke-dasharray: 3 3; }
.vd-rel-zone.is-overlap { fill-opacity: .3; stroke-width: 1.8; }
.vd-rel-core { opacity: .9; }
.vd-rel-ship-ring { fill: rgba(142, 230, 200, .12); stroke: rgba(142, 230, 200, .52); stroke-width: .8; }
.vd-rel-ship path { fill: #8ee6c8; stroke: #072434; stroke-width: 1.1; filter: drop-shadow(0 0 3px rgba(142, 230, 200, .85)); }
.vd-rel-tag { fill: #dff4ef; font-size: 7.5px; font-weight: 600; letter-spacing: .08em; paint-order: stroke; stroke: #081b28; stroke-width: 2px; stroke-linejoin: round; }
.vd-rel-caption { margin: 0; font-size: 9px; line-height: 1.34; color: #9fb8c8; text-align: center; font-variant-numeric: tabular-nums; }
.vd-rel-caption b { display: flex; align-items: center; justify-content: center; gap: 5px; font-weight: 500; color: #c8dce8; white-space: nowrap; }
.vd-rel-caption b i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 1px; }
.vd-rel-key-ship { background: #8ee6c8; box-shadow: 0 0 5px rgba(142, 230, 200, .7); }
.vd-rel-caption span { display: block; white-space: normal; overflow-wrap: anywhere; }
.vd-rel.is-hit .vd-rel-zone { animation: vd-rel-overlap 1.25s ease-in-out infinite; }
@keyframes vd-rel-overlap { 50% { fill-opacity: .4; stroke-width: 2.4; } }
@media (max-width: 620px) {
  .vd-event-body.has-rel { grid-template-columns: minmax(0, 1fr); }
  .vd-rel { flex-direction: row; align-items: center; gap: 8px; padding: 6px 7px; border: 1px solid rgba(126, 199, 214, .22); border-radius: 9px; background: rgba(8, 28, 42, .55); }
  .vd-rel svg { width: 84px; flex: none; border: 0; background: none; }
  .vd-rel-caption { text-align: left; min-width: 0; }
  .vd-rel-caption b { justify-content: flex-start; }
}
