/**
 * 后台通用样式
 * JJ竞猜管理系统
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

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

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: #001529;
    color: #fff;
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    overflow-y: auto;
    z-index: 99;
}

/* 侧边栏收起状态 */
.sidebar.open {
    transform: translateX(-100%);
}

/* 主内容区 */
.main-content {
    margin-left: 200px;
    padding: 20px;
    min-height: calc(100vh - 64px);
}

.sidebar-logo {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
}

.sidebar-menu .menu-item {
    position: relative;
}

.sidebar-menu .menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-menu .menu-item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-menu .menu-item.active a {
    color: #fff;
    background: #1890ff;
}

.sidebar-menu .menu-icon {
    font-family: 'iconfont';
    font-size: 16px;
    margin-right: 10px;
    width: 24px;
    text-align: center;
}

/* 子菜单样式 */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-menu .menu-item.submenu-open > .sidebar-submenu {
    display: block;
}

.sidebar-menu .menu-item.submenu-open > .menu-parent .menu-arrow {
    transform: rotate(180deg);
}

.menu-parent {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: all 0.3s;
}

.menu-parent:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.menu-parent .menu-text {
    flex: 1;
}

.menu-arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.sidebar-submenu .menu-item a {
    padding: 10px 24px 10px 48px;
    font-size: 13px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 200px;
    min-height: 100vh;
}

/* 顶部导航 */
.top-header {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.top-header .page-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.top-header .admin-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-header .admin-name {
    font-size: 14px;
    color: #666;
}

.top-header .logout-btn {
    padding: 6px 16px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.top-header .logout-btn:hover {
    background: #ff7875;
}

/* 内容区域 */
.content-wrapper {
    padding: 24px;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

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

.stats-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stats-card .stats-label {
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
}

.stats-card .stats-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stats-card.blue .stats-value { color: #1890ff; }
.stats-card.green .stats-value { color: #52c41a; }
.stats-card.orange .stats-value { color: #fa8c16; }
.stats-card.red .stats-value { color: #ff4d4f; }
.stats-card.purple .stats-value { color: #722ed1; }

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.data-table td {
    color: #666;
    font-size: 14px;
}

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

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
}

.btn-primary:hover {
    background: #40a9ff;
}

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

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

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-warning {
    background: #faad14;
    color: #fff;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-default {
    background: #f5f5f5;
    color: #666;
}

.btn-default:hover {
    background: #e8e8e8;
}

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

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 搜索筛选区 */
.filter-section {
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.filter-item input,
.filter-item select {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    color: #1890ff;
    border-color: #1890ff;
}

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

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

/* 徽章 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #f6ffed; color: #52c41a; }
.badge-warning { background: #fffbe6; color: #faad14; }
.badge-danger { background: #fff2f0; color: #ff4d4f; }
.badge-info { background: #e6f7ff; color: #1890ff; }
.badge-default { background: #f5f5f5; color: #666; }

/* 状态标签 */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online { background: #52c41a; }
.status-dot.offline { background: #d9d9d9; }

/* 操作按钮组 */
.action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 弹窗样式 */
.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;
    display: none;
}

.modal-overlay.active {
    display: flex;
}

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

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #d9d9d9;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn 0.3s ease;
}

.toast.success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.toast.error {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 头部快捷操作区 */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 图标字体 - Font Awesome 6 */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-style: normal;
    font-weight: 400;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/webfonts/fa-brands-400.woff2') format('woff2');
}

.iconfont,
.menu-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    text-align: center;
    line-height: 1;
    font-size: 16px;
    font-style: normal;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 菜单图标 */
.sidebar-menu .menu-icon {
    font-size: 16px;
    margin-right: 10px;
    width: 24px;
    text-align: center;
    font-weight: 900;
}

/* 图标背景 */
.icon-bg-blue { background: rgba(102, 126, 234, 0.1); color: #667eea; }
.icon-bg-green { background: rgba(82, 196, 26, 0.1); color: #52c41a; }
.icon-bg-orange { background: rgba(250, 140, 22, 0.1); color: #fa8c16; }
.icon-bg-red { background: rgba(255, 77, 79, 0.1); color: #ff4d4f; }
.icon-bg-purple { background: rgba(114, 46, 209, 0.1); color: #722ed1; }
.icon-bg-cyan { background: rgba(24, 144, 255, 0.1); color: #1890ff; }
