/* ---------- Шапка ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    /* учёт «челки» на iPhone */
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-height) + env(safe-area-inset-top));
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.app-logo__mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    font-family: var(--font-hanzi);
    font-size: 20px;
    color: #fff;
    background: var(--color-accent);
    border-radius: var(--radius-sm);
}

.app-logo__name {
    font-weight: 600;
    font-size: 17px;
}

/* ---------- Основной контейнер ---------- */
.app-main {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-4)
             calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + var(--space-6));
    min-height: calc(100dvh - var(--header-height));
}

/* ---------- Нижняя навигация ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
}

.bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: var(--space-1);
    color: var(--color-text-muted);
    font-size: 11px;
    transition: color 0.15s ease;
}

.bottom-nav__icon {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav__item.is-active {
    color: var(--color-accent);
    font-weight: 600;
}

/* ---------- Меню «Ещё» (bottom-sheet) ---------- */
.more-sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.more-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    animation: fade-in 0.15s ease;
}

.more-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-3) var(--space-4)
             calc(var(--space-4) + env(safe-area-inset-bottom));
    animation: slide-up 0.2s ease;
}

.more-sheet__handle {
    width: 40px;
    height: 4px;
    margin: 0 auto var(--space-3);
    background: var(--color-border);
    border-radius: 2px;
}

.more-sheet__list {
    display: grid;
    gap: var(--space-1);
}

.more-sheet__link {
    display: block;
    padding: var(--space-3) var(--space-2);
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.more-sheet__link:active {
    background: var(--color-accent-soft);
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ---------- Заглушки разделов ---------- */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--color-text-muted);
}

.placeholder__icon {
    font-size: 48px;
}

.placeholder__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
}

/* ---------- Десктоп ---------- */
@media (min-width: 900px) {
    .app-main {
        padding-top: var(--space-6);
    }
    .bottom-nav {
        max-width: 720px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 720px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: var(--shadow-md);
    }
}