/* 全局样式 */
:root {
    --primary-color: #4e73df;
    --secondary-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --dark-color: #5a5c69;
    --light-color: #f8f9fc;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-color);
    overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, #224abe 100%);
    color: #ffffff;
    transition: all var(--transition-speed);
    z-index: 1000;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-brand-icon {
    margin-right: 0.5rem;
}

.sidebar-brand-text {
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 1rem 0;
}

.nav-item {
    position: relative;
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.4);
    border-left: 4px solid #ffffff;
}

/* 确保侧边栏中的所有链接文字为白色 */
.sidebar .nav-link,
.sidebar .nav-link span,
.sidebar .nav-link i {
    color: #ffffff !important;
}

.nav-link i {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 1.5rem;
    text-align: center;
    transition: margin var(--transition-speed);
}

.nav-link span {
    transition: opacity var(--transition-speed);
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar-toggle {
    position: absolute;
    right: -15px;
    top: 20px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 0.15rem 0.5rem rgba(58, 59, 69, 0.15);
    z-index: 1001;
}

/* 主内容区域样式 */
.content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin var(--transition-speed);
    height: 100vh; /* 改为固定高度 */
    padding: 1.5rem;
    overflow-y: auto; /* 添加垂直滚动 */
    position: relative; /* 确保定位上下文正确 */
}

.content-wrapper.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* 顶部导航栏样式 */
.topbar {
    position: sticky;
    top: 0;
    background-color: white;
    border-bottom: 1px solid #e3e6f0;
    height: 70px;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
    margin-bottom: 1.5rem;
    z-index: 999;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.topbar-divider {
    width: 0;
    border-right: 1px solid #e3e6f0;
    height: 2rem;
    margin: auto 1rem;
}

/* 模块内容样式 */
.module-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.module-content.active {
    display: block;
}

.module-title {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 700;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.15);
}

.feature-card {
    overflow: hidden;
    border-radius: 0.5rem;
}

.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.2);
}

/* 时间线样式 */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50px;
    width: 4px;
    background: var(--primary-color);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-badge {
    position: absolute;
    left: 50px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-left: -15px;
    color: white;
    z-index: 1;
}

.timeline-panel {
    margin-left: 80px;
    padding: 15px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 0.5rem rgba(58, 59, 69, 0.1);
}

/* 计数器样式 */
.counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 登录/注册演示样式 */
.demo-step {
    display: none;
}

.demo-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* 验证码类型样式 */
.captcha-type {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 0.5rem;
    background-color: white;
    box-shadow: 0 0.15rem 0.5rem rgba(58, 59, 69, 0.1);
    transition: transform 0.3s ease;
}

.captcha-type:hover {
    transform: translateY(-5px);
}

.captcha-icon {
    margin-right: 15px;
}

/* 代码块样式 */
.code-block {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.code-block pre {
    margin-bottom: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
    }
    
    .sidebar.mobile-show {
        width: var(--sidebar-width);
    }
    
    .content-wrapper {
        margin-left: 0;
    }
    
    .timeline:before {
        left: 30px;
    }
    
    .timeline-badge {
        left: 30px;
    }
    
    .timeline-panel {
        margin-left: 60px;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-sidebar-toggle {
        position: fixed;
        left: 10px;
        top: 10px;
        width: 40px;
        height: 40px;
        background-color: var(--primary-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        cursor: pointer;
        box-shadow: 0 0.15rem 0.5rem rgba(58, 59, 69, 0.15);
        z-index: 1002;
        transition: left var(--transition-speed);
    }
    
    .sidebar.mobile-show + .mobile-sidebar-toggle {
        left: calc(var(--sidebar-width) - 50px);
    }
}

/* 滚动动画相关样式 */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(50px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-right"] {
    transform: translateX(-50px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-left"] {
    transform: translateX(50px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="zoom-in-right"] {
    transform: translateX(-50px) scale(0.9);
}

[data-aos="zoom-in-right"].aos-animate {
    transform: translateX(0) scale(1);
}

[data-aos="zoom-in-left"] {
    transform: translateX(50px) scale(0.9);
}

[data-aos="zoom-in-left"].aos-animate {
    transform: translateX(0) scale(1);
}

/* 特殊元素样式 */
.feature-list li {
    margin-bottom: 0.75rem;
}

.section-title {
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.monitor-feature {
    transition: transform 0.3s ease;
}

.monitor-feature:hover {
    transform: translateY(-10px);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
}