/* ============================
   Reset & Base
   ============================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-base:        #060b17;
    --bg-surface:     #0d1526;
    --bg-card:        #101c35;
    --bg-card-hover:  #131f3a;
    --border:         rgba(255, 255, 255, 0.07);
    --border-hover:   rgba(79, 119, 246, 0.45);
    --accent-from:    #4f77f6;
    --accent-to:      #8e54e9;
    --text-primary:   #e8edf8;
    --text-secondary: #7b8ea8;
    --text-muted:     #4a5568;
    --success:        #22c55e;
    --danger:         #ef4444;
    --radius-card:    16px;
    --radius-btn:     50px;
    --transition:     0.22s ease;
}

html { height: 100%; }

body {
    font-family: 'Outfit', 'Arial', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================
   Background Effects
   ============================ */
.page-wrapper {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #4f77f6, transparent 70%);
    top: -200px;
    left: -200px;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8e54e9, transparent 70%);
    bottom: -100px;
    right: -150px;
}

/* ============================
   Container
   ============================ */
.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

/* ============================
   Wallet Status (功能性，JS 控制)
   ============================ */
.wallet-status {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--danger);
    color: #fff;
    padding: 8px 14px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 200;
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0;
    height: 1px;
    overflow: hidden;
    transition: background-color var(--transition), opacity var(--transition);
}

.status-text {
    white-space: nowrap;
}

.connect-wallet-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 14px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background var(--transition);
}

.connect-wallet-btn:hover { background: rgba(255, 255, 255, 0.3); }
.connect-wallet-btn:disabled { opacity: 0.65; cursor: default; }

/* ============================
   Header
   ============================ */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

.brand-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.1);
}

.header-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-from);
    background: rgba(79, 119, 246, 0.12);
    border: 1px solid rgba(79, 119, 246, 0.3);
    padding: 4px 12px;
    border-radius: 50px;
}

/* ============================
   Hero Section
   ============================ */
.hero {
    text-align: center;
    margin-bottom: 36px;
}

.hero-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-from);
    background: rgba(79, 119, 246, 0.1);
    border: 1px solid rgba(79, 119, 246, 0.25);
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 18px;
}

.main-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.title-gradient {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ============================
   Currency Options List
   ============================ */
.currency-options {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.currency-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    cursor: default;
}

.currency-item:last-child {
    border-bottom: none;
}

.currency-item:hover {
    background: var(--bg-card-hover);
}

/* ============================
   Currency Info
   ============================ */
.currency-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.currency-logo-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.currency-item:hover .currency-logo-wrap {
    border-color: var(--border-hover);
    box-shadow: 0 0 12px rgba(79, 119, 246, 0.2);
}

.currency-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.currency-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.currency-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.currency-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================
   Connect Button
   ============================ */
.connect-btn {
    font-family: 'Outfit', 'Arial', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-from) !important;
    background: rgba(79, 119, 246, 0.08) !important;
    border: 1px solid rgba(79, 119, 246, 0.3) !important;
    padding: 8px 22px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.connect-btn:hover {
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to)) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(79, 119, 246, 0.35);
    transform: translateY(-1px);
}

.connect-btn:active {
    transform: translateY(0);
}

/* Loading 状态 */
.connect-btn.loading {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.connect-btn.loading::after {
    content: '';
    display: inline-block;
    margin-left: 7px;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(79, 119, 246, 0.4);
    border-top-color: var(--accent-from);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================
   Footer
   ============================ */
.site-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

/* ============================
   Modal (动态创建，由 app.js 使用)
   ============================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 32px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.modal-body {
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.modal-body p {
    margin-bottom: 10px;
}

.modal-body strong {
    color: var(--text-primary);
}

.contract-address {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    background: rgba(79, 119, 246, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(79, 119, 246, 0.25);
    color: var(--accent-from);
    font-weight: 600;
    word-break: break-all;
}

.contract-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 10px;
    margin: 14px 0;
    text-align: center;
}

.contract-label {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notice {
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    padding: 12px;
    border-radius: 8px;
    color: #fbbf24;
    font-size: 0.82rem;
    margin-top: 14px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    font-family: 'Outfit', 'Arial', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 11px 28px;
    border-radius: var(--radius-btn);
    background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.modal-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.modal-btn-cancel {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #f87171;
}

.modal-btn-cancel:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 480px) {
    .container {
        padding: 24px 16px 40px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.88rem;
    }

    .currency-item {
        padding: 14px 16px;
    }

    .currency-logo-wrap {
        width: 38px;
        height: 38px;
    }

    .currency-logo {
        width: 24px;
        height: 24px;
    }

    .connect-btn {
        padding: 7px 16px;
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 24px 20px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .site-header {
        margin-bottom: 28px;
    }
}
