/* ==========================================================================
   列车时刻表 —— 在 cpudb style.css 基础上扩展的页面样式
   ========================================================================== */

/* ---------- 加载 / 空态 ---------- */

.boot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 90px 20px;
    color: var(--ink-3);
    font-size: 13.5px;
}

.boot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    animation: boot-pulse 1s ease-in-out infinite;
}

.boot-dot:nth-child(2) { animation-delay: .15s; }
.boot-dot:nth-child(3) { animation-delay: .3s; }

@keyframes boot-pulse {
    0%, 100% { opacity: .25; transform: scale(.85); }
    50% { opacity: 1; transform: scale(1); }
}

/* ---------- 首页统计 ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.stat-card {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.stat-label {
    font-size: 11.5px;
    color: var(--ink-3);
    letter-spacing: .02em;
}

.stat-value {
    margin-top: 4px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.stat-value small {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
}

/* ---------- 车型快捷入口 ---------- */

.type-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-1);
    transition: border-color .16s, color .16s, background .16s;
}

.type-chip:hover {
    border-color: var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand);
}

.type-chip b {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 5px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 800;
}

.type-chip span {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-3);
}

/* ---------- 首页热门列表（复用 panel / hot-list / new-list） ---------- */

.hot-side {
    flex: 1;
    min-width: 0;
}

.hot-item .hot-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-count {
    flex: none;
    font-size: 11.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* ---------- 车次详情 Hero ---------- */

.trn-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 26px;
    padding: 24px 26px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(620px 300px at 88% -40%, rgba(59, 130, 246, .34), transparent 65%),
        linear-gradient(120deg, #0b1a2c 0%, #0f2539 60%, #123049 100%);
    color: #fff;
    box-shadow: var(--shadow-2);
}

.trn-id {
    flex: none;
    min-width: 132px;
}

.trn-code {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
}

.trn-badge {
    display: inline-block;
    margin-top: 9px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: 11.5px;
    font-weight: 600;
}

.trn-badge + .trn-badge {
    margin-left: 5px;
}

.trn-route {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.trn-st {
    text-align: center;
}

.trn-st b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.trn-st span {
    display: block;
    margin-top: 3px;
    font-size: 19px;
    font-weight: 700;
    opacity: .9;
    font-variant-numeric: tabular-nums;
}

.trn-st small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, .55);
}

.trn-arrow {
    flex: 1;
    position: relative;
    min-width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, .22);
}

.trn-arrow::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -3px;
    border: 4px solid transparent;
    border-left-color: rgba(255, 255, 255, .4);
}

.trn-meta {
    flex: none;
    text-align: right;
    font-size: 12px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .72);
}

.trn-meta b {
    display: block;
    font-size: 15px;
    color: #fff;
}

/* ---------- 停站时刻表 ---------- */

.trn-tbl {
    border-top: 1px solid var(--border);
}

.trn-tbl-head,
.trn-tbl-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1.7fr) 104px 104px 82px;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
}

.trn-tbl-head {
    height: 38px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--ink-3);
}

.trn-tbl-row {
    min-height: 50px;
    border-bottom: 1px solid var(--border);
    transition: background .14s;
}

.trn-tbl-row:last-child {
    border-bottom: 0;
}

.trn-tbl-row:hover {
    background: var(--surface-2);
}

.trn-seq {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.trn-tbl-row.is-first .trn-seq {
    background: var(--brand);
    color: #fff;
}

.trn-tbl-row.is-last .trn-seq {
    background: var(--navy);
    color: #fff;
}

.trn-station {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 600;
}

.trn-station a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trn-station .tag {
    flex: none;
}

.trn-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.trn-time.is-dim {
    color: var(--ink-3);
    font-weight: 500;
}

.trn-time em {
    margin-left: 3px;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    color: var(--brand);
    vertical-align: super;
}

.trn-stay {
    font-size: 12.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* ---------- 列表表格（车站 / 车次） ---------- */

.data-table--trn .data-head,
.data-table--trn .data-row {
    grid-template-columns: 82px minmax(0, 1.5fr) minmax(0, 1fr) 82px 82px 64px;
}

.data-table--trn.is-station .data-head,
.data-table--trn.is-station .data-row {
    grid-template-columns: 82px minmax(0, 1.3fr) 88px 82px 82px 64px;
}

.cell-code {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.data-row:hover .cell-code {
    color: var(--brand);
}

.cell-time {
    font-size: 13px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.cell-time.is-dim {
    color: var(--ink-3);
}

/* ---------- 城市导航 ---------- */

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.city-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 600;
    transition: border-color .15s, color .15s, background .15s;
}

.city-card:hover {
    border-color: var(--brand-line);
    background: var(--brand-soft);
    color: var(--brand);
}

.city-card span {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ink-3);
}

.city-group + .city-group {
    margin-top: 22px;
}

.city-group-title {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-2);
}

/* ---------- 说明 / 免责 ---------- */

.notice {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    background: var(--brand-soft);
    color: var(--ink-2);
    font-size: 12.5px;
    line-height: 1.75;
}

.notice svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    color: var(--brand);
}

.doc-list {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-2);
    font-size: 13px;
    line-height: 1.9;
}

/* ---------- 搜索建议 ---------- */

.header-search {
    position: relative;
}

.header-search .sug {
    left: auto;
    right: 0;
    top: calc(100% + 10px);
    width: 340px;
    max-width: min(86vw, 340px);
}

.hero-search .search-wrap input {
    width: 100%;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.sug {
    position: absolute;
    z-index: 60;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-2);
}

.sug[hidden] {
    display: none;
}

.sug-group {
    padding: 7px 10px 3px;
    font-size: 11px;
    color: var(--ink-3);
    letter-spacing: .06em;
}

.sug-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
}

.sug-item:hover,
.sug-item.is-active {
    background: var(--surface-2);
}

.sug-item b {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sug-item span {
    color: var(--ink-3);
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sug-item .sug-kind {
    flex: none;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--ink-3);
    font-size: 10px;
    line-height: 16px;
    letter-spacing: 0;
}

.sug-empty {
    padding: 14px 12px;
    color: var(--ink-3);
    font-size: 12.5px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trn-meta {
        text-align: left;
    }
}

@media (max-width: 720px) {
    .data-table--trn .data-head,
    .data-table--trn .data-row,
    .data-table--trn.is-station .data-head,
    .data-table--trn.is-station .data-row {
        grid-template-columns: 68px minmax(0, 1.3fr) 72px 72px;
    }

    .data-table--trn .col-type,
    .data-table--trn .col-dur,
    .data-table--trn .col-stay {
        display: none;
    }
}

@media (max-width: 640px) {
    .trn-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 18px;
    }

    .trn-id {
        min-width: 0;
    }

    .trn-code {
        font-size: 28px;
    }

    .trn-route {
        width: 100%;
        min-width: 0;
        gap: 10px;
    }

    .trn-st b {
        font-size: 16px;
    }

    .trn-st span {
        font-size: 16px;
    }

    .trn-meta {
        width: 100%;
        font-size: 11.5px;
    }

    .trn-tbl-head,
    .trn-tbl-row {
        grid-template-columns: 42px minmax(0, 1.4fr) 70px 70px;
        gap: 6px;
        padding: 0 12px;
    }

    .trn-tbl-head .col-stay,
    .trn-tbl-row .col-stay {
        display: none;
    }

    .trn-station {
        font-size: 13.5px;
    }

    .trn-station .tag {
        display: none;
    }

    .trn-time {
        font-size: 13px;
    }

    .city-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}
