/* ДискВью — один файл стилей, ни одного внешнего домена.
   Цвета взяты из самой программы (diskview/icons.py, main.py _DARK_QSS),
   чтобы сайт и окно выглядели одним продуктом. */

:root {
    color-scheme: dark light;
    --bg: #0d1117;
    --surface: #12161c;
    --surface-2: #0f1216;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #21262d;
    --border-2: #30363d;
    --accent: #1f6feb;
    --accent-2: #3b82f6;
    --link: #58a6ff;
    --ok: #238636;
    --ok-2: #2ea043;
    --danger: #f85149;
    --radius: 10px;
    --wrap: 1080px;
}

/* Светлая тема: и по системной настройке, и по кнопке в шапке. */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #ffffff;
        --surface: #f6f8fa;
        --surface-2: #eef2f6;
        --text: #1f2328;
        --muted: #57606a;
        --border: #d0d7de;
        --border-2: #afb8c1;
        --link: #0969da;
    }
}
:root[data-theme="light"] {
    --bg: #ffffff;
    --surface: #f6f8fa;
    --surface-2: #eef2f6;
    --text: #1f2328;
    --muted: #57606a;
    --border: #d0d7de;
    --border-2: #afb8c1;
    --link: #0969da;
}
:root[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #12161c;
    --surface-2: #0f1216;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #21262d;
    --border-2: #30363d;
    --link: #58a6ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
          "Helvetica Neue", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.skip {
    position: absolute; left: -9999px; top: 0; background: var(--accent);
    color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 0; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 2.1rem; margin: 0 0 16px; }
h2 { font-size: 1.5rem; margin: 40px 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.13rem; color: var(--text); max-width: 68ch; }
.muted { color: var(--muted); }
code {
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
    font-size: 0.92em; background: var(--surface); border: 1px solid var(--border);
    border-radius: 5px; padding: 1px 5px;
}
pre.code {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; overflow-x: auto;
}
pre.code code { background: none; border: 0; padding: 0; }
.hash { overflow-wrap: anywhere; }
.note {
    border-left: 3px solid var(--accent); background: var(--surface);
    padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0;
}
.flash { color: var(--danger); }

/* ---------------------------------------------------------------- шапка */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-logo { border-radius: 7px; }
.nav { display: flex; gap: 18px; margin-left: auto; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
    background: transparent; border: 1px solid var(--border-2); color: var(--muted);
}
.theme-toggle:hover { color: var(--text); }

/* На узком экране прячем не навигацию, а только её лишнюю ширину: строка
   разделов переезжает под шапку и прокручивается вбок. Прятать совсем нельзя —
   иначе на телефоне разделы доступны только из подвала. */
@media (max-width: 780px) {
    .header-inner { flex-wrap: wrap; height: auto; gap: 10px; padding-top: 10px; }
    .header-actions { margin-left: auto; }
    .nav {
        order: 3; width: 100%; margin-left: 0; gap: 16px;
        overflow-x: auto; padding-bottom: 8px;
        scrollbar-width: none;
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { white-space: nowrap; font-size: 0.94rem; }
}

/* ------------------------------------------------------------ хлебные крошки */
.crumbs { border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
.crumbs .wrap { padding-top: 10px; padding-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumb-current { color: var(--text); }

/* ----------------------------------------------------------------- герой */
.hero {
    background:
        radial-gradient(1100px 420px at 50% -140px,
                        color-mix(in srgb, var(--accent) 22%, transparent), transparent),
        var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.hero-inner { padding: 64px 20px 56px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); margin-bottom: 18px; }
.hero .lead { margin: 0 auto 28px; }

.section { padding: 44px 20px; }
.final-cta { text-align: center; border-top: 1px solid var(--border); }
.final-cta .lead { margin-left: auto; margin-right: auto; }
.more { margin-top: 18px; }

/* ---------------------------------------------------------------- кнопки */
.btn {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--accent); color: #fff; font-weight: 600;
    padding: 11px 20px; border-radius: var(--radius); border: 0; cursor: pointer;
    font-size: 1rem; font-family: inherit;
}
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn-lg { padding: 15px 30px; font-size: 1.1rem; }
.btn-sm { padding: 7px 14px; font-size: 0.92rem; }
.btn-quiet { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); }
.btn-quiet:hover { background: var(--surface-2); }

.cta { margin: 28px 0; }
.cta-note { color: var(--muted); font-size: 0.93rem; margin: 12px 0 4px; }
.cta-count { color: var(--muted); font-size: 0.93rem; margin: 0; }

/* ------------------------------------------------------------- скриншоты */
.shots { display: grid; gap: 28px; margin: 24px 0 8px; }
.shot { margin: 0; }
.shot img {
    width: 100%; height: auto; border: 1px solid var(--border-2);
    border-radius: var(--radius); background: var(--surface-2); display: block;
}
.shot figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* --------------------------------------------------------------- карточки */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px;
}
.card p { margin: 0; color: var(--muted); }

/* --------------------------------------------------------------- таблицы */
.table-wrap { overflow-x: auto; }
table.cmp { border-collapse: collapse; width: 100%; min-width: 520px; }
table.cmp th, table.cmp td {
    border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left;
}
table.cmp thead th { color: var(--muted); font-weight: 600; font-size: 0.92rem; }
table.cmp tbody th { font-weight: 500; }
table.cmp td.y { color: var(--ok-2); }
table.cmp td.n { color: var(--muted); }
table.cmp td.p { color: var(--muted); }
table.cmp.small { font-size: 0.86rem; }

/* ---------------------------------------------------------------- списки */
.ticks { list-style: none; padding: 0; margin: 0 0 14px; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.ticks li::before {
    content: ""; position: absolute; left: 6px; top: 0.62em;
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
}
.steps { padding-left: 22px; }
.steps li { margin-bottom: 12px; }
.links { list-style: none; padding: 0; }
.links li { margin-bottom: 8px; }
.deflist dt { font-weight: 600; margin-top: 16px; }
.deflist dd { margin: 4px 0 0; color: var(--muted); }

/* ------------------------------------------------------------------- FAQ */
.faq details {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: 12px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 2px; color: var(--muted); }

/* -------------------------------------------------------------- релизы */
.release { border-top: 1px solid var(--border); padding-top: 8px; }
.release h2 .anchor { color: var(--text); }
.rel-date { font-size: 0.9rem; font-weight: 400; margin-left: 10px; }
.rel-title { color: var(--muted); margin-top: -4px; }
.version-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: 18px 20px; margin-bottom: 16px;
}
.version-card h2 { margin-top: 0; }

/* -------------------------------------------------------------- поделиться */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 34px; }
.share-label { color: var(--muted); font-size: 0.92rem; }
.share-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 12px;
    color: var(--text); background: var(--surface); font-size: 0.9rem;
    cursor: pointer; font-family: inherit;
}
.share-btn:hover { border-color: var(--accent-2); text-decoration: none; }

/* ------------------------------------------------------------ липкая кнопка */
.sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface-2) 94%, transparent);
    backdrop-filter: blur(8px); border-top: 1px solid var(--border);
}
.sticky-cta[hidden] { display: none; }
.sticky-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding-top: 10px; padding-bottom: 10px;
}
.sticky-text { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 600px) { .sticky-text { display: none; } .sticky-inner .btn { width: 100%; justify-content: center; } }

/* ------------------------------------------------------------------ формы */
.form { display: grid; gap: 14px; max-width: 320px; }
.form label { display: grid; gap: 5px; color: var(--muted); font-size: 0.92rem; }
.form input {
    background: var(--surface); border: 1px solid var(--border-2); color: var(--text);
    border-radius: 8px; padding: 9px 11px; font: inherit;
}

/* ---------------------------------------------------------------- админка */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px;
}
.kpi-n { font-size: 1.5rem; font-weight: 600; }
.kpi-l { color: var(--muted); font-size: 0.85rem; }
.chart {
    display: flex; align-items: flex-end; gap: 3px; height: 160px;
    border-bottom: 1px solid var(--border); padding-top: 8px;
}
.chart .bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart .bar span { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 2px 2px 0 0; }
.bar-started { background: var(--border-2); }
.bar-done { background: var(--accent); }

/* ----------------------------------------------------------------- подвал */
.site-footer { border-top: 1px solid var(--border); margin-top: 20px; background: var(--surface-2); }
.footer-inner {
    display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
    padding-top: 28px; padding-bottom: 90px;
}
.footer-brand { font-weight: 600; margin-bottom: 4px; }
.footer-inner nav { display: grid; gap: 6px; }
.footer-inner nav a { color: var(--muted); font-size: 0.93rem; }

.err-code { font-size: 3rem; font-weight: 700; color: var(--muted); margin: 0; }
