* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #eef2f7;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

body.mah-mobile-app-shell {
    min-height: 100vh;
}

.mah-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.mah-shell__phone {
    position: relative;
    width: 100%;
    max-width: 540px;
    min-height: 100vh;
    background: #f5f7fb;
    overflow-x: hidden;
}

.mah-shell__header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 16px 16px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border-bottom: 1px solid #e6edf7;
}

.mah-shell__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mah-shell__brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #1677ff;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}

.mah-shell__title {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

.mah-shell__subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
}

.mah-shell__search {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 14px;
}

.mah-shell__main {
    padding: 14px 14px calc(104px + env(safe-area-inset-bottom));
}

.mah-tabs,
.mah-subtabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.mah-tabs::-webkit-scrollbar,
.mah-subtabs::-webkit-scrollbar {
    display: none;
}

.mah-tab,
.mah-subtab {
    flex: 0 0 auto;
    text-decoration: none;
    white-space: nowrap;
}

.mah-tab {
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dbe4f0;
    color: #334155;
    font-size: 14px;
}

.mah-tab.is-active {
    background: #1677ff;
    border-color: #1677ff;
    color: #fff;
    box-shadow: 0 8px 18px rgba(22, 119, 255, 0.18);
}

.mah-subtabs {
    margin-top: -2px;
}

.mah-subtab {
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1663d6;
    font-size: 13px;
}

.mah-subtab.is-active {
    background: #1677ff;
    color: #fff;
}

.mah-feed {
    display: grid;
    gap: 12px;
}

.mah-card {
    padding: 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #edf2f7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mah-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.mah-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
}

.mah-card__title {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.45;
}

.mah-card__summary {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

.mah-card__foot {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    color: #1677ff;
    font-size: 12px;
}

.mah-empty,
.mah-profile {
    padding: 22px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #edf2f7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mah-empty {
    text-align: center;
    color: #64748b;
}

.mah-empty__title,
.mah-profile__title {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 18px;
}

.mah-profile__text {
    margin: 0 0 12px;
    color: #475569;
    font-size: 14px;
    line-height: 1.8;
}

.mah-profile__tag {
    display: inline-block;
    margin: 6px 6px 0 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1677ff;
    font-size: 12px;
}

.mah-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 20;
    width: min(540px, 100vw);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e6edf7;
    backdrop-filter: blur(14px);
}

.mah-bottom-nav__item {
    padding: 8px 4px;
    border-radius: 14px;
    color: #64748b;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
}

.mah-bottom-nav__item.is-active {
    background: #eef4ff;
    color: #1677ff;
    font-weight: 700;
}

@media (min-width: 700px) {
    body.mah-mobile-app-shell {
        background: #dfe7f3;
    }

    .mah-shell {
        padding: 20px 0;
    }

    .mah-shell__phone {
        min-height: calc(100vh - 40px);
        border-radius: 28px;
        box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    }
}
