* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #42b883;
    --primary-dark: #35495e;
    --accent-color: #3ba776;
    --text-primary: #2c3e50;
    --text-secondary: #4e6e8e;
    --text-light: #6a8bad;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #1e1e1e;
    --border-color: #e4e7ed;
    --border-light: #dcdfe6;
    --code-bg: #282c34;
    --code-header: #21252b;
    --sidebar-bg: #f7f9fc;
    --sidebar-border: #e1e4e8;
    --header-height: 48px;
    --sidebar-width: 280px;
    --toc-width: 200px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    margin-right: 12px;
    font-size: 10px;
    font-weight: 500;
}

.logo-text {
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.3s;
    position: relative;
    align-content: center;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(66, 184, 131, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.main-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 24px 0;
    z-index: 100;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 24px;
    margin-bottom: 12px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-link {
    display: block;
    padding: 8px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.sidebar-link:hover {
    color: var(--primary-color);
    background: rgba(66, 184, 131, 0.05);
}

.sidebar-link.active {
    color: var(--primary-color);
    background: rgba(66, 184, 131, 0.1);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--toc-width);
    padding: 40px 60px;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    font-weight: 400;
}

.content-section {
    margin-bottom: 60px;
    scroll-margin-top: calc(var(--header-height) + 20px);
}

.content-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.content-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 16px 0;
}

.content-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px 0;
}

.content-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

.content-section ul,
.content-section ol {
    color: var(--text-secondary);
    margin: 16px 0 16px 24px;
    line-height: 1.8;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.content-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px;
    border-radius: 12px;
    margin: 32px 0;
}

.hero-box h2 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.hero-box p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.feature-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.feature-item h3 {
    color: white;
    font-size: 1.1rem;
    margin: 0 0 8px 0;
}

.feature-item p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin: 0;
}

.info-box,
.tip-box,
.warning-box {
    padding: 20px 24px;
    border-radius: 8px;
    margin: 24px 0;
    border-left: 4px solid;
}

.info-box {
    background: #e8f4fd;
    border-color: #2196f3;
}

.tip-box {
    background: #e8f5e9;
    border-color: #4caf50;
}

.warning-box {
    background: #fff3e0;
    border-color: #ff9800;
}

.info-box h3,
.tip-box h3,
.warning-box h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.info-box p,
.tip-box p,
.warning-box p {
    margin-bottom: 0;
}

.info-box ul,
.tip-box ul,
.warning-box ul {
    margin-bottom: 0;
}

.code-block {
    background: var(--code-bg);
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.code-block pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #abb2bf;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.step-list {
    margin: 24px 0;
}

.step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.control-category {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.control-category h4 {
    color: var(--primary-color);
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.control-category ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.control-category li {
    padding: 4px 0;
    font-size: 0.9rem;
}

.control-category code {
    background: var(--code-bg);
    color: #e06c75;
    padding: 2px 6px;
    border-radius: 4px;
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.layout-item {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.layout-item h4 {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.layout-item p {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.layout-item .code-block {
    margin: 0;
}

.mvvm-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.mvvm-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 8px;
    text-align: center;
    min-width: 150px;
}

.mvvm-box h3 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 1.2rem;
}

.mvvm-box p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin: 0;
}

.mvvm-arrow {
    font-size: 2rem;
    color: var(--primary-color);
}

.comparison-table {
    overflow-x: auto;
    margin: 24px 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:hover {
    background: var(--bg-secondary);
}

.resource-list {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

.resource-item {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.resource-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.resource-item h3 {
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.resource-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 12px 0;
}

.resource-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.resource-link:hover {
    text-decoration: underline;
}

.toc {
    width: var(--toc-width);
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    padding: 40px 20px;
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
}

.toc-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.toc-list {
    list-style: none;
}

.toc-link {
    display: block;
    padding: 6px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.5;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: all 0.3s;
}

.toc-link:hover {
    color: var(--primary-color);
}

.toc-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.page-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.nav-button:hover:not(.disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-text {
    font-size: 0.95rem;
}

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 32px;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
}

@media (max-width: 1200px) {
    .content {
        margin-right: 0;
    }

    .toc {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 40px 30px;
    }

    .nav {
        gap: 4px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .content {
        padding: 30px 20px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    .mvvm-diagram {
        flex-direction: column;
    }

    .mvvm-arrow {
        transform: rotate(90deg);
    }

    .page-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .nav-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 0;
    }

    .header {
        height: auto;
    }

    .main-container {
        margin-top: auto;
    }

    .sidebar,
    .toc {
        display: none;
    }

    .content {
        margin-left: 0;
        margin-right: 0;
        padding: 20px 16px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .content-section h2 {
        font-size: 1.4rem;
    }

    .content-section h3 {
        font-size: 1.2rem;
    }

    .hero-box {
        padding: 24px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.hljs {
    background: var(--code-bg) !important;
    padding: 20px;
    border-radius: 8px;
}