/* 邬达克建筑巡礼专题页样式（局部样式，仅本页使用） */

body.hudec-page {
    --hudec-bg: #08080c;
    --hudec-panel: #0d0d14;
    --hudec-card: #12121a;
    --hudec-card-hover: #171722;
    --hudec-border: rgba(255, 255, 255, 0.08);
    --hudec-border-strong: rgba(255, 255, 255, 0.14);
    --hudec-text: #f0f0f5;
    --hudec-muted: #8b8b9a;
    --hudec-soft: #b9b9c6;
    --hudec-accent: #9d8fff;
    --hudec-accent-2: #7c6cff;
    --hudec-accent-soft: rgba(157, 143, 255, 0.13);
    margin: 0;
    padding: 0;
    background: var(--hudec-bg);
    color: var(--hudec-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

body.hudec-page *,
body.hudec-page *::before,
body.hudec-page *::after {
    box-sizing: border-box;
}

/* 顶部栏 */
.hudec-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
    background: #0b0b11;
    border-bottom: 1px solid var(--hudec-border);
}

.hudec-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--hudec-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.hudec-brand .brand-mark {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--hudec-accent);
    color: #0b0b11;
    font-size: 13px;
    font-weight: 800;
}

.hudec-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hudec-nav a {
    color: var(--hudec-muted);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.18s ease;
}

.hudec-nav a:hover {
    color: var(--hudec-text);
}

/* 主布局 */
.hudec-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    height: calc(100vh - 56px);
    min-height: 0;
}

.hudec-map-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #0f0f16;
}

#hudec-map {
    position: absolute;
    inset: 0;
}

.hudec-map-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #0f0f16;
    color: var(--hudec-muted);
    font-size: 13px;
    transition: opacity 0.3s ease;
}

.hudec-map-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.hudec-map-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(157, 143, 255, 0.25);
    border-top-color: var(--hudec-accent);
    border-radius: 50%;
    animation: hudec-spin 0.8s linear infinite;
}

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

/* 地图上的标题卡片 */
.hudec-map-badge {
    position: absolute;
    z-index: 10;
    top: 20px;
    left: 20px;
    max-width: min(390px, calc(100% - 120px));
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(10, 10, 16, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
}

.hudec-map-badge .eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--hudec-accent);
}

.hudec-map-badge h1 {
    margin: 4px 0 6px;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.hudec-map-badge p {
    margin: 0;
    color: var(--hudec-soft);
    font-size: 12px;
    line-height: 1.6;
}

.hudec-reset {
    position: absolute;
    z-index: 10;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1px solid var(--hudec-border-strong);
    border-radius: 9px;
    background: rgba(10, 10, 16, 0.75);
    color: var(--hudec-text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.18s ease, color 0.18s ease;
}

.hudec-reset:hover {
    border-color: var(--hudec-accent);
    color: #ffffff;
}

.hudec-map-hint {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(10, 10, 16, 0.72);
    color: var(--hudec-soft);
    font-size: 11px;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}

/* 右侧面板 */
.hudec-side {
    min-width: 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    background: var(--hudec-panel);
    border-left: 1px solid var(--hudec-border);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hudec-intro {
    margin-bottom: 18px;
}

.hudec-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.hudec-stats span {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid rgba(157, 143, 255, 0.25);
    border-radius: 20px;
    background: var(--hudec-accent-soft);
    color: #d9d4ff;
    font-size: 11px;
    white-space: nowrap;
}

.hudec-note {
    margin: 0;
    color: var(--hudec-muted);
    font-size: 11px;
    line-height: 1.7;
}

/* 站点详情 */
.station-detail {
    margin-bottom: 20px;
    border: 1px solid var(--hudec-border);
    border-radius: 14px;
    background: var(--hudec-card);
    overflow: hidden;
}

.station-detail[hidden] {
    display: none;
}

.detail-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #191924;
}

.detail-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-cover-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--hudec-muted);
    font-size: 12px;
}

.detail-cover.is-failed img {
    display: none;
}

.detail-cover.is-failed .detail-cover-fallback {
    display: flex;
}

.detail-body {
    padding: 16px;
}

.detail-kicker {
    color: var(--hudec-accent);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.detail-body h2 {
    margin: 6px 0 10px;
    font-size: 21px;
    line-height: 1.25;
}

.detail-alias {
    display: block;
    margin-top: 3px;
    color: var(--hudec-muted);
    font-size: 12px;
    font-weight: 400;
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    color: #a7a7b5;
    font-size: 12px;
    line-height: 1.5;
}

.detail-meta i {
    width: 14px;
    margin-right: 2px;
    color: var(--hudec-accent-2);
}

.detail-desc {
    margin: 0 0 16px;
    color: #c7c7d1;
    font-size: 13px;
    line-height: 1.7;
}

.detail-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--hudec-accent);
    color: #0b0b11;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease;
}

.detail-actions a:hover {
    background: #b3a9ff;
}

.detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
}

.detail-nav button {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--hudec-border-strong);
    border-radius: 8px;
    background: transparent;
    color: #d7d7e0;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.detail-nav button:hover:not(:disabled) {
    border-color: var(--hudec-accent);
    color: #ffffff;
}

.detail-nav button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.detail-nav span {
    color: var(--hudec-muted);
    font-size: 11px;
    white-space: nowrap;
}

/* 站点列表 */
.station-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.station-list-head h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.station-list-head span {
    color: var(--hudec-muted);
    font-size: 11px;
}

.station-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.station-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--hudec-border);
    border-radius: 10px;
    background: var(--hudec-card);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.station-item:hover,
.station-item.is-hover {
    border-color: rgba(157, 143, 255, 0.45);
    background: var(--hudec-card-hover);
}

.station-item.is-active {
    border-color: var(--hudec-accent);
    background: var(--hudec-accent-soft);
}

.station-num {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(157, 143, 255, 0.5);
    border-radius: 50%;
    color: #d9d4ff;
    font-size: 11px;
    font-weight: 700;
}

.station-item.is-active .station-num {
    background: var(--hudec-accent);
    border-color: var(--hudec-accent);
    color: #0b0b11;
}

.station-info {
    flex: 1;
    min-width: 0;
}

.station-info strong {
    display: block;
    overflow: hidden;
    color: var(--hudec-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-info span {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--hudec-muted);
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-item > i {
    flex: 0 0 auto;
    color: #6b6b7b;
    font-size: 11px;
}

.station-item.is-active > i {
    color: var(--hudec-accent);
}

/* 地图标记 */
.hudec-marker {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(157, 143, 255, 0.75);
    border-radius: 50%;
    background: rgba(13, 13, 20, 0.92);
    color: #f0f0f5;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.hudec-marker:hover,
.hudec-marker.is-hover,
.hudec-marker.is-active {
    background: var(--hudec-accent);
    color: #0b0b11;
    transform: scale(1.14);
}

/* 相邻站点在整条路线视野下可能重叠，选中/悬停的标记置顶，避免被后一个站点盖住 */
.hudec-marker.is-active {
    z-index: 6;
}

.hudec-marker.is-hover {
    z-index: 5;
}

/* 移动端 */
@media (max-width: 860px) {
    body.hudec-page {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .hudec-topbar {
        position: sticky;
        top: 0;
        z-index: 30;
        padding: 0 14px;
    }

    .hudec-layout {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .hudec-map-wrap {
        height: 46vh;
        min-height: 320px;
    }

    .hudec-side {
        border-top: 1px solid var(--hudec-border);
        border-left: none;
        overflow: visible;
        padding: 18px 14px calc(22px + env(safe-area-inset-bottom));
    }

    .hudec-map-badge {
        top: 12px;
        left: 12px;
        max-width: calc(100% - 86px);
        padding: 10px 12px;
    }

    .hudec-map-badge h1 {
        font-size: 16px;
    }

    .hudec-map-badge p {
        display: none;
    }

    .hudec-reset {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
        justify-content: center;
        padding: 0;
    }

    .hudec-reset span {
        display: none;
    }

    .hudec-map-hint {
        display: none;
    }

    .station-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .station-item {
        flex: 0 0 250px;
        scroll-snap-align: start;
    }

    .detail-body h2 {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .hudec-nav a:not(:first-child) {
        display: none;
    }

    .hudec-map-wrap {
        height: 42vh;
        min-height: 280px;
    }
}
