/* 微商相册 - 移动端优先 */
:root {
    --album-bg: #f7f5f0;
    --album-card: #ffffff;
    --album-accent: #8ba38f;
    --album-accent-soft: rgba(139, 163, 143, 0.18);
    --album-text: #1f1f1f;
    --album-sub: #9a9a9a;
    --album-border: #eceae4;
    --album-radius: 16px;
    --album-radius-sm: 12px;
    --album-nav-h: 64px;
    --album-max: 480px;
}

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

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #ebe8e1;
    color: var(--album-text);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button, input {
    font: inherit;
    border: none;
    outline: none;
    background: none;
}

.album-app {
    width: 100%;
    max-width: var(--album-max);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--album-bg);
    position: relative;
    padding-bottom: 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

.album-page {
    padding: 16px 16px 0;
}

/* ===== Header / Shop ===== */
.album-shop {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.album-shop__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #ddd;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.album-shop__meta {
    min-width: 0;
}

.album-shop__name {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.album-shop__stats {
    margin-top: 4px;
    font-size: 12px;
    color: var(--album-sub);
    line-height: 1.2;
}

/* ===== Search ===== */
.album-search {
    position: relative;
    margin-bottom: 18px;
}

.album-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #b0b0b0;
    pointer-events: none;
}

.album-search__input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 44px;
    border-radius: 999px;
    background: #fff;
    color: var(--album-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.album-search__input::placeholder {
    color: #b8b8b8;
}

/* ===== Section ===== */
.album-section__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ===== Category pills ===== */
.album-cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.album-cats::-webkit-scrollbar {
    display: none;
}

.album-cat {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 32px;
    color: #444;
    background: #fff;
    border: 1px solid var(--album-border);
    white-space: nowrap;
    transition: background .2s, color .2s, border-color .2s;
}

.album-cat.is-active {
    background: var(--album-accent);
    border-color: var(--album-accent);
    color: #fff;
    font-weight: 600;
}

/* ===== Product waterfall ===== */
.album-grid {
    column-count: 2;
    column-gap: 12px;
}

.album-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 12px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    background: var(--album-card);
    border-radius: var(--album-radius);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform .2s ease;
    vertical-align: top;
}

.album-card:active {
    transform: scale(0.98);
}

.album-card__cover {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #eee;
}

/* 错落比例，增强瀑布流感 */
.album-card:nth-child(5n+1) .album-card__cover { aspect-ratio: 3 / 4; }
.album-card:nth-child(5n+2) .album-card__cover { aspect-ratio: 1 / 1; }
.album-card:nth-child(5n+3) .album-card__cover { aspect-ratio: 4 / 5; }
.album-card:nth-child(5n+4) .album-card__cover { aspect-ratio: 5 / 6; }
.album-card:nth-child(5n)   .album-card__cover { aspect-ratio: 2 / 3; }

.album-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-card__body {
    padding: 10px 10px 12px;
}

.album-card__title {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.album-empty {
    column-span: all;
    text-align: center;
    padding: 48px 16px;
    color: var(--album-sub);
    font-size: 14px;
}

/* ===== Bottom nav ===== */
.album-tabbar {
    position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: calc(var(--album-max) - 24px);
    height: var(--album-nav-h);
    background: #fff;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.album-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #8a8a8a;
    font-size: 10px;
    padding: 6px 0;
}

.album-tab__icon {
    width: 36px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: background .2s;
}

.album-tab__icon svg {
    width: 22px;
    height: 22px;
}

.album-tab.is-active {
    color: var(--album-accent);
    font-weight: 600;
}

.album-tab.is-active .album-tab__icon {
    background: var(--album-accent-soft);
}

.album-tab--publish .album-tab__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--album-accent);
    color: #fff;
}

.album-tab--publish {
    color: var(--album-accent);
}

.album-tab--publish .album-tab__icon svg {
    width: 22px;
    height: 22px;
}

/* ===== Detail page ===== */
.album-detail {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.album-detail .album-tabbar {
    display: none;
}

.album-detail-hd {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 12px;
    background: rgba(247, 245, 240, 0.92);
    backdrop-filter: blur(10px);
}

.album-detail-hd__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.album-detail-hd__btn svg {
    width: 20px;
    height: 20px;
}

.album-detail-hd__title {
    font-size: 15px;
    font-weight: 600;
}

.album-swiper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eee;
    overflow: hidden;
}

.album-swiper__track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.album-swiper__track::-webkit-scrollbar {
    display: none;
}

.album-swiper__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 100%;
}

.album-swiper__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-swiper__dots {
    position: absolute;
    right: 14px;
    bottom: 14px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
}

.album-info {
    margin: 12px 16px 0;
    padding: 16px;
    background: #fff;
    border-radius: var(--album-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.album-info__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
}

.album-info__meta {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--album-sub);
}

.album-info__actions {
    display: flex;
    gap: 8px;
}

.album-chip {
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--album-bg);
    font-size: 12px;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.album-seller {
    margin: 12px 16px 0;
    padding: 14px 16px;
    background: #fff;
    border-radius: var(--album-radius);
    display: flex;
    align-items: center;
    gap: 12px;
}

.album-seller__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.album-seller__name {
    font-size: 14px;
    font-weight: 600;
}

.album-seller__stats {
    margin-top: 3px;
    font-size: 12px;
    color: var(--album-sub);
}

.album-content {
    margin: 12px 16px 0;
    padding: 16px;
    background: #fff;
    border-radius: var(--album-radius);
}

.album-content__hd {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--album-border);
}

.album-content__body {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

.album-content__body p {
    margin: 0 0 12px;
}

.album-content__body img {
    width: 100%;
    border-radius: 12px;
    margin: 8px 0;
}

.album-related {
    margin: 12px 16px 24px;
}

.album-related__hd {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ===== Detail bottom bar ===== */
.album-buybar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--album-max);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 100;
}

.album-buybar__icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: #666;
    font-size: 10px;
    gap: 2px;
    flex-shrink: 0;
}

.album-buybar__icon svg {
    width: 20px;
    height: 20px;
}

.album-buybar__btns {
    flex: 1;
    display: flex;
    gap: 8px;
}

.album-btn {
    flex: 1;
    height: 42px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-btn--ghost {
    background: #fff;
    border: 1px solid var(--album-accent);
    color: var(--album-accent);
}

.album-btn--primary {
    background: var(--album-accent);
    color: #fff;
}

.album-toast {
    position: fixed;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.album-toast.is-show {
    opacity: 1;
}

/* Category page */
.album-cat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.album-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    background: #fff;
    border-radius: var(--album-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.album-cat-item__name {
    font-size: 15px;
    font-weight: 600;
}

.album-cat-item__arrow {
    color: #ccc;
}

@media (min-width: 481px) {
    body {
        padding: 24px 0;
    }
    .album-app {
        min-height: calc(100vh - 48px);
        border-radius: 20px;
        overflow: hidden;
    }
}
