/* ===== Feed 动态页 ===== */
body {
    background: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
.tab-bar .tab-btn.active::after { background: #2196f3; opacity: 0.5; }



#scroll-root {
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    min-height: 0;
    padding-bottom: calc(1.67rem + env(safe-area-inset-bottom, 0px)) !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fd-container {
    max-width: 23.52rem;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== Tab 切换 ===== */
.fd-tabs {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border-radius: 0.47rem 0.47rem 0 0;
    padding: 0.4rem 0.31rem 0.5rem 0.31rem;
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.fd-tabs::-webkit-scrollbar { display: none; }
.fd-tab {
    position: relative;
    border: none;
    background: transparent;
    color: #999;
    font-size: 0.36rem;
    font-weight: 400;
    padding: 0.1rem 0 0.13rem 0;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s, font-weight .18s;
}
.fd-tab:focus,
.fd-tab:focus-visible,
.fd-tab:active {
    outline: none;
    background: transparent;
}
.fd-tab.active {
    color: #333;
    font-weight: 500;
}
.fd-tab.active::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 2px;
    width: 0.13rem;
    height: 0.13rem;
    border-radius: 50%;
    background: #2196f3;
    opacity: 0.5;
    transform: translateX(-50%);
}

/* ===== 内容区 ===== */
.fd-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0 0 0 0;
}
.fd-loading,
.fd-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #b0b0b0;
    font-size: 0.31rem;
    gap: 0.21rem;
    padding: 2.1rem 0;
}
.fd-loading svg {
    width: 0.63rem;
    height: 0.63rem;
    animation: fd-spin 1s linear infinite;
}
@keyframes fd-spin {
    to { transform: rotate(360deg); }
}
.fd-end {
    text-align: center;
    padding: 0.42rem 0;
    color: #c0c0c0;
    font-size: 0.3rem;
}
.fd-bottom-loader {
    text-align: center;
    padding: 0.42rem 0;
    color: #999;
    font-size: 0.28rem;
}

/* ===== 动态卡片（朋友圈风格） ===== */
.fd-item {
    background: #fff;
    margin: 0 0.31rem;
    padding: 0.31rem;
    padding-bottom: 0.36rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-bottom: 0.02rem solid #e0e0e0;
}
.fd-item:active {
    background: #fafafa;
}

/* 头部：头像 + 用户名 + 商品 + 情感标签 */
.fd-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.16rem;
}
.fd-avatar-wrap {
    flex-shrink: 0;
    margin-right: 0.21rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.fd-avatar {
    width: 0.88rem;
    height: 0.88rem;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.fd-avatar-letter {
    width: 0.88rem;
    height: 0.88rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.37rem;
    font-weight: 600;
}
.fd-user {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
}
.fd-id {
    font-size: 0.29rem;
    color: #999;
    line-height: 1.3;
}
.fd-name {
    font-size: 0.37rem;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
}
.fd-product {
    font-size: 0.28rem;
    color: #1976d2;
    margin-bottom: 0.21rem;
}
.fd-sentiment {
    font-size: 0.28rem;
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.04rem 0.14rem;
    border-radius: 0.21rem;
    font-weight: 500;
}
.fd-sentiment.good { color: #4caf50; background: #e8f5e9; }
.fd-sentiment.bad { color: #f44336; background: #ffebee; }
.fd-sentiment.neutral { color: #ff9800; background: #fff3e0; }

/* 星级行 */
.fd-stars {
    margin-bottom: 0.16rem;
}
.fd-star {
    font-size: 0.3rem;
    color: #ff9800;
    text-shadow: 0 0 0.03rem rgba(255,152,0,0.4);
}
.fd-star.empty {
    color: #ddd;
    text-shadow: none;
}

/* 评价正文 */
.fd-body {
    font-size: 0.34rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 0.16rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== 媒体网格（统一三列小框，对齐 ReviewDetail）===== */
.fd-media {
    display: flex;
    flex-wrap: wrap;
    gap: 0.08rem;
    margin-bottom: 0.16rem;
}
.fd-media-item {
    width: calc((100% - 0.16rem) / 3);
    min-width: calc((100% - 0.16rem) / 3);
    aspect-ratio: 1;
    border-radius: 0.21rem;
    overflow: hidden;
    position: relative;
    background: #e8e8e8;
}
.fd-media-item img,
.fd-media-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fd-media-video-wrap {
    position: relative;
    background: #e0e0e0;
}
.fd-media-video-poster {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    display: block;
    background: transparent;
}
.fd-media-video-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
    background: #f0f0f0; /* 弱网兜底：视频画面未解码时显示浅灰，避免黑屏 */
    display: block;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}
/* .fd-video-play 已迁移至 common.css 的 .dm-play-icon */

/* 底部：时间 + 点赞 */
.fd-footer {
    display: flex;
    align-items: center;
    font-size: 0.28rem;
    color: #999;
}
.fd-footer > * + * { margin-left: 0.31rem; }
.fd-time {
    color: #bbb;
}
.fd-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
    color: #999;
    font-size: 0.32rem;
    text-decoration: none;
    margin-left: auto;
}
.fd-reply-link::before {
    content: '';
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    flex-shrink: 0;
    background: #999;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c1.54 0 2.98-.35 4.27-.97L21 22l-1.2-4.87C21.28 15.65 22 13.9 22 12c0-5.52-4.48-10-10-10z' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c1.54 0 2.98-.35 4.27-.97L21 22l-1.2-4.87C21.28 15.65 22 13.9 22 12c0-5.52-4.48-10-10-10z' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fd-likes {
    color: #999;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: color .15s;
    font-weight: normal;
    font-size: 0.32rem;
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
}
.fd-likes::before {
    content: '';
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    background: #999;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='8' width='5' height='12' rx='2' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2z' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='8' width='5' height='12' rx='2' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M9 21h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.58 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2z' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.fd-likes.liked {
    color: #999;
}
.fd-likes.liked::before {
    background: #999;
}

/* ===== 媒体查看器 ===== */
.fd-media-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}
.fd-media-viewer-close {
    position: absolute;
    top: 0.31rem;
    right: 0.31rem;
    width: 0.73rem;
    height: 0.73rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.42rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

/* 计数器 "2 / 7" */
.fd-media-viewer-counter {
    position: absolute;
    top: 0.37rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.32rem;
    background: rgba(0,0,0,0.4);
    padding: 0.1rem 0.31rem;
    border-radius: 0.52rem;
    z-index: 10;
    pointer-events: none;
}

/* 滑动轨道 */
.fd-media-viewer-track {
    display: flex;
    width: 100%;
    height: 100%;
    will-change: transform;
}
.fd-media-viewer-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.fd-media-viewer-img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}
.fd-media-viewer-video {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* 视频播放/暂停图标 */
.fd-video-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.25s;
    opacity: 1;
}
.fd-video-play-icon::after {
    content: '';
    display: block;
    width: 1.8rem;
    height: 1.8rem;
    background: rgba(255,255,255,0.75);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9,8 Q9,7 10,7 L17.5,11.5 Q18,12 17.5,12.5 L10,17 Q9,17 9,16 Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9,8 Q9,7 10,7 L17.5,11.5 Q18,12 17.5,12.5 L10,17 Q9,17 9,16 Z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.fd-video-play-icon.paused {
    opacity: 0;
}

/* 左右箭头 */
.fd-media-viewer-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0.94rem;
    height: 0.94rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.63rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
    line-height: 1;
}
.fd-media-viewer-prev {
    left: 0.21rem;
}
.fd-media-viewer-next {
    right: 0.21rem;
}

/* 视频模式：底部滑动提示 */
.fd-media-viewer-hint {
    position: absolute;
    bottom: 0.84rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.28rem;
    z-index: 10;
    pointer-events: none;
}

/* PC 宽屏：bottom-nav 隐藏，清除移动端为底部导航预留的 padding-bottom */
@media (min-width: 1070px) {
    #scroll-root {
        padding-bottom: 0.3rem !important;
    }
    /* 卡片/内容区自适应父级框宽度：与首页一致，宽屏 96vw */
    .fd-container {
        max-width: 96vw;
    }
}
