:root {
    --primary-color: #326ce5;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-bg: #f8f9fa;
    --sidebar-width: 260px;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background-color: var(--primary-color);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.sidebar-header .material-icons {
    font-size: 2rem;
}

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

.sidebar-nav .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 4px solid white;
    padding-left: calc(1.5rem - 4px);
}

.sidebar-nav .nav-link .material-icons {
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a237e 100%);
    color: white;
    padding: 80px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Material Design Button */
.btn-raised {
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
                0 3px 1px -2px rgba(0, 0, 0, 0.12),
                0 1px 5px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn-raised:hover {
    box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14),
                0 1px 10px 0 rgba(0, 0, 0, 0.12),
                0 2px 4px -1px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Concept Cards */
.concept-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.concept-card .card-body {
    padding: 2rem;
}

.material-icons-large {
    font-size: 64px !important;
}

.concept-btn {
    margin-top: 1rem;
    border-radius: 24px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Accordion Styles */
.accordion-button {
    font-weight: 500;
    background-color: var(--light-bg);
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-color);
    color: white;
}

.accordion-body pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.accordion-body code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Resource Cards */
.resource-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

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

.resource-card .card-body {
    padding: 1.5rem;
}

.resource-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-link:hover {
    color: #1a237e;
    text-decoration: underline;
}

/* Concept Detail Content */
.concept-detail-content {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    animation: slideDown 0.3s ease-out;
}

.concept-detail-content h5 {
    color: var(--primary-color);
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    position: relative;
    padding-left: 1.5rem;
}

.concept-detail-content h5::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(50, 108, 229, 0.2);
}

.concept-detail-content h5:first-child {
    margin-top: 0;
}

.concept-detail-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.concept-detail-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.concept-detail-content ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.concept-detail-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 1rem 0;
}

.concept-detail-content code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.concept-detail-content strong {
    color: #495057;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 2000px;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .sidebar-nav .nav-item {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }
    
    .sidebar-nav .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }
    
    .sidebar-nav .nav-link.active {
        border-left: none;
        border-bottom: 4px solid white;
        padding-left: 1rem;
    }
    
    /* 移动端子菜单下拉样式 */
    .nav-item.has-submenu .sidebar-submenu {
        position: absolute;
        left: 0;
        top: 100%;
        width: 200px;
        z-index: 1001;
        background: var(--primary-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .nav-item.has-submenu.open .sidebar-submenu {
        max-height: 300px;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .concept-card .card-body {
        padding: 1.5rem;
    }
    
    .material-icons-large {
        font-size: 48px !important;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section Spacing */
section {
    position: relative;
    padding: 4rem 0;
}

section#home {
    padding: 0;
}

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

.concept-card {
    animation: fadeInUp 0.6s ease-out;
}

.concept-card:nth-child(1) { animation-delay: 0.1s; }
.concept-card:nth-child(2) { animation-delay: 0.2s; }
.concept-card:nth-child(3) { animation-delay: 0.3s; }
.concept-card:nth-child(4) { animation-delay: 0.4s; }
.concept-card:nth-child(5) { animation-delay: 0.5s; }
.concept-card:nth-child(6) { animation-delay: 0.6s; }

/* Architecture Diagram Styles */
.architecture-diagram {
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.architecture-diagram pre.mermaid {
    text-align: center;
    padding: 1rem;
}

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

#architecture h3 {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

#architecture .card-header h4 {
    font-size: 1.1rem;
}

#architecture .list-group-item {
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

#architecture .list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(50, 108, 229, 0.05);
}

/* Sidebar Submenu Styles */
.nav-item.has-submenu > .nav-link::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.nav-item.has-submenu.open > .nav-link::after {
    transform: rotate(45deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.1);
    transition: max-height 0.3s ease;
}

.nav-item.has-submenu.open .sidebar-submenu {
    max-height: 700px; /* 增加最大高度以容纳更多子项 */
    overflow-y: auto;  /* 添加滚动条 */
}

.sidebar-submenu li {
    border-left: 2px solid transparent;
}

.sidebar-submenu li:hover {
    border-left-color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-submenu a {
    display: block;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 220px;  /* 确保有足够的宽度显示文本 */
}

.sidebar-submenu a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mermaid Diagram Styles */
.mermaid-diagram {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.mermaid-diagram pre.mermaid {
    margin: 0;
    background: transparent;
    padding: 0;
}

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

.concept-detail-content {
    background-color: #fff;
    border-top: 2px solid var(--primary-color);
    margin-top: 1rem;
}

.concept-detail-content .table {
    margin: 1rem 0;
}

.concept-detail-content h5 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* Command Block Styles */
.command-block {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.25rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-x: auto;
}

.command-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.command-prompt {
    color: #7f7f7f;
    font-size: 0.85rem;
    font-style: italic;
    display: block;
    margin-bottom: 0.25rem;
}

.command-code {
    background-color: #3a3a3a;
    color: #f8f8f2;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
    border-left: 3px solid var(--primary-color);
    width: 100%;
    box-sizing: border-box;
}

/* Deployment Card Styles */
.deployment-card {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
}

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

.deployment-icon {
    font-size: 2rem;
    text-align: center;
}

.deployment-title {
    color: var(--primary-color);
    font-weight: 600;
}

.deployment-description {
    color: #6c757d;
    font-size: 0.95rem;
}

.deployment-config {
    margin: 0;
    padding: 1rem;
}

/* 移动端子菜单样式 */
@media (max-width: 992px) {
    .sidebar-submenu {
        position: static;
        width: auto;
        min-width: 200px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    
    .nav-item.has-submenu.open .sidebar-submenu {
        max-height: 300px; /* 移动端较小的最大高度 */
    }
    
    .sidebar-submenu a {
        white-space: nowrap;
        min-width: 100%; /* 移动端适应容器宽度 */
    }
}

/* 美化列表和表格样式 */
.card-body ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    list-style: none;
}

.card-body ul li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
    transition: all 0.3s ease;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.card-body ul li::before {
    content: '▶';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 0.75rem;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.card-body ul li:hover {
    transform: translateX(4px);
    background-color: rgba(50, 108, 229, 0.05);
    border-radius: 4px;
    padding-left: 1.75rem;
}

.card-body ul li:hover::before {
    transform: translateX(2px) translateY(-50%);
    opacity: 1;
}

.card-body ul li strong {
    color: #495057;
    font-weight: 500;
}

.card-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.card-body ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.card-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 美化表格样式 */
.card-body .table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card-body .table:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-body .table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a237e 100%);
    color: white;
}

.card-body .table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
    overflow: hidden;
}

.card-body .table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.card-body .table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.card-body .table tbody tr:last-child {
    border-bottom: none;
}

.card-body .table tbody tr:hover {
    background-color: rgba(50, 108, 229, 0.05);
    transform: scale(1.005);
    z-index: 1;
    position: relative;
}

.card-body .table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.card-body .table tbody tr:nth-child(even):hover {
    background-color: rgba(50, 108, 229, 0.08);
}

.card-body .table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border: none;
    color: #495057;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.card-body .table td:first-child {
    font-weight: 500;
    color: var(--primary-color);
}

.card-body .table td strong {
    color: #212529;
}

/* 特定颜色主题的表格 */
.card-body .table-primary thead {
    background: linear-gradient(135deg, #326ce5 0%, #1a237e 100%);
}

.card-body .table-success thead {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.card-body .table-info thead {
    background: linear-gradient(135deg, #17a2b8 0%, #0f6674 100%);
}

.card-body .table-warning thead {
    background: linear-gradient(135deg, #ffc107 0%, #d39e00 100%);
}

.card-body .table-danger thead {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.card-body .table-dark thead {
    background: linear-gradient(135deg, #343a40 0%, #1d2124 100%);
}

/* 卡片中的表格 */
#architecture .table {
    margin: 0;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#architecture .table th,
#architecture .table td {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

#architecture .table td:first-child {
    font-weight: 500;
    color: #212529;
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
    .card-body .table {
        font-size: 0.9rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.75rem 0.875rem;
    }
}

@media (max-width: 992px) {
    .card-body .table {
        font-size: 0.85rem;
        overflow-x: auto;
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-y: visible;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.625rem 0.75rem;
        white-space: nowrap;
    }
    
    .card-body ul li {
        padding-left: 1.25rem;
    }
    
    .card-body ul li::before {
        font-size: 0.65rem;
    }
}

@media (max-width: 768px) {
    .card-body .table {
        font-size: 0.8rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .card-body h5 {
        font-size: 1rem;
        padding-left: 1.25rem;
    }
    
    .card-body h5::before {
        width: 6px;
        height: 6px;
    }
    
    .card-body ul {
        padding-left: 1rem;
    }
    
    .card-body ul li {
        padding-left: 1.25rem;
        font-size: 0.9rem;
    }
    
    .card-body ul li::before {
        font-size: 0.6rem;
    }
    
    .card-body .table {
        font-size: 0.75rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.4rem 0.375rem;
        white-space: normal;
        word-wrap: break-word;
    }
}

@media (max-width: 576px) {
    .card-body .table {
        font-size: 0.7rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.375rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .card-body h5 {
        font-size: 0.95rem;
        padding-left: 1rem;
    }
    
    .card-body h5::before {
        width: 5px;
        height: 5px;
    }
    
    .card-body ul {
        padding-left: 0.75rem;
    }
    
    .card-body ul li {
        padding-left: 1rem;
        font-size: 0.85rem;
    }
    
    .card-body ul li::before {
        font-size: 0.5rem;
    }
    
    .card-body .table {
        font-size: 0.65rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.3125rem 0.1875rem;
    }
}

/* 横屏设备优化 */
@media (max-height: 600px) and (orientation: landscape) {
    .card-body .table {
        font-size: 0.75rem;
    }
    
    .card-body .table th,
    .card-body .table td {
        padding: 0.4rem 0.375rem;
    }
}

/* 组件列表样式 */
.component-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.component-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.component-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    background-color: white;
}

.component-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 20px;
}

.component-content {
    flex: 1;
}

.component-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #212529;
    font-weight: 600;
}

.component-description {
    margin: 0;
    color: #6c757d;
    line-height: 1.5;
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-body .table {
        border: 1px solid #dee2e6;
    }
    
    .card-body .table th::after {
        height: 1px;
    }
}