@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css');

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

body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background: #f5f5f5;
    color: #333;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: #fff;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    margin: 15px 0 5px;
    font-size: 24px;
    color: #333;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-success {
    background: #2ecc71;
    color: #fff;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-cancel {
    background: #95a5a6;
    color: #fff;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-logout {
    background: #34495e;
    color: #fff;
    width: 100%;
}

.btn-logout:hover {
    background: #2c3e50;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #999;
}

.admin-page {
    min-height: 100vh;
}

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

.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: #34495e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header img {
    border-radius: 50%;
}

.sidebar-nav ul {
    list-style: none;
    padding: 10px 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
    background: #34495e;
    color: #fff;
}

.sidebar-footer {
    padding: 20px;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px;
}

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

.content-header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.header-info {
    color: #666;
}

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

.header-actions select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.card-icon.blue { background: #3498db; }
.card-icon.green { background: #2ecc71; }
.card-icon.orange { background: #f39c12; }
.card-icon.purple { background: #9b59b6; }

.card-content h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.card-content .card-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

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

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.3s;
}

.rank-item:hover {
    background: #f8f9fa;
}

.rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

.rank-num.top {
    background: #f39c12;
    color: #fff;
}

.rank-name {
    flex: 1;
    font-weight: 600;
}

.rank-count {
    color: #666;
    font-size: 14px;
}

.tab-container {
    margin-top: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-bar select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.settings-form {
    max-width: 600px;
}

.settings-form h3 {
    margin: 20px 0 15px;
    font-size: 16px;
    color: #2c3e50;
}

.settings-form .form-group {
    margin-bottom: 15px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #eee;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.close-btn:hover {
    background: #ddd;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

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

.page-info {
    color: #666;
    font-size: 14px;
}

.chart-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 200px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chart-bar .bar {
    width: 40px;
    background: #667eea;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s;
}

.chart-bar .bar:hover {
    background: #5a6fd6;
}

.chart-bar span {
    font-size: 12px;
    color: #666;
}

.pie-chart-container {
    display: flex;
    gap: 30px;
    align-items: center;
}

.pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        #3498db 0% 30%,
        #2ecc71 30% 55%,
        #f39c12 55% 75%,
        #9b59b6 75% 90%,
        #e74c3c 90% 100%
    );
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 8px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.game-card:hover {
    transform: translateY(-5px);
}

.game-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.game-card .game-info {
    padding: 15px;
}

.game-card h3 {
    font-size: 14px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.game-card p {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.game-card .game-actions {
    display: flex;
    gap: 5px;
}

.upload-form,
.create-form {
    max-width: 800px;
}

.upload-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.progress-bar {
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: #667eea;
    width: 50%;
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-text {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: #666;
}

textarea {
    font-family: monospace;
}

#game-preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .admin-content {
        margin-left: 0;
    }
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    .content-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}