/**
 * XIM文档页面 - 全新设计 v2.0
 * 现代化文档界面，优化用户操作空间和交互体验
 */

/* ============================================
   CSS变量定义
   ============================================ */
:root {
    /* 主色调 - 与主站保持一致 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-hover: #764ba2;
    --accent-color: #00d4ff;
    
    /* 背景色 */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* 边框与阴影 */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(102, 126, 234, 0.3);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.2);
    
    /* 文档特定变量 */
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 60px;
    --header-height: 64px;
    --content-max-width: 900px;
    --outline-width: 220px;
    
    /* 过渡动画 */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   基础样式
   ============================================ */
.docs-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.docs-page * {
    box-sizing: border-box;
}

/* ============================================
   顶部工具栏
   ============================================ */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.sidebar-toggle:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.docs-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.docs-header .logo img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.docs-header .logo span {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 中间搜索区 */
.header-center {
    flex: 1;
    max-width: 500px;
}

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

.search-box i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box kbd {
    position: absolute;
    right: 12px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
}

/* 右侧工具区 */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.icon-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.font-size-control .icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
}

.font-size-display {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ============================================
   主布局容器
   ============================================ */
.docs-layout {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================
   左侧边栏
   ============================================ */
.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.docs-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* 侧边栏调整大小手柄 - 已隐藏 */
.sidebar-resize-handle {
    display: none;
}

/* 侧边栏头部 */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 快速导航 */
.quick-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.quick-link:hover,
.quick-link.active {
    background: var(--primary-gradient);
    color: white;
}

.quick-link i {
    width: 20px;
    text-align: center;
}

/* 详细目录 */
.docs-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.nav-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform var(--transition-fast);
    width: 16px;
}

.nav-item.expanded .toggle-icon {
    transform: rotate(90deg);
}

.nav-children {
    list-style: none;
    padding-left: 24px;
    margin: 4px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.nav-item.expanded > .nav-children {
    max-height: 1000px;
}

.nav-children .nav-link {
    font-size: 0.85rem;
    padding: 6px 12px;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.version-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   主内容区
   ============================================ */
.docs-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--outline-width);
    padding: 40px 60px;
    min-width: 0;
    transition: margin-left var(--transition-base);
    position: relative;
    z-index: 1;
}

.docs-sidebar.collapsed ~ .docs-content {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 1400px) {
    .docs-content {
        margin-right: 0;
    }
}



/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb i {
    font-size: 0.7rem;
}

/* 页面标题 */
.page-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.page-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.meta-item i {
    color: var(--primary-color);
}

/* ============================================
   文档内容样式
   ============================================ */
.content-body {
    max-width: var(--content-max-width);
}

.doc-section {
    margin-bottom: 64px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.doc-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.doc-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.doc-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 16px;
}

.section-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.section-content p {
    margin-bottom: 16px;
}

.lead {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* 强调文字 */
.section-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 链接 */
.section-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.section-content a:hover {
    border-bottom-color: var(--accent-color);
}

/* 列表 */
.section-content ul,
.section-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.section-content li {
    margin-bottom: 8px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list i {
    margin-top: 4px;
}

.numbered-list {
    counter-reset: item;
    list-style: none;
    padding: 0;
}

.numbered-list li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 16px;
}

.numbered-list li::before {
    content: counter(item);
    counter-increment: item;
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

/* 代码 */
.section-content code {
    font-family: 'Monaco', 'Consolas', monospace;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--accent-color);
}

/* 提示框 */
.alert {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 4px solid;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-info {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
}

.alert-info i {
    color: var(--primary-color);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
}

.alert-warning i {
    color: #fbbf24;
}

/* 表格 */
.table-container {
    overflow-x: auto;
    margin-bottom: 32px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

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

.data-table tr:hover {
    background: var(--bg-glass);
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-blue {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.badge-yellow {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.badge-red {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge-orange {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

/* 卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--transition-base);
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.card-icon.blue {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.card-icon.yellow {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.card-icon.red {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.info-card h4 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
}

.info-card p {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.border-blue {
    border-left: 4px solid #667eea;
}

.border-yellow {
    border-left: 4px solid #fbbf24;
}

.border-red {
    border-left: 4px solid #ef4444;
}

/* 联系卡片 */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.contact-card:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.contact-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-card:hover i {
    color: white;
}

.contact-card h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.contact-card:hover h4 {
    color: white;
}

.contact-card p {
    margin: 0;
    font-size: 0.9rem;
}

/* 手风琴 */
.accordion {
    margin: 24px 0;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast);
}

.accordion-header:hover {
    background: var(--bg-tertiary);
}

.accordion-header i:first-child {
    color: var(--primary-color);
}

.accordion-icon {
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-content ul {
    padding: 0 20px 20px 48px;
    margin: 0;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 40px;
    margin: 32px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-gradient);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-marker {
    position: absolute;
    left: -33px;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
}

.timeline-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.timeline-content p {
    margin: 0;
    color: var(--text-secondary);
}

/* 项目区块 */
.project-hero {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
}

.project-stats {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 功能网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.feature-item {
    text-align: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.feature-item:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
}

.feature-item i {
    font-size: 2rem;
    margin-bottom: 16px;
}

.text-purple { color: #a78bfa; }
.text-blue { color: #667eea; }
.text-green { color: #22c55e; }
.text-yellow { color: #fbbf24; }

.feature-item h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.feature-item p {
    margin: 0;
    font-size: 0.9rem;
}

/* 团队成员 */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.team-member {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.member-info p {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.member-role {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 技术栈标签 */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 成就列表 */
.achievement-list {
    list-style: none;
    padding: 0;
}

.achievement-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.achievement-list li:last-child {
    border-bottom: none;
}

.achievement-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex: 1;
}

.achievement-link:hover {
    color: var(--accent-color);
}

.achievement-link i {
    color: var(--accent-color);
}

/* 部门卡片 */
.department-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.dept-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-base);
}

.dept-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.dept-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
}

.dept-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.dept-icon.blue {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.dept-icon.purple {
    background: rgba(167, 139, 250, 0.2);
    color: #a78bfa;
}

.dept-icon.orange {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.dept-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
}

.dept-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dept-content {
    padding: 24px;
}

.dept-desc {
    margin-bottom: 20px;
    line-height: 1.7;
}

.dept-quote {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    position: relative;
}

.dept-quote i {
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.dept-quote p {
    margin: 0;
    font-style: italic;
    color: var(--text-secondary);
}

.dept-stats {
    display: flex;
    gap: 20px;
}

.dept-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 历史时间线 */
.history-timeline {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border-color);
}

.timeline-header {
    text-align: center;
    margin-bottom: 32px;
}

.timeline-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
}

.timeline-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.team-overview {
    margin: 32px 0;
}

.team-overview h4 {
    margin-bottom: 20px;
}

.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.team-stat {
    text-align: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.highlight-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    margin-top: 24px;
}

.highlight-box i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.highlight-box p {
    margin: 0;
    font-size: 1.05rem;
}

/* 标签页 */
.info-tabs {
    margin: 32px 0;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-item-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    flex-wrap: wrap;
}

.project-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
}

.project-tech {
    padding: 4px 12px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.project-members {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: auto;
}

/* 页面导航 */
.page-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.page-nav-prev,
.page-nav-next {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    flex: 1;
}

.page-nav-next {
    justify-content: flex-end;
    text-align: right;
}

.page-nav-prev:hover,
.page-nav-next:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.page-nav span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.page-nav strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* ============================================
   右侧目录大纲
   ============================================ */
.docs-outline {
    width: var(--outline-width);
    position: fixed;
    right: 0;
    top: calc(var(--header-height) + 40px);
    bottom: 40px;
    padding: 0 24px;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
    z-index: 50;
    background: var(--bg-primary);
}

.docs-outline h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.outline-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.outline-nav a {
    display: block;
    padding: 6px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.outline-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.outline-nav a.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

/* ============================================
   遮罩层
   ============================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   返回顶部按钮
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 500;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* ============================================
   阅读进度条
   ============================================ */
.reading-progress {
    position: fixed;
    top: var(--header-height);
    left: 0;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 1001;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1400px) {
    .docs-outline {
        display: none !important;
    }
    
    .docs-content {
        max-width: calc(100% - var(--sidebar-width));
    }
    
    .docs-sidebar.collapsed ~ .docs-content {
        max-width: calc(100% - var(--sidebar-collapsed-width));
    }
}

@media (max-width: 1024px) {
    .docs-sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
    }
    
    .docs-content {
        margin-left: 0;
        max-width: 100%;
        padding: 32px;
    }
    
    .docs-sidebar.collapsed ~ .docs-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .header-center {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-header {
        padding: 0 16px;
    }
    
    .font-size-control,
    .layout-control {
        display: none;
    }
    
    .docs-content {
        padding: 24px 20px;
    }
    
    .page-header h1 {
        font-size: 1.875rem;
    }
    
    .cards-grid,
    .feature-grid,
    .team-grid,
    .department-cards {
        grid-template-columns: 1fr;
    }
    
    .team-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-stats {
        gap: 24px;
    }
    
    .stat-value {
        font-size: 1.875rem;
    }
    
    .page-nav {
        flex-direction: column;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .doc-section h2 {
        font-size: 1.5rem;
    }
    
    .doc-section h3 {
        font-size: 1.25rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .quick-nav {
        display: none;
    }
}

/* ============================================
   打印样式
   ============================================ */
@media print {
    .docs-header,
    .docs-sidebar,
    .docs-outline,
    .back-to-top,
    .reading-progress {
        display: none;
    }
    
    .docs-content {
        margin-left: 0;
        max-width: 100%;
        padding: 20px;
    }
    
    .doc-section {
        break-inside: avoid;
    }
}
