:root {
    color-scheme: dark;
    --bg-color: #07111f;
    --bg-accent: #101f35;
    --surface-strong: rgba(9, 18, 30, 0.78);
    --surface-soft: rgba(12, 21, 34, 0.66);
    --surface-border: rgba(148, 163, 184, 0.12);
    --text-main: #eff6ff;
    --text-sub: #8ea3bf;
    --accent: #7dd3fc;
    --accent-strong: #38bdf8;
    --accent-warm: #f59e0b;
    --land: #3d6c83;
    --land-stroke: rgba(208, 227, 255, 0.14);
    --ocean-top: #143457;
    --ocean-bottom: #07111f;
    --night-fill: rgba(1, 10, 20, 0.58);
    --night-stroke: rgba(125, 211, 252, 0.34);
    --shadow-strong: 0 18px 42px rgba(1, 10, 20, 0.28);
    --shadow-soft: 0 10px 24px rgba(1, 10, 20, 0.18);
    --radius-xl: 18px;
    --radius-lg: 12px;
    --radius-md: 10px;
    --page-width: 1380px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Inter, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 24%),
        linear-gradient(180deg, #0a1320 0%, #050b14 100%);
}

.page-shell {
    width: min(100%, var(--page-width));
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.hero {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.hero-main {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.hero-main h1 {
    margin: 0;
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.utc-panel {
    min-width: 192px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    background: rgba(9, 18, 30, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: none;
}

.utc-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-sub);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.locale-toggle {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    background: rgba(8, 20, 35, 0.28);
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.locale-toggle:hover,
.locale-toggle:focus-visible {
    color: var(--text-main);
    border-color: rgba(125, 211, 252, 0.24);
    background: rgba(8, 20, 35, 0.42);
    outline: none;
}

.utc-panel strong {
    display: block;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: clamp(24px, 2.8vw, 34px);
    color: var(--accent);
    line-height: 1.15;
}

.utc-panel small {
    display: block;
    margin-top: 8px;
    color: rgba(191, 219, 254, 0.7);
    font-size: 13px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.map-panel {
    display: grid;
    gap: 10px;
}

.map-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.footer-note {
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.4;
    padding: 0;
    border: 0;
    background: none;
}

.map-container {
    position: relative;
    aspect-ratio: 2 / 1;
    width: 100%;
    overflow: hidden;
    user-select: none;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(103, 232, 249, 0.14);
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.08), transparent 18%),
        radial-gradient(circle at 80% 8%, rgba(125, 211, 252, 0.12), transparent 18%),
        radial-gradient(circle at 50% 120%, rgba(14, 165, 233, 0.16), transparent 32%),
        linear-gradient(180deg, var(--ocean-top) 0%, var(--ocean-bottom) 100%);
    box-shadow: var(--shadow-strong);
    cursor: grab;
    touch-action: none;
}

.map-container.is-dragging {
    cursor: grabbing;
}

.map-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 26%),
        linear-gradient(0deg, rgba(3, 11, 20, 0.18), transparent 34%);
}

#world-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.globe-sphere {
    fill: rgba(255, 255, 255, 0.02);
}

.graticule {
    fill: none;
    stroke: rgba(203, 213, 225, 0.06);
    stroke-width: 0.9px;
}

.land-path {
    fill: var(--land);
    stroke: var(--land-stroke);
    stroke-width: 0.85px;
    filter: drop-shadow(0 8px 18px rgba(2, 10, 20, 0.14));
}

.night-glow {
    fill: none;
    stroke: var(--night-stroke);
    stroke-width: 2.2px;
    opacity: 0.9;
    filter: drop-shadow(0 0 12px rgba(103, 232, 249, 0.28));
}

.night-path {
    fill: var(--night-fill);
    stroke: none;
}

.city-layer {
    position: absolute;
    inset: 0;
}

.city-node,
.city-anchor-label,
.detail-card {
    position: absolute;
}

.city-node {
    display: grid;
    place-items: center;
    width: var(--city-hit-size, 20px);
    height: var(--city-hit-size, 20px);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    transform: translate(-50%, -50%);
    cursor: default;
    color: var(--text-main);
    z-index: 4;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

.map-container.is-dragging .city-node {
    cursor: grabbing;
}

.city-node::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(103, 232, 249, 0.08), transparent 72%);
    opacity: 0;
    transition: opacity 180ms ease;
}

.city-node:hover::before,
.city-node.is-active::before,
.city-node:focus-visible::before {
    opacity: 1;
}

.city-node:focus-visible {
    outline: none;
}

.city-node:focus-visible .city-core {
    box-shadow: 0 0 0 2px rgba(5, 11, 18, 0.85), 0 0 0 4px rgba(103, 232, 249, 0.72);
}

.city-pulse,
.city-core {
    position: absolute;
    border-radius: 999px;
    transition: transform 180ms ease, opacity 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.city-pulse {
    width: 20px;
    height: 20px;
    background: rgba(103, 232, 249, 0.22);
    opacity: 0.58;
}

.city-core {
    width: 8px;
    height: 8px;
    background: linear-gradient(180deg, #d8f8ff 0%, var(--accent) 100%);
    box-shadow: 0 0 0 1px rgba(207, 250, 254, 0.28), 0 0 18px rgba(56, 189, 248, 0.48);
}

.city-node.is-anchor .city-pulse {
    width: 24px;
    height: 24px;
    background: rgba(56, 189, 248, 0.28);
}

.city-node.is-anchor .city-core {
    width: 10px;
    height: 10px;
    background: linear-gradient(180deg, #fef3c7 0%, #f59e0b 100%);
}

.city-node.is-selected .city-pulse,
.city-node.is-preview .city-pulse {
    transform: scale(1.24);
    opacity: 0.88;
}

.city-node.is-selected .city-core,
.city-node.is-preview .city-core {
    transform: scale(1.45);
}

.city-anchor-label {
    display: none;
    min-width: 126px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(7, 18, 32, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 8px 18px rgba(2, 10, 20, 0.18);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
    backdrop-filter: blur(10px);
}

.city-anchor-label.visible {
    display: block;
}

.city-anchor-label strong,
.city-anchor-label span {
    display: block;
}

.city-anchor-label strong {
    font-size: 13px;
    letter-spacing: -0.02em;
}

.city-anchor-label span {
    margin-top: 4px;
    color: rgba(191, 219, 254, 0.82);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
}

.detail-card {
    width: min(236px, calc(100% - 24px));
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(8, 16, 28, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 0 16px 32px rgba(2, 10, 20, 0.22);
    pointer-events: auto;
    z-index: 6;
    backdrop-filter: blur(14px);
}

.detail-card[data-persistent="true"] {
    border-color: rgba(125, 211, 252, 0.22);
}

.detail-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.detail-card__city {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.detail-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    color: rgba(216, 248, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
}

.detail-card__time {
    margin: 10px 0 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: clamp(22px, 3vw, 28px);
    color: var(--accent);
    letter-spacing: -0.04em;
}

.detail-card__meta,
.detail-card__zone {
    margin: 0;
    color: rgba(191, 219, 254, 0.78);
    font-size: 13px;
    line-height: 1.5;
}

.detail-card__zone {
    margin-top: 2px;
    color: rgba(159, 179, 204, 0.92);
    font-size: 12px;
}

.map-status {
    position: absolute;
    inset: auto 18px 18px 18px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(7, 18, 32, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.5;
    z-index: 7;
    backdrop-filter: blur(10px);
}

.map-status.is-hidden {
    display: none;
}

.map-status.is-error {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.34);
}

.controls-panel {
    display: grid;
    gap: 14px;
}

.seo-section {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.seo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 28px;
}

.seo-copy h2,
.seo-faq h2 {
    margin: 0 0 10px;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.seo-copy p,
.seo-faq p {
    margin: 0 0 10px;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.7;
}

.seo-faq details {
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.seo-faq summary {
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
}

.seo-faq summary::-webkit-details-marker {
    display: none;
}

.seo-faq details p {
    margin: 8px 0 0;
}

.controls-card {
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(9, 18, 30, 0.52);
    border: 1px solid var(--surface-border);
    box-shadow: none;
}

.section-heading h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 6px 0 0;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.5;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.mode-option {
    position: relative;
}

.mode-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.mode-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 20, 35, 0.38);
    color: #dcecff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.mode-option input:checked + span {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(103, 232, 249, 0.24);
    color: #f0fbff;
}

.manual-panel {
    display: grid;
    gap: 12px;
}

.manual-topline {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.manual-topline span {
    color: var(--text-sub);
    font-size: 14px;
}

.manual-topline strong {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 24px;
    color: #f8fafc;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent-strong);
}

input[type="date"] {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(8, 20, 35, 0.34);
    color: var(--text-main);
    font: inherit;
}

input[type="date"]:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

input[type="range"]:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.slider-scale {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-sub);
    font-size: 12px;
}

.control-help {
    margin: 0;
    color: var(--text-sub);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 1120px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .seo-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .controls-card {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding-inline: 14px;
        padding-top: 16px;
    }

    .hero {
        gap: 10px;
        margin-bottom: 14px;
    }

    .hero-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        align-items: start;
    }

    .hero-main h1 {
        margin-bottom: 0;
        font-size: 30px;
    }

    .utc-panel {
        min-width: 152px;
        width: auto;
        padding: 12px 14px;
    }

    .utc-panel strong {
        font-size: 22px;
    }

    .utc-panel small {
        margin-top: 6px;
    }

    .controls-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .controls-card {
        padding: 14px;
    }

    .map-container {
        height: 340px;
        min-height: 340px;
        aspect-ratio: auto;
    }

    .section-heading p,
    .control-help {
        display: none;
    }

    .manual-panel {
        gap: 10px;
    }

    .city-anchor-label {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
