/* 快手门头样式 —— 1:1 复刻原版快手小店店铺头卡（ShopCard）
   结构与数值来源：原版 RN web DOM 实测提取（_preview/_kwshot/shopcard_tree.txt + shopcard_all.css）
   说明：facade.php / index.php 内联 <style> 中残留旧版样式，
   统一使用 .ks-content 前缀（特异性 0,2,0）覆盖，无需改动页面模板 */

/* ===== 卡片容器（原版：白底 圆角12px margin 12px padding 12px 0 无阴影） ===== */
.ks-content .ks-header {
    background-color: #fff;
    margin: 8px 12px 12px;
    border-radius: 12px;
    box-shadow: none;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* 顶部背景图（本站自有头图，保留） */
.ks-content .ks-header-image {
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
}

.ks-content .ks-top-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== 卡片内容区 ===== */
.ks-content .ks-card {
    padding: 12px 0;
}

/* 第一行：头像 + 名字徽章 + 关注（原版 height 44px, padding 0 12px） */
.ks-content .ks-card-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
}

/* 头像 44×44 圆形（原版 border-radius 100px），margin-top 2px + 右 12px */
.ks-content .ks-avatar-box {
    width: 44px;
    height: 44px;
    border-radius: 100px;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
    margin-right: 12px;
    background: #f2f3f5;
}

.ks-content .ks-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 名字 + 徽章列（原版 flex:1 height 48px column） */
.ks-content .ks-id-column {
    flex: 1 1 0%;
    min-width: 0;
    height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.ks-content .ks-name-box {
    margin-top: 3px;
    max-width: 100%;
}

/* 店铺名（原版 17px/700/行高24px/#222，单行省略） */
.ks-content .ks-shop-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 24px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    max-width: 241px;
}

/* ===== 徽章行（原版 height 17px, flex wrap, margin-top 2px） ===== */
.ks-content .ks-badge-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    height: 17px;
    margin-top: 2px;
    overflow: hidden;
}

/* 企业角标（原版 30×16 图片） */
.ks-content .ks-tag-img {
    height: 16px;
    width: auto;
    display: block;
    margin-top: 1px;
}

/* 自定义文字标签（后台 shop_tag 配非"企业"文字时） */
.ks-content .ks-tag-text {
    font-size: 11px;
    font-weight: 500;
    color: #fe364d;
    border: 0.5px solid rgba(254, 54, 77, 0.16);
    border-radius: 2px;
    line-height: 15px;
    padding: 0 4px;
    background: #fff;
}

/* 店铺体验复合标签（原版：0.5px 红边框 圆角2px 高16px） */
.ks-content .ks-exp-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 16px;
    border: 0.5px solid rgba(254, 54, 77, 0.16);
    border-radius: 2px;
    overflow: hidden;
    margin-left: 4px;
}

/* 左段：白底"店铺体验" 11px/500/#fe364d */
.ks-content .ks-exp-label {
    background: #fff;
    color: #fe364d;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    padding: 0 4px;
    white-space: nowrap;
}

/* 右段：浅红底 rgba(254,54,77,.08)：星星 + 优秀 */
.ks-content .ks-exp-stars {
    background: rgba(254, 54, 77, 0.08);
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 16px;
    padding: 0 4px 0 1px;
    white-space: nowrap;
}

/* 星星 8×8 图片（原版 fullstar/halfstar.png，间距 2px） */
.ks-content .ks-star {
    width: 8px;
    height: 8px;
    margin-right: 2px;
    display: block;
}

.ks-content .ks-star-empty {
    opacity: 0.35;
}

.ks-content .ks-exp-good {
    color: #fe364d;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    margin-left: 2px;
}

/* ===== 关注按钮（原版容器宽 62px） ===== */
.ks-content .ks-follow-box {
    width: 62px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 10;
}

.ks-content .ks-follow-btn {
    background: #fe364d;
    color: #fff;
    border: none;
    border-radius: 13px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    height: 26px;
    line-height: 26px;
    white-space: nowrap;
    font-family: inherit;
}

.ks-content .ks-follow-btn.following {
    background: #cccccc;
}

/* ===== 虚线分隔（原版 line1.png 1px 高 margin-left 12px margin-top 8px） ===== */
.ks-content .ks-divider {
    height: 1px;
    margin-top: 8px;
    margin-left: 12px;
    background-image: url("/templates/kuaishou/img/ks-divider.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* ===== 数据行（原版 space-around margin-top 8px padding 0 16px） ===== */
.ks-content .ks-stats-row {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    margin-top: 8px;
    padding: 0 16px;
}

.ks-content .ks-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* 数字行（原版 margin-top -0.5px，数字 14px/500/#000/行高17px） */
.ks-content .ks-stat-num-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    margin-top: -0.5px;
}

.ks-content .ks-stat-num {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    line-height: 17px;
    white-space: nowrap;
}

/* 单位（原版"个作品"12px/500） */
.ks-content .ks-stat-unit {
    font-size: 12px;
    font-weight: 500;
    color: #000;
    line-height: 17px;
    white-space: nowrap;
}

/* 标签行（原版 margin-top 2px：11px/400/#000/行高15px，opacity 0.5） */
.ks-content .ks-stat-label-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 2px;
}

.ks-content .ks-stat-label {
    font-size: 11px;
    font-weight: 400;
    color: #000;
    line-height: 15px;
    opacity: 0.5;
    white-space: nowrap;
}

/* "个作品"后的灰色箭头（原版 10×10 图片图标） */
.ks-content .ks-stat-arrow {
    width: 10px;
    height: 10px;
    margin-left: 4px;
    opacity: 0.35;
    display: block;
}

/* 快手号橙色小图标（原版 10×10，margin-left 2px margin-top 5px） */
.ks-content .ks-ksid-icon {
    width: 10px;
    height: 10px;
    margin-left: 2px;
    margin-top: 5px;
    display: block;
}

/* ===== 遮罩层样式 ===== */
.ks-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.ks-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

.ks-overlay-content {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 12px 18px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#ks-overlay-message {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

/* 快手旗舰标签样式（旧有，保留） */
.ks-flagship-tag {
    display: inline-block;
    background-color: #1f0846;
    color: #cbd76a !important;
    font-size: 11px;
    padding: 0px 3px;
    border-radius: 2px;
    margin-right: 4px;
    font-weight: bold;
}
