/* ============================================================
 * airmail.css —— 「航空邮路」风格（邮编查询专属 · 2.0 皮肤）
 * 作用域 .am；亮/暗双主题（:root[data-theme="dark"]）
 * 区别于 1.0 邮政信封绿：天空蓝渐变 hero + 橙色邮戳 + 白云纸飞机
 * 招牌元素：省→市→区县三级地址联动面板（三栏航班列表式）
 * ============================================================ */

.am {
    --am-bg1: #eef4fb;
    --am-bg2: #f7faff;
    --am-card: #ffffff;
    --am-line: #d5e1f1;
    --am-line2: #e6edf8;
    --am-text: #152238;
    --am-muted: #40546f;
    --am-faint: #8394ab;
    --am-accent: #2563eb;
    --am-accent2: #ea580c;
    --am-accent-soft: rgba(37, 99, 235, .08);
    --am-up: #0d9488;
    --am-down: #dc2626;
    --am-gold: #b45309;
    --fin-danger: #dc2626;
    --fin-up: #0d9488;
    --am-input-bg: #f2f6fc;
    --am-shadow: 0 2px 8px rgba(30, 64, 135, .06), 0 14px 32px rgba(30, 64, 135, .09);
    color: var(--am-text);
    font-variant-numeric: tabular-nums;
}

:root[data-theme="dark"] .am {
    --am-bg1: #0a1220;
    --am-bg2: #0e1728;
    --am-card: #121e31;
    --am-line: #243550;
    --am-line2: #1a2a42;
    --am-text: #dce8f8;
    --am-muted: #9db1cd;
    --am-faint: #64748b;
    --am-accent: #60a5fa;
    --am-accent2: #fb923c;
    --am-accent-soft: rgba(96, 165, 250, .12);
    --am-up: #2dd4bf;
    --am-down: #f87171;
    --am-gold: #fbbf24;
    --fin-danger: #f87171;
    --fin-up: #2dd4bf;
    --am-input-bg: #0c1526;
    --am-shadow: 0 2px 8px rgba(0, 0, 0, .4), 0 16px 38px rgba(0, 0, 0, .48);
}

/* ---------------- 面包屑 ---------------- */
.am-crumb {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: var(--am-muted); margin: 6px 0 18px;
}
.am-crumb a { color: var(--am-accent); text-decoration: none; }
.am-crumb a:hover { text-decoration: underline; }
.am-crumb .sep { color: var(--am-faint); }

/* ---------------- Hero（航空蓝天 · 虚线航迹 + 航邮斜纹） ---------------- */
.am-hero {
    position: relative; overflow: hidden;
    border-radius: 22px; padding: 34px 30px 42px;
    background:
        radial-gradient(circle at 84% 18%, rgba(224, 242, 254, .2) 0 46px, transparent 46px),
        radial-gradient(circle at 90% 30%, rgba(224, 242, 254, .12) 0 78px, transparent 78px),
        radial-gradient(circle at 12% 88%, rgba(186, 230, 253, .14) 0 58px, transparent 58px),
        linear-gradient(118deg, #0a2c66 0%, #1d4ed8 52%, #0284c7 100%);
    color: #eaf4ff;
    box-shadow: 0 18px 42px rgba(10, 44, 102, .36);
    margin-bottom: 22px;
}
/* 虚线航迹圈（雷达/航线感） */
.am-hero::before {
    content: ''; position: absolute; top: -46px; right: 46px; width: 170px; height: 170px;
    border-radius: 50%; border: 2px dashed rgba(224, 242, 254, .4);
    box-shadow: inset 0 0 0 12px rgba(224, 242, 254, .05), 0 0 0 14px rgba(224, 242, 254, .04);
    transform: rotate(10deg);
}
/* 航空信封红白蓝斜纹贴边 */
.am-hero::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
    background: repeating-linear-gradient(45deg,
        #dc2626 0 12px, #f8fafc 12px 24px, #2563eb 24px 36px, #f8fafc 36px 48px);
    opacity: .95;
}
:root[data-theme="dark"] .am-hero {
    background:
        radial-gradient(circle at 84% 18%, rgba(224, 242, 254, .08) 0 46px, transparent 46px),
        radial-gradient(circle at 90% 30%, rgba(224, 242, 254, .05) 0 78px, transparent 78px),
        radial-gradient(circle at 12% 88%, rgba(186, 230, 253, .06) 0 58px, transparent 58px),
        linear-gradient(118deg, #061733 0%, #0e2a5c 52%, #0c3a5e 100%);
    border: 1px solid #22385c;
}
.am-hero h1 {
    margin: 0 0 12px; font-size: 30px; line-height: 1.25; font-weight: 800; letter-spacing: .5px;
}
.am-hero p { margin: 0; font-size: 14.5px; line-height: 1.9; color: #c4dcf7; max-width: 880px; }
.am-hero p b { color: #fff; font-weight: 700; }
.am-hero-head { display: flex; gap: 18px; align-items: flex-start; }
.am-hero-icon {
    flex: 0 0 auto; width: 58px; height: 58px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 30px;
    background: rgba(224, 242, 254, .14); border: 1px solid rgba(224, 242, 254, .34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
    transform: rotate(4deg);
}
.am-theme {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    border: 1px solid rgba(186, 230, 253, .44); background: rgba(186, 230, 253, .1);
    color: #eaf4ff; font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
    cursor: pointer; transition: background .2s;
}
.am-theme:hover { background: rgba(186, 230, 253, .22); }
.am-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.am-tag {
    font-size: 12px; color: #d2e6fb; padding: 5px 12px; border-radius: 999px;
    background: rgba(186, 230, 253, .1); border: 1px solid rgba(186, 230, 253, .32);
    letter-spacing: .3px;
}

/* ---------------- 卡片 ---------------- */
.am-stack { display: flex; flex-direction: column; gap: 20px; }
.am-card {
    background: var(--am-card); border: 1px solid var(--am-line);
    border-radius: 16px; padding: 24px 24px 22px; box-shadow: var(--am-shadow);
}
.am-card-title {
    margin: 0 0 18px; font-size: 17.5px; font-weight: 800; letter-spacing: .4px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.am-card-title .fi {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; font-size: 18px;
    background: linear-gradient(135deg, #2563eb, #0284c7); color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .28);
}
:root[data-theme="dark"] .am-card-title .fi {
    background: linear-gradient(135deg, #1d4ed8, #0369a1);
}
.am-sub { font-size: 12.5px; font-weight: 500; color: var(--am-faint); letter-spacing: .2px; }

/* ---------------- 表单 ---------------- */
.am-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.am-label {
    font-size: 13px; font-weight: 700; color: var(--am-muted);
    letter-spacing: .3px;
}
.am-label small { font-weight: 500; color: var(--am-faint); letter-spacing: .2px; }
.am-input, .am-textarea {
    width: 100%; box-sizing: border-box;
    background: var(--am-input-bg); border: 1px solid var(--am-line);
    color: var(--am-text); border-radius: 10px; padding: 10px 12px;
    font-size: 14.5px; font-variant-numeric: tabular-nums;
    transition: border-color .15s, box-shadow .15s;
}
.am-input:focus, .am-textarea:focus {
    outline: none; border-color: var(--am-accent);
    box-shadow: 0 0 0 3px var(--am-accent-soft);
}
.am-textarea { resize: vertical; line-height: 1.7; }
.am-input-group { display: flex; align-items: stretch; }
.am-input-group .am-input { border-radius: 10px 0 0 10px; border-right: none; }
.am-addon {
    display: flex; align-items: center; padding: 0 12px;
    background: var(--am-line2); border: 1px solid var(--am-line);
    border-radius: 0 10px 10px 0; font-size: 13px; color: var(--am-muted); white-space: nowrap;
    cursor: pointer;
}
.am-addon--go {
    border-radius: 0; border-color: transparent;
    background: linear-gradient(120deg, #2563eb, #0284c7);
    color: #fff; font-weight: 700; padding: 0 18px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
    transition: opacity .12s;
}
.am-addon--go:hover { opacity: .92; }
:root[data-theme="dark"] .am-addon--go { box-shadow: none; }

/* ---------------- 三级地址联动（航班列表式三栏） ---------------- */
.am-cas-path {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 14px; font-size: 13px;
}
.am-cas-path .seg {
    padding: 5px 13px; border-radius: 999px; border: 1px solid var(--am-line);
    background: var(--am-input-bg); color: var(--am-muted);
    font-weight: 600; cursor: pointer; transition: all .14s; letter-spacing: .3px;
}
.am-cas-path .seg:hover { border-color: var(--am-accent); color: var(--am-accent); }
.am-cas-path .seg.cur {
    background: linear-gradient(120deg, var(--am-accent), #0284c7); color: #fff;
    border-color: transparent; cursor: default; font-weight: 800;
    box-shadow: 0 3px 8px rgba(37, 99, 235, .25);
}
.am-cas-path .sep { color: var(--am-faint); }
.am-cas-path .hint { margin-left: auto; font-size: 12px; color: var(--am-faint); }
.am-cas { display: grid; grid-template-columns: 1fr 1.15fr 1.35fr; gap: 12px; }
.am-cas-col {
    border: 1px solid var(--am-line); border-radius: 12px;
    background: var(--am-input-bg); overflow: hidden;
    display: flex; flex-direction: column; min-width: 0;
}
.am-cas-col .ch {
    padding: 9px 13px; font-size: 12px; font-weight: 800; letter-spacing: .6px;
    color: var(--am-muted); background: var(--am-line2); border-bottom: 1px solid var(--am-line);
    display: flex; justify-content: space-between; gap: 8px;
}
.am-cas-col .ch .cn { font-weight: 600; color: var(--am-faint); letter-spacing: 0; }
.am-cas-list { max-height: 302px; overflow-y: auto; }
.am-cas-it {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    padding: 8px 13px; font-size: 13.5px; cursor: pointer;
    border-bottom: 1px dashed var(--am-line2); border-left: 3px solid transparent;
    transition: background .12s;
}
.am-cas-it:last-child { border-bottom: none; }
.am-cas-it:hover { background: var(--am-accent-soft); }
.am-cas-it.on {
    background: var(--am-accent-soft); border-left-color: var(--am-accent);
    color: var(--am-accent); font-weight: 800;
}
.am-cas-it .zz {
    font-family: "Courier New", ui-monospace, monospace; font-weight: 800;
    color: var(--am-accent2); letter-spacing: 1px; font-size: 13px;
}
.am-cas-empty { padding: 30px 12px; text-align: center; color: var(--am-faint); font-size: 13px; line-height: 1.8; }

/* ---------------- 按钮 ---------------- */
.am-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.am-btn {
    border: none; cursor: pointer; border-radius: 12px;
    padding: 11px 22px; font-size: 14px; font-weight: 700; letter-spacing: .5px;
    color: #fff; background: linear-gradient(120deg, #2563eb, #0284c7);
    box-shadow: 0 6px 16px rgba(37, 99, 235, .26);
    transition: transform .12s, box-shadow .12s, opacity .12s;
}
.am-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(37, 99, 235, .32); }
.am-btn:active { transform: translateY(0); }
.am-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.am-btn--ghost {
    background: transparent; color: var(--am-accent);
    border: 1px solid var(--am-line); box-shadow: none;
}
.am-btn--ghost:hover { border-color: var(--am-accent); background: var(--am-accent-soft); }
.am-btn--sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.am-btn--stamp {
    background: linear-gradient(120deg, #c2410c, #ea580c);
    box-shadow: 0 6px 16px rgba(234, 88, 12, .26);
}
.am-btn--stamp:hover { box-shadow: 0 9px 22px rgba(234, 88, 12, .32); }

/* ---------------- 状态 ---------------- */
.am-status { margin-top: 12px; font-size: 13px; min-height: 18px; color: var(--am-muted); }
.am-status.err { color: var(--fin-danger); }

/* ---------------- 投递单（航空信封 · 顶部斜纹） ---------------- */
.am-receipt {
    position: relative; border: 1px solid var(--am-line); border-radius: 14px;
    background:
        radial-gradient(circle at 96% 6%, var(--am-accent-soft) 0 70px, transparent 70px),
        var(--am-input-bg);
    padding: 26px 22px 20px; overflow: hidden;
}
/* 顶部航邮斜纹 */
.am-receipt::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px;
    background: repeating-linear-gradient(45deg,
        #dc2626 0 10px, #f8fafc 10px 20px, #2563eb 20px 30px, #f8fafc 30px 40px);
    opacity: .9;
}
.am-receipt-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.am-receipt-head .lt { font-size: 13px; font-weight: 800; letter-spacing: 1.2px; color: var(--am-muted); }
.am-receipt-head .lh { font-size: 12px; color: var(--am-faint); }
.am-hero-num {
    margin: 12px 0 4px; font-size: 46px; font-weight: 800; line-height: 1.1;
    letter-spacing: 4px; font-variant-numeric: tabular-nums; color: var(--am-accent);
    font-family: "Courier New", ui-monospace, monospace;
}
.am-hero-sub { font-size: 13.5px; color: var(--am-muted); line-height: 1.8; }
.am-kpis {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px;
}
.am-kpi {
    border: 1px solid var(--am-line); border-radius: 12px; padding: 13px 14px;
    background: var(--am-card);
}
.am-kpi .k-label { font-size: 12px; font-weight: 700; color: var(--am-muted); letter-spacing: .4px; }
.am-kpi .k-val { margin-top: 7px; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; word-break: break-all; }
.am-kpi .k-val.up { color: var(--am-up); }
.am-kpi .k-val.gold { color: var(--am-gold); }
.am-kpi .k-val.info { color: var(--am-accent); }
.am-kpi .k-note { margin-top: 5px; font-size: 11.5px; color: var(--am-faint); }

/* 明细行 */
.am-rows { margin-top: 18px; border-top: 2px solid var(--am-line); }
.am-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 11px 2px; border-bottom: 1px dashed var(--am-line); font-size: 14px;
}
.am-row .r-label { color: var(--am-muted); flex: 0 0 auto; }
.am-row .r-val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* 提示条 */
.am-note {
    display: flex; gap: 11px; margin-top: 18px; padding: 14px 16px;
    border: 1px solid var(--am-line); border-left: 5px solid var(--am-accent2);
    border-radius: 12px; background: var(--am-accent-soft);
    font-size: 13.5px; line-height: 1.85; color: var(--am-muted);
}
.am-note b { color: var(--am-text); }
.am-note .ni { flex: 0 0 auto; font-size: 17px; }

/* ---------------- 表格 ---------------- */
.am-table-wrap {
    overflow-x: auto; border: 1px solid var(--am-line); border-radius: 12px;
    max-height: 520px; overflow-y: auto;
}
.am-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.am-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--am-line2); color: var(--am-muted);
    font-size: 12px; font-weight: 800; letter-spacing: .5px;
    text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--am-line);
}
:root[data-theme="dark"] .am-table thead th { background: #18263e; }
.am-table tbody td { padding: 8px 14px; border-bottom: 1px dashed var(--am-line2); }
.am-table tbody tr:hover { background: var(--am-accent-soft); }
.am-table tbody tr.on { background: var(--am-accent-soft); outline: 2px solid var(--am-accent); outline-offset: -2px; }
.am-table tbody tr { cursor: pointer; }
.am-table tfoot td {
    padding: 10px 14px; font-weight: 800; border-top: 2px solid var(--am-line);
    background: var(--am-accent-soft);
}
.am-table .zc {
    font-family: "Courier New", ui-monospace, monospace; font-weight: 800;
    letter-spacing: 1.5px; color: var(--am-accent2); font-size: 14.5px;
}

/* ---------------- AI ---------------- */
.am-ai { margin-top: 16px; }
.am-ai-body {
    border: 1px dashed var(--am-line); border-radius: 12px;
    padding: 16px 18px; font-size: 14px; line-height: 1.95;
    color: var(--am-text); background: var(--am-input-bg);
    white-space: pre-wrap; word-break: break-word;
}
.am-ai-body.empty { color: var(--am-faint); }

/* ---------------- 标签页（配合 Fin.initTabs：.active 切换） ---------------- */
.am-tabs {
    display: flex; gap: 6px; flex-wrap: wrap; margin: 26px 0 0;
    border-bottom: 2px solid var(--am-line);
}
.am-tab {
    border: none; background: transparent; cursor: pointer;
    padding: 11px 18px; font-size: 14px; font-weight: 700; letter-spacing: .5px;
    color: var(--am-muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.am-tab:hover { color: var(--am-text); }
.am-tab.active { color: var(--am-accent); border-bottom-color: var(--am-accent); }
.am-panel {
    display: none; padding: 22px 6px 8px; font-size: 14.5px; line-height: 1.95; color: var(--am-text);
}
.am-panel.active { display: block; }
.am-panel h2 { font-size: 16.5px; margin: 18px 0 8px; font-weight: 800; letter-spacing: .4px; }
.am-panel h2:first-child { margin-top: 0; }
.am-panel p { margin: 8px 0; color: var(--am-muted); }
.am-panel p b, .am-panel li b { color: var(--am-text); }
.am-panel ul { margin: 8px 0; padding-left: 22px; color: var(--am-muted); }
.am-panel li { margin: 6px 0; }
.am-panel code {
    background: var(--am-accent-soft); color: var(--am-accent);
    padding: 2px 8px; border-radius: 6px; font-size: 13.5px;
}

/* 更新记录 */
.am-timeline li { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 10px 0; }
.am-timeline .ver {
    font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(120deg, #2563eb, #0284c7);
    padding: 2px 10px; border-radius: 999px; letter-spacing: .5px;
}
.am-timeline .date { font-size: 12.5px; color: var(--am-faint); font-variant-numeric: tabular-nums; }
.am-timeline .txt { flex: 1 1 100%; font-size: 13.5px; color: var(--am-muted); }

/* FAQ */
.am-faq details {
    border: 1px solid var(--am-line); border-radius: 12px; margin: 10px 0;
    background: var(--am-input-bg); overflow: hidden;
}
.am-faq summary {
    cursor: pointer; padding: 13px 16px; font-size: 14px; font-weight: 700;
    list-style: none; position: relative; padding-right: 40px;
}
.am-faq summary::after {
    content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 18px; color: var(--am-accent); font-weight: 800;
}
.am-faq details[open] summary::after { content: '−'; }
.am-faq summary::-webkit-details-marker { display: none; }
.am-faq .a { padding: 0 16px 14px; font-size: 13.5px; line-height: 1.9; color: var(--am-muted); }

/* ---------------- 相关工具 ---------------- */
.am-rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.am-rel {
    display: flex; gap: 11px; align-items: center; text-decoration: none;
    border: 1px solid var(--am-line); border-radius: 12px; padding: 13px 14px;
    background: var(--am-input-bg); transition: border-color .15s, transform .15s;
}
.am-rel:hover { border-color: var(--am-accent); transform: translateY(-2px); }
.am-rel .ri { font-size: 22px; flex: 0 0 auto; }
.am-rel b { display: block; font-size: 13.5px; color: var(--am-text); }
.am-rel small { font-size: 12px; color: var(--am-faint); }

/* ---------------- fin-common.js 兼容样式 ---------------- */
.fin-toast {
    position: fixed; left: 50%; bottom: 46px; z-index: 99999;
    transform: translateX(-50%) translateY(16px);
    background: #0e1e3d; color: #d4e6ff; font-size: 13.5px; font-weight: 600;
    padding: 11px 20px; border-radius: 999px; letter-spacing: .4px;
    border: 1px solid rgba(96, 165, 250, .4);
    box-shadow: 0 12px 32px rgba(2, 8, 23, .5);
    opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.fin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.fin-ai-dots::after { content: ''; display: inline-block; width: 1.4em; text-align: left; animation: amDots 1.2s steps(4, end) infinite; }
@keyframes amDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .am-cas { grid-template-columns: 1fr 1fr; }
    .am-cas-col:last-child { grid-column: 1 / -1; }
    .am-cas-list { max-height: 220px; }
    .am-kpis { grid-template-columns: repeat(2, 1fr); }
    .am-rel-grid { grid-template-columns: repeat(2, 1fr); }
    .am-hero h1 { font-size: 24px; }
    .am-hero-num { font-size: 36px; }
}
@media (max-width: 560px) {
    .am-cas { grid-template-columns: 1fr; }
    .am-cas-col:last-child { grid-column: auto; }
    .am-hero { padding: 26px 18px 34px; }
    .am-hero-head { flex-direction: column; }
    .am-card { padding: 18px 16px; }
    .am-kpis { grid-template-columns: 1fr 1fr; }
    .am-rel-grid { grid-template-columns: 1fr; }
    .am-tab { padding: 10px 12px; font-size: 13px; }
    .am-cas-path .hint { margin-left: 0; flex: 1 1 100%; }
}
