:root {
    --tech-bg: #ffffff;
    --tech-text: #333333;
    --tech-heading: #354d5f;
    --tech-accent: #516e84;
    --tech-accent-600: #354d5f;
    --tech-divider: #e7e7e7;
    --tech-muted: #666666;
    --font-heading: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tech-page {
    background: var(--tech-bg);
    color: var(--tech-text);
    font-family: var(--font-body);
    min-height: 100vh;
}

.tech-shell {
    display: flex;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 70vh;
}

.tech-sidebar {
    flex: none;
    width: 252px;
    padding: 26px 14px 40px;
    background: var(--tech-bg);
    border-right: 1px solid var(--tech-divider);
    transition: width 0.18s ease;
}

.tech-sidebar.is-collapsed {
    width: 72px;
    padding: 20px 12px 40px;
}

.tech-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 8px;
}

.tech-sidebar.is-collapsed .tech-sidebar-head {
    justify-content: center;
}

.tech-sidebar-label {
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tech-muted);
}

.tech-sidebar.is-collapsed .tech-sidebar-label,
.tech-sidebar.is-collapsed .tech-track-name,
.tech-sidebar.is-collapsed .tech-track-count {
    display: none;
}

.tech-sidebar-toggle {
    border: 1px solid var(--tech-divider);
    background: transparent;
    color: var(--tech-text);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.tech-sidebar.is-collapsed .tech-sidebar-toggle {
    width: 48px;
}

.tech-track-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tech-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    text-decoration: none;
    color: var(--tech-text);
    min-height: 38px;
}

.tech-sidebar.is-collapsed .tech-track-nav {
    gap: 8px;
}

.tech-sidebar.is-collapsed .tech-track {
    justify-content: center;
    padding: 0;
    width: 48px;
    height: 38px;
    min-height: 38px;
    background: transparent;
    border-radius: 0;
}

.tech-track:hover {
    color: var(--tech-accent);
}

.tech-track.is-active {
    background: var(--tech-heading);
    color: #fff;
    border-radius: 4px;
}

.tech-sidebar.is-collapsed .tech-track.is-active {
    background: transparent;
    color: #fff;
}

.tech-track-abbr {
    flex: none;
    width: 48px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid var(--tech-divider);
    border-radius: 2px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.tech-sidebar.is-collapsed .tech-track-abbr {
    box-sizing: border-box;
    height: 38px;
}

.tech-track.is-active .tech-track-abbr {
    border-color: rgba(255, 255, 255, 0.7);
}

.tech-sidebar.is-collapsed .tech-track.is-active .tech-track-abbr {
    background: var(--tech-heading);
    color: #fff;
    border-color: var(--tech-heading);
    box-shadow: inset 0 0 0 3px var(--tech-heading), inset 0 0 0 4px rgba(255, 255, 255, 0.8);
}

.tech-track-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.tech-track-count {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.65;
}

.tech-main {
    flex: 1;
    min-width: 0;
    padding: 28px 28px 64px;
}

.tech-hero {
    margin-bottom: 28px;
}

.tech-kicker {
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 13px;
    color: var(--tech-accent);
    margin: 0 0 6px;
}

.tech-hero h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tech-heading);
    margin: 0 0 8px;
}

.tech-hero-meta {
    color: var(--tech-muted);
    font-size: 14px;
    margin: 0;
}

.tech-topic {
    margin-bottom: 8px;
}

.tech-topic-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--tech-divider);
    padding: 0 0 9px;
    margin: 0 0 0;
    cursor: pointer;
    color: var(--tech-text);
}

.tech-topic.is-open .tech-topic-head {
    margin-bottom: 18px;
}

.tech-topic-head.is-empty {
    opacity: 0.45;
    cursor: not-allowed;
}

.tech-topic-caret {
    font-size: 18px;
    width: 16px;
    flex: none;
}

.tech-topic-name {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0;
    font-size: 16px;
    color: var(--tech-heading);
}

.tech-topic-weight {
    background: var(--tech-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
}

.tech-topic-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--tech-muted);
}

.tech-topic-body {
    display: none;
}

.tech-topic.is-open .tech-topic-body {
    display: block;
    margin-bottom: 22px;
}

.tech-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.tech-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 16px 14px;
    border: 1px solid var(--tech-divider);
    border-radius: 5px;
    text-decoration: none;
    color: var(--tech-text);
    background: #fff;
    min-height: 132px;
    transition: border-color 0.15s ease;
}

.tech-card:hover {
    border-color: var(--tech-accent);
}

.tech-card:hover .tech-card-arrow {
    transform: translateX(4px);
}

.tech-card-type {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tech-accent);
    font-weight: 600;
}

.tech-card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--tech-heading);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tech-muted);
    flex-wrap: wrap;
}

.tech-card-sep {
    opacity: 0.5;
}

.tech-card-arrow {
    margin-left: auto;
    color: var(--tech-accent);
    transition: transform 0.15s ease;
    font-size: 16px;
}

.tech-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--tech-muted);
}

.tech-crumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--tech-muted);
}

.tech-crumb a {
    color: var(--tech-text);
    text-decoration: none;
}

.tech-crumb a:hover {
    color: var(--tech-accent);
}

.tech-article-grid {
    display: grid;
    grid-template-columns: 240px minmax(420px, 1fr);
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px 72px;
}

.tech-article-grid.has-promo {
    grid-template-columns: 240px minmax(420px, 1fr) 256px;
}

.tech-mini-tracks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
}

.tech-mini-track {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--tech-divider);
    border-radius: 3px;
    color: var(--tech-text);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 12px;
}

.tech-mini-track.is-active {
    background: var(--tech-heading);
    color: #fff;
    border-color: var(--tech-heading);
}

.tech-toc {
    position: sticky;
    top: 24px;
}

.tech-toc-label,
.tech-promo-label {
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tech-muted);
    margin-bottom: 12px;
}

.tech-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tech-toc a {
    display: block;
    padding: 6px 0;
    color: var(--tech-text);
    text-decoration: none;
    font-size: 14px;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.tech-toc a.is-active,
.tech-toc a:hover {
    color: var(--tech-heading);
    border-left-color: var(--tech-heading);
}

.tech-article h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tech-heading);
    margin: 0 0 12px;
}

.tech-article-meta {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--tech-muted);
    margin: 0 0 28px;
}

.tech-prose {
    font-size: 15px;
    line-height: 1.7;
    color: var(--tech-text);
}

.tech-prose h2,
.tech-prose h3 {
    font-family: var(--font-heading);
    color: var(--tech-heading);
    scroll-margin-top: 24px;
}

.tech-prose h2 {
    font-size: 22px;
    margin: 32px 0 12px;
}

.tech-prose h3 {
    font-size: 18px;
    margin: 24px 0 10px;
}

.tech-prose p {
    margin: 0 0 14px;
}

.tech-prose a {
    color: var(--tech-accent);
}

.tech-prose img {
    max-width: 100%;
    height: auto;
}

.tech-prose blockquote {
    margin: 0 0 16px;
    padding: 8px 16px;
    border-left: 3px solid var(--tech-accent);
    color: var(--tech-muted);
}

.tech-prose ul,
.tech-prose ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.tech-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0 0 16px;
}

.tech-table-scroll {
    overflow-x: auto;
}

.tech-prose th,
.tech-prose td {
    border: 1px solid var(--tech-divider);
    padding: 8px 10px;
    text-align: left;
}

.tech-prose pre {
    position: relative;
    background: #fbfbff;
    border: 1px solid var(--tech-divider);
    border-radius: 5px;
    padding: 16px 16px 16px 48px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 16px;
}

.tech-prose pre code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tech-code-wrap {
    position: relative;
    margin: 0 0 16px;
}

.tech-code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid var(--tech-divider);
    border-radius: 4px;
    background: #fff;
    color: var(--tech-muted);
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    z-index: 1;
}

.tech-prose pre.tech-has-lines {
    counter-reset: tech-line;
}

.tech-prose pre.tech-has-lines span.tech-line {
    display: block;
    position: relative;
}

.tech-prose pre.tech-has-lines span.tech-line::before {
    counter-increment: tech-line;
    content: counter(tech-line);
    position: absolute;
    left: -36px;
    width: 28px;
    text-align: right;
    color: #999;
    font-size: 12px;
}

.tech-promo-rail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tech-promo-card {
    display: block;
    border: 1px solid var(--tech-divider);
    border-radius: 0;
    overflow: hidden;
    padding: 14px;
    color: var(--tech-text);
    text-decoration: none;
}

.tech-promo-card:hover {
    border-color: var(--tech-accent);
}

.tech-promo-thumb {
    display: block;
    width: 100%;
    height: 150px;
    margin-bottom: 12px;
    border: 1px solid var(--tech-divider);
    background: #f4f5f6;
}

.tech-promo-thumb img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.tech-promo-kicker {
    display: block;
    margin: 0 0 5px;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tech-accent);
}

.tech-promo-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.15;
    color: var(--tech-text);
    margin: 0 0 6px;
}

.tech-promo-body {
    display: block;
    font-size: 13.5px;
    line-height: 1.5;
    color: #5d5d60;
    margin: 0;
}

.tech-promo-cta {
    display: block;
    margin-top: 10px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tech-accent);
}

@media (max-width: 1199px) {
    .tech-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1400px) {
    .tech-article-grid,
    .tech-article-grid.has-promo {
        grid-template-columns: 240px minmax(0, 1fr);
    }
    .tech-promo-rail {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .tech-promo-rail > .tech-promo-card {
        flex: 0 0 256px;
        width: 256px;
        max-width: 100%;
    }
}

@media (max-width: 1080px) {
    .tech-article-grid {
        grid-template-columns: 1fr;
    }
    .tech-toc {
        position: static;
    }
}

@media (max-width: 767px) {
    .tech-shell {
        flex-direction: column;
    }
    .tech-sidebar,
    .tech-sidebar.is-collapsed {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--tech-divider);
        padding: 12px 12px 8px;
    }
    .tech-sidebar-toggle {
        display: none;
    }
    .tech-sidebar-label {
        display: none;
    }
    .tech-sidebar.is-collapsed .tech-track {
        width: auto;
        height: auto;
        justify-content: flex-start;
        padding: 8px;
        min-height: 38px;
    }
    .tech-sidebar.is-collapsed .tech-track-abbr {
        height: 22px;
    }
    .tech-sidebar.is-collapsed .tech-track.is-active {
        background: var(--tech-heading);
        color: #fff;
        border-radius: 4px;
    }
    .tech-sidebar.is-collapsed .tech-track.is-active .tech-track-abbr {
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.7);
        box-shadow: none;
        outline: none;
        color: inherit;
    }
    .tech-track-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
    }
    .tech-track {
        flex: none;
        min-width: 140px;
    }
    .tech-track-name,
    .tech-track-count {
        display: block;
    }
    .tech-main {
        padding: 20px 16px 48px;
    }
    .tech-hero h1 {
        font-size: 24px;
    }
    .tech-article h1 {
        font-size: 24px;
    }
}
