/* 店铺管理独立增强：仅处理店铺管理页面，不影响其他模块。 */
.store-workspace .store-auth-actions > .cbt-auth-button,
.store-workspace .store-auth-actions > .local-auth-button {
  width: 120px;
  margin-right: 0;
}
.store-workspace .store-auth-actions > .cbt-auth-button { background: #138fe2; }
.store-workspace .store-auth-actions > .local-auth-button { background: #e7a037; }

.store-workspace .store-owner {
  display: none !important;
}

.store-workspace .store-table th.store-quota-header {
  overflow: visible;
}

.store-quota-header-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.store-workspace .store-table th .store-quota-help,
.store-workspace .store-quota-header .store-quota-help,
.store-quota-help {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border: 1px solid #9aa6b5;
  border-radius: 50%;
  color: #6f7b8b;
  background: #fff;
  font: 600 11px/14px Arial, sans-serif;
  text-align: center;
  cursor: pointer !important;
  vertical-align: middle;
}

.store-workspace .store-table th .store-quota-help *,
.store-workspace .store-quota-header .store-quota-help * {
  cursor: pointer !important;
}

.store-quota-help:hover,
.store-quota-help:focus-visible {
  color: #1688d5;
  border-color: #1688d5;
  outline: none;
}

.store-quota-tooltip {
  position: fixed;
  z-index: 10020;
  width: 360px;
  max-width: calc(100vw - 24px);
  padding: 14px 16px;
  border: 1px solid #e2e6ec;
  border-radius: 5px;
  background: #fff;
  color: #333;
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
  box-shadow: 0 3px 13px rgba(28, 39, 54, .18);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}

.store-quota-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.store-quota-tooltip strong {
  display: block;
  margin-bottom: 5px;
  color: #f39a28;
  font-weight: 500;
}

.store-quota-tooltip p {
  margin: 0;
}

.store-workspace .store-market-cell {
  white-space: nowrap;
}

.store-workspace .store-market-cell .market-country {
  display: inline-flex;
  align-items: center;
  border-right: 1px solid #dfe4eb;
  margin-right: 12px;
  padding-right: 12px;
}

.store-workspace .store-market-cell .market-type-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.store-workspace .store-market-cell .market-type-value::before {
  display: inline-block;
  font-size: 11px;
  line-height: 1;
  transform: translateY(-.5px);
}

.store-workspace .store-market-cell .market-type-value.local::before {
  content: "➤";
  color: #159ee8;
}

.store-workspace .store-market-cell .market-type-value.full::before {
  content: "➤";
  color: #4cac5d;
}

.store-workspace .store-market-cell .market-type-value.remote::before {
  content: "➤";
  color: #dc9b32;
}

@media (max-width: 760px) {
  .store-quota-tooltip {
    width: 320px;
  }
}

/* 国家站点图标：使用本地 SVG，不依赖 Emoji 字体；后续国家可按相同结构扩展。 */
.store-workspace .store-market-cell .market-country {
  gap: 6px;
}

.store-country-flag {
  display: inline-block;
  width: 18px;
  height: 12px;
  flex: 0 0 18px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 1px;
  box-sizing: border-box;
  vertical-align: middle;
}

.store-country-name {
  display: inline-block;
  vertical-align: middle;
}


/* 店铺管理平台列：数据来自业务类型表 bi_store_business_types，经 /api/stores/ 返回。 */
.store-workspace .store-table th.store-platform-header,
.store-workspace .store-table td.store-platform-cell {
  text-align: center;
  white-space: nowrap;
}

.store-workspace .store-table td.store-platform-cell {
  font-weight: 500;
  color: #333;
}

/* 店铺管理表格边框：仅作用于店铺管理。 */
.store-workspace .store-table-wrap {
  border: 1px solid #e4e9ef;
  border-bottom: 1px solid #e4e9ef;
  overflow-x: auto;
}

.store-workspace .store-table {
  width: 100%;
  border-collapse: collapse;
}

.store-workspace .store-table th,
.store-workspace .store-table td {
  border-right: 1px solid #e4e9ef;
  border-bottom: 1px solid #e4e9ef;
}

.store-workspace .store-table th:last-child,
.store-workspace .store-table td:last-child {
  border-right: 0;
}

/* 店铺管理分页：默认50条/页，样式参考旧BI。 */
.store-workspace .store-pagination {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px 0;
  color: #606b79;
  font-size: 13px;
}

.store-workspace .store-pagination-total {
  white-space: nowrap;
}

.store-workspace .store-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.store-workspace .store-page-size,
.store-workspace .store-page-jump,
.store-workspace .store-page-nav,
.store-workspace .store-page-current {
  height: 30px;
  border: 1px solid #d8e0e8;
  border-radius: 3px;
  background: #fff;
  color: #596473;
  box-sizing: border-box;
}

.store-workspace .store-page-size {
  min-width: 82px;
  padding: 0 24px 0 9px;
  cursor: pointer;
}

.store-workspace .store-page-nav,
.store-workspace .store-page-current {
  min-width: 30px;
  padding: 0 8px;
}

.store-workspace .store-page-nav {
  cursor: pointer;
}

.store-workspace .store-page-nav:disabled {
  color: #c8d0da;
  background: #f7f9fb;
  cursor: default;
}

.store-workspace .store-page-current {
  color: #fff;
  border-color: #409eff;
  background: #409eff;
}

.store-workspace .store-page-jump-label,
.store-workspace .store-page-unit {
  color: #7a8492;
}

.store-workspace .store-page-jump {
  width: 42px;
  padding: 0 5px;
  text-align: center;
}

.store-workspace .store-page-jump::-webkit-inner-spin-button,
.store-workspace .store-page-jump::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.store-workspace .store-page-jump {
  -moz-appearance: textfield;
}

@media (max-width: 900px) {
  .store-workspace .store-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* 店铺管理分页固定到底部，布局参考成本管理。 */
.store-workspace.hl-has-fixed-pagination {
  padding-bottom: var(--hl-pagination-space, 66px) !important;
}
.store-workspace .store-pagination.hl-fixed-pagination {
  min-height: 58px !important;
  padding: 0 14px !important;
  border-top: 1px solid #d8e0ea !important;
}

/* 店铺管理横向滚动：参考成本管理，只保留底部分页上方的固定横向滚动条。 */
.store-workspace {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

.store-workspace .store-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  overscroll-behavior-x: contain !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Chrome / Edge / Safari：隐藏表格自身横向条，只使用 global-sticky-layout 的固定代理横条。 */
.store-workspace .store-table-wrap::-webkit-scrollbar {
  height: 0 !important;
  background: transparent !important;
}

.store-workspace .store-table-wrap::-webkit-scrollbar-thumb,
.store-workspace .store-table-wrap::-webkit-scrollbar-track {
  background: transparent !important;
}

/* 同时存在固定分页和固定横向滚动条时，预留与成本管理一致的底部空间。 */
.store-workspace.hl-has-fixed-pagination.hl-has-fixed-hscroll {
  padding-bottom: calc(var(--hl-pagination-space, 62px) + var(--hl-hscroll-space, 22px) + 8px) !important;
}

/* 店铺管理与固定汇率统一：自然内容高度，只有一个底部占位来源。 */
body.hl-store-layout-active .app-main{
  display:block!important;padding:10px 11px 0!important;gap:0!important;
  overflow-x:hidden!important;overflow-y:auto!important;scrollbar-gutter:auto!important;
}
.app-main .store-workspace.hl-store-layout-panel{
  display:block!important;box-sizing:border-box!important;width:100%!important;
  height:auto!important;min-height:100%!important;padding:0 16px!important;margin:0!important;
  background:#fff!important;border:1px solid #edf0f4!important;border-radius:0!important;
  box-shadow:0 1px 2px rgba(26,42,68,.02)!important;overflow:visible!important;
}
.store-workspace.hl-store-layout-panel:before{
  content:"";position:fixed;top:var(--store-gap-top);left:var(--store-gap-left);width:var(--store-gap-width);
  height:10px;background:#f4f6f8;z-index:135;pointer-events:none;
}
.store-layout-title{
  position:sticky;top:10px;z-index:130;height:56px;display:flex;align-items:center;
  margin:0 -16px;padding:0 14px;border-bottom:1px solid #e8edf3;background:#fff;font-size:16px;font-weight:700;color:#202b3b;
}
.store-workspace.hl-store-layout-panel .store-toolbar{
  position:sticky!important;top:66px!important;z-index:130;background:#fff!important;
  padding:14px 16px 10px!important;margin:0 -16px!important;width:auto!important;min-height:56px!important;
  flex-wrap:wrap!important;gap:10px!important;border-bottom:0!important;
}
.store-workspace.hl-store-layout-panel .store-auth-actions{flex-wrap:wrap;row-gap:8px}
.store-workspace.hl-store-layout-panel .store-table-wrap{
  width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;
  height:auto!important;min-height:0!important;max-height:none!important;
  overflow-x:clip!important;overflow-y:visible!important;contain:inline-size;
}
.store-workspace.hl-store-layout-panel .store-table{
  border-collapse:separate!important;border-spacing:0!important;
  translate:var(--store-horizontal-offset,0px) 0;
}
.store-workspace.hl-store-layout-panel .store-table thead{
  position:static!important;top:auto!important;box-shadow:none!important;isolation:auto!important;
}
.store-workspace.hl-store-layout-panel .store-table thead th{
  position:sticky!important;top:calc(10px + var(--store-sticky-head-height,112px))!important;
  z-index:120!important;background:#fff!important;border-top:1px solid #e3e8ef!important;
  border-right:1px solid #e3e8ef!important;border-bottom:1px solid #d7dee8!important;
  box-shadow:0 -1px 0 #e3e8ef!important;
}
.store-workspace.hl-store-layout-panel>.hl-pagination-spacer-v250{display:none!important}
.store-workspace.hl-store-layout-panel.store-layout-short-viewport .store-layout-title,
.store-workspace.hl-store-layout-panel.store-layout-short-viewport .store-toolbar,
.store-workspace.hl-store-layout-panel.store-layout-short-viewport .store-table thead th{position:relative!important;top:auto!important}
.store-layout-bottom-spacer{height:var(--store-bottom-space,60px);min-height:var(--store-bottom-space,60px);pointer-events:none}
.store-workspace.hl-store-layout-panel .store-pagination{
  position:fixed!important;bottom:0!important;right:auto!important;z-index:140!important;
  box-sizing:border-box!important;height:48px!important;min-height:48px!important;margin:0!important;padding:0 12px!important;
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;
  background:#fff!important;border-top:1px solid #d8e0ea!important;box-shadow:0 -2px 8px rgba(28,45,70,.09)!important;
}
.store-workspace.hl-store-layout-panel .store-pagination,
.store-workspace.hl-store-layout-panel .store-pagination :is(span,div,label,select,button,input){font-size:13px!important}
body.hl-store-layout-active>#hl-fixed-hscroll,
body.hl-store-layout-active>#hl-management-fixed-hscroll-v021,
body.hl-store-layout-active>#hl-management-top-guard-v021{display:none!important}
#hl-store-fixed-hscroll{
  position:fixed;z-index:140;height:17px;box-sizing:border-box;overflow-x:auto;overflow-y:hidden;
  border-top:1px solid #d8e0ea;border-bottom:1px solid #d8e0ea;background:#fff;scrollbar-width:auto;
}
#hl-store-fixed-hscroll[hidden]{display:none!important}
#hl-store-fixed-hscroll>div{height:1px;pointer-events:none}
#hl-store-fixed-hscroll::-webkit-scrollbar{height:14px}
#hl-store-fixed-hscroll::-webkit-scrollbar-track{background:#f2f3f5}
#hl-store-fixed-hscroll::-webkit-scrollbar-thumb{background:#9ca6af;border-radius:6px}
.hl-store-action-mask{position:fixed;inset:0;z-index:20000;background:rgba(15,23,42,.4);display:flex;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}
.hl-store-action-panel{background:#fff;color:#263445;width:min(600px,100%);max-height:90vh;overflow:auto;border-radius:10px;box-shadow:0 16px 48px #172c4933;padding:22px;box-sizing:border-box;font-size:14px;line-height:1.7}
.hl-store-action-panel header{display:flex;align-items:center;justify-content:space-between;gap:16px}.hl-store-action-panel h2{font-size:18px;margin:0}
.hl-store-action-panel button,.hl-store-action-panel a[data-open]{padding:8px 16px;border:1px solid #d7e0e9;border-radius:5px;background:#fff;color:#283b50;cursor:pointer;font:inherit;text-decoration:none;box-sizing:border-box}
.hl-store-action-panel button[data-close]{padding:0 8px;font-size:24px;border:0;background:transparent}
.hl-store-action-panel footer,.hl-store-auth-choices{display:flex;justify-content:flex-end;gap:12px;margin-top:20px;flex-wrap:wrap}
.hl-store-action-panel [data-copy],.hl-store-action-panel a[data-open]{background:#009cff;color:#fff;border-color:#009cff}
.hl-store-action-panel [hidden]{display:none!important}.hl-store-action-panel [disabled],.hl-store-action-panel [aria-disabled="true"]{opacity:.5;cursor:not-allowed}
.hl-store-action-panel label{display:block}.hl-store-action-panel input{display:block;width:100%;max-width:none;box-sizing:border-box;border:1px solid #d7e0e9;border-radius:4px;padding:10px;color:#526173;font-size:12px;background:#f8fafc}
.hl-store-action-panel [data-status]{overflow-wrap:anywhere}.hl-store-action-panel .is-error{color:#c43d3d}.hl-store-action-panel .is-success{color:#228553}
.hl-store-auth-warning{padding:12px;background:#fff8e8;border:1px solid #f1dfb5;border-radius:5px;font-size:13px}.hl-store-action-panel [data-copy-status]{font-size:13px;color:#526173}
.hl-store-action-panel :focus-visible{outline:2px solid #009cff;outline-offset:3px}
.hl-store-auth-identity{padding:14px;border:1px solid #b9ddf5;background:#f2f9ff;border-radius:5px;overflow-wrap:anywhere}
.hl-store-action-panel [data-confirm]{background:#009cff;color:#fff;border-color:#009cff}
.hl-store-action-panel [data-expiry]{font-size:12px;color:#69788b}
.hl-store-action-panel [data-path-hint]{color:#2976ab;background:#eff8ff;border:1px solid #cce7fa;border-radius:5px;padding:8px 12px;font-size:13px}
.hl-store-action-panel [data-path-hint][hidden]{display:none}
.hl-store-auth-wizard-mask{position:fixed;inset:0;z-index:20000;background:rgba(14,22,35,.65);display:flex;align-items:center;justify-content:center;padding:48px 14px 22px;box-sizing:border-box}
.hl-store-auth-wizard-panel{position:relative;box-sizing:border-box;width:min(422px,100%);max-height:calc(100vh - 70px);overflow-y:auto;background:#fff;border-radius:11px;padding:22px 36px 20px;box-shadow:0 16px 48px #111d333b;color:#152139;text-align:center}
.hl-store-auth-wizard-panel.is-authorization-step{width:min(970px,100%);min-height:min(600px,calc(100vh - 70px));padding:20px;overflow:visible}
.hl-store-auth-wizard-panel.is-authorization-step [data-step-two]{max-height:calc(100vh - 112px);overflow-y:auto;scrollbar-width:thin}
.hl-store-auth-wizard-panel [hidden]{display:none!important}
.hl-store-auth-wizard-panel h2{font-size:23px;line-height:1.35;margin:0 0 32px;font-weight:700}
.hl-store-auth-wizard-panel.is-authorization-step h2{font-size:20px;margin:0 0 10px}
.hl-store-auth-wizard-close{position:absolute;right:10px;top:10px;width:30px;height:30px;border:0;border-radius:50%;background:#f3f6fa;color:#526277;font-size:24px;line-height:26px;cursor:pointer;z-index:2}
.hl-store-auth-wizard-panel.is-authorization-step .hl-store-auth-wizard-close{right:0;top:-48px;width:36px;height:36px;background:#fff;color:#5a6b80;font-size:26px}
.hl-store-auth-wizard-panel.is-authorization-step .hl-store-auth-wizard-close::after{content:"";position:absolute;left:17px;top:36px;width:1px;height:12px;background:#fff}
.hl-store-auth-wizard-close:hover{background:#e9f2fa;color:#087ed1}
.hl-store-auth-sites{display:grid;gap:17px;justify-items:center}
.hl-store-auth-sites label{display:flex;align-items:center;text-align:left;gap:9px;box-sizing:border-box;width:min(242px,100%);min-height:57px;padding:7px 10px;border:1px solid #d8e0ec;border-radius:5px;cursor:pointer}
.hl-store-auth-sites label:has(input:checked){border-color:#148fe1;background:#f3faff;box-shadow:0 0 0 1px #148fe1}
.hl-store-auth-sites label.is-unsupported{background:#f8f9fb;color:#8c98aa;cursor:not-allowed}
.hl-store-auth-sites input{width:14px;height:14px;flex:none;accent-color:#138fe2}
.hl-store-auth-sites img{width:31px;height:31px;flex:none;object-fit:cover;border-radius:50%}
.hl-store-auth-sites span{font-size:14px;line-height:1.15}
.hl-store-auth-sites small{display:block;margin-top:3px;font-size:12px;color:#64748b}
.hl-store-auth-sites .is-unsupported small{color:#929bac}
.hl-store-auth-wizard-primary{display:block;width:152px;height:41px;margin:27px auto 0;border:0;border-radius:4px;color:#fff;background:#138fe2;cursor:pointer}
.hl-store-auth-wizard-primary:disabled{background:#9acaff;cursor:not-allowed}
.hl-store-auth-wizard-alert{min-height:73px;box-sizing:border-box;background:#fff0f0;color:#e52e31;border-radius:4px;padding:8px 10px;text-align:left;font-size:12px;line-height:1.3;white-space:pre-line;margin:0}
.hl-store-auth-wizard-alert strong{display:block}
.hl-store-auth-wizard-name{display:flex;align-items:center;justify-content:center;gap:10px;margin:12px 0 -16px;color:#3d4b5b;font-size:13px;font-weight:600}
.hl-store-auth-wizard-name input{box-sizing:border-box;width:225px;height:34px;padding:0 10px;border:1px solid #ced8e4;border-radius:3px;background:#fff;font-size:13px}
.hl-store-auth-wizard-paths{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:20px;min-height:365px}
.hl-store-auth-wizard-path{padding:0 44px;text-align:left}
.hl-store-auth-wizard-path:first-child{border-right:1px solid #e8e8e8}
.hl-store-auth-wizard-icon{display:block;width:102px;height:102px;margin:52px auto 40px}
.hl-store-auth-wizard-path h3{font-size:17px;line-height:1.5;margin:0 0 12px;font-weight:700;color:#161b25}
.hl-store-auth-wizard-path p{font-size:14px;line-height:1.5;min-height:42px;margin:0 0 17px;color:#111827}
.hl-store-auth-wizard-path button[data-path]{height:33px;padding:0 16px;border:1px solid #0791ec;border-radius:3px;background:#0791ec;color:#fff;white-space:nowrap;cursor:pointer;font-size:13px}
.hl-store-auth-wizard-path button[data-path]:hover:not(:disabled){background:#087fcf;border-color:#087fcf}
.hl-store-auth-wizard-path button[data-path]:disabled{opacity:.55;cursor:wait}
.hl-store-auth-wizard-path:first-child button[data-path]{display:block;margin-left:auto}
.hl-store-auth-wizard-link{display:flex;gap:8px;align-items:center}
.hl-store-auth-wizard-link input{height:33px;box-sizing:border-box;min-width:0;flex:1;padding:0 12px;border:1px solid #d4dce5;border-radius:3px;background:#fff;color:#506070;font-size:12px}
.hl-store-auth-wizard-browser-note{display:block;margin-top:4px;color:#e45b36;font-size:12px}
.hl-store-auth-wizard-panel [data-status]{min-height:18px;color:#c43d3d;text-align:center;font-size:13px;margin:2px 0 0;overflow-wrap:anywhere}
.hl-store-auth-wizard-panel [data-status]:empty{display:none}
.hl-store-auth-wizard-back{display:block;margin:4px auto 0;border:0;background:transparent;color:#1689dc;cursor:pointer;padding:6px 10px;font-size:13px}
.hl-store-auth-wizard-panel :focus-visible{outline:2px solid #138fe2;outline-offset:2px}
@media (max-width:680px){.hl-store-auth-wizard-panel.is-authorization-step{padding:18px}.hl-store-auth-wizard-paths{grid-template-columns:1fr;min-height:0}.hl-store-auth-wizard-path{padding:14px 8px 22px}.hl-store-auth-wizard-path:first-child{border-right:0;border-bottom:1px solid #e8e8e8}.hl-store-auth-wizard-icon{margin:12px auto 20px}.hl-store-auth-wizard-name{margin:12px 0 0}.hl-store-auth-wizard-path h3{font-size:16px}}
@media (max-width:480px){.hl-store-auth-wizard-panel{padding:22px 20px 18px}.hl-store-auth-wizard-panel h2{font-size:20px;margin-bottom:20px}.hl-store-auth-sites{gap:9px}.hl-store-auth-wizard-name{flex-wrap:wrap}.hl-store-auth-wizard-name input{width:100%}}
.store-workspace .store-init-progress{margin-top:5px;color:#65758b;font-size:12px;line-height:1.5;white-space:normal;max-width:210px}
.store-workspace .store-init-progress button{display:block;padding:2px 0;border:0;background:none;color:#1689df;cursor:pointer;font:inherit}
.store-workspace .store-init-progress button:disabled{opacity:.55;cursor:wait}
