/* 长夜电竞 - 统一布局框架 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    background: #0a0e1a;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 顶部导航栏 ===== */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 48px;
    height: 72px;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.top-navbar .logo {
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
    text-decoration: none;
}

.top-nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.top-nav-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    padding: 8px 0;
}

.top-nav-link:hover {
    color: white;
}

.top-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s;
}

.top-nav-link:hover::after,
.top-nav-link.active::after {
    width: 100%;
}

.top-nav-link.active {
    color: white;
}

.top-nav-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
}

.nav-btn-login {
    color: rgba(255,255,255,0.9);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
}

.nav-btn-login:hover {
    border-color: #3b82f6;
    color: white;
    background: rgba(59, 130, 246, 0.1);
}

.nav-btn-register {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.nav-btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-weight: 600;
}

.user-role-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== 左侧隐藏式导航 ===== */
.sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    width: 260px;
    height: calc(100vh - 72px);
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.08);
    z-index: 999;
    transform: translateX(-220px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* 鼠标移入展开（仅未锁定时） */
.sidebar:not(.locked):hover {
    transform: translateX(0);
}

/* 点击展开/收起（锁定状态） */
.sidebar.expanded {
    transform: translateX(0);
}

/* 箭头按钮 - 始终可见 */
.sidebar-toggle {
    position: absolute;
    right: 8px;
    top: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    transition: all 0.3s;
    z-index: 10;
}

.sidebar-toggle:hover {
    background: rgba(59, 130, 246, 0.3);
    color: white;
    border-color: rgba(59, 130, 246, 0.5);
}

/* 展开时箭头旋转 */
.sidebar.expanded .sidebar-toggle {
    transform: rotate(180deg);
}

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

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 15px;
    transition: all 0.25s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: white;
    border-left-color: #3b82f6;
}

.sidebar-item.active {
    background: rgba(59, 130, 246, 0.12);
    color: white;
    border-left-color: #3b82f6;
}

.sidebar-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-text {
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .sidebar-text,
.sidebar.expanded .sidebar-text {
    opacity: 1;
}

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

.sidebar-footer-text {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
}

/* ===== 主内容区域 ===== */
.main-content {
    margin-left: 40px;
    min-height: 100vh;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 72px;
}

.sidebar:hover ~ .main-content,
.sidebar.expanded ~ .main-content {
    margin-left: 260px;
}

/* ===== 页面内容区 ===== */
.page-container {
    padding: 32px 48px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-subtitle {
    color: rgba(255,255,255,0.5);
    font-size: 16px;
}

/* ===== 卡片样式 ===== */
.card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title .icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.8);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

.form-select option {
    background: #1e293b;
    color: white;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-hint {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.25);
}

.btn-outline:hover {
    border-color: #3b82f6;
    color: white;
    background: rgba(59, 130, 246, 0.1);
}

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

/* ===== 表格样式 ===== */
.table-container {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.table-title {
    font-size: 18px;
    font-weight: 600;
}

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

th {
    text-align: left;
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

tr:hover {
    background: rgba(255,255,255,0.03);
}

/* ===== 标签页 ===== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    background: rgba(255,255,255,0.05);
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
}

.tab {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
}

.tab:hover {
    color: white;
}

.tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== 提示消息 ===== */
.toast {
    position: fixed;
    top: 100px;
    right: 48px;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.toast.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ===== 页脚 ===== */
.footer {
    padding: 60px 48px 40px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}

.footer-brand {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.35);
    font-size: 13px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .top-navbar {
        padding: 0 24px;
    }
    
    .top-nav-links {
        gap: 24px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        padding: 0 16px;
    }
    
    .top-nav-links {
        display: none;
    }
    
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-container {
        padding: 24px 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}
