/* 全局样式 */
:root {
    --primary-color: #ff4d4d;
    --secondary-color: #343a40;
    --accent-color: #6c5ce7;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --text-light: #f8f9fa;
    --text-dark: #343a40;
    --border-color: #dee2e6;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--text-dark);
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-bg);
    color: var(--text-light);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding-top: 20px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    position: relative;
    margin-bottom: 5px;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ced4da;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-links li a i {
    font-size: 1.2rem;
    margin-right: 15px;
    min-width: 24px;
    text-align: center;
}

.sidebar.collapsed .nav-links li a span {
    display: none;
}

.nav-links li.active a, 
.nav-links li a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.nav-links li.active a i {
    color: var(--primary-color);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    color: #ced4da;
    text-decoration: none;
    font-size: 0.9rem;
}

.sidebar-footer a i {
    margin-right: 10px;
    font-size: 1rem;
}

.sidebar.collapsed .sidebar-footer a span {
    display: none;
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* 顶部导航栏样式 */
.top-nav {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
}

.toggle-btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 15px;
    padding-right: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: #f8f9fa;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification {
    position: relative;
    font-size: 1.2rem;
    cursor: pointer;
}

.notification .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.7rem;
    background-color: var(--primary-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* 页面容器样式 */
.page-container {
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.page-header p {
    margin: 5px 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* 仪表盘样式 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 15px;
}

.bg-blue {
    background-color: #4e73df;
}

.bg-green {
    background-color: #1cc88a;
}

.bg-purple {
    background-color: #8a63d2;
}

.bg-red {
    background-color: #e74a3b;
}

.stat-details h4 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.stat-details p {
    color: #6c757d;
    margin: 5px 0 10px;
}

.stat-progress {
    margin-top: auto;
}

.progress {
    height: 5px;
    margin-bottom: 5px;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

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

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: none;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.view-all {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
}

.table th {
    font-weight: 600;
    border-top: none;
}

.quick-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* 游戏管理页面样式 */
.filters {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    margin: 0;
    font-weight: 500;
}

.games-table-wrapper {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.games-table {
    margin-bottom: 0;
}

.games-table th:first-child,
.games-table td:first-child {
    width: 40px;
    text-align: center;
}

.games-table th:nth-child(3),
.games-table td:nth-child(3) {
    width: 80px;
}

.games-table img.game-thumbnail {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.category-badge {
    background-color: #f0f2f5;
    color: var(--text-dark);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-right: 5px;
    display: inline-block;
}

.category-badge.horror {
    background-color: #ffd7d7;
    color: #e74c3c;
}

.category-badge.survival {
    background-color: #d7ffe8;
    color: #2ecc71;
}

.category-badge.puzzle {
    background-color: #d7e4ff;
    color: #3498db;
}

.category-badge.adventure {
    background-color: #fff6d7;
    color: #f39c12;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.status-badge.new {
    background-color: #d7ffe8;
    color: #2ecc71;
}

.status-badge.hot {
    background-color: #ffd7d7;
    color: #e74c3c;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
    margin-bottom: 20px;
}

.page-info {
    font-size: 0.9rem;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* 游戏表单样式 */
.game-form-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.game-form {
    max-width: 1200px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
}

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

.form-group label {
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.required {
    color: var(--danger-color);
}

.form-text {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 5px;
}

.image-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-preview {
    width: 100%;
    height: 180px;
    border: 1px dashed #ced4da;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-upload-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.image-upload-controls span {
    color: #6c757d;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* 分类管理页面样式 */
.categories-container {
    margin-top: 20px;
}

.categories-table th,
.categories-table td {
    vertical-align: middle;
}

/* 设置页面样式 */
.system-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

/* 响应式调整 */
@media (max-width: 991px) {
    .sidebar {
        left: -250px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.active + .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 767px) {
    .search-box {
        display: none;
    }
    
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar.active + .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .sidebar.active {
        width: 100%;
    }
    
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-wrap: wrap;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page {
    animation: fadeIn 0.3s;
}

/* 工具提示和消息样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 10px;
    animation: slideIn 0.3s;
    width: 300px;
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.toast-body {
    padding: 10px 15px;
}

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

/* 额外美化效果 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #ff3333;
    border-color: #ff3333;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(255, 77, 77, 0.25);
}

input[type="checkbox"].form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
} 