/* 8684火车 样式 */
:root {
    --brand: #2f6fe4;
    --brand-dark: #2559c2;
    --brand-soft: #eaf1ff;
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1c2b3a;
    --muted: #8496a9;
    --line: #e6edf5;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(28, 43, 58, .05);
    --shadow-lg: 0 10px 30px rgba(28, 43, 58, .10);
    --ok: #3a9d6e;
    --warn: #e8a020;
    --bad: #9aa9ba;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Arial, sans-serif;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
li { list-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }
button, input { font: inherit; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 18px; padding-bottom: 30px; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-mark { display: flex; border-radius: 8px; overflow: hidden; }
.logo-text { font-size: 21px; font-weight: 800; color: var(--brand); letter-spacing: -.3px; }
.logo-text em { font-style: normal; color: var(--text); }
.header-search {
    display: flex; align-items: center; flex: 1; max-width: 420px;
    background: var(--bg); border: 1px solid transparent; border-radius: 999px;
    padding: 3px 3px 3px 14px; transition: .2s;
}
.header-search:focus-within { background: #fff; border-color: #cfe0ff; box-shadow: 0 0 0 3px rgba(47, 111, 228, .10); }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 7px 0; color: var(--text); }
.header-search input::placeholder { color: #a9b6c6; }
.header-search button {
    border: 0; background: var(--brand); color: #fff; border-radius: 999px;
    padding: 6px 16px; cursor: pointer; font-size: 14px;
}
.header-search button:hover { background: var(--brand-dark); }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.header-nav a { padding: 7px 12px; border-radius: 8px; color: #52657a; font-size: 14px; white-space: nowrap; }
.header-nav a:hover, .header-nav a.active { color: var(--brand); background: var(--brand-soft); }

/* ---------- 通用卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { padding: 18px 20px; margin-top: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head h2, .section h2 { font-size: 17px; font-weight: 700; }
.section-head h2::before, .section > h2::before {
    content: ""; display: inline-block; width: 4px; height: 15px; border-radius: 2px;
    background: var(--brand); margin-right: 8px; vertical-align: -2px;
}
.section-sub, .more { font-size: 13px; color: var(--muted); }
.more { color: var(--brand); }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 面包屑 ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 4px 2px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: #c3cedb; }

/* ---------- 首页 hero ---------- */
.home-hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; align-items: stretch; margin-top: 6px; }
.home-hero-left {
    background: linear-gradient(135deg, #ffffff 0%, #f2f7ff 100%);
    border-radius: 20px; padding: 30px 30px 26px; box-shadow: var(--shadow);
}
.home-hero-left h1 { font-size: 30px; line-height: 1.25; letter-spacing: -.5px; }
.home-hero-left > p { color: var(--muted); margin: 8px 0 18px; font-size: 14px; }
.code-form { display: flex; gap: 8px; margin-bottom: 14px; }
.pair-form { border-top: 1px dashed var(--line); padding-top: 14px; }
.pair-inputs { display: flex; gap: 8px; align-items: end; }
.pair-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; position: relative; }
.pair-field > span { font-size: 12px; color: var(--muted); }
.pair-field input[type=text], .code-form input, .search-box input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--line);
    border-radius: 12px; background: #fff; outline: none; transition: .2s;
}
.pair-field input[type=text]:focus, .code-form input:focus, .search-box input:focus {
    border-color: #a9c8ff; box-shadow: 0 0 0 3px rgba(47, 111, 228, .10);
}
.pair-field input.err { border-color: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .12); }
.pair-form > button, .code-form > button {
    border: 0; background: var(--brand); color: #fff; padding: 11px 22px;
    border-radius: 12px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
.pair-form > button:hover, .code-form > button:hover { background: var(--brand-dark); }
.swap-btn {
    border: 1px solid var(--line); background: #fff; color: var(--brand);
    width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 16px; flex: 0 0 40px;
}
.swap-btn:hover { background: var(--brand-soft); }
.search-box { display: flex; gap: 8px; margin: 4px 0 10px; }
.search-box button {
    border: 0; background: var(--brand); color: #fff; padding: 0 24px;
    border-radius: 12px; cursor: pointer; font-weight: 600;
}
.search-box button:hover { background: var(--brand-dark); }

/* 联想下拉 */
.ac-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
    background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
    border: 1px solid var(--line); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.ac-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; color: var(--text); font-size: 14px; }
.ac-list a:hover { background: var(--brand-soft); color: var(--brand); }
.ac-list a b { font-weight: 600; }
.ac-list a span { font-size: 12px; color: var(--muted); }

/* ---------- hero(车次/车站/站站) ---------- */
.hero { border-radius: 20px; padding: 24px 26px; color: #fff; box-shadow: var(--shadow-lg); overflow: hidden; position: relative; }
.hero::after {
    content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px;
    border-radius: 50%; background: rgba(255, 255, 255, .10);
}
.hero-train { background: linear-gradient(135deg, #1d4fa8 0%, #2f6fe4 60%, #5c9bff 100%); }
.hero-station { background: linear-gradient(135deg, #14532d 0%, #2d7a4f 55%, #5cab7c 100%); }
.hero-route { background: linear-gradient(135deg, #6d3a10 0%, #b06a1e 55%, #d99b45 100%); }
.hero-main { position: relative; z-index: 1; display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-city h1 { font-size: 25px; font-weight: 700; }
.hero-sub { font-size: 13px; opacity: .88; margin-top: 4px; }
.hero-sub .dot { margin: 0 6px; opacity: .6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pair-inline { display: flex; gap: 8px; align-items: end; }
.pair-inline .pair-field { flex: 0 0 200px; }
.pair-inline input[type=text] { padding: 8px 12px; }
.pair-inline button { border: 0; background: #fff; color: var(--brand); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }

/* ---------- 车次类型徽标 ---------- */
.tbadge {
    display: inline-block; font-size: 12px; font-weight: 600; line-height: 1;
    padding: 4px 7px; border-radius: 6px; vertical-align: 3px; margin-left: 6px;
    background: rgba(255,255,255,.22); color: #fff;
}
.tbadge-g, .tbadge-c { background: #2f6fe4; }
.tbadge-d, .tbadge-s { background: #1d9e8f; }
.tbadge-z { background: #7c4dd1; }
.tbadge-t { background: #d97706; }
.tbadge-k, .tbadge-l { background: #3a9d6e; }
.tbadge-y { background: #0ea5b7; }
.tbadge-p { background: #8896aa; }

/* ---------- 时刻表/余票表格 ---------- */
.tt-wrap { overflow-x: auto; }
.tt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tt-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tt-table td { padding: 11px 10px; border-bottom: 1px solid #f2f6fa; vertical-align: middle; white-space: nowrap; }
.tt-table tr:last-child td { border-bottom: 0; }
.tt-table tr:hover td { background: #f8fbff; }
.tt-station a { font-weight: 600; }
.day-diff { font-style: normal; font-size: 11px; color: #d97706; margin-left: 6px; }
.lt-table td:nth-child(2) b, .lt-table td:nth-child(3) b { display: block; font-size: 16px; }
.lt-code a { font-weight: 700; font-size: 15px; }
.lt-od { display: block; font-size: 12px; margin-top: 2px; }
.lt-seats { min-width: 200px; white-space: normal; max-width: 280px; }
.seat-chip {
    display: inline-block; font-size: 12px; line-height: 1; padding: 4px 7px;
    border-radius: 6px; margin: 2px 4px 2px 0; background: #f2f6fb; color: #445a70;
}
.seat-chip.ok { background: #e3f4ec; color: #2c7a4b; }
.seat-chip.num { background: #fdf3e2; color: #a2660a; }
.seat-chip.none { background: #f2f4f7; color: #aab6c5; text-decoration: line-through; }

/* ---------- chips ---------- */
.chip-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.city-chip {
    display: flex; align-items: center; gap: 6px; padding: 10px 12px;
    background: #f7f9fc; border-radius: 10px; color: var(--text);
    border: 1px solid transparent; transition: .15s; min-width: 0;
}
.city-chip:hover { background: #fff; border-color: #cfe0ff; color: var(--brand); box-shadow: 0 2px 8px rgba(47,111,228,.08); }
.chip-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-sub { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.pair-chip {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
    background: #f7f9fc; border-radius: 10px; color: var(--text); font-size: 13px;
    border: 1px solid transparent; transition: .15s;
}
.pair-chip:hover { background: #fff; border-color: #cfe0ff; color: var(--brand); }
.code-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.code-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
    background: #f7f9fc; border-radius: 10px; color: var(--text); font-weight: 600;
    border: 1px solid transparent; transition: .15s;
}
.code-chip:hover { background: #fff; border-color: #cfe0ff; color: var(--brand); }

/* ---------- 车站大全 ---------- */
.letter-nav { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.letter-nav a {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: #f2f6fb; font-weight: 700; font-size: 13px; color: #445a70;
}
.letter-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.letter-group { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed #eef3f9; }
.letter-group:first-of-type { border-top: 0; }
.letter { flex: 0 0 22px; font-weight: 700; color: var(--brand); font-size: 14px; }
.letter-cities { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.letter-cities a { font-size: 13px; color: #445a70; }
.letter-cities a:hover { color: var(--brand); }

/* ---------- 按钮/空态/SEO ---------- */
.section-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 9px 18px; border-radius: 10px; font-size: 14px; }
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.ghost { background: rgba(255,255,255,.9); color: var(--brand); }
.btn.ghost:hover { background: #fff; }
.btn.tiny { padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.seo-text { font-size: 13px; color: #5f7288; line-height: 1.8; }
.seo-text h2 { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.seo-text p + p { margin-top: 8px; }
.empty-card { padding: 26px 20px; }
.empty-card h1 { font-size: 20px; margin-bottom: 8px; }
.empty-card p { color: var(--muted); margin-bottom: 14px; }
.mini-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0f4f9; }
.mini-links a { font-size: 13px; color: var(--muted); }
.mini-links a:hover { color: var(--brand); }

/* ---------- footer ---------- */
.site-footer { margin-top: 26px; background: #fff; border-top: 1px solid var(--line); padding: 24px 0 30px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; margin-bottom: 10px; }
.footer-links a { font-size: 13px; color: #52657a; }
.footer-note { text-align: center; font-size: 12px; color: var(--muted); }
.footer-copy { text-align: center; font-size: 12px; color: #a2b0c0; margin-top: 6px; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .header-nav a:not(.active) { display: none; }
    .home-hero { grid-template-columns: 1fr; }
    .chip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pair-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    body { font-size: 14px; }
    .header-inner { height: 56px; gap: 10px; }
    .logo-text { font-size: 18px; }
    .header-search { max-width: none; }
    .header-search button { padding: 6px 12px; }
    .header-nav { display: none; }
    .hero { padding: 18px; border-radius: 16px; }
    .hero-city h1 { font-size: 21px; }
    .section { padding: 14px 14px; }
    .home-hero-left { padding: 22px 18px; }
    .home-hero-left h1 { font-size: 24px; }
    .pair-inputs { flex-wrap: wrap; }
    .swap-btn { align-self: end; }
    .chip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pair-inline { flex-wrap: wrap; }
    .pair-inline .pair-field { flex: 1 1 100%; }
    .hero-main { display: block; }
    .hero-actions { margin-top: 12px; }
}
