:root {
    --primary: #9B59B6;
    --secondary: #E91E8C;
    --accent: #FF6B9D;
    --bg-dark: #1A1025;
    --bg-card: #2D1B3D;
    --bg-card-hover: #3D2B4D;
    --text-white: #FFFFFF;
    --text-secondary: #B8A0C8;
    --text-muted: #8B7A9E;
    --gradient-primary: linear-gradient(135deg, #9B59B6 0%, #E91E8C 100%);
    --gradient-accent: linear-gradient(135deg, #FF6B9D 0%, #9B59B6 100%);
    --gradient-dark: linear-gradient(180deg, #1A1025 0%, #2D1B3D 100%);
    --shadow-glow: 0 0 30px rgba(155, 89, 182, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--gradient-dark);
    background-attachment: fixed;
}

.page-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg-dark);
    box-shadow: 0 0 50px rgba(155, 89, 182, 0.2);
}

.page-content {
    padding-bottom: 80px;
    min-height: 100vh;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: 70px;
    background: rgba(26, 16, 37, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(155, 89, 182, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    padding-bottom: env(safe-area-inset-bottom, 10px);
    z-index: 1000;
    box-shadow: 0 -5px 30px rgba(155, 89, 182, 0.15);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    border-radius: 12px;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0;
    filter: blur(15px);
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-white);
}

.nav-item.active {
    color: var(--text-white);
}

.nav-item.active::before {
    opacity: 0.5;
}

.nav-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-bottom: 4px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-text {
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.nav-item.active .nav-text {
    color: var(--accent);
}

.page-header {
    background: rgba(26, 16, 37, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 20px;
    padding-top: calc(15px + env(safe-area-inset-top, 0));
    border-bottom: 1px solid rgba(155, 89, 182, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 15px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(155, 89, 182, 0.1);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(155, 89, 182, 0.3);
    transform: translateY(-2px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(155, 89, 182, 0.6);
    transform: translateY(-2px);
}

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

.btn-secondary {
    background: rgba(155, 89, 182, 0.2);
    color: var(--text-white);
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.btn-secondary:hover {
    background: rgba(155, 89, 182, 0.3);
}

.btn-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    }
    to {
        box-shadow: 0 4px 30px rgba(233, 30, 140, 0.6);
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(155, 89, 182, 0.2);
    color: var(--accent);
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.badge-free {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.badge-vip {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.3);
}

.badge-level {
    background: rgba(155, 89, 182, 0.2);
    color: var(--accent);
    border-color: rgba(155, 89, 182, 0.3);
}

.user-level {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: var(--gradient-primary);
    color: var(--text-white);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(155, 89, 182, 0.3);
}

.avatar-lg {
    width: 60px;
    height: 60px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.starry-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 200px 50px, #fff, transparent),
        radial-gradient(2px 2px at 250px 90px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 350px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 400px 400px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 30px;
    margin: 20px;
    max-width: 350px;
    width: 100%;
    border: 1px solid rgba(155, 89, 182, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(155, 89, 182, 0.3);
    background: rgba(45, 27, 61, 0.8);
    color: var(--text-white);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.2);
}

.input-field::placeholder {
    color: var(--text-muted);
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    z-index: 3000;
    animation: toastIn 0.3s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-success {
    border-color: rgba(76, 175, 80, 0.5);
}

.toast-error {
    border-color: rgba(244, 67, 54, 0.5);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(155, 89, 182, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.empty-text {
    font-size: 14px;
    color: var(--text-muted);
}

.glass {
    background: rgba(45, 27, 61, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 89, 182, 0.1);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }

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

.hidden { display: none !important; }

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.swipeRefresh {
    transition: transform 0.3s;
}

.pull-down-indicator {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.list-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.divider {
    height: 1px;
    background: rgba(155, 89, 182, 0.1);
    margin: 20px 0;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    cursor: pointer;
}

.list-item:hover {
    background: rgba(155, 89, 182, 0.1);
}

.list-item:active {
    transform: scale(0.98);
}

@media (max-width: 430px) {
    .page-container {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, 
        rgba(155, 89, 182, 0.1) 0%, 
        rgba(233, 30, 140, 0.1) 50%, 
        rgba(155, 89, 182, 0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 15px 0;
    margin-top: 10px;
    background: rgba(155, 89, 182, 0.05);
    border-radius: 12px;
}

.profile-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.profile-stats .stat-value {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #9B59B6, #FF6B9D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-stats .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-stats .stat-divider {
    display: none;
}
