* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-2: #764ba2;
    --text: #2c3e50;
    --muted: #666;
    --bg-soft: #f0f4ff;
    --border: #e6eaf2;
    --shadow: 0 10px 30px rgba(0,0,0,0.2);
    --shadow-soft: 0 8px 20px rgba(0,0,0,0.10);
}

body.home {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

body.home .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

body.home header {
    text-align: center;
    color: white;
    padding: 1.75rem 0;
}

body.home header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.home header p {
    font-size: 1.05rem;
    opacity: 0.9;
}

body.home .docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

body.home .doc-card {
    background: white;
    border-radius: 15px;
    padding: 1.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

body.home .doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

body.home .doc-card h2 {
    color: #667eea;
    margin-bottom: 0.6rem;
    font-size: 1.5rem;
}

body.home .doc-card p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

body.home .doc-card .features {
    list-style: none;
    margin-bottom: 1rem;
}

body.home .doc-card .features li {
    padding: 0.25rem 0;
    color: #555;
    position: relative;
    padding-left: 1.5rem;
}

body.home .doc-card .features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

body.home .doc-card a {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.65rem 1.4rem;
    border-radius: 25px;
    text-decoration: none;
    transition: opacity 0.3s;
    font-weight: 500;
}

body.home .doc-card a:hover {
    opacity: 0.9;
}

body.home .icon {
    font-size: 2.4rem;
    margin-bottom: 0.6rem;
}

body.home footer {
    text-align: center;
    color: white;
    padding: 1rem 0;
    margin-top: 1rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    body.home header h1 {
        font-size: 2rem;
    }

    body.home .docs-grid {
        grid-template-columns: 1fr;
    }
}

body.doc {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

body.doc .container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

body.doc h1 {
    color: var(--text);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
    margin-bottom: 18px;
    letter-spacing: -0.2px;
}

body.doc h2 {
    color: var(--primary);
    margin-top: 0;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
    scroll-margin-top: 100px;
}

body.doc h3 {
    color: var(--text);
    margin-top: 18px;
    margin-bottom: 10px;
}

body.doc h4 {
    color: var(--text);
    margin-top: 18px;
    margin-bottom: 8px;
}

body.doc p {
    color: var(--muted);
    margin-top: 10px;
}

body.doc a {
    color: var(--primary);
}

body.doc ul,
body.doc ol {
    margin-top: 10px;
    padding-left: 22px;
}

body.doc li {
    margin: 6px 0;
}

body.doc code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

body.doc pre {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    box-shadow: var(--shadow-soft);
}

body.doc pre code {
    background: none;
    padding: 0;
    color: inherit;
}

body.doc .function,
body.doc .struct,
body.doc .enum,
body.doc .highlight,
body.doc .json-schema,
body.doc .troubleshooting {
    margin: 20px 0;
    padding: 15px;
    background-color: var(--bg-soft);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

body.doc .parameter {
    margin: 10px 0;
}

body.doc .param-name {
    font-weight: bold;
    color: #495057;
}

body.doc .param-desc {
    margin-left: 20px;
    color: #6c757d;
}

body.doc .returns {
    margin-top: 15px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
}

body.doc .nav-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

body.doc .nav-bar ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

body.doc .nav-bar a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
    font-weight: 500;
}

body.doc .nav-bar a:hover {
    background-color: rgba(255,255,255,0.2);
}

body.doc .nav-bar .current {
    background-color: rgba(255,255,255,0.3);
}

body.doc .toc {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

body.doc .toc ul {
    list-style-type: none;
    padding-left: 0;
}

body.doc .toc li {
    margin: 5px 0;
}

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

body.doc .toc a:hover {
    text-decoration: underline;
}

body.doc section {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    background: white;
    margin-top: 18px;
}

body.doc section:first-of-type {
    margin-top: 0;
}

body.doc table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
}

body.doc th,
body.doc td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
}

body.doc th {
    background-color: var(--bg-soft);
    font-weight: bold;
    color: var(--text);
}

body.doc tr:nth-child(even) td {
    background-color: #fbfcff;
}

body.doc tr:hover td {
    background-color: #f6f8ff;
}

body.doc footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: #6c757d;
    text-align: center;
}

body.doc .warning {
    background-color: #fff5f5;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #dc3545;
    margin: 15px 0;
}

body.doc .info,
body.doc .success {
    background-color: #f0fff4;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #28a745;
    margin: 15px 0;
}

body.doc .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

body.doc .metric-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

body.doc .metric-card h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

body.doc .metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

body.doc .architecture-diagram {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

body.doc .module-box {
    display: inline-block;
    background: #f8f9fa;
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    padding: 15px;
    margin: 10px;
    min-width: 150px;
}

body.doc .lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    padding: 20px;
}

body.doc .lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.doc .lightbox img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

body.doc .lightbox-close {
    position: fixed;
    top: 14px;
    right: 18px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 768px) {
    body.doc {
        padding: 14px;
    }

    body.doc .container {
        padding: 18px;
    }

    body.doc .nav-bar ul {
        gap: 0.75rem;
        padding: 0 0.75rem;
    }

    body.doc section {
        padding: 16px;
    }
}
