@charset "utf-8";
/* ==========================================================================
   SHEIN 商城 · 公共样式（所有页面共用）
   1. 变量 / 基础重置
   2. 公共头部 .app-header
   3. 公共底部切换导航 .app-footer
   4. 通用组件（卡片 / 区块标题 / 商品卡 / 价格 / 按钮 / 轻提示）
   ========================================================================== */

/* ---------- 1. 变量 & 基础 ---------- */
:root {
    --brand: #ff2d55;
    --brand-2: #ff6b8b;
    --brand-soft: #ffe9ef;
    --text: #141414;
    --text-2: #75757d;
    --text-3: #a6a6ae;
    --line: #f1f1f4;
    --page-bg: #f5f5f8;
    --card: #ffffff;
    --radius: 14px;
    --radius-sm: 10px;
    --page-max: 430px;
    --header-h: 52px;
    --footer-h: 56px;
}

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

html {
    background: #e9ebef;
}

body {
    margin: 0 auto;
    max-width: var(--page-max);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    background: var(--page-bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* 页面切换动画放在 .page 上，避免影响 footer 的 fixed 定位 */
.page {
    animation: pageIn .28s ease both;
    transition: opacity .18s ease, transform .18s ease;
}

.page.page-leave {
    opacity: 0;
    transform: translateY(-4px);
}
.page--inner img{
    vertical-align: middle;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

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

h1, h2, h3, h4, p {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

input {
    font: inherit;
    color: inherit;
}

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

/* 图标：尺寸由外层控制，颜色跟随 currentColor */
.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.ic {
    display: block;
    width: 20px;
    height: 20px;
    flex: none;
}

/* 页面主体内容区：占据剩余高度，内部可滚动，footer 在外层贴底 */
.page {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 calc(var(--footer-h) + 16px);
}

/* ---------- 2. 公共头部 ---------- */
.app-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--header-h);
    padding: 0 12px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(20, 20, 20, .05);
}

.app-header__logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: none;
    cursor: pointer;
}

.logo-text {
    font-family: Georgia, "Times New Roman", "Songti SC", serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .5px;
    color: #111;
}

.logo-slogan {
    margin-top: 2px;
    font-size: 6px;
    line-height: 1;
    letter-spacing: .2px;
    color: #333;
    white-space: nowrap;
    transform: scale(.94);
    transform-origin: left center;
}

.app-header__search {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    background: #f4f4f6;
    border-radius: 999px;
    transition: background .2s ease, box-shadow .2s ease;
}

.app-header__search.is-focus {
    background: #fff;
    box-shadow: 0 0 0 1.5px var(--brand-2) inset;
}

.app-header__search .ic-search {
    width: 15px;
    height: 15px;
    color: #9c9ca4;
}

.search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 12.5px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.search-input::placeholder {
    color: #a8a8b0;
}

.search-input::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    display: none;
    width: 16px;
    height: 16px;
    color: #b6b6be;
}

.search-clear .ic {
    width: 16px;
    height: 16px;
}

.search-clear.is-show {
    display: block;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}

.act-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #444;
    border-radius: 50%;
    transition: background .2s ease, transform .15s ease;
}

.act-btn .ic {
    width: 25px;
    height: 25px;
}

.act-btn:active {
    background: #f0f0f3;
    transform: scale(.9);
}

.act-btn__dot {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 1.5px #fff;
}

/* ---------- 2.1 公共内页头部（二级页面，带返回键） ---------- */
.app-subheader {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: var(--header-h);
    padding: 0 6px;
    background: #fff;
    /*background: linear-gradient(180deg, #ffe4ed 0%, #fff1f5 62%, rgba(255, 255, 255, .96) 100%);*/
}

/* 返回按钮 */
.subheader-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    color: var(--text);
    transition: background .18s ease, transform .15s ease;
}

.subheader-back .ic {
    width: 21px;
    height: 21px;
}

.subheader-back:active {
    background: rgba(20, 20, 20, .06);
    transform: scale(.9);
}

.subheader-back--ghost {
    visibility: hidden;
}

/* 居中标题：绝对定位，左右元素不对称也不会偏移 */
.subheader-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 62%;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .4px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧文字操作（如“保存”） */
.subheader-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0 10px;
    flex: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    transition: opacity .18s ease;
}

.subheader-action:active {
    opacity: .6;
}

.subheader-action--ghost {
    visibility: hidden;
}

/* ---------- 3. 公共底部切换导航 ---------- */
/* footer 用 flex-shrink:0 贴在 body 底部，
   避免 position:fixed 在 Safari/iframe 预览里出现跟随滚动的兼容性问题 */
.app-footer {
    flex: 0 0 auto;
    z-index: 5;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -1px 0 rgba(20, 20, 20, .06);
}

.app-footer__inner {
    display: flex;
    height: var(--footer-h);
}

.tab-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    overflow: hidden;
    color: #9b9ba4;
    transition: color .22s ease;
}

/* 图标：两张图片叠放（灰 / 品牌色），用透明度切换，切换 tab 时不会二次请求 */
.tab-item__icon {
    position: relative;
    display: block;
    flex: none;
    width: 26px;
    height: 26px;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
}

.tab-item__img {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .22s ease;
}

/* 默认只显示灰色图标 */
.tab-item__img--active {
    opacity: 0;
}

.tab-item__text {
    font-size: 10.5px;
    line-height: 1;
    transition: transform .22s ease;
}

/* 选中态：主色高亮 + 图标上浮放大 */
.tab-item.is-active {
    color: var(--brand);
    font-weight: 600;
}

.tab-item.is-active .tab-item__icon {
    transform: translateY(-1px) scale(1.1);
}

/* 选中态换成品牌色图标 */
.tab-item.is-active .tab-item__img--normal {
    opacity: 0;
}

.tab-item.is-active .tab-item__img--active {
    opacity: 1;
}

.tab-item.is-active .tab-item__text {
    font-weight: 600;
}

/* 点击反馈 */
.tab-item:active .tab-item__icon {
    transform: scale(.85);
}

.tab-item.is-bounce .tab-item__icon {
    animation: tabBounce .34s ease;
}

@keyframes tabBounce {
    0% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-3px) scale(1.14); }
    100% { transform: translateY(-1px) scale(1.1); }
}

/* 切换中的过渡（跳转前播放） */
.tab-item.is-switching {
    color: var(--brand);
}

.tab-item.is-switching .tab-item__icon {
    animation: tabSwitch .3s ease;
}

/* 跳转前先用品牌色图标给出反馈 */
.tab-item.is-switching .tab-item__img--active {
    opacity: 1;
}

@keyframes tabSwitch {
    0% { transform: scale(1); }
    50% { transform: scale(.82); }
    100% { transform: scale(1.06); }
}

.tab-item__ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--brand);
    opacity: 0;
    pointer-events: none;
}

.tab-item__ripple.is-play {
    animation: tabRipple .55s ease-out;
}

@keyframes tabRipple {
    0% { opacity: .22; transform: scale(1); }
    100% { opacity: 0; transform: scale(8); }
}

.app-footer__safe {
    height: env(safe-area-inset-bottom);
}

/* ---------- 4. 通用组件 ---------- */
.card {
    margin: 10px 10px 12px;
    padding: 14px 10px;
    background: var(--card);
    border-radius: var(--radius);
}

/* 区块标题：图标 + 标题 + 查看更多 */
.sec-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 2px 12px;
}

.sec-head__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--brand);
}

.sec-head__icon .ic {
    width: 18px;
    height: 18px;
}

.sec-head__title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
}

.sec-head__more {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: var(--text-3);
}

.sec-head__more .ic {
    width: 13px;
    height: 13px;
}

.sec-head__more:active {
    opacity: .6;
}

/* 商品卡 */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.goods-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: var(--radius-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}

.goods-card:active {
    transform: scale(.975);
    box-shadow: 0 6px 18px rgba(20, 20, 20, .06);
}

.goods-card__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 112px;
    border-radius: var(--radius-sm);
}

.goods-card__thumb .ic {
    width: 46px;
    height: 46px;
    opacity: .85;
}

.goods-card__body {
    padding: 8px 2px 2px;
}

.goods-card__name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.goods-card__desc {
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goods-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 7px;
}

.goods-card__go {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
}

.goods-card__go .ic {
    width: 13px;
    height: 13px;
}

/* 横向商品条（热卖推荐） */
.goods-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.goods-row__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    flex: none;
    border-radius: var(--radius-sm);
}

.goods-row__thumb .ic {
    width: 40px;
    height: 40px;
    opacity: .85;
}

.goods-row__body {
    flex: 1;
    min-width: 0;
}

.goods-row__name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.goods-row__desc {
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-2);
}

.goods-row__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.goods-row__buy {
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5c7c, #ff2d55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(255, 45, 85, .26);
    transition: transform .15s ease;
}

.goods-row__buy:active {
    transform: scale(.94);
}

/* 价格 */
.price {
    display: inline-flex;
    align-items: baseline;
    color: var(--brand);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .2px;
}

.price i {
    margin-right: 1px;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.price--sm {
    font-size: 14px;
}

.price-old {
    margin-left: 5px;
    font-size: 11.5px;
    color: var(--text-3);
    text-decoration: line-through;
    font-weight: 400;
}

/* 缩略图配色 */
.thumb-blue { background: linear-gradient(135deg, #eaf1ff, #dce8ff); color: #7fa3e0; }
.thumb-rose { background: linear-gradient(135deg, #ffeef3, #ffdde8); color: #f18aab; }
.thumb-amber { background: linear-gradient(135deg, #fff5e6, #ffe9cc); color: #dda45c; }
.thumb-mint { background: linear-gradient(135deg, #e9fbf3, #d8f4e8); color: #67c39b; }

/* 轻提示 */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--footer-h) + 28px);
    z-index: 300;
    max-width: 70%;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(24, 24, 28, .86);
    color: #fff;
    font-size: 12.5px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
    pointer-events: none;
}

.app-toast.is-show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* 空状态 */
.empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}

.empty .ic {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    color: #d8d8de;
}
