/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 主应用容器 */
#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边导航栏 */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header i {
    color: #ffd700;
}

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

.nav-item {
    margin: 5px 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
}

.nav-item:hover a,
.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 30px;
}

.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.15);
    border-right: 3px solid #ffd700;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 顶部导航栏 */
.top-nav {
    background: white;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background-color: #f5f5f5;
}

#page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e3c72;
}

.nav-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 25px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: #e9ecef;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.user-avatar i {
    font-size: 24px;
    color: #1e3c72;
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

/* 页面样式 */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

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

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.search-box i {
    position: absolute;
    right: 15px;
    color: #666;
    pointer-events: none;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #1e3c72;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2a5298;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Tab 切换 */
.teams-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.teams-tab {
    padding: 10px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.teams-tab:hover {
    color: #1e3c72;
}

.teams-tab.active {
    color: #1e3c72;
    font-weight: 600;
}

.teams-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #1e3c72;
    border-radius: 2px 2px 0 0;
}

.tab-count {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 10px;
    background: #e9ecef;
    color: #6c757d;
}

.teams-tab.active .tab-count {
    background: #1e3c72;
    color: #fff;
}

/* 数据表格 */
.data-table-container {
    border-radius: 12px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 28px;
}

.data-table thead th.sortable::after {
    content: '\2195'; /* up-down arrow */
    position: absolute;
    right: 10px;
    color: #adb5bd;
    font-size: 12px;
}

.data-table thead th.sortable.asc::after {
    content: '\2191'; /* up arrow */
    color: #1e3c72;
}

.data-table thead th.sortable.desc::after {
    content: '\2193'; /* down arrow */
    color: #1e3c72;
}

.data-table tbody tr {
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

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

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

.data-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

/* pro 等级行高亮（浅橙色背景） */
.data-table tbody tr.pro-row {
    background-color: #fff4e5; /* 浅橙色 */
}

.data-table tbody tr.pro-row:hover {
    background-color: #ffe8cc; /* hover 稍深一点 */
}

/* 状态标签 */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-completed {
    background-color: #d1ecf1;
    color: #0c5460;
}

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

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn-edit {
    background-color: #17a2b8;
    color: white;
}

.action-btn-edit:hover {
    background-color: #138496;
}

.action-btn-delete {
    background-color: #dc3545;
    color: white;
}

.action-btn-delete:hover {
    background-color: #c82333;
}

.action-btn-view {
    background-color: #6c757d;
    color: white;
}

.action-btn-view:hover {
    background-color: #5a6268;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    color: #1e3c72;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: #f5f5f5;
}

.modal-body {
    padding: 30px;
}

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

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

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

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.form-control:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* 加载动画 */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
}

.loading.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: #1e3c72;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-left-color: #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

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

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* 分页组件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-top: 1px solid #e9ecef;
    background: transparent;
    font-size: 14px;
    flex-wrap: wrap;
}

.pagination-info {
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 分页按钮优化 */
.pagination .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pagination .page-btn:hover:not(.active):not(:disabled) {
    border-color: #cfd4da;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.pagination .page-btn.active {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    border-color: #1e3c72;
    box-shadow: 0 6px 14px rgba(30, 60, 114, 0.25);
    cursor: default;
}

.pagination .page-btn:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
    box-shadow: none;
    cursor: not-allowed;
}

.pagination .page-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.15);
}

@media (max-width: 480px) {
    .pagination {
        padding: 10px 8px;
        gap: 6px;
    }
    .pagination .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 10px;
        border-radius: 6px;
        font-size: 13px;
    }
}

.page-number {
    color: #495057;
    font-weight: 500;
}

/* 详情页面样式 */
.team-detail,
.user-detail,
.match-detail,
.registration-detail {
    max-width: 600px;
}

.detail-item {
    display: flex;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-item label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
    margin-right: 15px;
}

.detail-item span {
    flex: 1;
    color: #333;
}

/* 统计页面样式 */
.statistics-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #1e3c72;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* 审核表单样式 */
.approve-form,
.reject-form {
    padding: 10px 0;
}

.approve-form p,
.reject-form p {
    margin-bottom: 20px;
    color: #495057;
    font-size: 16px;
}

/* 必填标记 */
.required {
    color: #dc3545;
    margin-left: 3px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-header h2 span {
        display: none;
    }
    
    .nav-item span {
        display: none;
    }
    
    .content-wrapper {
        padding: 20px 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .data-table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0 15px;
    }
    
    #page-title {
        font-size: 20px;
    }
    
    .user-name {
        display: none;
    }
}
