/* ===== 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ===== 登录页 ===== */
.admin-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

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

.login-card h1 {
    text-align: center;
    font-size: 24px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 32px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #4f6ef7;
}

.login-error {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    margin-bottom: 12px;
}

/* ===== 布局 ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #1a1a2e;
    color: #ccc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header h2 {
    font-size: 18px;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #ddd;
}

.nav-item.active {
    background: rgba(79,110,247,0.15);
    color: #4f6ef7;
    border-left-color: #4f6ef7;
}

.nav-icon { font-size: 18px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-name {
    font-size: 13px;
    color: #888;
}

.btn-logout {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

/* ===== 主区域 ===== */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 32px;
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-size: 22px;
    color: #1a1a2e;
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    color: #555;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ===== 工具栏 ===== */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    max-width: 360px;
    padding: 10px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #4f6ef7;
}

.toolbar select {
    padding: 10px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

/* ===== 表格 ===== */
.table-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

.data-table thead {
    background: #fafafa;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    border-bottom: 2px solid #f0f0f0;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    white-space: nowrap;
}

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

.score-positive { color: #e74c3c; font-weight: 600; }
.score-negative { color: #27ae60; font-weight: 600; }
.game-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.game-tag.ddz { background: #fff3e0; color: #e67e22; }
.game-tag.gomoku { background: #e8f5e9; color: #2e7d32; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #4f6ef7;
    color: #fff;
    border-color: #4f6ef7;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: #888;
}

/* ===== 按钮 ===== */
.btn-primary {
    background: #4f6ef7;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #3b5de7;
}

.btn-primary.full-width {
    width: 100%;
    margin-top: 8px;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #1a1a2e;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 24px;
}

.modal-hint {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding: 12px;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.modal-error {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 160px;
    }
    .main-content {
        margin-left: 160px;
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
