:root {
    --primary-color: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --bg-dark: #0f0f1a;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-card-hover: rgba(40, 40, 70, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: rgba(139, 92, 246, 0.3);
    --border-glow: rgba(139, 92, 246, 0.5);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --gradient-gold: linear-gradient(135deg, #f59e0b, #fbbf24, #f59e0b);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #a78bfa);
    --gradient-dark: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--gradient-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-purple);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.2);
}

.nav-links a.active {
    background: var(--gradient-purple);
    box-shadow: var(--shadow-glow);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 140px);
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 30px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.card-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-value {
    font-size: 2.5rem;
    font-weight: bold;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    background: var(--gradient-gold);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

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

.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
}

.toast.success {
    border-color: var(--success-color);
}

.toast.error {
    border-color: var(--error-color);
}

.toast.warning {
    border-color: var(--warning-color);
}

.toast-icon {
    font-size: 1.3rem;
}

.toast.success .toast-icon { color: var(--success-color); }
.toast.error .toast-icon { color: var(--error-color); }
.toast.warning .toast-icon { color: var(--warning-color); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.stats-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: var(--gradient-purple);
}

.stats-info {
    flex: 1;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: bold;
}

.progress-bar {
    height: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-purple);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.character-card {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
}

.character-avatar {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    border: 3px solid var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.character-info {
    flex: 1;
}

.character-name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.character-profession {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--gradient-gold);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-title {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-header {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.calendar-day:hover:not(.empty):not(.signed) {
    background: rgba(139, 92, 246, 0.2);
}

.calendar-day.signed {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-glow);
}

.calendar-day.today {
    border: 2px solid var(--secondary-color);
}

.calendar-day.empty {
    cursor: default;
}

.lottery-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.lottery-wheel {
    aspect-ratio: 1;
    background: var(--bg-card);
    border-radius: 50%;
    border: 8px solid var(--border-glow);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    max-width: 400px;
}

.lottery-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid var(--secondary-color);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.lottery-center {
    width: 100px;
    height: 100px;
    background: var(--gradient-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: var(--shadow-glow);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.lottery-center:hover {
    transform: scale(1.05);
}

.lottery-center:active {
    transform: scale(0.95);
}

.lottery-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: bottom right;
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.prize-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.prize-card:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.prize-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.prize-info {
    flex: 1;
}

.prize-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.prize-probability {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.prize-stock {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    font-weight: 600;
}

.data-table tr:hover td {
    background: rgba(139, 92, 246, 0.1);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 10px 18px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--gradient-purple);
    border-color: transparent;
    color: white;
}

.chart-container {
    position: relative;
    height: 300px;
    padding: 20px;
}

.admin-sidebar {
    display: flex;
    gap: 30px;
}

.admin-menu {
    width: 250px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.admin-menu-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.admin-menu-item:hover,
.admin-menu-item.active {
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-primary);
}

.admin-menu-item.active {
    background: var(--gradient-purple);
}

.admin-content {
    flex: 1;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
}

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

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

@media (max-width: 1024px) {
    .lottery-container {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        flex-direction: column;
    }

    .admin-menu {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

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

    .character-card {
        flex-direction: column;
        text-align: center;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

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

.text-gold { color: var(--secondary-color); }
.text-purple { color: var(--primary-light); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.font-bold { font-weight: bold; }
.text-sm { font-size: 0.9rem; }
.text-lg { font-size: 1.2rem; }

.bg-glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
}
