/* =======================================================
   NISA Welcome System - 通用基础样式
   ======================================================= */

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

*::before,
*::after {
    box-sizing: border-box;
}

/* 根变量定义 */
:root {
    /* 主色调 */
    --primary-color: #00ffff;
    --secondary-color: #ff00ff;
    --accent-color: #00ff88;
    
    /* 背景颜色 */
    --bg-primary: #0c0c0c;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-disabled: rgba(255, 255, 255, 0.4);
    
    /* 边框颜色 */
    --border-primary: rgba(255, 255, 255, 0.1);
    --border-secondary: rgba(255, 255, 255, 0.2);
    --border-active: var(--primary-color);
    
    /* 阴影 */
    --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 8px 16px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 255, 255, 0.3);
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* 边角半径 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-xxl: 20px;
    
    /* 过渡效果 */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
    
    /* 字体 */
    --font-family-primary: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* 字体大小 */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* 行高 */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    
    /* z-index层级 */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* =======================================================
   统一导航栏组件样式
   ======================================================= */

/* 主导航栏 */
.main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(12, 12, 12, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-xl);
    box-shadow: var(--shadow-medium);
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-xl);
    font-weight: 600;
    transition: var(--transition-normal);
}

.navbar-brand:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.navbar-brand i {
    margin-right: var(--spacing-sm);
    font-size: var(--font-size-2xl);
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0 auto;
    gap: var(--spacing-md);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link i {
    margin-right: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: auto;
}

.user-info {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-sm);
    font-weight: bold;
    color: var(--bg-primary);
}

.logout-btn {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(255, 0, 0, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--radius-lg);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition-normal);
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
    transform: translateY(-2px);
}

.logout-btn i {
    margin-right: var(--spacing-sm);
}

/* 页面内容区域调整 */
.page-container {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-navbar {
        padding: 0 var(--spacing-md);
        height: 60px;
    }
    
    .navbar-nav {
        display: none; /* 移动端隐藏导航，将使用汉堡菜单 */
    }
    
    .navbar-brand {
        font-size: var(--font-size-lg);
    }
    
    .navbar-brand i {
        margin-right: var(--spacing-xs);
        font-size: var(--font-size-xl);
    }
    
    .user-info span {
        display: none; /* 移动端隐藏用户名文字 */
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        margin-right: var(--spacing-xs);
    }
    
    .logout-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    .logout-btn i {
        margin-right: 0;
    }
    
    .logout-btn span {
        display: none; /* 移动端只显示图标 */
    }
    
    /* 调整页面容器 */
    .page-container {
        margin-top: 60px;
        min-height: calc(100vh - 60px);
        padding: var(--spacing-md);
    }
}

/* 汉堡菜单样式 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-nav-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(12, 12, 12, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    z-index: var(--z-dropdown);
    padding: var(--spacing-lg);
    animation: slideDown 0.3s ease-out;
}

.mobile-nav-menu.show {
    display: block;
}

.mobile-nav-item {
    display: block;
    padding: var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
    border-bottom: 1px solid var(--border-primary);
    font-weight: 500;
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

.mobile-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-item.active {
    color: var(--primary-color);
    background: rgba(0, 255, 255, 0.1);
}

.mobile-nav-item i {
    margin-right: var(--spacing-md);
    width: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* 基础样式 */
html {
    font-size: 16px;
    line-height: var(--line-height-normal);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-primary);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 选择文本样式 */
::selection {
    background: rgba(0, 255, 255, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(0, 255, 255, 0.3);
    color: var(--text-primary);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.7);
}

/* 通用工具类 */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-accent { color: var(--accent-color) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-transparent { background: transparent !important; }
.bg-primary { background: var(--primary-color) !important; }
.bg-secondary { background: var(--secondary-color) !important; }

/* 边距工具类 */
.m-0 { margin: 0 !important; }
.m-1 { margin: var(--spacing-xs) !important; }
.m-2 { margin: var(--spacing-sm) !important; }
.m-3 { margin: var(--spacing-md) !important; }
.m-4 { margin: var(--spacing-lg) !important; }
.m-5 { margin: var(--spacing-xl) !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

/* 边框工具类 */
.border { border: 1px solid var(--border-primary) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--border-primary) !important; }
.border-bottom { border-bottom: 1px solid var(--border-primary) !important; }
.border-left { border-left: 1px solid var(--border-primary) !important; }
.border-right { border-right: 1px solid var(--border-primary) !important; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-circle { border-radius: 50% !important; }

/* 阴影工具类 */
.shadow-sm { box-shadow: var(--shadow-small) !important; }
.shadow { box-shadow: var(--shadow-medium) !important; }
.shadow-lg { box-shadow: var(--shadow-large) !important; }
.shadow-glow { box-shadow: var(--shadow-glow) !important; }
.shadow-none { box-shadow: none !important; }

/* 位置工具类 */
.position-static { position: static !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

/* 宽高工具类 */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }

.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

/* 通用动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.6), 0 0 40px rgba(0, 255, 255, 0.3);
    }
}

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

/* 动画类 */
.fade-in { animation: fadeIn 0.5s ease-out; }
.fade-in-up { animation: fadeInUp 0.5s ease-out; }
.fade-in-down { animation: fadeInDown 0.5s ease-out; }
.slide-in-left { animation: slideInLeft 0.5s ease-out; }
.slide-in-right { animation: slideInRight 0.5s ease-out; }
.pulse { animation: pulse 2s infinite; }
.glow { animation: glow 3s infinite; }

/* 响应式断点 */
@media (max-width: 576px) {
    :root { 
        font-size: 14px; 
        --spacing-xs: 3px;
        --spacing-sm: 6px;
        --spacing-md: 12px;
        --spacing-lg: 18px;
        --spacing-xl: 24px;
        --spacing-xxl: 32px;
    }
    
    .container { 
        padding: var(--spacing-sm); 
        margin: 0 var(--spacing-xs);
    }
    
    /* 小屏幕优化 */
    body {
        font-size: var(--font-size-sm);
    }
    
    h1 { font-size: var(--font-size-xl); }
    h2 { font-size: var(--font-size-lg); }
    h3 { font-size: var(--font-size-base); }
    
    /* 按钮优化 */
    button, .btn {
        min-height: 44px; /* 触摸友好的最小高度 */
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
    
    /* 输入框优化 */
    input, select, textarea {
        min-height: 44px;
        padding: var(--spacing-md);
        font-size: var(--font-size-base);
    }
    
    /* 表格在小屏幕上的处理 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: var(--font-size-xs);
    }
    
    th, td {
        padding: var(--spacing-sm) !important;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    
    /* 移动端布局调整 */
    .row {
        flex-direction: column;
    }
    
    .col-mobile-full {
        width: 100% !important;
        flex: none !important;
    }
    
    /* 模态框移动端优化 */
    .modal {
        padding: var(--spacing-md);
    }
    
    .modal-content {
        margin: auto;
        width: 95% !important;
        max-width: none !important;
    }
    
    /* 卡片移动端优化 */
    .card {
        margin-bottom: var(--spacing-md);
        border-radius: var(--radius-md);
    }
    
    /* 导航和菜单 */
    .breadcrumb {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm);
    }
}

@media (max-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
}

@media (max-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
}

/* 移动端通用工具类 */
@media (max-width: 768px) {
    .mobile-text-center { text-align: center !important; }
    .mobile-text-left { text-align: left !important; }
    .mobile-hidden { display: none !important; }
    .mobile-block { display: block !important; }
    .mobile-flex { display: flex !important; }
    .mobile-flex-column { flex-direction: column !important; }
    .mobile-flex-wrap { flex-wrap: wrap !important; }
    .mobile-justify-center { justify-content: center !important; }
    .mobile-align-center { align-items: center !important; }
    
    .mobile-p-0 { padding: 0 !important; }
    .mobile-p-1 { padding: var(--spacing-xs) !important; }
    .mobile-p-2 { padding: var(--spacing-sm) !important; }
    .mobile-p-3 { padding: var(--spacing-md) !important; }
    
    .mobile-m-0 { margin: 0 !important; }
    .mobile-m-1 { margin: var(--spacing-xs) !important; }
    .mobile-m-2 { margin: var(--spacing-sm) !important; }
    .mobile-m-3 { margin: var(--spacing-md) !important; }
    
    .mobile-w-100 { width: 100% !important; }
    .mobile-h-auto { height: auto !important; }
}