/* 商城前台表单使用独立的控件颜色，保持与浅色卡片的对比。 */
:root {
    --shop-field-bg: #f8fafc;
    --shop-field-border: #7d899a;
    --shop-field-ink: #1f2733;
    --shop-field-placeholder: #5e6a7c;
    --shop-field-focus: #2563b8;
    --shop-field-ring: rgb(37 99 184 / 18%);
}

:root[data-theme="dark"],
:root[data-bs-theme="dark"] {
    --shop-field-bg: #252e3b;
    --shop-field-border: #8392a7;
    --shop-field-ink: #f1f5fb;
    --shop-field-placeholder: #b0bed0;
    --shop-field-focus: #92c2ff;
    --shop-field-ring: rgb(146 194 255 / 24%);
}

/* 数量、验证码和顶部搜索的边框由外层控制，避免重复描边。 */
.uc-body :is(.shop-search__box, .qty-group, .captcha-group),
.uc-body :is(.form-control, .form-select):not(:where(.tb-blog *, .qty-group *, .captcha-group *)),
.auth-card .form-floating > .form-control {
    background-color: var(--shop-field-bg) !important;
    border-color: var(--shop-field-border) !important;
    color: var(--shop-field-ink) !important;
}

.uc-body :is(.form-control, .item-search-input):not(:where(.tb-blog *))::placeholder {
    color: var(--shop-field-placeholder) !important;
    opacity: 1;
}

.auth-card .form-floating > label {
    color: var(--shop-field-placeholder);
}

.auth-card .form-floating > .form-control:focus ~ label,
.auth-card .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--shop-field-placeholder);
}

.auth-card .form-floating > label::after {
    background-color: transparent;
}

.uc-body :is(.shop-search__box, .qty-group, .captcha-group):focus-within,
.uc-body :is(.form-control, .form-select):not(:where(.tb-blog *, .qty-group *, .captcha-group *)):focus,
.auth-card .form-floating > .form-control:focus {
    border-color: var(--shop-field-focus) !important;
    box-shadow: 0 0 0 3px var(--shop-field-ring) !important;
}

.uc-body .qty-group .change-num-sub { border-inline-end: 1px solid var(--shop-field-border); }
.uc-body .qty-group .change-num-add { border-inline-start: 1px solid var(--shop-field-border); }
.uc-body .qty-group button:focus-visible { outline: 2px solid var(--shop-field-focus); outline-offset: -3px; }

/* 支付方式卡片使用独立边框，避免玻璃背景下选项和页面融在一起。 */
.uc-body .cash-pay {
    border-color: var(--shop-field-border) !important;
}

.uc-body .pay-list .pay {
    background: var(--shop-field-bg) !important;
    border: 1px solid var(--shop-field-border) !important;
    color: var(--shop-field-ink) !important;
    box-shadow: 0 1px 2px rgb(31 39 51 / 8%);
}

.uc-body .pay-list .pay span {
    color: var(--shop-field-ink) !important;
}

.uc-body .pay-list .pay:hover,
.uc-body .pay-list .pay:focus-visible {
    border-color: var(--shop-field-focus) !important;
    background: color-mix(in srgb, var(--shop-field-focus) 8%, var(--shop-field-bg)) !important;
    box-shadow: 0 0 0 3px var(--shop-field-ring), 0 2px 6px rgb(31 39 51 / 10%);
    transform: translateY(-1px);
}

.uc-body .pay-list .pay.selected {
    border-color: var(--shop-field-focus) !important;
    background: color-mix(in srgb, var(--shop-field-focus) 14%, var(--shop-field-bg)) !important;
    box-shadow: 0 0 0 2px var(--shop-field-ring);
}

.uc-body .pay-list .pay.selected span {
    color: var(--shop-field-ink) !important;
}

/* 首页购买分类沿用前台控件配色，保留三种可辨认的状态。 */
.uc-body .chip-list > .switch-category {
    box-sizing: border-box;
    min-height: 40px;
    max-width: 100%;
    height: auto;
    padding: 7px 13px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--shop-field-ink);
    background: var(--shop-field-bg);
    border-color: var(--shop-field-border);
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

@media (hover: hover) {
    .uc-body .chip-list > .switch-category:not(.is-primary, .is-disabled):hover {
        border-color: var(--shop-field-focus);
        background: color-mix(in srgb, var(--shop-field-focus) 8%, var(--shop-field-bg));
    }
}

.uc-body .chip-list > .switch-category:focus-visible {
    outline: 2px solid var(--shop-field-focus);
    outline-offset: 2px;
}

.uc-body .chip-list > .switch-category.is-primary:not(.is-disabled) {
    color: var(--md-on-primary);
    background: var(--md-primary);
    border-color: var(--md-primary);
    box-shadow: 0 2px 6px rgba(var(--md-primary-rgb), .2);
}

.uc-body .chip-list > .switch-category.is-disabled {
    opacity: 1;
    filter: none;
    color: var(--shop-field-placeholder);
    background: transparent;
    border-style: dashed;
    border-color: var(--shop-field-border);
    box-shadow: none;
}

.uc-body .chip-list > .switch-category.is-disabled .chip-icon {
    filter: grayscale(1);
    opacity: .65;
}

@media (max-width: 575px), (pointer: coarse) {
    .uc-body .chip-list > .switch-category {
        min-height: 44px;
        padding-inline: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .uc-body .chip-list > .switch-category {
        transition: none;
    }
}

/* 订单查询输入区：桌面居中，手机端改为上下排列，避免输入框被横排按钮挤窄。 */
.uc-body .order-query-form {
    width: 100%;
}

.uc-body .order-query-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: min(100%, 520px);
    margin: 0 auto;
}

.uc-body .order-query-field {
    flex: 1 1 auto;
    min-width: 0;
    width: 300px;
}

.uc-body .order-query-field .form-control {
    width: 100%;
}

.uc-body .order-query-controls .btn-search-query {
    flex: 0 0 auto;
}

@media (max-width: 575px), (pointer: coarse) {
    .uc-body .order-query-controls {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .uc-body .order-query-field {
        width: 100%;
    }

    .uc-body .order-query-controls .btn-search-query {
        width: 100%;
        min-height: 44px;
    }
}
