/* ============================================================
   棱镜 · 前台商城
   主题色由 accent.js 写进 --pm-accent / --pm-ink / --pm-deep / --pm-soft / --pm-light（含 -rgb 版本），
   顾客在顶栏「调色盘」里换色，整站跟着变。载入顺序在 index.css 之后。
   ============================================================ */

/* ---------- 令牌 ---------- */
html:root[data-theme] {
    --pm-bg: #f4f6fa;
    --pm-surface: #ffffff;
    --pm-surface-2: #f6f8fb;
    --pm-text: #172033;
    --pm-text-2: #586377;
    --pm-text-3: #8d96a8;
    --pm-line: rgba(23, 32, 51, .09);
    --pm-line-2: rgba(23, 32, 51, .055);
    --pm-shadow: 0 1px 2px rgba(23, 32, 51, .04), 0 8px 24px rgba(23, 32, 51, .055);
    --pm-shadow-lg: 0 4px 10px rgba(23, 32, 51, .05), 0 22px 48px rgba(23, 32, 51, .12);
    --pm-glow: 0 10px 30px rgba(var(--pm-accent-rgb, 58, 168, 224), .24);
    --pm-radius: 20px;
    --pm-radius-sm: 14px;
    --pm-ok: #0f9b68;
    --pm-ok-soft: rgba(15, 155, 104, .1);
    --pm-warn: #c96f17;
    --pm-warn-soft: rgba(217, 130, 43, .12);
    --pm-bad: #d93d42;
    --pm-btn: var(--pm-ink, #2a6f97);
    --pm-btn-hover: var(--pm-deep, #1d4f6c);
    --pm-on-btn: #ffffff;
    --pm-strong: var(--pm-ink, #2a6f97);
    --pm-tint: var(--pm-soft, #e3f2fb);

    /* 预设模板沿用的令牌 → 跟着主题色 */
    --md-primary: var(--pm-ink, #2a6f97);
    --md-primary-rgb: var(--pm-ink-rgb, 42, 111, 151);
    --md-on-primary: #ffffff;
    --uc-primary-deep: var(--pm-deep, #1d4f6c);
    --acg-primary: var(--pm-ink, #2a6f97);
    --glass-bg: var(--pm-surface);
    --glass-bg-strong: var(--pm-surface);
    --glass-bg-soft: var(--pm-surface-2);
    --glass-border: var(--pm-line);
    --glass-border-soft: var(--pm-line-2);
    --glass-hi: 0 0 0 transparent;
    --glass-filter: none;
    --glass-filter-strong: none;
    --glass-shadow: var(--pm-shadow);
    --glass-shadow-lg: var(--pm-shadow-lg);
    --glass-radius: var(--pm-radius);
    --glass-radius-sm: var(--pm-radius-sm);
    --uc-field-bg: var(--pm-surface);
    --uc-ink: var(--pm-text);
    --uc-ink-med: var(--pm-text-2);
    --uc-ink-dis: var(--pm-text-3);
    --uc-focus: var(--pm-accent, #3aa8e0);
    --uc-focus-rgb: var(--pm-accent-rgb, 58, 168, 224);
}

html:root[data-theme="dark"] {
    --pm-bg: #0c0f15;
    --pm-surface: #141922;
    --pm-surface-2: #1a202b;
    --pm-text: #e8ecf4;
    --pm-text-2: #a3acbe;
    --pm-text-3: #6d778b;
    --pm-line: rgba(255, 255, 255, .08);
    --pm-line-2: rgba(255, 255, 255, .05);
    --pm-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
    --pm-shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
    --pm-glow: 0 10px 30px rgba(var(--pm-accent-rgb, 58, 168, 224), .18);
    --pm-ok: #4fd39a;
    --pm-ok-soft: rgba(79, 211, 154, .12);
    --pm-warn: #f0a75a;
    --pm-warn-soft: rgba(240, 167, 90, .13);
    --pm-bad: #ff7a7e;
    --pm-btn: var(--pm-light, #8fcdef);
    --pm-btn-hover: #ffffff;
    --pm-on-btn: #0c0f15;
    --pm-strong: var(--pm-light, #8fcdef);
    --pm-tint: rgba(var(--pm-accent-rgb, 58, 168, 224), .14);

    --md-primary: var(--pm-light, #8fcdef);
    --md-primary-rgb: var(--pm-light-rgb, 143, 205, 239);
    --md-on-primary: #0c0f15;
    --uc-primary-deep: #ffffff;
    --acg-primary: var(--pm-light, #8fcdef);
}

/* ---------- 基底 ---------- */
body.uc-body.pm-body {
    background: var(--pm-bg) !important;
    color: var(--pm-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body.uc-body.pm-body::before,
body.pm-body > footer {
    display: none;
}

.pm-body a {
    text-decoration: none;
}

.pm-top svg, .pm-drawer svg, .pm-hero svg, .pm-notice svg, .pm-cats svg, .pm-card svg, .pm-fab svg, .pm-empty svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pm-body .pm-fill {
    fill: currentColor;
    stroke: none;
}

/* 背景光晕：跟着主题色 */
.pm-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.pm-aurora i {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    background: rgb(var(--pm-accent-rgb, 58, 168, 224));
}

.pm-aurora i:nth-child(1) { width: 520px; height: 520px; top: -260px; left: -140px; opacity: .22; }
.pm-aurora i:nth-child(2) { width: 420px; height: 420px; top: -200px; right: -120px; opacity: .14; }
.pm-aurora i:nth-child(3) { width: 360px; height: 360px; top: 38vh; left: 52%; opacity: .07; }
html[data-theme="dark"] .pm-aurora i { opacity: .12; }
html[data-theme="dark"] .pm-aurora i:nth-child(3) { opacity: .05; }

/* ---------- 按钮 ---------- */
.pm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: var(--pm-btn);
    color: var(--pm-on-btn) !important;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s, transform .18s, box-shadow .18s;
    box-shadow: var(--pm-glow);
}

.pm-btn:hover {
    background: var(--pm-btn-hover);
    transform: translateY(-1px);
}

.pm-btn--ghost {
    background: transparent;
    color: var(--pm-text) !important;
    box-shadow: inset 0 0 0 1px var(--pm-line);
}

.pm-btn--ghost:hover {
    background: var(--pm-surface-2);
}

/* ---------- 顶栏 ---------- */
.pm-top {
    position: sticky;
    top: 0;
    z-index: 900;
    background: color-mix(in srgb, var(--pm-bg) 72%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s, box-shadow .2s;
}

.pm-top.is-scrolled {
    border-bottom-color: var(--pm-line);
    box-shadow: 0 6px 20px rgba(23, 32, 51, .05);
}

.pm-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
}

.pm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--pm-text) !important;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .2px;
}

.pm-brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--pm-line);
}

.pm-nav__list {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 0 0 auto;
}

.pm-nav__item {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--pm-text-2) !important;
    font-weight: 550;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.pm-nav__item:hover {
    background: var(--pm-surface-2);
    color: var(--pm-text) !important;
}

.pm-nav__item.active {
    background: var(--pm-tint);
    color: var(--pm-strong) !important;
}

.pm-nav__right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
}

.pm-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--pm-text-2) !important;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.pm-icon:hover,
.pm-drop.is-open > .pm-icon {
    background: var(--pm-surface);
    color: var(--pm-text) !important;
    box-shadow: inset 0 0 0 1px var(--pm-line);
}

.pm-palette__dot {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pm-accent, #3aa8e0);
    box-shadow: 0 0 0 2px var(--pm-bg);
}

.pm-mode svg { display: none; }
.pm-mode[data-mode="light"] .pm-mode--light,
.pm-mode[data-mode="dark"] .pm-mode--dark,
.pm-mode[data-mode="auto"] .pm-mode--auto,
.pm-mode:not([data-mode]) .pm-mode--auto { display: block; }

/* 下拉 */
.pm-drop {
    position: relative;
}

.pm-drop__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 950;
    min-width: 190px;
    padding: 6px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    border-radius: 16px;
    box-shadow: var(--pm-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity .16s, transform .16s, visibility .16s;
}

.pm-drop.is-open > .pm-drop__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.pm-menu__item {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--pm-text) !important;
    font-weight: 500;
}

.pm-menu__item:hover {
    background: var(--pm-surface-2);
}

.pm-menu__item.is-danger {
    color: var(--pm-bad) !important;
}

.pm-menu__sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--pm-line-2);
}

/* 调色盘 */
.pm-palette__pop {
    width: 300px;
    padding: 16px;
}

.pm-palette__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 750;
    color: var(--pm-text);
}

.pm-palette__title small {
    font-size: 12px;
    font-weight: 400;
    color: var(--pm-text-3);
}

.pm-palette__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.pm-sw {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 4px 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.pm-sw span {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
    transition: transform .15s, box-shadow .15s;
}

.pm-sw:hover span {
    transform: scale(1.08);
}

.pm-sw.is-on span {
    box-shadow: 0 0 0 3px var(--pm-surface), 0 0 0 5px var(--c);
}

.pm-sw.is-on span::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 46%;
    width: 7px;
    height: 13px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.pm-sw--custom span {
    background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b5de5, #ff6b6b);
}

.pm-sw--custom.is-on span {
    background: radial-gradient(circle, var(--c) 0 42%, transparent 44%), conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b5de5, #ff6b6b);
}

.pm-sw--custom.is-on span::after {
    display: none;
}

.pm-sw input[type=color] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: 0;
    padding: 0;
}

.pm-sw em {
    font-style: normal;
    font-size: 12px;
    color: var(--pm-text-2);
}

.pm-sw.is-on em {
    color: var(--pm-text);
    font-weight: 650;
}

/* 用户 */
.pm-user__btn {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 4px 12px 4px 4px;
    border: 0;
    border-radius: 999px;
    background: var(--pm-surface);
    box-shadow: inset 0 0 0 1px var(--pm-line);
    cursor: pointer;
}

.pm-user__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.pm-user__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.pm-user__name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 650;
    color: var(--pm-text);
}

.pm-user__balance {
    font-size: 12px;
    font-weight: 650;
    color: var(--pm-strong);
    font-variant-numeric: tabular-nums;
}

.pm-auth {
    display: flex;
    gap: 8px;
    margin-left: 4px;
}

.pm-burger {
    display: none;
}

/* 导航放不下 → 收进抽屉 */
html.pm-compact .pm-nav__list { display: none; }
html.pm-compact .pm-burger { display: inline-flex; }

.pm-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 82%;
    max-width: 300px;
    padding: 18px 14px;
    overflow-y: auto;
    background: var(--pm-surface);
    border-right: 1px solid var(--pm-line);
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

body.pm-drawer-open .pm-drawer { transform: none; }

.pm-drawer__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 6px 10px 16px;
    border-bottom: 1px solid var(--pm-line-2);
    color: var(--pm-text) !important;
    font-weight: 800;
    font-size: 16px;
}

.pm-drawer__brand img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}

.pm-drawer__link {
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--pm-text) !important;
    font-size: 15px;
    font-weight: 500;
}

.pm-drawer__link:hover,
.pm-drawer__link.active {
    background: var(--pm-tint);
    color: var(--pm-strong) !important;
}

.pm-drawer__link.is-danger { color: var(--pm-bad) !important; }

.pm-drawer__shade {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(12, 15, 21, .36);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s, visibility .28s;
}

body.pm-drawer-open .pm-drawer__shade {
    opacity: 1;
    visibility: visible;
}

/* ---------- 首页 ---------- */
.pm-main {
    padding-top: 18px;
    padding-bottom: 28px;
}

.pm-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    padding: 38px 40px;
    overflow: hidden;
    border: 1px solid var(--pm-line);
    border-radius: 28px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(var(--pm-accent-rgb, 58, 168, 224), .2), transparent 55%),
        radial-gradient(80% 120% at 100% 100%, rgba(var(--pm-accent-rgb, 58, 168, 224), .1), transparent 60%),
        var(--pm-surface);
    box-shadow: var(--pm-shadow);
}

.pm-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 48px;
    transform: rotate(28deg);
    background: linear-gradient(135deg, rgba(var(--pm-accent-rgb, 58, 168, 224), .22), rgba(var(--pm-accent-rgb, 58, 168, 224), 0));
    pointer-events: none;
}

.pm-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--pm-tint);
    color: var(--pm-strong);
    font-size: 12.5px;
    font-weight: 650;
}

.pm-pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pm-ok);
}

.pm-pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--pm-ok);
    opacity: 0;
    animation: pm-pulse 2s ease-out infinite;
}

@keyframes pm-pulse {
    0% { transform: scale(.4); opacity: .7; }
    100% { transform: scale(1.4); opacity: 0; }
}

.pm-hero__title {
    margin: 16px 0 8px;
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 850;
    letter-spacing: -.5px;
    line-height: 1.15;
    color: var(--pm-text);
}

.pm-hero__sub {
    margin: 0 0 22px;
    font-size: 15px;
    color: var(--pm-text-2);
}

.pm-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 520px;
    height: 52px;
    padding: 0 6px 0 16px;
    border-radius: 16px;
    background: var(--pm-surface);
    box-shadow: inset 0 0 0 1px var(--pm-line), var(--pm-shadow);
    transition: box-shadow .18s;
}

.pm-search:focus-within {
    box-shadow: inset 0 0 0 2px var(--pm-accent, #3aa8e0), 0 0 0 5px rgba(var(--pm-accent-rgb, 58, 168, 224), .16);
}

.pm-search > svg {
    color: var(--pm-text-3);
}

.pm-search__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pm-text);
    font-size: 15px;
}

.pm-search__input::placeholder { color: var(--pm-text-3); }
.pm-search .pm-btn { height: 40px; }

.pm-trust {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pm-trust li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--pm-surface) 78%, transparent);
    border: 1px solid var(--pm-line-2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.pm-trust__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--pm-tint);
    color: var(--pm-strong);
}

.pm-trust li > span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pm-trust b {
    font-size: 14px;
    color: var(--pm-text);
}

.pm-trust small {
    font-size: 12px;
    color: var(--pm-text-3);
}

/* 公告 */
.pm-notice {
    margin-top: 18px;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    background: var(--pm-surface);
    box-shadow: var(--pm-shadow);
    overflow: hidden;
}

.pm-notice__head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    background: none;
    color: var(--pm-text);
    text-align: left;
    cursor: pointer;
}

.pm-notice__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--pm-tint);
    color: var(--pm-strong);
}

.pm-notice__title {
    flex: 1 1 auto;
    font-weight: 750;
    font-size: 15px;
}

.pm-notice__toggle {
    font-size: 12.5px;
    color: var(--pm-text-3);
}

.pm-notice__chev {
    color: var(--pm-text-3);
    transition: transform .2s;
}

.pm-notice.is-collapsed .pm-notice__chev { transform: rotate(180deg); }
.pm-notice.is-collapsed .pm-notice__body { display: none; }

.pm-notice__body {
    padding: 2px 22px 18px 60px;
    color: var(--pm-text-2);
    line-height: 1.85;
}

.pm-notice__body p { margin: 0 0 8px; }
.pm-notice__body p:last-child { margin-bottom: 0; }
.pm-notice__body b, .pm-notice__body strong { color: var(--pm-text); }
.pm-notice__body ul { margin: 6px 0 10px; padding-left: 0; list-style: none; }
.pm-notice__body li { position: relative; padding-left: 16px; }
.pm-notice__body li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .78em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pm-accent, #3aa8e0);
}
.pm-notice__body a { color: var(--pm-strong); font-weight: 600; border-bottom: 1px solid rgba(var(--pm-accent-rgb, 58, 168, 224), .4); }

/* 分类 */
.pm-catalog {
    margin-top: 26px;
    scroll-margin-top: 80px;
}

.pm-cats-wrap {
    position: sticky;
    top: 66px;
    z-index: 50;
    margin: 0 -12px;
    padding: 10px 12px;
    background: linear-gradient(var(--pm-bg) 70%, transparent);
}

.pm-cats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
}

.pm-cats::-webkit-scrollbar { display: none; }

.pm-cat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--pm-surface);
    box-shadow: inset 0 0 0 1px var(--pm-line);
    color: var(--pm-text-2) !important;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}

.pm-cat:hover {
    color: var(--pm-text) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--pm-accent-rgb, 58, 168, 224), .5);
}

.pm-cat img {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    object-fit: cover;
}

.pm-cat svg { width: 17px; height: 17px; }

.pm-cat__count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--pm-surface-2);
    color: var(--pm-text-3);
    font-size: 11.5px;
    text-align: center;
}

.pm-cat.is-on {
    background: var(--pm-btn);
    color: var(--pm-on-btn) !important;
    box-shadow: var(--pm-glow);
}

.pm-cat.is-on .pm-cat__count {
    background: rgba(255, 255, 255, .22);
    color: inherit;
}

html[data-theme="dark"] .pm-cat.is-on .pm-cat__count { background: rgba(0, 0, 0, .14); }

.pm-catalog__bar {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 12px 2px 14px;
}

.pm-catalog__title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--pm-text);
}

.pm-catalog__count {
    font-size: 13px;
    color: var(--pm-text-3);
}

/* 商品卡片 */
.pm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.pm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--pm-radius);
    background: var(--pm-surface);
    box-shadow: inset 0 0 0 1px var(--pm-line), var(--pm-shadow);
    color: var(--pm-text) !important;
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s;
    animation: pm-in .45s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--i, 0) * 35ms);
}

.pm-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 0 0 1px rgba(var(--pm-accent-rgb, 58, 168, 224), .45), var(--pm-shadow-lg), var(--pm-glow);
}

@keyframes pm-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.pm-card__cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        radial-gradient(90% 90% at 25% 15%, rgba(var(--pm-accent-rgb, 58, 168, 224), .2), transparent 65%),
        var(--pm-surface-2);
    color: var(--pm-text-3);
}

.pm-card__cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 14px;
    object-fit: contain;
    transition: transform .3s;
}

.pm-card:hover .pm-card__cover img { transform: scale(1.04); }
.pm-card__cover svg { width: 40px; height: 40px; stroke-width: 1.3; }

.pm-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 9px;
    padding: 14px 16px 16px;
}

.pm-card__name {
    display: -webkit-box;
    min-height: 2.9em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1.45;
}

.pm-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pm-tag {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--pm-surface-2);
    color: var(--pm-text-2);
    font-size: 11.5px;
    font-weight: 550;
}

.pm-tag--auto { background: var(--pm-ok-soft); color: var(--pm-ok); }
.pm-tag--hot { background: var(--pm-tint); color: var(--pm-strong); }

.pm-card__foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.pm-price {
    font-size: 22px;
    font-weight: 850;
    color: var(--pm-strong);
    letter-spacing: -.3px;
    font-variant-numeric: tabular-nums;
}

.pm-price small {
    margin-right: 1px;
    font-size: 13px;
    font-weight: 700;
}

.pm-stock {
    font-size: 12px;
    color: var(--pm-text-3);
    white-space: nowrap;
}

.pm-stock.is-low { color: var(--pm-warn); font-weight: 600; }
.pm-stock.is-out { color: var(--pm-bad); font-weight: 600; }

.pm-card.is-out { cursor: not-allowed; }
.pm-card.is-out .pm-card__cover, .pm-card.is-out .pm-price { filter: grayscale(1); opacity: .55; }
.pm-card.is-out:hover { transform: none; box-shadow: inset 0 0 0 1px var(--pm-line), var(--pm-shadow); }

.pm-card--ghost { animation: none; pointer-events: none; }
.pm-card--ghost .pm-card__cover,
.pm-card--ghost .pm-card__body i {
    background: linear-gradient(90deg, var(--pm-surface-2) 25%, var(--pm-line-2) 50%, var(--pm-surface-2) 75%);
    background-size: 200% 100%;
    animation: pm-shimmer 1.3s linear infinite;
}
.pm-card--ghost .pm-card__body i { display: block; height: 12px; border-radius: 6px; }
.pm-card--ghost .pm-card__body i:nth-child(1) { width: 85%; }
.pm-card--ghost .pm-card__body i:nth-child(2) { width: 50%; }
.pm-card--ghost .pm-card__body i:nth-child(3) { width: 35%; height: 20px; margin-top: 6px; }

@keyframes pm-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.pm-empty {
    grid-column: 1 / -1;
    padding: 56px 16px;
    border-radius: var(--pm-radius);
    border: 1px dashed var(--pm-line);
    color: var(--pm-text-3);
    text-align: center;
}

/* 客服浮钮 */
.pm-fab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    background: var(--pm-btn);
    color: var(--pm-on-btn) !important;
    font-weight: 650;
    box-shadow: var(--pm-shadow-lg), var(--pm-glow);
    transition: transform .18s;
}

.pm-fab:hover { transform: translateY(-2px); }

/* 页脚 */
.pm-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
    padding: 26px 0 40px;
    border-top: 1px solid var(--pm-line);
}

.pm-footer__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pm-footer__brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.pm-footer__brand div {
    display: flex;
    flex-direction: column;
}

.pm-footer__brand b { color: var(--pm-text); }
.pm-footer__brand small { color: var(--pm-text-3); font-size: 12.5px; }

.pm-footer__links {
    display: flex;
    gap: 18px;
}

.pm-footer__links a { color: var(--pm-text-2) !important; }
.pm-footer__links a:hover { color: var(--pm-strong) !important; }

.pm-footer__icp {
    width: 100%;
    font-size: 12px;
    color: var(--pm-text-3);
}

/* ---------- 商品详情 / 订单查询（沿用预设结构，只换外观） ---------- */
.pm-body .panel {
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    border-radius: 24px;
    box-shadow: var(--pm-shadow);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.pm-body .panel-header {
    border-bottom: 1px solid var(--pm-line-2);
}

.pm-body .panel-header .icon {
    color: var(--pm-strong);
    background: var(--pm-tint);
}

.pm-body .panel-title { color: var(--pm-text); font-weight: 750; }

.pm-body .item-buy h4 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.35;
    color: var(--pm-text);
}

.pm-body .acg-cover {
    border: 1px solid var(--pm-line);
    border-radius: 20px;
    background:
        radial-gradient(90% 90% at 25% 15%, rgba(var(--pm-accent-rgb, 58, 168, 224), .2), transparent 65%),
        var(--pm-surface-2);
    box-shadow: none;
}

.pm-body .acg-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.pm-body .item-cover {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 14px;
}

.pm-body .price {
    color: var(--pm-strong);
    font-size: 32px;
    font-weight: 850;
    letter-spacing: -.5px;
}

.pm-body .price .unit { font-size: 16px; margin-right: 2px; }

.pm-body .badge-soft {
    border-radius: 8px;
    font-weight: 600;
}

.pm-body .badge-soft-success { background: var(--pm-ok-soft); color: var(--pm-ok); }
.pm-body .badge-soft-primary,
.pm-body .badge-soft-info { background: var(--pm-tint); color: var(--pm-strong); }

.pm-body .form-label { color: var(--pm-text-2); font-weight: 600; }

.pm-body .sku {
    border-radius: 12px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    color: var(--pm-text);
    transition: border-color .15s, background .15s;
}

.pm-body .sku:hover { border-color: rgba(var(--pm-accent-rgb, 58, 168, 224), .55); }

.pm-body .sku.is-primary {
    background: var(--pm-tint);
    border-color: var(--pm-accent, #3aa8e0);
    color: var(--pm-strong);
    box-shadow: 0 0 0 1px var(--pm-accent, #3aa8e0);
}

.pm-body .sku .badge-money { color: var(--pm-strong); }

.pm-body .form-control,
.pm-body .optional-card {
    border-radius: 12px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    color: var(--pm-text);
}

.pm-body .form-control:focus {
    border-color: var(--pm-accent, #3aa8e0);
    box-shadow: 0 0 0 4px rgba(var(--pm-accent-rgb, 58, 168, 224), .16);
}

.pm-body .qty-group button {
    background: var(--pm-surface-2);
    border: 1px solid var(--pm-line);
    color: var(--pm-text);
}

.pm-body .buy-divider {
    background: var(--pm-line-2);
    border-color: var(--pm-line-2);
}

.pm-body .pay-list .pay {
    border-radius: 14px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    color: var(--pm-text);
    font-weight: 600;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.pm-body .pay-list .pay:hover {
    border-color: var(--pm-accent, #3aa8e0);
    box-shadow: 0 0 0 3px rgba(var(--pm-accent-rgb, 58, 168, 224), .14);
    transform: translateY(-1px);
}

.pm-body .btn-primary {
    background: var(--pm-btn);
    border-color: var(--pm-btn);
    color: var(--pm-on-btn);
    border-radius: 12px;
    font-weight: 650;
}

.pm-body .btn-primary:hover,
.pm-body .btn-primary:focus {
    background: var(--pm-btn-hover);
    border-color: var(--pm-btn-hover);
    color: var(--pm-on-btn);
}

.pm-body .item-detail .panel-body {
    line-height: 1.85;
    color: var(--pm-text);
}

.pm-body .item-detail .panel-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.pm-body .material-icons-outlined,
.pm-body .material-icons {
    overflow: hidden;
    max-width: 1em;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 991.98px) {
    .pm-hero {
        grid-template-columns: 1fr;
        padding: 30px 26px;
    }
}

@media (max-width: 640px) {
    .pm-nav { height: 60px; gap: 10px; }
    .pm-cats-wrap { top: 60px; }
    .pm-brand span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pm-user__meta, .pm-auth .pm-btn--ghost { display: none; }
    .pm-user__btn { padding: 4px; }
    .pm-auth .pm-btn { height: 34px; padding: 0 12px; }
    .pm-icon { width: 36px; height: 36px; }
    .pm-nav__right { gap: 2px; }

    .pm-main { padding-top: 12px; }
    .pm-hero { padding: 24px 18px; border-radius: 22px; gap: 20px; }
    .pm-hero::after { display: none; }
    .pm-hero__sub { margin-bottom: 16px; font-size: 14px; }
    .pm-search { height: 48px; }
    .pm-trust { gap: 8px; }
    .pm-trust li { padding: 10px; gap: 9px; }
    .pm-trust__ico { width: 34px; height: 34px; border-radius: 10px; }
    .pm-trust small { font-size: 11px; }

    .pm-notice__body { padding: 0 18px 16px; }

    .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .pm-card { border-radius: 16px; }
    .pm-card__cover img { padding: 10px; }
    .pm-card__body { padding: 10px 12px 12px; gap: 7px; }
    .pm-card__name { font-size: 13.5px; }
    .pm-card__foot { flex-direction: column; align-items: flex-start; gap: 2px; }
    .pm-price { font-size: 19px; }

    .pm-fab { width: 50px; height: 50px; padding: 0; justify-content: center; }
    .pm-fab span { display: none; }

    .pm-footer { flex-direction: column; align-items: flex-start; }
    .pm-body .item-cover { max-height: 220px; }
    .pm-body .item-buy h4 { font-size: 19px; }
    .pm-body .price { font-size: 28px; }
    .pm-palette__pop { position: fixed; top: 66px; left: 16px; right: 16px; width: auto; transform-origin: top center; }
}

@media (prefers-reduced-motion: reduce) {
    .pm-card, .pm-card:hover, .pm-btn:hover, .pm-fab:hover { animation: none; transform: none; transition: none; }
    .pm-pulse::after { animation: none; }
}

/* ---------- 好友首单优惠提示 ---------- */
.pm-body .pm-ref {
    display: block;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--pm-tint);
    color: var(--pm-strong) !important;
    font-size: 13.5px;
    line-height: 1.6;
}

.pm-body .pm-ref[hidden] { display: none; }
.pm-body .pm-ref b { font-weight: 800; }
.pm-body .pm-ref em { font-style: normal; }
.pm-body .pm-ref--guest { border: 1px dashed rgba(var(--pm-accent-rgb, 58, 168, 224), .5); }
.pm-body .pm-ref--guest:hover { background: rgba(var(--pm-accent-rgb, 58, 168, 224), .2); }
