/**************************************************************************************************
 * At-Rules
 **************************************************************************************************/

@font-face {
    font-family: mplus-2p-light-sub;
    src: url("/styles/mplus-2p-light-sub.ttf?v6");
}

@font-face {
    font-family: monosocialiconsfont-sub;
    src: url("/styles/monosocialiconsfont-sub.ttf?v1");
}

/**************************************************************************************************
 * Styling Reset
 **************************************************************************************************/

html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, svg, canvas {
    margin: 0;
    padding: 0;
    border: 0;
    font: 1em Arial,sans-serif;
    -webkit-font-smoothing: subpixel-antialiased; /* safari disables subpixel antialiasing for some reason */
}

@media (max-width: 825px), (max-height: 700px) {
    html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, svg, canvas {
        font-size: 0.8em;
    }
}

/**************************************************************************************************
 * Page Styling
 **************************************************************************************************/

a, .text-button {
    color: #888888;
}

.text-button.highlighted {
    color: #e2b42e;
}

.text-button.disabled {
    color: #444444;
    cursor: default;
}

/* 置灰的按钮不要再有 hover 高亮和手型光标，否则看着仍像可点 */
.no-touch .text-button.disabled:hover,
.no-touch .text-button.disabled:focus,
.text-button.disabled:active {
    color: #444444;
    cursor: default;
}

a:hover, a:focus, .no-touch .text-button:hover, .no-touch .text-button:focus, .text-button:active {
    color: #ffffff;
    cursor: pointer;
    transition: color 125ms ease-in;
    -webkit-transition: color 125ms ease-in;
}

p.invisible, span.invisible, #sponsor.invisible {
    display: none;
}

/* ⚠️ 上面那条只覆盖 p / span / #sponsor，**对 SVG 元素无效**。
   时间轴的手柄、黄线（timeline-active）、区间色带都是 SVG，靠 classed("invisible")
   隐藏时如果不补这条规则，元素会一直留在画面上（表现为"切走后滑块/黄线还在"）。 */
svg .invisible {
    display: none;
}

svg {
    overflow: hidden;  /* Do not let IE draw outside the bounds of the svg element. */
}

body {
    color: #eeeeee;
    background: #000005;
}

#warn {
    font-size: 2.0em;
    position: absolute;
    top: 10%;
    left: 2%;
}

#display {
    cursor: default;
}

#map, #animation, #overlay, #foreground {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

#sponsor {
    position: absolute;
    text-align: right;
    bottom: 3%;
    right: 2%;
    background-color: rgba(0, 0, 5, 0.6);
    border-radius: 0.5rem/0.5rem;
    padding: 0.5rem 1rem 0.5rem 1rem;
    font-size: 1.0rem;
}

#sponsor:hover #sponsor-hide {
    display: inline;
}

#sponsor a {
    text-decoration: none;
}

#details {
    position: absolute;
    bottom: 3%;
    left: 2%;
    pointer-events: none;  /* This div is just a container--do not let it interfere with operation of the map. */
}

#earth {
    font-size: 2.4rem;
}

/* 左上角品牌区：logo + 出品单位。
   风格与 #details（半透明深色底 + 圆角）保持一致；字号刻意做小（署名感，不是主标题）。
   z-index 给 15，避开时间轴栏（20）的层级，也避开全屏 canvas 的覆盖。 */
#brand {
    position: fixed;
    top: 1.8%;
    left: 2%;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    background-color: rgba(0, 0, 5, 0.6);
    border-radius: 0.5rem / 0.5rem;
    z-index: 15;
    pointer-events: auto;        /* 内部链接可点 */
    user-select: none;
}
/* 每行 = 一个 logo + 它对应的出品单位 */
#brand .brand-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8rem;
    line-height: 1.3;
    color: #dfe9f3;
    letter-spacing: 0.02em;
}
/* 某行配了 href 时，整行包一层 <a>：沿用行的 flex 布局，去掉下划线、继承文字色 */
#brand .brand-row > a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: inherit;
    text-decoration: none;
}

#brand .brand-row > a:hover {
    text-decoration: underline;
}

/* 各 logo 原始比例不同，若按高度自适应会一宽一窄、右侧文字左边缘对不齐。
   这里固定同一个槽宽 + object-fit:contain，视觉上多行严格对齐。
   logo 都是透明底 + 纯白内容，在深色底上直接显示即可，无需去背。 */
#brand .brand-logo {
    width: 3.3rem;
    height: 2rem;
    object-fit: contain;
    object-position: left center;
    display: block;
    flex: none;
}

#status, #location, #earth {
    background-color: rgba(0, 0, 5, 0.6);
    border-radius: 0.5rem/0.5rem;
    display: table;
    margin-top: 1rem;
    padding: 0 1rem 0 1rem;
    pointer-events: all;
}

#menu {
    background-color: rgba(5, 10, 30, 0.85);
    border-radius: 0.5rem/0.5rem;
    overflow: hidden;
    pointer-events: all;

    margin-top: 1rem;
    padding: 0.5rem 1rem 0.5rem 1rem;
    opacity: 1;
    max-height: 34rem;
    transition: opacity 250ms ease, max-height 250ms ease, margin-top 250ms ease;
    -webkit-transition: opacity 250ms ease, max-height 250ms ease, margin-top 250ms ease;
}

#menu.invisible {
    margin-top: 0;
    padding: 0 1rem 0 1rem;
    opacity: 0;
    max-height: 0;
    transition: opacity 250ms ease, max-height 250ms ease, margin-top 250ms ease;
    -webkit-transition: opacity 250ms ease, max-height 250ms ease, margin-top 250ms ease;
}

#progress {
    padding-left: 1rem;
}

#nav-now {
    padding-right: 1rem;
}

#nav-backward, #nav-backward-more, #nav-forward, #nav-forward-more, #option-show-grid {
    padding-left: 1rem;
    padding-right: 1rem;
}

#show-location {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

#menu {
    display: none !important;
}

#earth {
    display: none !important;
}

#timeline-row {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 70vw;
    max-width: 68rem;
    height: 3.1rem;
    margin: 0;
    padding: 0 0.55rem 0 1rem;
    border: 1px solid rgba(132, 222, 228, 0.22);
    border-radius: 1.2rem;
    background: linear-gradient(180deg, rgba(10, 26, 50, 0.92), rgba(4, 13, 30, 0.95));
    box-shadow: 0 0.9rem 2.6rem rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px) saturate(130%);
    z-index: 20;
}

.timeline-play-button {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(130, 235, 228, 0.5);
    border-radius: 50%;
    color: #04222b;
    background: radial-gradient(circle at 32% 28%, #aef3e2, #2fb6c9 72%);
    box-shadow: 0 0 0.9rem rgba(47, 182, 201, 0.35), inset 0 1px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

.timeline-play-button:hover {
    transform: scale(1.08);
    box-shadow: 0 0 1.2rem rgba(47, 182, 201, 0.6);
}

.timeline-play-button.playing {
    color: #ffffff;
    background: radial-gradient(circle at 32% 28%, #f4cf8a, #d4693d 72%);
    border-color: rgba(255, 207, 132, 0.8);
    box-shadow: 0 0 1.1rem rgba(212, 105, 61, 0.55);
}

.timeline-svg {
    display: block;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.timeline-svg:active {
    cursor: ew-resize;
}

.timeline-track {
    stroke: #888888;
    stroke-width: 2;
}

.timeline-active {
    stroke: #e2b42e;
    stroke-width: 2;
}

.timeline-marks line {
    stroke: #eeeeee;
    stroke-width: 1;
    opacity: 0.5;
}

.timeline-labels text {
    fill: #eeeeee;
    font-size: 0.7rem;
    opacity: 0.8;
}

.timeline-handle {
    fill: #e2b42e;
    stroke: #ffffff;
    stroke-width: 1;
}

/* 累积降水的「区间」双滑块：起点手柄用青色，与终点的黄色明确区分。
   仅累积降水图层可见（其余图层由 JS 加 invisible）。 */
.timeline-handle-from {
    fill: #35d0c8;
}

/* 起止之间的区间色带：与起点手柄同色系，半透明，压在刻度线下方。 */
.timeline-range {
    fill: #35d0c8;
    opacity: 0.28;
    pointer-events: none;
}

.timeline-range.invisible,
.timeline-handle-from.invisible {
    display: none;
}

#lang {
    font-size: 1.25rem;
    float: right;
    padding-top: 0.5rem;
}

#lang .lang-selected {
    font-weight: bold;
    color: #fff;
}

.social-icon {
    font-size: 2.25rem;
    font-family: monosocialiconsfont-sub,sans-serif;
    padding-left: 0.25rem;
    text-decoration: none;
    position: relative;
    top: 0.1rem;
}

.internal-link {
    text-decoration: none;
}

.sup {
    position: relative;
   	bottom: 0.3em;
   	font-size: 0.6em;
}

.sub {
    position: relative;
   	top: 0.3em;
   	font-size: 0.6em;
}

/* 底部控制栏：播放按钮 → 时间轴轨道 → 比例尺(右端) */
#timeline-row .timeline-play-button { order: 0; }
#timeline-row .timeline-svg { order: 1; }

/* 比例尺并入底部时间轴条右端，作为统一底部控制栏的一部分，不再独立悬浮 */
.weather-scale {
    flex: 0 0 auto;
    order: 2;
    margin: 0;
    margin-left: auto;
    padding: 0.32rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    border-left: 1px solid rgba(132, 222, 228, 0.18);
    background: rgba(132, 222, 228, 0.05);
    border-radius: 0.7rem;
    white-space: nowrap;
    pointer-events: all;
}

.weather-scale canvas {
    height: 0.7rem;
    width: auto;
    max-width: 15rem;
    vertical-align: middle;
    flex: 0 1 auto;
}

/* 「比例尺」标签竖排：上面是"比例尺"，下面是当前单位（#scale-unit）。
   单位不再挂在色条上，避免色条那行被撑长。 */
.weather-scale #scale-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.12;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: #7d8ea8;
}

.weather-scale #scale-unit {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    color: #9fb0c6;
}

/* 色条 + 下方刻度行：竖向堆叠。刻度行宽度自动跟随色条（flex 列的子项默认拉伸），
   各档标签用绝对定位落在等分点上。 */
.weather-scale .scale-stack {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    flex: 0 1 auto;
}

.weather-scale .scale-ticks {
    position: relative;
    height: 0.75rem;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    color: #9fb0c6;
    font-variant-numeric: tabular-nums;   /* 等宽数字，切换单位时宽度不跳 */
}

.weather-scale .scale-ticks span {
    position: absolute;
    top: 0;
    white-space: nowrap;
}

#source-status {
    position: absolute;
    bottom: 6.25rem;
    right: 2%;
    font-size: 1.25rem;
    background-color: rgba(0, 0, 5, 0.6);
    border-radius: 0.5rem/0.5rem;
    padding: 0.25rem 0.75rem;
    pointer-events: all;
    color: #888888;
}

#weather-tools {
    position: fixed;
    top: 50%;
    right: 1.4rem;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.55rem;
    border: 1px solid rgba(144, 218, 228, 0.2);
    border-radius: 2.2rem;
    /* 不使用 backdrop-filter：它与 transform 在部分 GPU 上会产生合成层重绘不完整，
       导致按钮偶发“显示不全”。背景本已是近不透明渐变，去掉后观感一致且更稳定。 */
    background: linear-gradient(180deg, rgba(12, 30, 56, 0.97), rgba(5, 15, 34, 0.98));
    box-shadow: 0 1rem 2.8rem rgba(0, 0, 0, 0.45), inset 0 1px rgba(255, 255, 255, 0.06);
    pointer-events: all;
}

.weather-tool {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

/* Circular icon button */
.weather-tool-button {
    width: 3.5rem;
    min-height: 3.5rem;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    color: #dfe9f3;
    background:
        radial-gradient(circle at 30% 24%, rgba(90, 150, 210, 0.35), rgba(8, 20, 42, 0) 62%),
        linear-gradient(160deg, rgba(48, 82, 128, 0.92), rgba(12, 24, 50, 0.96));
    box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.14);
    cursor: pointer;
    line-height: 1;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

/* Per-tool accent color */
.weather-tool-button[data-panel="weather-mode-panel"] { --wacc: #5ee0d3; }
.weather-tool-button[data-panel="weather-overlay-panel"] { --wacc: #f0b45a; }
.weather-tool-button[data-panel="weather-height-panel"] { --wacc: #a490f0; }
.weather-tool-button[data-panel="weather-source-panel"] { --wacc: #6cb3f0; }
.weather-tool-button[data-panel="weather-projection-panel"] { --wacc: #f07a96; }

.weather-tool-button svg {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
    transition: transform 180ms ease, stroke 160ms ease;
}

.weather-tool-button:hover,
.weather-tool-button.active {
    transform: scale(1.08);
    color: var(--wacc);
    border-color: var(--wacc);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--wacc) 22%, transparent),
                0 0.55rem 1.4rem rgba(0, 0, 0, 0.5);
}

.weather-tool-button:hover svg,
.weather-tool-button.active svg {
    transform: scale(1.06) rotate(-4deg);
}

.weather-tool-button span {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #a9b8cc;
    transition: color 160ms ease;
}

.weather-tool-button:hover span,
.weather-tool-button.active span {
    color: #e8f4fb;
}

/* Popup panel */
.weather-tool-panel {
    display: none;
    position: absolute;
    top: 0;
    right: 4.3rem;
    min-width: 16rem;
    max-width: 24rem;
    padding: 0.85rem 0.9rem 0.95rem;
    border: 1px solid rgba(120, 220, 225, 0.3);
    border-radius: 0.9rem;
    background: linear-gradient(180deg, rgba(10, 24, 46, 0.96), rgba(5, 14, 32, 0.97));
    box-shadow: 0 1rem 2.8rem rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px) saturate(130%);
}

.weather-tool-panel.open {
    display: block;
    animation: weather-panel-in 160ms ease-out;
}

@keyframes weather-panel-in {
    from { opacity: 0; transform: translateX(0.5rem); }
    to { opacity: 1; transform: translateX(0); }
}

.weather-tool-panel b {
    display: block;
    margin-bottom: 0.7rem;
    color: #8fa3c2;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.weather-tool-panel button {
    margin: 0.22rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.55rem;
    color: #d4deea;
    background: rgba(30, 48, 80, 0.7);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.weather-tool-panel button:hover,
.weather-tool-panel button.highlighted {
    color: #06232b;
    border-color: #5fd8dc;
    background: linear-gradient(145deg, #84e8d8, #48c6cf);
    font-weight: 600;
    box-shadow: 0 0.3rem 0.9rem rgba(72, 198, 207, 0.3);
}

.weather-tool-panel button.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 叠加层按钮与其它面板按钮保持同一风格，统一圆角胶囊外观 */
#weather-overlay-options {
    display: flex;
    flex-wrap: wrap;
    max-width: 24rem;
}

#weather-overlay-options button {
    min-width: 4.4rem;
    border-radius: 1.4rem;
}

/* 标注开关分组（国界三态 + 城市两态），复用叠加层面板的胶囊按钮风格 */
#weather-label-options {
    display: flex;
    flex-wrap: wrap;
    max-width: 24rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(120, 220, 225, 0.18);
}

#weather-label-options .weather-label-group {
    flex-basis: 100%;
}

#weather-label-options .weather-label-group b {
    display: block;
    margin-bottom: 0.6rem;
    color: #8fa3c2;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

#weather-label-options button {
    min-width: 4.4rem;
    border-radius: 1.4rem;
}

/* 数据源面板里的时区切换（与地图精度同为 viewer 偏好），复用标注分组的胶囊按钮风格 */
#weather-tz-options {
    display: flex;
    flex-wrap: wrap;
    max-width: 24rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(120, 220, 225, 0.18);
}

#weather-tz-options button {
    min-width: 4.4rem;
    border-radius: 1.4rem;
}

#weather-height-panel {
    top: -3rem;
}

#weather-height-options {
    display: flex;
    max-width: 22rem;
    flex-wrap: wrap;
}

#weather-source-options button,
#weather-projection-options button {
    min-width: 4.4rem;
    border-radius: 0.6rem;
}

#source-status:empty {
    display: none;
}

/* 「数据已更新」提示（DOM 由 earth.js 注入）。放在状态条上方，用强调色区分。 */
#data-updated {
    position: absolute;
    bottom: 9.5rem;
    right: 2%;
    font-size: 1.1rem;
    background-color: rgba(0, 0, 5, 0.75);
    border-radius: 0.5rem/0.5rem;
    padding: 0.25rem 0.75rem;
    color: #e2b42e;
    cursor: pointer;
    pointer-events: all;
}

#data-updated.invisible {
    display: none;
}

/* 「层级自动切换」提示：某叠加层在当前层次没有数据时，按钮会连带切到它的第一个
   有效层次（如相对湿度 → 1000hPa）。DOM 由 earth.js 注入，几秒后自动隐藏。
   放在「数据已更新」上方，避免两者同时出现时叠在一起；不可点击，仅告知。 */
#level-switch-notice {
    position: absolute;
    bottom: 12.5rem;
    right: 2%;
    font-size: 1.1rem;
    background-color: rgba(0, 0, 5, 0.75);
    border-radius: 0.5rem/0.5rem;
    padding: 0.25rem 0.75rem;
    color: #84e8d8;
    cursor: default;
    pointer-events: none;
    transition: opacity 300ms ease-in;
}

#level-switch-notice.invisible {
    display: none;
}

/* 禁用按钮的悬浮提示（DOM 由 earth.js 注入）。
   鼠标移到「置灰的按钮」上时，说明它为什么点不了 —— 光置灰不给理由，
   用户只能靠猜（典型疑问："为什么选了相对湿度，空气密度就能点了？"）。
   用 fixed 定位 + translate 居中在按钮正上方，不参与布局也不吃鼠标事件。 */
#button-hint {
    position: fixed;
    z-index: 100;
    transform: translate(-50%, -100%);
    background-color: rgba(0, 0, 5, 0.88);
    border: 1px solid rgba(226, 180, 46, 0.45);
    border-radius: 0.4rem/0.4rem;
    padding: 0.3rem 0.7rem;
    color: #e2b42e;
    font-size: 1.05rem;
    line-height: 1.35;
    max-width: 30rem;
    text-align: center;
    pointer-events: none;
    white-space: normal;
}

#button-hint.invisible {
    display: none;
}

@media (max-width: 700px) {
    #weather-tools {
        top: 1rem;
        right: 0.8rem;
    }

    .weather-tool-button {
        width: 3.1rem;
        min-height: 3.1rem;
        font-size: 1.1rem;
    }

    .weather-tool-panel {
        right: 3.8rem;
        min-width: 14rem;
        max-width: calc(100vw - 5rem);
    }

    #timeline-row {
        width: 92vw;
        height: 2.9rem;
        bottom: 0.9rem;
    }

    #source-status {
        bottom: 5.5rem;
        right: 1rem;
    }

    .weather-scale {
        padding: 0.2rem 0.4rem;
        gap: 0.25rem;
    }

    .weather-scale #scale-label {
        display: none;
    }

    .weather-scale canvas {
        height: 0.5rem;
        max-width: 5rem;
    }

    .weather-scale .scale-ticks {
        height: 0.66rem;
        font-size: 0.52rem;
    }
}

/* 街区案例图标，画在 #foreground 的 <g class="micro-areas"> 里。半径是固定像素值，
   所以缩放时尺寸不变，只有屏幕坐标随投影变化。 */
g.micro-area {
    cursor: pointer;
}

/* 大连标记：只有一个黄点，外圈（.micro-halo）已按要求移除。
   点击热区是 earth.js 里垫的透明圆 .micro-hit —— 纯功能性，不参与视觉。 */
g.micro-area .micro-dot {
    fill: #e2b42e;
    stroke: rgba(0, 0, 5, 0.75);
    stroke-width: 1;
}

/* 悬停时点稍微放大：没有外圈后缺少交互反馈，用尺寸变化补上
   （SVG2 允许用 CSS 直接设几何属性 r） */
g.micro-area:hover .micro-dot {
    r: 4.5;
}

/* 街区微尺度浮层（DOM 由 earth.js 的 ensureMicroPanel 注入） */
#micro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;  /* 高于 #weather-tools 的 30，确保盖住右侧工具栏 */
}

#micro-overlay.invisible {
    display: none;
}

#micro-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 5, 0.62);
}

#micro-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 弹窗紧贴场景：宽度 = max-content（自动取到 3D 场景 1000px + 标题高度），
       不再用 92% 占满视口——这是 init.png 期望的"右/下余白尽量少"；
       max-width/max-height 留个安全余量防止小屏幕溢出。 */
    width: max-content;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(132, 222, 228, 0.22);
    border-radius: 1.2rem;
    background: linear-gradient(180deg, rgba(10, 26, 50, 0.96), rgba(4, 13, 30, 0.98));
    box-shadow: 0 0.9rem 2.6rem rgba(0, 0, 0, 0.5);
    overflow: hidden;   /* 让场景铺到底部时被圆角裁切，弹窗底部即场景底部 */
}

#micro-dialog-head {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    color: #ffffff;
    font-size: 1.25rem;
    border-bottom: 1px solid rgba(132, 222, 228, 0.16);
}

#micro-dialog-title {
    flex: 0 0 auto;
}

#micro-dialog-close {
    flex: 0 0 auto;
    margin-left: auto;   /* 把关闭按钮推到标题栏最右 */
    font-size: 1.4rem;
}

#micro-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background-color: #04050f;
}

/* 弹窗里嵌的 iframe：用 cube 比例后，X/Y=1200m 在屏幕上铺开约 2 倍 Z=300m。
   实测 Plotly 3D 场景盒含轴标签自然宽度 ≈ 700px，刚好 700×450 让
   X/Y=1200 + Z=350 的轴标签全可见且贴边；弹窗自动取到 702×502。
   再大（如 800×600/900×500）iframe 内右/下会出现 200-260px 大片画布留白；
   再小（如 600×500）会裁掉 "1200" 轴标签。
   实测 dialog 702×502（再紧凑就裁轴标签）。 */
#micro-frame {
    display: block;
    width: 700px;
    height: 450px;
    margin: 0 auto;
    border: 0;
    background: #fff;
}

#micro-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9fb6c8;
    font-size: 1.15rem;
    text-align: center;
}

/* 弹窗里嵌的 demo 页面（voxcity_demo.html）原本把 .plotly-graph-div 强拉成
   width:100%; height:100%，会拉伸 3D 场景。这里用 !important 强制回 800×600，
   让场景保持 cube 比例、不再拉伸；与 #micro-frame 同步。 */
.plotly-graph-div { width: 900px !important; height: 500px !important; margin: 0 auto !important; background: #fff; }

/* 弹窗结构说明（v3）：
   标题栏只有标题 + ✕（按当前需求去掉了版权声明 #micro-attribution）；
   弹窗尺寸 = max-content，自然紧贴 3D 场景 1000×800，右/下不再有画布外的余白。
   弹窗底部 = 3D 场景底部（无底栏 #micro-dialog-foot，3D 场景本身就是底）。 */
.src-btn {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

/**************************************************************************************************
 * SVG Element Styling
 **************************************************************************************************/

/* 陆地灰底：垫在 background-sphere(海 #303030) 之上、coastline 之下，用于区分海陆。
   无描边——轮廓交给上方的白色海岸线勾勒；数据来自 world-geo.json 的 land 层。 */
.land {
    fill: #4a4a4a;
    stroke: none;
}

/* 开启叠加层(温度/湿度/气压等)时隐藏陆地面。
   原因：叠加层是半透明色块(OVERLAY_ALPHA=0.4)，60% 的背景色会透上来；背景一旦不均匀
   (陆地 #4a4a4a 比海洋 #303030 亮)，数据色就会被掺灰、发淡，且海陆色调不一致。
   隐藏后背景恢复均匀深色，数据配色与加灰底之前完全一致。纯风场时仍显示灰底。 */
.land.invisible {
    display: none;
}

/* 海陆轮廓（海岸线 + 湖岸）—— 加粗以提升全球轮廓辨识度（原 1.25 / Firefox 1.0）。 */
.coastline, .lakes {
    stroke: #ffffff;
    stroke-width: 2.0;
    fill: none;
}

.firefox .coastline, .firefox .lakes {
    stroke-width: 1.7;
}

/* 国界 —— 默认低调细线 */
.borders path {
    stroke: rgba(180, 200, 220, 0.35);
    stroke-width: 1;
    fill: none;
}

/* 南海十段线 —— 虚线，稍亮以便辨识 */
.borders .nine-dash-line {
    stroke: rgba(208, 222, 240, 0.85);
    stroke-width: 1.1;
    stroke-dasharray: 6 4;
    stroke-linecap: round;
}

/* 国界 —— 清晰实线 */
body.borders-bold .borders path {
    stroke: #c8d8e8;
    stroke-width: 1.2;
}

/* 十段线在清晰模式下仍保持虚线且更亮（优先级高于上方通用规则） */
body.borders-bold .borders .nine-dash-line {
    stroke: rgba(208, 222, 240, 0.9);
    stroke-width: 1.2;
    stroke-dasharray: 6 4;
    stroke-linecap: round;
}

/* 国界隐藏 */
body.borders-off .borders { display: none; }

/* 中国省市行政边界线（DataV）：比国界稍亮、但明显弱于海岸线，避免抢视觉。
   省界 scale>=500 显示、市界 scale>=1200 显示（可见性由 JS 控制）。 */
.admin-borders path.admin-border {
    fill: none;
    stroke: rgba(150, 190, 215, 0.40);
    stroke-width: 0.7;
}

.admin-borders path.admin-border.city {
    stroke: rgba(150, 190, 215, 0.32);
    stroke-width: 0.6;
}

/* 关掉国界时一并隐藏行政边界（两者同属边界信息） */
body.borders-off .admin-borders { display: none; }

/* 县级（区县）轮廓：挂在 #foreground 的独立图层（#map 被两块全屏 canvas 压住，
   画在那里收不到鼠标事件）。只画轮廓、不填色；pointer-events:all 让**县域内部**
   也能触发悬停（SVG 里 fill:none 的面默认不可命中）。 */
.admin-districts path.admin-district {
    fill: none;
    stroke: rgba(150, 190, 215, 0.30);
    stroke-width: 0.6;
    pointer-events: all;
    cursor: help;
}

/* 悬停县域时跟随鼠标的县名提示（县名不常驻渲染在地图上，只在这里出现） */
#district-tip {
    position: fixed;
    z-index: 30;
    pointer-events: none;
    padding: 0.12rem 0.42rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #eaf2fb;
    background: rgba(8, 14, 24, 0.88);
    border: 1px solid rgba(132, 222, 228, 0.35);
    border-radius: 0.35rem;
    white-space: nowrap;
}

#district-tip.invisible { display: none; }

/* 关掉国界时县级轮廓一并隐藏（同属边界信息） */
body.borders-off .admin-districts { display: none; }

/* 城市点 */
.cities circle {
    fill: rgba(120, 210, 225, 0.85);
}

/* 首都五角星：亮黄实心 + 深色描边。用纯黄而非大连那种暗金(#e2b42e)，
   一是作为地标更跳，二是避免与街区案例图标混淆。 */
.cities polygon.city-star {
    fill: #ffd700;
    stroke: rgba(0, 0, 5, 0.85);
    stroke-width: 1;
    stroke-linejoin: round;
}

/* 城市名（深色描边增强可读性，不抢风场视觉） */
.cities text {
    fill: rgba(210, 230, 242, 0.85);
    font-size: 10px;
    paint-order: stroke;
    stroke: rgba(0, 0, 5, 0.85);
    stroke-width: 3px;
    stroke-linejoin: round;
}

/* 城市隐藏 */
body.cities-off .cities { display: none; }

/* 中国行政区划标注：按缩放逐级显示（省/市/区县），同一时刻只有一层。
   层级越高字号越大、越淡，避免压过城市标签。跟随"城市"开关一起隐藏。 */
.admin-labels text.admin-label {
    text-anchor: middle;
    paint-order: stroke;
    stroke: rgba(0, 0, 5, 0.82);
    stroke-linejoin: round;
    pointer-events: none;
}

.admin-labels text.admin-label.province {
    fill: rgba(186, 210, 230, 0.68);
    font-size: 12px;
    letter-spacing: 0.6px;
    stroke-width: 3.2px;
}

.admin-labels text.admin-label.city {
    fill: rgba(206, 226, 240, 0.80);
    font-size: 10.5px;
    letter-spacing: 0.3px;
    stroke-width: 3px;
}

.admin-labels text.admin-label.district {
    fill: rgba(214, 230, 242, 0.86);
    font-size: 9.5px;
    letter-spacing: 0;
    stroke-width: 2.6px;
}

body.cities-off .admin-labels { display: none; }

.graticule {
    stroke: #505050;
    stroke-width: 1.0;
    fill: none;
}

.hemisphere {
    stroke: #707070;
    stroke-width: 1.25;
    fill: none;
}

.background-sphere {
    stroke: none;
    fill: #303030;
}

.foreground-sphere {
    stroke: #000005;
    stroke-width: 4.0;
    fill: none;
    -moz-user-select: none;  /* Oddly, Win FF sometimes selects this SVG element. Disable. */
    user-select: none;
}

.location-mark {
    stroke: #3aff3a;
    stroke-width: 2.5;
    fill: none;
}

/**************************************************************************************************
 * About Page
 **************************************************************************************************/

#about {
    font-size: 1.5rem;
}

#about h1 {
    font-size: 2.4rem;
    text-align: center;
    padding-top: 2rem;
}

#about div {
    clear: both;
}

#about .blurb {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

#about .blurb img {
    padding-top: 2rem;
}

#about img {
    display: block;
    margin: auto;
}

#about:first-child {
    padding-top: 3rem;
}

#cover {
    border: 1px solid #eeeeee;
}

#about .left {
    width: 50%;
    float: left;
    text-align: right;
}

#about .right {
    width: 50%;
    float: right;
}

#about .center {
    text-align: center;
}

#about .pad {
    visibility: hidden;
}

#closing {
    padding-bottom: 2.5rem;
}
