:root {
    --bg: #070b14;
    --bg-2: #0b1120;
    --panel: rgba(19, 26, 43, .72);
    --panel-solid: #131a2b;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --ink: #eef2fb;
    --ink-2: #a9b4ca;
    --ink-3: #6f7b93;
    --accent: #3b82f6;
    --accent-2: #22d3ee;
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(900px 480px at 12% -8%, rgba(37, 99, 235, .22), transparent 65%),
        radial-gradient(700px 420px at 92% 4%, rgba(34, 211, 238, .12), transparent 62%);
    background-repeat: no-repeat;
}

a { color: inherit; text-decoration: none; }

/* ---------------- 顶栏 ---------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(7, 11, 20, .72);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    height: 68px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }

.brand-mark {
    width: 28px; height: 28px; border-radius: 9px;
    background: linear-gradient(135deg, #3b82f6, #22d3ee);
    box-shadow: 0 0 22px rgba(59, 130, 246, .5);
}

.brand-name { white-space: nowrap; }

.site-nav { display: flex; gap: 6px; }

.site-nav a {
    padding: 7px 13px;
    border-radius: 9px;
    color: var(--ink-2);
    font-size: 13px;
    transition: .18s;
}

.site-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.site-nav a.on { color: var(--ink); background: rgba(255, 255, 255, .1); }

.wallet-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.wallet-addr {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--ink-2);
}

.connect-btn {
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, .45);
    background: linear-gradient(135deg, rgba(37, 99, 235, .9), rgba(29, 78, 216, .9));
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: .18s;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .3);
    white-space: nowrap;
}

.connect-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(37, 99, 235, .4); }
.connect-btn.connected { background: rgba(255, 255, 255, .08); border-color: var(--line-2); box-shadow: none; }

/* ---------------- Hero ---------------- */
.hero { padding: 64px 24px 12px; }

.hero-inner { max-width: 1120px; margin: 0 auto; }

.hero-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, .35);
    background: rgba(59, 130, 246, .1);
    color: #93c5fd;
    font-size: 11px;
    letter-spacing: 1.2px;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -1.4px;
    background: linear-gradient(120deg, #fff 30%, #9cc0ff 75%, #6ee7e7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p { margin: 0; color: var(--ink-2); max-width: 560px; font-size: 15px; }

/* ---------------- 容器 ---------------- */
.container { max-width: 1120px; margin: 0 auto; padding: 34px 24px 60px; }
.container.narrow { max-width: 880px; }

/* ---------------- 链切换 ---------------- */
.chain-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }

.chain-tab {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--ink-2);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: .18s;
}

.chain-tab i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.chain-tab span { font-weight: 600; color: var(--ink); }
.chain-tab em { font-style: normal; font-size: 11px; color: var(--ink-3); }

.chain-tab:hover { border-color: var(--line-2); background: rgba(255, 255, 255, .06); }

.chain-tab.on {
    border-color: rgba(96, 165, 250, .55);
    background: linear-gradient(135deg, rgba(37, 99, 235, .25), rgba(34, 211, 238, .12));
    box-shadow: 0 8px 26px rgba(37, 99, 235, .18);
}

/* ---------------- 提示 ---------------- */
.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 13px 16px;
    border-radius: 13px;
    border: 1px solid rgba(240, 180, 41, .28);
    background: rgba(240, 180, 41, .07);
    margin-bottom: 22px;
}

.notice-icon {
    flex: 0 0 auto;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(240, 180, 41, .2);
    color: #f0b429;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.notice p { margin: 0; color: #e8c47a; font-size: 13px; }

/* ---------------- 面板与卡片 ---------------- */
.chain-panel { display: none; }
.chain-panel.active { display: block; animation: fadeUp .32s ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
}

.token-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: .2s;
    position: relative;
    overflow: hidden;
}

.token-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
}

.token-card:hover { border-color: var(--line-2); transform: translateY(-2px); }

.card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.token-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .06);
}

.token-avatar.letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    background: rgba(255, 255, 255, .06);
}

.token-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.token-meta b { font-size: 15px; }
.token-meta span { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.token-standard {
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: var(--ink-3);
    font-size: 11px;
    flex: 0 0 auto;
}

.addr-list {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 4px 12px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, .22);
}

.addr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 12px;
}

.addr-row + .addr-row { border-top: 1px dashed var(--line); }

.addr-key { color: var(--ink-3); flex: 0 0 auto; }

.addr-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ink-2);
    font-size: 12px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink-3);
    border-radius: 7px;
    padding: 2px 8px;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    flex: 0 0 auto;
}

.copy-btn:hover { color: var(--ink); border-color: var(--line-2); }

.amount-box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
    margin-bottom: 16px;
}

.amount-box label { font-size: 12px; color: var(--ink-3); }

.amount-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .25);
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    outline: none;
    transition: .18s;
}

.amount-input:focus { border-color: rgba(96, 165, 250, .55); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }
.amount-input::placeholder { color: var(--ink-3); font-family: inherit; }

.amount-hint { grid-column: 2; font-size: 11px; color: var(--ink-3); }

.approve-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: .18s;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .28);
}

.approve-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 28px rgba(37, 99, 235, .4); }
.approve-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.card-status {
    min-height: 18px;
    margin-top: 9px;
    font-size: 12px;
    text-align: center;
    color: var(--ink-3);
    word-break: break-all;
}

.card-status.ok { color: #4ade80; }
.card-status.fail { color: #f87171; }

/* ---------------- 空状态 ---------------- */
.empty-state {
    padding: 56px 24px;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
    text-align: center;
    background: rgba(255, 255, 255, .015);
}

.empty-state.small { padding: 40px 20px; }

.empty-mark {
    width: 44px; height: 44px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, .25), rgba(34, 211, 238, .12));
    border: 1px solid var(--line-2);
}

.empty-state h3 { margin: 0 0 6px; font-size: 15px; }
.empty-state p { margin: 0; color: var(--ink-3); font-size: 13px; }

/* ---------------- 流程说明 ---------------- */
.steps { margin-top: 48px; }

.steps h2 { font-size: 19px; margin: 0 0 18px; letter-spacing: -.3px; }

.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.step {
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
}

.step-num {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #60a5fa;
    letter-spacing: 1px;
}

.step h3 { margin: 8px 0 6px; font-size: 15px; }
.step p { margin: 0; color: var(--ink-3); font-size: 13px; }

/* ---------------- 授权记录页 ---------------- */
.page-title { margin: 28px 0 22px; }
.page-title h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.8px; }
.page-title p { margin: 0; color: var(--ink-2); font-size: 14px; }

.search-form { display: flex; gap: 10px; margin-bottom: 22px; }

.search-form input {
    flex: 1;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .28);
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    outline: none;
    transition: .18s;
}

.search-form input::placeholder { font-family: inherit; color: var(--ink-3); }
.search-form input:focus { border-color: rgba(96, 165, 250, .55); box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }

.search-form button {
    padding: 0 26px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.record-list { display: flex; flex-direction: column; gap: 12px; }

.record-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
}

.record-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-main b { font-size: 14px; }
.record-amount { color: var(--ink-2); font-size: 13px; }

.record-status {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
}
.record-status.ok { background: rgba(34, 197, 94, .14); color: #4ade80; }
.record-status.fail { background: rgba(239, 68, 68, .14); color: #f87171; }
.record-status.wait { background: rgba(240, 180, 41, .14); color: #f0b429; }

.record-sub {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 12px;
    color: var(--ink-3);
}

.record-sub code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ink-2);
}

.record-sub a { color: #60a5fa; }

/* ---------------- 标签 ---------------- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.tag-bsc { background: rgba(240, 185, 11, .15); color: #f0b90b; }
.tag-tron { background: rgba(235, 0, 41, .15); color: #f87171; }
.tag-sol { background: rgba(20, 241, 149, .13); color: #34d399; }

/* ---------------- 页脚 ---------------- */
.site-footer { border-top: 1px solid var(--line); padding: 26px 24px; margin-top: 40px; }

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--ink-3);
}

.footer-inner p { margin: 0; max-width: 700px; }

/* ---------------- Toast ---------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 12px);
    background: #1b2437;
    border: 1px solid var(--line-2);
    color: var(--ink);
    padding: 11px 20px;
    border-radius: 11px;
    font-size: 13px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: .24s;
    z-index: 999;
    max-width: 90vw;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.toast.success { border-color: rgba(74, 222, 128, .35); color: #86efac; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .step-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 34px; }
}

@media (max-width: 720px) {
    .header-inner { gap: 14px; padding: 0 16px; }
    .brand-name { display: none; }
    .site-nav { display: none; }
    .wallet-addr { display: none; }
    .hero { padding: 42px 16px 8px; }
    .container { padding: 26px 16px 44px; }
    .token-grid { grid-template-columns: 1fr; }
    .search-form { flex-direction: column; }
    .search-form button { padding: 12px; }
}

/* ---------------- 立即参与按钮 ---------------- */
.join-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.join-wrap[data-pos="hero"] { position: static; margin-top: 22px; }

.join-wrap[data-pos="top"] {
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    z-index: 900;
    margin: 0;
    pointer-events: none;
}

.join-wrap[data-pos="bottom"] {
    position: fixed;
    bottom: 26px;
    left: 0;
    right: 0;
    z-index: 900;
    margin: 0;
    pointer-events: none;
}

.join-wrap[data-pos="right"] {
    position: fixed;
    top: 50%;
    right: 22px;
    z-index: 900;
    margin: 0;
    transform: translateY(-50%);
    pointer-events: none;
}

.join-wrap[data-pos="top"] .join-btn,
.join-wrap[data-pos="bottom"] .join-btn,
.join-wrap[data-pos="right"] .join-btn { pointer-events: auto; }

.join-btn {
    margin-top: 0;
    padding: 14px 46px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .04em;
    color: #07121f;
    background: var(--join-color, #22d3ee);
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
    transition: transform .18s, box-shadow .18s, opacity .18s, filter .18s;
}

.join-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.join-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* ---------------- 授权成功推广弹窗 ---------------- */
.promo-mask {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 9, 17, .74);
    backdrop-filter: blur(4px);
}

.promo-mask[hidden] { display: none; }

.promo-box {
    position: relative;
    width: min(420px, 94vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: 30px 26px 22px;
    text-align: center;
    background: #131b2b;
    border: 1px solid var(--line-2, #243044);
    border-radius: 18px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}

.promo-box h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #86efac;
}

.promo-text {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.7;
    color: #a9b6c9;
    white-space: pre-wrap;
    word-break: break-word;
}

.promo-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 236px;
    height: 236px;
    margin: 0 auto 18px;
    padding: 8px;
    background: #fff;
    border-radius: 14px;
}

.promo-qr canvas,
.promo-qr img { width: 220px; height: 220px; display: block; }

.promo-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.promo-link-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 12px;
    color: #cfe0f5;
    background: #0c1421;
    border: 1px solid #243044;
    border-radius: 9px;
}

.promo-hint { margin: 0; font-size: 12px; color: #6f7f95; }

.promo-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    color: #8fa0b6;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.promo-close:hover { color: #fff; }

body.modal-open { overflow: hidden; }
