:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #f5f5f5;
    --surface-hover: #ebebeb;
    --text: #151515;
    --muted: #666666;
    --border: #dddddd;
    --accent: #7cff00;
    --max-width: 1100px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101010;
    --surface: #181818;
    --surface-hover: #222222;
    --text: #f5f5f5;
    --muted: #a0a0a0;
    --border: #2d2d2d;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #101010;
        --surface: #181818;
        --surface-hover: #222222;
        --text: #f5f5f5;
        --muted: #a0a0a0;
        --border: #2d2d2d;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

#header {
    flex-shrink: 0;
}

#footer {
    margin-top: auto;
    flex-shrink: 0;
}

main {
    flex: 1;
}

.site-header,
.site-footer {
    width: 100%;
    border-color: var(--border);
    border-style: solid;
    background: var(--bg);
}

.site-header {
    border-width: 0 0 1px;
}

.site-footer {
    border-width: 1px 0 0;
}

.header-inner,
.footer-inner {
    width: min(100% - 32px, var(--max-width));
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    flex-shrink: 0;
    font-weight: 700;
}

.header-nav,
.footer-nav,
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-nav a,
.footer-nav a {
    color: var(--muted);
    transition: color 0.15s ease;
}

.header-nav a:hover,
.footer-nav a:hover {
    color: var(--text);
}

.header-controls select {
    min-width: 110px;
    padding: 7px 30px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.header-controls select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.footer-inner {
    min-height: 80px;
    flex-wrap: wrap;
}

.footer-note {
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-note strong {
    color: var(--text);
}

.container {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
}

.hero {
    max-width: 760px;
    margin: 90px auto 60px;
    text-align: center;
}

.hero h1,
.page-header h1,
.article h1 {
    margin: 0 0 12px;
    line-height: 1.15;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 4rem);
}

.hero p,
.page-header p {
    margin: 0;
    color: var(--muted);
}

.search {
    position: relative;
    margin-top: 32px;
}

.search input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--surface);
    color: var(--text);
}

.search input:focus {
    border-color: var(--accent);
}

#searchResults {
    position: absolute;
    z-index: 10;
    width: 100%;
    margin-top: 8px;
    text-align: left;
}

.search-result {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.search-result:first-child {
    border-radius: 10px 10px 0 0;
}

.search-result:last-child {
    border-radius: 0 0 10px 10px;
}

.search-result:hover {
    background: var(--surface-hover);
}

.support-grid,
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.support-card,
.article-card {
    display: block;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: background 0.15s ease, transform 0.15s ease;
}

.support-card:hover,
.article-card:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.support-card h2,
.article-card h2 {
    margin: 0 0 8px;
    line-height: 1.3;
}

.support-card p,
.article-card p {
    margin: 0;
    color: var(--muted);
}

.page-header {
    margin: 60px 0 40px;
}

.page-header > a,
.article > a {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--muted);
}

.page-header > a:hover,
.article > a:hover {
    color: var(--text);
}

.article {
    max-width: 800px;
    margin: 60px auto;
}

.article h2 {
    margin-top: 40px;
}

.article p {
    color: var(--muted);
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 32px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface);
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 800px) {
    .header-inner {
        min-height: 60px;
        flex-wrap: wrap;
        padding: 10px 0;
    }

    .header-nav {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .header-controls {
        flex-wrap: wrap;
    }

    .footer-inner {
        padding: 16px 0;
    }
}

@media (max-width: 700px) {
    .support-grid,
    .article-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        margin: 60px auto 40px;
    }

    .support-card,
    .article-card {
        padding: 20px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container,
    .header-inner,
    .footer-inner {
        width: min(100% - 24px, var(--max-width));
    }

    .header-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .header-controls {
        width: 100%;
    }

    .header-controls select {
        flex: 1;
    }
}

/* Install page*/
.install-filter {
    margin-bottom: 32px;
}

.install-filter label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
}

.platform-select {
    width: 100%;
    max-width: 320px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
}

.platform-select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* GIF*/
.support-gif {
    width: 100%;
    margin-top: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.support-gif img {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================================================
   NOTICE
   ========================================================= */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin: 24px 0;
    padding: 16px 18px;

    border: 1px solid #d6ad2c;
    border-radius: 10px;

    background: #fff4c2;
    color: #3d3300;
}

.notice-icon {
    flex: 0 0 auto;

    width: 20px;
    height: 20px;

    margin-top: 1px;
}

.notice-icon svg {
    display: block;

    width: 20px;
    height: 20px;
}

.notice-content {
    flex: 1;
    min-width: 0;
}

.notice-content > strong {
    display: block;
    margin-bottom: 6px;
    color: #3d3300;
}

.notice p strong {
    display: inline;
    margin: 0;
    color: inherit;
}

.notice p {
    margin: 0;

    color: #3d3300;
}


/* =========================================================
   WARNING
   ========================================================= */

.warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin: 24px 0;
    padding: 16px 18px;

    border: 1px solid #c94a4a;
    border-radius: 10px;

    background: #ffe0e0;
    color: #5a0000;
}

.warning-icon {
    flex: 0 0 auto;

    width: 20px;
    height: 20px;

    margin-top: 1px;
}

.warning-icon svg {
    display: block;

    width: 20px;
    height: 20px;
}

.warning-content {
    flex: 1;
    min-width: 0;
}

.warning strong {
    display: block;
    margin-bottom: 6px;

    color: #5a0000;
}

.warning p {
    margin: 0;

    color: #5a0000;
}


/* =========================================================
   DARK MODE - NOTICE
   ========================================================= */

:root[data-theme="dark"] .notice {
    background: #3b3200;
    border-color: #8f781b;
    color: #fff4c2;
}

:root[data-theme="dark"] .notice strong,
:root[data-theme="dark"] .notice p {
    color: #fff4c2;
}


/* =========================================================
   DARK MODE - WARNING
   ========================================================= */

:root[data-theme="dark"] .warning {
    background: #3b1111;
    border-color: #8f3b3b;
    color: #ffd6d6;
}

:root[data-theme="dark"] .warning strong,
:root[data-theme="dark"] .warning p {
    color: #ffd6d6;
}


/* =========================================================
   SYSTEM DARK MODE
   ========================================================= */

@media (prefers-color-scheme: dark) {

    :root:not([data-theme="light"]) .notice {
        background: #3b3200;
        border-color: #8f781b;
        color: #fff4c2;
    }

    :root:not([data-theme="light"]) .notice strong,
    :root:not([data-theme="light"]) .notice p {
        color: #fff4c2;
    }


    :root:not([data-theme="light"]) .warning {
        background: #3b1111;
        border-color: #8f3b3b;
        color: #ffd6d6;
    }

    :root:not([data-theme="light"]) .warning strong,
    :root:not([data-theme="light"]) .warning p {
        color: #ffd6d6;
    }
}

.button-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.button-link:hover {
    background: var(--surface-hover);
}