* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-main: #070707;
    --bg-panel: #121212;
    --bg-soft: rgba(255, 255, 255, 0.02);
    --line: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-muted: #a7adb4;
    --brand: #00ff88;
    --brand-strong: #00cc6a;
    --brand-shadow: rgba(0, 255, 136, 0.25);
    --warning: #ffd93d;
    --danger: #ff6b6b;
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #000000 0%, #001a0d 50%, #002614 100%);
    color: var(--text);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding-bottom: var(--safe-area-inset-bottom);
    overflow-x: hidden;
}

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

.page {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 16px 16px;
    padding-bottom: calc(16px + var(--safe-area-inset-bottom));
    position: relative;
}

.page::before {
    content: "";
    position: fixed;
    inset: -120px 0 auto 0;
    height: 320px;
    background:
        radial-gradient(circle at 30% 20%, rgba(0, 255, 136, 0.15), transparent 50%),
        radial-gradient(circle at 70% 10%, rgba(0, 204, 106, 0.1), transparent 45%);
    opacity: 0.8;
    pointer-events: none;
    z-index: -1;
}

.topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    position: sticky;
    top: 0;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), transparent 65%),
                rgba(7, 7, 7, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
    z-index: 100;
    margin: 0 -16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 18px var(--brand-shadow));
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn {
    border: none;
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-connect {
    padding: 10px 16px;
    min-height: 40px;
    font-size: 0.875rem;
}

.btn-connect.connected {
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
}

.hero-section {
    text-align: center;
    padding: 120px 0 100px;
    position: relative;
    background: 
        radial-gradient(circle at 50% 30%, rgba(0, 255, 136, 0.08), transparent 45%),
        radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.06), transparent 40%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, transparent 100%);
    border-radius: 24px;
    margin: 0 -16px 40px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 24px;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 0 60px rgba(0, 255, 136, 0.3),
                 0 0 30px rgba(56, 189, 248, 0.2);
}

.hero-slogan {
    font-size: 1.125rem;
    color: rgba(148, 163, 184, 0.9);
    line-height: 1.75;
    max-width: 800px;
    margin: 0 auto;
    font-weight: 400;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #0b0b0b;
    box-shadow: 0 6px 20px var(--brand-shadow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--brand-shadow);
}

/* 智能按钮样式 */
.btn-smart {
    min-width: 140px;
}

.btn-smart[data-loading="true"] .btn-text {
    opacity: 0;
}

.btn-smart .btn-loading {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #0b0b0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
}

.btn-smart[data-loading="true"] .btn-loading {
    display: block;
}

/* 领取按钮特殊样式 */
.btn-claim {
    background: linear-gradient(135deg, #ffd93d 0%, #ff9500 100%);
    color: #0b0b0b;
    box-shadow: 0 6px 20px rgba(255, 217, 61, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

.btn-claim:hover:not(:disabled) {
    transform: translateY(-2px);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 6px 20px rgba(255, 217, 61, 0.3); }
    50% { box-shadow: 0 6px 30px rgba(255, 217, 61, 0.5); }
}

.btn-secondary {
    background: rgba(0, 255, 136, 0.12);
    color: var(--brand);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-ghost:hover,
.btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* 绿色按钮（领取收益） */
.btn-success {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #0b0b0b;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.25);
    border: none;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.35);
}

.btn-success:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 白色边框按钮（赎回） */
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--brand);
    background: rgba(0, 255, 136, 0.08);
    color: var(--brand);
}

.btn-outline:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: rgba(167, 173, 180, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.section {
    padding: 20px 0;
}

.section-head {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.section-head h2 {
    font-size: 1.5rem;
}

.section-head p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.grid {
    display: grid;
    gap: 20px;
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.app-grid {
    grid-template-columns: 1fr;
}

.panel {
    display: grid;
    gap: 16px;
}

.panel h3 {
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-fire {
    font-size: 1.25rem;
}

.panel-full {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.period-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.period-option {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.8125rem;
    cursor: pointer;
}

.period-option .period-main {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
}

.period-option .period-sub {
    font-size: 0.75rem;
}

.period-option.active {
    border-color: var(--brand);
    background: rgba(0, 255, 136, 0.12);
    color: var(--brand);
}

/* 快捷金额选择按钮 */
.amount-options {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.amount-option {
    flex: 1;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    padding: 8px 12px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.amount-option:hover {
    border-color: var(--brand);
    background: rgba(0, 255, 136, 0.05);
    color: var(--brand);
}

.amount-option:active {
    transform: scale(0.98);
}

input,
select {
    background: #0b0b0b;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 1rem;
    min-height: 48px;
    -webkit-appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a7adb4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.15);
}

input::placeholder {
    color: rgba(167, 173, 180, 0.5);
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.panel-meta strong {
    color: var(--text);
    font-weight: 600;
}

.panel-meta-stack {
    flex-direction: column;
    gap: 6px;
}

.text-break {
    word-break: break-all;
    font-size: 0.75rem;
}

.status {
    min-height: 20px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-soft);
}

.status:empty {
    display: none;
}

.status.success {
    color: var(--brand);
    background: rgba(0, 255, 136, 0.1);
}

.status.error {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
}

.status.info {
    color: var(--text-muted);
}

/* 空投奖励高亮区域 */
.airdrop-highlight {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.15) 0%, rgba(255, 149, 0, 0.1) 100%);
    border: 1px solid rgba(255, 217, 61, 0.3);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.airdrop-badge {
    background: linear-gradient(135deg, #ffd93d 0%, #ff9500 100%);
    color: #0b0b0b;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.airdrop-amount {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.airdrop-amount span:first-child {
    font-size: 2rem;
    font-weight: 700;
    color: var(--warning);
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.5);
}

.airdrop-unit {
    font-size: 1rem;
    color: var(--text-muted);
}

/* 创世共建面板特殊样式 */
.panel-genesis {
    border-color: rgba(255, 217, 61, 0.2);
}

/* 共建记录样式 */
.genesis-record {
    display: grid;
    gap: 12px;
}

.genesis-record-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.05) 0%, rgba(0, 204, 106, 0.02) 100%);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 12px;
    padding: 16px;
}

.genesis-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.genesis-record-title {
    font-weight: 600;
    color: var(--brand);
}

.genesis-record-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 255, 136, 0.15);
    color: var(--brand);
}

.genesis-record-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.genesis-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.genesis-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.genesis-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.genesis-stat-value.highlight {
    color: var(--warning);
}

.genesis-progress {
    margin-top: 12px;
}

.genesis-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.genesis-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.genesis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-strong) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.record-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
    font-size: 0.875rem;
}

.team-list {
    display: grid;
    gap: 8px;
}

.team-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.team-summary-metric {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.8125rem;
}

.team-summary-label {
    color: var(--text-muted);
    margin-bottom: 4px;
}

.team-summary-value {
    font-weight: 600;
    color: var(--text);
}

.team-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--bg-soft);
    font-size: 0.8125rem;
}

.team-index {
    color: var(--text-muted);
}

.team-address {
    color: var(--brand);
    font-family: monospace;
}

.records {
    display: grid;
    gap: 12px;
}

.record {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--bg-soft);
}

.record-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9375rem;
}

.record-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-countdown {
    font-size: 0.8125rem;
    color: var(--brand);
    font-weight: 500;
}

.record-meta {
    display: grid;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.stake-amount {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

/* 收益数字突出显示 */
.reward-highlight {
    font-size: 0.9375rem;
    color: var(--text);
}

.reward-highlight strong {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--brand);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.claimable-ready {
    color: var(--text);
    font-weight: 500;
}

.claimable-ready strong {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--brand);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.claimable-pending {
    color: var(--text-muted);
    opacity: 0.7;
}

.claimable-pending strong {
    font-weight: 600;
}

.address-grid {
    display: grid;
    gap: 12px;
}

.address-grid div {
    display: grid;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.address-grid a {
    color: var(--brand);
    word-break: break-all;
}

input[readonly] {
    opacity: 0.7;
}

.footer {
    padding: 40px 0 20px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(0, 255, 136, 0.15);
    border-top: 4px solid var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 18px;
    color: var(--brand);
}

.toast {
    position: fixed;
    bottom: calc(24px + var(--safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.95) 0%, rgba(0, 204, 106, 0.9) 100%);
    border: 1px solid rgba(0, 255, 136, 0.5);
    padding: 14px 18px;
    border-radius: 12px;
    color: #0b0b0b;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 255, 136, 0.4), 0 0 0 1px rgba(0, 255, 136, 0.3) inset;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 平板及以上 */
@media (min-width: 768px) {
    .page {
        padding: 0 20px 20px;
    }

    .topbar {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
        position: relative;
        background: transparent;
        backdrop-filter: none;
    }

    .topbar-right {
        gap: 32px;
    }

    .nav-link {
        font-size: 0.9375rem;
    }

    .hero-section {
        padding: 140px 0 120px;
        margin: 0 0 60px;
        border-radius: 32px;
    }

    .hero-title {
        font-size: 4rem;
    }

    .hero-slogan {
        font-size: 1.25rem;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .brand-name {
        font-size: 1.6rem;
    }

    .brand-sub {
        font-size: 0.85rem;
    }

    .section-head h2 {
        font-size: 2rem;
    }

    .card {
        padding: 24px;
        border-radius: 20px;
    }

    .app-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .record-actions {
        flex-direction: row;
    }

    .btn {
        width: auto;
    }

    .panel-meta-stack {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .genesis-record-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .airdrop-highlight {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .toast {
        left: auto;
        right: 24px;
        max-width: 360px;
    }
}

/* 移动端特定样式 */
@media (max-width: 767px) {
    .btn {
        width: 100%;
    }

    .btn-connect {
        width: auto;
        flex-shrink: 0;
    }

    .nav-link {
        display: none;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
