/* CedCouplet 站点级补充：日间/夜间切换开关 + 夜间（深色）模板
 * 说明：
 * 1) 开关样式分日间/夜间两套，均以 .theme-mode-toggle 为基础，浅色模式外观不变。
 * 2) 深色规则全部以 html.theme-dark 前缀限定，未加该 class 时本文件对页面无影响。
 * 3) 不修改任何价格数字的字号/颜色规则（价格框底色随夜间卡片统一，价格数字仍为绿色）。
 */

/* ============================================================
   一、日间 / 夜间 切换开关（两种模式下都显示）
   ============================================================ */
.theme-mode-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: 56px;
    height: 30px;
    min-width: 56px;
    padding: 0;
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 999px;
    background: #eef0f4;
    box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.08);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.theme-mode-toggle:hover {
    border-color: rgba(17, 24, 39, 0.26);
}

.theme-mode-toggle:focus-visible {
    outline: 2px solid #7d80a0;
    outline-offset: 2px;
}

.theme-mode-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.28s ease;
    will-change: transform;
}

.theme-mode-toggle__icon {
    grid-area: 1 / 1;
    width: 14px;
    height: 14px;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.theme-mode-toggle__icon--sun {
    color: #e8a33d;
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-mode-toggle__icon--moon {
    color: #c9cfe4;
    opacity: 0;
    transform: scale(0.6) rotate(-30deg);
}

html.theme-dark .theme-mode-toggle {
    background: #1b2231;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

html.theme-dark .theme-mode-toggle:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

html.theme-dark .theme-mode-toggle__thumb {
    transform: translateX(26px);
    background: #0c111a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

html.theme-dark .theme-mode-toggle__icon--sun {
    opacity: 0;
    transform: scale(0.6) rotate(30deg);
}

html.theme-dark .theme-mode-toggle__icon--moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* 手机端顶栏开关：小屏显示在品牌行（汉堡按钮左侧），桌面端隐藏；
   同时隐藏折叠菜单内的原开关，避免同一页面出现两个可见开关。 */
.theme-mode-toggle--topbar {
    display: none;
}

/* 「跟随系统」按钮：与开关同高的胶囊按钮，激活时实心紫灰 */
.theme-mode-auto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 999px;
    background: #ffffff;
    color: #4b5563;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.theme-mode-auto__icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.theme-mode-auto:hover {
    border-color: rgba(17, 24, 39, 0.26);
    color: #111827;
}

.theme-mode-auto:focus-visible {
    outline: 2px solid #7d80a0;
    outline-offset: 2px;
}

.theme-mode-auto[aria-pressed="true"],
.theme-mode-auto.is-active {
    background: #7d80a0;
    border-color: #7d80a0;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(125, 128, 160, 0.35);
}

.theme-mode-auto[aria-pressed="true"]:hover,
.theme-mode-auto.is-active:hover {
    background: #8a8db0;
    border-color: #8a8db0;
    color: #ffffff;
}

html.theme-dark .theme-mode-auto {
    background: #1b2231;
    border-color: rgba(255, 255, 255, 0.16);
    color: #c2cadb;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

html.theme-dark .theme-mode-auto:hover {
    border-color: rgba(255, 255, 255, 0.28);
    color: #e6eaf2;
}

html.theme-dark .theme-mode-auto[aria-pressed="true"],
html.theme-dark .theme-mode-auto.is-active {
    background: #7d80a0;
    border-color: #7d80a0;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

html.theme-dark .theme-mode-auto[aria-pressed="true"]:hover,
html.theme-dark .theme-mode-auto.is-active:hover {
    background: #8a8db0;
    border-color: #8a8db0;
    color: #ffffff;
}

/* 顶栏版「跟随系统」按钮只在手机端出现，桌面端用导航工具区里的那一个，
   避免同一页面出现两个可见的「跟随系统」。 */
.theme-mode-auto--topbar {
    display: none;
}

@media (max-width: 767.98px) {
    .theme-brand-wrap > .theme-mode-auto--topbar {
        display: inline-flex;
        height: 26px;
        padding: 0 8px;
        margin-right: 2px;
    }

    .theme-mode-auto--topbar .theme-mode-auto__icon {
        width: 13px;
        height: 13px;
    }

    /* 小屏只留图标，给品牌行省宽度；文字含义由 aria-label / title 承担 */
    .theme-mode-auto--topbar .theme-mode-auto__text {
        display: none;
    }

    /* 折叠菜单里的跟随系统按钮与顶栏重复，移动端隐藏 */
    .theme-nav-tools .theme-mode-auto {
        display: none;
    }

    .theme-brand-wrap > .theme-mode-toggle--topbar {
        display: inline-flex;
        width: 46px;
        min-width: 46px;
        height: 26px;
        margin-right: 2px;
    }

    .theme-mode-toggle--topbar .theme-mode-toggle__thumb {
        width: 20px;
        height: 20px;
    }

    .theme-mode-toggle--topbar .theme-mode-toggle__icon {
        width: 12px;
        height: 12px;
    }

    html.theme-dark .theme-mode-toggle--topbar .theme-mode-toggle__thumb {
        transform: translateX(20px);
    }

    .theme-nav-tools .theme-mode-toggle {
        display: none;
    }
}

/* ============================================================
   一之二、外观模式选择器（日间 / 夜间 / 跟随系统，一个按钮 + 下拉）
   ============================================================ */
.theme-mode-picker {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.theme-mode-picker__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid rgba(17, 24, 39, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: #3d4a5c;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 3px 12px rgba(17, 24, 39, 0.1);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.theme-mode-picker__trigger:hover {
    border-color: rgba(17, 24, 39, 0.24);
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.1);
}

.theme-mode-picker__trigger:focus-visible {
    outline: 2px solid #7d80a0;
    outline-offset: 2px;
}

.theme-mode-picker__trigger-icon {
    display: none;
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

html[data-theme-mode="light"] .theme-mode-picker__trigger-icon--light,
html[data-theme-mode="dark"] .theme-mode-picker__trigger-icon--dark,
html[data-theme-mode="auto"] .theme-mode-picker__trigger-icon--auto,
html:not([data-theme-mode]) .theme-mode-picker__trigger-icon--auto {
    display: inline-block;
}

.theme-mode-picker__trigger-icon--light {
    color: #e8a33d;
}

.theme-mode-picker__trigger-icon--dark {
    color: #7d80a0;
}

.theme-mode-picker__trigger-icon--auto {
    color: #7d80a0;
}

html.theme-dark .theme-mode-picker__trigger-icon--dark,
html.theme-dark .theme-mode-picker__trigger-icon--auto {
    color: #b6bad8;
}

.theme-mode-picker__label {
    display: none;
}

html[data-theme-mode="light"] .theme-mode-picker__label--light,
html[data-theme-mode="dark"] .theme-mode-picker__label--dark,
html[data-theme-mode="auto"] .theme-mode-picker__label--auto,
html:not([data-theme-mode]) .theme-mode-picker__label--auto {
    display: inline;
}

.theme-mode-picker__menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1040;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 168px;
    padding: 8px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16);
    transform-origin: top right;
    animation: theme-mode-pop 0.16s ease-out;
}

/* 菜单由脚本挂到 body 上并用内联 left/top 定位，避免被导航条的 backdrop-filter 裁剪 */
.theme-mode-picker__menu.is-open,
.theme-mode-picker.is-open .theme-mode-picker__menu {
    display: flex;
}

@keyframes theme-mode-pop {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.theme-mode-picker__option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #46586c;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-mode-picker__option:hover {
    background: #f4f6fb;
}

.theme-mode-picker__option.is-active {
    background: #eaf1fb;
    border-color: #d6e3f5;
    color: #1f3a5f;
}

.theme-mode-picker__option:focus-visible {
    outline: 2px solid #7d80a0;
    outline-offset: 1px;
}

.theme-mode-picker__option-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.theme-mode-picker__option[data-theme-mode-option="light"] .theme-mode-picker__option-icon {
    color: #e8a33d;
}

.theme-mode-picker__option[data-theme-mode-option="dark"] .theme-mode-picker__option-icon,
.theme-mode-picker__option[data-theme-mode-option="auto"] .theme-mode-picker__option-icon {
    color: #7d80a0;
}

html.theme-dark .theme-mode-picker__trigger {
    background: #1b2231;
    border-color: rgba(255, 255, 255, 0.16);
    color: #c2cadb;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

html.theme-dark .theme-mode-picker__trigger:hover {
    background: #202a3b;
    border-color: rgba(255, 255, 255, 0.28);
    color: #e6eaf2;
}

html.theme-dark .theme-mode-picker__menu {
    background: #121926;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.6);
}

html.theme-dark .theme-mode-picker__option {
    color: #c2cadb;
}

html.theme-dark .theme-mode-picker__option:hover {
    background: #1b2231;
}

html.theme-dark .theme-mode-picker__option.is-active {
    background: #1d2637;
    border-color: rgba(255, 255, 255, 0.16);
    color: #e6eaf2;
}

html.theme-dark .theme-mode-picker__option[data-theme-mode-option="dark"] .theme-mode-picker__option-icon,
html.theme-dark .theme-mode-picker__option[data-theme-mode-option="auto"] .theme-mode-picker__option-icon {
    color: #b6bad8;
}

/* 顶栏版选择器只在手机端出现，桌面端用导航工具区里的那一个 */
.theme-mode-picker--topbar {
    display: none;
}

@media (max-width: 767.98px) {
    .theme-brand-wrap > .theme-mode-picker--topbar {
        display: inline-flex;
    }

    /* 顶栏按钮不再单独设尺寸，直接继承桌面日间样式（38px 高 / 15px 内边距 / 13.5px 字） */

    /* 折叠菜单里的选择器与顶栏重复，移动端隐藏 */
    .theme-nav-tools .theme-mode-picker {
        display: none;
    }
}

@media (max-width: 359.98px) {
    .theme-brand-wrap > .theme-mode-picker--topbar .theme-mode-picker__label {
        display: none;
    }
}

/* ============================================================
   二、夜间配色令牌
   ============================================================ */
html.theme-dark {
    color-scheme: dark;
    --dm-page: #0b1018;
    --dm-bg-deep: #080b12;
    --dm-surface: #121926;
    --dm-surface-2: #171f2d;
    --dm-surface-3: #1d2637;
    --dm-text: #e6eaf2;
    --dm-text-2: #c2cadb;
    --dm-muted: #98a2b6;
    --dm-border: rgba(255, 255, 255, 0.09);
    --dm-border-strong: rgba(255, 255, 255, 0.18);
    --dm-primary: #7d80a0;
    --dm-primary-hover: #8a8db0;
}

/* 变量层：覆盖 bundle.css 里写死的浅色调色板 */
html.theme-dark body.theme-theme.ys {
    --ced-bg: var(--dm-page);
    --ced-bg-deep: var(--dm-bg-deep);
    --ced-surface: rgba(18, 25, 38, 0.96);
    --ced-surface-solid: var(--dm-surface);
    --ced-surface-soft: rgba(23, 31, 45, 0.96);
    --ced-purple: #b6bad8;
    --ced-violet: #2a3350;
    --ced-magenta: #323c5c;
    --ced-blue: #7fb0ff;
    --ced-cyan: #6fd3e0;
    --ced-text: var(--dm-text);
    --ced-muted: var(--dm-muted);
    --ced-muted-soft: #6f7889;
    --ced-line: var(--dm-border);
    --ced-line-strong: var(--dm-border-strong);
    --ced-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --ced-shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.55);
    /* bundle.css 里以字面色写死、不指向 --ced-* 的变量 */
    --theme-accent-rgb: 182, 186, 216;
    --theme-muted-strong: var(--dm-text-2);
    --xn-ink: var(--dm-text);
    --xn-ink-2: var(--dm-text-2);
    --xn-hair-soft: var(--dm-text-2);
    --xn-paper-2: rgba(8, 11, 18, 0.96);
    --xn-brick: var(--dm-text);
    --xn-success: #34d399;
    --xn-warning: #f0b95c;
    background-color: var(--dm-bg-deep) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys {
    background-color: var(--dm-bg-deep) !important;
    color: var(--dm-text) !important;
}

/* ============================================================
   三、通用交互件
   ============================================================ */
html.theme-dark body.ys .theme-nav-link,
html.theme-dark body.ys .theme-button-light,
html.theme-dark body.ys .theme-user-chip,
html.theme-dark body.ys .theme-searchbox,
html.theme-dark body.ys .theme-search-combo,
html.theme-dark body.ys .form-control,
html.theme-dark body.ys .qty-group,
html.theme-dark body.ys .password-form .input-group,
html.theme-dark body.ys .theme-nav-toggle {
    border-color: var(--dm-border-strong) !important;
    background: var(--dm-surface-2) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-nav-link:hover,
html.theme-dark body.ys .theme-nav-link.is-active,
html.theme-dark body.ys .theme-category-link:hover,
html.theme-dark body.ys .theme-category-link.is-active,
html.theme-dark body.ys .theme-commodity-card:hover,
html.theme-dark body.ys .theme-button-light:hover,
html.theme-dark body.ys .theme-button:hover {
    border-color: var(--dm-border-strong) !important;
    background: rgba(255, 255, 255, 0.07) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42) !important;
}

html.theme-dark body.ys .theme-button-dark,
html.theme-dark body.ys .theme-commodity-action-link,
html.theme-dark body.ys .view-card-btn,
html.theme-dark body.ys .component-popup .queryBtn,
html.theme-dark body.ys .component-popup .query-button {
    border-color: rgba(255, 255, 255, 0.22) !important;
    background: linear-gradient(135deg, #7d80a0, #6a6d8c) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45) !important;
}

html.theme-dark body.ys .theme-brand-name {
    background: linear-gradient(90deg, #eef1f8, #eef1f8 55%, #7fb0ff) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: var(--dm-text) !important;
}

/* 下拉菜单 */
html.theme-dark body.ys .theme-dropdown-menu {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55) !important;
}

html.theme-dark body.ys .theme-dropdown-menu .dropdown-item {
    background: transparent !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-dropdown-menu .dropdown-item i {
    color: var(--dm-muted) !important;
}

html.theme-dark body.ys .theme-dropdown-menu .dropdown-item:hover,
html.theme-dark body.ys .theme-dropdown-menu .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.07) !important;
}

html.theme-dark body.ys .theme-dropdown-entry-danger .dropdown-item,
html.theme-dark body.ys .theme-dropdown-entry-danger .dropdown-item i,
html.theme-dark body.ys .theme-dropdown-entry-danger .dropdown-item:hover,
html.theme-dark body.ys .theme-dropdown-entry-danger .dropdown-item:focus {
    background: transparent !important;
    color: #f87171 !important;
}

/* 分类链接 */
html.theme-dark body.ys .theme-category-link {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-category-link:hover,
html.theme-dark body.ys .theme-category-link.is-active {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: var(--dm-border-strong) !important;
}

/* 徽章与小标签 */
html.theme-dark body.ys .theme-pill,
html.theme-dark body.ys .badge-soft,
html.theme-dark body.ys .badge-soft-primary,
html.theme-dark body.ys .status-badge,
html.theme-dark body.ys .shipment-badge {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .status-badge.status-paid,
html.theme-dark body.ys .shipment-badge.shipment-paid {
    background: rgba(52, 211, 153, 0.14) !important;
    color: #4ade80 !important;
}

html.theme-dark body.ys .badge-money {
    background: var(--dm-primary) !important;
    color: #ffffff !important;
}

/* 选中规格上的价格徽章保持白底深字（与 theme-custom.css 一致） */
html.theme-dark body.ys .sku.is-primary .badge-money,
html.theme-dark .sku.is-primary .badge-money {
    background: #ffffff !important;
    color: #4a4d6b !important;
}

/* ============================================================
   四、卡片 / 列表 / 表格
   ============================================================ */
html.theme-dark body.ys .theme-commodity-card,
html.theme-dark body.ys .theme-commodity-card .row-inner,
html.theme-dark body.ys .theme-commodity-table,
html.theme-dark body.ys .wholesale-table {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    --bs-table-bg: var(--dm-surface) !important;
    --bs-table-color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-commodity-card .row-inner {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark body.ys .theme-commodity-table thead th {
    background: var(--dm-surface-3) !important;
    color: var(--dm-muted) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .theme-commodity-table tbody td,
html.theme-dark body.ys .theme-commodity-row {
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .theme-commodity-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

html.theme-dark body.ys .theme-result-count,
html.theme-dark body.ys .theme-category-count,
html.theme-dark body.ys .loading-content,
html.theme-dark body.ys .theme-inline-note {
    background: rgba(255, 255, 255, 0.07) !important;
    color: var(--dm-muted) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .theme-empty-row {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--dm-muted) !important;
}

/* ============================================================
   五、横幅 / 首屏
   ============================================================ */
html.theme-dark body.ys .theme-hero-banner {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .theme-hero-title,
html.theme-dark body.ys .theme-hero-side-notice,
html.theme-dark body.ys .theme-hero-news {
    background: transparent !important;
    color: var(--dm-text) !important;
    text-shadow: none !important;
}

html.theme-dark body.ys .theme-hero-banner--notice,
html.theme-dark .theme-hero-notice-head {
    background: var(--dm-surface) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-hero-notice-title i {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-hero-actions .cyber-btn-item {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border-strong) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-hero-actions .cyber-btn-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

html.theme-dark body.ys .theme-hero-banner--image {
    background: var(--dm-surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html.theme-dark body.ys .theme-hero-banner--image .theme-hero-media {
    background: #05070c;
}

html.theme-dark body.ys .theme-query-heading {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .theme-query-heading-icon {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: var(--dm-border) !important;
}

/* ============================================================
   六、表单 / 详情页
   ============================================================ */
html.theme-dark body.ys .theme-field {
    background-color: var(--dm-surface-2) !important;
    background-image: linear-gradient(var(--dm-surface-2), var(--dm-surface-2)) !important;
    border: 1px solid var(--dm-border) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
    color: var(--dm-text) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 价格框：底色随夜间卡片，价格数字（绿）与字号规则保持原样 */
html.theme-dark body.ys .theme-item-price {
    background-color: var(--dm-surface-2) !important;
    background-image: linear-gradient(var(--dm-surface-2), var(--dm-surface-2)) !important;
    border: 1px solid var(--dm-border) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
    color: var(--dm-text) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.theme-dark body.ys .theme-item-price .unit {
    color: var(--dm-muted) !important;
}

html.theme-dark body.ys .theme-field .form-label,
html.theme-dark body.ys .cash-pay > .form-label {
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .sku {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-form-stack .sku {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: linear-gradient(135deg, #2b3448 0%, #252d3f 55%, #202736 100%) !important;
    color: var(--dm-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 16px rgba(0, 0, 0, 0.45) !important;
}

html.theme-dark body.ys .theme-form-stack .sku:hover {
    border-color: rgba(255, 255, 255, 0.24) !important;
    background: linear-gradient(135deg, #323c53 0%, #2b3448 55%, #252d3f 100%) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 22px rgba(0, 0, 0, 0.5) !important;
}

html.theme-dark body.ys .theme-form-stack .qty-group {
    background: linear-gradient(135deg, #2b3448 0%, #252d3f 55%, #202736 100%) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: var(--dm-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.42) !important;
}

html.theme-dark body.ys .theme-form-stack .qty-group .form-control {
    background: rgba(0, 0, 0, 0.28) !important;
    color: var(--dm-text) !important;
    box-shadow: none !important;
}

html.theme-dark body.ys .theme-form-stack .qty-group .form-control:focus {
    background: rgba(0, 0, 0, 0.38) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .theme-form-stack .change-num-sub,
html.theme-dark body.ys .theme-form-stack .change-num-add {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: var(--dm-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 12px rgba(0, 0, 0, 0.4) !important;
}

html.theme-dark body.ys .theme-form-stack .change-num-sub:hover,
html.theme-dark body.ys .theme-form-stack .change-num-add:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .theme-form-stack input.form-control.contact-input {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: linear-gradient(135deg, #2b3448 0%, #252d3f 55%, #202736 100%) !important;
    color: var(--dm-text) !important;
    caret-color: var(--dm-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 16px rgba(0, 0, 0, 0.45) !important;
}

html.theme-dark body.ys .theme-form-stack input.form-control.contact-input:focus {
    border-color: rgba(255, 255, 255, 0.26) !important;
    background: linear-gradient(135deg, #323c53 0%, #2b3448 55%, #252d3f 100%) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(125, 128, 160, 0.3) !important;
}

html.theme-dark body.ys .theme-form-stack input.form-control.contact-input::placeholder {
    color: rgba(230, 234, 242, 0.45) !important;
}

html.theme-dark body.ys .theme-item-form-wrap .theme-item-badges .badge-soft,
html.theme-dark body.ys .theme-item-form-wrap .theme-item-badges .badge-soft-success,
html.theme-dark body.ys .theme-item-form-wrap .theme-item-badges .badge-soft-info,
html.theme-dark body.ys .theme-item-form-wrap .theme-item-badges .badge-soft-primary {
    background: linear-gradient(135deg, #2b3448 0%, #252d3f 52%, #202736 100%) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: var(--dm-text-2) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.42) !important;
}

html.theme-dark body.ys .theme-form-stack .sku.is-primary {
    border-color: #ffffff !important;
    background: linear-gradient(135deg, #8a8db0 0%, #7d80a0 55%, #6e7192 100%) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .theme-form-stack .sku.is-primary:hover {
    background: linear-gradient(135deg, #9497bb 0%, #8a8db0 55%, #7d80a0 100%) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .change-num-sub,
html.theme-dark body.ys .change-num-add {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .captcha-img,
html.theme-dark body.ys .input-group-text.captcha-img {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .form-control::placeholder,
html.theme-dark body.ys input::placeholder,
html.theme-dark body.ys textarea::placeholder {
    color: rgba(230, 234, 242, 0.42) !important;
}

/* ============================================================
   七、支付
   ============================================================ */
html.theme-dark body.ys .cash-pay,
html.theme-dark body.ys .cash-pay--independent {
    background-color: var(--dm-surface-2) !important;
    background-image: linear-gradient(var(--dm-surface-2), var(--dm-surface-2)) !important;
    border: 1px solid var(--dm-border) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .pay-list .pay {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: linear-gradient(135deg, #2b3448 0%, #252d3f 52%, #202736 100%) !important;
    color: var(--dm-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 18px rgba(0, 0, 0, 0.42) !important;
}

html.theme-dark body.ys .pay-list .pay span,
html.theme-dark body.ys .pay-list .pay .pay-name {
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .pay-list .pay:hover {
    border-color: rgba(255, 255, 255, 0.24) !important;
    background: linear-gradient(135deg, #323c53 0%, #2b3448 55%, #252d3f 100%) !important;
    color: #ffffff !important;
    transform: none !important;
}

html.theme-dark body.ys .pay-list .pay:hover span {
    color: #ffffff !important;
}

html.theme-dark body.ys .pay-list .pay.selected,
html.theme-dark body.ys .pay-list .pay.active,
html.theme-dark body.ys .pay-list .pay.pay-selected,
html.theme-dark body.ys .pay-list .pay.is-active,
html.theme-dark body.ys .cash-pay .pay.is-active {
    border-color: #ffffff !important;
    background: linear-gradient(135deg, #8a8db0 0%, #7d80a0 55%, #6e7192 100%) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 24px rgba(0, 0, 0, 0.5) !important;
    transform: none !important;
}

html.theme-dark body.ys .pay-list .pay.selected span,
html.theme-dark body.ys .pay-list .pay.active span,
html.theme-dark body.ys .pay-list .pay.pay-selected span,
html.theme-dark body.ys .pay-list .pay.is-active span {
    color: #ffffff !important;
}

html.theme-dark body.ys .pay-list .pay img {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   八、订单 / 订单查询
   ============================================================ */
html.theme-dark body.ys .order-amount {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .order-basic {
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .goods-section,
html.theme-dark body.ys .goods-thumb,
html.theme-dark body.ys .card-section .card-header,
html.theme-dark body.ys .card-display {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .btn-unified {
    background: var(--dm-primary) !important;
    border-color: var(--dm-primary) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .btn-unified:hover {
    background: var(--dm-primary-hover) !important;
    border-color: var(--dm-primary-hover) !important;
}

html.theme-dark body.ys .btn-copy-card,
html.theme-dark body.ys .cyber-back-btn,
html.theme-dark body.ys .btn-copy-unified {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .order-copy-btn,
html.theme-dark body.ys .order-copy-btn i {
    color: #7fb0ff !important;
    --fa-primary-color: #7fb0ff;
    --fa-secondary-color: #7fb0ff;
}

html.theme-dark body.ys .theme-description-body a {
    background: transparent !important;
    color: #7fb0ff !important;
}

html.theme-dark body.ys .theme-description-body a:hover {
    color: #a9c8ff !important;
}

html.theme-dark body.ys .theme-description-body blockquote,
html.theme-dark body.ys .theme-description-body blockquote.red,
html.theme-dark body.ys .theme-description-body blockquote.blue,
html.theme-dark body.ys .theme-description-body blockquote.blud,
html.theme-dark body.ys .theme-description-body blockquote.green,
html.theme-dark body.ys .theme-description-body blockquote.cyan,
html.theme-dark body.ys .theme-description-body blockquote.has-xn-quote-accent,
html.theme-dark body.ys .theme-description-body blockquote[style*="border-left-color"],
html.theme-dark body.ys .theme-description-body blockquote[style*="border-color"] {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .cyber-note,
html.theme-dark body.ys .theme-payment-notice {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .theme-payment-notice a {
    color: #7fb0ff !important;
}

/* ============================================================
   九、弹窗 / 表格类插件（layer、layui、bootstrap-table）
   ============================================================ */
html.theme-dark body .theme-layer-popup.layui-layer,
html.theme-dark body.ys .layui-layer.layui-layer-page,
html.theme-dark body.ys .component-popup,
html.theme-dark body.ys .theme-notice-popup-inner {
    background: var(--dm-surface) !important;
    color: var(--dm-text) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body .theme-layer-popup .theme-notice-modal-head,
html.theme-dark body.ys .layui-layer-title {
    background: var(--dm-surface-3) !important;
    color: var(--dm-text) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-container {
    border-color: var(--dm-border) !important;
    background: var(--dm-surface) !important;
    box-shadow: none !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-container .table thead th {
    background: var(--dm-surface-3) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-container .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-container .table tbody tr.selected td {
    background: rgba(255, 255, 255, 0.08) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-container .table td {
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-container .fixed-table-body .fixed-table-loading {
    background: rgba(18, 25, 38, 0.86) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-pagination > .pagination-detail .page-list .btn-group .btn,
html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-pagination > .pagination ul.pagination .page-item .page-link {
    background: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-muted) !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-pagination > .pagination ul.pagination .page-item.active .page-link {
    background: var(--dm-primary) !important;
    border-color: var(--dm-primary) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .component-popup .bootstrap-table .fixed-table-pagination > .pagination ul.pagination .page-item.disabled .page-link {
    background: var(--dm-surface-3) !important;
    color: rgba(152, 162, 182, 0.6) !important;
}

html.theme-dark body.ys .component-popup .hex-query-form,
html.theme-dark body.ys .component-popup .table-search {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
    box-shadow: none !important;
}

html.theme-dark body.ys .component-popup .hex-query-form .layui-input,
html.theme-dark body.ys .component-popup .table-search .layui-input {
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .layui-layer .layui-layer-content {
    color: var(--dm-text);
}

html.theme-dark body.ys .theme-image-layer,
html.theme-dark body.ys .component-popup .layui-layer-btn {
    background: var(--dm-surface) !important;
    color: var(--dm-text) !important;
}

html.theme-dark body.ys .theme-item-cover-hint {
    background: rgba(18, 25, 38, 0.82) !important;
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .theme-table-loading {
    background: rgba(12, 17, 26, 0.72) !important;
    color: var(--dm-text-2) !important;
}

html.theme-dark body.ys .theme-user-avatar {
    background: #1d2637 !important;
}

/* ============================================================
   十、页脚 / 回到顶部 / 杂项
   ============================================================ */
html.theme-dark body.ys .theme-footer-wrap {
    background: rgba(18, 25, 38, 0.94) !important;
    border-color: var(--dm-border) !important;
}

html.theme-dark body.ys .theme-footer-copy,
html.theme-dark body.ys .theme-footer-icp {
    color: var(--dm-muted) !important;
}

html.theme-dark body.ys .theme-back-to-top,
html.theme-dark body.ys #backToTop {
    border-color: var(--dm-border-strong) !important;
    background: var(--dm-surface-2) !important;
    color: var(--dm-text) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55) !important;
}

html.theme-dark body.ys .theme-back-to-top:hover,
html.theme-dark body.ys #backToTop:hover {
    background: var(--dm-primary) !important;
    border-color: var(--dm-primary) !important;
    color: #ffffff !important;
}

html.theme-dark body.ys .theme-back-to-top i {
    color: inherit;
}

html.theme-dark body.ys ::selection {
    background: rgba(125, 128, 160, 0.45);
    color: #ffffff;
}

html.theme-dark,
html.theme-dark body.ys,
html.theme-dark body.ys * {
    scrollbar-color: #3c465c #0f1520;
}

html.theme-dark body.ys ::-webkit-scrollbar-track {
    background: #0f1520 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

html.theme-dark body.ys ::-webkit-scrollbar-thumb {
    min-height: 34px;
    border: 2px solid #0f1520 !important;
    border-radius: 999px;
    background: linear-gradient(180deg, #3c465c 0%, #2a3242 100%) !important;
    box-shadow: none;
}

html.theme-dark body.ys ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4c5873 0%, #38415a 100%) !important;
}

/* 移动端 */
@media only screen and (max-width: 767px) {
    html.theme-dark body.ys .theme-nav-link {
        background: var(--dm-surface-2) !important;
    }

    html.theme-dark body.ys .theme-sidebar-panel,
    html.theme-dark body.ys .theme-sidebar-panel .panel-header,
    html.theme-dark body.ys .theme-sidebar-panel .panel-body {
        background: transparent !important;
        background-image: none !important;
    }

    html.theme-dark body.ys .theme-catalog-tools .theme-search-combo .theme-searchbox.theme-searchbox-combo {
        background: var(--dm-surface-2) !important;
        border: 1px solid var(--dm-border) !important;
    }
}

/* 分类名 / 商品标题的按图配色：夜间用 Index.js 输出的原始亮色（浅色模式由 theme-custom.css 取加深色） */
html.theme-dark .theme-category-name.has-accent-color,
html.theme-dark .theme-commodity-name.has-accent-color {
    color: var(--theme-accent-text) !important;
}

/* 手机端：分类卡片标题块沿用同款灰底横幅（夜间同样生效，与商品目录标题条一致） */
@media (max-width: 767.98px) {
    html.theme-dark body.ys .theme-sidebar-panel > .panel-header {
        background: linear-gradient(90deg, rgba(18, 24, 46, 0.76), rgba(7, 10, 20, 0.44)) !important;
        border-radius: 0;
    }

    /* 夜间：分类卡片本体补上深色底，避免卡片区域透出后面的浅色页面背景 */
    html.theme-dark body.ys .theme-sidebar-panel.panel {
        background: var(--dm-surface) !important;
        background-image: none !important;
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
    }

    /* 夜间：商品目录（商品列表）内容区补上深色底，商品卡片之间的空隙不再透出浅色背景 */
    html.theme-dark body.ys .theme-catalog-panel > .panel-body {
        background: var(--dm-surface) !important;
        background-image: none !important;
        border-radius: 0 0 24px 24px;
    }
}

/* ============================================================
   五、夜间：桌面端页面背景 / 面板底
   站点背景图（/assets/user/img/theme-bg.webp）是浅色图，夜间若不关闭会整片盖住深色底，
   表现为「夜间模式背景还是白的」；这里在夜间直接换回纯深色底。
   ============================================================ */
html.theme-dark body.theme-theme.ys,
html.theme-dark body.ys {
    background-image: none !important;
    background-color: var(--dm-bg-deep) !important;
}

/* 面板在桌面端沿用半透明浅色变量，夜间统一改为深色面板底 */
html.theme-dark body.ys .panel,
html.theme-dark body.ys .panel > .panel-body,
html.theme-dark body.ys .panel .theme-catalog-body {
    background-color: var(--dm-surface) !important;
    background-image: none !important;
}
