:root {
    --brand: #1a6dff;
    --brand-dark: #0b3fa8;
    --accent: #ff6a00;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e8f0;
    --success: #16a34a;
    --info: #0ea5e9;
    --warning: #f59e0b;
    --danger: #dc2626;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
    /* 固定底栏高度：正文用同一变量留白，避免遮挡内容末尾 */
    --footer-height: 72px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    /* 粘性页脚：body 至少占满一屏并纵向排布，由 main 撑开剩余空间 */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

main {
    flex: 1 0 auto;
    /* 为固定底栏留出等高空白，防止遮挡正文末尾 */
    padding-bottom: var(--footer-height);
}

a {
    color: var(--brand);
    text-decoration: none;
}

.container {
    width: min(1080px, 100% - 40px);
    margin: 0 auto;
}

.muted {
    color: var(--muted);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    font-size: 14px;
    letter-spacing: .5px;
}

.logo-text em {
    font-style: normal;
    font-weight: 500;
    color: var(--muted);
    margin-left: 6px;
    font-size: 13px;
}

.nav {
    display: flex;
    gap: 24px;
    font-size: 14px;
}

.nav a {
    color: var(--muted);
}

.nav a:hover {
    color: var(--brand);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 72px 0 64px;
    background: radial-gradient(1200px 400px at 15% -10%, rgba(255, 106, 0, .25), transparent),
                linear-gradient(135deg, #10214a 0%, #143a86 55%, #1a6dff 100%);
    color: #fff;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .5;
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    font-size: 13px;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: .5px;
}

.hero-desc {
    max-width: 640px;
    margin: 0 auto 30px;
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
}

/* ---------- Search ---------- */
.search-box {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(8, 20, 51, .28);
}

.search-field {
    position: relative;
    flex: 1;
    display: flex;
    /* 文本域增高后，搜索图标与按钮保持在顶部，不随高度漂移 */
    align-items: flex-start;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 16px;
    width: 20px;
    height: 20px;
    fill: #9aa3b2;
}

.search-field input,
.search-field textarea {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px 14px 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

/* 单号输入为文本域：初始一行，回车换行后由 JS 按内容自动增高 */
.search-field textarea {
    height: 52px;
    max-height: 220px;
    overflow-y: auto;
    resize: none;
    display: block;
}

.search-field input:focus,
.search-field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(26, 109, 255, .12);
}

.search-box .btn {
    /* 文本域多行时按钮不跟着拉高 */
    align-self: flex-start;
}

.btn {
    height: 52px;
    padding: 0 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.06);
}

/* 单号数量计数与超限提示 */
.number-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    min-height: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, .78);
}

.number-counter.is-over {
    color: #ffd0d0;
    font-weight: 600;
}

.number-warning {
    color: #ffdfa6;
}

.samples {
    margin-top: 18px;
    font-size: 14px;
    color: rgba(255, 255, 255, .78);
}

.samples-label {
    margin-right: 6px;
}

.chip {
    margin: 4px;
    padding: 5px 12px;
    border: 1px dashed rgba(255, 255, 255, .45);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.chip:hover {
    background: rgba(255, 255, 255, .2);
}

/* ---------- Features ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: -36px auto 0;
    position: relative;
    z-index: 2;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.feature-card h3 {
    margin: 12px 0 8px;
    font-size: 17px;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 22px;
}

.feature-icon-blue {
    background: rgba(26, 109, 255, .1);
}

.feature-icon-orange {
    background: rgba(255, 106, 0, .12);
}

.feature-icon-green {
    background: rgba(22, 163, 74, .12);
}

/* ---------- How to ---------- */
.howto {
    margin: 48px auto 64px;
}

.howto h2 {
    font-size: 20px;
    margin-bottom: 18px;
}

.howto ol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.howto li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
}

.howto li span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    flex: none;
}

/* ---------- Result ---------- */
.result-top {
    padding: 28px 0 6px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.result-top .container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box-sm {
    flex: 1;
    box-shadow: none;
    border: 1px solid var(--border);
    padding: 6px;
}

.search-box-sm input,
.search-box-sm textarea,
.search-box-sm .btn {
    height: 42px;
    font-size: 14px;
}

.search-box-sm .search-field textarea {
    min-height: 42px;
    height: 42px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.search-box-sm .search-icon {
    top: 11px;
}

.search-box-sm .btn {
    padding: 0 20px;
}

.link-back {
    font-size: 14px;
    white-space: nowrap;
}

.result-list {
    padding: 28px 0 60px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 22px;
}

.shipment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.shipment-no {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shipment-no .label {
    font-size: 12px;
    color: var(--muted);
}

.shipment-no strong {
    font-size: 20px;
    letter-spacing: .5px;
}

.btn-copy {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.btn-copy:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.shipment-sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--text);
}

.carrier {
    font-weight: 600;
}

.dot-sep {
    margin: 0 8px;
    color: #cbd5e1;
}

.badge {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

.badge-success,
.tone-success .timeline-desc {
    background: rgba(22, 163, 74, .12);
    color: var(--success);
}

.badge-primary {
    background: rgba(26, 109, 255, .12);
    color: var(--brand);
}

.badge-info {
    background: rgba(14, 165, 233, .12);
    color: var(--info);
}

.badge-danger {
    background: rgba(220, 38, 38, .12);
    color: var(--danger);
}

.badge-neutral {
    background: rgba(107, 114, 128, .12);
    color: var(--muted);
}

.badge-warning {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.alert {
    margin: 16px 0 0;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-danger {
    background: rgba(220, 38, 38, .08);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, .12);
    color: #92400e;
}

/* ---------- Stepper ---------- */
.stepper {
    margin: 26px 0 22px;
}

.stepper-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: #eef1f7;
    overflow: hidden;
}

.stepper-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #4d94ff);
    transition: width .4s ease;
}

.stepper-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dfe4ee;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #eef1f7;
}

.step.is-done .step-dot {
    background: var(--brand);
}

.step.is-done .step-label {
    color: var(--brand);
}

.step.is-current .step-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, .18);
}

.step.is-current .step-label {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- Meta ---------- */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.meta-grid span {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.meta-grid strong {
    font-size: 15px;
}

.section-title {
    margin: 26px 0 14px;
    font-size: 16px;
}

/* ---------- Timeline ---------- */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 4px;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 18px;
    padding: 0 0 22px 24px;
    border-left: 2px solid #e8ecf5;
}

.timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d7dce8;
    border: 2px solid #fff;
}

.timeline-item.is-latest::before {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, .16);
}

.timeline-item.tone-success::before {
    background: var(--success);
}

.timeline-item.tone-danger::before {
    background: var(--danger);
}

.timeline-time {
    width: 62px;
    flex: none;
    font-size: 13px;
    color: var(--muted);
    text-align: right;
}

.timeline-time em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: #9aa3b2;
}

.timeline-body {
    flex: 1;
    margin-top: -4px;
}

.timeline-desc {
    margin: 0;
    font-size: 15px;
}

.timeline-item.is-latest .timeline-desc {
    font-weight: 600;
}

.timeline-meta {
    margin: 4px 0 0;
    font-size: 13px;
}

.tag {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--muted);
    font-size: 12px;
}

.source-tag {
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: #f1f5f9;
    color: var(--muted);
}

.source-api {
    background: rgba(26, 109, 255, .12);
    color: var(--brand);
}

.source-database {
    background: rgba(22, 163, 74, .12);
    color: var(--success);
}

.notice {
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed var(--border);
    color: var(--muted);
    font-size: 13px;
}

code {
    padding: 1px 6px;
    border-radius: 6px;
    background: #eef1f7;
    font-size: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
    /* 固定悬浮底栏：常驻视口底部，任何滚动位置都可见 */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--footer-height);
    padding: 0 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    font-size: 13px;
    text-align: center;
}

.site-footer .container {
    width: 100%;
}

.site-footer p {
    margin: 4px 0;
}

@media (max-width: 640px) {
    :root {
        /* 窄屏页脚文案会换行，相应抬高留白 */
        --footer-height: 96px;
    }

    .hero {
        padding: 48px 0 56px;
    }

    .search-box {
        flex-direction: column;
        padding: 12px;
    }

    .btn {
        width: 100%;
    }

    .result-top .container {
        flex-direction: column;
        align-items: stretch;
    }

    .stepper-steps {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .step {
        font-size: 11px;
    }

    .timeline-item {
        flex-direction: column;
        gap: 4px;
    }

    .timeline-time {
        width: auto;
        text-align: left;
    }

    .timeline-time em {
        display: inline;
        margin-left: 6px;
    }
}
