:root {
    --exchange-bg: #f5f7fb;
    --exchange-surface: rgba(255, 255, 255, 0.92);
    --exchange-border: rgba(15, 23, 42, 0.08);
    --exchange-text: #0f172a;
    --exchange-muted: #64748b;
    --exchange-accent: #0f766e;
    --exchange-accent-soft: rgba(15, 118, 110, 0.12);
    --exchange-warning: #ea580c;
    --exchange-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body.exchange-app {
    margin: 0;
    min-height: 100vh;
    color: var(--exchange-text);
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 32%),
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        var(--exchange-bg);
    font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

.exchange-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 24px 16px 96px;
}

.exchange-hero {
    margin-bottom: 18px;
    padding: 22px 18px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
    box-shadow: var(--exchange-shadow);
    animation: revealUp .55s ease both;
}

.exchange-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.exchange-hero p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    opacity: .92;
}

.exchange-section {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--exchange-border);
    border-radius: 18px;
    background: var(--exchange-surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--exchange-shadow);
    animation: revealUp .55s ease both;
}

.exchange-section:nth-child(2) { animation-delay: .05s; }
.exchange-section:nth-child(3) { animation-delay: .1s; }
.exchange-section:nth-child(4) { animation-delay: .15s; }

.exchange-section h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.exchange-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.exchange-section-desc {
    margin: 0;
}

.exchange-muted {
    color: var(--exchange-muted);
    font-size: 13px;
    line-height: 1.6;
}

.exchange-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.exchange-kpi {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--exchange-border);
}

.exchange-kpi .label {
    display: block;
    color: var(--exchange-muted);
    font-size: 12px;
}

.exchange-kpi .value {
    margin-top: 8px;
    font-size: 22px;
    font-weight: 600;
}

.exchange-kpi .value.tiny {
    font-size: 14px;
    line-height: 1.6;
}

.exchange-actions {
    display: grid;
    gap: 10px;
}

.exchange-stack {
    display: grid;
    gap: 14px;
}

.exchange-warning-tip {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #9a3412;
    background: rgba(234, 88, 12, 0.12);
    border: 1px solid rgba(234, 88, 12, 0.18);
}

.exchange-inline-tip {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--exchange-muted);
    background: rgba(15, 118, 110, 0.08);
}

.exchange-maintenance-tip {
    color: #9a3412;
    background: rgba(234, 88, 12, 0.12);
    border: 1px solid rgba(234, 88, 12, 0.18);
}

.exchange-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 18px;
    scrollbar-width: none;
}

.exchange-filter-bar::-webkit-scrollbar {
    display: none;
}

.exchange-filter-chip {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--exchange-border);
    color: var(--exchange-muted);
    background: rgba(255, 255, 255, 0.76);
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
    white-space: nowrap;
}

.exchange-filter-chip.active {
    color: #fff;
    background: var(--exchange-accent);
}

.exchange-filter-chip:active {
    transform: translateY(1px);
}

.exchange-footer-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(245, 247, 251, 0.92);
    backdrop-filter: blur(18px);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.exchange-footer-nav .nav-inner {
    width: min(100%, 760px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.exchange-footer-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    border-radius: 14px;
    color: var(--exchange-muted);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.8);
    transition: transform .2s ease, color .2s ease, background .2s ease;
}

.exchange-footer-link.active {
    color: #fff;
    background: var(--exchange-accent);
}

.exchange-footer-link:active {
    transform: translateY(1px) scale(.99);
}

.exchange-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--exchange-accent);
    background: var(--exchange-accent-soft);
}

.exchange-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}

.exchange-list-item {
    display: block;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--exchange-border);
    background: rgba(255, 255, 255, 0.88);
    color: inherit;
    text-decoration: none;
}

.exchange-list-item .top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.exchange-list-item .title {
    font-size: 16px;
    font-weight: 600;
}

.exchange-list-item .meta {
    margin-top: 6px;
    color: var(--exchange-muted);
    font-size: 12px;
}

.exchange-order-card {
    padding: 18px 16px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.exchange-order-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.exchange-order-main {
    min-width: 0;
}

.exchange-order-route {
    display: inline-flex;
    align-items: center;
    color: var(--exchange-text);
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.exchange-order-route:active {
    transform: translateY(1px);
}

.exchange-order-meta {
    display: flex;
    gap: 8px 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--exchange-muted);
    font-size: 12px;
    line-height: 1.6;
}

.exchange-order-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.exchange-order-metric {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(15, 118, 110, 0.05);
}

.exchange-order-metric .label {
    display: block;
    color: var(--exchange-muted);
    font-size: 11px;
    line-height: 1.4;
}

.exchange-order-metric .value {
    display: block;
    margin-top: 6px;
    color: var(--exchange-text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.exchange-order-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.exchange-list-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.exchange-inline-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--exchange-border);
    color: var(--exchange-accent);
    text-decoration: none;
    background: rgba(15, 118, 110, 0.06);
}

.exchange-inline-link.is-subtle {
    color: var(--exchange-muted);
    background: rgba(148, 163, 184, 0.12);
}

.exchange-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--exchange-muted);
}

.exchange-code-box {
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: #0f172a;
    color: #f8fafc;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.exchange-highlight {
    color: var(--exchange-warning);
    font-weight: 600;
}

.exchange-agreement-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    color: var(--exchange-muted);
    font-size: 13px;
    line-height: 1.7;
}

.exchange-agreement-check input {
    margin-top: 3px;
}

.exchange-agreement-check a {
    color: var(--exchange-accent);
    text-decoration: none;
}

.exchange-qr-card {
    margin-top: 12px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--exchange-border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--exchange-shadow);
}

.exchange-qr-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.exchange-qr-card p {
    margin: 0;
    color: var(--exchange-muted);
    font-size: 13px;
    line-height: 1.7;
}

.exchange-qr-image {
    display: block;
    width: min(100%, 220px);
    margin: 18px auto 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    padding: 8px;
}

.exchange-qr-meta {
    text-align: center;
    color: var(--exchange-muted);
    font-size: 12px;
    line-height: 1.6;
}

.exchange-protocol-content {
    color: var(--exchange-text);
    font-size: 14px;
    line-height: 1.9;
    word-break: break-word;
}

.exchange-protocol-content p:first-child,
.exchange-protocol-content h1:first-child,
.exchange-protocol-content h2:first-child,
.exchange-protocol-content h3:first-child {
    margin-top: 0;
}

.exchange-protocol-content a {
    color: var(--exchange-accent);
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .exchange-grid {
        grid-template-columns: 1fr;
    }
    .exchange-hero h1 {
        font-size: 24px;
    }
    .exchange-section {
        padding: 16px;
    }
    .exchange-order-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .exchange-order-summary {
        grid-template-columns: 1fr;
    }
    .exchange-order-actions {
        gap: 8px;
    }
    .exchange-inline-link {
        min-height: 36px;
    }
}
