/* ForenDev Documentation Site Styles
 * Reuses theme.css color tokens. Designed for readability + lab aesthetic.
 */

.docs-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
                 "PingFang SC", "Microsoft YaHei", "Source Han Sans CN", sans-serif;
    background: var(--paper, #ffffff);
    color: var(--ink, #111318);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.docs-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
.docs-header {
    border-bottom: 1px solid var(--line, #dedbd2);
    background: var(--paper, #ffffff);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.docs-header .docs-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.docs-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink, #111318);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.docs-brand span { color: var(--accent, #22665d); font-weight: 600; }
.docs-topnav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.docs-topnav a {
    color: var(--muted, #626a73);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.docs-topnav a:hover {
    color: var(--accent, #22665d);
}

/* Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    gap: 32px;
    padding: 32px 24px;
    flex: 1;
    align-items: start;
}

@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 200px 1fr;
    }
    .docs-toc {
        display: none;
    }
}

@media (max-width: 720px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    .docs-sidebar {
        position: relative;
        top: 0;
    }
}

/* Sidebar */
.docs-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.docs-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.docs-nav li {
    margin: 0;
}
.docs-nav a {
    display: block;
    padding: 6px 12px;
    color: var(--muted, #626a73);
    text-decoration: none;
    font-size: 14px;
    border-left: 2px solid transparent;
    margin-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}
.docs-nav a:hover {
    color: var(--accent, #22665d);
}
.docs-nav a.active {
    color: var(--accent, #22665d);
    font-weight: 600;
    border-left-color: var(--accent, #22665d);
}

/* Main content */
.docs-main {
    min-width: 0;
}
.docs-content {
    max-width: 760px;
}
.docs-content h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 24px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--ink, #111318);
}
.docs-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 40px 0 16px;
    padding-top: 8px;
    border-top: 1px solid var(--line, #dedbd2);
    color: var(--ink, #111318);
    scroll-margin-top: 80px;
}
.docs-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 12px;
    color: var(--ink, #111318);
    scroll-margin-top: 80px;
}
.docs-content h5 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted, #626a73);
    margin: 32px 0 8px;
}
.docs-content h6 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted, #626a73);
    margin: 24px 0 4px;
}
.docs-content p {
    margin: 0 0 16px;
    color: var(--ink, #111318);
}
.docs-content a {
    color: var(--accent, #22665d);
    text-decoration: underline;
    text-decoration-color: rgba(34, 102, 93, 0.3);
    text-underline-offset: 3px;
}
.docs-content a:hover {
    text-decoration-color: var(--accent, #22665d);
}
.docs-content strong { font-weight: 700; }

/* Code */
.docs-content code {
    font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
    font-size: 0.88em;
    background: rgba(34, 102, 93, 0.08);
    color: #1a3d3a;
    padding: 2px 6px;
    border-radius: 3px;
}
.docs-content pre {
    background: #1a1d23;
    color: #e6e6e6;
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 16px 0 20px;
    line-height: 1.5;
    font-size: 13px;
}
.docs-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}
.docs-content pre code.lang-bash::before,
.docs-content pre code.lang-shell::before,
.docs-content pre code.lang-sh::before {
    content: "$ ";
    color: #6b7280;
}
.docs-content pre code.lang-php { color: #c5c8c6; }

/* Lists */
.docs-content ul,
.docs-content ol {
    padding-left: 24px;
    margin: 0 0 16px;
}
.docs-content li {
    margin: 4px 0;
}
.docs-content li > ul,
.docs-content li > ol {
    margin: 4px 0;
}

/* Tables */
.docs-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0 20px;
    font-size: 14px;
}
.docs-content th,
.docs-content td {
    border: 1px solid var(--line, #dedbd2);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.docs-content th {
    background: var(--ground, #f5f4ef);
    font-weight: 600;
}
.docs-content td code {
    font-size: 0.85em;
}

/* Blockquote */
.docs-content blockquote {
    border-left: 3px solid var(--accent, #22665d);
    padding: 8px 16px;
    margin: 16px 0;
    color: var(--muted, #626a73);
    background: var(--ground, #f5f4ef);
    border-radius: 0 4px 4px 0;
}
.docs-content blockquote p {
    margin: 4px 0;
}
.docs-content hr {
    border: 0;
    border-top: 1px solid var(--line, #dedbd2);
    margin: 32px 0;
}

/* Admin-only block */
.admin-only-mask {
    position: relative;
    border: 1px dashed var(--accent, #22665d);
    border-radius: 6px;
    padding: 24px;
    margin: 16px 0;
    background: var(--ground, #f5f4ef);
    overflow: hidden;
}
.admin-only-mask .admin-only-banner {
    font-weight: 600;
    color: var(--accent, #22665d);
    margin-bottom: 8px;
}
.admin-only-mask .admin-only-preview {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
    color: var(--muted, #626a73);
    font-style: italic;
    margin-bottom: 12px;
}
.admin-only-mask .admin-only-prompt {
    font-size: 14px;
    color: var(--muted, #626a73);
}
.admin-only-mask .admin-only-prompt a {
    color: var(--accent, #22665d);
    font-weight: 600;
}
.admin-only-content {
    border: 1px solid var(--line, #dedbd2);
    border-left: 3px solid var(--accent, #22665d);
    border-radius: 4px;
    padding: 16px 20px;
    margin: 16px 0;
    background: rgba(34, 102, 93, 0.03);
}
.admin-only-content .admin-only-banner {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent, #22665d);
    margin-bottom: 8px;
    opacity: 0.7;
}

/* TOC sidebar */
.docs-toc {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    font-size: 13px;
}
.docs-toc-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    color: var(--muted, #626a73);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line, #dedbd2);
}
.docs-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.docs-toc li {
    margin: 0;
}
.docs-toc li.toc-l3 {
    padding-left: 12px;
}
.docs-toc a {
    display: block;
    padding: 4px 0;
    color: var(--muted, #626a73);
    text-decoration: none;
    line-height: 1.4;
}
.docs-toc a:hover {
    color: var(--accent, #22665d);
}

/* Footer */
.docs-footer {
    border-top: 1px solid var(--line, #dedbd2);
    padding: 24px 0;
    margin-top: 48px;
    color: var(--muted, #626a73);
    font-size: 13px;
}
.docs-footer a {
    color: var(--muted, #626a73);
    text-decoration: underline;
}

/* Dark mode */
html.dark .docs-body {
    background: var(--paper, #111411);
    color: var(--ink, #e6e6e3);
}
html.dark .docs-header {
    background: var(--paper, #111411);
    border-bottom-color: var(--line, #2a2e26);
}
html.dark .docs-brand {
    color: var(--ink, #e6e6e3);
}
html.dark .docs-topnav a {
    color: var(--muted, #9ba39b);
}
html.dark .docs-nav a {
    color: var(--muted, #9ba39b);
}
html.dark .docs-content {
    color: var(--ink, #e6e6e3);
}
html.dark .docs-content h1,
html.dark .docs-content h2,
html.dark .docs-content h3 {
    color: var(--ink, #e6e6e3);
    border-top-color: var(--line, #2a2e26);
}
html.dark .docs-content a {
    color: #6ab3a3;
}
html.dark .docs-content code {
    background: rgba(106, 179, 163, 0.12);
    color: #d8e8e0;
}
html.dark .docs-content th {
    background: rgba(255, 255, 255, 0.04);
}
html.dark .docs-content th,
html.dark .docs-content td {
    border-color: var(--line, #2a2e26);
}
html.dark .docs-content blockquote {
    background: rgba(255, 255, 255, 0.04);
}
html.dark .admin-only-mask {
    background: rgba(255, 255, 255, 0.04);
}
html.dark .admin-only-content {
    background: rgba(106, 179, 163, 0.06);
}
html.dark .docs-footer {
    border-top-color: var(--line, #2a2e26);
}

/* Footer link group */
.footer-links {
    display: inline-flex;
    gap: 16px;
    align-items: center;
}