@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --mint-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* 背景动画 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-gradient);
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    top: 30%;
    right: 30%;
    animation-delay: 15s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    padding: 25px 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-icon {
    font-size: 3em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

header h1 {
    font-size: 2em;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 400;
}

/* 按钮 */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.hero-section {
    grid-column: 1 / -1;
}

.hero-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.hero-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hero-card h2 {
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 10px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: white;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-section {
    margin-top: 30px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.progress-percentage {
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Mint Section */
.mint-section,
.wallet-section {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header i {
    font-size: 1.5em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-header h2 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.mint-controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.quantity-section label,
.referral-section label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.referral-section {
    margin: 10px 0;
}

.referral-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95em;
    font-family: 'Inter', monospace;
    outline: none;
    transition: all 0.3s ease;
}

.referral-input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.referral-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.referral-hint {
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.btn-quantity {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2em;
}

.btn-quantity:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.quantity-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0 20px;
    min-width: 120px;
    justify-content: center;
}

.quantity-display input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 700;
    width: 50px;
    text-align: center;
    outline: none;
}

.quantity-label {
    color: var(--text-secondary);
    font-size: 1em;
}

.price-section {
    margin: 10px 0;
}

.price-card {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.price-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    margin-bottom: 8px;
}

.price-value {
    font-size: 2.5em;
    font-weight: 800;
    color: white;
}

.price-unit {
    font-size: 0.6em;
    margin-left: 8px;
    opacity: 0.9;
}

.btn-mint {
    background: var(--mint-gradient);
    color: white;
    padding: 18px;
    font-size: 1.1em;
    width: 100%;
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
    font-weight: 700;
}

.btn-mint:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(245, 87, 108, 0.4);
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-message.info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Wallet Section */
.wallet-info {
    line-height: 1.8;
}

.wallet-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.wallet-placeholder i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.wallet-info p {
    margin: 12px 0;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.wallet-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 推荐信息样式 */
.referral-info {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
}

.referral-detected {
    color: #10b981;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.referral-stats-section {
    grid-column: 1 / -1;
}

.referral-stats-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.stats-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.stats-placeholder i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.referral-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.referral-stat-item .stat-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.referral-stat-item .stat-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
}

.referral-link-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.referral-link-section label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.referral-link-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.referral-link-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9em;
    font-family: 'Inter', monospace;
    outline: none;
}

.btn-copy {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.referral-link-hint {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

/* 排行榜样式 */
.leaderboard-section {
    grid-column: 1 / -1;
}

.leaderboard-card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.leaderboard-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.leaderboard-placeholder i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.leaderboard-item.current-user {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.rank-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1em;
    color: white;
    flex-shrink: 0;
}

.leaderboard-item.current-user .rank-badge {
    background: var(--mint-gradient);
}

.leaderboard-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-address {
    font-family: 'Inter', monospace;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    word-break: break-all;
    font-size: 0.9em;
}

.you-badge {
    background: var(--mint-gradient);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
}

.leaderboard-count {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.1em;
}

.user-rank-info {
    margin-top: 20px;
}

.rank-separator {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
    position: relative;
}

.rank-separator::before {
    content: '你的排名';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.9);
    padding: 0 15px;
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .hero-card {
        padding: 30px 20px;
    }

    .hero-card h2 {
        font-size: 1.8em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .mint-section,
    .wallet-section {
        padding: 20px;
    }
}
