:root {
    --glass-bg: rgba(255, 255, 255, 0.62);
    --nav-h: 58px;
    --soft-shadow: 0 30px 80px -46px rgba(44, 148, 189, 0.4);
}

[data-theme="dark"] {
    --glass-bg: rgba(9, 18, 31, 0.55);
    --soft-shadow: 0 34px 90px -48px rgba(0, 0, 0, 0.9);
}

body {
    padding-top: calc(var(--nav-h) + 20px);
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--line-soft);
    transition: background 0.4s ease, border-color 0.4s ease;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .nav {
        background: var(--panel);
    }
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 940px;
    padding-right: 54px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
}

.nav-badge {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--ice-bright), var(--ice-deep));
    box-shadow: 0 6px 16px -10px rgba(79, 189, 229, 0.9);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.24s ease, background 0.24s ease;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link[aria-current="page"] {
    color: var(--ice-deep);
    background: var(--tag-bg);
}

[data-theme="dark"] .nav-link[aria-current="page"] {
    color: var(--ice-bright);
}

.nav-ico {
    width: 15px;
    height: 15px;
    opacity: 0.8;
    flex: 0 0 auto;
}

.theme-toggle {
    z-index: 61;
    top: 9px;
    right: 14px;
}

.shell {
    border-radius: 30px;
    box-shadow: var(--soft-shadow), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.card,
.gb-card {
    border-radius: 22px;
}

.gb-card {
    box-shadow: var(--soft-shadow);
}

.mr-host {
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mr-layer {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}

.mr-state {
    position: absolute;
    inset: 0;
    background: var(--mr-ink, rgba(255, 255, 255, 0.26));
    opacity: 0;
    transition: opacity 0.15s linear;
}

.mr-host.mr-down .mr-state {
    opacity: 0.12;
}

@media (hover: hover) {
    .mr-host:hover:not(.mr-down) .mr-state {
        opacity: 0.06;
    }
}

.mr-ink {
    position: absolute;
    border-radius: 50%;
    background: var(--mr-ink, rgba(255, 255, 255, 0.26));
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    will-change: transform, opacity;
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.075s linear;
}

.mr-ink.on {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mr-ink.out {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0s linear, opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 760px) {
    .nav {
        justify-content: flex-start;
        padding: 0 8px;
    }

    .nav-inner {
        padding-right: 50px;
    }

    .nav-brand span:last-child {
        display: none;
    }

    .nav-links {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 0 11px;
        font-size: 0.78rem;
    }

    .nav-ico {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mr-ink,
    .mr-state {
        transition: none !important;
    }
}

.gb-mount {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 940px;
    min-height: 1px;
}

.gb-mount.is-loaded {
    animation: gbMountIn 0.5s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

@keyframes gbMountIn {
    from { opacity: 0; translate: 0 14px; }
    to { opacity: 1; translate: 0 0; }
}

.gb-slot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.gb-spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--line);
    border-top-color: var(--ice);
    animation: gbSpin 0.8s linear infinite;
}

@keyframes gbSpin {
    to { transform: rotate(360deg); }
}
.gb-view {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
}

.view-enter {
    animation: viewSlideIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.gb-view[hidden] {
    display: none !important;
}

.gb-view-inner {
    position: relative;
    width: 100%;
    padding: 34px 30px 30px;
    border-radius: 30px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--soft-shadow), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

[data-theme="light"] .gb-view-inner {
    border-color: rgba(44, 148, 189, 0.22);
    box-shadow: 0 26px 70px -40px rgba(44, 148, 189, 0.55), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.gb-skel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0 10px;
}

.gb-skel[hidden] {
    display: none !important;
}

.view-leaving {
    animation: viewSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes viewSlideIn {
    from { opacity: 0; transform: translateX(38px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes viewSlideOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(-32px) scale(0.97); }
}

@media (max-width: 640px) {
    .gb-view-inner {
        padding: 22px 16px 20px;
        border-radius: 22px;
    }
}

.gb-dlg {
    position: fixed;
    inset: 0;
    overscroll-behavior: contain;
    touch-action: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 18, 26, 0.42);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    backdrop-filter: blur(10px) saturate(150%);
    animation: gbDlgFade 0.18s ease both;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .gb-dlg {
        background: rgba(0, 0, 0, 0.58);
    }
}

@keyframes gbDlgFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gb-dlg-card {
    width: min(340px, 100%);
    max-height: 82vh;
    overflow-y: auto;
    touch-action: pan-y;
    padding: 24px 22px 10px;
    border-radius: 28px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 24px 64px -20px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
    animation: gbDlgIn 0.2s cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

@keyframes gbDlgIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

.gb-dlg-title {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
}

.gb-dlg-text {
    margin: 0 0 20px;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--muted);
    white-space: pre-line;
}

.gb-dlg-input {
    width: 100%;
    margin: 0 0 18px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--tag-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
}

.gb-dlg-input:focus {
    border-color: var(--ice);
}

.gb-dlg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.gb-dlg-btn {
    min-width: 68px;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ice-deep);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.gb-dlg-btn:hover {
    background: var(--tag-bg);
}

.gb-dlg-btn.danger {
    color: #e5534b;
}

[data-theme="dark"] .gb-dlg-btn {
    color: var(--ice-bright);
}

[data-theme="dark"] .gb-dlg-btn.danger {
    color: #ff8078;
}
.gb-dlg-btn:focus {
    outline: none;
}

.gb-dlg-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--ice-soft);
}
