/* 仿小程序壳：自定义顶栏 + 底部 Tab */
.mp-app {
    --mp-nav-h: 44px;
    --mp-tab-h: 50px;
    --mp-safe-top: env(safe-area-inset-top, 0px);
    --mp-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mp-purple: #5a2f78;
    --mp-purple-light: #7c66a0;
    --mp-bg: linear-gradient(180deg, #efe6f8 0%, #eaf0fb 45%, #f4f6fb 100%);
    --mp-tab-inactive: #9a92a8;
    padding-top: calc(var(--mp-safe-top) + var(--mp-nav-h));
    padding-bottom: calc(var(--mp-safe-bottom) + var(--mp-tab-h));
    min-height: 100vh;
    box-sizing: border-box;
}

.mp-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: calc(var(--mp-safe-top) + var(--mp-nav-h));
    padding-top: var(--mp-safe-top);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(90, 47, 120, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-navbar-inner {
    width: 100%;
    max-width: 420px;
    height: var(--mp-nav-h);
    display: grid;
    grid-template-columns: 72px 1fr 72px;
    align-items: center;
    padding: 0 8px;
    margin: 0 auto;
}

.mp-nav-back {
    justify-self: start;
    border: none;
    background: transparent;
    color: var(--mp-purple);
    font-size: 28px;
    line-height: 1;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    visibility: hidden;
}

.mp-app[data-mp-show-back="1"] .mp-nav-back {
    visibility: visible;
}

.mp-nav-title {
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #251b35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-nav-placeholder {
    width: 1px;
}

.mp-main {
    max-width: 420px;
    margin: 0 auto;
}

.mp-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    height: calc(var(--mp-tab-h) + var(--mp-safe-bottom));
    padding-bottom: var(--mp-safe-bottom);
    background: #ffffff;
    border-top: 1px solid #ebe6f2;
    display: flex;
    align-items: stretch;
    justify-content: center;
    box-shadow: 0 -4px 16px rgba(72, 43, 102, 0.06);
}

.mp-tabbar-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
}

.mp-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--mp-tab-inactive);
    font-size: 11px;
    padding-top: 4px;
}

.mp-tab-item.active {
    color: var(--mp-purple);
    font-weight: 600;
}

.mp-tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-tab-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
