/* 世界杯直播平台 - 管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ========== 美化滚动条 ========== */
/* Webkit 浏览器 (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: rgba(231, 76, 60, 0.25);
    border-radius: 3px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(231, 76, 60, 0.5);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* 侧边栏滚动条 - 深色主题 */
.sidebar .nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}
.sidebar .nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(231, 76, 60, 0.25) transparent;
}
.sidebar .nav-menu {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* 浅色主题滚动条 */
.admin-light-theme ::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.2);
}
.admin-light-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.35);
}
.admin-light-theme .sidebar .nav-menu::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.15);
}
.admin-light-theme .sidebar .nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.3);
}
.admin-light-theme * {
    scrollbar-color: rgba(100, 100, 100, 0.2) transparent;
}
.admin-light-theme .sidebar .nav-menu {
    scrollbar-color: rgba(100, 100, 100, 0.15) transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* 后台浅色主题 */
.admin-light-theme { background: #f0f2f5 !important; }
.admin-light-theme .sidebar { background: #fff !important; border-right: 1px solid #e8e8e8; }
.admin-light-theme .nav-item { color: #666 !important; }
.admin-light-theme .nav-item:hover, .admin-light-theme .nav-item.active { background: rgba(231,76,60,0.08) !important; color: #e74c3c !important; }
.admin-light-theme .nav-group-title { color: #999 !important; }
.admin-light-theme .sidebar-footer { border-top-color: #eee !important; }
.admin-light-theme .logo { border-bottom-color: #eee !important; }
.admin-light-theme .logo-text { color: #333 !important; }
.admin-light-theme .sidebar-toggle { color: #999 !important; }
.admin-light-theme .sidebar-toggle:hover { background: #f5f5f5 !important; color: #333 !important; }
.admin-light-theme #head { background: #fff !important; border-bottom: 1px solid #e8e8e8; }
.admin-light-theme .main-content { background: #f0f2f5 !important; }

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

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

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

.login-box h1 {
    text-align: center;
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #999;
    text-decoration: none;
}

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

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 100;
}

/* 侧边栏折叠 */
body.sidebar-collapsed .sidebar {
    width: 64px;
}
body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-group-title span,
body.sidebar-collapsed .nav-group-title .arrow,
body.sidebar-collapsed .nav-item span,
body.sidebar-collapsed .sidebar-footer .admin-info span,
body.sidebar-collapsed .sidebar-footer .logout-btn,
body.sidebar-collapsed .sidebar-footer #themeToggleBtn {
    display: none;
}
body.sidebar-collapsed .logo {
    justify-content: center;
    padding: 16px 8px;
}
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}
body.sidebar-collapsed .nav-group-title {
    text-align: center;
    padding: 8px 0 4px;
    cursor: default;
}
body.sidebar-collapsed .nav-group-items {
    max-height: 0;
}
body.sidebar-collapsed .main-content {
    margin-left: 64px;
}
body.sidebar-collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

/* 折叠按钮 */
.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.5);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-left: auto;
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

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

.logo img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 16px;
    font-weight: bold;
    color: #e74c3c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

/* 分组折叠 */
.nav-group-title {
    padding: 10px 20px 6px;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.nav-group-title:hover {
    color: rgba(255,255,255,0.7);
}
.nav-group-title .arrow {
    font-size: 9px;
    transition: transform 0.3s;
}
.nav-group.collapsed .nav-group-title .arrow {
    transform: rotate(-90deg);
}
.nav-group-items {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 2000px;
}
.nav-group.collapsed .nav-group-items {
    max-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    gap: 10px;
    white-space: nowrap;
}
.nav-item .icon {
    font-size: 18px;
    flex-shrink: 0;
}
.nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover, .nav-item.active {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

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

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.logout-btn {
    display: block;
    padding: 8px;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.page-header h1 {
    font-size: 24px;
    color: #333;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-link {
    color: #3498db;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

.text-success { color: #2ecc71 !important; }
.text-danger { color: #e74c3c !important; }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

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

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

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #888;
    font-size: 14px;
}

/* 面板 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.panel {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.panel-full {
    grid-column: 1 / -1;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.panel-header h3 {
    font-size: 16px;
    color: #333;
}

.panel-body {
    padding: 15px 20px;
}

/* 表格 */
.data-table {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

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

.badge-default { background: #e0e0e0; color: #666; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-live { background: #e74c3c; color: #fff; animation: pulse 2s infinite; }

.badge-group { background: #9b59b6; color: #fff; }
.badge-final16, .badge-quarter, .badge-semi, .badge-final { background: #f39c12; color: #fff; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 赛事单元格 */
.match-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: contain;
    background: #f5f5f5;
}

.vs {
    color: #e74c3c;
    font-weight: bold;
    font-size: 12px;
}

.score {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.coins {
    color: #f39c12;
    font-weight: 600;
}

/* 表单 */
.form-container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-width: 700px;
}

.form-container h2 {
    margin-bottom: 25px;
    font-size: 20px;
}

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

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

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-tip {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 搜索 */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* 过滤器 */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.filter-btn:hover, .filter-btn.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
}

.pagination a:hover, .pagination a.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

/* 弹窗 */
.modal {
    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-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
}

/* 图片预览 */
.preview-image {
    max-width: 200px;
    margin-top: 10px;
    border-radius: 8px;
}

.table-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
    background: #f5f5f5;
}

/* 单选组 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

.text-muted {
    color: #999;
}

.mb-20 {
    margin-bottom: 20px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }
    .logo-text, .nav-item span, .nav-group-title span, .nav-group-title .arrow, .sidebar-footer .admin-info span {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px 0;
    }
    .nav-group-title {
        text-align: center;
        padding: 8px 0 4px;
        cursor: default;
    }
    .main-content {
        margin-left: 64px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
