/* ==========================================================================
   十香主题增强（插件注入）
   只作用于电脑端；手机端一律保持主题原样。所有改动都在前端完成，不动主题文件。
   ========================================================================== */

/* 插件界面统一用思源黑体（字体文件随插件打包在 intro-kit/fonts/，不依赖访客电脑是否安装） */
@font-face {
    font-family: "Noto Sans SC";
    src: url("intro-kit/fonts/NotoSansSC-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Noto Sans SC";
    src: url("intro-kit/fonts/NotoSansSC-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Noto Sans SC";
    src: url("intro-kit/fonts/NotoSansSC-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

.tkx-preview-stage,
.tkx-preview-stage *,
.tk-notice-pop-body,
.tk-notice-pop-body * {
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 通用：隐藏 */
.tkx-hide {
    display: none !important;
}

/* 顶部登录入口（插件配置「隐藏登录」开启时由 enhance.js 给 html 加类） */
.tkx-hide-login .tk-balance-login {
    display: none !important;
}

/* ---------- 一、商品列表：整行可点 ---------- */
@media (min-width: 992px) {
    .shop-content .item {
        cursor: pointer;
    }
}

/* ---------- 二、商品弹窗：左右两栏 ---------- */
@media (min-width: 992px) {
    /* 内容区整体不再滚动，改成左右两栏各自滚动 */
    .layui-layer.tkx-layer .layui-layer-content {
        max-height: min(90vh, 1000px);
        overflow: hidden;
    }

    .open-commodity.tkx-on {
        display: flex;
        align-items: flex-start;
        gap: 28px;
        padding: 26px 30px 24px;
    }

    .open-commodity.tkx-on .tkx-left {
        max-height: calc(min(90vh, 1000px) - 56px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .open-commodity.tkx-on .tkx-right .commodity-di,
    .open-commodity.tkx-on .tkx-left {
        overscroll-behavior: contain;
    }

    .open-commodity.tkx-on .tkx-left {
        flex: 1 1 54%;
        min-width: 0;
        padding-right: 8px;
    }

    .open-commodity.tkx-on .tkx-right {
        flex: 1 1 46%;
        min-width: 0;
        max-height: calc(min(90vh, 1000px) - 56px);
        display: flex;
        flex-direction: column;
        padding: 16px 16px 12px;
        border: 1px solid var(--tk-hairline, rgba(120, 120, 120, .18));
        border-radius: var(--tk-radius-xl, 18px);
        background: var(--tk-glass-raised, #fff);
        box-shadow: var(--tk-shadow-near, 0 8px 24px rgba(0, 0, 0, .06));
        overflow: hidden;
    }

    .open-commodity.tkx-on .tkx-right .commodity-di {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .open-commodity.tkx-on .tkx-right .pay-content {
        flex: 0 0 auto;
    }

    /* 左栏只有商品名和商品介绍 */
    .open-commodity.tkx-on .commodity_name {
        margin: 0 0 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--tk-hairline, rgba(120, 120, 120, .18));
        text-align: left;
        font-size: 1.3rem;
    }

    .open-commodity.tkx-on .description {
        font-size: .86rem;
        line-height: 1.9;
    }

    /* 右栏：收紧间距，付款区紧跟内容 */
    .open-commodity.tkx-on .commodity-di {
        padding: 0;
    }

    .open-commodity.tkx-on .commodity-di .general {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
    }

    /* 宝贝类型：标签保持一行，选项整颗换行，不要把「宝贝类型」挤成一字一行。 */
    .open-commodity.tkx-on .commodity-di .race-view {
        align-items: center;
        white-space: nowrap;
    }

    .open-commodity.tkx-on .commodity-di .race-view > span {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: wrap;
        align-items: center;
        min-width: 0;
        gap: 8px;
    }

    .open-commodity.tkx-on .commodity-di .race-view .sku-race {
        flex: 0 0 auto;
        margin: 0 !important;
    }

    /* 宝贝类型下方说明：彩色一句，不要方框背景 */
    .open-commodity.tkx-on .tkx-race-tip {
        margin: 0 0 12px;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        color: var(--tk-accent, #0a84ff);
        font-size: 0.78rem;
        line-height: 1.7;
        white-space: normal;
        word-break: break-word;
    }

    /* 查询密码下方说明：淡一点，不要方框，也不要动输入框样式 */
    .open-commodity.tkx-on .tkx-password-tip {
        margin: -4px 0 12px;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        color: var(--tk-text-dim, #666);
        font-size: 0.76rem;
        line-height: 1.7;
        white-space: normal;
        word-break: break-word;
    }

    /* 没开预选卡密时，系统会把数字 0 写进这一行。主题本来藏着，不要在这里再显示出来。 */
    .open-commodity.tkx-on .draft_status {
        display: none;
    }

    .open-commodity.tkx-on .commodity-di .acg-input {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        background: #fff !important;
        border: 1px solid rgba(20, 20, 20, .18) !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        color: #141414 !important;
        border-radius: 10px !important;
    }

    .open-commodity.tkx-on .commodity-di .acg-input:focus {
        border-color: var(--tk-accent, #0a84ff) !important;
        outline: none;
    }

    .open-commodity.tkx-on .pay-content {
        margin-top: 16px;
        padding-top: 14px;
    }

    /* 两栏的滚动条做细一点 */
    .open-commodity.tkx-on .tkx-left::-webkit-scrollbar,
    .open-commodity.tkx-on .tkx-right::-webkit-scrollbar {
        width: 6px;
    }

    .open-commodity.tkx-on .tkx-left::-webkit-scrollbar-thumb,
    .open-commodity.tkx-on .tkx-right::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(120, 120, 120, .28);
    }
}

/* 窄屏：回到主题的单栏 */
@media (max-width: 991.98px) {
    .open-commodity.tkx-on {
        display: block;
    }

    .open-commodity.tkx-on .tkx-right {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--tk-hairline, rgba(120, 120, 120, .18));
    }
}

/* ---------- 三、公告卡片：取消 / 我已阅读 ---------- */
.tk-notice-modal {
    display: flex;
    flex-direction: column;
    min-height: 230px;
}

.tk-notice-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 22px 14px;
    border-bottom: 1px solid var(--tk-hairline, rgba(120, 120, 120, .18));
    color: var(--tk-text, #222);
    font-size: 1rem;
    font-weight: 700;
}

.tk-notice-head .fa {
    color: var(--tk-accent, #0a84ff);
    font-size: 1.05rem;
}

.layui-layer:has(.tk-notice-modal),
.layui-layer:has(.tk-notice-modal) .layui-layer-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.tk-notice-content {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 18px 22px;
    color: var(--tk-text-dim, #555);
    font-size: 0.9rem;
    line-height: 1.9;
}

.tk-notice-content img {
    max-width: 100%;
    height: auto;
}

.tk-notice-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 4px 22px 10px;
}

.tk-notice-btn {
    min-width: 88px;
    padding: 8px 20px;
    border: 1px solid var(--tk-hairline, rgba(120, 120, 120, .22));
    border-radius: 999px;
    background: var(--tk-glass-control, #fff);
    color: var(--tk-text, #222);
    font-size: 0.86rem;
    font-weight: 650;
    cursor: pointer;
}

.tk-notice-confirm {
    border-color: transparent;
    background: var(--tk-accent, #0a84ff);
    color: #fff;
}

.tk-notice-hint {
    padding: 0 22px 16px;
    color: var(--tk-text-faint, #888);
    font-size: 0.74rem;
    text-align: right;
}

/* ---------- 四、商品介绍大图预览 ---------- */
/* 主题把 page 层内容区限成 76vh，大图层高按原图写死时图下会空一大块；这里跟图收紧。 */
.layui-layer.tkx-img-preview {
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.layui-layer.tkx-img-preview .layui-layer-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
}

.tkx-preview-stage {
    position: relative;
    display: block;
    line-height: 0;
}

.layui-layer.tkx-img-preview .tkx-preview-img {
    display: block;
    border-radius: 20px;
    max-width: none;
    vertical-align: top;
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

/* 绝对定位，不占层高，避免把预览层撑出空白 */
.tkx-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(20, 20, 20, .62);
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}

.tkx-preview-close:hover {
    background: rgba(20, 20, 20, .82);
}

/* 悬浮在图片下方中间，不撑高内容区 */
.tkx-preview-toolbar {
    position: absolute;
    left: 50%;
    bottom: -52px;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(-50%);
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(20, 20, 20, .72);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    line-height: 1;
    white-space: nowrap;
    pointer-events: auto;
}

.tkx-preview-btn {
    margin: 0;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.tkx-preview-btn:hover {
    background: rgba(255, 255, 255, .22);
}

.tkx-preview-scale {
    min-width: 52px;
    padding: 0 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
}

/* ---------- 五、整页介绍（iframe） ---------- */
/* 高度由 enhance.js 按介绍页实际内容设置；框本身不滚动，左栏只留一个滚动条 */
.description iframe.tkx-intro-frame {
    display: block;
    width: 100% !important;
    max-width: 100%;
    border: 0 !important;
    border-radius: 14px;
    background: transparent !important;
    overflow: hidden;
}

/* 左栏滚动更顺：独立合成层，避免跟右栏、背景毛玻璃一起重绘 */
@media (min-width: 992px) {
    .open-commodity.tkx-on .tkx-left {
        scrollbar-width: thin;
        scrollbar-color: rgba(120, 120, 120, .35) transparent;
        will-change: scroll-position;
        -webkit-overflow-scrolling: touch;
    }
}
