/* ============================================================
 * douyin2026 首页样式 — 一比一还原抖音商城
 * ============================================================ */

:root {
    --r: #fe2c55;   /* 抖音红 */
    --rl: #fff0f2;
    --t1: #222;
    --t2: #999;
    --bg: #f4f5f7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-y: auto; }
body { min-height: 100%; background: var(--bg); font-family: -apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue","Microsoft YaHei",sans-serif; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; }
svg { max-width: 100%; }

/* ===== 页面容器 ===== */
.dy-page { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 56px; overflow: visible; }

/* ===== 店铺信息卡片（仅头像+店名+关注）===== */
.dy-shop-card {
    margin: 0;
    background: #fff;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
}
.dy-shop-top {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    padding: 15px 26px 8px;
}

/* 头像 */
.dy-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    border: 0 solid #eee;
}

.dy-shop-info {
    flex: 1;
    -webkit-flex: 1;
    min-width: 0;
    margin-left: 10px;
}

/* 店铺名+认证 */
.dy-name-row {
    display: flex;
    align-items: center;
}
.dy-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--t1);
    line-height: 20px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dy-verify {
    margin-left: 4px;
    font-size: 14px;
    color: #888;
    line-height: 1;
}

/* 星星行 */
.dy-star-line {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    margin-top: 2px;
    font-size: 12px;
    line-height: 16px;
}
.dy-stars {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    margin-right: 5px;
    font-weight: 900;
}
.dy-star {
    color: #ff4d4f;
    font-size: 14px;
    font-weight: 900;
    line-height: 14px;
    letter-spacing: -1.2px;
    text-shadow: 0 0 0 #ff4d4f;
}
.dy-rate {
    color: #ff4d4f;
    font-size: 13px;
    font-weight: 700;
    margin-right: 6px;
}
.dy-sep {
    color: #d8d8d8;
    font-size: 11px;
    margin-right: 6px;
}
.dy-fans {
    color: #777;
    font-size: 12px;
}

/* 关注按钮 */
.dy-follow-btn {
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    margin-left: auto;
    background: var(--r);
    color: #fff;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    width: 72px;
    height: 34px;
    padding: 0;
    line-height: 34px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
}
.dy-follow-btn.on {
    background: #fff3f5;
    color: var(--r);
}

/* ===== 数据行（卡片下方独立区域，可横向滑动）===== */
.dy-stats {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    padding: 8px 26px 9px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: auto;
    scrollbar-width: none;
}
.dy-stats::-webkit-scrollbar { display: none; }
.dy-stats::-webkit-scrollbar { display: none; }
.dy-stat {
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    font-size: 12px;
    color: #666;
    position: relative;
    white-space: nowrap;
    height: 17px;
    line-height: 17px;
    margin-right: 18px;
    padding-right: 0;
}
.dy-stat + .dy-stat::before {
    display: none;
}

/* 数据行 SVG 图标 */
.stat-ic {
    width: 14px;
    height: 14px;
    min-width: 14px;
    max-width: 14px;
    margin-right: 4px;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
}
.v {
    color: var(--t1);
    font-weight: 700;
    margin-left: 1px;
    font-size: 12px;
}

/* ===== 保障横幅（浅蓝单行条，参考图布局）===== */
.dy-barrier {
    margin: 0;
    min-height: 34px;
    padding: 7px 16px;
    background: #eaf8ff;
    border: none;
    border-radius: 0;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    gap: 12px;
    overflow: hidden;
}
.dy-barrier::-webkit-scrollbar { display: none; }
.dy-bl {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: #1677ff;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    white-space: nowrap;
}
.barrier-ic {
    display: inline-block !important;
    width: 15px;
    height: 15px;
    min-width: 15px;
    max-width: 15px;
    margin-right: 4px;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    vertical-align: -3px;
}
.dy-br {
    flex: 1;
    -webkit-flex: 1;
    min-width: 0;
    text-align: right;
    font-size: 12px;
    color: #9aa6ad;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 排序栏 ===== */
.dy-sortbar {
    position: sticky;
    position: -webkit-sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f2f2f2;
    margin-top: 0;
}
.dy-sort-tabs { display: flex; align-items: center; }

.s-tab {
    font-size: 14px;
    color: var(--t1);
    margin-right: 18px;
    padding-bottom: 3px;
    cursor: pointer;
    position: relative;
}
.s-tab.active {
    color: var(--r);
    font-weight: 600;
}
.s-tab.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--r);
}

.new-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--r);
    margin-left: 3px;
    vertical-align: super;
}

.s-price .arw {
    display: inline-flex;
    flex-direction: column;
    margin-left: 3px;
    vertical-align: middle;
}
.s-price .arw b,
.s-price .arw u {
    display: block;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
}
.s-price .arw b { border-bottom: 4px solid #ccc; margin-bottom: 2px; }
.s-price .arw u { border-top: 4px solid #ccc; }
.s-price.active .arw.asc b { border-bottom-color: var(--r); }
.s-price.active .arw.asc u { border-top-color: #ccc; }
.s-price.active .arw.desc b { border-bottom-color: #ccc; }
.s-price.active .arw.desc u { border-top-color: var(--r); }

.s-mode {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
}
.s-mode svg { margin-right: 2px; }

/* ===== 商品列表 ===== */
.dy-list { padding: 10px 12px; }

.dy-item {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    transition: transform .08s;
}
.dy-item:active { transform: scale(.98); }

.dy-item-img {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}
.dy-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dy-item-body {
    flex: 1;
    margin-left: 12px;
    margin-right: -2px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dy-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--t1);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.dy-yellow-line {
    font-size: 11px;
    color: #b88946 !important;
    margin-top: 3px;
    line-height: 15px;
    height: 15px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    word-break: keep-all;
}
.dy-yellow-line,
.dy-yellow-line * {
    color: #b88946 !important;
}

.dy-price-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
}

.dy-price {
    color: var(--r);
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
}
.dy-price big {
    font-size: 24px;
    font-weight: 800;
    font-style: normal;
    margin-left: 1px;
}

.dy-fav {
    font-size: 11px;
    color: var(--t2);
}

.dy-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.tg {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.5;
}
.tg-r { color: var(--r); background: var(--rl); }
.tg-o { color: #ff6a00; background: #fff4ec; }
.tg-g { color: #999; background: #f5f5f5; }

/* 双列模式 */
.dy-list.grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 8px;
}
.dy-list.grid .dy-item {
    display: flex !important;
    width: auto !important;
    min-width: 0;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    padding: 8px;
    border-radius: 8px;
}
.dy-list.grid .dy-item-img {
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100%;
    position: relative;
    flex-shrink: 0;
}
.dy-list.grid .dy-item-img img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dy-list.grid .dy-item-body {
    margin-left: 0 !important;
    margin-top: 8px;
    margin-right: 0;
}

/* 已经到底了 */
.dy-end {
    text-align: center;
    font-size: 12px;
    color: #ccc;
    padding: 22px 0 30px;
}

/* ===== 底部导航栏 ===== */
.dy-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 99;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #ececec;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: 4px;
    padding-bottom: calc(4px + constant(safe-area-inset-bottom));
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
}
.tb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
    min-width: 60px;
    padding: 2px 0 3px;
}
.tb svg { margin-bottom: 2px; }
.tb svg path { fill: currentColor !important; }
.tb-on { color: #999; }
.tb-shop { color: #222; }

/* ===== PC 居中 ===== */
@media (min-width: 769px) {
    body { max-width: 420px !important; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,.06); }
    .dy-page { max-width: 420px; }
    .dy-tabbar { max-width: 420px; }
}
