/* Toka mobile presentation. Every rule is confined to the native phone breakpoint. */
@media screen and (max-width: 767.98px) {
    body.tk-body {
        --tk-mobile-blue: #2563eb;
        --tk-mobile-ink: #17243a;
        --tk-mobile-line: #e5ebf4;
        /* Mobile cards stay light even when the device requests dark mode. */
        --tk-text: #17243a;
        --tk-text-dim: #52637d;
        --tk-text-faint: #708099;
        background: #f2f6fd !important;
        color: var(--tk-mobile-ink);
    }

    .tk-body .tk-backdrop { display: none; }
    .tk-body .tk-nav-shell {
        position: sticky;
        top: 0;
        z-index: 70;
        padding: 0;
        transition: transform .24s ease;
    }
    .tk-body.tk-mobile-nav-hidden .tk-nav-shell {
        transform: translateY(calc(-100% - 8px));
        pointer-events: none;
    }
    .tk-body .tk-nav-shell > .container,
    .tk-body .tk-main > .container { max-width: none; padding: 0 8px; }
    .tk-body .tk-nav {
        gap: 5px;
        padding: 7px 8px;
        border: 1px solid var(--tk-mobile-line);
        border-radius: 0 0 13px 13px;
        background: #fff !important;
        box-shadow: 0 5px 18px rgba(30, 52, 86, .08) !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .tk-body .tk-brand { flex: 1 1 60%; padding: 2px 4px; }
    .tk-body .tk-brand-avatar { width: 30px; height: 30px; border-radius: 8px; }
    .tk-body .tk-brand-name { max-width: 58vw; font-size: 14px; font-weight: 800; }
    .tk-body .tk-balance { margin-left: auto; min-height: 32px; padding: 5px 10px; font-size: 12px; }
    .tk-body .tk-nav-links {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 4px;
        width: 100%;
        margin: 2px 0 0;
    }
    .tk-body .tk-nav-links > .tk-nav-link {
        grid-column: span 3;
        min-height: 34px;
        padding: 6px 3px;
        justify-content: center;
        font-size: 11px;
    }
    .tk-body .tk-nav-links > .tk-nav-link:first-child { background: #17243a; color: #fff; }
    .tk-body .tk-nav-links > .tk-mobile-contact,
    .tk-body .tk-nav-links > .tk-mobile-menu-trigger,
    .tk-body .tk-nav-links > .tk-mobile-tg {
        grid-column: span 4;
        min-height: 38px;
        background: #eef4ff;
        color: #245cc5;
        font-weight: 750;
        white-space: normal;
    }
    .tk-body .tk-nav-links > .tk-mobile-agent {
        grid-column: 1 / -1;
        min-height: 40px;
        border: 1px solid #cbdcfb;
        background: linear-gradient(120deg, #eff5ff, #e2efff);
        color: #245cc5;
        font-size: 12px;
        font-weight: 800;
    }
    .tk-body .tk-nav-links > [data-tk-notice],
    .tk-body .tk-nav-links > .tk-lang { display: none !important; }
    .tk-body .tk-nav-links > .tk-pop { display: none; }
    .tk-body .tk-nav-links .tk-icon-btn,
    .tk-body .tk-lang-toggle { width: 100%; justify-content: center; }

    .tk-body .tk-mobile-nav-drawer:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 1000000;
        display: flex;
        justify-content: flex-end;
    }
    .tk-body .tk-mobile-nav-mask {
        position: absolute;
        inset: 0;
        width: 100%;
        border: 0;
        background: rgba(15, 28, 48, .5);
    }
    .tk-body .tk-mobile-nav-panel {
        position: relative;
        width: min(84vw, 340px);
        height: 100%;
        background: #fff;
        box-shadow: -18px 0 38px rgba(10, 28, 57, .18);
    }
    .tk-body .tk-mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        border-bottom: 1px solid var(--tk-mobile-line);
        color: var(--tk-mobile-ink);
        font-size: 17px;
    }
    .tk-body .tk-mobile-nav-close {
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 50%;
        background: #f2f5fa;
        color: var(--tk-mobile-ink);
        font-size: 27px;
        line-height: 1;
    }
    .tk-body .tk-mobile-nav-empty { padding: 20px 14px; color: #65758e; font-size: 13px; }

    .tk-body .tk-main { padding-top: 0; }
    .tk-body .tk-mobile-hero:not([hidden]) {
        display: block;
        margin: 8px 0 10px;
        padding: 12px;
        border-radius: 12px;
        background: linear-gradient(130deg, #203b69, #3473d7);
        box-shadow: 0 10px 24px rgba(28, 77, 150, .16);
    }
    .tk-body .tk-mobile-hero-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; color: #fff; }
    .tk-body .tk-mobile-hero-title strong { font-size: 18px; line-height: 1.3; }
    .tk-body .tk-mobile-hero-title span { font-size: 11px; color: #dbeaff; }
    .tk-body [data-tk-mobile-notice-slot] > .col-12 { flex: none; max-width: none; padding: 0; margin: 9px 0 0; }
    .tk-body .tk-mobile-hero .tk-notice-card {
        margin: 0;
        border: 1px solid rgba(255,255,255,.28);
        border-radius: 9px;
        background: #fff !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .tk-body .tk-mobile-hero .tk-notice-card .card-header { min-height: 32px; padding: 7px 10px 4px !important; }
    .tk-body .tk-mobile-hero .tk-notice-card .card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .tk-body .tk-mobile-hero .tk-notice-scroll-toggle {
        flex: none; border: 1px solid #cbdcf5; border-radius: 8px;
        background: #edf4ff; color: #245ca7; padding: 3px 9px;
        font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
    }
    .tk-body .tk-mobile-hero .tk-notice-scroll-toggle[hidden] { display: none; }
    .tk-body .tk-mobile-hero .tk-notice-card .card-title { margin: 0; font-size: 12px; font-weight: 800; }
    .tk-body .tk-mobile-hero .tk-notice-prose {
        max-height: 94px;
        overflow-y: auto;
        padding: 4px 10px 9px !important;
        color: #34455f;
        font-size: 12px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }
    .tk-body .tk-mobile-hero .tk-notice-prose * {
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }
    .tk-body .tk-mobile-hero .tk-notice-prose > :last-child { margin-bottom: 0; }
    .tk-body .tk-mobile-search {
        display: flex;
        align-items: center;
        gap: 7px;
        min-height: 42px;
        margin-top: 9px;
        padding: 4px 5px 4px 10px;
        border-radius: 9px;
        background: #fff;
    }
    .tk-body .tk-mobile-search > i { color: var(--tk-mobile-blue); }
    .tk-body .tk-mobile-search input {
        flex: 1 1 auto;
        min-width: 0;
        padding: 5px 2px;
        border: 0;
        outline: 0;
        color: var(--tk-mobile-ink);
        background: transparent;
        font-size: 12px;
    }
    .tk-body .tk-mobile-search button {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 0 11px;
        border: 0;
        border-radius: 7px;
        background: #17243a;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
    }
    .tk-body .tk-mobile-quicklinks { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; color: #eaf3ff; font-size: 11px; }
    .tk-body .tk-mobile-quicklinks a { color: inherit; text-decoration: none; }

    .tk-body .tk-row { margin-left: -8px; margin-right: -8px; row-gap: 0; }
    .tk-body .tk-row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }
    .tk-body .tk-row .glass-card {
        margin-bottom: 10px;
        border: 1px solid var(--tk-mobile-line);
        border-radius: 10px;
        background: #fff !important;
        box-shadow: 0 4px 15px rgba(30, 52, 86, .055) !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .tk-body .tk-row .glass-card .card-header { min-height: 42px; padding: 10px 11px !important; }
    .tk-body .tk-row .glass-card .card-title { margin: 0; color: var(--tk-mobile-ink); font-size: 14px; font-weight: 800; }
    .tk-body .tk-row .glass-card .card-title i { color: var(--tk-mobile-blue); }
    .tk-body .tk-row .glass-card .card-block { padding: 7px 8px 9px !important; }

    .tk-body .tk-row > .shop-html > .glass-card { margin-top: 0; }
    .tk-body .shop-html > .glass-card > .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 54px;
        padding: 8px 11px !important;
    }
    .tk-body .shop-html > .glass-card > .card-header .card-title { min-width: 0; }

    .tk-body .category-list { max-height: 260px; overflow-y: auto; margin: 0; }
    .tk-body .tk-cat-tree { display: block; }
    .tk-body .tk-cat-row {
        min-height: 42px;
        margin: 0;
        padding: 7px 8px;
        border-radius: 7px;
        color: var(--tk-mobile-ink);
        font-size: 12px;
        font-weight: 700;
    }
    .tk-body .tk-cat-row:hover,
    .tk-body .tk-cat-row.checked { background: #eef4ff; color: #1d4ed8 !important; }
    .tk-body .tk-cat-row .commodity-icon {
        width: 30px;
        height: 30px;
        margin-right: 5px;
        padding: 2px;
        border: 1px solid #b7d4fb;
        border-radius: 8px;
        background: linear-gradient(135deg, #dbeafe, #e0e7ff, #cffafe);
        box-shadow: 0 0 0 2px rgba(99, 102, 241, .10);
    }
    .tk-body .tk-cat-children { margin-left: 20px; padding-left: 8px; border-left: 1px solid #dce7f8; }
    .tk-body .tk-cat-children .tk-cat-row { min-height: 38px; font-size: 11.5px; }
    .tk-body .tk-cat-children .commodity-icon { width: 22px; height: 22px; }
    .tk-body .tk-cat-count:not(.is-zero) {
        min-width: 23px;
        padding: 2px 5px;
        border-radius: 999px;
        background: #edf2f9;
        text-align: center;
    }
    .tk-body .tk-cat-count.is-zero { opacity: 0; }
    .tk-body .tk-cat-row:focus-visible,
    .tk-body .tk-mobile-category-trigger:focus-visible,
    .tk-body .tk-mobile-search button:focus-visible { outline: 2px solid var(--tk-mobile-blue); outline-offset: 2px; }
    .tk-body .tk-mobile-category-trigger:not([hidden]) {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 36px;
        margin-left: auto;
        padding: 6px 13px;
        border: 1px solid #7999f2;
        border-radius: 999px;
        background: linear-gradient(120deg, #2563eb 0%, #4f46e5 60%, #7c3aed 100%);
        box-shadow: 0 3px 10px rgba(79, 70, 229, .20), 0 0 0 2px #e4eaff;
        color: #fff;
        font-size: 12px;
        font-weight: 800;
        white-space: nowrap;
    }

    .tk-body .shop-content { min-height: 160px; }
    .tk-body .shop-content .layui-table,
    .tk-body .shop-list { display: block; width: 100%; margin: 0; }
    .tk-body .shop-content .layui-table .head { display: none; }
    .tk-body .shop-content .item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        gap: 1px 7px;
        min-height: 66px;
        padding: 8px 6px;
        border-bottom: 1px solid var(--tk-mobile-line);
        background: #fff;
    }
    .tk-body .shop-content .item:nth-child(even) { background: #f9fbff; }
    .tk-body .shop-content .item:last-child { border-bottom: 0; }
    .tk-body .shop-content .item td { display: block; width: auto; padding: 0; border: 0; background: transparent; }
    .tk-body .shop-content .item td:first-child {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: 12.5px;
        font-weight: 750;
        line-height: 1.3;
    }
    .tk-body .shop-content .item td:first-child .commodity-icon { float: left; width: 31px; height: 31px; margin: 0 7px 3px 0; }
    .tk-body .shop-content .item td:nth-child(2) { grid-column: 2; grid-row: 1; align-self: center; color: #e5485f; font-size: 13px; font-weight: 800; }
    .tk-body .shop-content .item td:nth-child(3) { grid-column: 1; grid-row: 2; align-self: end; color: #65758e; font-size: 11px; text-align: left; }
    .tk-body .shop-content .item td:nth-child(3)::before { content: '库存：'; }
    .tk-body .shop-content .item td:nth-child(4) { grid-column: 2; grid-row: 2; align-self: end; }
    .tk-body .shop-content .item td:nth-child(4) a {
        min-height: 29px;
        padding: 5px 11px;
        border-radius: 999px;
        background: #17243a;
        color: #fff;
        font-size: 11px;
        box-shadow: none;
    }
    .tk-body .shop-content .item td:nth-child(4) a:hover { background: #2563eb; color: #fff; }
    .tk-body .shop-content .keguan { padding: 45px 12px; color: #77859a; text-align: center; font-size: 13px; }

    .tk-body .open-commodity { padding: 16px 13px 22px; background: #fff; }
    .tk-body .open-commodity .commodity_name { font-size: 17px; text-align: left; overflow-wrap: anywhere; }
    .tk-body .open-commodity .description { overflow-wrap: anywhere; }
    .tk-body .open-commodity .description img { max-width: 100%; height: auto; }
    .tk-body .open-commodity .general { font-size: 12px; line-height: 1.6; }
    .tk-body .open-commodity .acg-input { max-width: 100%; }
    .tk-body .open-commodity .purchase_num,
    .tk-body .open-commodity .captcha-input { width: 92px !important; }
    .tk-body .open-commodity .race-click { min-height: 34px; margin: 0 6px 6px 0; padding: 7px 10px; }
    .tk-body .open-commodity .pay_list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tk-body .open-commodity .pay-button { min-height: 48px; margin: 0; padding: 8px; justify-content: center; text-align: center; white-space: normal; }

    /* The native page layer fills the phone viewport. Its desktop 76vh content
       cap must not leave an empty layer below the purchase form on mobile. */
    .tk-body .tk-commodity-layer.layui-layer-page {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        display: flex !important;
        flex-direction: column;
        box-sizing: border-box;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        overflow: hidden;
        border: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .tk-body .tk-commodity-layer .layui-layer-title {
        flex: 0 0 auto;
        box-sizing: border-box;
        height: auto !important;
        min-height: 52px;
        padding: 13px 52px 13px 16px;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: anywhere;
        background: #fff !important;
    }
    .tk-body .tk-commodity-layer .layui-layer-setwin {
        top: 4px;
        right: 8px;
    }
    .tk-body .tk-commodity-layer .layui-layer-setwin .layui-layer-close1 {
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        margin: 0;
        border-radius: 50%;
        background: transparent;
        color: var(--tk-mobile-ink);
        font-size: 32px;
        line-height: 40px;
        text-align: center;
        text-decoration: none;
    }
    .tk-body .tk-commodity-layer .layui-layer-setwin .layui-layer-close1::before { content: '\00d7'; }
    .tk-body .tk-commodity-layer .layui-layer-setwin .layui-layer-close1:focus-visible {
        outline: 2px solid var(--tk-mobile-blue);
        outline-offset: 2px;
    }
    .tk-body .tk-commodity-layer .layui-layer-content {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        max-height: none !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        border-radius: 0 !important;
        background: #fff;
    }
    .tk-body .tk-commodity-layer .layui-layer-title + .layui-layer-content .commodity_name { display: none; }

    .tk-body .tk-mobile-category-drawer:not([hidden]) { position: fixed; inset: 0; z-index: 1000000; display: block; }
    .tk-body .tk-mobile-drawer-mask { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(15, 28, 48, .5); }
    .tk-body .tk-mobile-drawer-panel {
        position: absolute;
        top: 0; bottom: 0; left: 0;
        display: flex;
        flex-direction: column;
        width: min(84vw, 340px);
        background: #fff;
        box-shadow: 18px 0 38px rgba(10, 28, 57, .18);
    }
    .tk-body .tk-mobile-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 12px 10px; border-bottom: 1px solid var(--tk-mobile-line); }
    .tk-body .tk-mobile-drawer-head div { display: flex; flex-direction: column; }
    .tk-body .tk-mobile-drawer-head small { color: #70839e; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
    .tk-body .tk-mobile-drawer-head strong { color: var(--tk-mobile-ink); font-size: 17px; }
    .tk-body .tk-mobile-drawer-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2f5fa; color: var(--tk-mobile-ink); font-size: 22px; }
    .tk-body .tk-mobile-drawer-close:focus-visible { outline: 2px solid var(--tk-mobile-blue); outline-offset: 2px; }
    .tk-body .tk-mobile-drawer-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 7px 8px 20px; overscroll-behavior: contain; }
    .tk-body .tk-mobile-drawer-list .tk-cat-row { min-height: 43px; border-bottom: 1px solid #f1f4f8; }
    .tk-body .tk-mobile-drawer-list .tk-cat-children .tk-cat-row { min-height: 39px; }
    .tk-body.tk-mobile-drawer-open { overflow: hidden !important; }

    .tk-body .tk-mobile-service-float:not([hidden]) {
        position: fixed;
        right: 12px;
        bottom: max(82px, env(safe-area-inset-bottom));
        z-index: 80;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--tk-mobile-blue);
        color: #fff;
        font-size: 10px;
        text-decoration: none;
        box-shadow: 0 10px 22px rgba(37, 99, 235, .28);
    }
    .tk-body .tk-mobile-service-float i { font-size: 17px; }
    .tk-body [hidden] { display: none !important; }
}
