/* CSS Variables */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #ffffff;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: var(--box-shadow);
    z-index: 1050; /* 确保导航栏在最上层 */
    position: relative;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* 确保下拉菜单在最上层 */
.dropdown-menu {
    z-index: 1060 !important;
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.dropdown-item {
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero .lead {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
    text-decoration: none;
}

/* Content Sections */
.content-section {
    padding: 3rem 0;
}

.section-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border-radius: 2px;
}

/* Lists */
.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

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

.feature-list li i {
    color: var(--success-color);
    margin-right: 0.5rem;
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: var(--border-radius);
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

/* Badges */
.badge {
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero .lead {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* SVG Diagrams */
.svg-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.svg-container svg {
    max-width: 100%;
    height: auto;
}

/* Code Highlighting */
pre[class*="language-"] {
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

/* Table of Contents - 优化字体大小 */
.toc {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.2rem;
    margin-bottom: 2rem;
    position: sticky;
    top: 100px;
    z-index: 100; /* 设置较低的z-index，确保不会遮挡导航下拉菜单 */
    font-size: 0.9rem; /* 整体字体大小调小 */
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1rem; /* 标题字体大小 */
    font-weight: 600;
}

.toc ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 0;
}

.toc li {
    margin-bottom: 0.4rem; /* 减少行间距 */
}

.toc a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem; /* 链接字体大小 */
    line-height: 1.4;
}

.toc a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

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

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

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

.rounded { border-radius: var(--border-radius) !important; }

/* 平台模块样式 */
.platform-modules {
    margin-top: 3rem;
}

.module-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.module-icon {
    text-align: center;
}

.module-status {
    margin-top: 1rem;
}

.text-purple {
    color: #6f42c1 !important;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0,0,0,0.125);
}

.badge {
    font-size: 0.75rem;
}
