* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --surface-variant: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 24px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-bg: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    --header-bg: rgba(30, 41, 59, 0.9);
    --nav-bg: rgba(30, 41, 59, 0.95);
}

body.light-mode {
    --background: #ffffff;
    --surface: #ffffff;
    --surface-light: #f1f5f9;
    --surface-variant: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(0, 0, 0, 0.12);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient-bg: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    --header-bg: rgba(255, 255, 255, 0.97);
    --nav-bg: rgba(255, 255, 255, 0.97);
}

body.light-mode .game-title { color: #0f172a; }
body.light-mode .game-meta { color: #475569; }
body.light-mode .game-rating { color: #d97706; }
body.light-mode .game-category { background: #e2e8f0; color: #475569; }
body.light-mode .form-label { color: #334155; }
body.light-mode .form-input, body.light-mode .form-select {
    background: #ffffff !important; color: #0f172a !important; border-color: #d1d5db !important;
}
body.light-mode .form-textarea, body.light-mode .raw-field-value {
    background: #ffffff !important; color: #0f172a !important; border-color: #d1d5db !important;
}
body.light-mode .settings-label { color: #1e293b; }
body.light-mode .settings-value { color: #64748b; }
body.light-mode .modal-content { background: #ffffff; border-color: #e2e8f0; }
body.light-mode .modal-title { color: #0f172a; }
body.light-mode .modal-body, body.light-mode .modal-body p,
body.light-mode .modal-body div, body.light-mode .modal-body span,
body.light-mode .modal-body label { color: #334155; }
body.light-mode .modal-body a { color: #6366f1; }
body.light-mode .modal-footer { border-color: #e2e8f0; }
body.light-mode .list-item { border-color: #e2e8f0; }
body.light-mode .list-item .list-item-title { color: #0f172a; }
body.light-mode .list-item .list-item-meta { color: #64748b; }
body.light-mode .pagination-btn { background: #ffffff; color: #334155; border-color: #cbd5e1; }
body.light-mode .pagination-btn.active { background: #6366f1; color: white; }
body.light-mode .filter-option { background: #ffffff; color: #334155; border-color: #cbd5e1; }
body.light-mode .filter-option.selected { background: #6366f1; color: white; }
body.light-mode .app-nav { background: var(--nav-bg); border-color: #e2e8f0; }
body.light-mode .nav-label { color: #64748b; }
body.light-mode .nav-item.active .nav-label { color: #6366f1; }
body.light-mode .toast { background: #334155; color: white; }
body.light-mode .skeleton { background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%); }
body.light-mode .guide-banner { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
body.light-mode .announcement-section { background: #f1f5f9; border-color: #e2e8f0; }
body.light-mode .announcement-section .announcement-title { color: #0f172a; }
body.light-mode .announcement-section .announcement-text { color: #475569; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-section {
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
    font-size: 20px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.carousel-section {
    margin-bottom: 32px;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    aspect-ratio: 16/9;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.carousel-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.carousel-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
}

.view-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.view-toggle:hover {
    background: var(--surface-light);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.category-card-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius);
}

.category-card-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
}

.game-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.game-cover {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.game-cover .cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.game-cover .cover-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.game-info {
    flex: 1;
    padding: 0;
    min-width: 0;
}

.game-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--warning);
}

.game-category {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--surface-light);
    border-radius: 6px;
}

.table-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface);
    padding: 6px;
    border-radius: var(--radius);
}

.table-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.table-tab:hover {
    color: var(--text-primary);
}

.table-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.table-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface);
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    align-items: center;
}

.toolbar-left {
    flex: 1;
    min-width: 200px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-light);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    flex: 1;
    min-width: 0;
}

.table-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    min-width: 0;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    background: var(--primary);
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.table-container {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.data-table thead {
    background: var(--surface-light);
}

.data-table th {
    padding: 14px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.th-select {
    width: 50px;
}

.th-icon {
    width: 60px;
}

.th-name {
    min-width: 150px;
}

.th-category {
    width: 100px;
}

.th-rating {
    width: 80px;
}

.th-downloads {
    width: 100px;
}

.th-date {
    width: 120px;
}

.th-actions {
    width: 120px;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.sortable:hover {
    color: var(--primary);
}

.sortable::after {
    content: ' ↕';
    opacity: 0.3;
}

.sortable.asc::after {
    content: ' ↑';
    opacity: 1;
    color: var(--primary);
}

.sortable.desc::after {
    content: ' ↓';
    opacity: 1;
    color: var(--primary);
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.data-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.2);
}

.table-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.table-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--warning);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-action-btn {
    padding: 6px 12px;
    border: none;
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-action-btn:hover {
    background: var(--primary);
}

.table-action-btn.danger:hover {
    background: var(--danger);
}

.table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.footer-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: var(--primary);
}

.pagination-btn.active {
    background: var(--gradient-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--surface);
    padding: 6px;
    border-radius: var(--radius);
}

.time-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-btn:hover {
    color: var(--text-primary);
}

.time-btn.active {
    background: var(--gradient-primary);
    color: white;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.chart-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-container {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.pie-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.bar-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 12px;
    height: 150px;
    padding: 0 20px;
}

.bar-chart-bar {
    flex: 1;
    max-width: 60px;
    background: var(--gradient-primary);
    border-radius: 8px 8px 0 0;
    transition: height 0.5s ease;
    position: relative;
}

.bar-chart-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bar-chart-value {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
}

.profile-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.avatar-text {
    color: white;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-email {
    font-size: 14px;
    color: var(--text-secondary);
}

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.settings-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.settings-list {
    display: flex;
    flex-direction: column;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-icon {
    font-size: 20px;
    margin-right: 12px;
}

.settings-label {
    flex: 1;
    font-size: 15px;
}

.settings-value {
    color: var(--text-secondary);
    font-size: 14px;
}

.settings-arrow {
    color: var(--text-muted);
    font-size: 20px;
}

.btn-small {
    padding: 8px 16px;
    border: none;
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: var(--primary);
}

.switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--surface-light);
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--gradient-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.app-nav {
    display: flex;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--danger);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    opacity: 0.9;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 8px 16px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-option:hover {
    border-color: var(--primary);
}

.filter-option.selected {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-range input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
}

.filter-range span {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: center;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: toastIn 0.3s ease;
    border: 1px solid var(--border);
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-cover {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .game-title {
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    cursor: pointer;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--surface-light);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.import-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--surface-light);
    padding: 4px;
    border-radius: var(--radius);
}

.import-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.import-tab:hover {
    color: var(--text-primary);
}

.import-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.import-content {
    margin-bottom: 16px;
}

.import-content.hidden {
    display: none;
}

.import-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.import-example {
    margin-top: 12px;
    text-align: right;
}

.import-example a {
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
}

.import-example a:hover {
    text-decoration: underline;
}

.import-options {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: var(--surface-light);
    border-radius: var(--radius);
}

.import-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.import-option input[type="radio"] {
    accent-color: var(--primary);
}

.add-game-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border: none;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-game-fab:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
}

.add-game-fab:active {
    transform: scale(0.95);
}

.cloud-provider-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--surface-light);
    padding: 4px;
    border-radius: var(--radius);
}

.provider-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.provider-tab:hover {
    color: var(--text-primary);
}

.provider-tab.active {
    background: var(--gradient-primary);
    color: white;
}

.provider-content {
    animation: fadeIn 0.3s ease;
}

.provider-content.hidden {
    display: none;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-hint a {
    color: var(--primary);
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

.info-card {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.info-card p {
    margin-bottom: 8px;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-warning {
    color: var(--warning);
}

.sync-options {
    margin-top: 20px;
    padding: 16px;
    background: var(--surface-light);
    border-radius: var(--radius);
}

.sync-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
}

.sync-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.sync-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.last-sync-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--surface-light);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.help-section {
    margin-bottom: 24px;
}

.help-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
}

.help-section ol {
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.8;
}

.help-section li {
    margin-bottom: 6px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}

.help-table th,
.help-table td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.help-table th {
    background: var(--surface-light);
    font-weight: 600;
}

.code-block {
    background: var(--surface-light);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 12px 0;
}

.warning-text {
    color: var(--warning);
    font-size: 12px;
    margin-top: 8px;
}

.admin-panel {
    max-width: 600px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.admin-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.admin-stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.admin-section {
    margin-bottom: 24px;
}

.admin-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-reviews-list {
    max-height: 300px;
    overflow-y: auto;
}

.admin-review-item {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}

.admin-review-item .review-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.admin-review-item .review-game {
    font-weight: 600;
}

.admin-review-item .review-rating {
    color: var(--warning);
}

.admin-review-item .review-user {
    color: var(--text-secondary);
    margin-left: auto;
}

.admin-review-item .review-content {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.btn-small.danger {
    background: var(--danger);
    color: white;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.review-game-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface-light);
    border-radius: var(--radius);
}

.game-icon-large {
    font-size: 48px;
}

.game-title-large {
    font-size: 18px;
    font-weight: 600;
}

.game-category-large {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.rating-stars {
    display: flex;
    gap: 8px;
}

.rating-stars .star {
    font-size: 32px;
    color: var(--surface-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-stars .star:hover,
.rating-stars .star.active {
    color: var(--warning);
    transform: scale(1.1);
}

.review-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.review-item:last-child {
    border-bottom: none;
}

.review-item .review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-item .review-user-name {
    font-weight: 600;
    font-size: 14px;
}

.review-item .review-rating {
    color: var(--warning);
    font-size: 13px;
}

.review-item .review-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.review-item .review-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.no-reviews {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.random-image-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.random-image-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.random-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 48px;
}

.placeholder-text {
    font-size: 14px;
}

.refresh-image-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.refresh-image-btn:hover {
    transform: scale(1.1) rotate(180deg);
}

.refresh-image-btn:active {
    transform: scale(0.95);
}

/* ========== 骨架屏加载动画 ========== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #1e293b;
}

.skeleton-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
}

.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w80 { width: 80%; }

/* ========== 封面图状态 ========== */
@keyframes cover-loading {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.game-cover.cover-loading {
    position: relative;
}

.game-cover.cover-loading::after {
    content: '⏳';
    position: absolute;
    font-size: 28px;
    animation: cover-loading 1.2s infinite;
    z-index: 2;
}

.game-cover.cover-noimage {
    opacity: 0.5;
}

.game-cover.cover-noimage::after {
    content: '😿';
    position: absolute;
    font-size: 24px;
    opacity: 0.6;
}
