/* 车次 · 时刻查询 /tools/train —— 极简界面，复用站点主题变量 */
body.page-train-full .app { max-width: 100%; }
body.page-train-full .main-content { max-width: 100%; width: 100%; border-right: 0; }

.tr-page {
    max-width: none; margin: 0; box-sizing: border-box;
    padding: 18px 20px 56px;
}

/* Hero */
.tr-hero { display: flex; align-items: center; gap: 16px; padding: 10px 4px 16px; }
.tr-hero-ic {
    width: 56px; height: 56px; border-radius: 16px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 30px;
    background: linear-gradient(135deg, var(--accent, #136ce9), color-mix(in srgb, var(--accent, #136ce9) 55%, #fff));
    box-shadow: 0 6px 18px rgba(19,108,233,.18);
}
.tr-hero-text h1 { margin: 0; font-size: 24px; font-weight: 700; }
.tr-hero-text p { margin: 4px 0 0; color: var(--text-secondary, #6b7280); font-size: 14px; }

.tr-notice {
    display: flex; gap: 8px; align-items: flex-start;
    background: color-mix(in srgb, var(--accent, #136ce9) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, #136ce9) 22%, transparent);
    border-radius: 10px; padding: 10px 12px; margin-bottom: 16px;
    font-size: 13px; color: var(--text-secondary, #6b7280); line-height: 1.6;
}
.tr-notice > span:first-child { color: var(--accent, #136ce9); font-weight: 700; }
.tr-notice strong { color: var(--text-primary, #1f2430); }

/* 模式切换 */
.tr-seg-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tr-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-secondary, #f1f3f7); border-radius: 12px; }
.tr-seg-btn {
    border: 0; background: transparent; cursor: pointer; padding: 8px 18px; border-radius: 9px;
    font-size: 14px; font-weight: 600; color: var(--text-secondary, #6b7280);
}
.tr-seg-btn.is-active { background: var(--bg-primary, #fff); color: var(--accent, #136ce9); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* 搜索条 */
.tr-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tr-field { flex: 1 1 240px; min-width: 0; position: relative; }
.tr-field-date { flex: 0 0 170px; }
.tr-field-station { flex: 1 1 200px; }
.tr-field-row { display: flex; gap: 8px; align-items: center; flex: 2 1 360px; }
.tr-arrow { color: var(--text-secondary, #6b7280); font-weight: 700; }
.tr-hint { margin: -6px 0 14px; font-size: 13px; color: var(--text-secondary, #6b7280); }
/* 自动定位失败时，高亮提示补充区间 */
.tr-field-row.is-needed .tr-input { border-color: var(--accent, #136ce9); }
.tr-field-row.is-needed .tr-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #136ce9) 18%, transparent); }
.tr-input {
    width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: 15px;
    border: 1px solid var(--border-color, #e3e6ec); border-radius: 10px;
    background: var(--bg-primary, #fff); color: var(--text-primary, #1f2430); outline: none;
}
.tr-input:focus { border-color: var(--accent, #136ce9); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #136ce9) 18%, transparent); }
.tr-btn {
    flex: 0 0 auto; border: 0; cursor: pointer; padding: 11px 22px; border-radius: 10px;
    font-size: 15px; font-weight: 600; color: #fff; background: var(--accent, #136ce9);
    transition: filter .15s ease;
}
.tr-btn:hover { filter: brightness(1.05); }
.tr-btn:disabled { opacity: .6; cursor: progress; }

/* 结果区 */
.tr-results { margin-top: 4px; }
.tr-empty { color: var(--text-secondary, #6b7280); font-size: 14px; padding: 18px 4px; }
.tr-empty b { color: var(--accent, #136ce9); }
.tr-err {
    display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 14px;
    background: color-mix(in srgb, #e5484d 10%, transparent);
    border: 1px solid color-mix(in srgb, #e5484d 30%, transparent);
    border-radius: 10px; padding: 12px 14px; font-size: 14px; color: #b42318; line-height: 1.6;
}
.tr-loading { color: var(--text-secondary, #6b7280); font-size: 14px; padding: 14px 4px; }

/* 车次概览卡 */
.tr-summary {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px;
    padding: 14px 16px; margin-bottom: 14px; border-radius: 12px;
    background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e3e6ec);
}
.tr-summary .tr-code { font-size: 22px; font-weight: 800; color: var(--accent, #136ce9); letter-spacing: .5px; }
.tr-summary .tr-route { font-size: 16px; font-weight: 600; }
.tr-summary .tr-route .tr-arrow-in { color: var(--text-secondary, #6b7280); margin: 0 6px; font-weight: 400; }
.tr-summary .tr-meta { color: var(--text-secondary, #6b7280); font-size: 13px; }
.tr-summary .tr-copy {
    margin-left: auto; border: 1px solid var(--border-color, #e3e6ec); background: var(--bg-secondary, #f1f3f7);
    color: var(--text-secondary, #6b7280); border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.tr-summary .tr-copy:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }

/* 时刻表 */
.tr-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border-color, #e3e6ec); background: var(--bg-primary, #fff); }
table.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.tr-table th, table.tr-table td { padding: 10px 12px; text-align: left; white-space: nowrap; }
table.tr-table thead th {
    position: sticky; top: 0; background: var(--bg-secondary, #f1f3f7); color: var(--text-secondary, #6b7280);
    font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border-color, #e3e6ec);
}
table.tr-table tbody tr { border-bottom: 1px solid color-mix(in srgb, var(--border-color, #e3e6ec) 60%, transparent); }
table.tr-table tbody tr:last-child { border-bottom: 0; }
table.tr-table td.tr-col-no { color: var(--text-secondary, #6b7280); width: 48px; }
table.tr-table td.tr-col-name { font-weight: 600; }
table.tr-table tr.tr-origin td.tr-col-name,
table.tr-table tr.tr-terminus td.tr-col-name { color: var(--accent, #136ce9); }
table.tr-table .tr-time { font-variant-numeric: tabular-nums; font-weight: 600; }
table.tr-table .tr-time.tr-dash { color: var(--text-secondary, #6b7280); font-weight: 400; }
table.tr-table .tr-stay { color: var(--text-secondary, #6b7280); }
table.tr-table .tr-dist { color: var(--text-secondary, #6b7280); font-variant-numeric: tabular-nums; }
table.tr-table .tr-day {
    display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 6px;
    background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; vertical-align: middle;
}
table.tr-table tr.tr-day2 td.tr-col-name { /* 跨天站名高亮 */ }

/* 站站查询结果列表 */
.tr-train-list { display: flex; flex-direction: column; gap: 10px; }
.tr-train {
    border: 1px solid var(--border-color, #e3e6ec); border-radius: 12px; background: var(--bg-primary, #fff);
    padding: 12px 14px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.tr-train:hover { border-color: var(--accent, #136ce9); box-shadow: 0 2px 10px rgba(19,108,233,.10); }
.tr-train-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tr-train-head .tr-tcode { font-size: 17px; font-weight: 800; color: var(--accent, #136ce9); }
.tr-train-head .tr-ttimes { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-train-head .tr-tarrow { color: var(--text-secondary, #6b7280); margin: 0 6px; }
.tr-train-head .tr-tdur { color: var(--text-secondary, #6b7280); font-size: 13px; }
.tr-train-head .tr-tmore { margin-left: auto; color: var(--text-secondary, #6b7280); font-size: 13px; }
.tr-train-detail { margin-top: 10px; }
.tr-train .tr-empty { padding: 10px 0; }

/* 自动补全 */
.tr-ac {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; margin: 0; padding: 4px;
    list-style: none; background: var(--bg-primary, #fff); border: 1px solid var(--border-color, #e3e6ec);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 280px; overflow-y: auto;
}
.tr-ac li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.tr-ac li:hover, .tr-ac li.is-active { background: color-mix(in srgb, var(--accent, #136ce9) 10%, transparent); }
.tr-ac .tr-ac-name { font-weight: 600; }
.tr-ac .tr-ac-py { color: var(--text-secondary, #6b7280); font-size: 12px; }

/* 设置按钮与面板 */
.tr-settings-btn {
    flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--border-color, #e3e6ec);
    background: var(--bg-secondary, #f1f3f7); border-radius: 10px; cursor: pointer;
    font-size: 17px; line-height: 1; color: var(--text-secondary, #6b7280);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tr-settings-btn:hover { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }
.tr-settings-btn[aria-expanded="true"] { border-color: var(--accent, #136ce9); color: var(--accent, #136ce9); }
.tr-settings-mask {
    position: fixed; inset: 0; z-index: 100000; padding: 16px;
    background: rgba(15,20,30,.42); display: flex; align-items: center; justify-content: center;
}
.tr-settings-mask[hidden] { display: none; }
.tr-settings-panel {
    width: min(360px, 100%); background: var(--bg-primary, #fff); border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,.28); overflow: hidden; color: var(--text-primary, #1f2430);
}
.tr-settings-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; font-weight: 700; font-size: 15px;
    border-bottom: 1px solid var(--border-color, #e3e6ec);
}
.tr-settings-close {
    border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--text-secondary, #6b7280);
    width: 28px; height: 28px; border-radius: 8px; line-height: 1;
}
.tr-settings-close:hover { background: var(--bg-secondary, #f1f3f7); color: var(--text-primary, #1f2430); }
.tr-settings-body { padding: 16px; }
.tr-settings-row { display: flex; flex-direction: column; gap: 10px; }
.tr-settings-label { font-size: 13px; color: var(--text-secondary, #6b7280); font-weight: 600; }
.tr-settings-opts { display: flex; gap: 14px; flex-wrap: wrap; }
.tr-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.tr-settings-tip { margin: 14px 0 0; font-size: 12px; color: var(--text-secondary, #6b7280); line-height: 1.5; }

/* 响应式 */
@media (max-width: 767px) {
    .tr-page { padding: 14px 14px 48px; }
    .tr-seg-bar { flex-wrap: wrap; }
    .tr-hero-ic { width: 46px; height: 46px; font-size: 26px; }
    .tr-hero-text h1 { font-size: 20px; }
    .tr-search { gap: 8px; }
    .tr-field-date { flex: 1 1 100%; }
    .tr-field-station { flex: 1 1 100%; }
    .tr-arrow { display: none; }
    .tr-btn { flex: 1 1 100%; padding: 12px; }
    .tr-summary .tr-code { font-size: 19px; }
    .tr-summary .tr-copy { margin-left: 0; }
}
