﻿/* layout.css — 固定顶栏 · 壳层 · 750×1334 窄列 */

:root {
    --layout-max: 100%;
    --nav-pad-x: clamp(8px, 2.8vw, 14px);
    --header-full: 0px;
    --z-header: 9000;
    --z-dropdown: 9001;

    --page-canvas: #060608;
    --page-canvas-edge: #030304;
    --surface-top: #0e0e12;
    --surface-card: #131318;
    --surface-card-inner: #0f0f14;
    --surface-elevated: #1a1a22;
    --shell-border: transparent;

    --text-main: #ffffff;
    --text-soft: #ffffff;
    --text-heading: #4ade80;
    --text-muted: #f0f0f0;
    --line-soft: rgba(255, 255, 255, 0.07);
    --line-gold: rgba(251, 191, 36, 0.28);

    --color-app-bar: #08080c;
    --color-app-bar-border: #22222c;
    --color-nav: #0e0e12;
    --color-nav-border: #22222c;
    --color-burger: #ffffff;
    --color-green: #22c55e;
    --color-green-dark: #16a34a;
    --color-green-hover: rgba(34, 197, 94, 0.18);
    --color-yellow: #fbbf24;
    --color-yellow-dark: #d97706;
    --color-blue: #fbbf24;
    --color-blue-dark: #d97706;
    --color-gold: #fbbf24;
    --color-accent: #4ade80;

    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-sm: 0 2px 12px rgba(251, 191, 36, 0.28);

    --body-font-size: 15px;
    --body-line-height: 1.72;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--page-canvas);
    overflow-x: hidden;
}

html[data-ui-contain="1"] {
    background: var(--page-canvas-edge);
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--page-canvas);
    color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a,
a:hover,
a:focus,
a:active {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.nav-state {
    position: fixed;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.site-header {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: var(--z-header);
    width: min(100%, var(--layout-max));
    transform: translateX(-50%);
    overflow: visible;
    border-inline: 1px solid var(--shell-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.app-bar {
    display: grid;
    grid-template-columns: 24px 48px minmax(0, 1fr) max-content;
    align-items: center;
    gap: 8px;
    padding: calc(3px + env(safe-area-inset-top, 0px)) var(--nav-pad-x) 3px;
    background: var(--color-app-bar);
    border-bottom: 1px solid var(--color-app-bar-border);
}

#app-bar-on:not(:checked) ~ .site-header .app-bar {
    display: none;
}

.app-bar__close {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: transparent;
    color: var(--color-green);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    transition: background-color 0.16s ease;
}

.app-bar__close:hover {
    background: var(--color-green-hover);
}

.app-bar__icon {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
}

.app-bar__copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.app-bar__text {
    margin: 0;
    padding: 0;
    color: #fff;
    overflow: hidden;
    font-size: clamp(13px, 3.45vw, 15px);
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-bar__bonus {
    color: var(--color-gold);
}

.app-bar__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 0.28rem;
    border-radius: 999px;
    background: var(--color-green);
    color: #fff;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.35);
    transition: filter 0.16s ease, transform 0.16s ease;
}

.app-bar__download:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.nav-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 62px;
    padding: 8px var(--nav-pad-x);
    background: var(--color-nav);
    border-bottom: 1px solid var(--color-nav-border);
}

.hamburger-button {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.16s ease;
}

.hamburger-button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.hamburger-button span {
    position: absolute;
    left: 11px;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-burger);
    transition: transform 0.18s ease, opacity 0.18s ease, top 0.18s ease;
}

.hamburger-button span:nth-child(1) { top: 14px; }
.hamburger-button span:nth-child(2) { top: 21px; }
.hamburger-button span:nth-child(3) { top: 28px; }

#nav-toggle:checked ~ .site-header .hamburger-button span:nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
}

#nav-toggle:checked ~ .site-header .hamburger-button span:nth-child(2) {
    opacity: 0;
}

#nav-toggle:checked ~ .site-header .hamburger-button span:nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
}

.site-logo {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    margin-left: 2px;
}

.site-logo img {
    width: clamp(80px, min(42vw, calc(100vw - 3.6rem)), 200px);
    height: clamp(28px, 5vw, 42px);
    object-fit: contain;
}

.header-cta {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
    margin-left: auto;
}

.header-cta__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 24px;
    border-radius: 9px;
    background: var(--color-yellow);
    color: #1a1a1a;
    font-size: clamp(13px, 3.4vw, 15px);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    transition: background 0.16s ease, transform 0.16s ease;
}

.header-cta__button:hover {
    background: var(--color-yellow-dark);
    transform: translateY(-1px);
}

.header-cta__button:last-child {
    background: var(--color-green);
    color: #fff;
    box-shadow: 0 2px 12px rgba(34, 197, 94, 0.35);
}

.header-cta__button:last-child:hover {
    background: var(--color-green-dark);
}

.header-cta__badge {
    position: absolute;
    top: -7px;
    right: -5px;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--color-yellow);
    color: #1a1a1a;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.site-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 12px var(--nav-pad-x) 14px;
    background: var(--surface-top);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

#nav-toggle:checked ~ .site-header .site-menu {
    display: flex;
}

.site-menu__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-menu__group + .site-menu__group {
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
}

.site-menu__label {
    margin: 0;
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.site-menu__links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.site-menu__links a {
    min-width: 0;
    min-height: 36px;
    padding: 11px 8px;
    overflow: hidden;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease;
}

.site-menu__links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.site-menu__links a.is-active {
    background: rgba(34, 197, 94, 0.14);
    color: var(--color-green);
    font-weight: 700;
}

.shell {
    position: relative;
    left: 50%;
    width: min(100%, var(--layout-max));
    max-width: 100%;
    min-height: 100vh;
    margin-inline: 0;
    transform: translateX(-50%);
    overflow-x: clip;
    background: var(--surface-top);
    border-inline: 1px solid var(--shell-border);
}

.site-main {
    width: 100%;
    max-width: 100%;
    padding-top: var(--header-full);
    overflow-x: hidden;
}

.site-main > *,
.shell > .site-footer {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.landing__container,
.prose,
.container {
    width: 100%;
    max-width: 100% !important;
    margin-inline: auto;
    padding-inline: var(--nav-pad-x);
    box-sizing: border-box;
}

@media (max-width: 360px) {
    .app-bar {
        grid-template-columns: 24px 42px minmax(0, 1fr) max-content;
        gap: 6px;
    }

    .app-bar__icon {
        width: 42px;
        height: 42px;
    }

    .header-cta {
        gap: 4px;
    }

    .header-cta__button {
        min-height: 40px;
        padding: 9px 18px;
        font-size: 13px;
    }
}
