@font-face {
    font-family: 'fzxs';
    src: url('fzxs.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
}

    body.no-scroll {
        overflow: hidden;
        height: 100vh;
    }

.container {
    max-width: 1500px;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 0 auto;
    box-sizing: border-box;
}

    .container:has(#simulator-view.active) {
        max-width: 800px;
        min-width: 350px;
        width: 100%;
        overflow: visible;
        box-sizing: border-box;
    }

@media (min-width: 400px) {
    .container:has(#portal-view.active) {
        min-width: 400px;
    }
}

.home-intro {
    text-align: center;
    color: #555;
}

.intro-title {
    font-size: 25px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.intro-desc {
    max-width: 900px;
    margin: auto;
    line-height: 1.8;
    font-size: 15px;
}

.intro-feature {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

    .intro-feature span {
        background: #f5f5f5;
        border-radius: 20px;
        padding: 8px 16px;
    }

.view {
    display: none;
}

    .view.active {
        display: block;
    }

header {
    text-align: center;
    padding: 15px;
    transition: background-color 0.4s ease, color 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 12px 12px 0 0;
}

.main-header {
    background-color: #ebeef5;
    color: #333333;
}

/* 模拟器专属头部，用于定位返回按钮 */
.sim-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.metro-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

/* 左上角返回按钮样式 */
.btn-back {
    position: absolute;
    left: 15px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: inherit;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background 0.2s;
    text-shadow: 0 1px 1px rgba(255,255,255,0.3);
}

    .btn-back:hover {
        background: rgba(255, 255, 255, 0.45);
    }

/* 首页线路网格布局 */
.line-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 10px;
}

/* 线路选择卡片 */
.line-card {
    padding: 25px 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .line-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    }

main {
    padding: 20px;
}

.control-panel {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

    .form-group label {
        width: 100px;
        font-weight: bold;
        flex-shrink: 0;
    }

    .form-group select {
        flex: 1;
        min-width: 120px;
        max-width: 100%;
        padding: 8px;
        border-radius: 4px;
        border: 1px solid #ccc;
        box-sizing: border-box;
    }

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 110px;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

    .btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

#btn-door-close {
    background-color: #ffc107;
    color: #333;
}

.display-screen {
    background-color: #000000;
    margin: 0;
    border: none;
    position: relative;
    overflow: hidden;
    height: 85px;
    width: 100%;
    display: flex;
    align-items: center;
}

.marquee-window {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: ledScroll 18s linear infinite;
    height: 100%;
    line-height: 90px;
}

@keyframes ledScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.led-red {
    color: #ff0000;
    font-size: 40px;
    font-family: 'fzxs', monospace;
    font-weight: normal;
    letter-spacing: 2px;
    display: inline-block;
    transform: scale(1, 1);
    transform-origin: left center;
    text-shadow: 0 0 2px rgba(255, 51, 51, 0.8), 0 0 6px rgba(255, 51, 51, 0.5), 0 0 10px rgba(255, 51, 51, 0.3);
    image-rendering: pixelated;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 关于本站按钮 */
.btn-about {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    background: #005BAC;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 91, 172, 0.2);
    transition: all 0.2s ease;
}

    .btn-about:hover {
        background: #004b8d;
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0, 91, 172, 0.35);
    }

    .btn-about:active {
        transform: translateY(0);
        box-shadow: 0 3px 8px rgba(0, 91, 172, 0.2);
    }
.about-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

    .about-badges img {
        height: 20px;
        border-radius: 3px;
    }

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.about-grid-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
}

    .about-grid-item h3 {
        margin-top: 0 !important;
        color: #005BAC;
        border-bottom: 2px solid #e2e8f0;
        padding-bottom: 8px;
        font-size: 16px;
    }

    .about-grid-item ul {
        padding-left: 18px;
        margin-bottom: 0;
        font-size: 13px;
        line-height: 1.8;
    }

.about-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 30px 0;
}

/* 时间轴样式 */
.timeline {
    border-left: 2px solid #e2e8f0;
    padding-left: 15px;
    margin: 15px 0;
}

.timeline-item {
    margin-bottom: 12px;
    position: relative;
    font-size: 13.5px;
}

    .timeline-item::before {
        content: '';
        position: absolute;
        left: -20px;
        top: 6px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #005BAC;
    }

.timeline-date {
    font-weight: bold;
    color: #005BAC;
    margin-right: 10px;
}

/* 按钮样式 */
.about-actions {
    margin: 20px 0;
}

.btn-github-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #24292e;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}

    .btn-github-action:hover {
        background-color: #1a1e22;
    }

.icon-git {
    fill: currentColor;
}

.about-disclaimer {
    font-size: 12px;
    line-height: 1.6;
    color: #94a3b8;
    background: #f8fafc;
    border-left: 3px solid #cbd5e1;
    padding: 10px 15px;
    margin-top: 30px;
}
.about-card {
    max-width: 900px;
    margin: auto;
    background: white;
    border-radius: 10px;
    padding: 35px;
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
    line-height: 2;
}

    .about-card h2 {
        color: #005BAC;
    }

    .about-card h3 {
        margin-top: 28px;
        color: #444;
    }

    .about-card ul {
        padding-left: 22px;
    }

.about-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0 25px 0;
    font-size: 12px;
}

.version-tag {
    background-color: #c70541;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.status-tag {
    background-color: #e2e8f0;
    color: #475569;
    padding: 3px 8px;
    border-radius: 4px;
}

    .status-tag.active {
        background-color: #def7ec;
        color: #03543f;
    }

.update-date {
    color: #94a3b8;
}

.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    overflow: hidden;
    cursor: pointer;
    background-color: white;
    perspective: 1200px;
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1);
    min-width: 400px;
}

    .welcome-screen.opened {
        pointer-events: none;
        opacity: 0;
    }

/* 欢迎页文字排版 */
.welcome-content-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    text-align: center;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 1. 图标动画 */
.welcome-logo-center {
    width: 140px;
    height: 140px;
    object-fit: contain;
    animation: logoMoveUp 0.25s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.15s;
}

/* 2. 文字动画 */
.welcome-text-animated {
    opacity: 0;
    margin-top: 20px;
    transform: translateY(20px);
    animation: textFadeInUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.25s;
}

/* 图标向上位移 */
@keyframes logoMoveUp {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-30px);
    }
}

/* 文字渐显并上浮 */
@keyframes textFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-title {
    font-size: 32px;
    color: #2c3e50;
    margin: 0 0 18px 0;
    font-weight: bold;
    letter-spacing: 4px;
}

.welcome-prompt {
    font-size: 16px;
    color: #7f8c8d;
    letter-spacing: 2px;
    animation: welcomePulse 1.5s infinite alternate ease-in-out;
}

/* 提示文字呼吸灯特效 */
@keyframes welcomePulse {
    0% {
        opacity: 0.3;
        transform: scale(0.97);
    }

    100% {
        opacity: 1;
        transform: scale(1.03);
    }
}

/* 触发开门状态时的样式 */
.welcome-screen.opened .welcome-content-box {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.8);
    transition: opacity 0.5s ease, transform 0.7s ease;
}

.site-footer {
    border-top: 1px solid #e8edf3;
    background-color: #fafbfc;
    padding: 5px 40px;
    text-align: center;
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 1s ease;
}

    .site-footer.fade-in {
        opacity: 1;
    }

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-copyright {
    font-weight: bold;
    color: #34495e;
    margin: 0 0 8px 0;
}

    .footer-copyright a {
        color: #c70541;
        text-decoration: none;
        font-weight: bold;
        transition: color 0.2s ease;
    }

        .footer-copyright a:hover {
            color: #8b032d;
            text-decoration: underline;
        }

.footer-disclaimer {
    font-size: 11px;
    color: #95a5a6;
    text-align: justify;
    text-justify: inter-word;
    margin: 0;
}

.email {
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

    .email:hover {
        color: #b200ff;
        text-decoration: underline;
    }

    .email:active {
        color: black;
    }

.route-map-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* 外层只负责横向滚动 */
.route-map {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

/* 内部弹性盒：强制撑开至所有站点的实际总宽 */
.route-map-inner {
    display: flex;
    position: relative;
    padding: 30px 10px 50px 10px;
    min-width: max-content;
}

/* 自定义滚动条 */
.route-map::-webkit-scrollbar {
    height: 6px;
}

.route-map::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.route-map::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* 基础底色路线轨道 */
.route-track {
    position: absolute;
    top: 42px;
    left: 55px; /* 10px 容器内边距 + 45px (半个站点宽度) */
    right: 55px;
    height: 6px;
    background-color: #e2e8f0;
    z-index: 1;
    border-radius: 3px;
}

/* 动态高亮运行轨道 */
.route-track-active {
    position: absolute;
    top: 42px;
    left: 55px;
    height: 6px;
    background-color: var(--line-color, #ccc);
    z-index: 1;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    width: 0;
}

/* 站点容器 */
.station-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    min-width: 90px;
    cursor: pointer;
    user-select: none;
}

/* 站点中心圆点 */
.station-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid #cbd5e1;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.station-node:hover .station-dot {
    border-color: var(--line-color, #64748b);
    transform: scale(1.15);
}

/* 当前高亮站状态 */
.station-node.active .station-dot {
    border-color: var(--line-color, #64748b);
    background-color: var(--line-color, #64748b);
    transform: scale(1.25);
    box-shadow: 0 0 8px var(--line-color, #64748b);
}

/* 下一站状态（空心高亮） */
.station-node.next-active .station-dot {
    border-color: var(--line-color, #64748b);
    background-color: #ffffff;
    border-width: 4px;
    transform: scale(1.25);
    box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

/* 站点标签倾斜排版 */
.station-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    position: absolute;
    top: 24px;
    transform: rotate(-35deg);
    transform-origin: top left;
    transition: all 0.3s ease;
}

.station-node.active .station-label,
.station-node.next-active .station-label {
    color: #1e293b;
    font-weight: bold;
}

/* 换乘标识标签 */
.transfer-tag {
    font-size: 9px;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 1px 4px;
    position: absolute;
    top: -22px;
    white-space: nowrap;
    transform: scale(0.9);
}

/* 行驶方向的三角形箭头 */
.route-track-arrow {
    position: absolute;
    top: 45px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 15px solid var(--line-color, #ccc);
    transform: translate(-50%, -50%);
    z-index: 3;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    animation: arrowPulse 1s infinite ease-in-out;
}

/* 箭头呼吸灯特效 */
@keyframes arrowPulse {
    0% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.9);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.9);
    }
}