/* 摊主工作台：服务器端独立界面。保持暖橙品牌，减少胶囊、长页和装饰性文案。 */
.brand-sub { display: none; }

html[data-surface="merchant"] .product-header .brand-row {
  min-width: 0;
  gap: 12px;
}

html[data-surface="merchant"] .product-header .logo {
  width: 46px;
  height: 46px;
  min-width: 46px;
  flex: 0 0 46px;
  border-radius: 13px;
  padding: 5px;
}

html[data-surface="merchant"] .product-header .brand-icon-v2 {
  width: 36px;
  height: 36px;
}

html[data-surface="merchant"] .brand-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}

html[data-surface="merchant"] .brand-name {
  overflow: hidden;
  font-size: 19px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-surface="merchant"] .brand-sub {
  display: block;
  color: rgba(255,255,255,.84);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .08em;
}

html[data-surface="merchant"] .merchant-account-wrap {
  max-width: min(44vw, 210px);
  margin-left: auto;
}

html[data-surface="merchant"] .merchant-account-chip {
  max-width: 100%;
  border-radius: 11px;
  background: rgba(138,54,14,.18);
}

html[data-surface="merchant"] .merchant-account-copy b {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-surface="merchant"] #view-merchant {
  padding-top: 14px;
}

html[data-surface="merchant"] .merchant-section-header {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 13px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ref-line);
  padding: 5px 2px 13px;
}

html[data-surface="merchant"] .merchant-section-header[hidden] { display: none; }

html[data-surface="merchant"] .merchant-section-header > div {
  display: grid;
  gap: 2px;
}

html[data-surface="merchant"] .merchant-section-header span {
  color: var(--ref-text-3);
  font-size: 11px;
}

html[data-surface="merchant"] .merchant-section-header h2 {
  margin: 0;
  color: var(--ref-text);
  font-size: 21px;
  line-height: 1.25;
}

html[data-surface="merchant"] .merchant-section-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--ref-line-d);
  border-radius: 10px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ref-text-2);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

html[data-surface="merchant"] .merchant-section-back svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-surface="merchant"] .merchant-identity {
  padding: 13px 14px;
}

html[data-surface="merchant"] .quick-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
}

html[data-surface="merchant"] .quick {
  min-height: 96px;
  border-radius: 13px;
  padding: 14px 10px;
  box-shadow: none;
}

html[data-surface="merchant"] .quick .qi {
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #FFF1E8;
  color: var(--ref-orange-d);
}

html[data-surface="merchant"] .quick .qi svg,
html[data-surface="merchant"] .merchant-mobile-tabbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-surface="merchant"] .quick .qt {
  margin-top: 8px;
  font-size: 14px;
}

html[data-surface="merchant"] .stats {
  gap: 8px;
}

html[data-surface="merchant"] .stat {
  border-radius: 11px;
  padding: 11px;
  box-shadow: none;
}

html[data-surface="merchant"] .merchant-profile-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

html[data-surface="merchant"] .merchant-profile-grid :is(input,select,textarea) {
  width: 100%;
  border: 1px solid var(--ref-line-d);
  border-radius: 9px;
  background: #fff;
  color: var(--ref-ink);
  font: inherit;
}

html[data-surface="merchant"] .merchant-profile-grid textarea {
  min-height: 92px;
  resize: vertical;
}

html[data-surface="merchant"] .merchant-profile-save {
  display: block;
  width: min(100%,320px);
  margin: 13px auto 0;
}

html[data-surface="merchant"] [data-merchant-section-panel][hidden],
html[data-surface="merchant"] [data-merchant-workspace-home][hidden] { display: none !important; }

html[data-surface="merchant"] #todayOutingCard > .card-title-row h3,
html[data-surface="merchant"] #merchantPhotosCard #merchantPhotosTitle,
html[data-surface="merchant"] #pubCard > h3,
html[data-surface="merchant"] #verifyCard > h3 { display: none; }

/* 照片维护由弹层改为真正的二级页面。 */
body.merchant-photos-open { overflow: auto; }
html[data-surface="merchant"] #merchantPhotosCard {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  padding: 0;
}
html[data-surface="merchant"] #merchantPhotosCard[hidden] { display: none !important; }
html[data-surface="merchant"] #merchantPhotosCard .merchant-photo-panel {
  position: static;
  width: 100%;
  max-height: none;
  overflow: visible;
}

/* 身份选择只保留业务身份本身，避免两张长说明卡上下堆叠。 */
.identity-choice-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

.identity-choice {
  grid-template-columns: 40px minmax(0,1fr);
  min-height: 68px;
  gap: 10px;
  padding: 12px;
}

.identity-choice-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.identity-choice-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.identity-choice b { font-size: 14px; }
.identity-lock-note { margin-top: 12px; }

/* 摊主协议是服务器入口的一次性确认；必要边界不藏入帮助。 */
body.merchant-consent-open { overflow: hidden; }
.merchant-consent-mask {
  position: fixed;
  inset: 0;
  z-index: 560;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45,35,32,.68);
}
.merchant-consent-mask[hidden] { display: none; }
.merchant-consent-dialog {
  width: min(100%, 470px);
  overflow: hidden;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(96,54,28,.28);
}
.merchant-consent-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  background: linear-gradient(135deg,#FF6B35,#FF9A3D);
  color: #fff;
}
.merchant-consent-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  padding: 4px;
  background: #fff;
}
.merchant-consent-brand div { display: grid; gap: 1px; }
.merchant-consent-brand b { font-size: 15px; }
.merchant-consent-brand span { color: rgba(255,255,255,.84); font-size: 10px; }
.merchant-consent-copy { padding: 20px; }
.merchant-consent-copy h2 { margin: 0 0 7px; color: var(--ref-text); font-size: 23px; }
.merchant-consent-copy > p { margin: 0; color: var(--ref-text-2); font-size: 13px; line-height: 1.65; }
.merchant-consent-copy ul { display: grid; gap: 5px; margin: 13px 0; padding-left: 20px; color: var(--ref-text-2); font-size: 12px; line-height: 1.55; }
.merchant-consent-check {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  gap: 9px;
  border-top: 1px solid var(--ref-line);
  border-bottom: 1px solid var(--ref-line);
  padding: 13px 2px;
  color: var(--ref-text-2);
  font-size: 12px;
  line-height: 1.55;
}
.merchant-consent-check input { width: 20px; height: 20px; min-height: 0; flex: none; margin: 0; accent-color: var(--ref-orange); }
.merchant-consent-check a { color: var(--ref-orange-d); font-weight: 750; }
.merchant-consent-error { min-height: 20px; padding-top: 5px; color: var(--ref-red); font-size: 11px; }
.merchant-consent-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 8px; }
.merchant-consent-actions :is(button,.publish) { width: 100%; min-height: 44px; margin: 0; }
.merchant-consent-actions button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }

@media (max-width: 600px) {
  html[data-surface="merchant"] .merchant-profile-grid { grid-template-columns: 1fr; }
  html[data-surface="merchant"] .merchant-profile-grid label:first-child { grid-column: auto; }
  html[data-surface="merchant"] .product-header {
    padding: 12px 13px;
  }
  html[data-surface="merchant"] .product-header .brand-row { margin: 0; }
  html[data-surface="merchant"] .product-header .logo {
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex-basis: 42px;
    border-radius: 12px;
  }
  html[data-surface="merchant"] .product-header .brand-icon-v2 { width: 32px; height: 32px; }
  html[data-surface="merchant"] .brand-name { font-size: 17px; }
  html[data-surface="merchant"] .merchant-account-wrap { flex: 0 1 auto; max-width: 41vw; margin-left: auto; }
  html[data-surface="merchant"] .merchant-account-chip { width: auto; }
  html[data-surface="merchant"] .merchant-account-copy { min-width: 0; }
  html[data-surface="merchant"] .merchant-account-copy b { max-width: 70px; }
  html[data-surface="merchant"] .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  html[data-surface="merchant"] .quick { min-height: 92px; }
  html[data-surface="merchant"] .merchant-mobile-tabbar svg { width: 20px; height: 20px; }
  .merchant-consent-mask { align-items: end; padding: 0; }
  .merchant-consent-dialog { border-radius: 18px 18px 0 0; padding-bottom: max(0px,env(safe-area-inset-bottom)); }
}

@media (max-width: 340px) {
  html[data-surface="merchant"] .brand-sub { display: none; }
  html[data-surface="merchant"] .merchant-account-avatar { display: none; }
  html[data-surface="merchant"] .merchant-account-copy b { max-width: 58px; }
  .identity-choice-grid { gap: 8px; padding-inline: 14px; }
  .identity-choice { grid-template-columns: 34px minmax(0,1fr); gap: 7px; padding: 9px; }
  .identity-choice-icon { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-surface="merchant"] .quick { transition: none; }
}
