/* 基础样式 */
:root {
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

/* 全屏布局 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    margin-bottom: 0;
    width: 100%;
    min-height: 3.5rem !important;
    max-height: 3.5rem !important;
    display: flex !important;
    align-items: center !important;
}

/* 主要内容区域 */
main {
    margin-top: 3.5rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
    flex: 1 !important;
}

main.container-fluid.py-4 {
    margin-top: 3.5rem !important;
    padding-top: 1.5rem !important;
    padding-bottom: 2rem !important;
    flex: 1 !important;
}

/* 卡片样式 */
.card {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
}

.navbar .container-fluid {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100% !important;
    min-height: 3.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 60% !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
}

/* 导航栏切换按钮 - 仅在窄屏显示 */
.navbar-toggler {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

/* 窄屏模式显示菜单按钮 */
@media (max-width: 768px) {
    .navbar-toggler {
        display: flex !important;
    }
}

.collapse.navbar-collapse {
    align-items: center !important;
    height: 100% !important;
}

.navbar-nav {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
}

.nav-item {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    padding: 0 0.75rem !important;
    margin: 0 !important;
}

/* 链接样式 */
a {
    text-decoration: none;
}

/* 页脚样式 */
footer {
    margin-top: auto;
    width: 100%;
}

footer .text-light {
    color: rgba(255, 255, 255, 0.7) !important;
}

footer a.text-light:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* 表格样式 */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    font-weight: 600;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 代码样式 */
pre {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
}

code {
    background-color: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* 响应式工具类 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 3.5rem; /* 确保移动设备上内容也不被遮挡 */
    }
    
    .navbar {
        max-height: none !important;
    }
    
    .navbar .container-fluid {
        min-height: 3.5rem !important;
    }
    
    .collapse.navbar-collapse {
        background-color: white !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        padding: 1rem !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
        z-index: 1029 !important;
    }
    
    .navbar-nav {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }
    
    .nav-item {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 0.5rem !important;
    }
    
    .nav-link {
        width: 100% !important;
        height: auto !important;
        padding: 0.75rem !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        margin-bottom: 0.5rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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