:root {
    --original-orange: #f28c18;
    --original-orange-dark: #c96800;
    --original-sidebar: #2f3338;
    --original-border: #d6d9dd;
    --original-surface: #f7f8fa;
    --original-text-muted: #626a73;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
}

.content p,
.content ul,
.content ol,
.content li,
.content blockquote,
.content table {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.05rem;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6,
.content label,
.content th,
.content button,
.content input,
.content select,
.content textarea,
.content .button,
.content .btn,
.content .box-title,
.content .programming-section-nav,
.content .programming-subnav {
    font-family: Arial, Helvetica, sans-serif;
}

.content pre,
.content code,
.content kbd,
.content samp {
    font-family: Consolas, "Courier New", monospace;
}

.header {
    min-height: 78px;
    background: linear-gradient(135deg, var(--original-orange), #ffad33);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-brand a {
    display: flex;
    flex: 0 0 auto;
}

.header-brand img {
    width: 54px;
    height: 54px;
    margin: 0;
    object-fit: contain;
}

.header-brand h1 {
    color: #fff;
    letter-spacing: 0.02em;
}

.hamburger {
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.12);
    color: #fff;
    font: inherit;
    font-weight: 700;
}

.hamburger:focus-visible,
.sidebar a:focus-visible,
.content a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #1f78b4;
    outline-offset: 2px;
}

.main {
    min-width: 0;
}

.sidebar {
    flex: 0 0 250px;
    background: linear-gradient(180deg, var(--original-sidebar), #24272b);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

.sidebar a {
    border-radius: 4px;
    padding: 0.35rem 0.45rem;
}

.sidebar .has-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    color: inherit;
}

.sidebar .has-submenu:hover,
.sidebar .has-submenu:focus-visible {
    background: transparent;
}

.sidebar-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.sidebar-search input {
    width: 100%;
    min-width: 0;
}

.sidebar-search button {
    padding-inline: 0.65rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sidebar a:hover,
.sidebar a:focus-visible {
    background: transparent;
    text-decoration: underline;
}

.submenu {
    margin-top: 0.25rem;
}

.submenu li {
    margin-bottom: 0.15rem;
}

.content-wrapper,
.content {
    min-width: 0;
}

.content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.content > :first-child {
    margin-top: 0;
}

.content p {
    margin: 0 0 1rem;
}

.content h1,
.content h2,
.content h3,
.content h4 {
    line-height: 1.25;
    margin-top: 1.35em;
    margin-bottom: 0.65em;
}

.content h1 {
    margin-top: 0;
}

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

.content hr {
    margin: 1.25rem 0;
    border: 0;
    border-top: 1px solid var(--original-border);
}

.box,
.card,
.programming-card,
.hosting-card,
.networking-card,
.bus-card,
.tools-card {
    border: 1px solid var(--original-border);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.box {
    margin-bottom: 1.25rem;
    padding: 1rem;
}

.box-title {
    margin: -1rem -1rem 1rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--original-border);
    border-radius: 6px 6px 0 0;
    background: var(--original-surface);
    color: #30343a;
    font-weight: 700;
}

.programming-grid,
.hosting-grid,
.networking-grid,
.bus-grid,
.tools-grid,
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}

.three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.programming-card,
.hosting-card,
.networking-card,
.bus-card,
.tools-card,
.card {
    padding: 1rem;
}

.programming-card > :first-child,
.hosting-card > :first-child,
.networking-card > :first-child,
.bus-card > :first-child,
.tools-card > :first-child,
.card > :first-child {
    margin-top: 0;
}

.programming-card > :last-child,
.hosting-card > :last-child,
.networking-card > :last-child,
.bus-card > :last-child,
.tools-card > :last-child,
.card > :last-child {
    margin-bottom: 0;
}

.button,
.btn,
button,
input[type="submit"],
input[type="button"] {
    display: inline-block;
    border: 1px solid var(--original-orange-dark);
    border-radius: 4px;
    padding: 0.55rem 0.85rem;
    background: var(--original-orange);
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--original-orange-dark);
    color: #fff;
    text-decoration: none;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="time"],
select,
textarea {
    max-width: 100%;
    border: 1px solid #aeb5bd;
    border-radius: 4px;
    padding: 0.55rem 0.65rem;
    background: #fff;
    color: #222;
    font: inherit;
}

label {
    font-weight: 700;
}

table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border: 1px solid var(--original-border);
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eceff2;
}

.muted,
.meta,
.small-label,
.tools-lead,
.programming-lead,
.hosting-lead,
.bus-lead {
    color: var(--original-text-muted);
}

.admonition,
.programming-callout,
.programming-note,
.hosting-callout,
.networking-callout,
.bus-callout,
.tools-note {
    border-left: 4px solid #1683a5;
    border-radius: 5px;
    padding: 1rem;
    background: #eef8fb;
}

.programming-warning,
.hosting-warning,
.networking-warning,
.bus-warning,
.warn {
    border-left: 4px solid #d28a00;
    border-radius: 5px;
    padding: 1rem;
    background: #fff8e5;
}

body.dark .content {
    color: #eee;
}

body.dark .box,
body.dark .card,
body.dark .programming-card,
body.dark .hosting-card,
body.dark .networking-card,
body.dark .bus-card,
body.dark .tools-card,
body.dark table,
body.dark input,
body.dark select,
body.dark textarea {
    border-color: #555c64;
    background: #202327;
    color: #eee;
}

body.dark .box-title,
body.dark th {
    border-color: #555c64;
    background: #30343a;
    color: #fff;
}

body.dark th,
body.dark td {
    border-color: #555c64;
}

body.dark .muted,
body.dark .meta,
body.dark .small-label,
body.dark .tools-lead,
body.dark .programming-lead,
body.dark .hosting-lead,
body.dark .bus-lead {
    color: #b7bdc5;
}

body.dark code:not(pre code) {
    background: #30343a;
    color: #f1f3f5;
}

@media (max-width: 900px) {
    .three-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        min-height: 68px;
        padding: 0.65rem 0.85rem;
    }

    .header-brand img {
        width: 46px;
        height: 46px;
    }

    .header-brand h1 {
        font-size: 1.25rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(86vw, 300px);
        height: 100vh;
        overflow-y: auto;
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.3);
    }

    .content {
        padding: 1.25rem;
    }

    .programming-grid,
    .hosting-grid,
    .networking-grid,
    .bus-grid,
    .tools-grid,
    .grid,
    .three-column {
        grid-template-columns: 1fr;
    }

    .content table:not(.responsive-table) {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
