/* 将证书站配色映射到商城现有组件，保留布局、商品图片和状态颜色。 */
html[data-front-theme] {
  --front-readable-accent: var(--color-link);
  --front-action-color: var(--color-accent-dark);
  --front-action-text: #fff;
  --front-nav-background: var(--bg-card);
  --front-theme-overlay: rgba(20, 25, 30, .4);
}

html[data-front-theme].front-night {
  --front-action-color: var(--color-accent-light);
  --front-action-text: var(--bg-page);
  --front-theme-overlay: rgba(0, 0, 0, .58);
}

html[data-front-theme],
html[data-front-theme] body.front-frame-page,
html[data-front-theme] body.front-frame-page > .front-app-frame {
  --bg: var(--bg-page);
  --paper: var(--bg-card);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-color);
  --soft: var(--bg-secondary);
  --accent: var(--front-readable-accent);
  --accent-2: var(--front-readable-accent);
  --front-frame-outside: var(--bg-page);
  --front-design-canvas: var(--bg-page);
  --front-design-paper: var(--bg-card);
  --front-design-paper-soft: var(--bg-secondary);
  --front-design-ink: var(--text-primary);
  --front-design-muted: var(--text-secondary);
  --front-design-line: var(--border-color);
  --front-design-line-strong: var(--border-color-strong);
  --front-design-accent: var(--front-readable-accent);
  --store-canvas: var(--bg-page);
  --store-surface: var(--bg-card);
  --store-surface-muted: var(--bg-secondary);
  --store-ink: var(--text-primary);
  --store-muted: var(--text-secondary);
  --store-line: var(--border-color);
  --store-line-strong: var(--border-color-strong);
  --store-action: var(--front-action-color);
  --download-paper: var(--bg-card);
  --download-ink: var(--text-primary);
  --download-muted: var(--text-secondary);
  --download-line: var(--border-color);
  --download-soft: var(--bg-secondary);
  --promotion-ink: var(--text-primary);
  --promotion-muted: var(--text-secondary);
  --promotion-line: var(--border-color-strong);
  --promotion-paper: var(--bg-card);
  --promotion-soft: var(--bg-secondary);
  --promotion-accent: var(--front-readable-accent);
  --promotion-accent-soft: var(--color-accent-bg);
  --promotion-action: var(--front-action-color);
  --promotion-action-text: var(--front-action-text);
}

html[data-front-theme].front-fixed-background-root {
  background: var(--bg-page) !important;
}

html[data-front-theme].front-fixed-background-root::before {
  /* 沿用证书站顶部的原始渐变、500px 高度和渐隐范围。 */
  bottom: auto;
  width: min(var(--front-design-frame-width, 430px), 100%);
  height: 500px;
  margin-inline: auto;
  background: var(--gradient-header) !important;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 40%, transparent 100%);
}

html[data-front-theme].front-frame-root body.front-frame-page {
  color: var(--text-primary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame,
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame > .front-app-content,
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame > .front-app-content > .front-page-layer {
  background: transparent !important;
  color: var(--text-primary);
  z-index: auto !important;
  isolation: auto !important;
}

/* 统一表单、卡片及弹层的底色，售后会话与消息列表仍保持原有布局。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .product-card, .product-body, .guess-card, .user-product-card, .user-follow-card, .user-order-card,
  .hero-panel, .result-box, .notice, .download-card, .download-note,
  .product-summary, .product-summary-content, .product-support-section,
  .detail-section, .shop-section, .product-gift-item,
  .user-section-band, .user-price-item, .user-code-item, .user-wallet-log,
  .profile-group-panel, .wallet-panel, .user-subsite-panel, .user-subsite-section,
  .user-invite-card, .user-invite-income, .user-withdraw-card, .user-withdraw-balance,
  .modal-card, .user-order-sheet, .user-authorization-panel, .security-dialog-sheet,
  .tag-filter-sheet, .home-tag-sheet, .product-combo-menu, .combo-menu,
  .message-search, .message-conversation, .message-dialog > section,
  .message-order-choice, .message-more-panel span, .redeem-hero, .redeem-panel,
  .home-followed-store-card, .home-tag-picker-card
) {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .user-order-card h3, .user-order-sheet h2, .user-order-sheet h3,
  .profile-identity-copy strong, .profile-setting-row > span, .profile-security-row,
  .profile-group h2, .profile-row-label, .wallet-panel h2, .wallet-record-copy strong,
  .message-conversation-head strong, .message-dialog h2, .message-order-choice strong,
  .user-common-section h2, .insight-item strong
) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .profile-group-note, .profile-identity-copy > span, .profile-row-value,
  .wallet-record-copy small, .wallet-record-time, .wallet-totals span,
  .message-conversation-copy p, .message-conversation-head time, .message-empty,
  .message-system, .message-order-choice small, .user-empty-state, .insight-item small
) {
  color: var(--text-secondary) !important;
}

/* 商品详情与订单卡片一样使用无描边、无外阴影的表面。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page :is(
  .product-hero-image, .product-summary, .product-summary-content,
  .product-support-section, .detail-section, .shop-section
) {
  border: 0 !important;
  box-shadow: none !important;
}

/* 订单内部区块与外层使用同一主题，避免暗色卡片中仍出现固定白底。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .user-order-product, .user-order-summary, .user-order-code
) {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .user-order-shop-name > strong, .user-order-copy h2, .user-order-price,
  .user-order-summary strong, .user-order-code code, .user-order-card-value
) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .user-order-copy time, .user-order-price > span, .user-order-countdown,
  .user-order-group-summary
) {
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-source,
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-group-empty {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-actions :is(a, button) {
  background: var(--bg-card) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-actions :is(.primary, .danger) {
  background: rgba(232, 79, 112, .08) !important;
  border-color: rgba(232, 79, 112, .45) !important;
  color: #e84f70 !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-actions .external-redeem {
  background: rgba(201, 117, 30, .08) !important;
  border-color: rgba(201, 117, 30, .45) !important;
  color: var(--color-gold-value) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-actions .disabled {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-reject {
  background: rgba(232, 79, 112, .08) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .user-order-reject p {
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .input, .select, .textarea, .buyer-auth-field input,
  .wallet-custom-input, .message-compose-input
) {
  background-color: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
  caret-color: var(--front-readable-accent);
}

/* 首页筛选和商品卡片也跟随选色，保留分类、活动与稀有度标签的含义。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-glass-brand, .home-glass-icon, .home-glass-search-field
) {
  background: var(--pill-bg) !important;
  border-color: var(--pill-border) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-glass-brand :is(span, strong) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-primary-filter, .home-category-item, .home-tag-filters button,
  .home-tag-picker-options button, .home-tag-toggle, .home-tag-picker-actions button,
  .user-order-tabs button, .product-body .heat
) {
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-primary-filter.active, .home-primary-filter.active span, .home-category-item.active,
  .user-order-tabs button.active
) {
  color: var(--front-readable-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-primary-indicator, .user-order-tab-indicator
) {
  background: var(--color-accent) !important;
}

/* 沿用参考站的外侧虚线圈和八秒旋转，图片只随选中状态轻微缩放。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-strip {
  padding: 10px 4px 6px;
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item {
  --home-category-image-size: 50px;
  position: relative;
  gap: 9px;
  transition: color .24s ease;
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item img {
  transition: transform .28s cubic-bezier(.22, .8, .24, 1), box-shadow .24s ease;
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item::after {
  content: '';
  position: absolute;
  top: -4px;
  left: calc(50% - (var(--home-category-image-size) + 8px) / 2);
  width: calc(var(--home-category-image-size) + 8px);
  height: calc(var(--home-category-image-size) + 8px);
  box-sizing: border-box;
  border: 2px dashed var(--color-accent);
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  scale: .76;
  animation: home-category-spin 8s linear infinite paused;
  transition: opacity .24s ease, scale .32s cubic-bezier(.22, .8, .24, 1);
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item.active::after {
  opacity: .45;
  scale: 1;
  animation-play-state: running;
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item.active img {
  border-color: transparent;
  box-shadow: none;
  transform: scale(1.035);
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item:active img {
  transform: scale(.96);
}
@keyframes home-category-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 360px) {
  html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item { --home-category-image-size: 46px; }
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-tag-filters button, .home-offer-filters button, .home-tag-picker-options button,
  .home-tag-toggle, .home-tag-picker-actions button
) {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-tag-filters button.active, .home-offer-filters button.active,
  .home-tag-picker-options button.active
) {
  background: var(--color-accent-bg) !important;
  border-color: var(--color-tag-border) !important;
  color: var(--front-readable-accent) !important;
}

/* 首页与店铺标签去掉描边，夜间保留原配色。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-tag-filters button, .home-tag-filters button.active,
  .home-tag-picker-options button, .home-tag-picker-options button.active
) {
  border: 0 !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* 店铺筛选标签沿用首页的主题配色，覆盖旧版固定紫色与选中阴影。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.public-shop-page #shopTagFilters button {
  background: var(--bg-secondary) !important;
  border: 0 !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.public-shop-page #shopTagFilters button.active {
  background: var(--color-accent-bg) !important;
  border-color: var(--color-tag-border) !important;
  color: var(--front-readable-accent) !important;
}

/* 浅色主题未选中为白底，选中填充当前主题色。 */
html[data-front-theme]:not(.front-night).front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-tag-filters button, #shopTagFilters button
) {
  background: #fff !important;
}
html[data-front-theme]:not(.front-night).front-frame-root body.front-frame-page > .front-app-frame :is(
  .home-tag-filters button.active, #shopTagFilters button.active
) {
  background: var(--color-accent) !important;
  color: var(--text-on-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  #homeTagConfirm, .redeem-submit
) {
  background: var(--front-action-color) !important;
  color: var(--front-action-text) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .redeem-field input, .redeem-field select
) {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .redeem-field > span:first-child {
  color: var(--text-secondary);
}

/* 两个推荐区保留原有粉色和金色，暗色时使用对应的深色底。 */
html[data-front-theme] body.home-step-header-only .home-feature-heading h2 {
  color: #25241f !important;
}

html[data-front-theme].front-night body.home-step-header-only .home-feature-stores {
  background: linear-gradient(160deg, #442735, var(--bg-card)) !important;
}

html[data-front-theme].front-night body.home-step-header-only .home-feature-weekly {
  background: linear-gradient(160deg, #453b20, var(--bg-card)) !important;
}

html[data-front-theme].front-night body.home-step-header-only :is(.home-feature-heading h2, .home-feature-item strong) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-night body.home-step-header-only .home-feature-empty {
  color: var(--text-secondary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(input, textarea)::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .account-page-topbar, .buyer-preview-app .topbar, .message-topbar,
  .product-detail-topbar, .public-shop-topbar
) {
  background: var(--header-glass-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .account-page-topbar h1, .account-page-topbar a, .account-page-topbar button,
  .buyer-preview-app .topbar .brand, .message-topbar h1
) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page .public-bottom-nav {
  background: var(--front-nav-background) !important;
  border-color: var(--border-color) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page .public-bottom-nav :is(a, button) {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page .public-bottom-nav :is(a, button).active {
  color: var(--front-readable-accent) !important;
}

/* 选中与未选中图标直接展示原 SVG，也覆盖旧夜间样式的黑色滤镜。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .public-bottom-nav :is(a, button) .public-nav-icon {
  filter: none !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .btn.primary, .btn.dark, .profile-save-button, .buyer-auth-submit,
  .user-order-sheet footer .primary, .user-authorization-save,
  .quick-float-btn, .product-buy-btn, .product-action-buy, .wallet-pay-button
) {
  background: var(--front-action-color) !important;
  border-color: transparent !important;
  color: var(--front-action-text) !important;
}

/* 三个进店入口与立即购买使用相同深色配色，保留无描边胶囊。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .product-bottom-buy {
  background: var(--gradient-btn-dark) !important;
  color: var(--color-btn-dark-text) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(.shop-enter-btn, .home-followed-store-enter, .user-follow-enter) {
  background: var(--gradient-btn-dark) !important;
  color: var(--color-btn-dark-text) !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  outline: none !important;
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(.shop-enter-btn, .home-followed-store-enter, .user-follow-enter):focus-visible {
  outline: 2px solid var(--color-accent) !important;
  outline-offset: 3px;
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-summary .product-tag {
  border: 0 !important;
  box-shadow: none !important;
}
html[data-front-theme].front-night.front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-hero-image::after {
  content: none;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .category-row .pill.active, .home-category-row button.active,
  .wallet-record-tabs button.active, .wallet-amount-button.active
) {
  background: var(--color-accent-bg) !important;
  border-color: var(--color-tag-border) !important;
  color: var(--front-readable-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .sort-row .pill.active, .profile-row-action, .message-search button,
  .user-subsite-tabs button.active, .user-invite-tabs button.active
) {
  color: var(--front-readable-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .sort-row .pill.active::after, .user-invite-tabs button.active::after,
  .user-subsite-tabs button.active::after
) {
  background-color: var(--color-accent);
}

/* 会员、钱包沿用证书站的浅金横条和深色授权按钮。 */
html[data-front-theme] body.user-home-page #buyerAppView :is(.identity, .identity-name strong, .quick-item strong) {
  color: var(--text-primary) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView .identity-uid {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

html[data-front-theme] body.user-home-page #buyerAppView #buyerAuthorizationOpen {
  background: var(--gradient-btn-dark) !important;
  color: var(--color-btn-dark-text) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView .balance-band {
  background: var(--gradient-golden-pill) !important;
  border-color: var(--color-gold-divider) !important;
}

/* 用户中心沿用证书站紧凑功能区和并排推广入口。 */
html[data-front-theme] body.user-home-page #buyerAppView .account-card-stack { margin:8px 12px 0; padding:8px 0 0; }
html[data-front-theme] body.user-home-page #buyerAppView .identity { padding:0 8px 20px !important; }
html[data-front-theme] body.user-home-page #buyerAppView .balance-band { min-height:48px; border:0; border-radius:14px; background:var(--gradient-golden-pill) !important; box-shadow:none; }
html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item { min-height:48px; padding:12px 14px; gap:7px; }
html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item span { font-size:12px; }
html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item strong { font-size:14px; line-height:1.25; }
html[data-front-theme] body.user-home-page #buyerAppView .content { gap:10px; padding-top:12px; }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsules { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; min-width:0; --profile-illus-soft:color-mix(in srgb,var(--color-accent-light) 40%,var(--bg-card)); }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule,
html[data-front-theme] body.user-home-page #buyerAppView #buyerInviteSummary { display:flex; align-items:center; justify-content:space-between; min-width:0; min-height:64px; margin:0; padding:0 8px 0 14px !important; border:1px solid var(--header-capsule-border) !important; border-radius:14px; background:var(--gradient-capsule-invite) !important; color:var(--text-primary); box-shadow:none; text-decoration:none; text-align:left; cursor:pointer; font:inherit; }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule.hidden { display:none !important; }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule > span { display:flex; flex-direction:column; gap:4px; min-width:0; }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule strong { font-size:13px; font-weight:600; color:var(--text-primary); white-space:nowrap; }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule small { font-size:10px; line-height:1.5; color:var(--text-muted); }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule > svg { flex:0 0 48px; width:48px; height:48px; margin-left:3px; }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsules:has(> :only-child),
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsules:has(> .hidden) { grid-template-columns:minmax(0,1fr); }
html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsules:has(> .hidden + .hidden) { display:none; }
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .user-account-functions { padding:12px 4px 10px; }
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .user-service-functions { gap:16px 0; padding:12px 4px 14px; }
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .quick-icon img { width:24px; height:24px; filter:var(--icon-theme-filter,none) !important; }
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .quick-item strong { font-size:12px; font-weight:500; }
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions h2 { padding:12px 16px 0; font-size:14px; font-weight:700; }
html[data-front-theme] img[src^="/assets/user-commerce/"]:not(.public-nav-icon) { filter:var(--icon-theme-filter,none) !important; }
@media(max-width:360px) {
  html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item { padding:10px 9px; gap:5px; }
  html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item strong { font-size:12px; }
  html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .quick-item strong { font-size:11px; }
  html[data-front-theme] body.user-home-page #buyerAppView .profile-action-capsule > svg { flex-basis:40px; width:40px; height:40px; }
}

html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item {
  color: var(--color-gold-label) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item strong {
  color: var(--color-gold-value) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView .account-summary-item + .account-summary-item::before {
  background: var(--color-gold-divider);
}

html[data-front-theme] body.user-home-page #buyerAppView .user-common-section,
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .user-account-functions,
html[data-front-theme] body.user-home-page #buyerAppView #buyerCommonFunctions .user-tool-services {
  background-color: var(--bg-card) !important;
}

/* 仅调整界面图标，商品图、头像、视频和用户上传图片保留原色。 */
html[data-front-theme] body.user-home-page #buyerAppView .quick-icon {
  color: var(--front-readable-accent) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView :is(.quick-icon, .top-actions .icon-button) img,
html[data-front-theme].front-night body.front-frame-page .account-page-topbar button img {
  filter: var(--icon-theme-filter,none) !important;
}

/* 图片本身保留原色，留白区域与公告共用透明磨砂效果。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-hero-image {
  background: linear-gradient(168deg,rgba(255,255,255,.78),rgba(255,255,255,.42) 42%,rgba(248,250,255,.5)) !important;
  backdrop-filter: blur(44px) saturate(210%) brightness(1.06);
  -webkit-backdrop-filter: blur(44px) saturate(210%) brightness(1.06);
}
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page :is(.product-hero-trigger, .product-image-track, .product-main-image, .product-hero-trigger img) {
  background: transparent !important;
}
html[data-front-theme].front-night.front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-hero-image {
  background: linear-gradient(168deg,rgba(40,43,48,.78),rgba(30,32,36,.5)) !important;
}

html[data-front-theme] body.front-frame-page > .front-app-frame.buyer-page .buyer-auth-theme-toggle {
  position: absolute;
  top: 16px;
  right: 12px;
  z-index: 2;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  color: var(--front-readable-accent) !important;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

html[data-front-theme] body.front-frame-page > .front-app-frame.buyer-page #buyerLoginView {
  position: relative;
}

/* 顶部沿用证书站的渐变圆圈，切换后立即显示当前主题。 */
html[data-front-theme] body.front-frame-page :is([data-front-theme-open], [data-buyer-theme-toggle]):has([data-front-theme-swatch]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  opacity: .72;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
}

html[data-front-theme] body.front-frame-page [data-front-theme-swatch] {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: var(--front-theme-preview, linear-gradient(135deg,#dcf9ed,#4da58a));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

html[data-front-theme] body.front-frame-page :is([data-front-theme-open], [data-buyer-theme-toggle]):has([data-front-theme-swatch]):active {
  transform: scale(.9);
  opacity: 1;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell :is(.buyer-auth-card, .buyer-auth-field) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-primary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell :is(.buyer-auth-heading h1, .buyer-auth-brand) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell :is(.buyer-auth-heading p, .buyer-auth-links, .buyer-auth-switch, .buyer-auth-divider, .buyer-auth-steps > span) {
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell :is(.buyer-auth-links button, .buyer-auth-switch button, .buyer-auth-steps > span.active) {
  color: var(--front-readable-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-divider::before,
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-divider::after,
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-steps > em {
  background: var(--border-color-strong) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-steps b {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  box-shadow: none;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-steps .active b {
  background: var(--front-action-color);
  color: var(--front-action-text);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-submit {
  background: var(--front-action-color) !important;
  color: var(--front-action-text) !important;
  box-shadow: none !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-field input {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .buyer-auth-shell .buyer-auth-field input:focus {
  border-color: var(--color-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .message-composer {
  background: var(--bg-card) !important;
  color: var(--text-primary);
}

/* 固定在页面外层的订单、授权和会员弹窗，也与页面使用同一套配色。 */
html[data-front-theme].front-frame-root body.front-frame-page :is(
  .user-order-sheet, .user-authorization-panel, .community-sheet-panel,
  #buyerRechargeModal .modal-card, #buyerMembershipModal .modal-card
) {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page :is(.user-order-sheet, .user-authorization-panel, .community-sheet-panel) :is(h2, h3, strong, label) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page :is(.user-order-sheet, .user-authorization-panel, .community-sheet-panel) :is(.input, .select, .textarea) {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page :is(
  .user-order-sheet > header, .user-order-sheet > footer, .user-order-sheet-head,
  .user-order-sheet-foot, .user-order-sheet-product, .user-blind-code-sheet
) {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page .user-order-detail-list dd {
  color: var(--text-primary);
}

html[data-front-theme].front-frame-root body.front-frame-page :is(.user-order-detail-list dt, .user-order-detail-paid > span) {
  color: var(--text-secondary);
}

html[data-front-theme].front-frame-root body.front-frame-page :is(
  .user-authorization-panel .user-wechat-field input,
  .user-authorization-panel .user-wechat-capsule,
  .user-authorization-panel .user-identity-capsule,
  #buyerMembershipModal .buyer-membership-summary,
  #buyerMembershipModal .buyer-membership-package,
  #buyerMembershipModal .input
) {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page :is(
  .user-authorization-panel .user-wechat-field b,
  .user-authorization-panel .user-identity-capsule code,
  #buyerMembershipModal strong,
  #buyerMembershipModal .modal-head
) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page :is(
  .user-authorization-save, #buyerMembershipModal .btn.primary,
  #buyerMembershipModal .buyer-membership-package button
) {
  background: var(--front-action-color) !important;
  color: var(--front-action-text) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page #buyerMembershipModal :is(.modal-head, .modal-foot) {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView #buyerLogout strong {
  color: #df6678 !important;
}

html[data-front-theme].front-frame-root body.front-frame-page #orderSearchForm {
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* 页顶露出页面渐变；向下浏览时使用实色底，避免订单内容透过顶栏。 */
html[data-front-theme].front-frame-root.account-header-scrolled body.front-frame-page #orderSearchForm {
  background: var(--bg-card) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page #toggleOrderSearch {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView .insight-item {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme] body.user-home-page #buyerAppView .icon-button svg {
  width: 21px;
  height: 21px;
}

/* 内嵌表单沿用原来的透明输入布局，避免深色下出现额外的方块底色。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .profile-setting-row .input,
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-amount-field input {
  background: transparent !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .profile-group-panel > :not(:last-child)::after {
  background: var(--border-color-strong);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-overview {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-primary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-overview > strong {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-totals {
  background: var(--gradient-golden-pill);
  color: var(--color-gold-value);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-totals span {
  color: var(--color-gold-label) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-totals > div + div {
  border-color: var(--color-gold-divider);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .wallet-quick-amounts button, .wallet-pay-channels button, .wallet-record-tabs button,
  .wallet-amount-field, .wallet-empty-state button, .wallet-load-more
) {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong);
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .wallet-quick-amounts button.active, .wallet-pay-channels button.active, .wallet-record-tabs button.active
) {
  background: var(--color-accent-bg) !important;
  border-color: var(--color-tag-border) !important;
  color: var(--front-readable-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-amount-field:focus-within {
  border-color: var(--color-accent);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .wallet-record {
  border-color: var(--border-color);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .product-detail-topbar strong, .public-shop-topbar strong, .product-top-icon,
  .product-support-heading, .shop-profile-copy strong, .product-top-icon svg
) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .shop-profile-copy > strong #shopName {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .product-price {
  color: var(--front-design-danger, #e4586e) !important;
}

/* 商品名与顶部站点标题同为 14px，保留分类标签和长名称自然换行。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-title-row :is(h1, #productTitle) {
  font-size: 14px !important;
  color: var(--text-primary);
}

/* 优惠商品的旧规则优先级较高，需要同时覆盖信息卡与支持区。 */
html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-summary.has-product-offer {
  background: transparent !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame.product-detail-page .product-summary.has-product-offer :is(.product-summary-content, .product-support-section) {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  color-scheme: inherit;
}

html[data-front-theme].front-night body.front-frame-page :is(.product-group-mode-choice, .product-group-tier-choice, .product-group-choice-icon, .product-group-tier-icon, .product-group-empty) {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary);
  box-shadow: none;
}

html[data-front-theme].front-night body.front-frame-page :is(.product-group-copy strong, .product-group-choice-copy strong, .product-group-tier-copy strong),
html[data-front-theme].front-night body.front-frame-page .product-group-tier-choice:not(.is-disabled) .product-group-tier-action:not(.is-limit-reached) em {
  color: var(--text-primary);
}

html[data-front-theme].front-night body.front-frame-page :is(.product-group-tier-copy > span, .product-group-sheet-empty) {
  color: var(--text-secondary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .product-bottom-bar {
  background: var(--front-nav-background) !important;
  border-color: var(--border-color) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(
  .product-bottom-icon, .product-support-action, .shop-profile-metrics, .product-heat
) {
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .shop-follow-btn {
  background: var(--color-accent-bg) !important;
  border-color: var(--color-tag-border) !important;
  color: var(--front-readable-accent) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame #messageText {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .message-more-panel button {
  color: var(--text-secondary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame :is(.message-more-panel, .message-more) svg {
  stroke: var(--text-secondary);
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .message-order-card {
  background: transparent;
  color: inherit;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .message-order-card :is(strong, small, em) {
  color: inherit !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .message-row.is-merchant .message-bubble {
  background: var(--bg-card) !important;
  border-color: var(--border-color-strong);
  color: var(--text-primary) !important;
}

html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .message-row.is-buyer .message-bubble {
  background: #95ec69 !important;
  color: #17311a !important;
}

/* 预览机只调整操作界面，画布、素材与导出图片保持原色。 */
html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-upload, .preview-maker-workspace, .preview-maker-controls,
  .preview-maker-settings-panel, .preview-maker-export-panel, .preview-maker-function-tabs,
  .preview-maker-function-content, .preview-maker-segmented, .preview-maker-settings, .preview-maker-manager-dialog,
  .preview-maker-manager-item
) {
  background: var(--bg-card) !important;
  border-color: var(--border-color-strong) !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-topbar h1, .preview-maker-upload-copy strong, .preview-maker-section-head h2,
  .preview-maker-panel-summary strong, .preview-maker-switch-row strong,
  .preview-maker-mask-head strong, .preview-maker-manager-copy strong,
  .preview-maker-manager-dialog h2, .preview-maker-range-list label > span,
  .preview-maker-range-row > span, .preview-maker-field-row, .preview-maker-input-row,
  .preview-maker-settings summary, .preview-maker-pager strong
) {
  color: var(--text-primary) !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-topbar > div > span, .preview-maker-upload-copy small,
  .preview-maker-upload-copy em, .preview-maker-current-files,
  .preview-maker-section-head > div > span, .preview-maker-switch-row small,
  .preview-maker-mask-head small, .preview-maker-manager-copy small,
  .preview-maker-watermark-tip, .preview-maker-manager-dialog > p,
  .preview-maker-watermark-grid label, .preview-maker-watermark-manage label,
  .preview-maker-mask-ranges label > span, .preview-maker-mask-rotation label > span
) {
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-back, .preview-maker-local, .preview-maker-upload-icon,
  .preview-maker-resolution, .preview-maker-shell button,
  .preview-maker-manager button:not(.preview-maker-manager-backdrop)
) {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-secondary) !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-function-tabs button.active, .preview-maker-layer-tabs button.active,
  .preview-maker-shell button.active, .preview-maker-local, .preview-maker-confirm-layer
) {
  background: var(--color-accent-bg) !important;
  color: var(--color-link) !important;
}

html[data-front-theme].front-night body.preview-maker-page .preview-maker-primary {
  background: var(--gradient-btn-dark) !important;
  color: var(--color-btn-dark-text) !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-layer-row button.delete, .preview-maker-manager-actions button.delete,
  .preview-maker-current-actions button:nth-child(3)
) {
  color: var(--color-danger-text) !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(
  .preview-maker-shell select, .preview-maker-shell input:not([type="range"]):not([type="file"]):not([type="checkbox"])
) {
  background: var(--bg-input) !important;
  border-color: var(--border-color-strong) !important;
  color: var(--text-primary) !important;
}

html[data-front-theme].front-night body.preview-maker-page input[type="range"] {
  background: transparent !important;
}

html[data-front-theme].front-night body.preview-maker-page :is(.preview-maker-shell output, .preview-maker-tool-grid b) {
  color: var(--color-link) !important;
}

html[data-front-theme].front-night body.preview-maker-page .preview-maker-upload-icon img {
  filter: brightness(0) invert(.88);
}

html[data-front-theme].front-night body.preview-maker-page .preview-maker-empty strong {
  color: #59535e !important;
}

/* 推广与对接表单沿用证书站帮助中心：44px 高、22px 圆角、主题卡片底色与轻阴影。 */
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page :is(
  .input, .select, .textarea, .user-copy-row, .subsite-code-search-input,
  .user-withdraw-form input:where(:not([type="hidden"]):not([type="file"])), .user-withdraw-form select
) {
  box-sizing: border-box;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 0 !important;
  border-radius: 22px !important;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-card) !important;
  outline: none !important;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page textarea.textarea {
  height: auto;
  padding-block: 12px;
  border-radius: 20px !important;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page :is(.input, .select, .textarea, .user-copy-row, .subsite-code-search-input):focus-within,
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page .user-withdraw-form :is(input, select):focus-visible {
  box-shadow: var(--shadow-accent-md) !important;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page .user-copy-row {
  gap: 4px;
  padding-inline: 16px 4px;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page :is(.user-copy-row input, .subsite-code-search-input input) {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page :is(
  .user-copy-row button, .user-withdraw-actions button, .user-form-submit,
  .subsite-installation-actions button, .subsite-binding-actions button, :where(#uploadSubsiteLogoBtn),
  .subsite-code-toolbar button, .subsite-code-pagination button, .subsite-copy-latest
) {
  min-height: 36px;
  padding-inline: 14px;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--bg-card) !important;
  color: var(--front-readable-accent) !important;
  box-shadow: var(--shadow-card) !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page .user-copy-row button {
  min-width: 48px;
  background: transparent !important;
  box-shadow: none !important;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page .subsite-mode-options :is(label > span, input:checked + span) {
  border: 0 !important;
  border-radius: 22px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page .subsite-mode-options label {
  -webkit-tap-highlight-color: transparent;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page .subsite-mode-options input:checked + span strong {
  color: var(--front-readable-accent);
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-search {
  grid-template-columns: minmax(0, 1fr);
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-search-input { gap: 10px; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-search-input img { width: 18px; height: 18px; flex-basis: 18px; opacity: .4; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-search-input input { font-size: 14px; }

/* 分站下载独立成卡片，仍随对接信息页签显隐。 */
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-file-drawer {
  min-width: 0;
  margin: 0 0 14px;
  padding: 18px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: none;
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-file-drawer summary { outline: none; -webkit-tap-highlight-color: transparent; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-file-drawer[open] summary { margin-bottom: 14px; }

/* 卡密区直接使用页面底色，统计与列表不再包裹白色外层卡片。 */
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page #subsiteCodesSection {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-list-panel {
  padding-top: 0;
  border-top: 0;
}

/* 卡密统计复用金色横条，标题与数字统一字号、行高和文字基线。 */
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-info {
  padding: 12px 8px;
  border: 0;
  border-radius: 14px;
  background: var(--gradient-golden-pill);
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-stats {
  padding: 0;
  font-family: var(--front-font-family);
  font-size: 12px;
  line-height: 20px;
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-stats > div {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-stats > div + div { border-left: 1px solid var(--color-gold-divider); }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-stats span { order: -1; color: var(--color-gold-label); font-size: inherit; line-height: inherit; white-space: nowrap; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-stats strong { order: 0; min-width: 0; overflow: hidden; color: var(--color-gold-value); font-size: inherit; font-weight: 700; line-height: inherit; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-item { padding-block: 10px; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-body { gap: 4px; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page .subsite-code-chips span { padding: 2px 6px; }
html[data-front-theme].front-frame-root body.front-frame-page.user-subsite-page :is(.subsite-code-meta button, .subsite-code-toolbar button.danger) {
  min-height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--color-danger-bg) !important;
  color: var(--color-danger-text) !important;
  box-shadow: none !important;
}

/* 取消底部导航点击底色和触摸高亮，选中图标与文字继续使用原配色。 */
html[data-front-theme].front-frame-root body.front-frame-page .public-bottom-nav :is(a, button),
html[data-front-theme].front-frame-root body.front-frame-page .public-bottom-nav :is(a, button):is(:hover, :active, :focus) {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
html[data-front-theme].front-frame-root body.front-frame-page.account-promotion-page :is(button, summary):focus-visible,
html[data-front-theme].front-frame-root body.front-frame-page .public-bottom-nav :is(a, button):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* 外观主题选择器独立固定在视口底部，避免被页面容器或固定顶栏裁切。 */
.front-theme-layer[hidden] { display: none !important; }
.front-theme-layer {
  position: fixed;
  inset: 0;
  z-index: 25000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--text-primary);
  isolation: isolate;
}
.front-theme-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--front-theme-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .18s ease;
}
.front-theme-panel {
  position: relative;
  width: min(430px, 100%);
  max-height: min(78vh, 650px);
  max-height: min(78dvh, 650px);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-radius: 20px 20px 0 0;
  background: var(--bg-card);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .08);
  transform: translateY(100%);
  transition: transform .18s ease;
  outline: none;
}
.front-theme-layer.is-open .front-theme-backdrop { opacity: 1; }
.front-theme-layer.is-open .front-theme-panel { transform: translateY(0); }
.front-theme-handle { width: 30px; height: 4px; flex: 0 0 4px; margin: 9px auto 0; border-radius: 3px; background: var(--border-color-strong); }
.front-theme-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 15px 12px; }
.front-theme-head h2 { margin: 0; color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 650; }
.front-theme-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--bg-secondary); color: var(--text-secondary); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.front-theme-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 8px 12px; }
.front-theme-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 51px; margin: 0 0 2px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.front-theme-item:is(:hover, .is-selected) { background: var(--bg-secondary); }
.front-theme-swatch { width: 44px; height: 30px; flex: 0 0 44px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.front-theme-name { flex: 1; }
.front-theme-check { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: var(--front-readable-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.front-theme-item.is-selected .front-theme-name { color: var(--front-readable-accent); font-weight: 650; }
.front-theme-item.is-selected .front-theme-check { visibility: visible; }
.front-theme-item:focus-visible, .front-theme-close:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
html.front-theme-picker-open, html.front-theme-picker-open body { overflow: hidden !important; }
@media (prefers-reduced-motion: reduce) { .front-theme-backdrop, .front-theme-panel { transition: none; } }

/* 普通固定操作位于粒子下方，弹窗保留更高的独立层级。 */
html[data-front-theme].front-frame-root body.front-frame-page :is(.public-bottom-nav, .product-bottom-bar, .random-theme-float) {
  z-index: 1900 !important;
}
.front-particles {
  position: fixed;
  z-index: 2000;
  inset: 0;
  width: min(var(--front-design-frame-width, 430px), 100%);
  margin-inline: auto;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
}
.front-particles .stars {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: perspective(500px);
  transform-style: preserve-3d;
  perspective-origin: 50% 100%;
  animation: stars_anime 90s infinite linear;
}
.front-particles .star {
  width: 2px;
  height: 2px;
  background: #fff;
  position: absolute;
  transform-origin: 0 0 -300px;
  transform: translate3d(0, 0, -300px);
  backface-visibility: hidden;
}
@keyframes stars_anime {
  0% { transform: rotateZ(20deg) rotateX(-40deg) rotateY(0); }
  100% { transform: rotateZ(20deg) rotateX(-40deg) rotateY(-360deg); }
}
.front-particles.is-paused .stars { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .front-particles .stars { animation: none; transform: rotateZ(20deg) rotateX(-40deg); }
  html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item::after { animation: none; transition: none; }
  html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item,
  html[data-front-theme].front-frame-root body.front-frame-page > .front-app-frame .home-category-item img { transition: none; }
}
