/* ============================================================
   ticket_generator.php · 纪念车票票面
   版本号：v2.19.0 (2026-11-20)
   更新日志：
   v1.x   赛博蓝底（#0a192f + #64ffda），blue / green / red 三变体
   v2.0.7 导出改为 PNG（带透明通道），圆角外透明，四角圆弧与网页预览一致；
          JPG 不支持透明，圆角只能靠填色，无法还原圆弧
   v2.0.6 圆角描边与裁剪圆弧同心，修掉左下/右下角露白缺口；画布铺白底
   v2.0.5 底部色条纳入圆角裁剪，不再盖住圆角、溢出纸面
   v2.0.4 票面整体改为 canvas 绘制，几何与文字全部取自 DOM 实测，
          彻底不再依赖 html2canvas / SVG 的排版结果
   v2.0.3 导出改为背景走 SVG、文字走 canvas 实测坐标绘制，
          绕开 SVG 独立渲染时的字体回退差异，框线与文字彻底对齐
   v2.0.2 导出改用 SVG foreignObject + canvas，由浏览器原生排版，
          彻底消除 html2canvas 的中文基线偏移（框线压字、拼音叠站名）
   v2.0.1 修复 html2canvas 导出 JPG 后文字与边框错位：
          所有文字容器补显式 line-height，角标弃用 flex 垂直居中改 line-height 撑高，
          票号/信息行/站名块内边距加大，让文字即使基线偏移也不碰框线
   v2.0.0 票面改为真实票纸，按主题切换：
          暗色 → 中国铁路红票（软纸票）：浅粉纸底 + 红棕字 + 底部红条
          亮色 → 中国铁路蓝票（磁介质票）：浅蓝纸底 + 深蓝字 + 底部蓝条
          表单区改跟随全站主题变量
   ============================================================ */

.ticket-section .ticket-generator-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ticket-preview-wrapper {
    width: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ── 票面：暗色 = 中国铁路红票 ───────────────────────────── */
.ticket-preview {
    --tk-paper:  #FBF4EC;
    --tk-ink:    #1B1B1B;
    --tk-ink-2:  #7A5B4C;
    --tk-accent: #B03A2E;
    --tk-accent-2:#8C2A20;
    --tk-line:   rgba(176, 58, 46, 0.22);
    --tk-panel:  rgba(255, 255, 255, 0.50);
    --tk-shadow: rgba(110, 55, 35, 0.20);

    width: 520px;
    max-width: 520px;
    flex: 0 0 520px;
    margin: 0 auto;
    height: auto;
    transform-origin: top center;
    min-height: 300px;
    border: 1px solid var(--tk-line);
    border-radius: 8px;
    padding: 14px 18px 24px;
    background: var(--tk-paper);
    color: var(--tk-ink);
    box-shadow: 0 10px 28px var(--tk-shadow);
    font-family: "PingFang SC", "Microsoft YaHei", monospace;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

/* 软纸横纹 */
.ticket-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(176, 58, 46, 0.035) 0px,
        rgba(176, 58, 46, 0.035) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 0;
}
/* 票根底条：用真实元素而非伪元素，保证 html2canvas 导出 JPG 时能渲染出来 */
.ticket-preview .ticket-stub {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 9px;
    background: linear-gradient(90deg, var(--tk-accent-2) 0%, var(--tk-accent) 55%, var(--tk-accent-2) 100%);
    z-index: 2;
    pointer-events: none;
}
.ticket-preview > * { position: relative; z-index: 1; }

/* ── 票面：亮色 = 中国铁路蓝票 ───────────────────────────── */
:root[data-theme="light"] .ticket-preview {
    --tk-paper:  #EEF5FC;
    --tk-ink:    #123A63;
    --tk-ink-2:  #4C6F94;
    --tk-accent: #1B5FA8;
    --tk-accent-2:#144A83;
    --tk-line:   rgba(27, 95, 168, 0.22);
    --tk-panel:  rgba(255, 255, 255, 0.55);
    --tk-shadow: rgba(28, 62, 105, 0.18);
}
:root[data-theme="light"] .ticket-preview::before {
    background-image: repeating-linear-gradient(
        0deg,
        rgba(27, 95, 168, 0.035) 0px,
        rgba(27, 95, 168, 0.035) 1px,
        transparent 1px,
        transparent 4px
    );
}

/* ── 票号与角标 ── */
.ticket-preview .ticket-code-area {
    position: absolute; top: 12px; left: 18px;
    font-size: 12px; line-height: 18px; letter-spacing: 0.5px;
    color: var(--tk-accent);
    background: var(--tk-panel);
    padding: 4px 9px;
    border-radius: 3px;
    border: 1px solid var(--tk-line);
}
.ticket-preview .corner-tag {
    position: absolute; top: 12px; right: 18px;
    box-sizing: border-box;
    min-width: 34px; height: 30px; padding: 0 9px;
    line-height: 28px; text-align: center;
    border: 1px solid var(--tk-accent);
    background: transparent;
    display: inline-block;
    font-size: 14px; font-weight: 700; color: var(--tk-accent);
    border-radius: 3px; white-space: nowrap;
}

/* ── 车次 ── */
.ticket-preview .train-number-area { text-align: center; margin-top: 46px; margin-bottom: 6px; }
.ticket-preview .train-number {
    font-size: 24px; line-height: 1.3; font-weight: 700; color: var(--tk-ink);
    border-bottom: 2px solid var(--tk-accent);
    padding-bottom: 7px; display: inline-block;
    letter-spacing: 1px;
}

/* ── 站名 ── */
.ticket-preview .station-container {
    display: flex; justify-content: center; align-items: flex-start;
    margin-bottom: 12px; gap: 36px; flex-wrap: wrap;
}
.ticket-preview .depart-station,
.ticket-preview .arrive-station {
    text-align: center; flex: 0 0 auto;
    min-width: 80px; max-width: 200px;
    padding: 4px 6px 9px;
    border-bottom: 1px dashed var(--tk-line);
}
.ticket-preview .station-name {
    font-size: 26px; line-height: 1.2; font-weight: 800; color: var(--tk-ink);
    margin-bottom: 5px;
    white-space: nowrap;
    letter-spacing: 1px;
}
.ticket-preview .station-pinyin {
    font-size: 11px; line-height: 1.5; color: var(--tk-ink-2);
    white-space: nowrap; letter-spacing: 1.5px; text-transform: uppercase;
}
.ticket-preview .arrow {
    font-size: 26px; color: var(--tk-accent); font-weight: 700;
    width: 36px; text-align: center; flex-shrink: 0;
    display: inline-block; transform: scaleX(1.4);
    transform-origin: center; line-height: 1.2;
    align-self: center; margin-top: -6px;
}

/* ── 信息行 ── */
.ticket-preview .info-row1,
.ticket-preview .info-row2 {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 6px; font-size: 14px; line-height: 1.5;
    color: var(--tk-ink);
    background: var(--tk-panel);
    padding: 7px 10px;
    border-radius: 3px;
    border: 1px solid var(--tk-line);
}
.ticket-preview .price {
    font-size: 19px; line-height: 1.2; font-weight: 800; color: var(--tk-accent);
}
.ticket-preview .ticket-rule {
    font-size: 11px; line-height: 1.5; color: var(--tk-ink-2);
    text-align: center; margin-top: 10px; letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════
   水牌专用字体：思源黑体 Bold 子集（GB2312 一级字 + ASCII）
   自托管，保证页面与导出 canvas 用同一套字形
   ══════════════════════════════════════════════════════════ */
@font-face {
    font-family: "ZhanPaiFang";
    src: url("../assets/fonts/FangYuan-Bold.woff2") format("woff2");
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "ZhanPaiHei";
    src: url("../assets/fonts/ZhanPaiHei-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* ══════════════════════════════════════════════════════════
   v2.1.0 模块外壳 · 表单 · Tab · 水牌
   ══════════════════════════════════════════════════════════ */

@font-face {
    font-family: "STXinwei";
    src: url("../assets/fonts/STXinwei.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

/* 方正大黑（怀旧水牌站名 / 等级字 / 拼音，v2.19.23）
   FZDaHei-B02S，unitsPerEm 256，仅 Regular 一字重。
   老式铅字黑体：横画末端斜切、撇捺刀切，与上世纪站牌字模一致。
   子集：GB2312 全集 + 拉丁字母 + 数字 + 常用标点，844KB。 */
@font-face {
    font-family: "FZDaHei";
    src: url("../assets/fonts/FZDaHei-B02S-sub.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

.tg-head { margin-bottom: 18px; }
.tg-head h3 { margin: 0 0 6px; }
.tg-headsub {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 6px 18px; flex-wrap: wrap;
}
.tg-note {
    margin: 0; font-size: 13px; color: var(--ink-2);
    letter-spacing: 0.2px;
}

/* ── 表单：桌面一行六列 ─────────────────────────────────── */
.tg-form {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) 1fr 1fr 1fr 0.85fr 1fr;
    gap: 14px;
    align-items: end;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
}
.tg-f { min-width: 0; }
.tg-f > label {
    display: block; margin-bottom: 6px;
    font-size: 12px; color: var(--ink-2);
    letter-spacing: 0.6px;
}
.tg-f input,
.tg-f select {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    padding: 9px 11px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    color: var(--ink);
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.tg-f input:focus,
.tg-f select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .18);
}
.tg-f select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                      linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
    cursor: pointer;
}
/* 只读字段：虚线边框 + 弱化底色，视觉上不可改 */
.tg-f .tg-ro {
    border-style: dashed;
    border-color: var(--line-2);
    background: var(--bg-0);
    color: var(--ink-2);
    cursor: default;
}
.tg-f .tg-ro:focus { border-color: var(--line-2); box-shadow: none; }

/* 车次：前缀按钮 + 号码 */
.tg-train { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.tg-pfx {
    display: flex; gap: 3px; flex: 1 1 auto;
    min-width: 0;
}
.tg-pfx button {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 0;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: 6px;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
}
.tg-pfx button:hover { border-color: var(--accent); color: var(--accent); }
.tg-pfx button.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-0);
}
#tg-num {
    width: 74px; flex: 0 0 74px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.tg-f-arrive { position: relative; }

/* ── Tab ────────────────────────────────────────────────── */
.tg-tabs {
    display: flex;
    gap: 4px;
    margin: 20px 0 14px;
    padding: 4px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    width: fit-content;
}
.tg-tabs button {
    padding: 8px 22px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all .2s;
}
.tg-tabs button:hover { color: var(--ink); }
.tg-tabs button.is-on {
    background: var(--bg-1);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

/* ── 预览舞台 ───────────────────────────────────────────── */
.tg-stage {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 0;
    padding: 8px 0 4px;
}
.tg-pane { display: none; width: 100%; }
.tg-pane.is-on { display: flex; justify-content: center; align-items: flex-start; }

.tg-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}
/* ══ v2.18.56 下载 + 打印：一个按钮斜向一分为二 ══
   两块用 clip-path 各切掉一个斜角，拼起来正好是一条 1px 的斜缝；
   容器底色从缝里透出来，所以不需要额外画分隔线。 */
.tg-split {
    --sp-h: 54px;                          /* 按钮高 */
    --sp-cut: 26px;                        /* 斜边的水平投影 */
    --sp-ink: var(--accent, #405838);      /* 跟随站点主色，取不到时用站牌绿 */
    position: relative;
    display: inline-flex;
    height: var(--sp-h);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, .55);  /* 斜缝颜色 */
    box-shadow: 0 3px 14px rgba(0, 0, 0, .16), inset 0 0 0 1px rgba(0, 0, 0, .05);
    isolation: isolate;
}
.tg-split button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    border: 0;
    height: 100%;
    padding: 0 30px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background-color: var(--sp-ink);
    background-image: none;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .05em;
    white-space: nowrap;
    cursor: pointer;
    transition: background-image .2s;
}
.tg-split .sp-ico {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* 左半：右下角切掉一个斜角 */
.tg-split .sp-a {
    padding-right: calc(30px + var(--sp-cut));
    clip-path: polygon(0 0, calc(100% - 1px) 0, calc(100% - var(--sp-cut) - 1px) 100%, 0 100%);
}
/* 右半：左上角切掉一个斜角，负边距让它咬进左半的斜边里 */
.tg-split .sp-b {
    margin-left: calc(-1 * var(--sp-cut));
    padding-left: calc(30px + var(--sp-cut));
    clip-path: polygon(calc(var(--sp-cut) + 1px) 0, 100% 0, 100% 100%, 1px 100%);
    /* 只压背景不压字：叠一层半透明黑，别用 filter —— filter 会把白字一起压灰 */
    background-image: linear-gradient(rgba(0, 0, 0, .14), rgba(0, 0, 0, .14));
}
.tg-split button:hover {
    background-image: linear-gradient(rgba(255, 255, 255, .12), rgba(255, 255, 255, .12));
}
.tg-split .sp-b:hover {
    background-image: linear-gradient(rgba(0, 0, 0, .02), rgba(0, 0, 0, .02));
}
.tg-split button:active {
    background-image: linear-gradient(rgba(0, 0, 0, .22), rgba(0, 0, 0, .22));
}
.tg-split button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
/* 下载次数统计：说明行右侧一行小字，随说明行一起换行 */
.tg-dlstat {
    margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 9px;
    font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
    letter-spacing: .02em; text-align: right; opacity: .92;
    font-variant-numeric: tabular-nums;
}
.tg-dlstat-t { opacity: .78; }
.tg-dli { white-space: nowrap; }
.tg-dli b { font-weight: 500; }
.tg-dli i { font-style: normal; opacity: .5; margin-left: 9px; }
.tg-dli:last-child i { display: none; }
.tg-dlstat[hidden] { display: none; }


/* ══════════════════════════════════════════════════════════
   纪念水牌：10:2 方向牌
   基准 759×154 实测 → 5:1；拼音条 26%；底距 4%；左右各 36%
   ══════════════════════════════════════════════════════════ */
.plaque {
    --pc: #405838;
    --pc2: #405838;
    position: relative;
    width: 100%;
    max-width: 760px;
    aspect-ratio: 5 / 1;
    display: flex;
    background: #F4F2ED;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.16), inset 0 0 0 1px rgba(0,0,0,.10);
    container-type: inline-size;
    flex: 0 0 auto;
    font-family: "ZhanPaiHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

.plaque .side {
    position: absolute;
    top: 0;
    width: 36%;
    height: 100%;
    overflow: visible;
}
.plaque .side:first-child { left: 0; }
.plaque .side:last-child  { right: 0; }
.plaque .side:last-child .bar { left: auto; right: 0; }
.plaque .name {
    position: absolute;
    /* 盒子取文字自身宽度：内容再宽也不会因溢出而丢失居中。
       水平位置由 alignBars 按色条中心用 px 设定 */
    left: 50%;
    width: max-content;
    transform: translateX(-50%);
    transform-origin: center center;
    bottom: 34%;
    text-align: center;
    font-size: 9.02cqw;
    font-weight: 700;
    line-height: 1.32;
    color: #1A1A1A;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
}
.plaque .bar {
    position: absolute;
    left: 0;
    bottom: 4%;
    height: 26%;
    width: var(--bw, 36%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pc);
    color: #FFFFFF;
    border-radius: 1px;
    overflow: hidden;
}
.plaque .bar .py {
    font-family: "Source Han Sans SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 3.6cqw;
    letter-spacing: 0.12cqw;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
}

/* 拼色：左条 104deg 主→副，右条 76deg 副→主（镜像）
   G 走「龙凤呈祥」的红+祥龙黄，金色端白字偏弱，给拼音加一层轻阴影 */
.plaque .bar.split {
    background: linear-gradient(104deg, var(--pc) 0 60%, var(--pc2) 60% 100%);
}
.plaque .side:last-child .bar.split {
    background: linear-gradient(76deg, var(--pc2) 0 40%, var(--pc) 40% 100%);
}
.plaque .bar.split .py {
    text-shadow: 0 1px 2px rgba(0, 0, 0, .34);
}
/* 国槐绿 + 黄腰线：斜向拼色 65/35，避开 22 型客车那种横贯式黄腰带。
   拼音用白字、不加描边与阴影——绿区清楚，黄区偏弱但视觉干净 */
.plaque .bar.split4 {
    background: linear-gradient(104deg, var(--pc) 0 65%, var(--pc2) 65% 100%);
}
.plaque .side:last-child .bar.split4 {
    background: linear-gradient(76deg, var(--pc2) 0 35%, var(--pc) 35% 100%);
}
.plaque .bar.split2 {
    background: linear-gradient(104deg, var(--pc) 0 55%, var(--pc2) 55% 100%);
    color: #1F2428;
    box-shadow: inset 0 0 0 1px rgba(28,36,44,.24);
}
.plaque .side:last-child .bar.split2 {
    background: linear-gradient(76deg, var(--pc2) 0 45%, var(--pc) 45% 100%);
}

/* 中间区：等级字 - 路徽 - 等级字，车次在下方 */
.plaque .mid {
    position: absolute;
    top: 0; left: 36%;
    width: 28%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 1.2cqw;
    box-sizing: border-box;
}
.plaque .lvrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5cqw;
}
.plaque .emb {
    width: 12.6cqw;
    height: 12.6cqw;
    /* 路徽图片本身是圆形透明底，不裁切、不拉伸，原样完整显示 */
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}
.plaque .lv {
    font-size: 3.3cqw;
    font-weight: 700;
    line-height: 1;
    color: #1A1A1A;
    white-space: nowrap;
    transform: translateY(-4.6cqw);
}
.plaque .no {
    font-family: "Source Han Sans SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 2.25cqw;
    font-weight: 500;
    line-height: 1;
    color: #1A1A1A;
    letter-spacing: 0.04cqw;
    margin-top: 0.6cqw;
    white-space: nowrap;
}

/* ── 响应式 ─────────────────────────────────────────────── */
@media (max-width: 1000px) {
    .tg-form {
        grid-template-columns: repeat(3, 1fr);
    }
    .tg-f-train { grid-column: span 3; }
}
@media (max-width: 760px) {
    .tg-form {
        grid-template-columns: repeat(2, 1fr);
        padding: 14px;
        gap: 12px;
    }
    .tg-f-train { grid-column: span 2; }
    .tg-f-date  { grid-column: span 2; }
    .tg-train { flex-wrap: nowrap; }
    .tg-pfx { gap: 2px; }
    .tg-pfx button { font-size: 11px; padding: 8px 0; }
    #tg-num { width: 64px; flex: 0 0 64px; }
    .tg-stage { min-height: 0; padding: 4px 0; }
    .tg-tabs { width: 100%; }
    .tg-tabs button { flex: 1; padding: 8px 0; }
    .tg-split { width: 100%; }
    .tg-split button { flex: 1 1 auto; justify-content: center; padding: 0 16px; }
    .tg-split .sp-a { padding-right: calc(16px + var(--sp-cut)); }
    .tg-split .sp-b { padding-left: calc(16px + var(--sp-cut)); }
    .tg-headsub { flex-direction: column; align-items: flex-start; }
    .tg-dlstat { text-align: left; }
}

/* 窄屏车票：不改宽度、不改字号，只做整体等比缩放（JS 计算 scale）
   这样任何屏幕、任何 DPI 下车票的版面比例都完全一致，
   offsetWidth 恒为 520，导出 PNG 也不会变形。 */
@media (max-width: 600px) {
    .ticket-preview-wrapper { overflow: hidden; }
}

/* 车票两字站名：中间空半个字位（三字及以上不加） */
.ticket-preview .station-name.len2 {
    letter-spacing: 0.3em;
    margin-left: 0.3em;
}

/* 车票站名放大，减少票面留白 */
.ticket-preview .station-name {
    font-size: 32px;
    margin-bottom: 6px;
}

/* 水牌字体：提高优先级，避免被站点全局字体覆盖；栈里补 SimSun/STSong，
   让没有思源宋体的 Windows 也落到宋体而不是无衬线 */
.ticket-section .plaque {
    font-family: "ZhanPaiHei", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
}
/* 站名 / 等级字 / 车次：同一字体，切换时一起变 */
.ticket-section .plaque .name,
.ticket-section .plaque .lv,
.ticket-section .plaque .no {
    font-family: "ZhanPaiHei", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    font-weight: 700;
}
/* 拼音条保持无衬线 */
.ticket-section .plaque .py {
    font-family: "Source Han Sans SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

/* 水牌容器：切换条 + 牌面 */
.tg-pane-inner {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tg-fontsw {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;      /* v2.13.7 字体胶囊与上方表单拉开，避免贴边 */
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--ink-2);
    flex-wrap: wrap;
}
.tg-fontsw button {
    padding: 5px 14px;
    background: var(--bg-1);
    border: 1px solid var(--line-2);
    border-radius: 5px;
    color: var(--ink-2);
    font-size: 13px;
    cursor: pointer;
    transition: all .18s;
}
.tg-fontsw button:hover { border-color: var(--accent); color: var(--accent); }
.tg-fontsw button.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-0);
}

/* 方圆体：站名、等级字、车次一起换 */
.ticket-section .plaque.font-fang .name,
.ticket-section .plaque.font-fang .lv,
.ticket-section .plaque.font-fang .no {
    font-family: "ZhanPaiFang", "ZhanPaiHei", sans-serif;
    font-weight: 600;   /* 方圆体是可字体，wght 轴 200–700，600 与宋体 SemiBold 观感一致 */
}

/* 方圆体与黑体同字号（9.024cqw），不再单独缩档 */
.ticket-section .plaque.font-fang .name {
    font-size: 9.024cqw;
}

/* v2.13.8 拼音也跟随方圆体。此前只换了站名/等级字/车次，拼音一直留在
   Source Han Sans，切到阿里方圆后拼音还是黑体，视觉上两套字混在一起。
   方圆体拉丁字母比黑体略宽（M 0.912em vs 0.853em），字号保持不变，
   靠色条宽度余量吸收。 */
.ticket-section .plaque.font-fang .bar .py {
    font-family: "ZhanPaiFang", "ZhanPaiHei", sans-serif;
    font-weight: 600;
}

/* 字体切换对车票同样生效 */
.ticket-section .ticket-preview {
    font-family: "ZhanPaiHei", "PingFang SC", "Microsoft YaHei", monospace;
}
.ticket-section .ticket-preview.font-fang,
.ticket-section .ticket-preview.font-fang .station-name,
.ticket-section .ticket-preview.font-fang .train-number {
    font-family: "ZhanPaiFang", "PingFang SC", sans-serif;
}
.tg-fontsw-tip {
    font-size: 12px;
    color: var(--ink-2);
    opacity: .7;
    margin-left: 4px;
}

/* 真实车次开关 */
.tg-real {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-weight: 400;
    font-size: 12px;
    opacity: .8;
    cursor: pointer;
    user-select: none;
}
.tg-real input {
    width: 13px;
    height: 13px;
    margin: 0;
    accent-color: currentColor;
    cursor: pointer;
}
.tg-real em {
    font-style: normal;
    letter-spacing: .02em;
}
/* ── 站名联想下拉 ── */
.suggestions-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-1); border: 1px solid var(--line-2);
    border-radius: 0 0 6px 6px; max-height: 200px;
    overflow-y: auto; z-index: 1000; display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.suggestions-dropdown div {
    padding: 8px 12px; cursor: pointer; color: var(--ink);
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.suggestions-dropdown div:hover { background: var(--bg-3); color: var(--accent); }
.suggestions-dropdown div strong { color: var(--accent); font-weight: 600; }
.suggestions-dropdown div small { color: var(--ink-3); margin-left: 8px; }

/* ══════════════════════════════════════════════════════════
   怀旧水牌模式 v2.18.52
   中间块尺寸固定、站名固定字框、字高统一，均不跟随字体/配色切换。
   牌面 5:1，容器高 20cqw；字高 11.8cqw（0.59 牌高），字数只影响字宽与字距。
   ══════════════════════════════════════════════════════════ */
.plaque.old {
    background: #F4F2ED;
}
/* 站名：固定字框 33.5cqw，左框 3.5cqw 起、右框 63cqw 起；
   垂直中心落在 0.378 牌高（容器高 15.12cqw 后居中） */
.plaque.old .old-cell {
    position: absolute;
    top: 0;
    height: 15.12cqw;
    width: 33.5cqw;
    display: flex;
    align-items: center;
    justify-content: center;
}
.plaque.old .old-cell-l { left: 3.5cqw; }
.plaque.old .old-cell-r { left: 63cqw; }
.plaque.old .old-name {
    font-family: "FZDaHei", "ZhanPaiHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
    font-weight: 400;
    color: #1A1A1A;
    line-height: 1;
    white-space: nowrap;
    transform-origin: center center;
    /* v2.19.23 换方正大黑：ascent 229 / descent -62（upm 256），
       line-height:1 下行盒高 1em、基线下 0.826em，汉字墨迹中心 0.344em，
       墨迹偏上 0.018em；实测 top:0.45cqw 时墨迹中心 0.3786 牌高，与原站牌黑版（top:-0.57cqw）完全一致 */
    position: relative;
    top: 0.45cqw;
    /* 老牌油墨扩散补偿：实拍笔画比方正大黑 Regular 粗一档，
       0.45px @ 9.024cqw ≈ 预览 112px 下的 0.8px */
    -webkit-text-stroke: 0.45px currentColor;
    paint-order: stroke fill;
}
/* 中间块：箭头 18cqw 宽、等级字 5.26cqw 高，任何站名组合都用同一套尺寸 */
.plaque.old .old-mid {
    position: absolute;
    left: 50%;
    top: 0;
    height: 15.12cqw;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.plaque.old .old-lvrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4.1cqw;
    height: 5.26cqw;
    /* 站牌黑 CJK 字面在字身框里整体偏右约 0.042em（5.45cqw 字号下 0.23cqw），
       整行左移同样数值，字面中心才与箭头圆圈、等级拼音落在同一条中线上 */
    transform: translateX(-0.23cqw);
}
.plaque.old .old-lv {
    display: block;
    width: 5.14cqw;
    font-family: "FZDaHei", "ZhanPaiHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
    font-size: 5.45cqw;
    font-weight: 400;
    line-height: 5.26cqw;
    text-align: center;
    color: #C0272D;
    -webkit-text-stroke: 0.45px currentColor;
    paint-order: stroke fill;
}
.plaque.old .old-arrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 18cqw;
    height: 2.06cqw;
    margin-top: 0.9cqw;
}
.plaque.old .old-dot {
    display: block;
    width: 2.06cqw;
    height: 2.06cqw;
    border-radius: 50%;
    background: #C0272D;
}
.plaque.old .old-tri {
    display: block;
    width: 7.72cqw;
    height: 1.65cqw;
    background: #C0272D;
}
.plaque.old .old-tri-l { clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.plaque.old .old-tri-r { clip-path: polygon(100% 50%, 0 0, 0 100%); }
.plaque.old .old-bar {
    position: absolute;
    left: 0; right: 0; bottom: 2.5%;
    height: 23.7%;
    background: #1F488A;
    border-radius: 1px;
}
.plaque.old .old-py {
    position: absolute;
    top: 50%;
    /* v2.18.54 大写字母块居中：行盒固定 1em（normal 会被取整成整数 px，
       小断点上纵向比例会漂）；站牌黑 ascent 1160 / descent 288，
       行盒中心落在基线下 0.436em，大写字面中心在基线上 0.375em，
       两者差 0.061em，向上补掉即字面居中 */
    line-height: 1;
    /* 末字后多出的一段字距会把字面中心拉左半个字距，右移补回 */
    transform: translate(calc(-50% + 0.0325em), calc(-50% - 0.06em));
    font-family: "FZDaHei", "ZhanPaiHei", "Arial", sans-serif;
    font-weight: 400;
    font-size: 2.94cqw;
    color: #fff;
    white-space: nowrap;
    letter-spacing: .10em;
    -webkit-text-stroke: 0.45px currentColor;
    paint-order: stroke fill;
}
.plaque.old .old-py-lv {
    font-size: 2.12cqw;
}

/* ══════════════════════════════════════════════════════════
   硬板车票 v2.14.0 —— 5.7cm × 2cm，canvas 绘制
   ══════════════════════════════════════════════════════════ */
#pane-ticket-old {
    flex-direction: column;
    align-items: center;
}
/* v2.18.41 正反两面：宽屏并排，窄屏一次一面由胶囊切换 */
/* 硬板票要放下两面，容器比其它 pane 宽 */
#pane-ticket-old .tg-pane-inner { max-width: 1120px; }
.ot-frame {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    line-height: 0;
}
.ot-side {
    min-width: 0;
    line-height: 0;
}
.ot-side canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .16);
}
.ot-cap {
    margin-top: 9px;
    line-height: 1.4;
    font-size: 11px;
    letter-spacing: .22em;
    text-indent: .22em;
    color: var(--ink-2);
    text-align: center;
    opacity: .62;
}
.ot-fallback { grid-column: 1 / -1; }
/* 窄屏：一次只出现一面 */
@media (max-width: 779px) {
    .ot-frame { grid-template-columns: 1fr; gap: 0; }
    .ot-side { display: none; }
    .ot-frame[data-side="front"] .ot-side[data-side="front"],
    .ot-frame[data-side="back"]  .ot-side[data-side="back"] { display: block; }
    .ot-cap { display: none; }
}
/* 宽屏：当前选中的一面加一圈细描边，提示下载的是它 */
@media (min-width: 780px) {
    .ot-frame[data-side="front"] .ot-side[data-side="front"] canvas,
    .ot-frame[data-side="back"]  .ot-side[data-side="back"] canvas {
        box-shadow: 0 3px 14px rgba(0, 0, 0, .16), 0 0 0 2px rgba(255, 255, 255, .22);
    }
    .ot-frame[data-side="front"] .ot-side[data-side="front"] .ot-cap,
    .ot-frame[data-side="back"]  .ot-side[data-side="back"] .ot-cap {
        color: var(--ink);
        opacity: .9;
    }
}
/* 正面 / 背面 切换 */
.ot-side-sw {
    display: inline-flex;
    align-items: center;
    margin: 16px auto 0;
    padding: 3px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 999px;
    background: rgba(0, 0, 0, .035);
    line-height: 1;
}
.ot-side-sw button {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: none;
    margin: 0;
    padding: 7px 20px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    letter-spacing: .12em;
    text-indent: .12em;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .18s, color .18s;
}
.ot-side-sw button:hover { color: var(--ink); }
.ot-side-sw button.on {
    background: rgba(128, 128, 128, .26);
    color: var(--ink);
    font-weight: 600;
}
.ot-opts {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px auto 0;
    font-size: 13px;
    color: var(--ink-2);
    flex-wrap: wrap;
    justify-content: center;
}
.ot-opts-lab { color: var(--ink-2); }
.ot-opts label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    color: var(--ink);
}
.ot-opts input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    margin: 0;
    border: 1.5px solid var(--ink-2);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}
.ot-opts input[type="radio"]:checked { border-color: var(--accent, #C8102E); }
.ot-opts input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent, #C8102E);
    transform: translate(-50%, -50%);
}
.ot-tip {
    margin: 10px auto 0;
    font-size: 12px;
    color: var(--ink-2);
    opacity: .8;
    text-align: center;
}
@media (max-width: 640px) {
    .ot-opts { gap: 12px; font-size: 12px; }
}

.ot-fallback {
    display: block;
    margin: 0;
    padding: 20px 16px;
    font-size: 13px;
    line-height: 1.8;
    color: #C8102E;
    text-align: center;
    border: 1px dashed rgba(200, 16, 46, .55);
    border-radius: 6px;
    background: rgba(200, 16, 46, .06);
}

/* ══════════ 纪念车票 · 红票 / 蓝票 ══════════
   票面 85.6×53.98mm，四角 1.6mm 圆角。
   红票留白边（印刷区四边内缩 左右 3.5mm、上下 2.9mm）；
   蓝票不设白边，通体浅蓝到底，底部 3.5mm 深蓝条收边。 */
@font-face{font-family:"RT TrainCode";src:url("../assets/fonts/traincode.ttf") format("truetype");font-weight:400;font-display:block}
@font-face{font-family:"RT DuanHeiSong";src:url("../assets/fonts/ChillDuanHeiSong-sub.woff2") format("woff2");font-weight:400;font-display:block}
@font-face{font-family:"RT TicketNum";src:url("../assets/fonts/idcode.otf") format("opentype");font-weight:700;font-display:block}
/* 拼音专用：Noto Serif CJK 的西文子集（58 个字形，8.5KB，OFL 授权）
   随包提供，保证 Windows / Mac / 安卓看到的是同一款字，不再各机器一个样 */
@font-face{font-family:"RT Pinyin";src:url("../assets/fonts/PinyinSerif-sub.woff2") format("woff2");font-weight:400;font-style:normal;font-display:block}

.rt-ticket.rt {
    position: relative;
    width: 85.6mm;
    height: 53.98mm;
    overflow: hidden;
    border-radius: 1.6mm;
    color: #151515;
    background: #fff;
    text-align: left;
    line-height: normal;
    font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.rt-ticket.rt-red  { --rt-paper: #F1D2CE; --rt-paper2: #E7B9B4; }
.rt-ticket.rt-blue { --rt-paper: #B9D6F4; --rt-paper2: #AECDEB; background: #B9D6F4; }

.rt-ticket.rt .rt-bg {
    position: absolute;
    left: 3.5mm; right: 3.5mm; top: 2.9mm; bottom: 2.9mm;
    border-radius: .5mm;
    background: radial-gradient(130% 100% at 50% 0%, var(--rt-paper) 0%, var(--rt-paper2) 100%);
}
.rt-ticket.rt-blue .rt-bg { left: 0; right: 0; top: 0; bottom: 0; border-radius: 0; }
.rt-ticket.rt-blue::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5.6mm;
    background: #78ADDC;
}

/* 票号字体：手机上（iOS / 安卓）没有 Arial Narrow，会掉到系统默认无衬线，
   字宽一下涨两成 —— 所以随包带一个 1.2KB 的窄体子集（PT Sans Narrow，OFL），
   只含 A~Z 与 0-9（票号首字母改成 24 字母随机后，只带 K 会让字母掉回系统字体）。
   桌面仍优先用本机 Arial Narrow，观感不变。 */
@font-face {
    font-family: "RT Serial";
    src: url("../assets/fonts/SerialNarrow3-sub.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
}
.rt-ticket.rt .rt-serial {
    position: absolute; left: 6.4mm; top: 4.7mm;
    font-family: "Arial Narrow", "RT Serial", "Nimbus Sans Narrow", "Liberation Sans Narrow", Arial, sans-serif;
    font-size: 4.6mm; font-weight: 400; letter-spacing: .72mm; color: #C63C1C;
}
.rt-ticket.rt-blue .rt-serial { left: 4.8mm; top: 3.1mm; color: #F58392; }
/* 票号首字母：Arial Narrow 的 K 比数字宽 21%，真票是等宽铅字、只宽 3%。
   rtSnFit() 按「数字平均墨宽 ÷ 首字母墨宽」算压缩比，横向压扁并把后面的数字拉回来，
   使整串回到等宽节奏。压缩比写在 style 上，导出 canvas 读 data-snk 复现。 */
.rt-ticket.rt .rt-sn-l1, .rt-ticket.rt-blue .rt-sn-l1 {
    display: inline-block; transform-origin: 0 50%;
    font: inherit; letter-spacing: inherit; color: inherit;
}
.rt-ticket.rt .rt-sn-rest, .rt-ticket.rt-blue .rt-sn-rest {
    display: inline-block;
    font: inherit; letter-spacing: inherit; color: inherit;
}
.rt-ticket.rt .rt-check {
    position: absolute; right: 5.4mm; top: 4.5mm;
    font-size: 2.95mm; font-weight: 700;
}

.rt-ticket.rt .rt-stblk { position: absolute; top: 10.0mm; width: 28.5mm; text-align: center; }
.rt-ticket.rt .rt-l { left: 3.6mm; }
.rt-ticket.rt .rt-r { right: 7.2mm; }
.rt-ticket.rt .rt-station {
    /* 站名就是普通黑体（v2.18.61）：实拍票竖笔画占字高 9.1%，
       Regular 约 7.8%、加 0.0222em 描边后 9.9% 偏重，所以不加描边、不加粗。
       也别写 font-weight:700 —— 系统字库没有 500 档时会直接跳 700，
       Windows 落到微软雅黑 Bold，比真票重一半。 */
    display: flex; align-items: baseline; justify-content: center;
    font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 4.76mm; font-weight: 400; letter-spacing: 0; white-space: nowrap; line-height: 1.05;
    /* 普通黑体再描 0.011em 细边：竖笔画占字高落到 9.1%，与实拍票一致。
       用 em 不用 px，5 字以上站名缩字号时粗细比例不变。 */
    -webkit-text-stroke: 0.011em currentColor;
    paint-order: stroke fill;
}
.rt-ticket.rt .rt-station > * { flex: none; }
/* 「站」字墨高是站名的 0.685，3.18mm 时实测 0.688；
   与站名的空隙按实拍票 26px（字高 109px）留，即 1.00mm */
.rt-ticket.rt .rt-suf { font-size: 3.18mm; letter-spacing: 0; margin-left: 1.00mm; position: relative; }
.rt-ticket.rt .rt-pinyin {
    /* 字号提到 2.55mm 后行盒变高，行高锁 1、上边距收到 .45mm，
       否则拼音下缘会压到 18.3mm 的日期行 */
    margin-top: .45mm; line-height: 1;
    /* 实物拼音：a / g 都是双层结构、衬线是粗壮的小方角、笔画对比不高，
       这是 Century Schoolbook 那一路「书版衬线」，不是 Times（衬线太细）、
       也不是 Courier（太宽）、更不是宋体西文（a、g 是单层）。
       所以随包带一个 8.5KB 的西文子集（RT Pinyin，Noto Serif 的西文，OFL），
       各机器看到的一致；2.55mm 时大写高 1.86mm ＝ 站名的 0.39（实物 0.39）。
       字距 .20mm（v2.18.65）：实拍票 Ha'erbin 字母之间是分开的、每处约 0.2 字高，
       原来收 -.15mm 把字母压得贴在一起，是错的；放开后整串 "Ha'erbin" 宽约
       站名墨宽的 0.59（实物 0.60） */
    font-family: "RT Pinyin", "Noto Serif CJK SC", "Century Schoolbook", "C059", Georgia, serif;
    font-size: 2.55mm; letter-spacing: .10mm; white-space: nowrap;
}

.rt-ticket.rt .rt-trainno {
    position: absolute; left: 0; right: 0; top: 10.30mm; text-align: center;
    font-family: "RT TrainCode", "Ume P Mincho", "Noto Serif CJK SC", serif;
    font-size: 4.76mm; font-weight: 400; letter-spacing: .48mm; text-indent: .48mm;
}
.rt-ticket.rt .rt-arrow {
    position: absolute; left: 50%; transform: translateX(-50%); top: 15.6mm;
    width: 13.8mm; height: 1.5mm; overflow: visible;
}

.rt-ticket.rt .rt-daterow { position: absolute; top: 18.3mm; left: 5.6mm; white-space: nowrap; line-height: 1; }
/* 行内元素吃不到 transform，改成 inline-block 才能做亚像素位移 */
.rt-ticket.rt .rt-daterow .rt-cn { display: inline-block; }
.rt-ticket.rt .rt-num {
    font-family: "RT TicketNum", Arial, Helvetica, sans-serif;
    font-size: 3.4mm; font-weight: 700; letter-spacing: .02mm;
}
.rt-ticket.rt .rt-cn {
    /* 年 / 月 / 日 / 开 / 车 / 号 / 上中下铺 / 元 都是黑体（v2.18.63），
       原来用的是宋体。与站名同一套字体栈，各机器落到同一个黑体。 */
    font-family: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1.95mm; font-weight: 400; margin: 0 .1mm; letter-spacing: 0;
    /* 与席别同一档：普通黑体 + 0.015em 描边（v2.18.64） */
    -webkit-text-stroke: 0.015em currentColor;
    paint-order: stroke fill;
}
.rt-ticket.rt .rt-daterow .rt-num { font-size: 3.8mm; }
/* 年/月/日/开 与前面的数字之间留小半个字宽（2.25mm 的 0.38 ≈ 0.85mm），右侧保持 .30mm */
.rt-ticket.rt .rt-daterow .rt-cn  { font-size: 2.25mm; margin: 0 .30mm 0 .85mm; position: relative; }

.rt-ticket.rt .rt-seatno {
    position: absolute; top: 18.3mm; left: 45.65mm; width: 38mm;
    /* 基线对齐：车 / 号 与数字先站同一条基线，再由脚本按字形墨迹把中线补平 */
    display: flex; align-items: baseline; justify-content: center;
    white-space: nowrap; line-height: 1; text-align: center;
}
.rt-ticket.rt .rt-seatno > * { flex: none; }
.rt-ticket.rt .rt-seatno .rt-num { font-size: 3.57mm; }
/* 车 / 号 比数字小一号；两套字体基线不同，字框居中后仍会低约 0.58mm，
   按实测墨迹中心上提，视觉上才真正与数字齐中 */
.rt-ticket.rt .rt-seatno .rt-cn  { font-size: 2.20mm; margin: 0 .26mm; position: relative; }
/* 卧铺：「号 + 上/中/下铺」与座位号同大 */
.rt-ticket.rt .rt-seatno .rt-bed { font-size: 2.89mm; margin: 0 0 0 .26mm; position: relative; }

/* 无座：车厢号与「无座」之间留一点空 */
.rt-ticket.rt .rt-seatno .rt-cn.rt-noseat { margin-left: 1.00mm; }

.rt-ticket.rt .rt-pricerow {
    /* 22.2 → 23.15 → 23.84：￥ 与日期行之间留出行距（对齐参考票 1.48mm 的空） */
    position: absolute; top: 23.84mm; left: 5.6mm; white-space: nowrap; line-height: 1;
    /* 居中：￥ 的字形上伸比数字高，改成基线对齐会把整行压低，所以保持盒居中，
       再由脚本按实测墨迹中心补平 */
    display: flex; align-items: center; justify-content: flex-start;
}
.rt-ticket.rt .rt-pricerow > * { flex: none; }
.rt-ticket.rt .rt-pricerow .rt-num { font-size: 3.6mm; }
.rt-ticket.rt .rt-pricerow .rt-cn  { font-size: 2.25mm; margin: 0 .12mm; position: relative; }

/* ￥ 与价格数字同大；￥ 字形本身比数字略高，上提 0.24mm 后上下对称 */
.rt-ticket.rt .rt-pricerow .rt-cn.rt-cur {
    /* ￥ 不在这次的改字范围内，仍是宋体西文那一路，别跟着 .rt-cn 变黑体 */
    font-family: "SimSun", "Songti SC", "AR PL UMing CN", "Source Han Serif SC", serif;
    /* ￥ 高度与价格数字齐平（3.6mm，墨迹同为 2.64mm）；
       但它是全角字形，占满一格，视觉上显得又宽又大——横向收到 0.8，
       再用负边距把收出来的两侧空隙吃掉，跟数字贴住 */
    font-size: 3.6mm;
    margin: 0 -.28mm 0 -.28mm;
    transform: scaleX(.8);
}

.rt-ticket.rt .rt-seatcls {
    position: absolute; top: 23.9mm; left: 45.65mm; width: 38mm;
    text-align: center; font-size: 3.21mm; font-weight: 400; line-height: 1;
    /* 每个字之间留一点点空（v2.18.65），原来字与字是紧挨着的 */
    letter-spacing: .10mm;
    /* 席别也是普通黑体，只是比站名「浑厚」一档：描 0.015em。
       原来写 700，Windows 落到微软雅黑 Bold，比实拍票重。 */
    -webkit-text-stroke: 0.015em currentColor;
    paint-order: stroke fill;
}

.rt-ticket.rt .rt-limit,
.rt-ticket.rt .rt-reimb {
    position: absolute; left: 5.6mm; line-height: 1;
    font-family: "RT DuanHeiSong", "Source Han Sans SC", sans-serif;
    font-size: 3.21mm; font-weight: 400; letter-spacing: .12mm;
}
.rt-ticket.rt .rt-limit { top: 27.6mm; }
.rt-ticket.rt .rt-reimb { top: 31.4mm; }

/* 姓名 / 身份证号行：已取消，保留空行占位，勿删 */
.rt-ticket.rt .rt-blankrow {
    position: absolute; top: 36.9mm; left: 5.6mm; width: 74mm; height: 3.6mm; visibility: hidden;
}

.rt-ticket.rt .rt-adbox {
    position: absolute; left: 5.6mm; top: 38.8mm; width: 47mm; height: 7.6mm;
    /* 虚线不用 border dashed：浏览器按 CSS 像素算段长，换缩放比段数就变，
       和 canvas 导出永远对不上。改成四条按毫米定死的渐变条。
       周期与段长走 --ad-pitch / --ad-dash：JS 按「乘」到「新」的实际宽度
       除以 24 算出来再写进行内样式，顶端恒为 24 段。
       下面这两个值只是 JS 还没跑时的兜底。 */
    --ad-dash: 1.175mm;
    --ad-pitch: 1.9583mm;
    --ad-gap: 0.7833mm;
    --ad-arm: 0.40mm;      /* 拐角 L 的横臂长度 */
    border: 0; border-radius: .4mm; box-sizing: border-box;
    /* 上下边：把整宽等分成 24 块平铺，每块内画 60% 实线 + 40% 空白，
       24 块首尾相接正好铺满，右端不会因除不尽被切出一个残段（那会多数出一段）。
       左右边：仍按 --ad-pitch 循环，长短边长度不同不影响顶端的 24 段。 */
    background-image:
        linear-gradient(to right, rgba(25,25,25,.8) 0 60%, transparent 60% 100%),
        linear-gradient(to right, rgba(25,25,25,.8) 0 60%, transparent 60% 100%),
        repeating-linear-gradient(to bottom, rgba(25,25,25,.8) 0 var(--ad-dash), transparent var(--ad-dash) var(--ad-pitch)),
        repeating-linear-gradient(to bottom, rgba(25,25,25,.8) 0 var(--ad-dash), transparent var(--ad-dash) var(--ad-pitch)),
        /* 四个拐角是 L 型：竖臂由左右边的第一段给出，这里补四条横臂接成 L */
        linear-gradient(to right, rgba(25,25,25,.8) 0 100%),
        linear-gradient(to right, rgba(25,25,25,.8) 0 100%),
        linear-gradient(to right, rgba(25,25,25,.8) 0 100%),
        linear-gradient(to right, rgba(25,25,25,.8) 0 100%);
    /* 25 段：整宽 = 25×段长 + 26×间隔（两端各留一个间隔，拐角才单独成段）。
       段长 : 间隔 = 3 : 2 → 整宽 = 63.5×间隔，故 间隔 = 宽/63.5、段长 = 1.5×间隔，
       一块 = 段长 + 间隔 = 宽/25.4，按这个宽度平铺 25.4 次正好铺满。 */
    background-size: calc(100% / 25.4) .28mm, calc(100% / 25.4) .28mm, .28mm 100%, .28mm 100%,
                     var(--ad-arm) .28mm, var(--ad-arm) .28mm, var(--ad-arm) .28mm, var(--ad-arm) .28mm;
    background-position: var(--ad-gap) 0, var(--ad-gap) 100%, 0 0, 100% 0,
                         0 0, 100% 0, 0 100%, 100% 100%;
    background-repeat: repeat-x, repeat-x, no-repeat, no-repeat,
                       no-repeat, no-repeat, no-repeat, no-repeat;
    text-align: center; padding-top: 1.28mm; line-height: 1.15;   /* 原 1.0mm + 0.28mm 边框厚度，去掉边框后补回 */
}
.rt-ticket.rt-blue .rt-adbox {
    left: 5.5mm; top: 39.7mm; width: 54.3mm;
    /* 兜底值：蓝票按 54.3mm / 24 段算。实际由 JS 按文字边界覆盖 */
    --ad-dash: 1.3573mm;
    --ad-pitch: 2.2625mm;
}
.rt-ticket.rt .rt-l1 { font-size: 2.45mm; font-weight: 700; letter-spacing: .2mm; white-space: nowrap; }
.rt-ticket.rt .rt-l2 {
    font-family: "Times New Roman", "Noto Serif CJK SC", serif;
    font-size: 2.15mm; letter-spacing: .35mm; margin-top: .6mm; white-space: nowrap;
}

.rt-ticket.rt .rt-barcode {
    position: absolute; left: 5.6mm; top: 47.85mm; line-height: 1; z-index: 3;
    font-size: 2.55mm; letter-spacing: 0; white-space: nowrap; font-weight: 400;
}
/* 无座：车厢号与「无座」之间留一点空 */
.rt-ticket.rt .rt-seatno .rt-cn.rt-noseat { margin-left: 1.00mm; }
/* 数字串 + J M 作为一个整体，宽度由脚本按「开」字右边界反算字号。
   条码行字号比「售」小、墨迹也偏上，纵向拉高 1.42 倍之后顶边仍高出「售」约 0.12mm，
   所以整行再下移 0.12mm，让数字串 / J M / 站名售 三者墨迹底边齐平。 */
.rt-ticket.rt .rt-bcline {
    display: inline-block; white-space: nowrap;
    transform: translateY(.12mm) scaleY(1.42); transform-origin: 0 100%;
}
/* J M 与数字串分开，间隔由脚本按 1 个字宽补 */
.rt-ticket.rt .rt-bcjm {
    display: inline-block;
    transform: translateY(.12mm) scaleY(1.42); transform-origin: 0 100%;
}
.rt-ticket.rt .rt-soldat {
    display: inline-block; font-size: 2.89mm; margin-left: 1.2mm;
    letter-spacing: .1mm; transform: translateY(-.40mm);
}
.rt-ticket.rt-blue .rt-barcode { top: 49.85mm; }

.rt-ticket.rt .rt-qr { position: absolute; right: 6.4mm; top: 34.0mm; width: 13.3mm; height: 13.3mm; }
.rt-ticket.rt-blue .rt-qr { right: 3.7mm; }
.rt-ticket.rt .rt-qr img { width: 100%; height: 100%; display: block; }

/* 到达站不合格：输入框标红 + 下方提示（内容由 JS 写入） */
.tg-f-arrive input.is-bad { border-color: #c0392b; box-shadow: 0 0 0 2px rgba(192,57,43,.15); }
.tg-bad-hint { display: none; margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #e0786a; }

.rt-wrap { display: flex; justify-content: center; }

/* 红蓝票同屏：宽屏两张并排、窄屏单张 + 票面单选 */
.rt-duo { display: block; }
.rt-duo .rt-wrap-alt { display: none; }
.rt-duo .rt-wrap.is-sel .rt { outline: 2px solid rgba(127,169,200,.5); outline-offset: 4px; }
/* 红蓝票并排断点与 JS（tgPickWide / rtDuoWide）统一到 900px，
   否则 780~899 会出现「CSS 认为并排、JS 认为单选」的错位 */
@media (min-width: 900px) {
    .rt-duo { display: flex; gap: 30px; justify-content: center; align-items: flex-start; }
    .rt-duo .rt-wrap-alt { display: flex; }
    .rt-duo .rt-wrap { cursor: pointer; }
    #rt-opts { display: none; }
}

@media (max-width: 640px) {
    .rt-ticket.rt { border-radius: 1.2mm; }
}

/* 未从车站详情页进入时的提示：不渲染车票模块，只留一条说明 */
.tg-need-detail {
    display: flex; align-items: center; gap: 10px;
    padding: 26px 8px; color: var(--ink-2, #6b7280);
    font-size: 14px; line-height: 1.7;
}
.tg-need-detail i { font-size: 15px; opacity: .8; }

/* ══ v2.18.59 打印：按实物尺寸出（cm），只留 #tg-print-sheet ══
   宽度由 JS 写在 img 的行内样式上（红票 9cm、蓝票 8.6cm、硬板票 5.7cm），
   高度 auto 跟着票面比例走；没给宽度的（水牌）仍按页宽铺满。
   两张以上（硬板票正反）在打印纸上并排，gap 6mm。 */
#tg-print-sheet { display: none; }
@media print {
    html, body { background: #fff !important; }
    body.is-printing > *:not(#tg-print-sheet) { display: none !important; }
    body.is-printing #tg-print-sheet {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6mm;
        align-items: flex-start;
        margin: 0;
        padding: 0;
    }
    body.is-printing #tg-print-sheet img {
        display: block;
        max-width: 100%;
        height: auto;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    body.is-printing #tg-print-sheet img.tg-p-full { width: 100%; }
    @page { margin: 12mm; }
}

/* ══════════════════════════════════════════════════════════
   v2.19.0 车票 / 水牌 / 留影 —— 四 tab 并为三 tab
   宽屏：同类两种款式并排、点选决定下载目标
   窄屏(<900px)：退回单一项目 + 单选条
   ══════════════════════════════════════════════════════════ */

/* —— 窄屏票面/牌面单选条，默认不显示 —— */
.tg-pick-bar { display: none; }

@media (min-width: 900px) {
    /* 舞台变成横向排布容器，同类 pane 并排 */
    .tg-stage {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
        align-items: flex-start;
    }
    .tg-stage > .tg-pane.is-on {
        display: flex;
        flex: 1 1 0;
        min-width: 0;
    }
    /* 水牌：纪念 / 怀旧 左右各一半 */
    .tg-stage[data-tab="plaque"] > #pane-plaque.is-on,
    .tg-stage[data-tab="plaque"] > #pane-plaque-old.is-on { flex: 1 1 0; }
    /* 留影独占整行 */
    .tg-stage > #pane-photo.is-on { flex: 1 1 100%; }

    /* 硬板票 pane 内部不再限宽，跟随 pane 宽度 */
    #pane-ticket-old .tg-pane-inner { max-width: none; }

    /* —— 点选态：选中加青色描边，未选压暗 —— */
    .tg-stage .rt-wrap { cursor: pointer; transition: opacity .18s ease; }
    .tg-stage .rt-wrap.is-sel .rt {
        outline: 3px solid #2fb3c9;
        outline-offset: 6px;
        border-radius: 4px;
    }
    .tg-stage .rt-wrap:not(.is-sel) { opacity: .55; }

    .tg-stage .ot-frame { cursor: pointer; transition: opacity .18s ease; }
    /* 正反两面共用一个外框，不再各自描边 */
    .tg-stage .ot-frame.is-pick {
        outline: 3px solid #2fb3c9;
        outline-offset: 6px;
        border-radius: 4px;
    }
    .tg-stage .ot-frame.is-pick .ot-side { outline: none !important; }
    .tg-stage .ot-frame:not(.is-pick) { opacity: .55; }

    .tg-stage .plaque { cursor: pointer; transition: opacity .18s ease; }
    .tg-stage .plaque.is-pick { outline: 3px solid #2fb3c9; outline-offset: 8px; }
    .tg-stage .plaque:not(.is-pick) { opacity: .8; }

}

@media (max-width: 899px) {
    /* 窄屏只显示选中的那一个 pane。
       注意不能用 #pane-ticket 这类 id 选择器写 display:none —— id 权重高于
       .tg-pane.is-on，会把整个舞台清空。 */
    .tg-stage > .tg-pane:not(.is-on) { display: none; }
    .tg-stage > .tg-pane.is-off { display: none !important; }

    /* 单选条：显隐由 JS 控制（写 inline display），这里只管排版 */
    .tg-pick-bar {
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 14px;
        padding: 12px 0 4px;
        font-size: 13.5px;
        color: #3d4a52;
    }
    .tg-pick-bar .tg-pick-lab { margin-right: 0; }
    .tg-pick-bar label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
    }
    .tg-pick-bar input { position: absolute; opacity: 0; pointer-events: none; }
    .tg-pick-bar i {
        width: 15px; height: 15px;
        border: 1.5px solid #9aa7b0;
        border-radius: 50%;
        display: inline-block;
        position: relative;
    }
    .tg-pick-bar input:checked + i { border-color: #2fb3c9; }
    .tg-pick-bar input:checked + i::after {
        content: "";
        position: absolute;
        inset: 3px;
        border-radius: 50%;
        background: #2fb3c9;
    }
    .tg-pick-lab { color: #7b8993; margin-right: 2px; }

    /* 窄屏一次只显示一张，点选描边没有意义：不压暗，也不画框。
       红蓝票与硬板票的描边本来就只写在 @media (min-width:900px) 块里，
       窄屏天然没有，不用管；只有水牌此前多了一条写在媒体查询外的全局规则，
       把描边铺到了窄屏，已删除，这里再兜一道。 */
    .tg-stage .rt-wrap:not(.is-sel),
    .tg-stage .ot-frame:not(.is-pick),
    .tg-stage .plaque:not(.is-pick) { opacity: 1; }
    .tg-stage .plaque.is-pick { outline: none; }
}

/* ══════════ 留影面板 ══════════ */
.tg-photo-wrap {
    display: flex;
    gap: 26px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 6px 0 2px;
}
.tg-photo-card {
    position: relative;
    width: 300px;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(160deg, #1d2a35 0%, #2b3d4c 48%, #16212b 100%);
    box-shadow: 0 14px 34px rgba(16, 30, 40, .26);
    flex: 0 0 auto;
    isolation: isolate;
}
.tg-photo-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    opacity: .42;
    filter: saturate(.85);
}
.tg-photo-ov {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(11,20,27,.55) 0%, rgba(11,20,27,.12) 34%, rgba(11,20,27,.72) 100%);
}
.tg-photo-hd {
    position: absolute; top: 14px; left: 16px; right: 16px;
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 10px; letter-spacing: .16em;
    color: rgba(255,255,255,.78);
    text-transform: uppercase;
}
.tg-photo-no { font-variant-numeric: tabular-nums; }
.tg-photo-line { letter-spacing: .08em; }
.tg-photo-bd {
    position: absolute; left: 18px; right: 18px; bottom: 74px;
    color: #fff;
}
.tg-photo-name {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: .04em;
    text-shadow: 0 2px 14px rgba(0,0,0,.4);
}
.tg-photo-py {
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: .3em;
    color: rgba(255,255,255,.72);
    text-transform: uppercase;
}
.tg-photo-wm {
    position: absolute; left: 18px; bottom: 46px;
    display: flex; align-items: center; gap: 8px;
    font-size: 9px; letter-spacing: .22em;
    color: rgba(255,255,255,.5);
}
.tg-photo-ft {
    position: absolute; left: 18px; right: 18px; bottom: 14px;
    display: flex; justify-content: space-between;
    font-size: 9px; letter-spacing: .1em;
    color: rgba(255,255,255,.56);
    border-top: 1px solid rgba(255,255,255,.16);
    padding-top: 8px;
}
.tg-photo-side { max-width: 300px; }
.tg-photo-t {
    font-size: 17px; font-weight: 600; color: #23323c;
    margin-bottom: 8px;
}
.tg-photo-d {
    font-size: 13px; line-height: 1.75; color: #5f6f7a;
    margin: 0 0 18px;
}
.tg-photo-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px;
    border: 0; border-radius: 7px;
    background: #2fb3c9; color: #fff;
    font-size: 14px; letter-spacing: .04em;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.tg-photo-btn:hover { background: #2699ad; }
.tg-photo-btn:active { transform: translateY(1px); }

@media (max-width: 899px) {
    .tg-photo-wrap { gap: 18px; }
    .tg-photo-card { width: 258px; }
    .tg-photo-side { max-width: 100%; text-align: center; }
    .tg-photo-name { font-size: 33px; }
}

/* 窄屏：JS 给非当前款式的 pane 打 is-off，强制隐藏 */
.tg-stage > .tg-pane.is-off { display: none !important; }

/* ══════════ 硬板票两种形态，按 1200px 分界 ══════════
   ≥1200：与红蓝票三列并排，正反上下堆叠、两面同时可见
   <1200：三种票竖排一列，硬板票正反上下摊开 */
#pane-ticket-old .tg-pane-inner { max-width: none; padding: 0; }

/* 硬板票票面选项：窄列里保持一行，不要「儿童」单独掉下去 */
#pane-ticket-old .ot-opts {
    flex-wrap: nowrap;
    gap: 12px;
    font-size: 12.5px;
    margin-top: 12px;
    white-space: nowrap;
}
#pane-ticket-old .ot-opts label { gap: 5px; }

/* 描边唯一：选硬板票时，红蓝票的 is-sel 不再显示描边 */
.tg-stage[data-pick="hard"] .rt-wrap .rt { outline: none !important; }

/* 硬板票下方选项与提示：收紧间距，提示不折行 */
#pane-ticket-old .ot-opts { margin-top: 8px; }
#pane-ticket-old .ot-tip {
    font-size: 11.5px;
    line-height: 1.55;
    margin-top: 6px;
    text-align: center;
}

/* 车票长提示：移到三张票整体下方居中 */
.tg-global-tip {
    width: 100%;
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--ink-2);
    text-align: center;
}

/* ══════════ 三张票下方的统一说明区 ══════════ */
.tg-bottom {
    width: 100%;
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.tg-bottom .ot-opts { margin: 0; }
.tg-bottom .ot-tip,
.tg-bottom .tg-global-tip {
    margin: 0;
    text-align: center;
    max-width: 860px;
}

/* 窄屏：红蓝票自带的单选让位给 #tg-pick-bar-ticket */
@media (max-width: 899px) {
    #rt-opts { display: none !important; }
}

/* 全屏时限制舞台宽度，硬板票与红蓝票的间距不被拉散 */
@media (min-width: 900px) {
    .tg-stage { max-width: 1480px; margin-left: auto; margin-right: auto; }
}

/* 单选条移到票下方后，与票的距离 */
.tg-pick-bar { margin: 10px 0 0; }

/* ══════════ v2.19.9 车票 / 硬板票 分段切换 ══════════
   车票胶囊拆成「车票 / 硬板票」两段，各自可点。
   点车票 → 红蓝票两张并排；点硬板票 → 正反两张并排。
   一次只显示一组，不再有三列并排的高度对齐问题。 */
.tg-tabs button.tg-tab-split {
    padding: 0;
    display: flex;
    align-items: center;
}
.tg-tab-split .tg-tsub {
    padding: 8px 16px;
    border-radius: 7px;
    transition: color .18s ease;
    white-space: nowrap;
}
.tg-tab-split .tg-tsep {
    font-style: normal;
    opacity: .3;
    font-weight: 400;
    user-select: none;
}
.tg-tab-split .tg-tsub.is-sub { color: var(--accent); }

/* 硬板票单独显示时，正反水平并排，和红蓝票同一排法 */
#pane-ticket-old .tg-pane-inner { width: 100%; max-width: none; padding: 0; }
#pane-ticket-old .ot-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    max-width: 960px;
    margin: 0 auto;
}
#pane-ticket-old .ot-side { display: block !important; }
#pane-ticket-old .ot-side-sw { display: none !important; }
#pane-ticket-old .ot-cap { display: none !important; }

/* 红蓝票：沿用最初模式——两张并排居中，尺寸由 tgFitTicketWidth 控制 */
#pane-ticket .tg-pane-inner { width: 100%; max-width: none; }

/* v2.19.9 车票 tab：一次只显示一组（红蓝票 或 硬板票），占满舞台宽度。
   不再有「三票并排」，因此也不存在三列高度对齐的问题。 */
.tg-stage[data-tab="ticket"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.tg-stage[data-tab="ticket"] > .tg-pane.is-on {
    width: 100%;
    max-width: 1480px;
    flex: 0 0 auto;
}
.tg-stage[data-tab="ticket"] > .tg-pane.is-off { display: none !important; }

/* 窄屏 / 手机：硬板票正反改上下堆叠，单张限宽居中，和红蓝票的窄屏规则一致 */
@media (max-width: 779px) {
    #pane-ticket-old .ot-frame {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        max-width: 560px;
    }
}

/* ══════════ v2.19.9 底部选项条按 tab / 款式显隐 ══════════
   水牌与留影页没有票面，整条收起；
   红蓝票页只留通用提示，硬板票才出「仅对普速列车开放」。 */
.tg-bottom[data-tab="plaque"],
.tg-bottom[data-tab="photo"] { display: none !important; }
.tg-bottom[data-pick="rt"] .tg-hard-only { display: none !important; }

/* 硬板票是单组显示（点胶囊右段直接切过去），不存在「选不选」，
   因此不压暗、也不画选中框 */
#pane-ticket-old .ot-frame,
#pane-ticket-old .ot-frame:not(.is-pick) { opacity: 1 !important; }
#pane-ticket-old .ot-frame.is-pick { outline: none !important; }

/* ══════════ v2.19.13 留影：宽屏横版 / 窄屏竖版 ══════════
   宽屏右侧还有说明与按钮，卡片取横构图更舒展；窄屏单列，保持 3:4 竖版。 */
@media (min-width: 900px) {
    .tg-photo-card {
        width: 460px;
        aspect-ratio: 4 / 3;
        border-radius: 12px;
    }
    /* 横版高度只有 345px，站名再大就会顶到页脚，收一档并把下方层级拉开 */
    .tg-photo-name { font-size: 44px; letter-spacing: .02em; }
    .tg-photo-bd { bottom: 62px; }
    .tg-photo-py { margin-top: 5px; letter-spacing: .26em; }
    .tg-photo-wm { bottom: 34px; }
    .tg-photo-ft { bottom: 12px; padding-top: 7px; }
    .tg-photo-hd { top: 16px; left: 18px; right: 18px; }
}

/* ══════════ v2.19.15 留影悬停 ══════════
   迁入到车票区块时丢了原来的悬停反馈。这里恢复：
   鼠标移上去背景图轻微推近、遮罩压深、卡片抬起，静态截图也有呼吸感。 */
.tg-photo-card {
    transition: box-shadow .45s ease, transform .5s cubic-bezier(.2, .7, .3, 1);
    transform-style: preserve-3d;
    will-change: transform;
}
.tg-photo-bg {
    transition: transform .6s cubic-bezier(.2, .7, .3, 1), opacity .4s ease;
    will-change: transform;
}
.tg-photo-ov {
    transition: opacity .4s ease;
}
/* 悬停：卡片轻微 3D 倾斜（倾斜是主体），背景只做极轻推近，补倾斜后露出的边角 */
.tg-photo-card:hover {
    box-shadow: 0 26px 54px rgba(16, 30, 40, .46);
    transform: perspective(1000px) rotateX(1.6deg) rotateY(-3.2deg) scale(1.015);
}
.tg-photo-card:hover .tg-photo-bg {
    transform: scale(1.03);
    opacity: .5;
}
.tg-photo-card:hover .tg-photo-ov {
    opacity: .88;
}

/* 留影：卡片 460 + 间距 26 + 说明 300 = 786，默认 760 的内层宽度会把说明挤到下一行，
   宽屏放宽到 900 让两者左右并排；窄屏仍按单列（卡片 258 + 说明满宽） */
@media (min-width: 900px) {
    #pane-photo .tg-pane-inner { max-width: 900px; }
    .tg-photo-wrap { gap: 34px; }
    .tg-photo-side { max-width: 320px; }
}
