:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --section-bg: #f5f5f5;
    --toc-bg: #f5f5f5;
    --code-bg: #e0e0e0;
    --table-header-bg: #e5e5e5;
    --accent-color: #ffcc00;
    --highlight-orange: #ffa500;
    --border-color: #ccc;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --scroll-icon-color: #000000;
    --scroll-btn-bg: #ffcc00;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #eeeeee;
        --section-bg: #1e1e1e;
        --toc-bg: #1e1e1e;
        --code-bg: #0d0d0d;
        --table-header-bg: #2a2a2a;
        --border-color: #333;
        --shadow-color: rgba(0, 0, 0, 0.5);
        --accent-color: #ffcc00;
        --highlight-orange: #ffa500;
        --scroll-icon-color: #ffffff;
        --scroll-btn-bg: #2a2a2a;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 30px;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1,
h2 {
    color: var(--text-color);
}

h3 {
    color: var(--highlight-orange);
}

h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

h2 {
    margin: 5px 0px 5px 0px;
    font-size: 24px;
}

h3 {
    font-size: 20px;
    color: #ffa500;
}

a {
    color: #4eaaff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.section {
    background: var(--section-bg, #1e1e1e);
    color: var(--text-color);
    padding: 10px 20px 10px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px var(--shadow-color);
    border: 1px solid var(--border-color);
}

pre {
    border-radius: 10px;
    padding: 12px;
    font-family: monospace;
    font-size: 14px;
    display: block;
    white-space: pre-wrap;
    overflow-x: auto;
}

code {
    border-radius: 6px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 14px;
}

button,
.btn {
    background: #ffcc00;
    color: #000;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease-in-out;
    margin: 10px 0;
}

button:hover,
.btn:hover {
    background: #ffd633;
}

ul,
ol {
    padding-left: 20px;
    margin-bottom: 0;
}

hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 30px 0;
}

#toc {
    background: var(--toc-bg, #1e1e1e);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.toc-list li {
    margin-bottom: 2px !important;
}

#toc ul {
    list-style: none;
    padding-left: 0;
}

#toc li {
    margin-bottom: 8px;
}

#toc a {
    color: #4eaaff;
    font-weight: bold;
    text-decoration: none;
}

#toc a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 15px 0;
    display: block;
    box-shadow: 0 0 10px var(--shadow-color);
    border: 1px solid var(--border-color);
}

figure {
    display: inline-block;
    margin: 0;
    max-width: 100%;
}

figure img {
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    height: auto;
    display: block;
}

figcaption {
    text-align: center;
    font-size: 14px;
    color: #aaa;
    margin-top: 8px;
    max-width: 100%;
}

.config-table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.config-table th,
.config-table td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.config-table th {
    background-color: var(--table-header-bg, #2a2a2a);
    color: var(--accent-color, #ffcc00);
    font-weight: bold;
    white-space: nowrap;
}

.config-table td code {
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    white-space: nowrap;
}

@media (max-width: 768px) {

    .config-table th,
    .config-table td {
        padding: 10px;
        font-size: 14px;
    }

    .config-table {
        font-size: 14px;
    }
}

.note {
    background: var(--bg-color);
    border-left: 4px solid #ffaa00;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 20px;
    color: var(--text-color);
    font-size: 14px;
}

/* Theme Toggle */
.toggle-section {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #666;
    border-radius: 20px;
    transition: 0.4s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(to right, #f9d423, #ff4e50);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translate(20px, -50%);
}

pre,
code,
.config-table td code {
    background: var(--code-bg, #0d0d0d);
    color: var(--text-color);
}

body,
.section,
code,
pre {
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Scroll Btn */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 48px;
    height: 48px;
    padding: 0;
    background-color: var(--scroll-btn-bg, #ffcc00);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 10px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-top-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.scroll-top-btn svg {
    width: 32px;
    height: 32px;
    display: inline-block;
    object-fit: contain;
    filter: invert(var(--scroll-icon-invert, 0));
    transition: filter 0.3s ease;
    border: none;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    fill: var(--scroll-icon-color, #121212);
}

@media (prefers-color-scheme: dark) {
    .scroll-top-btn img {
        filter: invert(100%);
    }
}

.scroll-top-btn.hidden {
    display: none;
}

.header-with-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}