/* Profile Page Styles - Modern Tailwind-inspired design */
.profile-page {
    display: none;
    height: 100vh;
    overflow-y: auto;
    background: #f8fafc;
}

.profile-page.active {
    display: block;
}

.profile-header {
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.back-btn {
    padding: 8px 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.back-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.profile-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.profile-content {
    padding: 16px;
}

/* User Info Card */
.profile-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.profile-avatar-section {
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #16a34a;
    margin-bottom: 16px;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.profile-name {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.profile-id {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
}

/* VIP Cards */
.vip-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.vip-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.vip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.vip-card.vip1::before {
    background: linear-gradient(90deg, #22c55e, #10b981);
}

.vip-card.vip1.active {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.vip-card.vip2::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.vip-card.vip2.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 100%);
}

.vip-card.vip3::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.vip-card.vip3.active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

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

.vip-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.vip-price {
    font-size: 15px;
    font-weight: 700;
    color: #ef4444;
    background: #fef2f2;
    padding: 4px 10px;
    border-radius: 20px;
}

.vip-card-body {
    margin-bottom: 14px;
}

.vip-features {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.vip-status {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

.vip-status.active {
    background: #dcfce7;
    color: #15803d;
}

.vip-status.expired {
    background: #fee2e2;
    color: #b91c1c;
}

.vip-buy-btn {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
}

.vip-buy-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.vip-buy-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.vip-card.active .vip-buy-btn {
    background: #94a3b8;
    cursor: default;
}

.vip-card.active .vip-buy-btn:hover {
    transform: none;
    box-shadow: none;
}

/* Token Card */
.token-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    position: relative;
    overflow: hidden;
}

.token-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.token-card h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.token-balance {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
}

.token-amount {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
}

.token-unit {
    font-size: 14px;
    opacity: 0.85;
}

.token-tip {
    margin: 0;
    font-size: 13px;
    opacity: 0.8;
}

/* Payment Modal */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.payment-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.payment-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.payment-modal-body {
    padding: 32px 24px;
    text-align: center;
}

#qr-code-container {
    margin: 0 auto 24px;
    width: 180px;
    height: 180px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    overflow: hidden;
}

#qr-code-container img {
    max-width: 100%;
    max-height: 100%;
}

.payment-amount {
    font-size: 18px;
    font-weight: 600;
    color: #ef4444;
    margin: 12px 0;
}

.payment-desc {
    font-size: 14px;
    color: #64748b;
    margin: 12px 0;
}

.payment-status {
    font-size: 14px;
    color: #16a34a;
    margin: 20px 0 0 0;
    padding: 10px 20px;
    background: #f0fdf4;
    border-radius: 24px;
    display: inline-block;
    font-weight: 500;
}

.payment-status.waiting {
    color: #d97706;
    background: #fffbeb;
}

.payment-status.success {
    color: #15803d;
    background: #dcfce7;
}

.payment-status.failed {
    color: #b91c1c;
    background: #fee2e2;
}

/* Paper list styles for autocite */
.paper-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.paper-item:hover {
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.12);
}

.paper-item.selected {
    border-color: #16a34a;
    background: #f0fdf4;
    border-width: 2px;
}

.paper-item .paper-checkbox {
    flex-shrink: 0;
    padding-top: 2px;
}

.paper-item .paper-select {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #16a34a;
}

.paper-item .paper-info {
    flex: 1;
    min-width: 0;
}

.paper-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.5;
}

.paper-authors {
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
    line-height: 1.4;
}

.paper-meta {
    font-size: 13px;
    color: #64748b;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.paper-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.paper-journal {
    font-style: italic;
}

/* 复制 BibTeX 按钮 */
.paper-copy-bib-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.paper-copy-bib-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

.paper-copy-bib-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.paper-copy-bib-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .profile-avatar {
        width: 64px;
        height: 64px;
    }

    .profile-name {
        font-size: 18px;
    }

    .vip-card {
        padding: 14px;
    }

    .vip-card-header h4 {
        font-size: 15px;
    }

    .token-amount {
        font-size: 32px;
    }
}
