/* ==========================================================================
   ui-common.css —— 全站通用体验优化层（主题无关，所有模板共用）
   最后加载；删除本文件的 <link> 即可完全恢复原状。
   内容：
     A. 小字号批量提升（10px→12.5 / 11px→13 / 12px→13.5 / 13px→14，
        选择器与原规则一一对应，随原媒体查询生效）
     B. 板块间距与移动端安全边距（内容不贴手机屏边）
     C. 前台数据库页统计卡移除
     D. 前台桌面侧边栏：图标改到文字左边（栏加宽容纳）
   ========================================================================== */

/* ── A. 小字号批量提升 ── */
@media (max-width:420px){.onboarding-step b{font-size:12.5px}}
@media (max-width:520px){body.admin-body .source-summary-title h4{font-size:14px}}
@media (max-width:680px){.onboarding-step small,
.admin-body .selection-category-count{font-size:12.5px}}
@media (max-width:680px){.onboarding-step b{font-size:13px}}
@media (max-width:680px){.onboarding-step strong{font-size:13.5px}}
@media (max-width:680px){.onboarding-step{font-size:14px}}
@media(max-width:1023px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item{font-size:12.5px!important}}
@media(max-width:520px){.connection-stats .stat-label{font-size:12.5px!important}}
@media(max-width:620px){.home-kicker,
.announcement-modal-head .eyebrow{font-size:13px}}
@media(max-width:620px){.home-trust-row,
.announcement-counter,
.announcement-modal-actions small{font-size:13.5px}}
@media(max-width:620px){.home-nav-actions .button{font-size:14px}}
@media(max-width:640px){.province-legend span{font-size:12.5px}}
@media(max-width:680px){.customer-body .auto-sync-toggle small{font-size:12.5px}}
@media(max-width:680px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .stat-card .stat-label,
.customer-body .synced-toolbar .button,
body.customer-body .connection-stats .stat-label,
body.customer-body .customer-bottom-nav .nav-item{font-size:13px!important}}
@media(max-width:680px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .protocol-catalog>p,
.customer-body .customer-bottom-nav .nav-item,
.customer-body .mapping-database-field .field-caption,
.customer-body .synced-category-actions .action-button{font-size:13px}}
@media(max-width:680px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.page-intro p,.page-head p,.mapping-head p,.section-heading p),
.customer-body #mappingsView select,.customer-body #syncedView select,
.customer-body .mapping-switcher .button,
body:is(.customer-body,.admin-body) .page-intro p{font-size:13.5px!important}}
@media(max-width:680px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .protocol-catalog>summary,
.customer-body .mapping-head p{font-size:13.5px}}
@media(max-width:680px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-card h3,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .home-hero-copy>p{font-size:14px!important}}
@media(max-width:680px){.customer-body .mapping-card h3{font-size:14px}}
@media(max-width:700px){.source-account-state{font-size:12.5px}}
@media(max-width:700px){.table-head p{font-size:13px}}
@media(max-width:860px){.connection-stats .stat-label{font-size:13px!important}}
@media(max-width:860px){.sidebar-brand .brand-copy strong,
.connection-stats .stat-label{font-size:13.5px}}
@media(max-width:860px){.screen-diagnostics{font-size:13.5px!important}}
@media(max-width:860px){.sidebar .sidebar-account strong{font-size:14px}}
@media(max-width:900px){.screen-toolbar .button{font-size:13.5px}}
@media(min-width:1024px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item{font-size:12.5px!important}}
.sidebar-account small,
.breadcrumb,
th,
td small,
.engine-badge,.badge,.status-pill,.announcement-section,
.announcement-card-head span,
.quick-action small,
.table-role,
.announcement-list-head small,
.confirm-kicker,
.account-trigger-copy small,
.account-menu-item small,
.mapping-select-help,
.mail-presets code,
.synced-check small,
.record-kicker,
.mobile-record-main small,.mobile-record-meta small,
.mobile-record-identity small,
.brand-copy span,
.nav-label,
.plan-features li:before,
.region-rank,
.region-empty small,
.screen-mini-stats span,
.mail-save-bar small,
.published-category-head span,
.published-category-head small,
.source-account-state,
.source-account-meta small,
.source-scan-head small,
.source-scan-table-wrap th,
.source-scan-table-wrap pre,
.customer-account-identity small,
.customer-account-meta small,
.nav-group-toggle .nav-label,
html[data-ui-theme="dashboard"] body #mappingProtocolAlert,
html[data-ui-theme="dashboard"] body.admin-body .dashboard-insight-label,
.customer-body .mapping-save-bar small,
.customer-body .database-row-actions .status-pill,
body.admin-body .source-detail-fact span,.source-detail-status span,
.admin-body .selection-category-label small,.admin-body .selection-category-label em,
.admin-body .selection-node-meta,.admin-body .selection-node-api,.admin-body .selection-node-id{font-size:12.5px}
.screen-auto-location small,
.nav-label,
.eyebrow,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .eyebrow,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .brand-copy span,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .nav-label,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .account-trigger-copy small,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .home-brand small,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .workflow-tag,
body:is(.customer-body,.admin-body) .eyebrow,
body.admin-body .sidebar-brand .brand-copy small,
body.admin-body .sidebar .nav-group-toggle,body.admin-body .sidebar .nav-group-toggle .nav-label{font-size:12.5px!important}
.field-hint,.verification-field>small,label small,
.eyebrow,.section-kicker,
.feature-list li>span,
.login-trust span,
.console-chip strong,
.stat-card p,
.mapping-card p,
.mapping-save-bar p,.mapping-save-bar small,
.connection-note,.source-note,
.storage-facts dd,
.setup-warning,
.source-item p,.source-item small,
.html-preview-wrap>strong,
.account-popover-head small,
.mapping-select-label,
.soft-tip span,
.mail-presets span,
.detail-field small,
.mobile-record-meta strong,
.eyebrow,
.breadcrumb,
th,
.confirm-kicker,
.home-brand small,
.payment-method-icon,
.plan-recommend,
.order-status,
.table-subline,
.payment-flow small,
.user-plan-caption,
.connection-stats .stat-card small,
.screen-auto-location small,
.screen-loading small,
.screen-kpi p,
.live-badge,.region-count,
.map-empty p,
.region-row-top b,
.screen-insight p,
.screen-state-pill,
.mail-template-card summary small,
.mail-preview-wrap>strong,
.mail-variable-box p,
.province-legend,
.published-catalog-copy small,
.published-node,
.published-empty,
.onboarding-step small,
.activity-meta,
.activity-meta code,.activity-row>code,
.site-upload-field small,
.source-accounts-toolbar label,
.source-account-identity small,
.source-account-meta strong,
.source-scan-table-wrap table,
.customer-accounts-toolbar label,
.customer-account-meta strong,
.admin-search-field,
.mail-automation-facts small,
.published-node-api,.selection-node-api,
.publish-structure>summary small,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .protocol-catalog>summary>span:last-child,
:is(.customer-body,.admin-body) .published-node-api,
.customer-body .auto-sync-toggle small,
.customer-body .mapping-metrics,
.customer-body .mapping-select-label,
.customer-body .mapping-save-bar p,
.customer-body .database-row-copy p,
.customer-body .database-row-actions .action-button,
body.admin-body .source-summary-meta,
body.admin-body .source-detail-status,
.admin-body .selection-category-count{font-size:13px}
.map-empty strong,
.breadcrumb,
.onboarding-step>b,
.onboarding-step em,
.release-footer,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .breadcrumb,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .stat-card small,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.status-pill,.badge,.tag,.protocol-tag),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) th,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .home-kicker,
body:is(.customer-body,.admin-body) dialog :is(small,.form-hint,.field-hint),
body.admin-body .nav-group-toggle .nav-label{font-size:13px!important}
.action-button,
label,
.password-wrap button,
.message,
.sidebar-account strong,
.nav-item,
.stat-label,
td,
.announcement-html,
.account-trigger-copy strong,
.account-menu-item strong,
.soft-tip strong,
.synced-node-empty,
.mobile-record-main strong,.mobile-record-main code,
.announcement-counter,
/* 表单控件按 macOS 控件比例处理。 */
label,
.home-kicker,
.announcement-modal-head .eyebrow,
.subscription-badge,
.plan-index,
.plan-price small,
.order-main small,.order-side span,
.commerce-summary-card span,
.commerce-summary-card small,
.payment-flow>div>span,
.setup-step small,
.setup-step .button,
.subscription-editor small,
.screen-caption,
.screen-kpi small,
.map-heading p,
.map-selection,
.region-row-top strong,
.mail-variable-box strong,
.published-catalog-copy p,
.published-toggle,
.published-catalog-card[open] .published-toggle-label::after,
.relay-badge,
.onboarding-step b,
.onboarding-step em,
.activity-main small,
.mapping-database-field .field-caption,
.auto-sync-toggle small,
.mail-automation-command textarea,
.mail-automation-last-run,
.task-purpose-card p,
.mail-template-actions small,
.mail-template-actions .button,
.publish-structure-grid table,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .protocol-catalog>p,
html[data-ui-theme="dashboard"] body .protocol-warnings p,
html[data-ui-theme="dashboard"] body.admin-body #adminStats .stat-card>span,
html[data-ui-theme="dashboard"] body.admin-body .dashboard-insight p,
html[data-ui-theme="dashboard"] body.admin-body .dashboard-insight a,
:is(.customer-body,.admin-body) .status-pill,
.customer-body .customer-bottom-nav .nav-item,
.customer-body .auto-sync-toggle strong,
.customer-body .mapping-save-bar .button,
.admin-body .source-actions .action-button,
.admin-body .published-node-copy strong,
.admin-body .selection-note,
body:is(.customer-body,.admin-body) #appConfirmDialog .confirm-detail,
body.admin-body .source-summary-copy>p,
body.admin-body .source-detail-toggle,
body.admin-body .source-detail-fact strong{font-size:13.5px}
.mail-template-fields textarea,.broadcast-mail-grid textarea,
.screen-diagnostics span,
.onboarding-copy strong,
.modal-head p,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .table-head p,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.button.small,.small-button,.action-button,.row-actions .button,.synced-actions .button),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.field-label,label,.mapping-select-label>span),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .account-trigger-copy strong,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.modal-card p,.confirm-card p),
.customer-body .synced-toolbar .button,
body:is(.customer-body,.admin-body) dialog .modal-head p,
body:is(.customer-body,.admin-body) dialog label,
body:is(.customer-body,.admin-body) dialog .button,
.customer-body #connectionsView .table-head p,
body:is(.customer-body,.admin-body) .table-head p,
body.customer-body .connection-stats .stat-label,
body.admin-body .customer-owner-field small,
body.admin-body .customer-account-meta small{font-size:13.5px!important}
.account-trigger-avatar,
.account-popover-head strong,
.detail-field strong,
.nav-item,
.home-trust-row,
.home-step,
.home-footer,
.auth-back-button,
.announcement-counter,
.announcement-modal-actions small,
.payment-method-option,
.payment-unavailable,
.plan-features,
.payment-flow strong,
.payment-method-fieldset legend,
.payment-method-checks span,
.modal-head p,.field-note,
.setup-indicator,
.setup-retry,
.connection-stats .stat-label,
.map-empty span,
.map-selection,
.region-list li,
.screen-auto-location strong,
.screen-hero p,
.screen-alert,
.screen-loading strong,
.screen-insight strong,
.mail-html-preview,
.hero-live,
.onboarding-step strong,
.source-scan-head strong,
.admin-search-field input,
.auto-sync-toggle strong,
.mail-automation-facts strong,
.publish-structure>summary strong,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .protocol-catalog>summary,
:is(.customer-body,.admin-body) .button,
.customer-body .mapping-save-bar strong,
.customer-body .database-row-copy h3,
.admin-body .published-category-head strong,
body:is(.customer-body,.admin-body) #appConfirmDialog [data-confirm-message],
.admin-body .selection-category-label strong{font-size:14px}
.onboarding-guide-head h3,.onboarding-guide-head strong,
.site-upload-field input[type=file],
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.page-intro p,.page-head p,.mapping-head p,.section-heading p),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .stat-label,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .button,html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(.icon-button,.action-button,.small-button,.primary-button,.secondary-button,.danger-button,.menu-button,.close-button),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="file"]),select,textarea),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) table,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .brand-copy strong,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .nav-item,
body:is(.customer-body,.admin-body) dialog :is(input:not([type=checkbox]):not([type=radio]),select,textarea),
body:is(.customer-body,.admin-body) dialog .profile-summary strong,
body:is(.customer-body,.admin-body) .page-intro p,
body.admin-body .sidebar .nav-item,
body:is(.customer-body,.admin-body) #appConfirmDialog .confirm-actions .button,
body.admin-body .customer-owner-badge{font-size:14px!important}

/* ── B. 板块间距与移动端安全边距 ── */
.content-view,.admin-content{row-gap:22px}
.table-card .table-head,.admin-form-panel .table-head{padding:18px 20px!important}
.table-card .padded-form,.form-grid.padded-form{padding:20px!important}
.mapping-switcher,.synced-toolbar{row-gap:12px}
@media(max-width:1023px){
  .content-view,.admin-content{padding-left:18px!important;padding-right:18px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body #appView>.workspace{padding:0 14px 110px!important}
}
@media(max-width:640px){
  .content-view,.admin-content{padding-left:16px!important;padding-right:16px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body #appView>.workspace{padding:0 12px 110px!important}
  .table-card,.stat-card,.mapping-card,.subscription-card{border-radius:16px!important}
  .table-card .table-head{padding:16px!important}
  .button{min-height:44px}
}

/* ── C. 前台数据库页：移除「连接总数 / 连接正常 / 需要检查」统计卡 ── */
.stats-grid.connection-stats{display:none!important}

/* ── D. 前台桌面侧边栏：图标改到文字左边 ── */
/* 选择器照抄 dashboard.css 桌面端结构（:is()+.customer-body 双类叠加），同特异性靠后加载胜出。 */
@media(min-width:1024px){
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body{padding-left:188px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav{
    width:188px!important;padding:28px 12px!important;align-items:stretch!important;
  }
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav:before{margin:0 0 36px 8px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-items{
    width:100%!important;display:flex!important;flex-direction:column!important;gap:8px!important;align-items:stretch!important;
  }
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item{
    flex-direction:row!important;justify-content:flex-start!important;align-items:center!important;
    gap:10px!important;width:100%!important;min-height:46px!important;padding:10px 12px!important;
    font-size:13px!important;text-align:left!important;
  }
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-icon{flex-shrink:0;width:auto!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-icon svg{width:20px!important;height:20px!important}
}

/* ── E. 后台模板管理：模板卡片画廊 ── */
.template-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px;padding:20px}
.template-card{display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.08);border-radius:18px;overflow:hidden;background:#fff;transition:box-shadow .22s ease,transform .22s ease,border-color .22s ease}
.template-card:hover{box-shadow:0 12px 32px rgba(0,0,0,.1);transform:translateY(-2px)}
.template-card.active{border-color:#007AFF;box-shadow:0 0 0 3px rgba(0,122,255,.14),0 12px 32px rgba(0,0,0,.08)}
.template-card-preview{display:flex;flex-direction:column;justify-content:flex-end;gap:8px;height:112px;padding:14px}
.template-card-preview-bar{display:block;width:42%;height:8px;border-radius:99px;background:rgba(255,255,255,.9)}
.template-card-preview-block{display:block;height:34px;border-radius:10px;background:rgba(255,255,255,.55)}
.template-card-preview-block.short{width:66%}
.template-card-body{flex:1;padding:14px 16px 6px}
.template-card-body strong{display:block;font-size:15px;color:#1D1D1F}
.template-card-body p{margin:6px 0 0;font-size:12.5px;line-height:1.55;color:#86868B}
.template-enable-btn{align-self:flex-start;margin:12px 16px 16px}
@media(max-width:640px){
  .template-gallery{grid-template-columns:1fr 1fr;padding:14px;gap:12px}
  .template-card-preview{height:88px}
}
@media(max-width:460px){
  .template-gallery{grid-template-columns:1fr}
}

/* ── F. 布局加宽与字号分层（桌面更大 / 手机收敛） ── */
@media(min-width:1024px){
  /* 内容区加宽，减少两侧留白 */
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .content-view,
  body.customer-body .content-view{max-width:1440px!important}
  /* 套餐页：标题与卡片字号提升，杜绝拥挤溢出 */
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .commerce-heading h1{font-size:32px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .commerce-heading p,
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .commerce-section-head p{font-size:15px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .commerce-section-head h2{font-size:25px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .subscription-card h3{font-size:24px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .subscription-card p{font-size:15px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card h3{font-size:24px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-description{font-size:15px!important;min-height:46px}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-features{font-size:14px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-price strong{font-size:44px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-price small{font-size:13px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .order-title strong{font-size:16px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .order-main p{font-size:13px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .order-side>strong{font-size:20px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .voucher-redeem-card p{font-size:15px!important}
  /* 通用正文与表格再提半级 */
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .table-wrap td,
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .table-wrap th{font-size:14px!important}
}
/* 移动端字号收敛一级（仍不低于原始可读底线） */
@media(max-width:680px){
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .table-wrap td,
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .table-wrap th{font-size:12.5px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card h3{font-size:19px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-description{font-size:12.5px!important;min-height:0}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-features{font-size:12px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-price strong{font-size:30px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .subscription-card h3{font-size:17px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .subscription-card p,
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .voucher-redeem-card p{font-size:12.5px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .commerce-section-head h2{font-size:19px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .order-title strong{font-size:13.5px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .order-main p{font-size:11px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .button{font-size:13px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .badge,
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .status-pill{font-size:11.5px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-card h3{font-size:13.5px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-select-label span,
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-metrics{font-size:11.5px!important}
}

/* ── G. 全站圆角统一 ── */
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) input:not([type=checkbox]):not([type=radio]),
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) select,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) textarea{border-radius:12px!important}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .button,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) button.icon-button{border-radius:12px!important}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .table-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .subscription-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .stat-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .template-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .voucher-redeem-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .settings-card,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mobile-record-card{border-radius:18px!important}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) dialog,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .modal-card{border-radius:22px!important}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-database-select,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .mapping-card select{border-radius:12px!important}

/* ── H. 映射页「自选 / 全部」控件 ── */
.mapping-filter-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:14px 0 4px}
.segmented{display:inline-flex;padding:4px;gap:2px;border:1px solid var(--line,rgba(0,0,0,.08));border-radius:999px;background:rgba(120,120,128,.08)}
.segmented-item{border:0;background:transparent;padding:8px 20px;border-radius:999px;font-size:13.5px;font-weight:600;color:#6e6e73;cursor:pointer;transition:background .18s ease,color .18s ease,box-shadow .18s ease}
.segmented-item.active{background:#fff;color:#1d1d1f;box-shadow:0 2px 8px rgba(0,0,0,.12)}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .segmented-item.active{color:var(--ui-900,#1d1d1f)}
.mapping-pick-field{display:flex;align-items:center;gap:10px;font-size:13px;color:#6e6e73}
.mapping-pick-field select{min-width:240px;max-width:min(72vw,360px);padding:10px 12px;border:1px solid var(--line,rgba(0,0,0,.1));background:#fff;font-size:13.5px}
.mapping-pick-empty{grid-column:1/-1;padding:34px 20px;text-align:center;color:#6e6e73;border:1.5px dashed var(--line,rgba(0,0,0,.14));border-radius:18px}
.mapping-pick-empty h3{margin:0 0 6px;font-size:16px;color:#1d1d1f}
.mapping-pick-empty p{margin:0;font-size:13px}
@media(max-width:680px){
  .mapping-filter-bar{gap:10px}
  .segmented-item{padding:7px 16px;font-size:12.5px}
  .mapping-pick-field{flex-direction:column;align-items:stretch;gap:6px;width:100%}
  .mapping-pick-field select{min-width:0;width:100%}
}

/* ── I. 移动端底部导航 6 项紧凑适配 ── */
@media(max-width:1023px){
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-items{gap:2px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item{padding:8px 2px 6px!important;min-width:0}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item .nav-icon{margin-bottom:2px}
}
@media(max-width:420px){
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item{font-size:10px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body).customer-body .customer-bottom-nav .nav-item .nav-icon svg{width:20px;height:20px}
}

/* ── J. 1.1.56 响应式布局收口 ── */
:root{--ui-radius:16px;--ui-radius-lg:22px}
/* 套餐：卡片永远在网格内收缩，不再被长标题/功能文案撑出容器 */
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plans-grid{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:stretch;width:100%;min-width:0
}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plans-grid>*{min-width:0;max-width:none}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card{
  display:flex;min-width:0;flex-direction:column;height:100%;overflow:hidden;padding:22px!important;border-radius:20px!important
}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card h3,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-description,
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-features{min-width:0;overflow-wrap:anywhere;word-break:break-word}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-description{flex:1;line-height:1.65}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-features{margin:16px 0;line-height:1.7}
html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card .button{width:100%;margin-top:auto}
@media(max-width:1180px){html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plans-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plans-grid{grid-template-columns:minmax(0,1fr);gap:12px}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card{padding:18px!important;border-radius:16px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-card h3{font-size:20px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-description{font-size:14px!important}
  html[data-ui-theme="dashboard"] body:is(.customer-body,.admin-body) .plan-features{font-size:13.5px!important}
}
/* 首页：桌面双栏、窄屏单栏；避免流程卡被挤成狭长竖条 */
body.customer-body .home-nav{min-height:64px;padding:12px clamp(18px,5vw,72px)}
body.customer-body .home-hero{padding:clamp(48px,7vw,92px) 24px 64px}
body.customer-body .home-hero-inner{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);gap:clamp(34px,6vw,90px);align-items:center;width:min(1180px,100%);margin:0 auto}
body.customer-body .home-hero-copy{min-width:0}
body.customer-body .home-hero-copy h1{font-size:clamp(42px,5.2vw,72px);line-height:1.05}
body.customer-body .home-hero-copy>p{max-width:620px;font-size:17px;line-height:1.8}
body.customer-body .home-workflow{width:100%;min-width:0;padding:26px;border-radius:22px!important}
body.customer-body .workflow-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:12px;align-items:start;padding:17px 0}
body.customer-body .workflow-row strong,body.customer-body .workflow-row small{display:block;overflow-wrap:anywhere}
body.customer-body .home-template-stats,body.customer-body .home-capabilities{width:min(1180px,calc(100% - 48px));margin-left:auto;margin-right:auto}
body.customer-body .home-template-stats{padding:28px;border-radius:22px!important}
body.customer-body .home-capabilities{padding:40px 0 24px}
body.customer-body .home-capability-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
body.customer-body .home-capability-grid article{min-width:0;padding:26px;border-radius:20px!important}
body.customer-body .home-capability-grid article h3,body.customer-body .home-capability-grid article p{overflow-wrap:anywhere}
@media(max-width:820px){
  body.customer-body .home-nav{padding:12px 16px}
  body.customer-body .home-nav-actions{gap:6px}
  body.customer-body .home-nav-link{display:none}
  body.customer-body .home-hero{padding:38px 16px 42px}
  body.customer-body .home-hero-inner{grid-template-columns:1fr;gap:24px}
  body.customer-body .home-hero-copy h1{font-size:clamp(38px,12vw,58px)}
  body.customer-body .home-hero-copy>p{font-size:15px}
  body.customer-body .home-workflow{padding:20px;border-radius:18px!important}
  body.customer-body .home-template-stats,body.customer-body .home-capabilities{width:calc(100% - 32px)}
  body.customer-body .home-template-stats{padding:20px}
  body.customer-body .home-capabilities{padding:30px 0 18px}
  body.customer-body .home-capability-grid{grid-template-columns:1fr;gap:12px}
  body.customer-body .home-capability-grid article{padding:20px}
}
@media(max-width:460px){
  body.customer-body .home-brand small{display:none}
  body.customer-body .home-nav .button{padding-inline:12px;font-size:12px}
  body.customer-body .home-template-stats-grid{grid-template-columns:1fr 1fr;gap:8px}
  body.customer-body .home-template-stats-grid article{min-height:78px;padding:12px}
  body.customer-body .workflow-row{grid-template-columns:32px minmax(0,1fr);gap:8px}
  body.customer-body .workflow-tag{grid-column:2;justify-self:start}
}
/* 映射：把“自选”明确成来源分类 → 目标分类/自定义名称的两步操作 */
.mapping-filter-bar{align-items:stretch;padding:14px 16px;border:1px solid var(--line,rgba(0,0,0,.08));border-radius:16px;background:rgba(255,255,255,.78)}
.mapping-pick-field{position:relative;flex:1;min-width:min(280px,100%);padding:10px 12px;border:1px solid var(--line,rgba(0,0,0,.1));border-radius:14px;background:#fff}
.mapping-pick-field:before{content:'第 1 步 · 选择来源分类';display:block;margin-bottom:5px;color:#6e6e73;font-size:11px;font-weight:700}
.mapping-pick-field .field-caption{display:none}
.mapping-pick-field select{max-width:none;width:100%;border:0!important;padding:3px 24px 3px 0!important;background-color:transparent}
.mapping-card{min-width:0}
.mapping-card .mapping-select-label:before{content:'第 2 步 · 选择导入位置';display:block;margin-bottom:6px;color:#6e6e73;font-size:11px;font-weight:700}
.mapping-card .mapping-select-label>span{display:none}
.mapping-card .mapping-custom-name{margin-top:10px;padding:10px 12px;border:1px dashed rgba(0,122,255,.3);border-radius:12px;background:#f5f9ff}
.mapping-card .mapping-custom-name:before{content:'自定义分类名称';display:block;margin-bottom:5px;color:#0066cc;font-size:12px;font-weight:700}
.mapping-card .mapping-custom-name input{width:100%;min-width:0}
@media(max-width:680px){
  .mapping-filter-bar{flex-direction:column;padding:12px}
  .mapping-pick-field{min-width:0;width:100%}
  .mapping-card .mapping-select-label:before{font-size:12px}
}
/* 所有节点 */
.nodes-switcher{align-items:flex-end;justify-content:space-between;flex-wrap:wrap}
.nodes-switcher>label{display:flex;flex:1;min-width:220px;flex-direction:column;gap:7px}
.nodes-toolbar{display:flex;flex-wrap:wrap;gap:8px}
.nodes-content{min-width:0}
.nodes-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.node-item{display:flex;min-width:0;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px;border:1px solid var(--line,rgba(0,0,0,.1));border-radius:18px;background:#fff;box-shadow:0 8px 24px rgba(31,50,81,.05)}
.node-check{display:flex;min-width:0;align-items:center;gap:12px;cursor:pointer}
.node-check>span{display:flex;min-width:0;flex-direction:column;gap:4px}
.node-check small,.node-check strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.node-check small{color:#7f85a2;font-size:12px}.node-check strong{font-size:15px}
.node-actions{display:flex;flex:0 0 auto;gap:7px}.node-actions .action-button{white-space:nowrap}
@media(max-width:860px){.nodes-list{grid-template-columns:1fr}}
@media(max-width:560px){.nodes-switcher{align-items:stretch}.nodes-switcher>label{min-width:0}.nodes-toolbar{display:grid;grid-template-columns:1fr 1fr;width:100%}.nodes-toolbar .button:first-child{grid-column:1/-1}.node-item{align-items:flex-start;flex-direction:column}.node-actions{width:100%}.node-actions .action-button{flex:1}.node-check{width:100%}}
/* 顶部多余留白：压缩前后台顶栏和首屏内容起始距离 */
@media(min-width:861px){
  body:is(.customer-body,.admin-body) .topbar{min-height:58px!important;padding-top:8px!important;padding-bottom:8px!important}
  body:is(.customer-body,.admin-body) .content-view,body:is(.customer-body,.admin-body) .admin-content{padding-top:24px!important}
  body.admin-body .sidebar-brand{padding-top:10px!important;padding-bottom:12px!important}
}
/* 全站统一圆角，保留圆形头像/复选框/徽标 */
body:is(.customer-body,.admin-body) :is(.card,.panel,.surface,.table-card,.stat-card,.mapping-card,.subscription-card,.voucher-redeem-card,.settings-card,.database-card,.source-card,.form-card,.admin-page,.admin-form-panel,.admin-sync-panel,.selection-card,.quick-action,.empty-state,.table-wrap,.data-table,.toolbar,.filter-bar,.notice,.message,.alert,.search-field,.account-popover,.menu-panel){border-radius:18px!important}
body:is(.customer-body,.admin-body) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){border-radius:12px!important}
body:is(.customer-body,.admin-body) :is(button,.button,.action-button,.icon-button,.small-button,.primary-button,.secondary-button,.danger-button,.menu-button){border-radius:12px!important}

/* 1.1.56 · Compact edge-attached mobile tab bar (not a floating card). */
@media(max-width:1023px){
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav{
    position:fixed!important;inset:auto 0 0!important;z-index:80;display:block!important;
    width:100%!important;max-width:none!important;margin:0!important;
    padding:4px max(4px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left))!important;
    border:0!important;border-top:1px solid rgba(60,60,67,.12)!important;border-radius:0!important;
    background:rgba(255,255,255,.97)!important;box-shadow:none!important;backdrop-filter:blur(18px)!important;
  }
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav:before{display:none!important}
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-items{
    --nav-count:6;--nav-index:0;position:relative;isolation:isolate;display:grid!important;
    grid-template-columns:repeat(var(--nav-count),minmax(0,1fr));gap:0!important;
    width:100%!important;max-width:760px!important;margin:0 auto!important;padding:0 4px!important;
  }
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-items:before{
    content:'';position:absolute;z-index:-1;pointer-events:none;top:0;bottom:0;left:4px;
    width:calc((100% - 8px)/var(--nav-count));border-radius:14px;background:#edf2ff;
    transform:translateX(calc(var(--nav-index)*100%));opacity:0;
    transition:transform .34s cubic-bezier(.22,.8,.25,1),opacity .18s ease;
  }
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-items.has-active-item:before{opacity:1}
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav .nav-item{
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    min-width:0!important;min-height:44px!important;height:44px;padding:3px 1px!important;gap:2px!important;
    background:transparent!important;border:0!important;box-shadow:none!important;border-radius:14px!important;
    color:#747782!important;font-size:10px!important;line-height:1.2!important;white-space:nowrap;
    transition:color .22s ease,transform .18s ease;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
  }
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-items.has-active-item .nav-item.active{color:#3e6bec!important}
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav .nav-icon{margin:0!important;line-height:0}
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav .nav-icon svg{width:19px!important;height:19px!important;transition:transform .28s cubic-bezier(.2,.8,.2,1)}
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav .nav-item.active .nav-icon svg{transform:translateY(-1px)}
  html[data-ui-theme] body.customer-body.customer-body .customer-bottom-nav .nav-item:active{transform:scale(.94)}
  html[data-ui-theme] body.customer-body.customer-body .workspace .content-view{padding-bottom:calc(78px + env(safe-area-inset-bottom))!important}
  html[data-ui-theme] body.customer-body.customer-body .mapping-save-bar{bottom:calc(58px + env(safe-area-inset-bottom))!important}
  html[data-ui-theme] body.customer-body.customer-body #appView .content-view:not(.hidden){animation:customer-view-in .22s ease both}
}
@keyframes customer-view-in{from{opacity:.45;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){
  .customer-body .customer-bottom-items:before,.customer-body .customer-bottom-nav .nav-item,.customer-body .customer-bottom-nav .nav-icon svg{transition:none!important}
  .customer-body #appView .content-view{animation:none!important}
}

/* 1.1.56 · Self-select first; equal-width mode buttons at every viewport. */
html[data-ui-theme] body.customer-body .mapping-filter-bar{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px;min-width:0}
html[data-ui-theme] body.customer-body .mapping-filter-bar [role=tablist]{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));align-self:center;width:min(100%,360px);min-width:0;padding:4px;gap:4px;box-sizing:border-box;border-radius:16px!important;background:#eff2f7}
html[data-ui-theme] body.customer-body .mapping-filter-bar [role=tab]{width:100%;min-width:0;min-height:40px;padding:8px 12px!important;margin:0;text-align:center;font-size:14px!important;border-radius:12px!important;transition:background .2s ease,color .2s ease,box-shadow .2s ease}
html[data-ui-theme] body.customer-body .mapping-filter-bar [role=tab].active{background:#fff!important;color:#355fd5!important;box-shadow:0 2px 7px #23314a0f}
html[data-ui-theme] body.customer-body .mapping-pick-field{flex:auto;min-width:0;width:100%;box-sizing:border-box}
