@charset "utf-8";
/* ==========================================================================
   抖店中转页 —— 移动端自适应样式
   设计：浅色卡片流，抖音红点缀，750px 设计稿等比缩放，PC 上居中显示
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
    --dy-red: #fe2c55;        /* 抖音品牌红，用于主按钮和价格 */
    --dy-red-dark: #e01e43;
    --ink: #161823;           /* 主文字 */
    --ink-2: #4a4b53;         /* 次要文字 */
    --ink-3: #8a8b95;         /* 辅助文字 */
    --line: #eeeef2;          /* 分割线 */
    --bg: #f5f6f8;            /* 页面背景 */
    --card: #ffffff;
    --warn: #ff9500;          /* 微信提示 */
    --ok: #00b578;            /* 可直接唤起 */
    --radius: 14px;
    --shadow: 0 2px 12px rgba(22, 24, 35, .06);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    /* 宽屏时于右侧/左下铺一层极淡渐变，弱化大留白，不影响文字可读性 */
    background-image:
        radial-gradient(1100px 620px at 88% -8%, rgba(254, 44, 85, .07), transparent 60%),
        radial-gradient(900px 520px at 4% 112%, rgba(22, 24, 35, .045), transparent 55%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    /* 移动端禁止横向滚动 */
    overflow-x: hidden;
}

img { display: block; max-width: 100%; border: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* 页面主容器：移动端满宽，PC 上限制宽度居中 */
.app {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    /* dvh 适配移动端浏览器地址栏伸缩，比 100vh 更可靠 */
    min-height: 100dvh;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ==========================================================================
   环境提示条
   ========================================================================== */
.env-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.45;
}
.env-bar .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.env-bar--warn { background: #fff7e8; color: #a35a00; }
.env-bar--ok   { background: #e9f9f2; color: #00795a; }
.env-bar b { font-weight: 600; }

/* ==========================================================================
   店铺卡片
   ========================================================================== */
.shop-card {
    margin: 12px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.shop-top { display: flex; align-items: center; gap: 12px; }

.shop-logo {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
    border: 1px solid var(--line);
}

.shop-meta { flex: 1; min-width: 0; }
.shop-name {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    /* 单行截断 */
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.shop-slogan {
    margin: 0;
    font-size: 12px;
    color: var(--ink-3);
    /* 最多两行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-stats {
    display: flex;
    gap: 18px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}
.shop-stat { text-align: center; }
.shop-stat .num { font-size: 16px; font-weight: 700; color: var(--ink); }
.shop-stat .lbl { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* 进入店铺按钮 */
.shop-enter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 44px;
    margin-top: 14px;
    border: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, #ff4d6a, var(--dy-red));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(254, 44, 85, .28);
}
.shop-enter:active { transform: scale(.985); }

/* ==========================================================================
   区块标题
   ========================================================================== */
.section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 10px;
}
.section .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--dy-red); }
.section .txt { font-size: 15px; font-weight: 700; }
.section .more { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* ==========================================================================
   商品网格
   ========================================================================== */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 12px;
}

.goods-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    /* 整卡可点击，用 a 标签包裹，兼顾无障碍与长按复制 */
    display: block;
    position: relative;
}
.goods-card:active { transform: scale(.99); }

.g-img-wrap { position: relative; width: 100%; padding-top: 100%; background: var(--bg); }
.g-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
/* 左上角角标 */
.g-tag {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 7px;
    border-radius: 4px;
    background: linear-gradient(135deg, #ff4d6a, var(--dy-red));
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.g-body { padding: 10px 10px 12px; }

.g-title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
    height: 36.4px;              /* 两行高度，避免卡片参差 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.g-sub {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--ink-3);
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

.g-price { display: flex; align-items: baseline; gap: 4px; color: var(--dy-red); }
.g-price .sym { font-size: 12px; font-weight: 600; }
.g-price .int { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.g-price .dec { font-size: 12px; font-weight: 600; }
.g-price .origin {
    margin-left: 4px;
    font-size: 11px;
    color: var(--ink-3);
    text-decoration: line-through;
}

.g-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
.g-sales { font-size: 11px; color: var(--ink-3); }
.g-btn {
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(254, 44, 85, .1);
    color: var(--dy-red);
    font-size: 11px;
    font-weight: 600;
}

/* 空状态 */
.empty {
    margin: 40px 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--ink-3);
    background: var(--card);
    border-radius: var(--radius);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* 底部说明 */
.footer {
    margin-top: 20px;
    padding: 0 20px 10px;
    text-align: center;
    font-size: 11px;
    color: var(--ink-3);
    line-height: 1.6;
}

/* ==========================================================================
   商品详情页
   ========================================================================== */
.detail-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bg);
}
.detail-box {
    margin: -20px 12px 12px;      /* 上移压住图片，形成卡片叠层效果 */
    position: relative;
    padding: 18px 16px;
    background: var(--card);
    border-radius: 16px 16px var(--radius) var(--radius);
    box-shadow: var(--shadow);
}
.detail-title { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.4; }
.detail-sub { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.detail-price { display: flex; align-items: baseline; gap: 6px; color: var(--dy-red); }
.detail-price .sym { font-size: 15px; font-weight: 600; }
.detail-price .int { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.detail-price .dec { font-size: 15px; font-weight: 600; }
.detail-price .origin { font-size: 12px; color: var(--ink-3); text-decoration: line-through; }

.detail-rows { margin-top: 16px; border-top: 1px solid var(--line); }
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 11px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
}
.detail-row .k { color: var(--ink-3); }
.detail-row .v { color: var(--ink-2); text-align: right; }

/* 底部固定操作条 */
.action-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    display: flex;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
}
.btn {
    flex: 1;
    height: 46px;
    border: 0;
    border-radius: 23px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-primary { background: linear-gradient(135deg, #ff4d6a, var(--dy-red)); color: #fff; }
.btn-primary:active { background: var(--dy-red-dark); }
.btn-ghost {
    flex: none;
    width: 110px;
    background: #f2f3f5;
    color: var(--ink-2);
}

/* 有固定操作条时给内容留出空间 */
.has-action-bar { padding-bottom: 80px; }

/* ==========================================================================
   微信引导遮罩
   ========================================================================== */
.mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .74);
    display: none;
    color: #fff;
}
.mask.show { display: block; }

/* 指向右上角的箭头 */
.mask-arrow {
    position: absolute;
    top: 8px;
    right: 22px;
    width: 66px;
    animation: floatY 1.4s ease-in-out infinite;
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.mask-tip {
    margin: 96px 24px 0;
    text-align: center;
    font-size: 15px;
    line-height: 1.9;
}
.mask-tip .step {
    display: inline-block;
    margin: 0 4px;
    padding: 1px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .16);
    font-weight: 600;
}
.mask-actions { margin-top: 28px; padding: 0 32px; }
.mask-close {
    display: block;
    width: 100%;
    height: 44px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 22px;
    background: transparent;
    color: #fff;
    font-size: 15px;
}
.mask-copy {
    display: block;
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 22px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}

/* ==========================================================================
   唤起结果 / 降级弹层
   ========================================================================== */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
}
.modal-mask.show { display: flex; }

.modal {
    width: 100%;
    max-width: 640px;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 18px 18px 0 0;
    animation: slideUp .22s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p  { margin: 0 0 16px; font-size: 13px; color: var(--ink-3); }
.modal-list { display: flex; flex-direction: column; gap: 10px; }
.modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #f7f8fa;
    font-size: 14px;
}
.modal-item .t { flex: 1; }
.modal-item .t small { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); }
.modal-item .go { color: var(--ink-3); font-size: 16px; }
.modal-cancel {
    width: 100%;
    height: 44px;
    margin-top: 14px;
    border: 0;
    border-radius: 22px;
    background: #f2f3f5;
    color: var(--ink-2);
    font-size: 15px;
}

/* 唤起中提示 */
.launching {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .92);
    flex-direction: column;
    gap: 14px;
    font-size: 14px;
    color: var(--ink-2);
}
.launching.show { display: flex; }

.spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--line);
    border-top-color: var(--dy-red);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   轻提示 Toast
   ========================================================================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    z-index: 200;
    transform: translate(-50%, 10px);
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(22, 24, 35, .88);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   截图展示模式（showcase）
   ========================================================================== */
.showcase {
    margin: 0 12px 12px;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.showcase-img {
    display: block;
    width: 100%;
    height: auto;
    /* 让长截图在容器里完整显示，不被裁切 */
    object-fit: contain;
    background: #f2f3f5;
}
.showcase-cap {
    margin: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    font-size: 13px;
    color: var(--ink-3);
    text-align: center;
    border-top: 1px solid var(--line);
}

/* 底部固定操作条（截图模式专用，避免与内容重叠） */
.sticky-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    max-width: 640px;
    margin: 0 auto;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
}
.sticky-bar .btn { width: 100%; flex: none; }

/* ==========================================================================
   唤起落地页（/go/shop、/go/goods/:id）
   ========================================================================== */
.go-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 32px 24px;
    text-align: center;
}
.go-logo {
    width: 68px; height: 68px;
    border-radius: 18px;
    object-fit: cover;
    background: #fff;
    box-shadow: var(--shadow);
}
.go-title { margin: 18px 0 6px; font-size: 18px; font-weight: 700; }
.go-desc  { margin: 0 0 28px; font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.go-card {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.go-card .row {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.go-card .row:last-child { border-bottom: 0; }
.go-card .row img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.go-card .row .m { flex: 1; min-width: 0; }
.go-card .row .m .n {
    font-size: 14px; font-weight: 500;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.go-card .row .m .p { margin-top: 4px; color: var(--dy-red); font-size: 14px; font-weight: 700; }

.go-actions { width: 100%; max-width: 420px; margin-top: 20px; }

/* ==========================================================================
   响应式：小屏微调
   ========================================================================== */
@media (max-width: 360px) {
    .goods-grid { gap: 8px; padding: 0 8px; }
    .shop-card { margin: 10px 8px; }
    .g-title { font-size: 12px; }
    .g-price .int { font-size: 16px; }
}

/* ==========================================================================
   宽屏布局：右侧装饰栏（仅在较宽屏幕显示，移动端自动隐藏）
   - 不影响原有 .app 内容，仅在其右侧并列一块信息/装饰栏
   - 移动端（≤860px）恢复单列，.side 隐藏
   ========================================================================== */
.page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 22px;
    max-width: 1040px;
    margin: 0 auto;
    padding: 22px 16px 0;
}
.page > .app {
    flex: none;
    width: 420px;       /* 桌面下略收窄，给右侧留空间 */
    margin: 0;          /* 取消自身居中，交由 .page 统一居中 */
}

.side {
    flex: 1 1 auto;
    max-width: 340px;
    position: sticky;
    top: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.side-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 16px;
    position: relative;
    overflow: hidden;
}

/* ---------- 品牌装饰卡（渐变 + 几何点缀） ---------- */
.side-hero {
    background: linear-gradient(150deg, #ff5b76, var(--dy-red) 72%);
    color: #fff;
    text-align: center;
    padding: 26px 18px 22px;
}
.hero-ring {
    position: absolute;
    right: -34px; top: -34px;
    width: 130px; height: 130px;
    border: 18px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
}
.hero-dot { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.hero-dot--1 { width: 70px; height: 70px; left: -22px; bottom: -22px; }
.hero-dot--2 { width: 36px; height: 36px; right: 32px; bottom: 22px; background: rgba(255, 255, 255, .12); }

.hero-logo {
    width: 54px; height: 54px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .18);
    display: flex; align-items: center; justify-content: center;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.hero-logo svg { width: 30px; height: 30px; display: block; }
.hero-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.hero-sub { margin: 0 0 14px; font-size: 12.5px; line-height: 1.7; opacity: .92; }
.hero-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.hero-tags span {
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .18);
    font-size: 11px; font-weight: 600;
}

/* ---------- 侧栏小标题（复用红色竖条） ---------- */
.side-h {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
    font-size: 14px; font-weight: 700; color: var(--ink);
}
.side-h .bar { width: 3px; height: 14px; border-radius: 2px; background: var(--dy-red); }

/* ---------- 承诺列表 ---------- */
.promise { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.promise li { display: flex; align-items: center; gap: 12px; }
.p-ico {
    flex: none; width: 38px; height: 38px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(254, 44, 85, .1);
    color: var(--dy-red);
}
.p-ico svg { width: 20px; height: 20px; display: block; }
.promise li b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.promise li small { display: block; margin-top: 1px; font-size: 11px; color: var(--ink-3); }

/* ---------- 步骤列表 ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 12px; }
.step-n {
    flex: none; width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4d6a, var(--dy-red));
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.steps li b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.steps li small { display: block; margin-top: 1px; font-size: 11px; color: var(--ink-3); }

/* ---------- 窄屏 / 移动端：恢复单列，隐藏侧栏 ---------- */
@media (max-width: 860px) {
    .page { display: block; padding: 0; max-width: 100%; }
    .page > .app { width: 100%; max-width: 640px; margin: 0 auto; }
    .side { display: none; }
}
