:root {
  --radius: 12px;
  --app-header-height: 4.5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  height: 100%;
  line-height: 1.5;
}

#app {
  min-height: 100%;
}

/* 使用传统滚动条（含可点击轨道），避免系统覆盖式滚动条只能拖滑块 */
* {
  scrollbar-width: auto;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 70%, transparent) color-mix(in srgb, var(--surface2) 80%, transparent);
}
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
*::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--surface2) 88%, var(--bg));
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 62%, var(--border));
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text) 55%, var(--primary) 20%);
  background-clip: padding-box;
}
*::-webkit-scrollbar-button {
  display: block;
  width: 12px;
  height: 0;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

.page-content,
#nav-menu {
  scrollbar-gutter: stable;
}

.hidden { display: none !important; }

html.auth-boot-session #login-page { display: none !important; }
html.auth-boot-session #main-app { display: flex !important; }

/* Login */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.login-page-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #0f1419;
  background-image: linear-gradient(135deg, #0f172a 0%, #1e3a5f 45%, #0f172a 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.85s ease;
  transform: scale(1.02);
  will-change: opacity, transform;
}

.login-page-bg.is-visible {
  opacity: 1;
  transform: scale(1);
  transition: opacity 1s ease, transform 8s ease-out;
}

.login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(8, 12, 20, 0.72) 0%,
    rgba(15, 20, 35, 0.55) 45%,
    rgba(8, 12, 20, 0.78) 100%
  );
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 400px;
  max-width: 92vw;
  background: rgba(24, 24, 31, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.login-page--denied::after {
  background: linear-gradient(135deg, rgba(8, 12, 20, 0.88) 0%, rgba(30, 20, 20, 0.75) 100%);
}

.login-denied-panel {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 420px;
}
.login-denied-img {
  width: 180px;
  height: auto;
  margin: 0 auto 1.25rem;
  display: block;
  opacity: 0.95;
}
.login-denied-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fecaca;
  margin-bottom: .75rem;
}
.login-denied-text {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: .5rem;
}
.login-denied-example {
  font-size: .75rem;
  color: rgba(255, 255, 255, 0.45);
  word-break: break-all;
}
.login-denied-example code {
  font-size: .72rem;
  color: #fca5a5;
}

.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 3px;
}
.login-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  padding: .55rem .75rem;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.login-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.login-tab.login-tab--disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.brand { text-align: center; margin-bottom: 2rem; }
.brand-icon { font-size: 3rem; margin-bottom: .5rem; }
.brand h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand p { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: .8125rem; color: var(--text-muted); margin-bottom: .375rem; }
.field input,
.field textarea,
.field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: .75rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9375rem;
  font-family: inherit;
  transition: border-color .2s;
}
.field textarea {
  display: block;
  min-height: 5rem;
  line-height: 1.5;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus { outline: none; border-color: var(--primary); }

.captcha-row { display: flex; gap: .5rem; align-items: center; }
.captcha-row input { flex: 1; }
.captcha-img {
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.login-entry-hint {
  margin: 0 0 1rem;
  padding: .5rem .75rem;
  border-radius: var(--radius);
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .25);
  color: var(--danger, #dc2626);
  font-size: .8125rem;
  line-height: 1.45;
}

.login-form-error {
  color: var(--danger);
  font-size: .875rem;
  margin-bottom: .75rem;
  padding: .625rem .75rem;
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: var(--radius);
}

.login-phone-hint {
  margin-top: .35rem;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.field input:invalid:not(:placeholder-shown):not(.setting-input) {
  border-color: rgba(239, 68, 68, .55);
}

.alert-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.alert-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.alert-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: rgba(248, 113, 113, .15);
  color: var(--danger);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 48px;
}
.alert-box h3 { margin-bottom: .5rem; font-size: 1.125rem; }
.alert-box p { color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.6; word-break: break-word; }

.sms-row { display: flex; gap: .5rem; }
.sms-row input { flex: 1; }
.sms-row .btn-ghost:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  white-space: nowrap;
}

.btn-primary, .btn-ghost, .btn-sm {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: var(--btn-text);
  padding: .875rem 1.5rem;
  font-size: .9375rem;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-hover); }
.btn-sm { padding: .5rem .75rem; font-size: .8125rem; }

/* Layout??????????????????????? */
.main-app {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}
.main-app:not(.hidden) {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
body:has(.main-app:not(.hidden)) {
  overflow: hidden;
  height: 100%;
}
body:has(.main-app:not(.hidden)) #app {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body:has(.main-app:not(.hidden)) #app > .main-app {
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 272px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.sidebar-brand {
  padding: 0 1.5rem;
  min-height: var(--app-header-height);
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}

#nav-menu {
  flex: 1 1 auto;
  min-height: 0;
  padding: .75rem .5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group { margin-bottom: .375rem; }

/* ??????????????? */
.nav-group-head,
#nav-menu > .nav-item {
  background: color-mix(in srgb, var(--surface2) 28%, var(--surface));
}
.nav-group-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5625rem .75rem;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .22s ease, color .22s ease;
}
.nav-group-head:hover,
#nav-menu > .nav-item:hover {
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
  color: var(--text);
}
.nav-group.expanded > .nav-group-head {
  background: color-mix(in srgb, var(--surface2) 62%, var(--surface));
  color: var(--text);
}

.nav-group-head .nav-icon {
  font-size: .9375rem;
}

.nav-group-title-text { flex: 1; letter-spacing: .02em; }

/* ?????????/???? */
.nav-group-body {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0 .125rem;
  padding: 0 .25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  box-shadow: none;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    grid-template-rows .34s cubic-bezier(0.4, 0, 0.2, 1),
    opacity .26s ease,
    margin .34s cubic-bezier(0.4, 0, 0.2, 1),
    padding .34s cubic-bezier(0.4, 0, 0.2, 1),
    border-color .26s ease,
    box-shadow .26s ease;
}
.nav-group-body-inner {
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.nav-group.expanded .nav-group-body {
  grid-template-rows: 1fr;
  margin: .1875rem .125rem .375rem;
  padding: .3125rem .25rem;
  background: color-mix(in srgb, var(--surface2) 2%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 55%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent);
  opacity: 1;
  pointer-events: auto;
}

.nav-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9375rem;
  margin-bottom: .25rem;
  transition: all .15s;
}
#nav-menu > .nav-item.active {
  background: var(--sidebar-accent);
  color: var(--primary-hover);
}
.nav-subitem {
  padding: .5625rem .75rem .5625rem .875rem;
  font-size: .875rem;
  margin-bottom: .125rem;
  background: color-mix(in srgb, var(--surface) 18%, transparent);
  position: relative;
  z-index: 1;
}
.nav-subitem:hover:not(.active) {
  background: color-mix(in srgb, var(--surface2) 55%, transparent);
  color: var(--text);
}
.nav-subitem.active {
  background: transparent;
  color: var(--primary-hover);
  font-weight: 600;
}
.nav-subitem .nav-icon { font-size: .9375rem; }
.nav-subitem span:last-child { flex: 1; }

/* ??/????????? */
.nav-subitem-lens {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(1);
  transition:
    top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease;
  background:
    radial-gradient(ellipse 88% 130% at 50% 32%,
      color-mix(in srgb, white 58%, var(--sidebar-accent)) 0%,
      color-mix(in srgb, var(--primary) 16%, var(--sidebar-accent)) 48%,
      color-mix(in srgb, var(--primary) 10%, var(--surface2)) 100%);
  box-shadow:
    0 3px 12px color-mix(in srgb, var(--primary) 24%, transparent),
    0 1px 0 color-mix(in srgb, white 72%, transparent) inset,
    0 -2px 8px color-mix(in srgb, var(--primary) 14%, transparent) inset,
    0 0 0 1px color-mix(in srgb, var(--primary) 20%, transparent);
}
.nav-subitem-lens.visible { opacity: 1; }

.nav-subgroup { margin: .125rem 0 .25rem; }
.nav-subgroup-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5625rem .75rem .5625rem .875rem;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  transition: background .22s ease, color .22s ease;
}
.nav-subgroup-head .nav-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  font-size: .9375rem;
}
.nav-subgroup-head:hover {
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
  color: var(--text);
}
.nav-subgroup.expanded > .nav-subgroup-head {
  background: color-mix(in srgb, var(--surface2) 45%, var(--surface));
  color: var(--text);
}
.nav-subgroup.has-active-child > .nav-subgroup-head {
  background: transparent;
  color: var(--text-muted);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 55%, transparent);
}
.nav-subgroup.has-active-child.expanded > .nav-subgroup-head {
  color: var(--text);
}
.nav-subgroup-title { flex: 1; letter-spacing: .02em; }
.nav-subgroup-body {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  padding: 0;
  border-radius: calc(var(--radius) - 2px);
  border-left: 2px solid transparent;
  background: transparent;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    grid-template-rows .3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity .24s ease,
    margin .3s cubic-bezier(0.4, 0, 0.2, 1),
    padding .3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color .24s ease,
    background .24s ease;
}
.nav-subgroup-body-inner {
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.nav-subgroup.expanded .nav-subgroup-body {
  grid-template-rows: 1fr;
  margin: .125rem 0 .125rem;
  padding: .125rem 0 .125rem .125rem;
  background: transparent;
  border-left: 2px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  opacity: 1;
  pointer-events: auto;
}
.nav-subgroup.has-active-child.expanded .nav-subgroup-body {
  border-left-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
.nav-subitem-l3 {
  padding: .5625rem .75rem .5625rem .875rem;
  font-size: .875rem;
  margin-bottom: .125rem;
  background: transparent;
  position: relative;
  z-index: 1;
}
.nav-subitem-l3:hover:not(.active) {
  background: color-mix(in srgb, var(--surface2) 40%, transparent);
  color: var(--text);
}
.nav-subitem-l3.active {
  background: transparent;
  color: var(--primary-hover);
  font-weight: 600;
}
.nav-subgroup-body-inner .nav-subitem-lens {
  left: 0;
  right: 0;
}
.nav-subitem-l3 .nav-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  font-size: .9375rem;
}
.nav-subitem-l3 span:last-child { flex: 1; }

@media (prefers-reduced-motion: reduce) {
.nav-group-body,
  .nav-subgroup-body,
  .nav-group-head,
  .nav-subgroup-head,
  .nav-subitem-lens {
    transition: none !important;
    animation: none !important;
  }
  
  .flatpickr-calendar.animate.open {
    animation: none !important;
  }
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.user-info { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.sidebar-auth-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.sidebar-auth-actions .btn-sm {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
}
.password-policy-hint {
  margin: 0 0 1rem;
  padding: .65rem .75rem;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--surface-elevated);
  border-radius: .5rem;
  border: 1px solid var(--border);
}
.form-modal-footer--triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .5rem;
}
.form-modal-footer--triple .btn-secondary,
.form-modal-footer--triple .btn-ghost,
.form-modal-footer--triple .btn-primary {
  min-width: 5.5rem;
}

.form-modal-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ios-overlay, color-mix(in srgb, var(--bg) 48%, transparent));
  backdrop-filter: blur(12px) saturate(175%);
  -webkit-backdrop-filter: blur(12px) saturate(175%);
  border-radius: inherit;
  pointer-events: auto;
}
.form-modal-loading-overlay .app-loading-overlay {
  position: static;
  min-height: auto;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
  flex-direction: column;
  gap: .65rem;
}
.form-modal-loading-overlay .app-loading-text {
  margin: 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
}
.form-modal-footer--preview-close {
  display: flex;
  justify-content: flex-end;
}

.form-modal-footer--preview-send {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
}

.message-preview-modal .form-modal-body {
  max-height: min(68vh, 640px);
  overflow-y: auto;
}

.form-modal-footer--triple .btn-primary {
  width: 100%;
  min-width: 0;
  justify-content: center;
}
.message-preview-summary {
  margin: 0 0 .75rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}
.message-preview-meta {
  margin: 0 0 .5rem;
  font-size: .8125rem;
  color: var(--text-muted);
}
.message-preview-prop-list {
  margin: 0 0 1rem 1.1rem;
  padding: 0;
  font-size: .8125rem;
  color: var(--text-muted);
}
.message-preview-sample {
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--border);
}
.message-preview-sample-head {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .8125rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--text);
}
.message-preview-channel {
  margin-bottom: .65rem;
}
.message-preview-channel strong {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .25rem;
}
.message-preview-content {
  margin: 0;
  padding: .5rem .65rem;
  font-size: .8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-elevated);
  color: var(--text);
  border-radius: .4rem;
  border: 1px solid var(--border);
  font-family: inherit;
}
.message-preview-content--html {
  white-space: normal;
}
.message-preview-content--html,
.message-preview-content--doc,
.message-preview-content--html .doc-notice-body,
.message-preview-content--doc .doc-notice-body {
  color: var(--text);
  background: var(--surface-elevated);
}
.message-preview-content--html p,
.message-preview-content--doc p,
.message-preview-content--html .doc-notice-body p,
.message-preview-content--doc .doc-notice-body p {
  color: var(--text);
}
.message-preview-content--html .doc-notice-title,
.message-preview-content--doc .doc-notice-title {
  color: var(--text) !important;
}
.doc-notice-body {
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.65;
  color: var(--text);
}
.doc-notice-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.doc-notice-p { margin: 0 0 8px; color: var(--text); }
.doc-notice-p--center { text-align: center; }
.doc-notice-p--right { text-align: right; }
.doc-notice-p--justify { text-align: justify; }
.doc-notice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  table-layout: fixed;
}
.doc-notice-td {
  border: 1px solid var(--border, #d1d5db);
  padding: 6px 8px;
  vertical-align: top;
  color: var(--text);
  word-break: break-word;
}
.doc-notice-cell-line { display: block; width: 100%; }
.doc-notice-cell-line--center { text-align: center; }
.doc-notice-cell-line--right { text-align: right; }
.doc-notice-cell-line--justify { text-align: justify; }
.message-preview-content--doc.print-doc-html table,
.message-preview-content--doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
}
.message-preview-content--doc.print-doc-html td,
.message-preview-content--doc.print-doc-html th,
.message-preview-content--doc td,
.message-preview-content--doc th {
  border: 1px solid var(--border, #d1d5db);
  padding: 4px 6px;
  vertical-align: top;
  word-break: break-word;
}
.message-preview-empty {
  color: var(--text-muted);
  font-size: .875rem;
}
.message-preview-recipients {
  margin: .75rem 0 1rem;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.message-preview-recipient-list {
  margin: .45rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 14rem;
  overflow: auto;
}
.message-preview-recipient-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .75rem;
  padding: .35rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  font-size: .8125rem;
}
.message-preview-recipient-item:last-child { border-bottom: none; }
.message-preview-recipient-room {
  font-weight: 600;
  color: var(--text);
  min-width: 6rem;
}
.message-preview-recipient-contacts,
.message-preview-sample-contacts {
  color: var(--text-muted);
  font-size: .8125rem;
}

.message-send-bind-link--inline {
  margin-left: 0.25rem;
  vertical-align: baseline;
}
.form-modal-error .message-send-bind-link {
  font-size: inherit;
}
.tenant-contact-bind-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.tenant-contact-bind-field {
  display: block;
  margin-bottom: 0.75rem;
}
.tenant-contact-bind-field span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.tenant-contact-bind-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
}
.tenant-contact-bind-actions {
  display: flex;
  justify-content: flex-end;
}
  padding-top: .35rem;
  color: var(--text-muted);
  font-size: .75rem;
}
.msg-template-card--announcement .doc-mgmt-var-tag {
  padding: 0.32rem 0.58rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  min-height: 1.75rem;
}
.msg-template-card--announcement .foldable-chip-slot--lines2 {
  height: 4.1rem;
}
.msg-template-card--announcement .foldable-chip-more {
  line-height: 2rem;
}
.dashboard-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem .5rem;
  margin-left: auto;
}
.dashboard-top-actions .btn-sm {
  flex-shrink: 0;
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--btn-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .875rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar.avatar--img {
  background: var(--surface2);
  padding: 0;
}
.avatar img,
.avatar .lazy-img-wrap,
.avatar .lazy-img-wrap > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.avatar .lazy-img-wrap {
  overflow: hidden;
  position: relative;
}
.avatar .lazy-img-wrap > img.lazy-img-gif {
  display: none !important;
}
.role-tag { font-size: .75rem; color: var(--text-muted); }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
}

.topbar {
  flex-shrink: 0;
  padding: 0 2rem;
  min-height: var(--app-header-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}
.topbar h2 {
  font-size: 1.375rem;
  font-weight: 600;
  flex: 0 1 auto;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem 1.25rem;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
}
.topbar-user {
  margin-bottom: 0;
  flex-shrink: 0;
}
.topbar-user-text {
  min-width: 0;
}
.topbar-user .role-tag {
  color: var(--primary);
}
.topbar-user .role-tag {
  color: var(--primary);
}
.topbar-theme {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.topbar-theme .theme-select-label {
  margin-bottom: 0;
  white-space: nowrap;
}
.topbar-theme .theme-select {
  width: auto;
  min-width: 7rem;
}
.topbar-auth-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.page-footer-actions {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 2rem;
  padding-bottom: calc(.75rem + var(--safe-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.page-footer-actions[hidden] {
  display: none !important;
}

.page-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Cards & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stats-grid--centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 0;
}
.stats-grid--centered .stat-card {
  flex: 0 1 13.5rem;
  min-width: 12.5rem;
  max-width: 15rem;
  text-align: center;
}
.stats-grid--centered .stat-card .label,
.stats-grid--centered .stat-card .value,
.stats-grid--centered .stat-card .stat-sub {
  text-align: center;
}

/* ??? */
.page-content:has(.study-dashboard) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.study-dashboard {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.study-dashboard-nav {
  flex: 0 0 20%;
  max-width: 20%;
  min-width: 11rem;
  border-right: 1px solid var(--border);
  background: var(--surface2, var(--surface));
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: auto;
}
.study-dashboard-nav-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 0.35rem;
}
.study-dashboard-sub {
  font-size: 0.78rem;
  margin: 0 0 0.35rem;
  padding: 0 0.35rem;
  line-height: 1.4;
}
.study-dashboard-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.study-dashboard-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.study-dashboard-tab:hover {
  background: color-mix(in srgb, var(--primary, #3b82f6) 8%, transparent);
}
.study-dashboard-tab.is-active {
  background: color-mix(in srgb, var(--primary, #3b82f6) 14%, transparent);
  border-color: color-mix(in srgb, var(--primary, #3b82f6) 35%, var(--border));
}
.study-dashboard-tab-label {
  font-size: 0.92rem;
  font-weight: 600;
}
.study-dashboard-tab-count {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 600;
}
.study-dashboard-tab.is-active .study-dashboard-tab-count {
  color: var(--primary, #3b82f6);
}
.study-dashboard-main {
  flex: 1 1 80%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.1rem 1.25rem;
}
.sd-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sd-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--surface);
}
.sd-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.sd-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.sd-card-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.sd-meta-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.9rem;
  margin: 0.25rem 0;
}
.sd-meta-row > span {
  color: var(--text-muted);
  min-width: 4.5rem;
  flex: 0 0 auto;
}
.sd-meta-row > strong {
  font-weight: 600;
  color: var(--text);
}
.sd-section-label {
  margin-top: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}
.sd-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.55rem;
}
.sd-staff-role {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  background: var(--surface2, var(--surface));
  position: relative;
}
.sd-staff-role-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  min-height: 1.2rem;
}
.sd-staff-role-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0;
}
.sd-staff-role-status {
  flex: 0 0 auto;
  max-width: 5.5rem;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: #b45309;
}
.sd-staff-role-status.st-selected,
.sd-staff-role-status.st-accepted {
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: #b45309;
}
.sd-staff-role-status.st-rejected,
.sd-staff-role-status.st-cancelled {
  background: color-mix(in srgb, #ef4444 14%, transparent);
  color: #b91c1c;
}
.sd-staff-role-status.st-departed,
.sd-staff-role-status.st-finished,
.sd-staff-role-status.st-completed,
.sd-staff-role-status.st-settled,
.sd-staff-role-status.st-reviewed {
  background: color-mix(in srgb, #10b981 14%, transparent);
  color: #047857;
}
.sd-staff-role-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}
.sd-person {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.sd-person--stack {
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  width: 100%;
}
.sd-person--lg {
  align-items: flex-start;
  gap: 0.55rem;
}
.sd-person-name {
  font-size: 0.82rem;
  color: var(--text);
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-person--stack .sd-person-name {
  max-width: 100%;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.25;
}
.sd-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--surface2, #e5e7eb);
}
.sd-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: color-mix(in srgb, var(--primary, #3b82f6) 75%, #0f172a);
}
.sd-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.sd-muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.sd-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.sd-table th,
.sd-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.sd-table th {
  background: var(--surface2, var(--surface));
  color: var(--text-muted);
  font-weight: 600;
}
.sd-table tr:last-child td {
  border-bottom: none;
}
.sd-money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.sd-foot {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.sd-chart {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.sd-chart-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.sd-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.5rem;
  gap: 0.55rem;
  align-items: center;
}
.sd-bar-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
}
.sd-bar-track {
  height: 0.85rem;
  border-radius: 999px;
  background: var(--surface2, #e5e7eb);
  overflow: hidden;
}
.sd-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary, #3b82f6) 70%, #0ea5e9), var(--primary, #3b82f6));
  min-width: 0;
}
.sd-bar-val {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.page-content:has(.dashboard-page-root) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dashboard-page-root {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
}
.dashboard-upper {
  flex: 0 0 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  overflow: hidden;
}
.dashboard-lower {
  flex: 0 0 50%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  overflow: hidden;
}
.dashboard-chart-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.dashboard-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0 0.25rem 0.5rem;
}
.dashboard-chart-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.dashboard-chart-tabs {
  display: flex;
  gap: 0.35rem;
}
.dashboard-chart-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
.dashboard-chart-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.dashboard-chart-body {
  flex: 1;
  min-height: 0;
  position: relative;
}
.dashboard-chart-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 12rem;
}
.dashboard-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  width: 100%;
  position: relative;
  z-index: 30;
}
.dashboard-announce-form--modal .dashboard-announce-field > label {
  flex: 0 0 4.5rem;
}
.message-channel-hint {
  margin: 0 0 .75rem;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.message-channel-modal-channels {
  padding-top: .15rem;
}
.message-channel-option {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  margin-right: 1rem;
}
.message-channel-option--disabled {
  opacity: .55;
  cursor: not-allowed;
}
.message-channel-option--disabled input[type="checkbox"] {
  cursor: not-allowed;
}
.message-channel-disabled-tip {
  display: block;
  margin-top: .2rem;
  font-size: .75rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.setting-field-radio.field label.settings-radio-opt {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: .35rem;
  margin-bottom: 0;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.setting-field-radio .settings-radio-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.25rem;
}
.settings-radio-opt {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.settings-radio-opt input[type="radio"],
.setting-field-radio .setting-input.setting-radio {
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  flex-shrink: 0;
}
.settings-radio-opt input {
  accent-color: var(--primary);
}
.setting-field-radio.setting-field-row {
  padding: .4rem 0;
}
.setting-field-radio .setting-field-line--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
}
.setting-field-radio .setting-label {
  flex: none;
  max-width: none;
  white-space: normal;
}
.setting-field-radio .setting-control {
  min-width: 0;
  width: 100%;
}
.setting-field-radio .field-hint,
.setting-field-radio .setting-field-hint {
  margin: .2rem 0 0 0;
  padding: 0;
  font-size: .8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.settings-tab-panel[data-tab-panel="message"] .settings-message-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.settings-message-section {
  padding: 1rem 0.85rem 0.85rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.settings-message-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
}
.settings-tab-panel[data-tab-panel="message"] .settings-message-retry-fields {
  margin-bottom: 0;
}
.settings-tab-panel[data-tab-panel="message"] .settings-message-bill-fields {
  gap: 0.65rem;
}
.settings-tab-panel[data-tab-panel="message"] .setting-field-row {
  padding: 0.35rem 0;
}
.settings-finance-single {
  max-width: 42rem;
}
.setting-input--invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 22%, transparent);
}
.dashboard-top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  gap: .75rem;
  flex-shrink: 0;
  width: 100%;
  max-width: 28rem;
  overflow: visible;
  position: relative;
  padding-bottom: .25rem;
}
.dashboard-announce-panel {
  flex: 1 1 20rem;
  max-width: 38rem;
  margin-left: auto;
  padding: 1rem 1.15rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: .75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.dashboard-announce-title {
  margin: 0 0 .85rem;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.dashboard-announce-form {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.dashboard-announce-field {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
}
.dashboard-announce-field > label {
  flex: 0 0 4.5rem;
  padding-top: .45rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.dashboard-announce-field .finance-area-combo {
  flex: 1;
  min-width: 0;
  max-width: none;
}
.dashboard-multi-combo {
  position: relative;
  display: block;
  width: 100%;
}
.dashboard-multi-combo .finance-area-combo-field {
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
}
.dashboard-multi-combo .dashboard-multi-field {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  cursor: pointer;
  padding: 0;
}
.dashboard-multi-combo .dashboard-multi-display {
  flex: 1 1 auto;
  min-width: 0;
  padding: .35rem .65rem;
}
.dashboard-multi-combo .finance-area-combo-toggle {
  flex-shrink: 0;
  margin-left: auto;
}
.dashboard-announce-modal.form-modal-wide .form-modal-body {
  overflow: visible;
}
.dashboard-announce-tabs-wrap {
  margin-bottom: .75rem;
}
.dashboard-announce-audience-hint,
.dashboard-announce-wechat-hint {
  margin: 0 0 .75rem;
  font-size: .8125rem;
  color: var(--text-muted, #64748b);
}
.hr-wechat-banner {
  margin-bottom: .75rem;
  flex-shrink: 0;
}
.page-content:has(.hr-wechat-approval-page) {
  padding: 1rem 1.25rem;
  overflow: auto;
}
.hr-wechat-approval-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 10rem);
}
.hr-wechat-approval-page .hr-approval-panel--wechat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.hr-wechat-approval-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  gap: 0;
}
.hr-wechat-approval-nav {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding-bottom: 0.5rem;
  margin-bottom: 0.65rem;
}
.hr-wechat-category-tabs {
  margin-bottom: 0.5rem;
}
.hr-wechat-subtabs-wrap {
  padding: 0 0.1rem;
}
.hr-wechat-subtabs-empty {
  margin: 0.25rem 0;
}
.hr-wechat-type-tabs {
  flex-wrap: wrap;
  gap: 0.35rem;
}
.hr-wechat-template-tab--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.hr-wechat-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface2));
  color: var(--primary);
  font-size: 0.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.hr-wechat-template-tab.is-active .hr-wechat-tab-icon {
  background: color-mix(in srgb, #fff 22%, transparent);
  color: var(--btn-text, #fff);
}
.hr-wechat-tab-label {
  line-height: 1.2;
}
.hr-wechat-approval-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}
.hr-wechat-query-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1.25rem;
  width: 100%;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-sizing: border-box;
}
.hr-wechat-query-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.hr-wechat-query-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.hr-wechat-query-input {
  width: 100%;
  min-height: 2.125rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--input-bg, var(--surface2, var(--surface)));
  color: var(--input-fg, var(--text));
  font-family: inherit;
  font-size: 0.875rem;
  box-sizing: border-box;
  accent-color: var(--primary);
}
.hr-wechat-query-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--focus-ring, color-mix(in srgb, var(--primary) 25%, transparent));
}
.hr-wechat-date-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.hr-wechat-date-range .hr-wechat-query-input {
  flex: 1;
  min-width: 0;
}
.hr-wechat-date-range input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
}
.hr-wechat-date-range input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.72;
}
.hr-wechat-date-sep {
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}
.hr-wechat-query-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.15rem;
}
.hr-wechat-list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}
.hr-wechat-list-count {
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
}
.hr-wechat-list-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.hr-wechat-list-shell {
  flex: 1;
  min-height: 14rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
}
.hr-wechat-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100%;
}
.hr-wechat-query-table {
  width: 100%;
  min-width: 960px;
}
.hr-wechat-query-table th {
  white-space: nowrap;
  font-size: 0.8125rem;
}
.hr-wechat-sort-icon {
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
  margin-left: 0.15rem;
}
.hr-wechat-list-shell .hr-approval-table {
  margin-bottom: 0;
}
.hr-wechat-approval-page .hr-wechat-banner { margin-bottom: 0.75rem; }
@media (max-width: 1100px) {
  .hr-wechat-query-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .page-content:has(.hr-wechat-approval-page) {
    padding: 0.75rem;
  }
  .hr-wechat-query-grid {
    grid-template-columns: 1fr;
  }
}
.hr-wechat-amount-range {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.hr-wechat-amount-range .hr-wechat-query-input {
  flex: 1;
  min-width: 0;
}
.hr-wechat-amount-unit {
  color: var(--text-muted, #64748b);
  font-size: 0.875rem;
  flex-shrink: 0;
}
.hr-wechat-detail-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: .5rem 0 0;
  padding: .75rem;
  background: var(--surface-2, #f8fafc);
  border-radius: .375rem;
  font-size: .8125rem;
}
.hr-wechat-detail-fields {
  margin-top: .5rem;
  font-size: .8125rem;
}
.hr-wechat-detail-process {
  margin-top: .5rem;
}
.hr-wechat-process-node {
  padding: .5rem 0;
  border-bottom: 1px dashed var(--border);
}
.hr-wechat-process-node:last-child {
  border-bottom: none;
}
.hr-wechat-process-node ul {
  margin: .35rem 0 0 1rem;
  padding: 0;
}
.hr-wechat-detail-attachments {
  margin: .5rem 0 0 1rem;
  padding: 0;
}
.badge-muted {
  background: rgba(100, 116, 139, .15);
  color: #64748b;
}
.dashboard-multi-field {
  cursor: pointer;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  padding: .35rem .65rem;
  user-select: none;
}
.dashboard-multi-display {
  font-size: .875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-multi-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  font-size: .875rem;
  cursor: pointer;
}
.dashboard-multi-option:hover {
  background: var(--hover, rgba(59, 130, 246, .06));
}
.dashboard-multi-option input {
  flex-shrink: 0;
  margin: 0;
}
.dashboard-announce-textarea {
  flex: 1;
  min-height: 4.5rem;
  resize: vertical;
  padding: .5rem .65rem;
  font-size: .875rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--input-bg);
  color: var(--text);
  line-height: 1.45;
}
.dashboard-announce-channels {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
  padding-top: .25rem;
}
.dashboard-announce-channels label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
}
.dashboard-announce-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: .25rem;
  margin-left: 5.15rem;
}
.dashboard-announce-actions .btn-primary {
  min-width: 6rem;
}
.dashboard-top-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  text-align: left;
}
.dashboard-top-bar .finance-area-combo {
  flex: 1;
  min-width: 14rem;
  max-width: 22rem;
  z-index: 50;
}
.dashboard-stats-body {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: block;
}
.dashboard-stats-wrap {
  width: 100%;
  margin: 0;
}
.stats-grid--dashboard {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0;
  width: 100%;
}
.stats-grid--dashboard .stat-card {
  min-width: 0;
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}
.stat-card--clickable {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius, 8px);
  padding: 0.65rem 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  font: inherit;
  color: inherit;
  width: 100%;
}
.stat-card--clickable:hover {
  border-color: var(--primary);
}
.stat-card--clickable.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}
.stats-grid--dashboard .stat-card .label,
.stats-grid--dashboard .stat-card .value,
.stats-grid--dashboard .stat-card .stat-sub {
  text-align: center;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-grid--dashboard .stat-card .label {
  font-size: clamp(0.625rem, 0.72vw, 0.8125rem);
  line-height: 1.3;
}
.stats-grid--dashboard .stat-card .value {
  font-variant-numeric: tabular-nums;
}
.stats-grid--dashboard .stat-card .stat-sub {
  font-size: clamp(0.5625rem, 0.65vw, 0.75rem);
  line-height: 1.25;
}

.perm-settings-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.perm-settings-role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
}
.perm-settings-role-tab {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.perm-settings-role-tab:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  color: var(--text);
}
.perm-settings-role-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.perm-settings-head-body {
  padding: 0 1.25rem 1rem;
}
.perm-settings-group + .perm-settings-group {
  margin-top: 0.75rem;
}
.perm-settings-group-head {
  font-size: 0.9375rem;
}
.perm-settings-subgroup {
  margin: 0 1rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface2) 25%, transparent);
  overflow: hidden;
}
.perm-settings-subgroup-head {
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
}
.perm-page-list--nested {
  padding-top: 0.5rem;
}
.btn-xs {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.2;
}
.perm-settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.perm-settings-section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}
.perm-settings-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.35rem 0.75rem;
}
.perm-settings-check-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.perm-settings-check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.perm-settings-check-label {
  flex: 1;
  min-width: 0;
}
.perm-default-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
}
.perm-super-badge {
  font-size: 0.6875rem;
  color: var(--primary);
}
.perm-required-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
}
.perm-settings-check-row--menu.is-required-menu {
  opacity: 0.95;
}
.perm-code-tag {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.perm-settings-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0 1rem;
}
.perm-settings-custom-hint {
  margin: 0.25rem 0 0;
}

.perm-settings-section-hint {
  margin: 0 0 0.75rem;
}
.perm-page-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
}
.perm-page-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface2) 35%, var(--surface));
  overflow: hidden;
}
.perm-page-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.perm-page-title {
  font-weight: 600;
}
.perm-page-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem 0.75rem 1.5rem;
}
.perm-page-actions.hidden {
  display: none;
}
.perm-settings-check-row--menu {
  flex: 1;
}
.perm-settings-check-row--action {
  padding-left: 0.25rem;
}
.perm-page-no-actions {
  margin: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.perm-action-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}
.perm-page-toggle {
  flex-shrink: 0;
  font-size: 0.75rem;
}

/* ???? */
.profile-center-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 56rem;
}
.profile-center-page--records {
  max-width: none;
  width: 100%;
}
.profile-center-page--records .profile-record-panel,
.profile-center-page--records .profile-record-summary {
  width: 100%;
}
.profile-center-page--share {
  max-width: none;
  width: 100%;
}
.profile-center-page--share .profile-record-panel,
.profile-center-page--share .profile-record-summary,
.profile-center-page--share .profile-share-code-card {
  width: 100%;
}
.profile-center-page--share .profile-record-panel .card {
  margin-top: 0.75rem;
  background: color-mix(in srgb, var(--surface2) 35%, var(--surface));
  border: 1px solid var(--border);
}
.profile-center-page--share .profile-record-panel .table-wrap {
  width: 100%;
}
.profile-center-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.profile-center-head-icon { font-size: 1.25rem; }
.profile-wallet-grid,
.profile-commission-grid,
.profile-record-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
  width: 100%;
}
.profile-record-panel {
  padding: 1rem;
}
.profile-record-panel--secondary {
  background: color-mix(in srgb, var(--surface2) 40%, var(--surface));
}
.profile-record-panel-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}
.profile-point-change--plus {
  color: var(--success, #16a34a);
  font-weight: 600;
}
.profile-point-change--minus {
  color: var(--danger, #dc2626);
  font-weight: 600;
}
.profile-coupon-available-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.65;
}
.profile-stat-card {
  padding: 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
  border: 1px solid var(--border);
}
.profile-stat-card--primary {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}
.profile-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.profile-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.profile-record-summary--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 28rem;
}
.profile-record-summary--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 40rem;
}
.my-order-card--study {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.my-order-card--study .my-order-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.my-order-card--study .my-order-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.my-order-card--study .my-order-aside {
  text-align: right;
}
.my-order-card--study .my-order-amount {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.my-order-card--study .my-order-status {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--primary-hover, var(--primary));
  font-weight: 600;
}
.profile-center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.profile-center-hint,
.profile-bank-current,
.profile-kyc-status {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.profile-article-body p {
  margin: 0 0 0.85rem;
  line-height: 1.75;
  color: var(--text);
}
.profile-article-body p:last-child {
  margin-bottom: 0;
}
.profile-article-version {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
  margin: 0 0 1rem;
}
.profile-article-h {
  margin: 1.25rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.profile-article-h:first-of-type {
  margin-top: 0.25rem;
}
.profile-article-h2 {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.profile-about-sec {
  margin: 0 0 1.15rem;
}
.profile-about-sec:last-child { margin-bottom: 0; }
.profile-about-k {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.profile-about-v {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-about-culture-t {
  margin-top: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.profile-about-culture-t:first-child { margin-top: 0; }
.profile-about-license {
  display: block;
  width: min(100%, 28rem);
  max-height: 22rem;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.profile-about-honors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.profile-about-honors img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
@media (max-width: 640px) {
  .profile-about-honors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.profile-center-page--withdraw {
  max-width: none;
}
.profile-withdraw-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  gap: 1rem;
  width: 100%;
  align-items: stretch;
}
.profile-withdraw-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 20rem;
}
.profile-withdraw-available {
  margin: 0 0 1rem;
  font-size: 1rem;
  width: 100%;
  text-align: center;
}
.profile-withdraw-field {
  width: 100%;
  text-align: left;
}
.profile-withdraw-actions {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}
.profile-withdraw-hint {
  width: 100%;
  text-align: center;
}
.profile-withdraw-history {
  display: flex;
  flex-direction: column;
  min-height: 20rem;
  max-height: calc(100vh - 10rem);
  overflow: hidden;
}
.profile-withdraw-history .card-header {
  flex-shrink: 0;
}
.profile-withdraw-table-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.profile-withdraw-table-scroll table {
  width: 100%;
}
.profile-withdraw-table-scroll .col-seq {
  width: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.profile-bound-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.profile-bound-card-title {
  font-weight: 600;
  font-size: 1rem;
}
.profile-edit-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  opacity: 0.75;
}
.profile-edit-btn:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--surface2) 60%, transparent);
}
.profile-bound-dl {
  display: grid;
  gap: 0.65rem;
}
.profile-bound-row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 0.5rem;
  font-size: 0.9375rem;
}
.profile-bound-row dt {
  margin: 0;
  color: var(--text-muted);
}
.profile-bound-row dd {
  margin: 0;
  color: var(--text);
  word-break: break-all;
}
.profile-kyc-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.profile-kyc-upload-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.profile-kyc-upload-box {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface2) 40%, var(--surface));
  cursor: pointer;
}
.profile-kyc-upload-box.is-uploading {
  opacity: 0.6;
  pointer-events: none;
}
.profile-kyc-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.profile-kyc-upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-kyc-upload-preview.profile-kyc-preview-loading,
.profile-kyc-photo-view-img.profile-kyc-preview-loading,
.profile-kyc-upload-preview.lazy-img-loading,
.profile-kyc-photo-view-img.lazy-img-loading {
  opacity: 0;
}
.profile-kyc-upload-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.75rem;
  opacity: 0.45;
}
.profile-kyc-submit-wrap {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}
.profile-invoice-cert-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.profile-invoice-ratio-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: var(--surface-alt, rgba(0, 0, 0, 0.03));
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.profile-invoice-ratio-summary #profile-invoice-cert-ratio-sum.is-invalid,
.profile-invoice-ratio-summary [id$="-ratio-sum"].is-invalid {
  color: var(--danger, #c0392b);
  font-weight: 600;
}
.profile-invoice-company-card {
  padding: 1rem;
}
.profile-invoice-company-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.profile-invoice-company-title {
  font-weight: 600;
  font-size: 0.9375rem;
}
.profile-invoice-ratio-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.profile-invoice-ratio-input {
  width: 100%;
  max-width: 6rem;
}
.profile-invoice-ratio-suffix {
  color: var(--text-muted);
  font-size: 0.875rem;
}
.profile-invoice-add-btn {
  align-self: flex-start;
}
.profile-invoice-bound-block {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.profile-invoice-bound-block:first-child {
  border-top: none;
  padding-top: 0;
}
.profile-invoice-bound-title {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.profile-invoice-cert-form .field-span-all {
  grid-column: 1 / -1;
}
.ext-approval-invoice-companies {
  margin-top: 1rem;
}
.ext-approval-invoice-companies .data-table {
  font-size: 0.8125rem;
}
.profile-kyc-photos-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
  grid-column: 1 / -1;
}
.profile-kyc-photo-view-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.profile-kyc-photo-view-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
}
.settings-panel-fields .setting-field-textarea {
  grid-column: 1 / -1;
}
.settings-entity-panel .settings-entity-text-fields .setting-field-textarea {
  grid-column: auto;
}
.settings-entity-panel .settings-entity-text-fields .setting-textarea {
  max-width: none;
  min-height: 7.5rem;
}
.setting-field-textarea .setting-textarea {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.profile-withdraw-form .btn-primary,
.profile-bank-form .btn-primary,
.profile-kyc-form .btn-primary {
  margin-top: 0.75rem;
}
.gender-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-muted, #f3f5f8);
}
.gender-switch-option {
  border: none;
  background: transparent;
  color: var(--text-muted, #667085);
  padding: 0.375rem 1.125rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.gender-switch-option.is-active {
  background: var(--primary, #2563eb);
  color: #fff;
}
.profile-kyc-gender-field .gender-switch {
  margin-top: 0.25rem;
}
@media (max-width: 768px) {
  .profile-withdraw-layout { grid-template-columns: 1fr; }
  .profile-withdraw-history { max-height: 24rem; }
}
.profile-commission-notes h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.profile-policy-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ???? */
.my-orders-page-root {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  max-width: 56rem;
}
.my-orders-page-head {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.my-orders-tabs-wrap {
  width: 100%;
  border-bottom: 1px solid var(--border);
}
.my-orders-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.my-orders-tab {
  padding: .625rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.my-orders-tab:hover { color: var(--text); }
.my-orders-tab.active {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
}
.my-orders-list-body {
  width: 100%;
}
#my-orders-list-wrap.paginated-list-shell {
  width: 100%;
}
.my-orders-list {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  width: 100%;
}
.my-order-card {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .75rem 1rem;
  align-items: stretch;
  min-height: 8.25rem;
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.my-order-side-bar {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: auto;
  min-width: 4.25rem;
  min-height: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.my-order-side-room {
  flex: 0 0 38%;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--order-side-fg, var(--btn-text, #fff));
  background: var(--order-side-room-bg, var(--primary-deep));
  padding: .35rem .5rem;
}
.my-order-side-period {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: .35rem .35rem;
  color: var(--order-side-fg, var(--btn-text, #fff));
  background: var(--order-side-period-bg, var(--primary));
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.my-order-side-period strong {
  font-size: 1.375rem;
  line-height: 1;
  margin: .125rem 0;
  font-weight: 800;
}
.my-order-cover {
  align-self: stretch;
  height: 100%;
  width: auto;
  aspect-ratio: 1;
  min-width: 5.5rem;
  max-width: 11rem;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface2, var(--bg-muted, #f3f4f6));
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.my-order-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.my-order-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding: .25rem;
}
.my-order-body { min-width: 0; position: relative; padding-bottom: 1.75rem; }
.my-order-body-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .2rem;
}
.my-order-title {
  font-weight: 600;
  font-size: .9375rem;
  color: var(--text);
}
.my-order-period-range {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.my-order-fee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: .35rem .65rem;
}
.my-order-fee-cell {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  font-size: .8125rem;
}
.my-order-fee-k { color: var(--text-muted); font-size: .75rem; }
.my-order-fee-v { font-weight: 600; color: var(--text); }
.my-order-grand-row {
  margin-top: .5rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .8125rem;
}
.my-order-grand-row strong {
  font-size: 1rem;
  color: var(--primary-hover);
}
.my-order-pay-row {
  margin-top: .625rem;
  padding-top: .625rem;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.my-order-pay-remaining {
  font-size: .875rem;
  font-weight: 600;
  color: var(--danger, #dc2626);
}
.my-order-wechat-pay {
  flex-shrink: 0;
}
.my-order-expand {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 100%;
}
.my-order-expand.is-disabled .my-order-expand-btn {
  opacity: .35;
  cursor: not-allowed;
}
.my-order-expand-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: .25rem .35rem;
  line-height: 0;
}
.my-order-expand-tri {
  display: block;
  width: 0;
  height: 0;
  border-left: .7rem solid transparent;
  border-right: .7rem solid transparent;
  border-top: .85rem solid var(--text-muted);
  transition: transform .15s, border-top-color .15s;
}
.my-order-expand.is-open .my-order-expand-tri {
  transform: rotate(180deg);
  border-top-color: var(--primary-hover);
}
.my-order-expand-panel {
  margin-top: .35rem;
  padding: .5rem .65rem;
  background: var(--bg-muted, var(--surface2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8125rem;
  text-align: left;
  max-width: min(100%, 22rem);
}
.my-order-expand-label {
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .25rem;
}
.my-order-expand-panel p { margin: 0; line-height: 1.45; }
@media (max-width: 640px) {
  .my-order-card {
    grid-template-columns: auto auto 1fr;
    min-height: 7rem;
    gap: .5rem .65rem;
    padding: .75rem;
  }
  .my-order-side-bar { min-width: 3.75rem; }
  .my-order-side-room { font-size: 1rem; min-height: 2.25rem; }
  .my-order-side-period strong { font-size: 1.125rem; }
  .my-order-cover { min-width: 4.5rem; max-width: 7.5rem; }
  .my-order-fee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.my-order-payment-wrap { margin-top: .75rem; }
.my-order-payment-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2, var(--surface));
  font-size: .8125rem;
}
.my-order-payment-body {
  margin-top: .5rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.my-order-payment-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .8125rem;
  padding: .2rem 0;
}
.my-order-payment-k { color: var(--text-muted); }
.my-order-payment-v { font-weight: 600; }
.my-order-payment-v--accent { color: #ef4444; }
.my-order-payment-v--deduct { color: var(--text); }
.my-order-action-row {
  margin-top: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.my-order-after-sales-panel {
  width: 100%;
  margin-top: .5rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, .08);
}
.my-order-after-sales-title {
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: .35rem;
}
.my-order-refund-history {
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(148, 163, 184, .18);
}
.my-order-refund-history-title {
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--text-muted);
}
.my-order-refund-history-item {
  padding: .5rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.my-order-refund-history-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.my-order-refund-history-date {
  color: var(--text-muted);
  font-size: .8125rem;
}
.my-order-refund-history-status {
  color: var(--primary-hover);
  font-size: .8125rem;
  font-weight: 600;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-card .label { font-size: .8125rem; color: var(--text-muted); }
.stat-card .value { font-size: 2rem; font-weight: 700; margin-top: .25rem; }
.stat-card .stat-sub { font-size: .75rem; color: var(--text-muted); margin-top: .375rem; line-height: 1.4; }
.stat-card.primary .value { color: var(--primary-hover); }
.stat-card.accent .value { color: var(--accent); }
.stat-card.warning .value { color: var(--warning); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .875rem 1.25rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: .8125rem; }
tr:hover td { background: var(--row-hover); }

.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
}
.badge-pending { background: rgba(251,191,36,.15); color: var(--warning); }
.badge-success { background: rgba(52,211,153,.15); color: var(--success); }
.badge-danger { background: rgba(248,113,113,.15); color: #ef4444; }
.badge-info { background: var(--sidebar-accent); color: var(--primary-hover); }

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* 工作台：无权限占位（覆盖真实运营总览） */
.dashboard-no-access {
  min-height: min(70vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 40px;
  box-sizing: border-box;
  background:
    radial-gradient(1200px 420px at 50% -10%, color-mix(in srgb, var(--primary, #0ea5e9) 16%, transparent), transparent 60%),
    var(--bg, #f8fafc);
}
.dashboard-no-access__card {
  width: min(560px, 100%);
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.08));
  border-radius: 16px;
  box-shadow: var(--shadow-md, 0 16px 40px rgba(15, 23, 42, 0.08));
  padding: 36px 32px 28px;
  text-align: left;
  position: relative;
}
.dashboard-no-access__badge {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--danger, #dc2626);
  background: color-mix(in srgb, var(--danger, #dc2626) 12%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
}
.dashboard-no-access__title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.dashboard-no-access__reason {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text, #334155);
}
.dashboard-no-access__meta {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}
.dashboard-no-access__hint {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary, #475569);
}
.dashboard-no-access__tips {
  margin: 0 0 22px;
  padding: 12px 12px 12px 28px;
  background: var(--surface2, #f1f5f9);
  border-radius: 12px;
  color: var(--text-secondary, #475569);
  font-size: 0.88rem;
  line-height: 1.55;
}
.dashboard-no-access__tips li + li {
  margin-top: 6px;
}
.dashboard-no-access__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.empty-state--loading,
.empty-state--error {
  padding: 2.5rem 1rem;
}
.app-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 2.5rem 1rem;
  min-height: 12rem;
  background: var(--ios-overlay, color-mix(in srgb, var(--bg) 42%, transparent));
  backdrop-filter: blur(12px) saturate(175%);
  -webkit-backdrop-filter: blur(12px) saturate(175%);
  border-radius: var(--radius);
  border: none;
}
.app-loading-overlay--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 11000;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: var(--ios-overlay, color-mix(in srgb, var(--bg) 48%, transparent));
  backdrop-filter: blur(var(--ios-blur, 22px)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--ios-blur, 22px)) saturate(185%);
}
/* 右侧主窗口加载遮罩：盖住 .content（顶栏+内容+底栏），不盖侧栏 */
.content.cw-page-loading-host,
.content.cw-page-loading-lock {
  position: relative !important;
}
.content.cw-page-loading-lock {
  overflow: hidden !important;
}
.cw-page-loading-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 40 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: max(3.5rem, 10vh) 1rem 1rem;
  pointer-events: auto !important;
  background: color-mix(in srgb, var(--bg, #0b1220) 58%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.cw-page-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0 auto;
  padding: 1.1rem 1.35rem;
  max-width: min(92vw, 22rem);
  text-align: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
  box-shadow: 0 16px 40px color-mix(in srgb, #000 14%, transparent);
}
.cw-page-loading-text {
  display: block;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.app-loading-card {
  display: contents;
}
.app-loading-overlay--inline {
  min-height: min(40vh, 320px);
  animation: app-loading-fade-in .22s ease both;
}
.app-loading-overlay--compact {
  min-height: 6rem;
  padding: 1.25rem .75rem;
  animation: app-loading-fade-in .22s ease both;
}
.app-loading-overlay--compact .app-loading-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border-width: 2px;
}
.app-loading-text {
  display: none;
}
.form-modal-loading-overlay .app-loading-text,
.app-loading-overlay--compact .app-loading-text {
  display: block;
  margin: .5rem 0 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
}
.app-loading-overlay--compact {
  flex-direction: column;
  gap: .35rem;
}
.app-loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: app-loading-spin .75s linear infinite;
  filter: drop-shadow(0 0 10px color-mix(in srgb, rgb(var(--primary-rgb, 37 99 235)) 35%, transparent));
}
@keyframes app-loading-spin {
  to { transform: rotate(360deg); }
}
@keyframes app-loading-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.empty-state--error {
  color: var(--danger, #dc2626);
}

.app-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(0.75rem, 3vw, 1.5rem);
  min-height: min(42vh, 280px);
  text-align: center;
}
.app-empty-state__img,
.app-empty-state__illus {
  display: block;
  width: min(100%, 280px);
  margin: 0 auto clamp(0.75rem, 2vw, 1.25rem);
}
.app-empty-state__img {
  height: auto;
  max-height: min(36vh, 200px);
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.app-empty-state__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(36vh, 200px);
  user-select: none;
  pointer-events: none;
}
.app-empty-state__text {
  margin: 0;
  font-size: clamp(0.875rem, 2.2vw, 1rem);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 22rem;
}
.app-empty-state__hint {
  margin: 0.35rem 0 0;
  font-size: clamp(0.75rem, 1.8vw, 0.875rem);
  color: var(--text-muted);
  opacity: 0.85;
  line-height: 1.45;
  max-width: 24rem;
}
.app-empty-state--sm .app-empty-state__img,
.app-empty-state--sm .app-empty-state__illus {
  width: min(100%, 200px);
}
.app-empty-state--sm .app-empty-state__img,
.app-empty-state--sm .app-empty-state__svg {
  max-height: min(28vh, 140px);
}
.app-empty-state--compact {
  min-height: min(32vh, 200px);
  padding: clamp(1rem, 3vw, 1.5rem) 0.5rem;
}
.app-empty-state--in-sidebar {
  min-height: 10rem;
  padding: 1rem 0.35rem;
}
.app-empty-state--in-sidebar .app-empty-state__img,
.app-empty-state--in-sidebar .app-empty-state__illus {
  width: min(100%, 150px);
  margin-bottom: 0.65rem;
}
.app-empty-state--in-sidebar .app-empty-state__img,
.app-empty-state--in-sidebar .app-empty-state__svg {
  max-height: 96px;
}
.app-empty-state--in-sidebar .app-empty-state__text {
  font-size: 0.8125rem;
}
.app-empty-state--in-main,
.app-empty-state--in-panel {
  flex: 1 1 auto;
  min-height: min(48vh, 320px);
  height: 100%;
}
.app-empty-state--page {
  min-height: min(55vh, 400px);
}
.app-empty-state--in-table {
  min-height: 11rem;
  padding: 1.25rem 0.75rem;
  margin-left: auto;
  margin-right: auto;
}
.app-empty-state--centered {
  margin-left: auto;
  margin-right: auto;
}
.table-empty-cell {
  padding: 0 !important;
  vertical-align: middle;
  border-bottom: none !important;
  text-align: center;
}
.table-empty-cell .app-empty-state {
  min-height: min(28vh, 200px);
  width: 100%;
  margin: 0 auto;
}
.app-empty-state--error {
  min-height: min(28vh, 180px);
}
.app-empty-state--error .app-empty-state__text,
.app-empty-state__text.empty-state--error {
  color: var(--danger, #dc2626);
}
.app-empty-state--in-scroll-panel {
  min-height: auto;
  height: auto;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.5rem;
}
.app-empty-state--in-scroll-panel .app-empty-state__illus {
  width: min(100%, 112px);
  margin-bottom: 0.45rem;
}
.app-empty-state--in-scroll-panel .app-empty-state__img,
.app-empty-state--in-scroll-panel .app-empty-state__svg {
  max-height: 68px;
}
.app-empty-state--in-scroll-panel .app-empty-state__text {
  font-size: 0.8125rem;
}

.section-gap { margin-top: 1.25rem; }

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.form-modal-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.form-modal-box.form-modal-wide {
  width: min(1024px, calc(100vw - 2rem));
  max-width: none;
}
.form-modal-wide .form-modal-body {
  padding: 1.25rem 1.375rem;
}
.form-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.form-modal-header h3 { font-size: 1.0625rem; font-weight: 600; }
.form-modal-error {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0;
  padding: .75rem 1.25rem;
  background: rgba(248, 113, 113, .18);
  border-bottom: 1px solid rgba(248, 113, 113, .45);
  color: #fecaca;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.5;
  flex-shrink: 0;
}
.form-modal-error::before {
  content: '!';
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}
.form-modal-error.hidden { display: none; }
.form-modal-box.form-modal-box-error {
  animation: formModalShake .45s ease;
}
@keyframes formModalShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.form-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .5rem;
}
.form-modal-close:hover { color: var(--text); }
.form-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.form-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  position: relative;
  z-index: 2;
}
.form-grid .field { margin-bottom: 1rem; }
.form-grid .field label { display: block; font-size: .8125rem; color: var(--text-muted); margin-bottom: .375rem; }
.form-grid .field input,
.form-grid .field select {
  width: 100%;
  padding: .625rem .875rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9375rem;
}
.form-grid .field input:focus,
.form-grid .field select:focus { outline: none; border-color: var(--primary); }
.form-grid .field-hint { font-size: .75rem; color: var(--text-muted); margin: -.25rem 0 .875rem; line-height: 1.45; }
.field-check-row {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: 1rem;
}
.field-check-row.field-check-inline { min-height: auto; margin-bottom: 0; align-self: end; padding-bottom: .625rem; }
.field-check-row .inline-check { margin: 0; }
.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem;
  margin-bottom: 0;
}
.field-row-2 .field { margin-bottom: 1rem; }
.form-grid-compact .field { margin-bottom: .875rem; }
.inline-check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--text); min-height: 1.25rem; user-select: none; }
.inline-check input { width: auto; margin: 0; flex-shrink: 0; cursor: pointer; }
.field-avoid-row .field-check-inline { flex: 1; }
.field-hint { font-size: .75rem; color: var(--text-muted); margin: .25rem 0 .375rem; }
.field-unit { font-size: .75rem; color: var(--text-muted); font-weight: 400; }
.settings-actions { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ?? ????? ?? */
.lazy-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface2) 88%, var(--surface));
  vertical-align: middle;
}
.lazy-img-wrap > img.lazy-img-gif {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.75rem;
  height: 2.75rem;
  max-width: 56%;
  max-height: 56%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity .12s ease;
}
.lazy-img-wrap.is-loading > img.lazy-img-gif {
  opacity: 1;
}
.lazy-img-wrap.is-loaded > img.lazy-img-gif,
.lazy-img-wrap.is-error > img.lazy-img-gif {
  display: none;
}
.lazy-img-wrap::after {
  content: none;
  display: none;
}
.lazy-img-wrap.is-error::before {
  content: none;
  display: none;
}
.lazy-img-wrap > img.lazy-load-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .22s ease;
}
.lazy-img-wrap.is-loaded > img.lazy-load-img { opacity: 1; }
.lazy-img-wrap.is-error > img.lazy-load-img { opacity: 0; }
.lazy-img-wrap.is-fallback > img.lazy-load-img {
  object-fit: contain;
  padding: 0.55rem;
  background: color-mix(in srgb, var(--surface2) 92%, var(--surface));
}

img.lazy-load-img:not(.lazy-img-wrap > img) {
  background: color-mix(in srgb, var(--surface2) 88%, var(--surface));
}
img.lazy-load-img.lazy-img-loading:not([data-lazy-nowrap="1"]):not(.cw-img-slot-img--adaptive):not(.cw-img-adaptive-img) {
  opacity: 0;
}
/* 自适应/nowrap：不包 wrap，加载中占位，避免高度塌成一条线 */
img.lazy-load-img[data-lazy-nowrap="1"].is-lazy-nowrap-loading,
img.cw-img-slot-img--adaptive.is-lazy-nowrap-loading,
img.cw-img-adaptive-img.is-lazy-nowrap-loading,
img.lazy-load-img[data-lazy-nowrap="1"]:not([src]),
img.cw-img-slot-img--adaptive.lazy-load-img:not([src]),
img.cw-img-adaptive-img.lazy-load-img:not([src]) {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 96px;
  height: auto;
  opacity: 1;
  background: color-mix(in srgb, var(--surface2) 88%, #e2e8f0);
}
.cw-iphone--mini .cw-list-preview-scale img.lazy-load-img[data-lazy-nowrap="1"]:not([src]),
.cw-iphone--editor img.lazy-load-img[data-lazy-nowrap="1"]:not([src]),
.cw-iphone--editor img.cw-img-slot-img--adaptive.lazy-load-img:not([src]) {
  min-height: 120px;
}

.ext-approval-photo-item .lazy-img-wrap,
.profile-kyc-upload-box .lazy-img-wrap,
.profile-kyc-photo-view .lazy-img-wrap {
  display: block;
  width: 100%;
  height: 100%;
}

.activity-category-cover-wrap .lazy-img-wrap {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}
.activity-category-cover-wrap .lazy-img-wrap > img.lazy-img-gif {
  width: 2.1rem;
  height: 2.1rem;
  max-width: 52%;
  max-height: 52%;
}
.activity-category-cover-wrap .activity-category-cover {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.entity-qual-thumb .lazy-img-wrap {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.entity-qual-thumb .lazy-img-wrap > img.lazy-load-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cw-cat-card .lazy-img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 7px;
}
.cw-cat-card .lazy-img-wrap > img.lazy-load-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}
.cw-side-cover-row .lazy-img-wrap {
  width: 48px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 6px;
}
.cw-side-cover-row .lazy-img-wrap > img.lazy-load-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.cw-side-asset {
  position: relative;
}
.cw-side-asset .lazy-img-wrap {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.cw-side-asset .lazy-img-wrap > img.lazy-load-img,
.cw-side-asset img.cw-side-asset-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cw-img-slot .lazy-img-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cw-img-slot .lazy-img-wrap > img.lazy-load-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cw-editor-doc-cover .lazy-img-wrap {
  display: block;
  width: 100%;
}
.cw-editor-doc-cover .lazy-img-wrap > img.lazy-load-img,
.cw-editor-doc-cover img.cw-editor-doc-cover-img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.cw-doc-footer--qr .lazy-img-wrap {
  display: inline-block;
  width: 25%;
  max-width: 25%;
  vertical-align: top;
}
.cw-doc-footer--endorse .lazy-img-wrap {
  display: block;
  width: 100%;
}
.cw-block--note .cw-note-shell .lazy-img-wrap {
  display: block;
  width: 100%;
  position: relative;
  z-index: 0;
}
.cw-block--note .cw-note-shell .lazy-img-wrap > img.lazy-load-img,
.cw-block--note .cw-note-paper-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  pointer-events: none;
}
.cw-asset-block-pick .lazy-img-wrap {
  display: block;
  width: 100%;
}
.cw-asset-block-pick .lazy-img-wrap > img.lazy-load-img,
.cw-asset-block-pick img.cw-asset-block-img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  display: block;
}
.cw-asset-block-pick--adaptive .lazy-img-wrap > img.lazy-load-img,
.cw-asset-block-pick--adaptive img.cw-asset-block-img {
  max-height: none;
  height: auto;
  object-fit: contain;
}
.tenant-deliver-avatar .lazy-img-wrap {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
.tenant-deliver-avatar .lazy-img-wrap > img.lazy-load-img,
.tenant-deliver-avatar img.tenant-deliver-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-about-v .lazy-img-wrap {
  display: block;
  width: min(100%, 28rem);
  max-height: 22rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}
.profile-about-v .lazy-img-wrap > img.lazy-load-img,
.profile-about-license {
  width: 100%;
  height: auto;
  max-height: 22rem;
  object-fit: contain;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.profile-about-honors .lazy-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: block;
}
.profile-about-honors .lazy-img-wrap > img.lazy-load-img,
.profile-about-honors img.profile-about-honor-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 0;
  background: transparent;
}
.cw-asset-lightbox .lazy-img-wrap {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 4rem);
}
.cw-asset-lightbox .lazy-img-wrap > img.lazy-load-img,
.cw-asset-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 4rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  min-width: 18rem;
  max-width: min(92vw, 32rem);
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--border));
  border-radius: 4px;
  background: #fff;
  color: #303133;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .14);
  z-index: 13100;
  animation: toastSlideDown .32s ease;
  overflow: hidden;
  pointer-events: auto;
}
.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  flex-shrink: 0;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}
.toast-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: .8125rem 1rem;
  /* ??????????????????????? --text */
  color: #067647;
  font-size: .875rem;
  line-height: 1.45;
  text-align: left;
}
.toast-close {
  flex-shrink: 0;
  align-self: center;
  margin-right: .5rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  background: transparent;
  color: #c0c4cc;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.toast-close:hover {
  color: #909399;
  background: rgba(0, 0, 0, .04);
}
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: #ef4444; }
.toast-warning .toast-icon { background: var(--warning); }
.toast-info .toast-icon { background: #3b82f6; }
.toast-success { border-color: color-mix(in srgb, var(--success) 60%, var(--primary) 40%); }
.toast-error { border-color: color-mix(in srgb, #ef4444 55%, var(--primary) 45%); }
.toast-warning { border-color: color-mix(in srgb, var(--warning) 60%, var(--primary) 40%); }
.toast-info { border-color: color-mix(in srgb, #3b82f6 55%, var(--primary) 45%); }
/* ?????????????????????? */
.toast-success .toast-body { color: #067647; }
.toast-error .toast-body { color: #b91c1c; }
.toast-warning .toast-body { color: #b45309; }
.toast-info .toast-body { color: #1d4ed8; }
.toast-success .toast-close:hover { color: #067647; }
.toast-error .toast-close:hover { color: #b91c1c; }
.toast-warning .toast-close:hover { color: #b45309; }
.toast-info .toast-close:hover { color: #1d4ed8; }

@keyframes toastSlideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.page-content:has(.elev-page-root),
.page-content:has(.coupon-page-root),
.page-content:has(.point-page-root),
.page-content:has(.message-page-root) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 1rem;
}

/* ??? */
.coupon-page-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: .75rem;
}
.page-hero-panel,
.coupon-create-panel {
  flex: 0 0 auto;
  min-width: 0;
  background: var(--page-hero-bg);
  box-shadow: var(--page-hero-shadow);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  container-type: inline-size;
}
.coupon-create-form { padding: .85rem 1rem 1rem; min-width: 0; }
.coupon-create-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  margin-bottom: .65rem;
}
.coupon-create-icon { font-size: 1.25rem; }
.coupon-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem .55rem;
  min-width: 0;
}
.coupon-field { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.coupon-field-span2 { grid-column: 1 / -1; }
.coupon-field span { font-size: .75rem; color: var(--text-muted); }
.coupon-field input, .coupon-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: .45rem .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  color: var(--input-fg, var(--text));
  font-family: inherit;
  font-size: .8125rem;
}
.coupon-form-actions { margin-top: .55rem; }
.coupon-list-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.coupon-list-head {
  flex-shrink: 0;
  padding: .65rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.coupon-list-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: .75rem;
}
.coupon-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: .65rem;
}
.coupon-card {
  display: flex;
  min-height: 6.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.coupon-card-left {
  flex: 0 0 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--coupon-value-fg, var(--btn-text, #fff));
  padding: .5rem;
  text-align: center;
  background-color: var(--coupon-value-bg-deep, var(--primary-deep));
  background-image: linear-gradient(
    160deg,
    var(--coupon-value-bg-top, var(--primary)) 0%,
    var(--coupon-value-bg-deep, var(--primary-deep)) 100%
  );
}
.coupon-card-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.coupon-card-value small { font-size: .75rem; font-weight: 500; }
.coupon-card-type { font-size: .7rem; opacity: .92; margin-top: .2rem; }
.coupon-card-right {
  flex: 1;
  padding: .55rem .65rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
}
.coupon-card-name { font-weight: 600; font-size: .875rem; }
.coupon-card-meta, .coupon-card-date { font-size: .72rem; color: var(--text-muted); }
.coupon-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .45rem;
  padding-top: .45rem;
  border-top: 1px dashed var(--border);
}
.coupon-claim-badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.coupon-claim-badge--open {
  color: #047857;
  background: rgba(16, 185, 129, .15);
}
.coupon-claim-badge--closed {
  color: #b45309;
  background: rgba(245, 158, 11, .15);
}
.coupon-card-actions .coupon-claim-toggle {
  flex-shrink: 0;
}

.coupon-page-stats-wrap {
  flex: 0 0 auto;
}
.coupon-page-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
}
.coupon-stat-card {
  padding: .75rem .85rem;
  border-radius: var(--radius);
  background: var(--page-hero-bg);
  border: 1px solid var(--border);
  box-shadow: var(--page-hero-shadow);
}
.coupon-stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .25rem;
}
.coupon-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}
.coupon-stat-amount {
  font-size: .8125rem;
  color: var(--primary-hover);
  margin-top: .15rem;
  font-weight: 600;
}
.coupon-page-tabs-wrap {
  flex-shrink: 0;
}
.coupon-page-tab-body {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.coupon-tab-panel {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}
.coupon-tab-panel[hidden] {
  display: none !important;
}
.coupon-tab-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}
.coupon-tab-panel.coupon-create-tab-body:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
  gap: .75rem;
}
.coupon-create-tab-body {
  min-height: 0;
}
.coupon-create-tab-body .coupon-create-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.coupon-create-tab-body .coupon-list-panel {
  min-height: 0;
}
.coupon-redeem-tab-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 0;
}
.coupon-redeem-tab-body .coupon-redeem-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.coupon-redeem-list-shell {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.coupon-redeem-list-shell .coupon-redeem-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding: 0 .75rem .75rem;
}
.coupon-redeem-list-shell > .list-pagination-bar {
  flex-shrink: 0;
  margin-top: 0;
  padding: .5rem .75rem .65rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.coupon-page-body {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
  gap: .75rem;
}
.coupon-page-col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.coupon-page-col--list .coupon-create-panel {
  flex: 0 0 auto;
}
.coupon-page-col--list .coupon-list-panel {
  flex: 1 1 0;
}
.coupon-page-col--redeem {
  flex: 1 1 0;
}
.coupon-page-col--redeem #coupon-redeem-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.coupon-panel-head {
  flex-shrink: 0;
  padding: .65rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.coupon-list-panel .coupon-list-shell {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.coupon-list-shell .coupon-list-scroll-area {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .65rem .75rem;
}
.coupon-list-shell .coupon-list-scroll-area--empty {
  justify-content: center;
  align-items: center;
}
.coupon-list-shell > .list-pagination-bar {
  flex-shrink: 0;
  margin-top: 0;
  padding: .5rem .75rem .65rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.coupon-row-item {
  display: flex;
  align-items: stretch;
  gap: .65rem;
  min-height: 4.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}
.coupon-row-value {
  flex: 0 0 4.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--coupon-value-fg, var(--btn-text, #fff));
  background-color: var(--coupon-value-bg-deep, var(--primary-deep));
  background-image: linear-gradient(
    160deg,
    var(--coupon-value-bg-top, var(--primary)) 0%,
    var(--coupon-value-bg-deep, var(--primary-deep)) 100%
  );
}
.coupon-row-value small {
  font-size: .72rem;
  font-weight: 500;
  margin-left: .1rem;
}
.coupon-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .12rem;
  padding: .45rem 0;
}
.coupon-row-title {
  font-weight: 600;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coupon-row-meta {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coupon-row-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: .35rem;
  padding: .45rem .65rem .45rem 0;
}
.coupon-row-actions .coupon-claim-toggle {
  white-space: nowrap;
}
.coupon-redeem-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.coupon-redeem-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding: 0 .75rem .75rem;
}
.coupon-redeem-body--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.coupon-redeem-body .data-table td.coupon-money {
  font-weight: 600;
  color: #ea580c;
  white-space: nowrap;
}
.coupon-redeem-body .data-table td.coupon-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
}
@media (max-width: 1100px) {
  .coupon-page-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .coupon-tab-panel.coupon-create-tab-body:not([hidden]) {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .coupon-field-span2 {
    grid-column: auto;
  }
  .coupon-row-item {
    flex-wrap: wrap;
  }
  .coupon-row-actions {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    padding: 0 .65rem .55rem;
    border-top: 1px dashed var(--border);
  }
}

/* ?? */
.point-page-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: .75rem;
}
.point-hero {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--page-hero-bg);
  box-shadow: var(--page-hero-shadow);
  border: 1px solid var(--border);
}
.point-hero--tenant { justify-content: flex-start; }
.point-hero--admin {
  width: 100%;
  box-sizing: border-box;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.point-hero-metrics {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.point-hero--admin .point-stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: .35rem;
  flex: 0 0 auto;
  min-width: 6.75rem;
  padding: 0 1.25rem;
  border-right: 1px solid var(--border);
  box-sizing: border-box;
}
.point-hero--admin .point-stat--last {
  border-right: none;
  flex: 1 1 auto;
}
.point-hero--admin .point-stat-label {
  font-size: .8125rem;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: nowrap;
}
.point-hero--admin .point-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.point-hero--admin .point-stat--featured .point-stat-value {
  font-size: 1.75rem;
  color: var(--primary-hover);
}
.point-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  padding: 0 0 0 1.25rem;
  border-left: 1px solid var(--border);
}
.point-hero-top-stat {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-right: 1rem;
  border-right: 1px solid var(--border);
}
.point-hero-top-stat--secondary { border-right: none; padding-right: 0; }
.point-hero-value--sm { font-size: 1.35rem; }
.point-hero-icon { font-size: 2rem; line-height: 1; }
.point-hero-body { display: flex; flex-direction: column; gap: .15rem; }
.point-hero-label { font-size: .8125rem; color: var(--text-muted); }
.point-hero-value { font-size: 1.75rem; font-weight: 700; color: var(--primary-hover); }
.point-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  flex: 1 1 auto;
  min-width: 0;
}
.point-stat { display: flex; flex-direction: column; gap: .15rem; min-width: 6rem; }
.point-stat-label { font-size: .75rem; color: var(--text-muted); }
.point-stat-value { font-size: 1.25rem; font-weight: 700; }
.point-table-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 .75rem .75rem;
  box-sizing: border-box;
}
.point-table-wrap > .card {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
}
.point-table-wrap > .card > .table-wrap {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}
.point-table-wrap--empty {
  padding: 0;
}
.point-table-empty-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.point-table-empty-body .app-empty-state--in-panel {
  min-height: auto;
  height: auto;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
}
.point-page-root > .empty-state {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.point-table-wrap .data-table { margin-top: .5rem; }
.point-num { font-weight: 600; color: var(--primary-hover); }
.point-money { font-weight: 600; color: #ea580c; }

/* ???? */
/* ???? */
.activity-rules-page {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-height: 0;
  flex: 1;
}
.activity-rules-tabs-wrap { flex-shrink: 0; }
.activity-rules-tabs {
  flex-wrap: wrap;
  gap: .35rem .15rem;
}
.activity-rules-tab-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.activity-rule-panel {
  padding: 1rem 1.15rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg, var(--surface));
}
.activity-rule-panel--edit {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.activity-rule-panel-empty { padding: 1rem; }
.activity-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.activity-rule-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}
.activity-rule-title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.activity-rule-colon { font-weight: 700; }
.activity-rule-icon { font-size: 1.25rem; line-height: 1; }
.activity-rule-head-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.activity-rule-clauses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.activity-rule-clause {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: .65rem;
  align-items: flex-start;
}
.activity-rule-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--btn-text, #fff);
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.activity-rule-text {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--text);
  padding-top: .15rem;
}
.arule-edit-grid {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: .75rem;
}
.arule-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding-top: .25rem;
}
.arule-clauses-editor {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-bottom: .55rem;
}
.arule-clause-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: start;
}
.arule-clause-text {
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .arule-edit-grid { grid-template-columns: 1fr; }
  .arule-clause-row { grid-template-columns: 2rem minmax(0, 1fr); }
  .arule-clause-row .arule-clause-remove {
    grid-column: 2;
    justify-self: start;
  }
}

/* ???? */
/* ???? */
.share-page-root {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-height: 0;
  flex: 1;
}
.share-page-stats-wrap { flex-shrink: 0; }
.share-page-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .65rem;
}
.share-stat-card {
  padding: .75rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg, var(--surface));
}
.share-stat-label { font-size: .75rem; color: var(--text-muted); }
.share-stat-value { font-size: 1.25rem; font-weight: 700; margin-top: .2rem; color: var(--primary-hover); }
.share-rule-banner {
  padding: .7rem .9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  font-size: .875rem;
  line-height: 1.45;
}
.share-page-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.4fr);
  gap: .75rem;
  min-height: 0;
  flex: 1;
}
.share-panel { min-height: 0; display: flex; flex-direction: column; }
.share-panel--list .table-wrap { overflow: auto; }
.share-empty-tip { padding: 0 1rem 1rem; margin: 0; }
.share-profile-root { display: flex; flex-direction: column; gap: .75rem; }
.share-code-display {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--primary-hover);
  margin: .35rem 0;
}
.share-url-line code {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  font-size: .8rem;
}
.share-profile-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.share-reward-tip { margin-top: .5rem; }
@media (max-width: 960px) {
  .share-page-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-page-body { grid-template-columns: 1fr; }
}

/* ?? */
.message-page-root {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 0;
  flex: 1;
}
.message-page-head {
  font-size: 1.125rem;
  font-weight: 600;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}
.message-page-root .msg-tabs-wrap {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.message-page-root .msg-tabs-wrap .visitor-tabs {
  margin-bottom: .5rem;
}
.msg-page-body {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.msg-page-body > .card:first-child,
.msg-page-body > .msg-template-grid:first-child {
  margin-top: 0;
}
.msg-page-body .app-empty-state--in-panel {
  min-height: min(28vh, 220px);
  flex: 0 1 auto;
}
.msg-template-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1100px) {
  .msg-template-grid { grid-template-columns: 1fr 1fr; }
}
.msg-template-card[data-type="announcement"],
.msg-template-card--announcement,
.msg-template-card[data-type="verification"],
.msg-template-card--verification {
  min-width: 0;
}
.settings-sms-provider-picker {
  margin: .35rem 0 .65rem;
}
.settings-sms-provider-picker .setting-field-row {
  margin: 0;
}
.settings-sms-provider-picker .setting-select {
  width: 100%;
}
.settings-map-browser-top-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(18rem, 1.35fr);
  gap: 0.85rem 1.5rem;
  align-items: start;
  margin: 0 0 0.85rem;
}
.settings-map-browser-top-row .settings-map-browser-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.settings-map-browser-top-row .settings-sms-provider-picker {
  margin: 0;
  max-width: none;
  width: 100%;
}
.settings-map-browser-top-row .setting-field,
.settings-map-browser-top-row .setting-field-row {
  margin: 0;
  padding: 0;
  border: none;
}
.settings-map-browser-top-row .setting-field-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.settings-map-browser-top-row .setting-label,
.settings-map-browser-top-row .settings-map-default-loc-label {
  flex: none;
  max-width: none;
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted, var(--text));
  white-space: normal;
}
.settings-map-browser-top-row .setting-control {
  width: 100%;
  min-width: 0;
  flex: none;
}
.settings-map-browser-top-row .setting-control .setting-input,
.settings-map-browser-top-row .setting-control .setting-select,
.settings-map-browser-top-row .setting-select {
  width: 100%;
  max-width: none;
  min-height: 2.625rem;
  box-sizing: border-box;
  line-height: 1.35;
  padding: 0.55rem 0.75rem;
}
.settings-map-default-loc {
  margin: 0;
  width: 100%;
}
.settings-map-default-loc-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}
.settings-map-default-loc-row .setting-input {
  flex: 1;
  min-width: 0;
  min-height: 2.625rem;
  height: 2.625rem;
  box-sizing: border-box;
  line-height: 1.35;
  padding: 0.55rem 0.75rem;
}
.settings-map-default-loc-row .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
  min-height: 2.625rem;
  height: 2.625rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.95rem;
}
.settings-map-browser-top-row .setting-field-hint,
.settings-map-browser-top-row .settings-payment-hint,
.settings-map-browser-top-row .field-hint {
  margin: 0.15rem 0 0;
  line-height: 1.45;
}
@media (max-width: 900px) {
  .settings-map-browser-top-row {
    grid-template-columns: 1fr;
  }
}
.settings-sms-provider-panel.hidden {
  display: none;
}
.settings-sms-provider-panel .setting-field-row {
  margin: 0;
}
.msg-verify-field input,
.msg-verify-field textarea {
  width: 100%;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .875rem;
  line-height: 1.5;
}
.msg-template-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.msg-template-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .65rem;
}
.msg-template-head h3 { font-size: 1rem; font-weight: 600; }
.msg-template-code { font-size: .75rem; color: var(--text-muted); }
.msg-template-vars { margin-bottom: .75rem; }
.msg-template-vars-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .4rem;
}
.msg-template-vars-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: 0;
}
.msg-template-var-tags { min-height: 1.5rem; }
.msg-template-var-empty {
  font-size: .75rem;
  color: var(--text-muted);
}
.msg-var-chip { cursor: pointer; }
.msg-var-chip:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, var(--surface2));
}
.msg-template-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; }
.msg-template-field span { font-size: .8125rem; color: var(--text-muted); }
.msg-template-content {
  width: 100%;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .875rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 7rem;
}
.msg-template-preview {
  padding: .65rem .75rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px dashed var(--border);
  margin-bottom: .75rem;
}
.msg-template-preview-label {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
.msg-template-preview-text {
  font-size: .8125rem;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}
.msg-template-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ???? ? ????????? */
.msg-announce-layout {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  margin-bottom: .75rem;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated, var(--surface));
}
.msg-announce-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.msg-announce-field > span {
  font-size: .8125rem;
  color: var(--text-muted);
  font-weight: 500;
}
.msg-announce-salutation,
.msg-announce-signature {
  width: 100%;
  max-width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font-size: .875rem;
}
.msg-announce-field--salutation .msg-announce-salutation { max-width: 320px; }
.msg-announce-body-slot,
.msg-announce-date-slot {
  padding: .65rem .75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.5;
}
.msg-announce-body-placeholder {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: .25rem;
}
.msg-announce-body-hint {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
}
.msg-announce-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .65rem;
  margin-top: .25rem;
  padding-top: .5rem;
}
.msg-announce-field--signature,
.msg-announce-field--date {
  width: min(100%, 280px);
  align-self: flex-end;
  text-align: right;
}
.msg-announce-field--signature .msg-announce-signature { text-align: right; }
.msg-template-preview--announcement .msg-announce-preview-text {
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-template-content--hidden { display: none !important; }

.msg-log-content {
  max-width: 280px;
  font-size: .8125rem;
  line-height: 1.4;
}

/* ?????????? */
.page-content:has(.doc-mgmt-page) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.doc-mgmt-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.doc-mgmt-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.doc-mgmt-var-row {
  gap: 0.5rem;
}
.doc-mgmt-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.doc-mgmt-var-count-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.doc-mgmt-var-count-wrap span {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.doc-mgmt-var-picker-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.doc-mgmt-var-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}
.doc-mgmt-var-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface2));
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
}
.doc-mgmt-var-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.doc-mgmt-var-picker-overlay.hidden { display: none; }
.doc-mgmt-var-picker-dialog {
  width: min(920px, 96vw);
  max-height: min(640px, 90vh);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.doc-mgmt-var-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.doc-mgmt-var-picker-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}
.doc-mgmt-var-picker-close {
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}
.doc-mgmt-var-picker-hint {
  margin: 0.5rem 1rem 0;
}
.doc-mgmt-var-picker-toolbar {
  padding: 0.5rem 1rem 0;
}
.doc-mgmt-var-picker-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
}
.doc-mgmt-var-picker-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}
.doc-mgmt-var-picker-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 0;
  flex: 1;
}
.doc-mgmt-var-picker-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.doc-mgmt-var-picker-col-title {
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface2) 65%, var(--surface));
}
.doc-mgmt-var-picker-list {
  overflow: auto;
  padding: 0.45rem;
  flex: 1;
  min-height: 240px;
  max-height: 360px;
}
.doc-mgmt-var-picker-group { margin-bottom: 0.5rem; }
.doc-mgmt-var-picker-group-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0.35rem;
  font-weight: 600;
}
.doc-mgmt-var-picker-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.8125rem;
  cursor: pointer;
  user-select: none;
}
.doc-mgmt-var-picker-item-label {
  flex: 1;
  min-width: 0;
  color: var(--text);
}
.doc-mgmt-var-drag-handle {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
  color: var(--text-muted);
  cursor: grab;
  font-size: 0.875rem;
  line-height: 1;
}
.doc-mgmt-var-picker-item.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}
.doc-mgmt-var-picker-item.is-dragging .doc-mgmt-var-drag-handle { cursor: grabbing; }
.doc-mgmt-var-picker-item.is-drag-over {
  border-color: var(--primary);
  background: var(--sidebar-accent);
}
.doc-mgmt-var-picker-list--picked .doc-mgmt-var-picker-item { cursor: default; }
.doc-mgmt-var-picker-item:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
}
.doc-mgmt-var-picker-item.is-active {
  border-color: var(--primary);
  background: var(--sidebar-accent);
  color: var(--text);
}
.doc-mgmt-var-picker-item.is-picked,
.doc-mgmt-var-picker-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.doc-mgmt-var-picker-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}
.doc-mgmt-var-picker-action-btn {
  min-width: 2.25rem;
  font-size: 1rem;
  line-height: 1;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}
.doc-mgmt-var-picker-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
.doc-mgmt-var-picker-empty { margin: 0.5rem; }

/* ?????? */
.sys-var-page .page-head { margin-bottom: 1rem; }
.sys-var-page .page-subtitle { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.875rem; }
.sys-var-hint {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--sidebar-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.sys-var-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}
.sys-var-search {
  flex: 1 1 220px;
  max-width: 420px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.sys-var-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.sys-var-stats strong { color: var(--text); }
.sys-var-tabs-wrap {
  margin-top: 0.25rem;
  padding: 0;
  min-height: 420px;
}
.sys-var-tabs {
  margin-bottom: 0;
  padding-bottom: 0;
  gap: 0.25rem 0.35rem;
}
.sys-var-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.sys-var-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  background: color-mix(in srgb, var(--surface2) 80%, var(--surface));
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.sys-var-tab.active .sys-var-tab-count {
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.sys-var-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0.75rem;
}
.sys-var-tab-panel.active .card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sys-var-tab-panel.active .table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.sys-var-key { font-size: 0.8125rem; }
.sys-var-source { font-size: 0.8125rem; color: var(--text-muted); max-width: 280px; }
.sys-var-ph-list { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; }
.sys-var-ph-btn {
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--primary);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  cursor: pointer;
}
.sys-var-ph-btn:hover { border-color: var(--primary); background: var(--sidebar-accent); }
.sys-var-ph-btn--msg { color: var(--accent, #0d9488); }
.sys-var-ctx-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin: 0 0.25rem 0.25rem 0;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--sidebar-accent);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.sys-var-ctx-tag--doc {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.sys-var-ctx-tag--bill {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.sys-var-ctx-tag--collection {
  color: var(--accent, #0d9488);
  border-color: color-mix(in srgb, var(--accent, #0d9488) 35%, var(--border));
}
.sys-var-ctx-tag--notice {
  color: color-mix(in srgb, var(--text) 85%, var(--primary));
  border-color: var(--border);
}
.sys-var-save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.sys-var-save-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.sys-var-scenario-cell {
  min-width: 220px;
  max-width: 320px;
}
.sys-var-scenario-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
}
.sys-var-scenario-check {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sys-var-scenario-check input {
  margin: 0;
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}
.sys-var-scenario-check:hover {
  color: var(--text);
}
.sys-var-debug-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
}
.sys-var-debug-field {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.sys-var-debug-field span {
  white-space: nowrap;
}
.sys-var-debug-select {
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
}
.sys-var-debug-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  flex: 1 1 12rem;
  min-width: 0;
}
.sys-var-preview-cell {
  max-width: 220px;
  font-size: 0.8125rem;
  color: var(--text);
  vertical-align: top;
}
.sys-var-preview-text {
  display: block;
  word-break: break-word;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}
.sys-var-preview-empty {
  font-style: italic;
}

.doc-mgmt-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.doc-mgmt-type-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}
.doc-mgmt-type-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.doc-mgmt-type-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.doc-mgmt-type-add {
  border-style: dashed;
  color: var(--primary);
  background: transparent;
}
.doc-mgmt-type-add:hover {
  background: rgba(37, 99, 235, 0.06);
}
.doc-mgmt-split {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
.doc-mgmt-left {
  flex: 0 0 40%;
  max-width: 40%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  padding: 1rem;
  overflow: hidden;
}
.doc-mgmt-left .doc-mgmt-form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}
.doc-mgmt-right {
  flex: 0 0 60%;
  max-width: 60%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  padding: 1rem;
  overflow: hidden;
}
.doc-mgmt-panel-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}
.doc-mgmt-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.doc-mgmt-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.doc-mgmt-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}
.doc-mgmt-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
}
.doc-mgmt-input[readonly] {
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: not-allowed;
}
.doc-mgmt-file {
  font-size: 0.875rem;
}
.doc-mgmt-hint {
  margin: 0;
  font-size: 0.75rem;
}
.doc-mgmt-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.doc-mgmt-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.doc-mgmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.doc-mgmt-table th,
.doc-mgmt-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.doc-mgmt-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
}
.doc-mgmt-col-invoke-id {
  width: 5.5rem;
  white-space: nowrap;
}
.doc-mgmt-invoke-id {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--primary-hover);
}
.doc-mgmt-path-cell {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.doc-mgmt-actions {
  white-space: nowrap;
}
.doc-mgmt-actions .btn-link {
  margin-right: 0.35rem;
}
.doc-mgmt-preview-modal .form-modal-body {
  padding: 0;
  max-height: min(78vh, 720px);
  overflow: auto;
}
.doc-mgmt-preview-wrap {
  min-height: 240px;
  padding: 0.75rem 1rem 1rem;
}
.doc-mgmt-preview-embed {
  width: 100%;
  height: min(72vh, 680px);
  border: 0;
  display: block;
  background: #fff;
}
.doc-mgmt-preview-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.doc-mgmt-preview-html {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.doc-mgmt-preview-html table {
  border-collapse: collapse;
  width: 100%;
}
.doc-mgmt-preview-html td,
.doc-mgmt-preview-html th {
  border: 1px solid var(--border);
  padding: 4px 6px;
}
.doc-mgmt-preview-empty {
  margin: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* ?? select ??????? */
select,
.theme-select,
.doc-mgmt-input[type="text"],
.setting-input select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:focus,
.theme-select:focus {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

@media (max-width: 960px) {
  .doc-mgmt-split {
    flex-direction: column;
  }
  .doc-mgmt-left,
  .doc-mgmt-right {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

/* 768px ????? responsive.css?? iPad ?? ?1024px? */

.placeholder-page-card { min-height: 320px; display: flex; align-items: center; justify-content: center; }
.placeholder-page-inner { text-align: center; padding: 2rem 1.5rem; max-width: 420px; }
.placeholder-page-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .85; }
.placeholder-page-title { font-size: 1.125rem; font-weight: 600; margin-bottom: .5rem; }
.placeholder-page-sub { color: var(--text-muted); font-size: .875rem; line-height: 1.6; }

.list-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem .5rem;
  margin-top: .75rem;
  padding: .5rem .25rem 0;
  border-top: 1px solid var(--border);
}
.list-pagination-bar--center {
  justify-content: center;
}
.list-pagination-bar--left {
  justify-content: flex-start;
}
.list-pagination-bar--right {
  justify-content: flex-end;
}
.list-pagination {
  /* 兼容旧选择器，与 list-pagination-bar 同用 */
}
.paginated-list-shell {
  display: flex;
  flex-direction: column;
  min-height: min(380px, calc(100vh - 14rem));
  overflow: hidden;
  overflow: clip;
}
.paginated-list-shell > .list-pagination-bar {
  flex-shrink: 0;
  margin-top: 0;
}
.paginated-list-shell > :not(.list-pagination-bar) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.paginated-list-shell > .card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  overflow: hidden;
}
.paginated-list-shell > .card > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.paginated-list-shell.card,
.paginated-list-shell.hr-approval-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.paginated-list-shell > table,
.paginated-list-shell > .hr-approval-table {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  width: 100%;
  overflow: auto;
}
.list-pagination-btn {
  padding: .35rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .8125rem;
  cursor: pointer;
}
.list-pagination-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  color: color-mix(in srgb, var(--text) 92%, transparent);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface) 78%, #fff) 0%,
      var(--surface) 42%,
      color-mix(in srgb, var(--surface) 72%, #000) 100%
    );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
    inset 0 -1px 0 color-mix(in srgb, #000 18%, transparent),
    0 1px 2px color-mix(in srgb, #000 22%, transparent);
}
.list-pagination-icon {
  display: block;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}
.list-pagination-btn--icon:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  color: var(--primary);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--surface) 70%, var(--primary)) 0%,
      var(--surface) 48%,
      color-mix(in srgb, var(--surface) 78%, #000) 100%
    );
}
.list-pagination-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.list-pagination-btn--icon:disabled,
.list-pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.list-pagination-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0 .15rem;
  font-size: .8125rem;
  color: var(--text-muted);
}
.list-pagination-input {
  width: 2.75rem;
  min-height: 2rem;
  padding: .25rem .35rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: color-mix(in srgb, var(--surface) 88%, #000);
  color: var(--text);
  text-align: center;
  font-size: .875rem;
  font-weight: 650;
  box-shadow: inset 0 1px 2px color-mix(in srgb, #000 16%, transparent);
}
.list-pagination-input-wrap [data-pg-total] {
  white-space: nowrap;
  color: color-mix(in srgb, var(--text-muted) 70%, var(--primary));
  font-variant-numeric: tabular-nums;
}
.list-pagination-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-left: .25rem;
}
.settings-pagination-modules {
  margin-top: 1rem;
  padding: 1rem 1.15rem 1.15rem;
}
.settings-pagination-modules-head {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}
.settings-pagination-modules-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.settings-pagination-modules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 0.85rem;
}
.page-pagination-module-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--surface2) 88%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.page-pagination-module-item:focus-within {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, rgb(var(--primary-rgb)) 14%, transparent);
}
.page-pagination-module-label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}
.page-pagination-module-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.375rem;
  padding: 0.3rem 0.55rem 0.3rem 0.65rem;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 92%, var(--text-muted));
  border-radius: calc(var(--radius-sm) + 2px);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent),
    0 1px 2px color-mix(in srgb, var(--bg) 18%, transparent);
}
.page-pagination-module-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent),
    0 0 0 3px color-mix(in srgb, rgb(var(--primary-rgb)) 12%, transparent);
}
.page-pagination-module-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0.2rem 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}
.page-pagination-module-input::-webkit-outer-spin-button,
.page-pagination-module-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.page-pagination-module-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.85;
}
.page-pagination-module-unit {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}
@media (max-width: 1100px) {
  .settings-pagination-modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .settings-pagination-modules-grid {
    grid-template-columns: 1fr;
  }
}
.settings-points-subtabs-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-share-reward {
  margin-top: 1rem;
  padding: 1rem 1.125rem;
}
.settings-share-reward-head {
  font-weight: 700;
  margin-bottom: .5rem;
}
.share-reward-type-radios {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin: .75rem 0 1rem;
}
.share-reward-radio {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .875rem;
  cursor: pointer;
}
.profile-share-code-card {
  margin-top: 0;
}
.profile-share-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin: .75rem 0;
}
.profile-share-code {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: .35rem .75rem;
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, var(--radius));
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.profile-share-url {
  word-break: break-all;
  color: var(--text-muted);
}

/* ?????? */
.glass-tip-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
}
.glass-tip-overlay--visible { opacity: 1; }
.glass-tip-overlay--hide { opacity: 0; pointer-events: none; }
.glass-tip-overlay--pass-through {
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.glass-tip-overlay--pass-through .glass-tip-panel {
  pointer-events: auto;
}
.glass-tip-panel {
  max-width: min(420px, 92vw);
  padding: .85rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
}
.glass-tip-panel--anchored { z-index: 12001; }
.glass-tip-title {
  font-weight: 600;
  margin-bottom: .5rem;
  font-size: .9375rem;
}
.glass-tip-dl { margin: 0; }
.glass-tip-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: .35rem .75rem;
  padding: .2rem 0;
  font-size: .875rem;
}
.glass-tip-row dt { color: var(--text-muted); margin: 0; }
.glass-tip-row dd { margin: 0; word-break: break-word; }
.glass-tip-section { margin-top: .65rem; }
.glass-tip-section strong { display: block; margin-bottom: .25rem; font-size: .8125rem; }
.glass-tip-meta, .glass-tip-sub { font-size: .8125rem; color: var(--text-muted); margin: 0 0 .35rem; }

/* ???? */
.field-required { color: var(--primary); font-weight: 600; }

.tenant-wechat-bind-slot,
.tenant-channel-bind-slot { margin-top: .75rem; }
.tenant-wechat-bind {
  padding: .65rem .75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2, rgba(0,0,0,.02));
  font-size: .8125rem;
}
.tenant-wechat-bind-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .35rem;
}
.tenant-wechat-bind-status { color: var(--text-muted); font-weight: 400; }
.tenant-wechat-bind--bound .tenant-wechat-bind-status { color: var(--success, #16a34a); }
.tenant-wechat-bind--unbound .tenant-wechat-bind-status { color: var(--danger, #dc2626); }
.tenant-wechat-bind-meta, .tenant-wechat-bind-hint { margin: .25rem 0 .5rem; color: var(--text-muted); }
.tenant-wechat-bind-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.tenant-wechat-bind-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.wechat-userid-row {
  display: flex;
  gap: .5rem;
  width: 100%;
  align-items: stretch;
}
.wechat-userid-row .wechat-userid-input,
.wechat-userid-row .tenant-wechat-bind-input {
  flex: 0 0 calc(50% - .25rem);
  width: calc(50% - .25rem);
  max-width: calc(50% - .25rem);
  min-width: 0;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8125rem;
}
.wechat-userid-row .wechat-userid-pick {
  flex: 0 0 calc(50% - .25rem);
  width: calc(50% - .25rem);
  max-width: calc(50% - .25rem);
  min-width: 0;
  white-space: nowrap;
}
.wechat-contact-picker-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: .65rem;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
}
.wechat-contact-picker-list {
  max-height: min(52vh, 28rem);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface, #fff);
}
.wechat-contact-picker-options {
  display: flex;
  flex-direction: column;
}
.wechat-contact-picker-option {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.wechat-contact-picker-option:last-child { border-bottom: none; }
.wechat-contact-picker-option:hover { background: rgba(0, 0, 0, .03); }
.wechat-contact-picker-option input { margin-top: .2rem; flex-shrink: 0; }
.wechat-contact-picker-option-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.wechat-contact-picker-name { font-weight: 600; font-size: .875rem; }
.wechat-contact-picker-meta,
.wechat-contact-picker-id {
  font-size: .75rem;
  color: var(--text-muted);
  word-break: break-all;
}
.wechat-contact-picker-empty {
  margin: 0;
  padding: 1rem .75rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8125rem;
}
.tenant-wechat-bind-input {
  flex: 1 1 10rem;
  min-width: 8rem;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8125rem;
}
.glass-tip-wechat-bind-slot { margin-top: .5rem; }
.glass-tip-wechat-bind-slot .tenant-wechat-bind { border: none; padding: 0; background: transparent; }
.message-channel-option--radio input { margin-right: .35rem; }

/* ?????? */
.app-loading-overlay--leaving {
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
}
.form-modal-footer .form-modal-preview:disabled,
.form-modal-footer .form-modal-submit:disabled,
.form-modal-footer .form-modal-send:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.sidebar-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-width: 0;
}
.sidebar-auth-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; }
@media (max-width: 1180px) {
  .sidebar-auth-label { display: none; }
}

/* ?????? */
.form-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}
.form-modal.hidden { display: none; }
.form-modal-box--busy { pointer-events: none; opacity: 0.92; }
.form-modal-body .field { margin-bottom: 1rem; }
.form-modal-body .field:last-child { margin-bottom: 0; }
.form-modal-body .field label {
  display: block;
  font-size: .8125rem;
  color: var(--text-muted);
  margin-bottom: .375rem;
}
.form-modal-body .field .input,
.form-modal-body .field input,
.form-modal-body .field select,
.form-modal-body .field textarea {
  width: 100%;
  padding: .625rem .875rem;
  background: var(--surface2, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9375rem;
  font-family: inherit;
  box-sizing: border-box;
}
.form-modal-body .field .input:focus,
.form-modal-body .field input:focus,
.form-modal-body .field select:focus,
.form-modal-body .field textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.device-manage-modal.form-modal-box {
  width: min(560px, calc(100vw - 2rem));
  max-width: none;
}
.device-manage-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-height: min(60vh, 420px);
  overflow-y: auto;
}
.device-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, var(--radius));
  background: color-mix(in srgb, var(--surface2) 35%, var(--surface));
}
.device-manage-meta { flex: 1; min-width: 0; }
.device-manage-meta strong {
  font-size: .9375rem;
  word-break: break-word;
}
.device-manage-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
  line-height: 1.45;
}
.device-manage-current {
  font-size: .75rem;
  color: var(--primary);
  margin-left: .35rem;
  font-weight: 600;
}
.device-manage-delete { flex-shrink: 0; color: var(--danger); }
.device-manage-delete:hover {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.password-change-modal.form-modal-box {
  width: min(440px, calc(100vw - 2rem));
}

/* ?? ?????????? ?? */
.activity-category-page {
  max-width: 720px;
  margin: 0 auto;
}
.activity-category-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.activity-category-card {
  display: grid;
  /* ?? | ?? | ?? | ?? | ?? */
  grid-template-columns: 2.25rem minmax(0, 1fr) 3.25rem auto 4.75rem;
  align-items: center;
  gap: 0.75rem 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.activity-category-del,
.activity-category-del-spacer {
  justify-self: end;
  min-width: 3.25rem;
  text-align: center;
}
.activity-category-del-spacer {
  display: block;
  visibility: hidden;
  pointer-events: none;
}
.activity-category-index {
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}
.activity-category-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-category-switch {
  /* 相对定位：避免绝对定位的隐藏 checkbox 焦点滚动把 #page-content 滚空 */
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  min-width: 5.5rem;
}
.activity-category-switch input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.activity-category-switch-ui {
  width: 2.6rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.activity-category-switch-ui::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.activity-category-switch.is-on .activity-category-switch-ui {
  background: #22c55e;
  border-color: #16a34a;
}
.activity-category-switch.is-on .activity-category-switch-ui::after {
  transform: translateX(1.15rem);
}
.activity-category-switch-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 2rem;
}
.activity-category-switch.is-on .activity-category-switch-text {
  color: #16a34a;
  font-weight: 600;
}
.activity-category-cover-wrap {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  justify-self: end;
}
.activity-category-cover-wrap.is-uploading {
  opacity: 0.55;
  pointer-events: none;
}
.activity-category-cover {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.activity-category-cover-wrap .lazy-img-wrap .activity-category-cover {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.activity-category-cover-hit {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  z-index: 3;
}
.activity-category-cover-empty {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed color-mix(in srgb, var(--text-muted) 55%, transparent);
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.activity-category-cover-empty:hover:not(.is-readonly):not(:disabled) {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: color-mix(in srgb, var(--primary, #2563eb) 6%, transparent);
}
.activity-category-cover-empty.is-readonly {
  cursor: default;
}
.activity-category-cover-empty--modal {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 1.75rem;
}
.activity-category-cover-file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.activity-category-upload {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.activity-category-cover-preview {
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
@media (max-width: 640px) {
  .activity-category-card {
    grid-template-columns: 1.75rem minmax(0, 1fr) 4.25rem;
    grid-template-areas:
      "idx name cover"
      "idx del cover"
      "idx switch cover";
  }
  .activity-category-index { grid-area: idx; }
  .activity-category-name { grid-area: name; }
  .activity-category-del,
  .activity-category-del-spacer { grid-area: del; justify-self: start; }
  .activity-category-switch { grid-area: switch; }
  .activity-category-cover-wrap { grid-area: cover; }
}

/* ?? ???????? ?? */
.material-catalog-page {
  max-width: 960px;
  margin: 0 auto;
}
.material-catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.06));
}
.material-catalog-banner {
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 75%, #1e3a5f) 100%);
  color: var(--btn-text, #fff);
  text-align: center;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
}
.material-category {
  border-top: 1px solid var(--border);
}
.material-category:first-of-type {
  border-top: none;
}
.material-category-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface2) 88%, var(--border));
  padding: 0.55rem 0.75rem;
}
.material-category-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1 1 auto;
  text-align: center;
}
.material-category-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.material-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 1rem;
  padding: 0.85rem 1.25rem 1rem;
}
.material-item-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.6rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text);
  position: relative;
  padding-right: 1.1rem;
}
.material-item-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.material-item-name {
  line-height: 1.35;
  word-break: break-word;
}
.material-item-del {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  opacity: 0;
}
.material-item-check:hover .material-item-del {
  opacity: 1;
}
.material-item-del:hover {
  color: var(--danger, #dc2626);
}
@media (max-width: 720px) {
  .material-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.75rem 0.85rem;
  }
  .material-category-name {
    flex: 1 1 100%;
  }
  .material-category-actions {
    flex: 1 1 100%;
    justify-content: center;
  }
}
@media (max-width: 420px) {
  .material-item-grid {
    grid-template-columns: 1fr;
  }
}

.alert-actions {
  display: flex;
  gap: .65rem;
  justify-content: stretch;
}
.alert-actions .btn-ghost,
.alert-actions .btn-primary {
  flex: 1;
}
.alert-icon--confirm {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
}

.settings-mail-supported { margin-top: .75rem; padding-top: .65rem; border-top: 1px dashed var(--border); }
.settings-mail-auto-hint--footer { margin: 0 0 .45rem; }
.settings-mail-supported-details { font-size: .8125rem; color: var(--text-muted); }
.settings-mail-supported-details summary {
  cursor: pointer; user-select: none; color: var(--text); font-weight: 500;
}
.settings-mail-domains {
  margin: .45rem 0 0; font-size: .75rem; line-height: 1.55; color: var(--text-muted); word-break: break-all;
}
.settings-mail-actions-row {
  grid-column: 2;
  margin: 0;
}
.settings-mail-actions-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  flex-wrap: wrap;
}
.settings-mail-auth-help-scroll {
  max-height: min(62vh, 480px);
  overflow-y: auto;
  padding-right: .25rem;
}
.settings-mail-auth-section {
  margin-bottom: .85rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--border);
}
.settings-mail-auth-section:last-of-type { border-bottom: none; margin-bottom: .35rem; }
.settings-mail-auth-title {
  margin: 0 0 .35rem;
  font-size: .875rem;
  font-weight: 600;
}
.settings-mail-auth-domains {
  margin: 0 0 .4rem;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.settings-mail-auth-steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: .8125rem;
  line-height: 1.55;
}
.settings-mail-auth-steps li { margin: .2rem 0; }
.settings-mail-auth-note,
.settings-mail-auth-footnote {
  margin: .5rem 0 0;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.glass-tip-panel:has(.settings-mail-auth-help-scroll) {
  max-width: min(520px, 94vw);
}
/* ??? web-view ??????? Web ??????????? */
html[data-mp-embed="native-nav"] .sidebar {
  display: none !important;
}

html[data-mp-embed="native-nav"] .main-app,
html[data-mp-embed="native-nav"] .main-app:not(.hidden) {
  width: 100%;
  max-width: none;
  min-height: 100%;
}

html[data-mp-embed="native-nav"] .content {
  width: 100%;
  max-width: none;
  min-width: 0;
}

html[data-mp-embed="native-nav"] .topbar {
  display: none !important;
}

html[data-mp-embed="native-nav"] .page-content {
  padding: 0.375rem 0.5rem 4.5rem;
  min-height: auto;
  box-sizing: border-box;
}

html[data-mp-embed="1"] .main-app,
html[data-mp-embed="1"] .main-app:not(.hidden) {
  width: 100%;
  max-width: none;
  min-height: 100vh;
}

html[data-mp-embed="1"] .content {
  width: 100%;
  max-width: none;
  min-width: 0;
}

html[data-mp-embed="1"] .topbar {
  padding: 0 0.75rem;
  min-height: var(--app-header-height);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface, #fff);
}

html[data-mp-embed="1"] .page-content {
  padding: 0.5rem 0.625rem 1.5rem;
  min-height: calc(100vh - 3.25rem);
}

html[data-mp-embed="1"] input,
html[data-mp-embed="1"] textarea,
html[data-mp-embed="1"] select {
  font-size: 16px;
}

html[data-mp-embed="1"] .modal-overlay,
html[data-mp-embed="1"] .alert-modal,
html[data-mp-embed="1"] .drawer-overlay,
html[data-mp-embed="1"] .popover-overlay {
  z-index: 10000;
}

html[data-mp-embed="1"] .modal,
html[data-mp-embed="1"] .alert-box,
html[data-mp-embed="1"] .drawer {
  max-height: 92vh;
  overflow: auto;
}

html[data-mp-embed="1"] .btn-primary,
html[data-mp-embed="1"] .btn-ghost,
html[data-mp-embed="1"] button {
  touch-action: manipulation;
}

/* ?? ????????? / ???? ?? */
.tenant-deliver-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tenant-deliver-page-title {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 700;
}
.tenant-deliver-page-hint {
  margin: 0;
}
.tenant-deliver-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tenant-deliver-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.tenant-deliver-card {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.tenant-deliver-card > .settings-actions,
.tenant-deliver-card > .tenant-deliver-return-actions {
  margin-top: auto;
}
.tenant-deliver-card .card-header {
  margin-bottom: 0.45rem;
}
.tenant-deliver-card .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.65rem 0;
}
/* 表单标签与说明文案统一为 field-hint 字号 */
.tenant-deliver-card .field > span,
.tenant-deliver-card .theme-select-label,
.tenant-deliver-card > p:not(.field-hint) {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.45;
}
.tenant-deliver-card .theme-select-label {
  display: block;
  margin: 0.35rem 0 0.25rem;
}
.tenant-deliver-card .settings-actions {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tenant-deliver-mp-line {
  margin: 0.55rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}
.tenant-deliver-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.65rem 0 0.85rem;
}
.tenant-deliver-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface2));
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tenant-deliver-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tenant-deliver-avatar--fallback {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
}
.tenant-deliver-person-name {
  font-weight: 600;
}
.tenant-deliver-person-sub {
  font-size: 0.85rem;
  color: var(--text-muted, var(--muted));
}
.tenant-deliver-openid-box {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.tenant-deliver-openid-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.tenant-deliver-openid-list {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  color: var(--text-muted, var(--muted));
}
.tenant-deliver-return-actions {
  margin-top: 0.85rem;
}

.tenant-approvals-page {
  padding: 0.85rem 1rem 1rem;
}
.tenant-approvals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.tenant-approvals-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.tenant-approvals-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tenant-approvals-header-actions .setting-select {
  min-width: 8.5rem;
}
.tenant-approvals-table th,
.tenant-approvals-table td {
  vertical-align: middle;
}
.tenant-approvals-hint {
  margin: 0 0 0.75rem;
  max-width: 56rem;
}
.tenant-approvals-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  min-width: 18rem;
}
.tenant-approvals-ops .btn-sm[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.tenant-approvals-btn-freeze:not([disabled]) {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
}
.tenant-approvals-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text, #e2e8f0);
}
.tenant-approvals-status.is-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.tenant-approvals-status.is-normal {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.tenant-approvals-status.is-paused {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.tenant-approvals-status.is-frozen {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.tenant-approvals-status.is-rejected {
  background: rgba(148, 163, 184, 0.22);
  color: #94a3b8;
}

@media (max-width: 900px) {
  .tenant-deliver-row {
    grid-template-columns: 1fr;
  }
}

.tenant-create-page {
  padding: 0.25rem 0 1rem;
}
.tenant-create-page-head {
  margin-bottom: 1rem;
}
.tenant-create-page-title {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 700;
}
.tenant-create-page-hint {
  margin: 0;
  max-width: 56rem;
}
.tenant-create-cloud-card {
  width: 100%;
  margin: 0 0 1.5rem;
}
.tenant-create-location-card {
  width: 100%;
  margin: 0 0 1.5rem;
}
.tenant-create-loc-coords {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
}
.tenant-create-location-card #tenant-pick-location,
.tenant-pick-location-btn {
  align-self: flex-start;
  width: auto;
  max-width: max-content;
  display: inline-flex;
  padding: 0.45rem 1rem;
  white-space: nowrap;
}
.tenant-create-cloud-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.tenant-create-cloud-fields .field {
  margin: 0.35rem 0;
}
.tenant-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin: 0.25rem 0 1.25rem;
}
.tenant-create-card {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  box-sizing: border-box;
}
.tenant-create-equal-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.tenant-create-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tenant-create-card .card-header {
  margin-bottom: 0.45rem;
}
.tenant-create-card .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.7rem 0;
}
.tenant-create-field-label {
  font-weight: 600;
}
.tenant-create-readonly-field .setting-input:disabled {
  opacity: 0.92;
  cursor: default;
}
.tenant-create-init-check {
  margin-top: 0.85rem;
}
.tenant-create-actions {
  margin-top: 0.25rem;
}
.tenant-create-result {
  margin-top: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 16rem;
  overflow: auto;
}

@media (max-width: 900px) {
  .tenant-create-grid,
  .tenant-create-cloud-fields,
  .tenant-create-loc-coords {
    grid-template-columns: 1fr;
  }
}

.tenant-features-page {
  padding: 0.25rem 0 1rem;
}
.tenant-features-page-head {
  margin-bottom: 1rem;
}
.tenant-features-page-title {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 700;
}
.tenant-features-layout {
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 70%);
  gap: 1rem;
  align-items: stretch;
  min-height: 28rem;
}
.tenant-features-card {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}
.tenant-features-card .card-header {
  margin-bottom: 0.55rem;
}
.tenant-features-tenant-list,
.tenant-features-panel {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.tenant-features-tenant-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  margin: 0 0 0.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.tenant-features-tenant-item:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.tenant-features-tenant-item.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface2));
}
.tenant-features-tenant-name {
  font-weight: 600;
}
.tenant-features-tenant-appid {
  font-size: 0.8rem;
  opacity: 0.85;
}
.tenant-features-tenant-meta {
  font-size: 0.8rem;
  color: var(--text-muted, var(--muted));
}
.tenant-features-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.tenant-features-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.payment-simulate-switch {
  margin-right: 0.15rem;
}
.payment-simulate-switch.is-locked {
  opacity: 0.65;
  cursor: not-allowed;
}
.tenant-features-group {
  margin: 0.85rem 0 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.tenant-features-group:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.tenant-features-group-title {
  font-weight: 600;
  margin-bottom: 0.45rem;
}
.tenant-features-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
}
.tenant-features-check {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.tenant-features-check.is-locked {
  opacity: 0.85;
  cursor: default;
}
.tenant-features-check input {
  margin-top: 0.2rem;
}

@media (max-width: 900px) {
  .tenant-features-layout,
  .tenant-features-checks {
    grid-template-columns: 1fr;
  }
}

/* ?? ??????????? ?? */
.cloud-media-upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.cloud-media-upload-overlay.hidden { display: none; }
.cloud-media-upload-panel {
  width: min(420px, 92vw);
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.cloud-media-upload-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.cloud-media-upload-hint {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.cloud-media-upload-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.cloud-media-upload-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #22c55e));
  transition: width 0.2s ease;
}

/* ???? ??????????? ???? */
.settings-body {
  padding: 1.25rem;
  --settings-label-width: 12rem;
  --settings-label-offset: calc(var(--settings-label-width) + 1rem);
}
.settings-tabs-wrap { margin-top: .5rem; }
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.settings-tab {
  padding: .625rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
}
.settings-tab:hover { color: var(--text); background: var(--surface2); }
.settings-tab.active {
  color: var(--primary-hover, var(--primary));
  border-bottom-color: var(--primary);
  background: var(--sidebar-accent, transparent);
}
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }
.settings-panel-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-panel-fields--cols2,
.settings-panel-fields--cols3 {
  --settings-cols-font: .8125rem;
  display: grid;
  gap: .75rem 1.25rem;
  align-items: start;
  font-size: var(--settings-cols-font);
}
.settings-panel-fields--cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-panel-fields--cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .settings-panel-fields--cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .settings-panel-fields--cols2,
  .settings-panel-fields--cols3 { grid-template-columns: 1fr; }
}
.settings-panel-fields--cols2 .setting-field-row,
.settings-panel-fields--cols3 .setting-field-row {
  border-bottom: none;
  padding: .35rem 0;
}
.settings-panel-fields--cols2 .setting-field-line,
.settings-panel-fields--cols3 .setting-field-line {
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}
.settings-panel-fields--cols2 .setting-label,
.settings-panel-fields--cols3 .setting-label {
  flex: none;
  max-width: none;
  white-space: normal;
  font-weight: 500;
}
.settings-panel-fields--cols2 .setting-control,
.settings-panel-fields--cols3 .setting-control {
  width: 100%;
  min-width: 0;
}
.settings-panel-fields--cols2 .setting-input,
.settings-panel-fields--cols3 .setting-input,
.settings-panel-fields--cols2 .setting-select,
.settings-panel-fields--cols3 .setting-select {
  max-width: none;
  width: 100%;
}
.setting-field-row {
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.setting-field-row:last-child { border-bottom: none; }
.setting-field-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.setting-field-line--stack {
  flex-direction: column;
  align-items: flex-start;
}
.setting-label {
  flex: 0 0 var(--settings-label-width);
  max-width: var(--settings-label-width);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
}
.setting-label-optional {
  margin-left: .25rem;
  color: var(--text-muted);
  font-weight: 400;
  font-size: .8125rem;
}
.setting-control {
  flex: 1;
  min-width: 12rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.setting-control .setting-input,
.setting-control .setting-select {
  flex: 1;
  min-width: 8rem;
  max-width: 20rem;
}
.setting-input,
.setting-select,
.setting-textarea {
  padding: .5rem .625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
}
.setting-textarea { width: 100%; max-width: 36rem; resize: vertical; }
.setting-field-hint,
.setting-field-configured-hint {
  margin: .375rem 0 0 var(--settings-label-offset);
  font-size: .8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.settings-panel-fields--cols2 .setting-field-hint,
.settings-panel-fields--cols3 .setting-field-hint,
.settings-panel-fields--cols2 .setting-field-configured-hint,
.settings-panel-fields--cols3 .setting-field-configured-hint {
  margin-left: 0;
}
.settings-rewards-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.settings-rewards-section .settings-rewards-row {
  margin: 0;
}
.setting-field--readonly .setting-input,
.setting-field--readonly .setting-select,
.setting-field--readonly .setting-textarea {
  opacity: 0.85;
  cursor: default;
  background: color-mix(in srgb, var(--bg-elevated, var(--card, #1e293b)) 88%, var(--border, #334155));
}
.field-unit { color: var(--text-muted); font-size: .8125rem; white-space: nowrap; }
.setting-configured-badge {
  margin-left: .4rem;
  padding: .1rem .4rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}
.setting-control--switch {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}
.setting-page-switch.activity-category-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  max-width: none;
  min-width: 5.5rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.setting-page-switch.activity-category-switch input.setting-switch {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}
.setting-field-switch .activity-category-switch-ui {
  width: 2.6rem;
  height: 1.4rem;
  flex: 0 0 2.6rem;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
}
.setting-field-switch .activity-category-switch.is-on .activity-category-switch-ui {
  background: #22c55e;
  border-color: #16a34a;
}
.setting-field-switch .activity-category-switch.is-on .activity-category-switch-text {
  color: #16a34a;
  font-weight: 600;
}

.settings-mp-wxauth-sync-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #fbbf24;
  background: #fffbeb;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.settings-mp-wxauth-sync-text {
  margin: 0;
  flex: 1 1 240px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #92400e;
}

/* ????????????????????? */
.settings-mp-carousel-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.settings-mp-carousel-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.settings-mp-carousel-title { font-weight: 700; font-size: 1rem; }
.settings-mp-carousel-hint {
  margin: .4rem 0 0;
  font-size: .8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.settings-entity-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.entity-qual-media-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2) 55%, transparent);
}
.entity-qual-media-title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .35rem;
}
.entity-qual-media-block .field-hint {
  margin: 0 0 .75rem;
  font-size: .8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.entity-qual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.entity-qual-actions[hidden] {
  display: none !important;
}
.entity-qual-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.entity-qual-empty {
  font-size: .8125rem;
  color: var(--text-muted);
  padding: .35rem 0;
}
.entity-qual-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.entity-qual-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.entity-qual-thumb-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
  background: var(--surface2);
}
.entity-qual-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.entity-qual-thumb-del:hover {
  background: rgba(180, 30, 30, .85);
}
.mp-carousel-count {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.settings-mp-carousel-upload { margin-top: .9rem; }
.mp-carousel-dropzone,
.maint-upload-dropzone {
  border: 1.5px dashed color-mix(in srgb, var(--border) 70%, var(--primary));
  border-radius: 12px;
  padding: 1.35rem 1rem;
  text-align: center;
  background: color-mix(in srgb, var(--surface2) 70%, transparent);
  cursor: pointer;
}
.mp-carousel-dropzone.is-disabled { opacity: .92; }
.maint-upload-dropzone-icon { font-size: 1.6rem; margin-bottom: .35rem; }
.maint-upload-dropzone-title { font-weight: 600; }
.maint-upload-dropzone-sub,
.maint-upload-dropzone-hint {
  margin-top: .25rem;
  font-size: .8125rem;
  color: var(--text-muted);
}
.mp-carousel-list { margin-top: .85rem; }
.mp-carousel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 8.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  text-align: center;
}
.mp-carousel-empty-icon { font-size: 1.75rem; opacity: .7; }
.mp-carousel-empty-title { font-weight: 600; }
.mp-carousel-empty-hint { font-size: .8125rem; color: var(--text-muted); }
.mp-carousel-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.mp-carousel-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  background: var(--surface2);
  overflow: hidden;
}
.mp-carousel-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem .65rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mp-carousel-order {
  display: inline-flex;
  align-items: center;
  padding: .12rem .45rem;
  border-radius: 4px;
  font-size: .6875rem;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}
.mp-carousel-remove-btn {
  flex-shrink: 0;
  padding: .28rem .55rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.mp-carousel-remove-btn:hover { color: #ef4444; }
.mp-carousel-item-body {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .75rem;
}
.mp-carousel-preview-wrap {
  position: relative;
  flex: 0 0 84px;
  width: 84px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.mp-carousel-preview-wrap .lazy-img-wrap {
  width: 100%;
  height: 100%;
  display: block;
}
.mp-carousel-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mp-carousel-thumb--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: .625rem;
  background: var(--surface2);
}
.mp-carousel-thumb-icon { font-size: .95rem; opacity: .55; }
.mp-carousel-item-fields {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem .75rem;
}
.mp-carousel-field {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  min-width: 0;
}
.mp-carousel-field-label {
  font-size: .6875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.mp-carousel-input-shell .setting-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.mp-carousel-dropzone.is-uploading { opacity: .72; pointer-events: none; }
@media (max-width: 720px) {
  .mp-carousel-item-fields { grid-template-columns: 1fr; }
}

/* ???? ??????????? / ???? ???? */
.settings-interface-section-body--payment-stack,
.settings-interface-section-body--sms-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.settings-payment-provider-block {
  padding: 1rem 1.15rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.settings-payment-provider-title {
  margin-bottom: .75rem;
}
.settings-payment-provider-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  color: #fff;
  background: color-mix(in srgb, var(--primary) 78%, #7c3aed);
}
.settings-pay-switch-row {
  margin-bottom: .85rem;
}
.settings-interface-section-body--cols2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.25rem;
}
@media (max-width: 900px) {
  .settings-interface-section-body--cols2 { grid-template-columns: 1fr; }
}
.settings-interface-section-body--cols2 .setting-field-row {
  border-bottom: none;
  padding: .2rem 0;
}
.settings-interface-section-body--cols2 .setting-field-line {
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}
.settings-interface-section-body--cols2 .setting-label {
  flex: none;
  max-width: none;
  white-space: normal;
}
.settings-interface-section-body--cols2 .setting-control,
.settings-interface-section-body--cols2 .setting-input,
.settings-interface-section-body--cols2 .setting-select,
.settings-interface-section-body--cols2 .setting-textarea {
  width: 100%;
  max-width: none;
}
.settings-interface-section-body--cols2 .setting-field-hint,
.settings-interface-section-body--cols2 .setting-field-configured-hint {
  margin-left: 0;
}
.settings-wechat-pay-mode-picker {
  grid-column: 1 / -1;
}
.settings-payment-actions-row {
  margin-top: .85rem;
}
.settings-mkt-if-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 12px;
}
.settings-payment-hint {
  margin: .65rem 0 0;
  font-size: .8125rem;
  line-height: 1.5;
}
.settings-sms-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.settings-sms-test-hint {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.settings-sms-enabled-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem 1.25rem;
  margin-bottom: .35rem;
}
@media (max-width: 900px) {
  .settings-sms-enabled-row { grid-template-columns: 1fr; }
}
.settings-sms-provider-picker { margin: .5rem 0 .85rem; max-width: 28rem; }
.settings-sms-provider-panel.hidden { display: none !important; }
.settings-sms-tencent-grid--cols3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem 1.15rem;
}
@media (max-width: 1100px) {
  .settings-sms-tencent-grid--cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .settings-sms-tencent-grid--cols3 { grid-template-columns: 1fr; }
}
.settings-sms-tencent-col {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
}
.settings-sms-tencent-col .setting-field-row { border-bottom: none; padding: .15rem 0; }
.settings-sms-tencent-col .setting-field-line {
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}
.settings-sms-tencent-col .setting-label { flex: none; max-width: none; white-space: normal; }
.settings-sms-tencent-col .setting-control,
.settings-sms-tencent-col .setting-input,
.settings-sms-tencent-col .setting-select { width: 100%; max-width: none; }
.settings-sms-tencent-col .setting-field-hint,
.settings-sms-tencent-col .setting-field-configured-hint { margin-left: 0; }
.hidden { display: none !important; }

.param-init-fields { margin-top: .75rem; }
.param-init-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .8125rem;
  margin-bottom: .25rem;
}
.param-init-field input:disabled {
  opacity: .85;
  cursor: not-allowed;
  background: var(--surface2);
}
.param-init-section-title {
  margin: 1rem 0 .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}
.param-init-section-title:first-of-type { margin-top: 0; }
.param-init-hint {
  display: block;
  font-size: .75rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 .35rem;
  line-height: 1.35;
}
.param-init-loaded-hint {
  color: var(--success, #15803d);
  margin-top: .25rem;
}
.param-init-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}
.param-init-overlay.hidden { display: none; }
.param-init-overlay-panel {
  width: min(22rem, 100%);
  padding: 1.25rem 1.35rem 1.1rem;
  border-radius: var(--radius, 8px);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .18);
}
.param-init-overlay-title {
  margin: 0 0 .85rem;
  font-size: .9375rem;
  font-weight: 600;
  text-align: center;
  color: var(--text, #0f172a);
}
.param-init-overlay-hint {
  margin: .65rem 0 0;
  font-size: .75rem;
  text-align: center;
  color: var(--text-muted, #64748b);
}
.param-init-progress-track {
  height: .45rem;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.param-init-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary, #2563eb), #3b82f6);
  transition: width .12s ease-out;
}
.required-mark {
  color: var(--danger, #c0392b);
  margin-left: 2px;
}

.tenant-features-page {
  padding: 0.25rem 0 1rem;
}
.tenant-features-page-head {
  margin-bottom: 1rem;
}
.tenant-features-layout {
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 70%);
  gap: 1rem;
  align-items: stretch;
  min-height: 28rem;
}
.tenant-features-card {
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}
.tenant-features-card .card-header {
  margin-bottom: 0.55rem;
  font-weight: 600;
}
.tenant-features-tenant-list,
.tenant-features-panel {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.tenant-features-tenant-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  margin: 0 0 0.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 8px);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.tenant-features-tenant-item:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.tenant-features-tenant-item.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface2));
}
.tenant-features-tenant-name {
  font-weight: 600;
}
.tenant-features-tenant-appid {
  font-size: 0.8rem;
  opacity: 0.85;
}
.tenant-features-tenant-meta {
  font-size: 0.8rem;
  color: var(--text-muted, var(--muted));
}
.tenant-features-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.tenant-features-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.payment-simulate-switch {
  margin-right: 0.15rem;
}
.payment-simulate-switch.is-locked {
  opacity: 0.65;
  cursor: not-allowed;
}
.tenant-features-group {
  margin: 0.85rem 0 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.tenant-features-group:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.tenant-features-group-title {
  font-weight: 600;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
}
.tenant-features-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
}
.tenant-features-check {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.tenant-features-check.is-locked {
  opacity: 0.85;
  cursor: default;
}
.tenant-features-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .tenant-features-layout,
  .tenant-features-checks {
    grid-template-columns: 1fr;
  }
}

.tenant-reports-page .tenant-features-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.tenant-reports-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-left: auto;
}
.tenant-reports-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
}
.tenant-reports-kpi-label {
  font-size: .78rem;
  color: var(--text-muted, #64748b);
}
.tenant-reports-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  line-height: 1.2;
}
.tenant-reports-kpi.is-negative .tenant-reports-kpi-val {
  color: #dc2626;
}
.tenant-reports-kpi--rate .tenant-reports-kpi-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary, #0ea5e9);
}
.tenant-reports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.tenant-reports-card {
  border: 1px solid var(--border, rgba(15, 23, 42, .1));
  border-radius: var(--radius, 12px);
  background: var(--surface2, #f8fafc);
  padding: 14px 16px;
}
.tenant-reports-card-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text, #0f172a);
}
.tenant-reports-card-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tenant-reports-card-rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: .9rem;
}
.tenant-reports-card-rows span {
  color: var(--text-muted, #64748b);
}
.tenant-reports-card-rows strong {
  font-size: 1.05rem;
  color: var(--text, #0f172a);
}
@media (max-width: 900px) {
  .tenant-reports-grid {
    grid-template-columns: 1fr;
  }
}
.payment-manage-page {
  padding: 0.25rem 0 1rem;
}
.payment-manage-placeholder {
  opacity: 0.85;
}
.setting-readonly-value {
  display: inline-block;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}
.settings-wechat-pay-mode-locked .setting-readonly-value {
  min-width: 6rem;
}

/* ?? ?????? ?? */
.cw-assets-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.cw-assets-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cw-assets-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
}
.cw-assets-tab {
  padding: 0.625rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cw-assets-tab:hover { color: var(--text); }
.cw-assets-tab.active {
  color: var(--primary-hover, var(--primary));
  border-bottom-color: var(--primary-hover, var(--primary));
}
.cw-assets-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 30%) minmax(0, 70%);
  gap: 1rem;
  align-items: stretch;
  min-height: min(62vh, 560px);
}
.cw-assets-col { min-width: 0; }
.cw-assets-upload-card,
.cw-assets-browse-card {
  height: 100%;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  box-sizing: border-box;
}
.cw-assets-panel-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.cw-assets-panel-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.cw-assets-folder-toolbar {
  margin: 0 0 0.75rem;
}
.cw-assets-folder-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}
.cw-assets-folder-tab {
  appearance: none;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
  line-height: 1.3;
}
.cw-assets-folder-tab.active {
  background: var(--primary, #0284c7);
  border-color: var(--primary, #0284c7);
  color: #fff;
}
.cw-assets-folder-empty {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--warning-text, #92400e);
  background: color-mix(in srgb, #f59e0b 12%, var(--surface, #fff));
  border-radius: 8px;
}
.cw-asset-folder-mini-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}
.cw-asset-folder-mini-tab {
  appearance: none;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.cw-asset-folder-mini-tab.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.cw-assets-dropzone.is-dragover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.cw-assets-dropzone.is-uploading {
  opacity: 0.6;
  pointer-events: none;
}
.cw-assets-upload-status {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.cw-assets-upload-status.is-error { color: var(--danger, #dc2626); }
.cw-assets-count {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.cw-assets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.85rem;
}
.cw-asset-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.cw-asset-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.cw-asset-thumb-btn {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.cw-asset-thumb-btn .lazy-img-wrap {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface2) 88%, var(--surface));
}
.cw-asset-thumb-btn .lazy-img-wrap > img.lazy-img-gif {
  width: 3rem;
  height: 3rem;
  max-width: 46%;
  max-height: 46%;
}
.cw-asset-thumb,
.cw-asset-thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cw-asset-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.cw-asset-badge {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  z-index: 2;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  line-height: 1.2;
  color: #fff;
  background: rgba(15, 23, 42, 0.65);
  pointer-events: none;
}
.cw-asset-badge.is-public { background: rgba(22, 101, 52, 0.85); }
.cw-asset-badge.is-tenant { background: rgba(30, 64, 175, 0.85); }
.cw-asset-del {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cw-asset-del:hover { background: var(--danger, #dc2626); }
.cw-asset-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.cw-asset-lightbox {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.cw-asset-lightbox-panel {
  position: relative;
  max-width: min(92vw, 880px);
  max-height: 90vh;
  padding: 0.75rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.cw-asset-lightbox-img {
  display: block;
  max-width: min(88vw, 840px);
  max-height: min(78vh, 720px);
  object-fit: contain;
  border-radius: 8px;
  margin: 0 auto;
}
.cw-asset-lightbox-name {
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  word-break: break-all;
}
.cw-asset-lightbox-close,
.cw-asset-lightbox-del {
  position: absolute;
  top: 0.45rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}
.cw-asset-lightbox-close { right: 0.45rem; }
.cw-asset-lightbox-del { right: 2.7rem; font-size: 0.95rem; }
.cw-asset-lightbox-del:hover { background: var(--danger, #dc2626); }
.maint-upload-dropzone.is-dragover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
@media (max-width: 860px) {
  .cw-assets-layout { grid-template-columns: 1fr; }
}

/* ?? ??????? / ???? / H5 ??? ?? */
.btn-cw-new {
  appearance: none;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 1.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #9bbcf8 0%, #6b93e8 55%, #5a84dc 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 2px 8px rgba(74, 112, 200, 0.35);
  white-space: nowrap;
}
.btn-cw-new:hover { filter: brightness(1.05); }
.cw-row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.cw-styles-page { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.cw-styles-desc { margin: 0; color: var(--text-muted); font-size: 0.875rem; }
.cw-styles-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--border); }
.cw-styles-tab {
  padding: 0.55rem 0.95rem; border: 0; background: transparent; color: var(--text-muted);
  font-weight: 600; font-size: 0.875rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.cw-styles-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.cw-styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.cw-styles-card {
  display: flex; flex-direction: column; gap: 0.55rem;
  height: 100%;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface);
}
.cw-styles-card.is-disabled { opacity: 0.55; }
.cw-styles-card-preview {
  min-height: 140px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  border-radius: 8px; padding: 0.65rem;
}
.cw-styles-card-title { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.cw-styles-card-sub { font-size: 0.75rem; color: var(--text-muted); }
.cw-styles-switch {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-muted);
}
.cw-styles-switch input { accent-color: var(--primary); }
.cw-styles-card-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}
.cw-styles-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.cw-styles-card-actions .cw-styles-apply {
  margin-left: 0;
  white-space: nowrap;
}
.cw-styles-card.is-default {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

/* ???? */
.cw-title-page { width: 100%; display: flex; flex-direction: column; gap: 1rem; }
.cw-title-count {
  margin-left: 0.5rem; font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  padding: 0.15rem 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--border) 55%, transparent);
}
.cw-title-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; justify-content: space-between;
  margin-top: 0.35rem;
}
.cw-title-search {
  min-width: 200px; max-width: 280px; flex: 1;
  padding: 0.45rem 0.7rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.cw-title-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.cw-title-col--list {
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 0.25rem;
}
.cw-title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.75rem;
}
.cw-title-card {
  display: flex; flex-direction: column; gap: 0.45rem; text-align: left;
  padding: 0.65rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; color: inherit;
}
.cw-title-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.cw-title-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.cw-title-card.is-disabled { opacity: 0.55; }
.cw-title-card-preview {
  min-height: 72px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  border-radius: 8px; padding: 0.55rem;
}
.cw-title-card-name { font-weight: 700; font-size: 0.78rem; line-height: 1.35; color: var(--text); }
.cw-title-card-id { font-size: 0.68rem; color: var(--text-muted); }
.cw-title-col--panel {
  position: sticky; top: 0.5rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 0.9rem 1rem 1.1rem;
  max-height: calc(100vh - 200px); overflow: auto;
  overflow-anchor: none;
}
.cw-title-panel-empty { color: var(--text-muted); font-size: 0.875rem; padding: 1.5rem 0.5rem; }
.cw-title-panel-empty-title { font-weight: 700; color: var(--text); margin-bottom: 0.35rem; }
.cw-title-panel-name { font-weight: 800; font-size: 1rem; }
.cw-title-panel-id { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.cw-title-live {
  margin: 0.85rem 0; padding: 0.85rem; border-radius: 10px;
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  min-height: 88px;
  display: flex; align-items: center; justify-content: center;
}
/* 线条缩略：用 block 撑满宽度，避免 flex + 百分比宽把细线压成 0 */
.cw-title-live.cw-line-live {
  display: block;
  box-sizing: border-box;
}
.cw-title-live.cw-line-live > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.cw-line-card-preview {
  min-height: 44px;
  width: 100%;
  display: block;
  padding: 0.55rem 0.4rem;
  overflow: visible;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  border-radius: 8px;
}
.cw-line-card-preview > * {
  width: 100% !important;
  max-width: 100%;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box;
}
.cw-side-line-styles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  max-height: 62vh;
  overflow: auto;
}
.cw-side-line-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  text-align: left;
}
.cw-side-line-card:hover { border-color: var(--primary); }
.cw-side-line-preview {
  min-height: 36px;
  width: 100%;
  display: block;
  padding: 0.35rem 0.15rem;
  overflow: visible;
  box-sizing: border-box;
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  border-radius: 6px;
}
.cw-side-line-preview > * {
  width: 100% !important;
  max-width: 100%;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box;
}
.cw-title-fields { display: flex; flex-direction: column; gap: 0.55rem; }
.cw-title-field-group {
  margin: 0.45rem 0 0.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}
.cw-title-field-group:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.cw-title-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; }
.cw-title-field > span { color: var(--text-muted); font-weight: 600; }
.cw-title-field.cw-title-check {
  align-items: flex-start;
}
.cw-title-field.cw-title-check input[type="checkbox"] {
  margin: 0.15rem 0 0;
  align-self: flex-start;
  accent-color: var(--primary);
}
.cw-title-input {
  width: 100%; padding: 0.4rem 0.55rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg, #fff); color: var(--text); font-size: 0.84rem;
}
.cw-title-color-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.cw-title-color { width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 6px; padding: 0; background: transparent; }
.cw-title-hex { flex: 1; min-width: 120px; }
.cw-title-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.85rem 0 0.55rem; }
.cw-title-switch {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.55rem;
}
.cw-title-switch input { accent-color: var(--primary); }
.cw-title-html {
  margin: 0; padding: 0.65rem 0.75rem; border-radius: 8px;
  background: color-mix(in srgb, var(--surface2) 70%, #0f172a);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.68rem; line-height: 1.45; white-space: pre-wrap; word-break: break-all; max-height: 140px; overflow: auto;
}
@media (max-width: 980px) {
  .cw-title-layout { grid-template-columns: 1fr; }
  .cw-title-col--list { max-height: none; }
  .cw-title-col--panel { position: static; max-height: none; }
}

/* ?????????????button ????????? */
.cw-img-style {
  --cw-gap: 4px;
  --cw-img-shadow: none;
  display: grid;
  gap: var(--cw-gap);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  min-height: 72px;
  overflow: visible;
}
.cw-img-style .cw-img-slot {
  box-shadow: var(--cw-img-shadow);
}
.cw-img-style.is-placeholder .cw-img-slot {
  background: #d8dde4;
  border: 1.5px dashed #8b93a0;
  color: #6b7280;
}
.cw-img-slot {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; min-width: 0;
  background: #cfd5de;
  border: 0;
  padding: 0;
  cursor: default;
  color: #64748b;
  font-size: 0.75rem;
  box-sizing: border-box;
}
/* 选中图片后右上角裁剪图标（浮于图片之上）
 * 保持 overflow:hidden，否则半圆/圆角等裁切在选中态会失效 */
.cw-img-slot.is-slot-selected {
  z-index: 3;
  outline: 2px solid rgba(14, 165, 233, 0.55);
  outline-offset: 1px;
}
/* 旧版槽位浮层裁剪已并入 .cw-block-chrome，隐藏残留节点 */
.cw-img-crop-btn {
  display: none !important;
}

/* 图片裁剪工具弹窗 */
.img-crop-tool {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  box-sizing: border-box;
}
.img-crop-tool.hidden { display: none !important; }
.img-crop-tool-box {
  width: min(720px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--card-solid, #fff);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
}
.img-crop-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.img-crop-tool-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
}
.img-crop-tool-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.img-crop-tool-close:hover { background: var(--surface2, #f1f5f9); }
.img-crop-tool-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.img-crop-tool-stage {
  position: relative;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  background: #0f172a;
  border-radius: 8px;
  overflow: visible;
}
.img-crop-tool-img {
  display: block;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.img-crop-tool-box-sel {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  cursor: move;
  touch-action: none;
}
.img-crop-tool-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #0ea5e9;
  border-radius: 2px;
  box-sizing: border-box;
}
.img-crop-tool-handle[data-handle="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.img-crop-tool-handle[data-handle="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.img-crop-tool-handle[data-handle="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.img-crop-tool-handle[data-handle="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.img-crop-tool-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}
.img-crop-tool-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
}
/* 样式库 / 图片样式管理页：占位槽跟随系统主题（手机白底预览区仍用上方浅色） */
.cw-editor-side .cw-img-slot,
.cw-styles-page .cw-img-slot,
.cw-styles-card-preview .cw-img-slot {
  background: color-mix(in srgb, var(--surface2) 72%, var(--border));
  color: var(--text-muted);
}
.cw-editor-side .cw-img-style.is-placeholder .cw-img-slot,
.cw-styles-page .cw-img-style.is-placeholder .cw-img-slot,
.cw-styles-card-preview .cw-img-style.is-placeholder .cw-img-slot {
  background: color-mix(in srgb, var(--surface2) 58%, var(--border));
  border: 1.5px dashed color-mix(in srgb, var(--text-muted) 42%, var(--border));
  color: var(--text-muted);
}
.cw-editor-side .cw-img-style--single-polaroid,
.cw-styles-page .cw-img-style--single-polaroid,
.cw-styles-card-preview .cw-img-style--single-polaroid {
  background: var(--surface);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 10%, transparent);
}
button.cw-img-slot {
  cursor: pointer;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 40px;
  align-self: stretch;
  justify-self: stretch;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}
.cw-img-slot-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none;
}
.cw-img-slot-label { pointer-events: none; }
/* ???????????????????? */
.cw-img-slot--circle {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto !important;
  max-width: 100%;
  max-height: none;
  align-self: center;
  justify-self: center;
  box-sizing: border-box;
}
.cw-img-slot--rect-round { border-radius: 18px; }
.cw-img-slot--soft-round { border-radius: 28px; }
.cw-img-slot--arch { border-radius: 50% 50% 14px 14px; }
.cw-img-slot--capsule { border-radius: 999px; }
.cw-img-slot--half-left { border-radius: 999px 0 0 999px; }
.cw-img-slot--half-right { border-radius: 0 999px 999px 0; }
.cw-img-slot--half-top { border-radius: 999px 999px 0 0; }
.cw-img-slot--half-bottom { border-radius: 0 0 999px 999px; }

.cw-img-style--single-adaptive { grid-template-columns: 1fr; }
/* 空槽占位：临时 16:10；有图后改由原图比例撑开 */
.cw-img-style--single-adaptive .cw-img-slot.is-empty,
.cw-img-style--single-adaptive .cw-img-slot:not(.has-image) {
  aspect-ratio: 16 / 10;
}
/*
 * 编辑器自适应有图：宽 100%、高度随原图（对齐小程序 widthFix）。
 * 必须覆盖 button.cw-img-slot{height:100%} 与 .lazy-img-wrap{position:absolute;inset:0}，
 * 否则绝对定位子元素不占流，槽位塌成一条扁带。
 */
.cw-img-style--single-adaptive .cw-img-slot.has-image,
.cw-img-style--adaptive-flow .cw-img-slot.has-image,
.cw-img-style--single-adaptive button.cw-img-slot.has-image,
.cw-img-style--adaptive-flow button.cw-img-slot.has-image {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: start;
  display: block;
  width: 100%;
  overflow: hidden;
}
.cw-img-style--single-adaptive .cw-img-slot.has-image .lazy-img-wrap,
.cw-img-style--adaptive-flow .cw-img-slot.has-image .lazy-img-wrap {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}
.cw-img-style--single-adaptive .cw-img-slot.has-image .cw-img-slot-img,
.cw-img-style--single-adaptive .cw-img-slot.has-image .lazy-img-wrap > img.lazy-load-img,
.cw-img-style--adaptive-flow .cw-img-slot.has-image .cw-img-slot-img,
.cw-img-style--adaptive-flow .cw-img-slot.has-image .lazy-img-wrap > img,
.cw-img-slot-img--adaptive {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  opacity: 1 !important;
  pointer-events: none;
}
.cw-img-adaptive,
.cw-img-adaptive > div {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.cw-img-adaptive-img,
.cw-img-adaptive img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}
.cw-img-style--single-portrait,
.cw-img-style--single-portrait-round { grid-template-columns: 1fr; max-width: 160px; }
.cw-img-style--single-portrait .cw-img-slot,
.cw-img-style--single-portrait-round .cw-img-slot { aspect-ratio: 3 / 4; }
.cw-img-style--single-portrait-round .cw-img-slot { border-radius: 18px; }

.cw-img-style--dual-half-circle,
.cw-img-style--dual-rect,
.cw-img-style--dual-rect-round,
.cw-img-style--dual-aligned,
.cw-img-style--dual-stagger-left,
.cw-img-style--dual-stagger-right {
  grid-template-columns: 1fr 1fr;
}
.cw-img-style--dual-half-circle {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  border-radius: 50%;
  overflow: hidden;
  gap: var(--cw-gap, 4px);
  aspect-ratio: 1 / 1;
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--dual-half-circle .cw-img-slot {
  aspect-ratio: auto;
  height: 100%;
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--dual-half-circle .cw-img-slot:nth-child(1) {
  border-radius: 999px 0 0 999px;
}
.cw-img-style--dual-half-circle .cw-img-slot:nth-child(2) {
  border-radius: 0 999px 999px 0;
}
.cw-img-style--dual-rect .cw-img-slot,
.cw-img-style--dual-aligned .cw-img-slot { aspect-ratio: 3 / 4; }
.cw-img-style--dual-rect-round .cw-img-slot { aspect-ratio: 3 / 4; border-radius: 18px; }
.cw-img-style--dual-stagger-left .cw-img-slot:nth-child(1) { transform: translateY(-10px); aspect-ratio: 3 / 4; }
.cw-img-style--dual-stagger-left .cw-img-slot:nth-child(2) { transform: translateY(10px); aspect-ratio: 3 / 4; }
.cw-img-style--dual-stagger-right .cw-img-slot:nth-child(1) { transform: translateY(10px); aspect-ratio: 3 / 4; }
.cw-img-style--dual-stagger-right .cw-img-slot:nth-child(2) { transform: translateY(-10px); aspect-ratio: 3 / 4; }

.cw-img-style--tri-left-stack,
.cw-img-style--tri-left-stack-b {
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--tri-left-stack .cw-img-slot:nth-child(1),
.cw-img-style--tri-left-stack-b .cw-img-slot:nth-child(1) {
  grid-row: 1 / span 2;
}

/* ???????? ? ?????? */
.cw-img-style--tri-left-circle {
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-rows: 1.2fr 0.8fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--tri-left-circle .cw-img-slot:nth-child(1) { grid-row: 1 / span 2; }
.cw-img-style--tri-left-circle .cw-img-slot:nth-child(2) {
  aspect-ratio: 1 / 1;
  width: 94%;
  max-width: 94%;
  height: auto !important;
  max-height: none;
  align-self: center;
  justify-self: center;
}

.cw-img-style--tri-left-sq-circle {
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-rows: 0.8fr 1.2fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--tri-left-sq-circle .cw-img-slot:nth-child(1) { grid-row: 1 / span 2; }
.cw-img-style--tri-left-sq-circle .cw-img-slot:nth-child(3) {
  aspect-ratio: 1 / 1;
  width: 94%;
  max-width: 94%;
  height: auto !important;
  max-height: none;
  align-self: center;
  justify-self: center;
}

.cw-img-style--tri-right-stack,
.cw-img-style--tri-right-stack-b {
  grid-template-columns: 0.85fr 1.15fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--tri-right-stack .cw-img-slot:nth-child(1),
.cw-img-style--tri-right-stack-b .cw-img-slot:nth-child(1) {
  grid-column: 1; grid-row: 1;
}
.cw-img-style--tri-right-stack .cw-img-slot:nth-child(2),
.cw-img-style--tri-right-stack-b .cw-img-slot:nth-child(2) {
  grid-column: 1; grid-row: 2;
}
.cw-img-style--tri-right-stack .cw-img-slot:nth-child(3),
.cw-img-style--tri-right-stack-b .cw-img-slot:nth-child(3) {
  grid-column: 2; grid-row: 1 / span 2;
}

.cw-img-style--tri-right-circle {
  grid-template-columns: 0.95fr 1.05fr;
  grid-template-rows: 1.2fr 0.8fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--tri-right-circle .cw-img-slot:nth-child(1) {
  grid-column: 1; grid-row: 1;
  aspect-ratio: 1 / 1;
  width: 94%;
  max-width: 94%;
  height: auto !important;
  max-height: none;
  align-self: center;
  justify-self: center;
}
.cw-img-style--tri-right-circle .cw-img-slot:nth-child(2) { grid-column: 1; grid-row: 2; min-height: 0; }
.cw-img-style--tri-right-circle .cw-img-slot:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }

.cw-img-style--tri-top2-landscape {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.15fr 0.85fr;
  aspect-ratio: 5 / 4;
}
.cw-img-style--tri-top2-landscape .cw-img-slot:nth-child(3) { grid-column: 1 / span 2; }

.cw-img-style--tri-landscape-bot2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 0.85fr 1.15fr;
  aspect-ratio: 5 / 4;
}
.cw-img-style--tri-landscape-bot2 .cw-img-slot:nth-child(1) { grid-column: 1 / span 2; }

.cw-img-style--tri-circle-land-top,
.cw-img-style--tri-circle-land-bot {
  aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  gap: var(--cw-gap, 4px);
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--tri-circle-land-top .cw-img-slot,
.cw-img-style--tri-circle-land-bot .cw-img-slot {
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--tri-circle-land-top .cw-img-slot:nth-child(1) { grid-column: 1 / span 2; }
.cw-img-style--tri-circle-land-bot .cw-img-slot:nth-child(3) { grid-column: 1 / span 2; }

.cw-img-style--tri-row {
  grid-template-columns: repeat(3, 1fr);
}
.cw-img-style--tri-row .cw-img-slot { aspect-ratio: 3 / 4; }

.cw-img-style--quad-left1-right3 {
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: repeat(3, 1fr);
  aspect-ratio: 4 / 5;
}
.cw-img-style--quad-left1-right3 .cw-img-slot:nth-child(1) { grid-row: 1 / span 3; }

.cw-img-style--quad-left3-right1 {
  grid-template-columns: 0.8fr 1.2fr;
  grid-template-rows: repeat(3, 1fr);
  aspect-ratio: 4 / 5;
}
.cw-img-style--quad-left3-right1 .cw-img-slot:nth-child(1) { grid-column: 1; grid-row: 1; }
.cw-img-style--quad-left3-right1 .cw-img-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.cw-img-style--quad-left3-right1 .cw-img-slot:nth-child(3) { grid-column: 1; grid-row: 3; }
.cw-img-style--quad-left3-right1 .cw-img-slot:nth-child(4) {
  grid-column: 2; grid-row: 1 / span 3;
}

.cw-img-style--quad-2x2,
.cw-img-style--quad-circle-mask,
.cw-img-style--quad-diag-round-a,
.cw-img-style--quad-diag-round-b,
.cw-img-style--quad-circle-br,
.cw-img-style--quad-circle-tl,
.cw-img-style--quad-circle-tr,
.cw-img-style--quad-circle-bl,
.cw-img-style--quad-circle-diag,
.cw-img-style--quad-circle-adiag,
.cw-img-style--quad-clover {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1.05;
}
.cw-img-style--quad-circle-mask,
.cw-img-style--tri-circle-land-top,
.cw-img-style--tri-circle-land-bot {
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--quad-circle-mask {
  border-radius: 50%;
  overflow: hidden;
  gap: var(--cw-gap, 4px);
}
.cw-img-style--quad-circle-mask .cw-img-slot {
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--quad-diag-round-a .cw-img-slot:nth-child(2) { border-top-right-radius: 28px; }
.cw-img-style--quad-diag-round-a .cw-img-slot:nth-child(3) { border-bottom-left-radius: 28px; }
.cw-img-style--quad-diag-round-b .cw-img-slot:nth-child(1) { border-top-left-radius: 28px; }
.cw-img-style--quad-diag-round-b .cw-img-slot:nth-child(4) { border-bottom-right-radius: 28px; }
.cw-img-style--quad-clover .cw-img-slot:nth-child(1) { border-radius: 0 42% 42% 42%; }
.cw-img-style--quad-clover .cw-img-slot:nth-child(2) { border-radius: 42% 0 42% 42%; }
.cw-img-style--quad-clover .cw-img-slot:nth-child(3) { border-radius: 42% 42% 42% 0; }
.cw-img-style--quad-clover .cw-img-slot:nth-child(4) { border-radius: 42% 42% 0 42%; }

.cw-img-style-mask--circle { border-radius: 50%; overflow: hidden; }

/* ???? */
/* 单圆图：直径占满内容宽（与小程序一致） */
.cw-img-style--single-circle {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
}
.cw-img-style--single-circle .cw-img-slot {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 100%;
}

/* 大圆角：外框高=宽/2 */
.cw-img-style--single-soft-round {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 2 / 1;
  box-sizing: border-box;
}
.cw-img-style--single-soft-round .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 28px;
  min-height: 0;
}

.cw-img-style--single-arch { grid-template-columns: 1fr; max-width: 180px; }
.cw-img-style--single-arch .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 50% 50% 14px 14px;
  background: transparent;
}

.cw-img-style--single-capsule { grid-template-columns: 1fr; max-width: 140px; }
.cw-img-style--single-capsule .cw-img-slot { aspect-ratio: 1 / 1.85; border-radius: 999px; }

.cw-img-style--single-polaroid {
  grid-template-columns: 1fr;
  max-width: 200px;
  background: #fff;
  padding: 10px 10px 28px;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  gap: 0;
}
.cw-img-style--single-polaroid .cw-img-slot { aspect-ratio: 1 / 1; border-radius: 2px; }

.cw-img-style--dual-circles {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 2.05 / 1;
  align-items: center;
}
.cw-img-style--dual-circles .cw-img-slot {
  aspect-ratio: 1 / 1;
  height: auto !important;
  width: 100% !important;
}

.cw-img-style--dual-circle-left,
.cw-img-style--dual-circle-right {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 1.05 / 1;
  align-items: stretch;
}
.cw-img-style--dual-circle-left .cw-img-slot,
.cw-img-style--dual-circle-right .cw-img-slot {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  align-self: stretch !important;
  justify-self: stretch !important;
}
.cw-img-style--dual-circle-left .cw-img-slot:nth-child(1),
.cw-img-style--dual-circle-right .cw-img-slot:nth-child(2) {
  border-radius: 50%;
}
.cw-img-style--dual-circle-left .cw-img-slot:nth-child(2),
.cw-img-style--dual-circle-right .cw-img-slot:nth-child(1) {
  border-radius: 18px;
}

.cw-img-style--dual-landscape {
  grid-template-columns: 1fr;
  gap: 8px;
}
.cw-img-style--dual-landscape .cw-img-slot { aspect-ratio: 16 / 9; border-radius: 14px; }

/* —— 追加双图样式（外框 1:1）；单图横图/半圆外框高=宽/2 —— */
.cw-img-style--dual-stack-flat,
.cw-img-style--dual-stagger-top,
.cw-img-style--dual-stagger-bottom,
.cw-img-style--dual-half-tb {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}

/* 横图 / 上半圆 / 下半圆：外框高 = 宽/2 */
.cw-img-style--single-landscape-12,
.cw-img-style--single-half-top,
.cw-img-style--single-half-bottom {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  aspect-ratio: 2 / 1;
  box-sizing: border-box;
  grid-template-columns: 1fr;
}

.cw-img-style--single-landscape-12 .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  min-height: 0;
}

.cw-img-style--single-half-top .cw-img-slot,
.cw-img-style--single-half-bottom .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  min-height: 0;
  overflow: hidden;
}
.cw-img-style--single-half-top .cw-img-slot {
  border-radius: 999px 999px 0 0;
}
.cw-img-style--single-half-bottom .cw-img-slot {
  border-radius: 0 0 999px 999px;
}

/* 双横并排：上下两张、直角、外框总高=总宽 */
.cw-img-style--dual-stack-flat {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--cw-gap, 4px);
}
.cw-img-style--dual-stack-flat .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  min-height: 0;
}

/* 上错落 / 下错落：上下横图 + 水平镜像错位；纵向偏移同量，避免一边拉开一边重叠 */
.cw-img-style--dual-stagger-top,
.cw-img-style--dual-stagger-bottom {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--cw-gap, 4px);
  overflow: visible;
}
.cw-img-style--dual-stagger-top .cw-img-slot,
.cw-img-style--dual-stagger-bottom .cw-img-slot {
  width: 88%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  min-height: 0;
}
/* 上错落：左上 / 右下 */
.cw-img-style--dual-stagger-top .cw-img-slot:nth-child(1) {
  justify-self: start;
  transform: translateY(6px);
}
.cw-img-style--dual-stagger-top .cw-img-slot:nth-child(2) {
  justify-self: end;
  transform: translateY(-6px);
}
/* 下错落：右上 / 左下（仅水平镜像，纵向同量） */
.cw-img-style--dual-stagger-bottom .cw-img-slot:nth-child(1) {
  justify-self: end;
  transform: translateY(6px);
}
.cw-img-style--dual-stagger-bottom .cw-img-slot:nth-child(2) {
  justify-self: start;
  transform: translateY(-6px);
}

/* 上下半圆：整圆外框上下对切（对齐半圆对切） */
.cw-img-style--dual-half-tb {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  border-radius: 50%;
  overflow: hidden;
  gap: var(--cw-gap, 4px);
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--dual-half-tb .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  min-height: 0;
  box-shadow: var(--cw-img-shadow, none);
}
.cw-img-style--dual-half-tb .cw-img-slot:nth-child(1) {
  border-radius: 999px 999px 0 0;
}
.cw-img-style--dual-half-tb .cw-img-slot:nth-child(2) {
  border-radius: 0 0 999px 999px;
}

.cw-img-style--dual-soft-stack {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 1.2 / 1;
  padding: 8px 4px;
}
.cw-img-style--dual-soft-stack .cw-img-slot { aspect-ratio: 3 / 4; border-radius: 22px; }
.cw-img-style--dual-soft-stack .cw-img-slot:nth-child(1) { transform: translate(6px, -8px) rotate(-3deg); }
.cw-img-style--dual-soft-stack .cw-img-slot:nth-child(2) { transform: translate(-6px, 8px) rotate(3deg); }

.cw-img-style--tri-circles-row {
  grid-template-columns: repeat(3, 1fr);
  aspect-ratio: auto;
  align-items: center;
}
.cw-img-style--tri-circles-row .cw-img-slot {
  aspect-ratio: 1 / 1;
  height: auto !important;
  width: 100% !important;
}

.cw-img-style--tri-pyramid-circles {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  aspect-ratio: auto;
  gap: var(--cw-gap, 4px);
}
.cw-img-style--tri-pyramid-circles .cw-img-slot {
  aspect-ratio: 1 / 1;
  width: 92% !important;
  height: auto !important;
  align-self: center;
  justify-self: center;
}
.cw-img-style--tri-pyramid-circles .cw-img-slot:nth-child(1) {
  grid-column: 1 / span 2;
  width: 56% !important;
}

.cw-img-style--tri-inv-pyramid {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  justify-items: center;
  align-items: center;
  aspect-ratio: auto;
  gap: var(--cw-gap, 4px);
}
.cw-img-style--tri-inv-pyramid .cw-img-slot {
  aspect-ratio: 1 / 1;
  width: 92% !important;
  height: auto !important;
  align-self: center;
  justify-self: center;
}
.cw-img-style--tri-inv-pyramid .cw-img-slot:nth-child(3) {
  grid-column: 1 / span 2;
  width: 56% !important;
}

.cw-img-style--tri-soft-row {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cw-img-style--tri-soft-row .cw-img-slot { aspect-ratio: 3 / 4; border-radius: 22px; }

.cw-img-style--tri-magazine-l {
  grid-template-columns: 1.2fr 0.9fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1.05 / 1;
  gap: 8px;
}
.cw-img-style--tri-magazine-l .cw-img-slot { border-radius: 14px; min-height: 48px; }
.cw-img-style--tri-magazine-l .cw-img-slot:nth-child(1) { grid-row: 1 / span 2; }
.cw-img-style--tri-magazine-l .cw-img-slot:nth-child(2),
.cw-img-style--tri-magazine-l .cw-img-slot:nth-child(3) { min-height: 48px; }

.cw-img-style--tri-center-circle {
  grid-template-columns: 0.9fr 1.15fr 0.9fr;
  align-items: stretch;
  aspect-ratio: 1.35 / 1;
}
.cw-img-style--tri-center-circle .cw-img-slot:nth-child(1),
.cw-img-style--tri-center-circle .cw-img-slot:nth-child(3) {
  aspect-ratio: auto !important;
  border-radius: 14px;
  height: 100% !important;
  width: 100% !important;
  z-index: 1;
}
.cw-img-style--tri-center-circle .cw-img-slot:nth-child(2) {
  aspect-ratio: auto !important;
  border-radius: 50%;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  transform: scale(1.08);
}

.cw-img-style--tri-arch-sides {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cw-img-style--tri-arch-sides .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 50% 50% 12px 12px;
}

.cw-img-style--quad-window {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: max(10px, var(--cw-gap, 4px));
  aspect-ratio: auto;
  align-items: center;
  justify-items: center;
}
.cw-img-style--quad-window .cw-img-slot {
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  align-self: center !important;
  justify-self: center !important;
}

.cw-img-style--quad-filmstrip {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  aspect-ratio: auto;
  padding: 10px 8px;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.cw-img-style--quad-filmstrip .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  height: auto !important;
  width: 100% !important;
}

.cw-img-style--penta-mosaic {
  grid-template-columns: 1.25fr 0.85fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  aspect-ratio: 1.15 / 1;
}
.cw-img-style--penta-mosaic .cw-img-slot { border-radius: 12px; }
.cw-img-style--penta-mosaic .cw-img-slot:nth-child(1) { grid-row: 1 / span 2; }

.cw-img-style--penta-top-wide {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1.15fr 0.95fr;
  gap: 6px;
  aspect-ratio: 1.25 / 1;
}
.cw-img-style--penta-top-wide .cw-img-slot { border-radius: 12px; }
.cw-img-style--penta-top-wide .cw-img-slot:nth-child(1) { grid-column: 1 / span 4; }

/* —— 秀米常见版式参考：自研扩展 —— */
.cw-img-style--single-frame,
.cw-img-style--single-frame-thick,
.cw-img-style--single-card {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
}
.cw-img-style--single-frame {
  padding: 6px;
  border: 1px solid #cbd5e1;
  gap: 0;
}
.cw-img-style--single-frame-thick {
  padding: 14px;
  border: 6px solid #334155;
  gap: 0;
}
.cw-img-style--single-card {
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  gap: 0;
}
.cw-img-style--single-frame .cw-img-slot,
.cw-img-style--single-frame-thick .cw-img-slot {
  aspect-ratio: 16 / 10;
  border-radius: 0;
}
.cw-img-style--single-card .cw-img-slot {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
}

.cw-img-style--single-square,
.cw-img-style--single-square-round {
  grid-template-columns: 1fr;
  max-width: 280px;
  width: 100%;
}
.cw-img-style--single-square .cw-img-slot,
.cw-img-style--single-square-round .cw-img-slot {
  aspect-ratio: 1 / 1;
}
.cw-img-style--single-square-round .cw-img-slot { border-radius: 18px; }

.cw-img-style--single-landscape-round {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}
.cw-img-style--single-landscape-round .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 16px;
  min-height: 0;
}

.cw-img-style--dual-seamless {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  aspect-ratio: 1 / 1;
  width: 100%;
}
.cw-img-style--dual-seamless .cw-img-slot {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  min-height: 0;
}

.cw-img-style--dual-side-land {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  aspect-ratio: 2.05 / 1;
}
.cw-img-style--dual-side-land .cw-img-slot {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 12px;
  min-height: 0;
}

.cw-img-style--dual-overlap {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 1.15 / 1;
  padding: 12px 8px;
  overflow: visible;
}
.cw-img-style--dual-overlap .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 22px;
}
.cw-img-style--dual-overlap .cw-img-slot:nth-child(1) {
  transform: translate(14px, 6px) rotate(-4deg);
  z-index: 1;
}
.cw-img-style--dual-overlap .cw-img-slot:nth-child(2) {
  transform: translate(-14px, -6px) rotate(5deg);
  z-index: 2;
}

.cw-img-style--dual-arch {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.cw-img-style--dual-arch .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 50% 50% 14px 14px;
}

.cw-img-style--dual-frame {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}
.cw-img-style--dual-frame .cw-img-slot {
  aspect-ratio: 3 / 4;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.cw-img-style--dual-capsules {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.cw-img-style--dual-capsules .cw-img-slot {
  aspect-ratio: 1 / 1.85;
  border-radius: 999px;
}

.cw-img-style--tri-equal-land {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  aspect-ratio: 2.4 / 1;
}
.cw-img-style--tri-equal-land .cw-img-slot {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 12px;
  min-height: 0;
}

.cw-img-style--tri-seamless {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  aspect-ratio: 1.35 / 1;
}
.cw-img-style--tri-seamless .cw-img-slot {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
  min-height: 0;
}

.cw-img-style--tri-capsules {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.cw-img-style--tri-capsules .cw-img-slot {
  aspect-ratio: 1 / 1.85;
  border-radius: 999px;
}

.cw-img-style--tri-frames {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}
.cw-img-style--tri-frames .cw-img-slot {
  aspect-ratio: 3 / 4;
  border: 1px solid #cbd5e1;
  box-sizing: border-box;
}

.cw-img-style--tri-stack-land {
  grid-template-columns: 1fr;
  gap: 8px;
}
.cw-img-style--tri-stack-land .cw-img-slot {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
}

.cw-img-style--quad-row {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  aspect-ratio: auto;
}
.cw-img-style--quad-row .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  height: auto !important;
  width: 100% !important;
}

.cw-img-style--quad-seamless {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  aspect-ratio: 1 / 1;
}
.cw-img-style--quad-seamless .cw-img-slot {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
  min-height: 0;
}

.cw-img-style--quad-top1-bot3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1.2fr 0.95fr;
  gap: 6px;
  aspect-ratio: 1.2 / 1;
}
.cw-img-style--quad-top1-bot3 .cw-img-slot { border-radius: 12px; min-height: 0; }
.cw-img-style--quad-top1-bot3 .cw-img-slot:nth-child(1) { grid-column: 1 / span 3; }

.cw-img-style--quad-top3-bot1 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 0.95fr 1.2fr;
  gap: 6px;
  aspect-ratio: 1.2 / 1;
}
.cw-img-style--quad-top3-bot1 .cw-img-slot { border-radius: 12px; min-height: 0; }
.cw-img-style--quad-top3-bot1 .cw-img-slot:nth-child(4) { grid-column: 1 / span 3; }

.cw-img-style--penta-film {
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 10px 8px;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}
.cw-img-style--penta-film .cw-img-slot {
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  height: auto !important;
  width: 100% !important;
}

.cw-img-style--penta-bot-wide {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 0.95fr 1.15fr;
  gap: 6px;
  aspect-ratio: 1.25 / 1;
}
.cw-img-style--penta-bot-wide .cw-img-slot { border-radius: 12px; }
.cw-img-style--penta-bot-wide .cw-img-slot:nth-child(5) { grid-column: 1 / span 4; }

.cw-img-style--penta-cross {
  grid-template-columns: 1fr 1.15fr 1fr;
  grid-template-rows: 0.85fr 1.2fr 0.85fr;
  gap: 6px;
  aspect-ratio: 1 / 1.05;
}
.cw-img-style--penta-cross .cw-img-slot { border-radius: 12px; min-height: 0; }
.cw-img-style--penta-cross .cw-img-slot:nth-child(1) { grid-column: 1 / span 3; }
.cw-img-style--penta-cross .cw-img-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.cw-img-style--penta-cross .cw-img-slot:nth-child(3) { grid-column: 2; grid-row: 2; }
.cw-img-style--penta-cross .cw-img-slot:nth-child(4) { grid-column: 3; grid-row: 2; }
.cw-img-style--penta-cross .cw-img-slot:nth-child(5) { grid-column: 1 / span 3; grid-row: 3; }

/* 合图：多图收进同一外框。缝 3px、槽位圆角 2px，比例不用三等分百分比 */
.cw-img-style--plate-bands,
.cw-img-style--plate-banner-pair,
.cw-img-style--plate-banner-trio,
.cw-img-style--plate-quad,
.cw-img-style--plate-thirds,
.cw-img-style--plate-six,
.cw-img-style--plate-hero,
.cw-img-style--plate-shift {
  gap: 3px;
  overflow: hidden;
  border-radius: 6px;
  min-height: 0;
}
.cw-img-style--plate-bands .cw-img-slot,
.cw-img-style--plate-banner-pair .cw-img-slot,
.cw-img-style--plate-banner-trio .cw-img-slot,
.cw-img-style--plate-quad .cw-img-slot,
.cw-img-style--plate-thirds .cw-img-slot,
.cw-img-style--plate-six .cw-img-slot,
.cw-img-style--plate-hero .cw-img-slot,
.cw-img-style--plate-shift .cw-img-slot {
  border-radius: 2px;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
}
.cw-img-style--plate-bands {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--plate-banner-pair {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 3fr 2fr;
  aspect-ratio: 5 / 4;
}
.cw-img-style--plate-banner-pair .cw-img-slot:nth-child(1) { grid-column: 1 / span 2; }
.cw-img-style--plate-banner-trio {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 8fr 5fr;
  aspect-ratio: 6 / 5;
}
.cw-img-style--plate-banner-trio .cw-img-slot:nth-child(1) { grid-column: 1 / span 3; }
.cw-img-style--plate-quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--plate-thirds {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  aspect-ratio: 3 / 4;
}
.cw-img-style--plate-six {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 3 / 2;
}
.cw-img-style--plate-hero {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 2.4fr 1fr;
  aspect-ratio: 1 / 1;
}
.cw-img-style--plate-hero .cw-img-slot:nth-child(4) { grid-column: 1 / span 3; }
.cw-img-style--plate-shift {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 5fr 7fr 5fr;
  aspect-ratio: 5 / 4;
}
.cw-img-style--plate-shift .cw-img-slot:nth-child(1) { grid-column: 1 / span 2; grid-row: 1; }
.cw-img-style--plate-shift .cw-img-slot:nth-child(2) { grid-column: 3 / span 3; grid-row: 1; }
.cw-img-style--plate-shift .cw-img-slot:nth-child(3) { grid-column: 1 / span 5; grid-row: 2; }
.cw-img-style--plate-shift .cw-img-slot:nth-child(4) { grid-column: 1 / span 3; grid-row: 3; }
.cw-img-style--plate-shift .cw-img-slot:nth-child(5) { grid-column: 4 / span 2; grid-row: 3; }

.cw-editor-side .cw-img-style--single-frame,
.cw-styles-page .cw-img-style--single-frame,
.cw-styles-card-preview .cw-img-style--single-frame,
.cw-editor-side .cw-img-style--single-frame-thick,
.cw-styles-page .cw-img-style--single-frame-thick,
.cw-styles-card-preview .cw-img-style--single-frame-thick,
.cw-editor-side .cw-img-style--single-card,
.cw-styles-page .cw-img-style--single-card,
.cw-styles-card-preview .cw-img-style--single-card,
.cw-editor-side .cw-img-style--dual-frame,
.cw-styles-page .cw-img-style--dual-frame,
.cw-styles-card-preview .cw-img-style--dual-frame,
.cw-editor-side .cw-img-style--tri-frames,
.cw-styles-page .cw-img-style--tri-frames,
.cw-styles-card-preview .cw-img-style--tri-frames {
  background: var(--surface);
  border-color: var(--border);
}

/* H5 文案编辑：占满 page-content，避免外层再出纵向滚动条 */
.page-content:has(.cw-editor-page) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.cw-editor-page {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cw-editor-shell {
  display: grid;
  /* 活动分类+组件 | 预览 | 文案设置 | 组件样式参数 */
  grid-template-columns: max-content minmax(0, 1fr) minmax(240px, 280px) minmax(240px, 280px);
  gap: 0.55rem;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}
.cw-editor-shell.cw-meta-collapsed {
  grid-template-columns: max-content minmax(0, 1fr) 28px minmax(240px, 280px);
}
.cw-editor-meta-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}
.cw-editor-meta-wrap .cw-editor-meta {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.cw-editor-meta-wrap.is-collapsed .cw-editor-meta,
.cw-editor-meta.is-collapsed {
  display: none !important;
}
.cw-meta-collapse-btn {
  flex: 0 0 28px;
  width: 28px;
  align-self: stretch;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 35%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary, #2563eb) 12%, var(--surface));
  color: var(--primary, #2563eb);
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  z-index: 2;
  text-shadow: 0 0 0.5px currentColor;
}
.cw-meta-collapse-btn:hover {
  color: #fff;
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
}
.cw-editor-group--nav,
.cw-editor-rail,
.cw-editor-cats,
.cw-editor-meta,
.cw-editor-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem;
}
.cw-editor-group--nav,
.cw-editor-meta,
.cw-editor-side {
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
.cw-editor-group--nav {
  display: flex;
  flex-direction: row;
  gap: 0.55rem;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
}
.cw-editor-group--nav .cw-editor-cats,
.cw-editor-group--nav .cw-editor-rail {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.cw-editor-group--nav .cw-editor-cats {
  width: 112px;
  flex: 0 0 112px;
  border-right: 1px solid var(--border);
  padding-right: 0.55rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.cw-editor-group--nav .cw-editor-rail {
  width: 120px;
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.cw-editor-rail { display: flex; flex-direction: column; gap: 0.55rem; }
.cw-editor-meta,
.cw-editor-side {
  min-width: 0;
  overflow: auto;
}
.cw-editor-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.25rem;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
/* 预览区浮动操作条（正文/标题/图片参数） */
.cw-float-toolbar {
  position: absolute;
  z-index: 45;
  left: 12px;
  top: 12px;
  min-width: 220px;
  max-width: min(360px, calc(100% - 16px));
  max-height: min(70%, calc(100% - 16px));
  overflow: auto;
  box-sizing: border-box;
  padding: 0.35rem 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface, #fff) 96%, transparent);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}
/* 主菜单定宽：按最宽子菜单锁定，展开子菜单时主栏不再被撑宽 */
.cw-float-toolbar--para {
  width: 300px;
  min-width: 300px;
  max-width: min(300px, calc(100% - 16px));
}
.cw-float-toolbar--title {
  width: 320px;
  min-width: 320px;
  max-width: min(320px, calc(100% - 16px));
}
.cw-float-toolbar--image {
  width: 280px;
  min-width: 280px;
  max-width: min(280px, calc(100% - 16px));
}
.cw-float-toolbar.is-hidden {
  display: none !important;
}
.cw-float-toolbar-drag {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: move;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
  padding: 0.15rem 0.2rem 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  margin-bottom: 0.35rem;
}
.cw-float-toolbar-body {
  width: 100%;
  box-sizing: border-box;
}
.cw-float-toolbar-body .cw-para-bar,
.cw-float-toolbar-body .cw-float-menu-bar {
  width: 100%;
  flex-wrap: nowrap;
  box-sizing: border-box;
}
.cw-float-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.55rem 0.15rem;
  cursor: pointer;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}
.cw-float-tab:last-child { border-right: 0; }
.cw-float-tab.active,
.cw-float-tab:hover:not(:disabled) { background: #2f3642; }
.cw-float-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cw-float-hint {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.cw-float-pop {
  margin-top: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}
.cw-float-pop .cw-side-bg-tune {
  max-height: 42vh;
  overflow: auto;
}
.cw-editor-stage .cw-iphone--editor {
  flex-shrink: 1;
  height: auto;
  max-height: min(100%, 848px);
  width: min(395px, 100%);
  min-height: 0;
  align-self: center;
  /* 高度不足时按比例缩小宽度，保持 iPhone X 外形 */
  aspect-ratio: 395 / 848;
}
.cw-editor-rail-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.cw-editor-rail-group--hist {
  flex-direction: row;
  gap: 0.3rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.cw-editor-rail-group--tools {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.cw-editor-hist {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
  border-radius: 8px;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  color: #334155;
}
.cw-editor-hist:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.cw-editor-hist:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.cw-editor-hist-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.cw-editor-cats {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.cw-editor-cats > .cw-editor-rail-title,
.cw-editor-cats > .cw-editor-rail-tip {
  flex: 0 0 auto;
}
.cw-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 2px;
}
.cw-cat-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, var(--primary) 6%);
  padding: 0.35rem;
  cursor: pointer;
  text-align: center;
}
.cw-cat-card:hover { border-color: var(--primary); }
.cw-cat-card:disabled,
.cw-cat-card.is-locked {
  cursor: not-allowed;
  opacity: 0.55;
}
.cw-cat-card:disabled:hover,
.cw-cat-card.is-locked:hover {
  border-color: var(--border);
}
.cw-cat-card.is-on:disabled,
.cw-cat-card.is-on.is-locked {
  opacity: 1;
  cursor: default;
}
.cw-editor-cats.is-locked > .cw-editor-rail-tip {
  color: var(--muted, #64748b);
}
.cw-cat-card.is-on {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.cw-cat-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 7px;
  background: #e8edf3;
  display: block;
}
.cw-cat-card-img.is-empty { min-height: 54px; }
.cw-cat-card-name {
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--text);
  padding: 0 0.15rem 0.15rem;
}
.cw-price-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin: 0.35rem 0 0.55rem;
}
.cw-price-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
}
.cw-price-field small { color: var(--text-muted); font-weight: 500; }
.cw-price-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--primary) 12%);
  border-radius: 8px;
  padding: 0 0.45rem;
  background: var(--input-bg, color-mix(in srgb, var(--surface2) 82%, var(--surface)));
  color-scheme: inherit;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 45%, transparent);
}
.cw-price-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--primary) 18%, transparent));
}
.cw-price-yen { color: var(--text-muted); font-size: 0.8rem; }
.cw-price-input {
  width: 5.5rem;
  border: 0;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--input-fg, var(--text));
  padding: 0.4rem 0;
  font: inherit;
  outline: none;
  color-scheme: inherit;
  -moz-appearance: textfield;
}
.cw-price-input::-webkit-outer-spin-button,
.cw-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cw-act-meta {
  margin: 0.55rem 0 0.75rem;
  padding: 0.7rem 0.75rem 0.75rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--primary) 8%, var(--surface)) 0%,
      var(--surface) 100%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 55%, transparent);
  color-scheme: inherit;
}
.cw-act-meta-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.55rem;
  letter-spacing: 0.02em;
}
.cw-act-field {
  margin: 0 0 0.55rem;
}
.cw-act-field:last-child {
  margin-bottom: 0;
}
.cw-act-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.28rem;
}
.cw-act-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.15rem;
  padding: 0 0.7rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--primary) 12%);
  background: var(--input-bg, color-mix(in srgb, var(--surface2) 82%, var(--surface)));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 45%, transparent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  color-scheme: inherit;
}
.cw-act-control:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}
.cw-act-control:focus-within {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: var(--input-bg, var(--surface2));
  box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--primary) 18%, transparent));
}
.cw-act-control--select {
  padding-right: 0.45rem;
  position: relative;
}
.cw-act-control--select::after {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.2rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg) translateY(-1px);
  pointer-events: none;
  flex-shrink: 0;
  opacity: 0.85;
}
.cw-act-input,
.cw-act-select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent !important;
  background-color: transparent !important;
  font: inherit;
  font-size: 0.84rem;
  color: var(--input-fg, var(--text));
  padding: 0.45rem 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color-scheme: inherit;
  box-shadow: none;
}
.cw-act-select {
  cursor: pointer;
  padding-right: 0.25rem;
}
.cw-act-select option {
  background: var(--surface);
  color: var(--text);
}
.cw-act-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}
.cw-act-input[type='number'] {
  -moz-appearance: textfield;
}
.cw-act-input[type='number']::-webkit-outer-spin-button,
.cw-act-input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cw-act-suffix {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface2) 70%, var(--border));
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.cw-editor-rail-title,
.cw-side-head { font-weight: 700; margin-bottom: 0.35rem; }
.cw-side-style-sync {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
}
.cw-side-style-sync-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.cw-side-style-sync-btns .btn-ghost {
  min-width: 5.5rem;
}
.cw-editor-tool {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
  border-radius: 8px;
  padding: 0.4rem 0.3rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}
.cw-editor-tool:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.cw-editor-tool:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  color: var(--text-muted, #94a3b8);
}
.cw-editor-phone {
  width: min(390px, 100%);
  background: #fff;
  color: #111;
  border-radius: 24px;
  border: 1px solid #d6dbe3;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  min-height: 480px;
}
.cw-editor-phone-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 0.85rem; border-bottom: 1px solid #eceff3;
  background: #f8fafc;
}
.cw-editor-title-input {
  flex: 1; border: 0; background: transparent; font-weight: 700; font-size: 0.95rem; outline: none;
}
.cw-editor-status {
  font-size: 0.72rem; color: #64748b; white-space: nowrap;
  padding: 0.15rem 0.45rem; border-radius: 999px; background: #e8eef8;
}
.cw-editor-canvas { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.75rem; min-height: 520px; }
.cw-editor-empty { color: #94a3b8; text-align: center; padding: 2rem 1rem; font-size: 0.875rem; }
.cw-block {
  position: relative;
  border: 1px dashed transparent;
  border-radius: 8px;
  padding: 0.15rem;
  /* 块级操作条与槽位浮层（裁剪等）分区：选中时顶部预留一条，避免互相遮挡 */
  --cw-block-chrome-h: 28px;
  --cw-block-chrome-gap: 3px;
}
.cw-block.is-selected {
  border-color: #6b93e8;
  box-shadow: 0 0 0 2px rgba(107,147,232,0.25);
  padding-top: calc(var(--cw-block-chrome-h) + 4px);
}
/* 标题块的操作条放到标题上方，避免盖住标题素材和叠层 */
.cw-block--heading.is-selected {
  margin-top: calc(var(--cw-block-chrome-h) + 10px);
}
.cw-block--heading.is-selected:not(:has(.cw-block-overlays)) {
  padding-top: 0.15rem;
}
.cw-block--heading.is-selected > .cw-block-chrome {
  top: auto;
  bottom: calc(100% + 6px);
  z-index: 40;
}
/* 叠层坐标相对块盒。选中时才有上间距会让保存后再进入时组件错位，有叠层时始终留出同样的上间距 */
.cw-block--heading:has(.cw-block-overlays),
.cw-block--image:has(.cw-block-overlays) {
  padding-top: calc(var(--cw-block-chrome-h) + 4px);
}
/* 块级工具条：上移/下移/删除及后续新增图标统一横排于此，不压住图片内容区 */
.cw-block-chrome {
  display: none;
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  height: var(--cw-block-chrome-h);
  z-index: 6;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: var(--cw-block-chrome-gap);
  padding: 2px 4px;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
}
.cw-block.is-selected > .cw-block-chrome {
  display: flex;
}
.cw-block-chrome > .cw-block-move,
.cw-block-chrome > .cw-block-del,
.cw-block-chrome > .cw-block-action {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}
.cw-block-chrome > .cw-block-move:hover:not(:disabled),
.cw-block-chrome > .cw-block-del:hover,
.cw-block-chrome > .cw-block-action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}
.cw-block-chrome > .cw-block-move:disabled,
.cw-block-chrome > .cw-block-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cw-block-chrome > .cw-block-del {
  font-size: 14px;
  font-weight: 600;
}
.cw-block-chrome > .cw-block-crop svg {
  display: block;
  pointer-events: none;
}
.cw-h5-heading { margin: 0; font-size: 1.15rem; font-weight: 800; line-height: 1.35; }
.cw-h5-paragraph { margin: 0; font-size: 0.92rem; line-height: 1.7; color: #334155; white-space: pre-wrap; }

.cw-side-hint { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 0.65rem; }
.cw-side-hint.is-pick { color: var(--primary); font-weight: 600; }
.cw-side-locations { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.35rem; }
.cw-side-loc-row { display: flex; align-items: stretch; gap: 0.35rem; }
.cw-side-loc-main {
  flex: 1; min-width: 0; text-align: left; border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #f8fafc); border-radius: 8px; padding: 0.45rem 0.55rem; cursor: pointer;
}
.cw-side-loc-main:hover { border-color: var(--primary, #0284c7); }
.cw-side-loc-name { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text, #0f172a); }
.cw-side-loc-coord { display: block; font-size: 0.72rem; color: var(--text-muted, #64748b); margin-top: 0.15rem; font-family: ui-monospace, monospace; }
.cw-side-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0 0 0.35rem;
}
.cw-side-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  cursor: pointer;
  user-select: none;
}
.cw-side-check input { margin: 0; }
.cw-editor-doc-footer { margin-top: 0.5rem; }
.cw-endorsement-page { max-width: 920px; }
.cw-endorsement-intro {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.5rem 0 1.25rem;
  line-height: 1.55;
}
.cw-side-styles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem;
  max-height: none; overflow: visible;
}
.cw-side-styles-scroll {
  max-height: none;
  overflow: visible;
  padding-right: 0.15rem;
}
/* 组件样式栏只保留外侧一条滚动条，避免样式库内部再套一层 */
.cw-editor-side .cw-side-styles,
.cw-editor-side .cw-side-styles-scroll,
.cw-editor-side .cw-side-title-styles,
.cw-editor-side .cw-side-line-styles,
.cw-editor-side .cw-side-assets,
.cw-editor-side .cw-side-bg-list,
.cw-editor-side .cw-side-bg-tune {
  max-height: none;
  overflow: visible;
}
.cw-side-style-group { margin-bottom: 0.85rem; }
.cw-side-style-group-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  margin: 0 0 0.45rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border);
}
.cw-side-style-group .cw-side-styles {
  max-height: none; overflow: visible;
}
.cw-side-style-card {
  position: relative;
  z-index: 0;
  overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 0.4rem; cursor: pointer; text-align: left;
  user-select: none;
}
.cw-side-style-card:hover { border-color: var(--primary); z-index: 1; }
.cw-side-style-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  z-index: 1;
}
.cw-side-style-preview {
  overflow: hidden;
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  border-radius: 6px; padding: 0.35rem; min-height: 88px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.cw-side-style-preview .cw-img-style { max-width: 100%; transform: scale(0.92); transform-origin: center; }
.cw-side-style-card--material .cw-side-style-preview {
  display: block;
  max-height: none;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.cw-side-mat-host {
  position: relative;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.cw-side-mat-scale {
  position: absolute;
  left: 0;
  top: 0;
  width: 375px;
  max-width: none;
  box-sizing: border-box;
  transform-origin: top left;
}
.cw-side-mat-scale .cw-img-style {
  transform: none;
  max-width: 100%;
}
.cw-side-mat-scale .cw-block {
  margin: 0;
  border-color: transparent;
  background: transparent;
}
.cw-side-mat-scale .cw-block-overlay {
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}
.cw-side-mat-scale .cw-view-crop,
.cw-side-mat-scale .cw-view-crop img,
.cw-side-mat-scale .cw-block-overlay--adorn img {
  max-width: none;
}
.cw-side-style-preview .cw-img-style[class*="--plate-"] {
  transform: none;
  width: 100%;
}
.cw-side-style-preview .cw-img-style[class*="--plate-"] .cw-img-slot,
.cw-side-style-preview .cw-img-style[class*="--plate-"] button.cw-img-slot {
  min-height: 0;
  height: 100%;
}
.cw-side-style-preview .cw-img-style[class*="--plate-"] .cw-img-slot-label {
  font-size: 0.62rem;
  line-height: 1.1;
}
.cw-side-style-preview .cw-img-style--quad-filmstrip {
  transform: scale(0.8);
  max-width: 100%;
  overflow: hidden;
}
.cw-side-style-name {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  pointer-events: none;
}
.cw-side-title-styles {
  display: grid; grid-template-columns: 1fr; gap: 0.45rem; max-height: 70vh; overflow: auto;
}
.cw-side-title-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 0.4rem 0.5rem; cursor: pointer; text-align: left;
}
.cw-side-title-card:hover { border-color: var(--primary); }
.cw-side-title-preview {
  background: color-mix(in srgb, var(--surface2) 82%, var(--border));
  border-radius: 6px; padding: 0.45rem;
  min-height: 56px; display: flex; align-items: center; justify-content: center;
}
.cw-asset-mini-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.55rem; }
.cw-asset-mini-tab {
  border: 1px solid var(--border); background: transparent; border-radius: 999px;
  padding: 0.2rem 0.55rem; font-size: 0.72rem; cursor: pointer;
}
.cw-asset-mini-tab.active { background: var(--primary); color: var(--btn-text); border-color: var(--primary); }
.cw-side-assets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; max-height: min(42vh, 100%); overflow: auto;
}
.cw-side-asset {
  position: relative;
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  padding: 0; background: color-mix(in srgb, var(--surface2) 75%, var(--border)); cursor: pointer;
  color: var(--text-muted);
  /* 不用 transform，避免光栅高亮时格子错位 */
  transition: filter .18s ease, box-shadow .18s ease, border-color .18s ease;
  isolation: isolate;
}
.cw-side-asset::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.18) 38%,
    transparent 72%
  );
  box-shadow:
    inset 0 0 18px 4px rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  filter: blur(0.6px);
  transition: opacity .18s ease;
  z-index: 1;
}
.cw-side-asset:hover,
.cw-side-asset:focus-visible {
  filter: brightness(1.28) saturate(1.18) contrast(1.06);
  border-color: color-mix(in srgb, var(--primary, #2563eb) 65%, var(--border));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 42%, transparent),
    0 0 22px 6px color-mix(in srgb, var(--primary, #2563eb) 28%, transparent),
    0 0 36px 10px rgba(255, 255, 255, 0.22);
  z-index: 1;
  outline: none;
}
.cw-side-asset:hover::after,
.cw-side-asset:focus-visible::after {
  opacity: 1;
}
.cw-side-asset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-prop-text {
  width: 100%; min-height: 72px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0.45rem; resize: vertical; background: var(--surface); color: var(--text);
  font: inherit;
}

@media (max-width: 1280px) {
  .cw-editor-page { height: 100%; min-height: 0; }
  .cw-editor-shell {
    grid-template-columns: max-content minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    overflow: auto;
  }
  .cw-editor-group--nav {
    height: 100%;
    max-height: 100%;
  }
  .cw-editor-stage {
    height: min(100%, 640px);
    max-height: min(100%, 640px);
  }
  .cw-editor-meta-wrap,
  .cw-editor-meta,
  .cw-editor-side {
    grid-column: 1 / -1;
    height: auto;
    max-height: min(42vh, 360px);
  }
}
@media (max-width: 720px) {
  .page-content:has(.cw-editor-page) {
    overflow-y: auto;
  }
  .cw-editor-page { height: auto; max-height: none; overflow: visible; }
  .cw-editor-shell { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .cw-editor-group--nav {
    flex-direction: column;
    height: auto;
    max-height: none;
  }
  .cw-editor-group--nav .cw-editor-cats {
    width: auto;
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 0.55rem;
    height: auto;
    max-height: 180px;
  }
  .cw-editor-group--nav .cw-editor-rail {
    width: auto;
    flex: none;
    height: auto;
  }
  .cw-editor-stage { max-height: none; height: auto; overflow: visible; }
  .cw-editor-meta-wrap,
  .cw-editor-meta,
  .cw-editor-side {
    max-height: none;
  }
  .cw-editor-rail-group--tools {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .cw-editor-rail-group--tools .cw-editor-tool {
    flex: 1 1 calc(33.33% - 0.3rem);
  }
  .cw-cat-list { flex-direction: row; flex-wrap: wrap; }
  .cw-cat-card { width: calc(33.33% - 0.35rem); }
}

.cw-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
}
.cw-list-empty-actions { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
.cw-list-empty-hint { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* 文案列表：iPhone 预览网格 */
.cw-list-footer {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.cw-list-footer-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.cw-list-footer-right {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.cw-list-footer-right .list-pagination-bar,
.cw-list-footer-right .cw-list-pager-bar {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-end;
}
.cw-list-page {
  width: 100%;
  min-height: calc(100vh - 9.5rem);
  display: flex;
  flex-direction: column;
}
.cw-list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}
.cw-list-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.cw-list-tab.is-on {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}
.cw-list-desc { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.875rem; }
.cw-cat-pick-overlay {
  position: fixed; inset: 0; z-index: 13000;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.cw-cat-pick-modal {
  width: min(420px, 100%);
  max-height: min(70vh, 520px);
  overflow: auto;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  padding: 0.85rem 1rem 1rem;
}
.cw-cat-pick-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.35rem;
}
.cw-cat-pick-hint { margin: 0 0 0.65rem; font-size: 0.78rem; color: var(--text-muted); }
.cw-cat-pick-list { display: flex; flex-direction: column; gap: 0.35rem; }
.cw-cat-pick-item {
  text-align: left;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface2) 70%, var(--surface));
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
.cw-cat-pick-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cw-editor-shell--no-meta {
  grid-template-columns: max-content minmax(0, 1fr) minmax(240px, 280px) !important;
}
.cw-editor-shell--preview {
  grid-template-columns: minmax(0, 1fr) !important;
}
.cw-editor-group--tools-only .cw-editor-cats { display: none !important; }
/* 叠层坐标系：相对块盒（含图片间距/标题外边距视觉区） */
.cw-block-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}
.cw-block--heading .cw-block-overlays,
.cw-block--image .cw-block-overlays {
  /* 含间距：略外扩，使拖拽区域覆盖块内 gap / 标题间距 */
  inset: -8px -4px;
}
/* 选中叠层时抬到裁剪框之上，蓝色缩放边才不会被挡住 */
.cw-block--heading .cw-block-overlays:has(.cw-block-overlay.is-selected),
.cw-block--image .cw-block-overlays:has(.cw-block-overlay.is-selected) {
  z-index: 45;
}
.cw-block-overlay {
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  border: 1px dashed color-mix(in srgb, var(--primary, #2563eb) 45%, transparent);
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  min-width: 36px;
  overflow: visible;
}
.cw-block-overlay.is-selected {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 35%, transparent);
  z-index: 7;
}
.cw-block-overlay--adorn {
  padding: 0;
  overflow: visible;
  background: transparent;
  cursor: move;
}
.cw-block-overlay--adorn .lazy-img-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  background: transparent;
}
.cw-block-overlay--adorn .lazy-img-wrap > img.lazy-load-img,
.cw-block-overlay--adorn img.cw-block-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cw-block-overlay--para {
  display: flex;
  flex-direction: column;
  min-height: 72px;
  overflow: visible;
  /* 叠在图片/标题上：背景必须全透明，勿用 surface 蒙层 */
  background: transparent !important;
}
.cw-block-overlay-body {
  flex: 0 1 auto;
  min-height: 1.25em;
  width: 100%;
  outline: none;
  background: transparent;
  overflow: auto;
}
.cw-block-overlay-rule {
  display: none;
  flex: 0 0 auto;
  height: 0;
  margin: 6px 0 0;
  border: 0;
  border-top: 1.5px solid #334155;
  pointer-events: none;
}
.cw-block-overlay--para.has-rule .cw-block-overlay-rule {
  display: block;
}
.cw-block-overlay-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.cw-block-overlay-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 11px; color: var(--text-muted);
  background: color-mix(in srgb, var(--surface2) 80%, var(--border));
  pointer-events: none;
}
.cw-block-overlay-drag {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  min-width: 36px;
  height: 16px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: block;
  font-size: 0;
  line-height: 0;
  letter-spacing: 0;
  text-indent: 0;
  text-align: center;
  color: transparent;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  z-index: 6;
  border-radius: 0 0 6px 6px;
  background-color: rgba(15, 23, 42, 0.78);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Ccircle cx='3' cy='2' r='1.15' fill='white'/%3E%3Ccircle cx='9' cy='2' r='1.15' fill='white'/%3E%3Ccircle cx='3' cy='5' r='1.15' fill='white'/%3E%3Ccircle cx='9' cy='5' r='1.15' fill='white'/%3E%3Ccircle cx='3' cy='8' r='1.15' fill='white'/%3E%3Ccircle cx='9' cy='8' r='1.15' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 10px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}
.cw-block-overlay-drag:active { cursor: grabbing; }
.cw-block-overlay-del {
  position: absolute; top: -1px; right: -1px;
  width: 22px; height: 20px; padding: 0; margin: 0;
  border: 0; border-radius: 0 6px 0 6px;
  background: rgba(185, 28, 28, 0.92); color: #fff;
  font-size: 14px; line-height: 20px; letter-spacing: 0; text-indent: 0;
  cursor: pointer; z-index: 6;
}
.cw-block-overlay-del:hover { background: #b91c1c; }
.cw-block-overlay-rotate {
  position: absolute;
  top: -36px;
  left: 50%;
  margin-left: -13px;
  z-index: 6;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 55%, var(--border));
  background-color: color-mix(in srgb, var(--surface, #fff) 92%, var(--primary, #2563eb));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.6'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  color: transparent;
  font-size: 0;
  line-height: 0;
  letter-spacing: 0;
  text-indent: 0;
  text-align: center;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.cw-block-overlay-rotate::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 25px;
  width: 1px;
  height: 11px;
  background: #64748b;
  transform: translateX(-50%);
  pointer-events: none;
}
.cw-block-overlay-rotate:active { cursor: grabbing; }
.cw-block-overlay-resize {
  position: absolute;
  z-index: 4;
  background: color-mix(in srgb, var(--primary, #2563eb) 80%, #fff);
  border: 1px solid #fff;
  box-sizing: border-box;
  pointer-events: auto;
}
.cw-block-overlay-resize--n,
.cw-block-overlay-resize--s {
  left: 18%;
  right: 18%;
  height: 8px;
  cursor: ns-resize;
  border-radius: 4px;
}
.cw-block-overlay-resize--n { top: -4px; left: 28px; right: 28px; }
.cw-block-overlay-resize--s { bottom: -4px; }
.cw-block-overlay-resize--e,
.cw-block-overlay-resize--w {
  top: 18%;
  bottom: 18%;
  width: 8px;
  cursor: ew-resize;
  border-radius: 4px;
}
.cw-block-overlay-resize--e { right: -4px; }
.cw-block-overlay-resize--w { left: -4px; }
.cw-block-overlay-resize--se {
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  cursor: nwse-resize;
}
/* 覆盖自适应槽位的 height:auto !important / img width:100% !important，否则右/下边裁剪无效 */
.cw-img-style--adaptive-flow .cw-img-slot.has-image.cw-img-slot--view-crop,
.cw-img-style--single-adaptive .cw-img-slot.has-image.cw-img-slot--view-crop,
.cw-img-slot.has-image.cw-img-slot--view-crop {
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
  max-width: 100%;
  width: var(--cw-crop-w, 100%) !important;
  height: var(--cw-crop-h, auto) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin-left: var(--cw-crop-ml, 0) !important;
  margin-right: var(--cw-crop-mr, 0) !important;
  margin-top: var(--cw-crop-mt, 0) !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}
.cw-img-style--adaptive-flow .cw-img-slot.has-image.cw-img-slot--view-crop .cw-img-slot-img,
.cw-img-style--adaptive-flow .cw-img-slot.has-image.cw-img-slot--view-crop .cw-img-slot-img--adaptive,
.cw-img-style--adaptive-flow .cw-img-slot.has-image.cw-img-slot--view-crop .lazy-img-wrap > img,
.cw-img-style--adaptive-flow .cw-img-slot.has-image.cw-img-slot--view-crop > img,
.cw-img-style--single-adaptive .cw-img-slot.has-image.cw-img-slot--view-crop .cw-img-slot-img,
.cw-img-style--single-adaptive .cw-img-slot.has-image.cw-img-slot--view-crop .cw-img-slot-img--adaptive,
.cw-img-style--single-adaptive .cw-img-slot.has-image.cw-img-slot--view-crop .lazy-img-wrap > img,
.cw-img-style--single-adaptive .cw-img-slot.has-image.cw-img-slot--view-crop > img,
.cw-img-slot.has-image.cw-img-slot--view-crop > img,
.cw-img-slot.has-image.cw-img-slot--view-crop .cw-img-slot-img,
.cw-img-slot.has-image.cw-img-slot--view-crop .cw-img-slot-img--adaptive,
.cw-img-slot.has-image.cw-img-slot--view-crop .lazy-img-wrap > img {
  position: absolute !important;
  inset: auto !important;
  display: block !important;
  /* 固定为原图完整显示尺寸（宽高比=自然比例），视口只做遮挡裁剪，不拉伸变形 */
  width: var(--cw-crop-img-w, 100%) !important;
  height: var(--cw-crop-img-h, auto) !important;
  max-width: none !important;
  max-height: none !important;
  left: var(--cw-crop-img-l, 0) !important;
  top: var(--cw-crop-img-t, 0) !important;
  margin: 0 !important;
  transform: none !important;
  object-fit: fill !important;
  object-position: 0 0 !important;
  aspect-ratio: auto !important;
  pointer-events: none !important;
}
.cw-img-slot--view-crop .lazy-img-wrap {
  position: static !important;
  inset: auto !important;
  width: 0 !important;
  height: 0 !important;
  overflow: visible !important;
}
.cw-img-slot.is-editable-slot {
  cursor: pointer;
}
.cw-block--image {
  position: relative;
}
/* 裁剪手柄挂在块上，高于叠层，避免被 overflow/叠层挡住 */
.cw-adaptive-crop-ui {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 50%, transparent);
}
.cw-adaptive-crop-ui .cw-adaptive-edge {
  pointer-events: auto !important;
  z-index: 41 !important;
}
.cw-para-wrap {
  position: relative;
}
.cw-para-wrap.has-rotate-handle {
  outline: 1px dashed color-mix(in srgb, var(--primary, #2563eb) 40%, transparent);
  outline-offset: 2px;
}
.cw-para-rotate-handle {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 9;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 55%, var(--border));
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--primary, #2563eb));
  color: var(--primary, #2563eb);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.cw-para-rotate-handle:active { cursor: grabbing; }
.cw-adaptive-edge {
  position: absolute;
  z-index: 12;
  background: color-mix(in srgb, var(--primary, #2563eb) 80%, #fff);
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
.cw-adaptive-edge--n,
.cw-adaptive-edge--s {
  left: 18%;
  right: 18%;
  height: 5px;
  cursor: ns-resize;
  border-radius: 2px;
}
.cw-adaptive-edge--n { top: -1px; }
.cw-adaptive-edge--s { bottom: -1px; }
.cw-adaptive-edge--e,
.cw-adaptive-edge--w {
  top: 18%;
  bottom: 18%;
  width: 5px;
  cursor: ew-resize;
  border-radius: 2px;
}
.cw-adaptive-edge--e { right: -1px; }
.cw-adaptive-edge--w { left: -1px; }
.cw-side-style-card--material .cw-side-style-name::after,
.cw-side-title-card--material .cw-side-style-name::after {
  content: '素材';
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}
.cw-side-mat-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: var(--text-muted);
  font-size: 12px;
  background: color-mix(in srgb, var(--surface2) 70%, var(--border));
}
.cw-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.cw-list-grid.is-empty {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 14rem);
  grid-template-columns: none;
}
.cw-list-card {
  display: flex; flex-direction: column; gap: 0.65rem;
  padding: 0.75rem; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
  min-width: 0;
}
.cw-list-card-phone { display: flex; justify-content: center; }
.cw-list-card-material {
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface2) 88%, var(--border));
  border: 1px solid var(--border);
}
.cw-list-material-host {
  width: 100%;
  overflow: hidden;
}
.cw-list-material-scale {
  --cw-mat-scale: 0.64;
  width: 375px;
  max-width: none;
  box-sizing: border-box;
  transform: scale(var(--cw-mat-scale));
  transform-origin: top left;
}
/* 列表素材预览沿用编辑器叠层盒，但不露出选中虚线 */
.cw-list-material-scale .cw-block-overlay {
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}
.cw-list-material-scale .cw-view-crop,
.cw-list-material-scale .cw-view-crop img,
.cw-list-material-scale .cw-block-overlay--adorn img {
  max-width: none;
}
.cw-list-card-title { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-list-card-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  min-width: 0;
}
.cw-list-card-author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--surface2, #f1f5f9);
}
.cw-list-card-author-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}
.cw-list-card-author-name {
  font-size: 0.78rem;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cw-list-card-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.cw-list-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.28rem;
  margin-top: 0.45rem;
  width: 100%;
}
.cw-list-card-actions > .btn-ghost,
.cw-list-card-actions > .btn-sm,
.cw-list-card-actions > button {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.15rem !important;
  padding-right: 0.15rem !important;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* iPhone X ?? */
.cw-iphone {
  position: relative;
  width: 320px;
  max-width: 100%;
  background: #111827;
  border-radius: 36px;
  padding: 12px 10px 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28), inset 0 0 0 2px #374151;
}
.cw-iphone--mini {
  width: 168px;
  border-radius: 22px;
  padding: 8px 6px 10px;
}
/*
 * 列表预览按 iPhone X 逻辑宽度 375pt 排版后等比缩小。
 * mini 屏内容宽约 156px → 156/375 ≈ 0.416
 */
/* 列表未进编辑前：仅作静态预览，禁止滚动、隐藏滚动条 */
.cw-iphone--mini .cw-iphone-scroll {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.cw-iphone--mini .cw-iphone-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.cw-iphone--mini .cw-list-preview-host {
  width: 100%;
  overflow: hidden;
}
.cw-iphone--mini .cw-list-preview-scale {
  --cw-mini-scale: 0.416;
  width: 375px;
  max-width: none;
  box-sizing: border-box;
  transform: scale(var(--cw-mini-scale));
  transform-origin: top left;
}
/*
 * 列表迷你预览：自适应图与小程序 widthFix 一致——占满逻辑屏宽，高度随比例。
 * 关键破 lazy-img-wrap 的 inline-flex（会按图片固有宽收缩，导致两侧留白）。
 */
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap,
.cw-iphone--mini .cw-img-adaptive,
.cw-iphone--mini .cw-img-adaptive > div,
.cw-iphone--mini [data-layout="single-adaptive"],
.cw-iphone--mini .cw-img-style--single-adaptive,
.cw-iphone--mini .cw-img-style--single-adaptive .cw-img-slot.has-image {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}
/* 勿用「> img」命中 loading gif，否则 loaded 后 gif 仍被强制显示 */
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap > img.lazy-load-img,
.cw-iphone--mini .cw-list-preview-scale img.lazy-load-img:not(.lazy-img-gif),
.cw-iphone--mini .cw-img-adaptive img.lazy-load-img,
.cw-iphone--mini .cw-img-adaptive-img,
.cw-iphone--mini .cw-img-style--single-adaptive .cw-img-slot.has-image img.lazy-load-img,
.cw-iphone--mini .cw-img-style--single-adaptive .cw-img-slot-img,
.cw-iphone--mini [data-layout="single-adaptive"] img.lazy-load-img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap.is-loaded > img.lazy-load-img {
  opacity: 1 !important;
}
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap > img.lazy-img-gif {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  width: 2.75rem !important;
  height: 2.75rem !important;
  max-width: 56% !important;
  max-height: 56% !important;
  transform: translate(-50%, -50%) !important;
  object-fit: contain !important;
  pointer-events: none !important;
  z-index: 2 !important;
}
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap.is-loading > img.lazy-img-gif {
  display: block !important;
  opacity: 1 !important;
}
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap:not(.is-loading) > img.lazy-img-gif,
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap.is-loaded > img.lazy-img-gif,
.cw-iphone--mini .cw-list-preview-scale .lazy-img-wrap.is-error > img.lazy-img-gif {
  display: none !important;
  opacity: 0 !important;
}
.cw-iphone--mini .cw-list-mini-cover-wrap,
.cw-iphone--mini .cw-list-mini-img-block {
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 0;
  box-sizing: border-box;
  line-height: 0;
  overflow: hidden;
  background: transparent;
}
@supports (zoom: 1) {
  .cw-iphone--mini .cw-list-preview-scale {
    transform: none;
    zoom: 0.416;
  }
}
.cw-iphone--editor {
  /* iPhone X 逻辑宽 375pt + 左右边框各 10px = 395；屏 812 + 外壳约 36 → 总高约 848 */
  --cw-ix-screen-w: 375px;
  --cw-ix-screen-h: 812px;
  --cw-ix-frame-w: 395px;
  --cw-ix-frame-h: 848px;
  width: var(--cw-ix-frame-w);
  max-width: min(var(--cw-ix-frame-w), 100%);
  flex-shrink: 1;
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 10px 10px 12px;
  border-radius: 36px;
  aspect-ratio: 395 / 848;
  max-height: min(100%, var(--cw-ix-frame-h));
  height: auto;
}
/* 编辑预览：内容区真机 375 宽；屏高随外壳比例伸缩 */
.cw-iphone--editor .cw-iphone-screen {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}
/*
 * 垂直滚动条会挤占客户区；禁止横向滚动，并用较细滚动条减少占宽。
 */
.cw-iphone--editor .cw-iphone-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  scrollbar-width: thin;
  scrollbar-gutter: auto;
}
.cw-iphone--editor .cw-iphone-scroll::-webkit-scrollbar {
  width: 6px;
  height: 0;
}
.cw-iphone--editor .cw-iphone-scroll::-webkit-scrollbar:horizontal {
  height: 0;
  display: none;
}
.cw-iphone--editor .cw-editor-preview-host {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.cw-iphone--editor .cw-editor-preview-scale {
  /* 真机 1:1，不再额外缩小 */
  --cw-editor-scale: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  transform: none;
  zoom: 1;
}
@supports (zoom: 1) {
  .cw-iphone--editor .cw-editor-preview-scale {
    transform: none;
    zoom: var(--cw-editor-scale);
  }
}
/* 块操作条贴齐块顶内边，避免伸出裁切预览宽度。标题块改到标题上方。 */
.cw-iphone--editor .cw-block-chrome {
  top: 2px;
  left: 2px;
  right: 2px;
}
.cw-iphone--editor .cw-block--heading.is-selected > .cw-block-chrome {
  top: auto;
  bottom: calc(100% + 6px);
  z-index: 40;
}
.cw-iphone--editor .cw-iphone-home {
  margin-top: 6px;
  flex-shrink: 0;
}
.cw-iphone--editor .cw-iphone-status {
  padding: 20px 14px 6px;
  font-size: 11px;
}
.cw-iphone-notch {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 38%; height: 18px; background: #0b1220; border-radius: 0 0 12px 12px; z-index: 3;
}
.cw-iphone--mini .cw-iphone-notch { top: 7px; height: 12px; border-radius: 0 0 8px 8px; }
.cw-iphone-screen {
  background: #fff; color: #0f172a;
  border-radius: 26px; overflow: hidden;
  height: 620px; display: flex; flex-direction: column;
  position: relative;
}
/* 整篇背景图：贴手机屏视口（底色 + 照片），正文滚动区须透明才能看见 */
.cw-iphone-bg-layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.cw-iphone-bg-base {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cw-iphone-status {
  position: relative;
  z-index: 2;
}
.cw-iphone-scroll {
  position: relative;
  z-index: 1;
}
.cw-iphone--has-bg .cw-rich-preview,
.cw-iphone--has-bg .cw-doc-bg-body {
  background: transparent !important;
}
.cw-doc-bg-photo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.cw-doc-bg-photo-img {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-position: center center;
}
.cw-doc-bg-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.cw-doc-bg-body {
  position: relative;
  z-index: 1;
}
.cw-side-bg-photo-thumb {
  margin: 0.65rem 0 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  min-height: 96px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cw-side-bg-photo-thumb.is-empty {
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
}
.cw-side-bg-photo-img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
}
.cw-side-bg-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
.cw-iphone--mini .cw-iphone-screen { height: 300px; border-radius: 16px; }
.cw-iphone-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 14px 6px; font-size: 11px; font-weight: 600; color: #0f172a;
  flex-shrink: 0;
}
.cw-iphone--mini .cw-iphone-status { padding: 16px 8px 4px; font-size: 9px; }
.cw-iphone-status-icons { letter-spacing: 1px; opacity: 0.55; font-size: 8px; }
.cw-iphone-scroll {
  flex: 1; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff;
  overflow-anchor: none;
  min-width: 0;
}
.cw-iphone--has-bg .cw-iphone-scroll {
  background: transparent;
}
.cw-iphone-home {
  width: 34%; height: 4px; border-radius: 999px; background: #4b5563;
  margin: 10px auto 0;
}
.cw-iphone--mini .cw-iphone-home { height: 3px; margin-top: 6px; }

.cw-editor-doc-header {
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
}
.cw-rich-preview.has-doc-bg .cw-editor-doc-header {
  border-bottom-color: color-mix(in srgb, #64748b 22%, transparent);
}
.cw-editor-doc-title {
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  text-align: center;
  cursor: text;
  background: transparent;
}
.cw-editor-doc-title-edit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 8px;
  border: 1px dashed color-mix(in srgb, var(--primary, #0ea5e9) 35%, #cbd5e1);
  border-radius: 8px;
  background: color-mix(in srgb, #fff 82%, var(--primary, #0ea5e9) 18%);
  color: #0f172a;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  outline: none;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cw-editor-doc-title-edit::placeholder {
  color: #94a3b8;
  font-weight: 600;
}
.cw-editor-doc-title-edit:focus {
  border-style: solid;
  border-color: color-mix(in srgb, var(--primary, #0ea5e9) 55%, #94a3b8);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0ea5e9) 16%, transparent);
}
.cw-editor-doc-title.is-selected .cw-editor-doc-title-edit {
  border-style: solid;
}
.cw-editor-doc-title.is-selected,
.cw-editor-doc-cover.is-selected,
.cw-editor-doc-goal.is-selected {
  outline: 2px solid color-mix(in srgb, var(--primary, #2563eb) 55%, transparent);
  outline-offset: -2px;
}
.cw-editor-doc-cover {
  position: relative;
  margin: 0 4px 2px;
  min-height: 132px;
  max-height: 180px;
  background: #e8edf3;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  border-radius: 4px;
}
.cw-editor-doc-cover.is-picking {
  box-shadow: inset 0 0 0 2px var(--primary, #2563eb);
}
.cw-editor-doc-cover img,
.cw-editor-doc-cover .lazy-img-wrap > img.lazy-load-img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.cw-editor-doc-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  padding: 12px;
  text-align: center;
}
.cw-editor-doc-cover-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.55));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.cw-editor-doc-cover:hover .cw-editor-doc-cover-hint,
.cw-editor-doc-cover.is-picking .cw-editor-doc-cover-hint,
.cw-editor-doc-cover.is-selected .cw-editor-doc-cover-hint {
  opacity: 1;
}
.cw-editor-doc-goal {
  padding: 4px 4px 8px;
  cursor: pointer;
  background: transparent;
  border-radius: 6px;
}
.cw-editor-doc-goal-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.cw-editor-doc-goal-text {
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
}
.cw-editor-doc-goal-text.is-placeholder {
  color: #94a3b8;
}
.cw-editor-doc-goal-edit {
  display: block;
  width: 100%;
  min-height: 88px;
  max-height: 280px;
  box-sizing: border-box;
  margin: 0;
  padding: 6px 8px;
  border: 1px dashed color-mix(in srgb, var(--primary, #0ea5e9) 35%, #cbd5e1);
  border-radius: 8px;
  background: color-mix(in srgb, #fff 82%, var(--primary, #0ea5e9) 18%);
  color: #334155;
  font: inherit;
  font-size: 13px;
  line-height: 1.7;
  resize: none;
  overflow-x: hidden;
  overflow-y: hidden;
  outline: none;
  cursor: text;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  /* 禁止被预览壳 min-height:100% / flex 拉伸成整屏高；高度由 JS 按内容量，CSS 封顶兜底 */
  flex: none;
  align-self: stretch;
}
.cw-editor-doc-goal-edit::placeholder {
  color: #94a3b8;
}
.cw-editor-doc-goal-edit:focus {
  border-style: solid;
  border-color: color-mix(in srgb, var(--primary, #0ea5e9) 55%, #94a3b8);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0ea5e9) 16%, transparent);
}
.cw-editor-doc-goal.is-selected .cw-editor-doc-goal-edit {
  border-style: solid;
}
.cw-side-cover-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0.55rem;
  flex-wrap: wrap;
}
.cw-side-cover-thumb {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
  border: 1px solid var(--border, #e2e8f0);
}
.cw-side-cover-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #94a3b8;
}
.cw-canvas-flow {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
}
.cw-rich-preview { min-height: 100%; }
.cw-rich-preview--editable .cw-block { margin: 0.35rem 0; }
/* 连续独立图片样式：块与块之间只用「图片间隔」。
   相接的一边去掉 1px 透明边框和圆角，避免间隔为 0 时露出一条底色横线。 */
.cw-rich-preview--editable .cw-block--image.cw-img-before-image {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.cw-rich-preview--editable .cw-block--image.cw-img-after-image {
  margin-top: var(--cw-img-block-gap, 4px);
  border-top-width: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
/* 新插入的块会处于选中态。选中内边距不能加进图片间隔，否则新块和上一张图的间距会对不上。 */
.cw-rich-preview--editable .cw-block--image.cw-img-after-image:not(:has(.cw-block-overlays)) {
  padding-top: 0;
}
.cw-rich-preview--editable .cw-block--note {
  position: relative;
  margin: 0.45rem 0;
  padding: 0;
}
.cw-block--note .cw-note-shell {
  position: relative;
  margin: 0 auto;
  padding: 0;
  /* 与单图自适应一致：留左右间隙，避免通栏贴满预览屏宽 */
  width: 96%;
  max-width: 96%;
  min-height: 160px;
  border-radius: 2px;
  background: #fef08a;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, #ca8a04 28%, transparent);
  /* 允许左右/底边缩放手柄略超出正文框，避免被裁切导致无法拖动 */
  overflow: visible;
}
.cw-block--note .cw-note-shell.has-paper {
  background-color: transparent;
  border-color: transparent;
}
/* 便签纸：按原图宽高自适应，不裁切 cover */
.cw-block--note .cw-note-paper-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  position: relative;
  z-index: 0;
  pointer-events: none;
  vertical-align: top;
}
.cw-note-paper-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 88%, #fef08a 12%);
  color: var(--text-muted);
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
}
.cw-note-paper-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}
.cw-note-text {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 80px;
  min-height: 48px;
  border: 1px dashed color-mix(in srgb, #64748b 35%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, #fff 55%, transparent);
  padding: 0;
  overflow: hidden;
  /* 与 JS noteTextGeoStyle 一致：相对便签壳水平居中 */
  left: 50%;
  transform: translateX(-50%);
}
.cw-block--note.is-selected .cw-note-text,
.cw-note-text:focus-within {
  border-color: var(--primary, #2563eb);
  border-style: solid;
}
.cw-note-drag {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, #fef08a 8%);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1;
  cursor: move;
  user-select: none;
  touch-action: none;
}
.cw-note-drag:hover {
  color: var(--text);
  border-color: var(--primary);
}
.cw-note-resize {
  position: absolute;
  z-index: 5;
  touch-action: none;
  box-sizing: border-box;
  opacity: 0.55;
  background: transparent;
}
.cw-note-resize::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--primary, #2563eb) 35%, #64748b 65%);
  opacity: 0.85;
}
.cw-block--note.is-selected .cw-note-resize,
.cw-block--note:hover .cw-note-resize {
  opacity: 1;
}
/* 右侧：拖动时左右同步变宽（保持居中） */
.cw-note-resize--e {
  top: 22px;
  right: 0;
  width: 12px;
  height: calc(100% - 34px);
  cursor: ew-resize;
}
.cw-note-resize--e::after {
  top: 50%;
  left: 4px;
  width: 3px;
  height: 28px;
  margin-top: -14px;
  inset: auto;
  border-radius: 2px;
}
/* 左侧：同上，解决右下角被窗口遮挡时无法调宽 */
.cw-note-resize--w {
  top: 22px;
  left: 0;
  width: 12px;
  height: calc(100% - 34px);
  cursor: ew-resize;
}
.cw-note-resize--w::after {
  top: 50%;
  right: 4px;
  width: 3px;
  height: 28px;
  margin-top: -14px;
  inset: auto;
  border-radius: 2px;
}
/* 底边调高 */
.cw-note-resize--s {
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 12px;
  width: auto;
  cursor: ns-resize;
}
.cw-note-resize--s::after {
  left: 50%;
  top: 4px;
  width: 28px;
  height: 3px;
  margin-left: -14px;
  inset: auto;
  border-radius: 2px;
}
/* 右下角：宽高同时调（宽度仍左右同步居中） */
.cw-note-resize--se {
  right: 1px;
  bottom: 1px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}
.cw-note-resize--se::after {
  right: 1px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  inset: auto;
  background: transparent;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  border-radius: 0;
  opacity: 1;
}
.cw-block--note.is-selected .cw-note-resize--se::after,
.cw-block--note:hover .cw-note-resize--se::after {
  border-color: var(--primary, #2563eb);
}
.cw-block--note .cw-para-wrap {
  background: transparent;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: auto;
  /* 正文区贴齐文本框边：覆盖段落 body_width / 文本框底色 / 居中 margin */
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
.cw-block--note .cw-para-editor {
  /* 覆盖段落默认段前/段后 margin:6px 0 */
  margin: 0 !important;
  width: 100%;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
}
/* 聚焦浅蓝色 inset 内框会造成“内边距感”，便签仅用外层 .cw-note-text 选中边框 */
.cw-block--note .cw-para-editor.is-focused {
  box-shadow: none;
  border-radius: 0;
}
.cw-rich-preview--editable .cw-block--image { min-height: 72px; }
.cw-rich-preview--editable .cw-img-style { max-width: 100%; width: 100%; }
.cw-rich-preview--editable .cw-img-slot { pointer-events: auto; }
.cw-side-bg-tabs {
  display: flex;
  gap: 0;
  margin: 0.35rem 0 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cw-side-bg-tab {
  flex: 1;
  border: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.2rem;
  cursor: pointer;
}
.cw-side-bg-tab + .cw-side-bg-tab {
  border-left: 1px solid var(--border);
}
.cw-side-bg-tab.is-on {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}
.cw-side-bg-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.65rem; max-height: 58vh; overflow: auto; }
.cw-side-bg-card {
  text-align: left; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 0.55rem 0.7rem; cursor: pointer;
}
.cw-side-bg-card:hover { border-color: var(--primary); }
.cw-side-bg-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.cw-side-bg-name { font-weight: 700; font-size: 0.82rem; }
.cw-side-bg-desc { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.cw-side-bg-tune {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 58vh;
  overflow: auto;
  overflow-anchor: none;
}
.cw-side-bg-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
}
.cw-side-bg-field > span em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}
.cw-doc-bg-color-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.cw-doc-bg-swatch {
  width: 2rem;
  height: 1.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.cw-doc-bg-swatch.is-on {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.cw-doc-bg-hex-preview {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: transparent;
}
.cw-doc-bg-color32 {
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, #000 4%);
}
.cw-doc-bg-color32-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.cw-doc-bg-color-input {
  width: 2rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
}
.cw-doc-bg-color-hex {
  flex: 1;
  min-width: 6.5rem;
  font-size: 0.72rem;
  padding: 0.28rem 0.4rem;
}
.cw-doc-bg-color-alpha {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.cw-doc-bg-color-alpha input { width: 4.5rem; }
.cw-doc-bg-color32-hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.cw-doc-bg-color32-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.cw-side-bg-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

/* 管理页：样式 / 参数 双 Tab（背景 / 标题 / 线条） */
.cw-mode-tabs {
  display: flex;
  gap: 0;
  margin: 0.65rem 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  max-width: 28rem;
}
.cw-mode-tab {
  flex: 1;
  border: 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.35rem;
  cursor: pointer;
}
.cw-mode-tab + .cw-mode-tab {
  border-left: 1px solid var(--border);
}
.cw-mode-tab.is-on {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}
.cw-bggrid-layout--style {
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
}
.cw-bggrid-layout--params {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}
.cw-title-layout--style .cw-title-col--list {
  max-width: none;
  width: 100%;
}
.cw-title-layout--params {
  grid-template-columns: minmax(0, 1fr);
}
.cw-title-layout--params .cw-title-col--panel {
  max-width: 520px;
  width: 100%;
}
.cw-side-title-card.is-active,
.cw-side-line-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}

.cw-para-bar {
  display: flex; width: 100%; margin: 0 0 0.55rem;
  background: #3f4654; border-radius: 6px; overflow: hidden;
}
.cw-para-tab {
  flex: 1; border: 0; background: transparent; color: #fff;
  font-size: 0.72rem; font-weight: 600; padding: 0.55rem 0.2rem;
  cursor: pointer; border-right: 1px solid rgba(255,255,255,0.22);
}
.cw-para-tab:last-child { border-right: 0; }
.cw-para-tab.active, .cw-para-tab:hover { background: #2f3642; }
.cw-para-hint {
  margin: 0 0 0.45rem;
  padding: 0 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}
.cw-para-wrap {
  position: relative;
  min-height: 1.5em;
  width: 100%;
}
.cw-block--note .cw-para-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
.cw-para-editor {
  outline: none;
  min-height: 1.5em;
  word-break: break-word;
  cursor: text;
}
.cw-para-editor:empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.cw-para-editor.is-focused {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary, #2563eb) 35%, transparent);
  border-radius: 4px;
}
.cw-para-line {
  display: block;
  min-height: 1.25em;
  /* 默认无段间距；段前/段后由 data-cw-mt/mb + 行内 style 按行设置 */
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}
/* 悬挂缩进：换行后正文与首行文字左缘对齐（不顶到符号下方） */
.cw-para-line[data-cw-list] {
  --cw-mark-gutter: 2em;
  --cw-mark-color: inherit;
  --cw-mark-size: inherit;
  --cw-mark-font: inherit;
  --cw-mark-weight: inherit;
  --cw-mark-tracking: inherit;
  padding-left: var(--cw-mark-gutter);
  text-indent: calc(-1 * var(--cw-mark-gutter)) !important;
}
.cw-para-line[data-cw-list]::before {
  content: attr(data-cw-marker);
  display: inline-block;
  box-sizing: content-box;
  min-width: calc(var(--cw-mark-gutter) - 0.4em);
  margin-right: 0.4em;
  font-style: normal;
  font-weight: var(--cw-mark-weight);
  font-size: var(--cw-mark-size);
  font-family: var(--cw-mark-font);
  letter-spacing: var(--cw-mark-tracking);
  color: var(--cw-mark-color);
  line-height: inherit;
  text-indent: 0;
  white-space: nowrap;
  vertical-align: baseline;
}
.cw-para-pop {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  margin-bottom: 0.65rem; background: var(--surface);
}
.cw-para-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #3b82f6; color: #fff; padding: 0.45rem 0.65rem; font-weight: 700; font-size: 0.82rem;
}
.cw-para-pop-close {
  border: 0; background: transparent; color: #fff; font-size: 1rem; cursor: pointer; line-height: 1;
}
.cw-para-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border); font-size: 0.8rem;
}
.cw-para-row.is-disabled { opacity: 0.45; }
.cw-para-row.is-disabled select { cursor: not-allowed; }
.cw-para-row:last-child { border-bottom: 0; }
.cw-para-select {
  min-width: 96px; max-width: 140px; padding: 0.25rem 0.35rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg, #fff);
}
.cw-para-item {
  display: block; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--border); background: transparent;
  padding: 0.65rem 0.75rem; cursor: pointer; font-size: 0.82rem; color: inherit;
}
.cw-para-item.is-open {
  background: color-mix(in srgb, var(--primary, #2563eb) 10%, transparent);
  font-weight: 600;
}
.cw-para-list-picker {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface, #f8fafc) 88%, #e2e8f0);
  padding: 0.4rem 0.5rem 0.6rem;
  gap: 0.45rem;
}
.cw-para-list-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  padding: 0.15rem 0.35rem 0.25rem;
}
.cw-para-list-group-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.cw-para-list-group--symbols .cw-para-list-group-opts {
  gap: 0.28rem;
}
.cw-para-list-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: inherit;
  max-width: 100%;
}
.cw-para-list-opt--sym {
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.3rem;
}
.cw-para-list-opt:hover {
  background: #fff;
  border-color: var(--border, #e2e8f0);
}
.cw-para-list-opt.is-on {
  background: #fff;
  border-color: color-mix(in srgb, var(--primary, #2563eb) 45%, #cbd5e1);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #2563eb) 14%, transparent);
  font-weight: 600;
}
.cw-para-list-opt-mark {
  flex: 0 0 auto;
  min-width: 1.2rem;
  text-align: center;
  line-height: 1;
  font-size: 0.95rem;
  color: #0f172a;
}
.cw-para-list-opt-mark::before {
  content: attr(data-mark);
}
.cw-para-list-opt-mark[data-mark="–"]::before {
  color: #94a3b8;
}
.cw-para-list-opt-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
}
.cw-para-item:last-child { border-bottom: 0; }
.cw-para-item:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.cw-para-item-static {
  padding: 0.45rem 0.75rem 0.2rem; font-size: 0.75rem; color: var(--text-muted); font-weight: 600;
}
.cw-para-colors {
  display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.25rem 0.75rem 0.55rem;
}
.cw-para-swatch {
  width: 22px; height: 22px; border-radius: 4px; border: 1px solid #cbd5e1;
  padding: 0; cursor: pointer;
}
.cw-para-swatch.is-on { box-shadow: 0 0 0 2px #3b82f6; }
.cw-para-swatch--clear {
  width: auto; padding: 0 0.35rem; font-size: 0.68rem; background: #f8fafc; color: #64748b;
}
.cw-para-swatch--more {
  width: auto; min-width: 22px; padding: 0 0.3rem; font-size: 0.78rem; font-weight: 700;
  background: linear-gradient(135deg, #ef4444, #eab308, #22c55e, #3b82f6, #a855f7);
  color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.35); border-color: #94a3b8;
}
.cw-para-color32 {
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
  padding: 0.15rem 0.75rem 0.65rem;
}
.cw-para-color-input {
  width: 2rem; height: 1.75rem; border: 1px solid var(--border); border-radius: 6px;
  padding: 0; background: transparent; cursor: pointer;
}
.cw-para-color-hex {
  width: 6.5rem; font-size: 0.72rem; padding: 0.25rem 0.35rem;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  font-family: ui-monospace, Consolas, monospace;
}
.cw-para-color-alpha {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; color: var(--text-muted);
}
.cw-para-color-alpha input { width: 72px; }
.cw-para-color-apply { margin-left: auto; }
.cw-para-color-history {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
}
.cw-para-color-history-block + .cw-para-color-history-block {
  margin-top: 0.35rem;
}
.cw-para-colors--history {
  padding-top: 0.15rem;
  padding-bottom: 0.35rem;
}
.cw-para-swatch--history {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}
.cw-para-color-history-empty {
  margin: 0.35rem 0.75rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1.45;
}

.cw-editor-stage-title {
  text-align: center; font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 0.5rem; font-weight: 600;
}
.cw-editor-rail-tip {
  margin: 0.6rem 0 0; font-size: 0.68rem; color: var(--text-muted); line-height: 1.4;
}
.cw-side-meta { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.cw-side-label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 0.3rem; }
.cw-editor-status-line { margin-top: 0.35rem; font-size: 0.75rem; color: var(--text-muted); }

/* 文案设置栏：文案设置 / AI编辑文案 */
.cw-editor-meta .cw-meta-tabs { margin: 0 0 0.55rem; }
.cw-editor-meta .cw-meta-pane { min-height: 0; }
.cw-side-meta--ai { display: flex; flex-direction: column; gap: 0.75rem; }
.cw-ai-field { display: flex; flex-direction: column; gap: 0.28rem; }
.cw-side-meta--ai .cw-act-control--select {
  width: 100%;
}
.cw-ai-textarea {
  width: 100%;
  min-height: 4.2em;
  resize: vertical;
  line-height: 1.45;
  box-sizing: border-box;
  /* 主题浅灰底，区别于页面 / 侧栏 surface 背景 */
  background: var(--input-bg, color-mix(in srgb, var(--surface2) 82%, var(--surface))) !important;
  background-color: var(--input-bg, color-mix(in srgb, var(--surface2) 82%, var(--surface))) !important;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--primary) 12%);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: var(--input-fg, var(--text));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 45%, transparent);
}
.cw-ai-textarea--goal {
  min-height: 9.5em;
}
.cw-ai-title-list { display: flex; flex-direction: column; gap: 0.35rem; }
.cw-ai-title-row { display: flex; align-items: center; gap: 0.35rem; }
.cw-ai-title-row .cw-ai-title-input { flex: 1 1 auto; min-width: 0; }
.cw-ai-field--action .btn-primary { width: 100%; }
.cw-ai-field--action .btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

html.cw-ai-progress-lock,
body.cw-ai-progress-lock { overflow: hidden; }
.cw-ai-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  box-sizing: border-box;
}
.cw-ai-progress {
  width: min(420px, 100%);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border-radius: 14px;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}
.cw-ai-progress-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}
.cw-ai-progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.cw-ai-progress-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
}
.cw-ai-progress-mark {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border, #e2e8f0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  background: #fff;
}
.cw-ai-progress-step.is-active { color: var(--text, #0f172a); font-weight: 600; }
.cw-ai-progress-step.is-active .cw-ai-progress-mark { border-color: #2563eb; }
.cw-ai-progress-step.is-done { color: #15803d; }
.cw-ai-progress-step.is-done .cw-ai-progress-mark {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.cw-ai-progress-step.is-fail { color: #b91c1c; }
.cw-ai-progress-step.is-fail .cw-ai-progress-mark {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.cw-ai-progress-spin {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  border: 2px solid #bfdbfe;
  border-top-color: #2563eb;
  animation: cw-ai-spin 0.7s linear infinite;
}
@keyframes cw-ai-spin { to { transform: rotate(360deg); } }
.cw-block-list {
  margin-top: 1rem; padding: 0.85rem; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface);
  display: flex; flex-direction: column; gap: 0.55rem;
}
.cw-block-list-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.25rem; }
.cw-asset-block-pick {
  width: 100%; min-height: 72px; border: 1px dashed var(--border); border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, #94a3b8 10%);
  cursor: pointer; overflow: hidden; padding: 0;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.cw-asset-block-pick img { width: 100%; max-height: 140px; object-fit: cover; display: block; }
.cw-asset-block-pick--adaptive img {
  max-height: none;
  height: auto;
  object-fit: contain;
}

/* 点缀图：可拖动位置 + 缩放 */
.cw-block--adorn {
  position: relative;
}
.cw-adorn-shell {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
}
.cw-adorn-frame {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  cursor: move;
  touch-action: none;
}
.cw-adorn-frame .lazy-img-wrap,
.cw-adorn-frame img.cw-adorn-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.cw-adorn-drag {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  cursor: grab;
  user-select: none;
}
.cw-adorn-drag:active { cursor: grabbing; }
.cw-adorn-resize {
  position: absolute;
  z-index: 3;
  background: #3b82f6;
  border: 1px solid #fff;
  box-sizing: border-box;
  border-radius: 2px;
}
.cw-adorn-resize--se {
  right: -4px;
  bottom: -4px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.cw-adorn-resize--e {
  right: -4px;
  top: 50%;
  width: 8px;
  height: 16px;
  margin-top: -8px;
  cursor: ew-resize;
}
.cw-adorn-resize--s {
  left: 50%;
  bottom: -4px;
  width: 16px;
  height: 8px;
  margin-left: -8px;
  cursor: ns-resize;
}

@media (max-width: 720px) {
  .cw-list-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .cw-list-grid.is-empty { min-height: calc(100vh - 12rem); }
}

/* ?? ???? ?? */
.cw-bggrid-page { width: 100%; display: flex; flex-direction: column; gap: 1rem; }
.cw-bggrid-head .profile-center-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; }
.cw-bggrid-applied-badge {
  margin-left: 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--primary);
  vertical-align: middle;
}
.cw-bggrid-applied-badge.is-off {
  background: color-mix(in srgb, #94a3b8 18%, var(--surface));
  color: var(--text-muted);
}
.cw-bggrid-desc { margin: 0.35rem 0 0; color: var(--text-muted); font-size: 0.875rem; line-height: 1.55; }
.cw-bggrid-desc code { font-size: 0.8em; }
.cw-bggrid-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(240px, 300px);
  gap: 0.85rem;
  align-items: stretch;
}
.cw-bggrid-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.cw-bggrid-col-title { margin: 0 0 0.65rem; font-size: 0.9rem; font-weight: 700; flex-shrink: 0; }
.cw-bggrid-col--types .cw-bggrid-col-title:first-child { margin-top: 0; }
.cw-bggrid-types {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.cw-bggrid-col-title--presets {
  margin-top: 0.85rem;
  flex-shrink: 0;
}
.cw-bggrid-presets,
.cw-bggrid-preset-empty {
  flex-shrink: 0;
}
.cw-bggrid-col--controls .cw-bggrid-fields {
  flex: 1 1 auto;
}
.cw-bggrid-col--preview {
  justify-content: flex-start;
}
.cw-bggrid-type {
  text-align: left; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; padding: 0.45rem 0.55rem; cursor: pointer;
}
.cw-bggrid-type.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.cw-bggrid-type-name { display: block; font-weight: 700; font-size: 0.82rem; }
.cw-bggrid-type-desc { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.cw-bggrid-presets { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.35rem; }
.cw-bggrid-preset { display: flex; gap: 0.25rem; align-items: center; }
.cw-bggrid-preset-load {
  flex: 1; text-align: left; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; padding: 0.3rem 0.45rem; cursor: pointer; font-size: 0.78rem;
}
.cw-bggrid-preset-del {
  width: 1.6rem; height: 1.6rem; border: 0; border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--danger, #dc2626) 15%, var(--surface)); color: var(--danger, #dc2626);
}
.cw-bggrid-phone-wrap { display: flex; justify-content: center; padding: 0.5rem 0; }
.cw-bggrid-iphone {
  width: min(100%, 360px);
  background: #111827;
  border-radius: 28px;
  padding: 10px 8px 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25), inset 0 0 0 2px #374151;
  position: relative;
}
.cw-bggrid-iphone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 36%; height: 14px; background: #0b1220; border-radius: 0 0 10px 10px; z-index: 2;
}
.cw-bggrid-iphone-screen {
  background: #fff; border-radius: 20px; overflow: hidden;
  /* ?? = ??? 1/2?? canvas ??????????? */
  display: flex; align-items: center; justify-content: center;
}
.cw-bggrid-canvas { display: block; width: 100%; height: auto; vertical-align: top; }
.cw-bggrid-preview-hint { margin: 0.55rem 0 0; text-align: center; font-size: 0.75rem; color: var(--text-muted); }
.cw-bggrid-fields { display: flex; flex-direction: column; gap: 0.65rem; }
.cw-bggrid-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; }
.cw-bggrid-field span em { font-style: normal; color: var(--primary); font-weight: 700; }
.cw-bggrid-color-row { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.cw-bggrid-color-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.cw-bggrid-swatch {
  width: 2rem;
  height: 1.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.cw-bggrid-swatch.is-on {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.cw-bggrid-hex-preview {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: transparent;
}
.cw-bggrid-color32 {
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, #000 4%);
}
.cw-bggrid-color32-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.cw-bggrid-color-input {
  width: 2rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
}
.cw-bggrid-color {
  width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 6px; padding: 0; background: transparent;
}
.cw-bggrid-color-hex {
  flex: 1;
  min-width: 6.5rem;
  font-size: 0.72rem;
  padding: 0.28rem 0.4rem;
}
.cw-bggrid-alpha {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.cw-bggrid-alpha input { width: 4.5rem; }
.cw-bggrid-color32-hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.cw-bggrid-color32-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.cw-bggrid-range { width: 100%; }
.cw-bggrid-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; margin-top: 0.25rem; }
.cw-bggrid-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.85rem 0 0.55rem; }
.cw-bggrid-html {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem;
  font-family: ui-monospace, monospace; font-size: 0.68rem; resize: vertical;
  background: color-mix(in srgb, var(--surface) 92%, #64748b 8%); color: var(--text);
}
.cw-bggrid-preset-empty { font-size: 0.78rem; margin: 0.25rem 0 0; }

/* 费用与用餐 */
.afm-page { max-width: 960px; }
.afm-desc { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 0.85rem; }
.afm-tabs { margin-bottom: 0.75rem; }
.afm-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.afm-actions { white-space: nowrap; }
.afm-check { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; }

/* 活动测算分析：铺满内容区全宽 */
.page-content:has(.acalc-page) {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.acalc-page {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 2rem;
}
.acalc-desc { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 1rem; line-height: 1.55; }
.acalc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
}
@media (max-width: 960px) {
  .acalc-layout { grid-template-columns: 1fr; }
}
.acalc-col { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
@media (min-width: 961px) {
  .acalc-col--result { position: sticky; top: 0.75rem; }
}
.acalc-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.85rem 1rem 1rem;
}
.acalc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.acalc-card-title { margin: 0; font-size: 0.98rem; }
.acalc-card-hint { margin: 0.2rem 0 0; color: var(--text-muted); font-size: 0.78rem; }
.acalc-table-wrap { overflow: auto; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 10px; }
.acalc-table { width: 100%; margin: 0; background: transparent; color: var(--text); }
.acalc-table th, .acalc-table td {
  vertical-align: middle;
  background: transparent;
  color: var(--text);
  border-color: color-mix(in srgb, var(--border) 80%, transparent);
}
.acalc-table thead th {
  background: color-mix(in srgb, var(--surface2, var(--surface)) 88%, var(--surface));
  color: var(--text-muted);
}
.acalc-page .input,
.acalc-page input.acalc-inp,
.acalc-page input[type="text"],
.acalc-page input[type="number"] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--primary) 12%);
  border-radius: 8px;
  background: var(--input-bg, color-mix(in srgb, var(--surface2) 82%, var(--surface))) !important;
  background-color: var(--input-bg, color-mix(in srgb, var(--surface2) 82%, var(--surface))) !important;
  color: var(--input-fg, var(--text)) !important;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.35;
  outline: none;
  color-scheme: inherit;
  -webkit-text-fill-color: var(--input-fg, var(--text));
  caret-color: var(--input-fg, var(--text));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 45%, transparent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.acalc-page .input::placeholder,
.acalc-page input.acalc-inp::placeholder,
.acalc-page input[type="text"]::placeholder,
.acalc-page input[type="number"]::placeholder {
  color: var(--input-placeholder, var(--text-muted));
  opacity: 1;
  -webkit-text-fill-color: var(--input-placeholder, var(--text-muted));
}
.acalc-page .input:hover,
.acalc-page input.acalc-inp:hover,
.acalc-page input[type="text"]:hover,
.acalc-page input[type="number"]:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
}
.acalc-page .input:focus,
.acalc-page input.acalc-inp:focus,
.acalc-page input[type="text"]:focus,
.acalc-page input[type="number"]:focus {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: var(--input-bg, var(--surface2)) !important;
  background-color: var(--input-bg, var(--surface2)) !important;
  box-shadow: 0 0 0 3px var(--focus-ring, color-mix(in srgb, var(--primary) 18%, transparent));
}
.acalc-page input[type="number"] {
  -moz-appearance: textfield;
}
.acalc-page input[type="number"]::-webkit-outer-spin-button,
.acalc-page input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.acalc-page input:-webkit-autofill,
.acalc-page input:-webkit-autofill:hover,
.acalc-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--input-fg, var(--text));
  caret-color: var(--input-fg, var(--text));
  box-shadow: 0 0 0 1000px var(--input-bg, var(--surface2)) inset;
  transition: background-color 99999s ease-out;
}
.acalc-inp { width: 100%; min-width: 0; }
.acalc-inp--num { max-width: 7.5rem; }
.acalc-card--project .acalc-inp--num { max-width: 6.25rem; }
.acalc-inp--locked {
  cursor: default;
  color: var(--text-muted, #64748b);
  background: color-mix(in srgb, var(--surface2, #f1f5f9) 70%, var(--surface, #fff)) !important;
  opacity: 0.92;
}
.acalc-row-actions { white-space: nowrap; width: 3.5rem; }
.acalc-params {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .acalc-params { grid-template-columns: 1fr; }
}
.acalc-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; color: var(--text-muted); }
.acalc-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.acalc-metric {
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--surface2, var(--surface)) 88%, transparent);
}
.acalc-metric-lab { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.acalc-metric-val { font-size: 1rem; font-weight: 650; color: var(--text); word-break: break-word; }
.acalc-metric.is-pos .acalc-metric-val { color: #15803d; }
.acalc-metric.is-neg .acalc-metric-val { color: #b91c1c; }
.acalc-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface2, var(--surface));
}
.acalc-badge.is-ok {
  color: #166534;
  border-color: color-mix(in srgb, #22c55e 40%, var(--border));
  background: color-mix(in srgb, #bbf7d0 55%, var(--surface));
}
.acalc-badge.is-warn {
  color: #9a3412;
  border-color: color-mix(in srgb, #f97316 40%, var(--border));
  background: color-mix(in srgb, #ffedd5 55%, var(--surface));
}
.acalc-notes {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: #9a3412;
  font-size: 0.82rem;
}
.acalc-formula {
  margin: 0.85rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

/* 文案发布向导 */
.cw-publish-page { max-width: 760px; margin: 0 auto; padding-bottom: 2rem; }
.cw-publish-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.cw-publish-head h2 { margin: 0; font-size: 1.05rem; }
.cw-pub-steps {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem;
}
.cw-pub-step {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  border-radius: 999px; padding: 0.28rem 0.72rem; font-size: 0.74rem; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cw-pub-step.is-on { background: var(--primary); color: #fff; border-color: transparent; }
.cw-pub-step.is-done { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--primary); }
.cw-pub-panel {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 0.35rem 1.05rem 1rem;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}
.cw-pub-block { padding: 0.7rem 0 0.35rem; }
.cw-pub-block--check {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  margin-bottom: 0.15rem;
}
.cw-pub-row {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 0.65rem 0.85rem;
  align-items: start;
  padding: 0.72rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.cw-pub-row:last-child { border-bottom: none; }
.cw-pub-row--stack {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
.cw-pub-row--stack .cw-pub-label {
  padding-top: 0;
}
.cw-pub-label {
  font-size: 0.8125rem;
  font-weight: 650;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding-top: 0.55rem;
  line-height: 1.35;
  color: var(--text);
}
.cw-pub-label-text { min-width: 0; }
.cw-pub-ico { font-size: 1rem; line-height: 1.2; flex-shrink: 0; }
.cw-pub-req { color: #dc2626; margin-left: 0.12rem; }
.cw-pub-ctrl {
  font-size: 0.8125rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  container-type: inline-size;
  container-name: cw-pub-ctrl;
}
.cw-pub-ctrl-pair {
  --cw-pub-inline-w: 6.75rem;
  --cw-pub-sep-w: 0.9rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  width: calc(var(--cw-pub-inline-w) * 2 + 0.45rem * 2 + var(--cw-pub-sep-w));
  max-width: 100%;
}
.cw-pub-ctrl-unit {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  flex: none;
}
/* 净宽与无单位输入框一致：单位文案在框外，不挤占输入框宽度 */
.cw-pub-ctrl-unit .input,
.cw-pub-ctrl-unit .cw-pub-short,
.cw-pub-ctrl-unit .cw-pub-num {
  flex: none !important;
  width: 50cqw !important;
  max-width: none !important;
  min-width: 0 !important;
}
.cw-pub-ctrl-inline {
  display: grid;
  grid-template-columns: 50cqw 1.5rem auto;
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.35rem;
  width: 100%;
}
.cw-pub-ctrl-inline .cw-pub-short,
.cw-pub-ctrl-inline .cw-pub-num,
.cw-pub-ctrl-inline > .input {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}
.cw-pub-unit-slot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 1.5rem;
  min-height: var(--cw-pub-control-h, 2.2rem);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1;
  user-select: none;
}
.cw-pub-ctrl-inline .cw-pub-check {
  justify-self: start;
  white-space: nowrap;
  margin: 0;
}
.cw-pub-sep {
  color: var(--text-muted);
  font-weight: 600;
  width: var(--cw-pub-sep-w, 0.9rem);
  text-align: center;
  flex: 0 0 var(--cw-pub-sep-w, 0.9rem);
  line-height: 1;
}
.cw-pub-sep--blank {
  visibility: hidden;
}
.cw-pub-unit {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}
.cw-pub-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
}
.cw-pub-inline {
  width: var(--cw-pub-inline-w, 6.75rem) !important;
  min-width: var(--cw-pub-inline-w, 6.75rem) !important;
  max-width: var(--cw-pub-inline-w, 6.75rem) !important;
  flex: none !important;
  height: var(--cw-pub-control-h, 2.2rem) !important;
  min-height: var(--cw-pub-control-h, 2.2rem) !important;
  max-height: var(--cw-pub-control-h, 2.2rem) !important;
  aspect-ratio: auto !important;
}
.cw-pub-w-pair {
  width: calc(6.75rem * 2 + 0.45rem * 2 + 0.9rem) !important;
  max-width: 100% !important;
  flex: none !important;
  height: var(--cw-pub-control-h, 2.2rem) !important;
  min-height: var(--cw-pub-control-h, 2.2rem) !important;
  max-height: var(--cw-pub-control-h, 2.2rem) !important;
}
.cw-pub-short,
.cw-pub-num {
  /* 相对控件列宽度，避免单位文案挤占净宽；不用 flex-basis 防纵向撑高 */
  width: 50cqw !important;
  max-width: 100% !important;
  flex: none !important;
  height: var(--cw-pub-control-h, 2.2rem) !important;
  min-height: var(--cw-pub-control-h, 2.2rem) !important;
  max-height: var(--cw-pub-control-h, 2.2rem) !important;
  aspect-ratio: auto !important;
  box-sizing: border-box;
  align-self: flex-start;
}
.cw-pub-check, .cw-pub-radio {
  display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.82rem;
}
.cw-pub-dates { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; width: 100%; }
.cw-pub-date-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  width: calc(6.75rem * 2 + 0.45rem * 2 + 0.9rem);
  max-width: 100%;
}
.cw-pub-date-row .input { flex: 1; min-width: 0; width: auto !important; }
.cw-pub-section { margin-top: 0.95rem; padding-top: 0.35rem; }
.cw-pub-section-head {
  display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.88rem;
  margin-bottom: 0.55rem;
}
.cw-pub-itin-day {
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--primary) 30%);
  border-radius: 10px; padding: 0.55rem 0.7rem; margin-bottom: 0.55rem;
  background: color-mix(in srgb, var(--surface2) 35%, var(--surface));
}
.cw-pub-itin-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; color: var(--primary); }
.cw-pub-itin-item { display: flex; align-items: center; gap: 0.4rem; margin: 0.3rem 0; }
.cw-pub-itin-item .input { flex: 1; min-width: 0; }
.cw-pub-itin-no {
  width: 1.5rem; height: 1.5rem; border-radius: 50%; color: #fff;
  font-size: 0.68rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 65%, var(--accent, var(--primary))));
}
.cw-pub-note-block { margin: 0.65rem 0; }
.cw-pub-note-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.cw-pub-note-title { font-weight: 600; font-size: 0.82rem; margin: 0; }
.cw-pub-note-del {
  flex-shrink: 0; color: #dc2626 !important; border-color: color-mix(in srgb, #dc2626 35%, var(--border)) !important;
}
.cw-pub-mat-add-btn {
  width: auto !important; min-width: 6.5rem !important; max-width: none !important;
  padding: 0.55rem 1.1rem !important; font-size: 0.9rem !important; font-weight: 600;
  border-radius: 999px; margin-top: 0.25rem;
}
.cw-pub-fee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.4rem 0.55rem;
  align-items: stretch;
}
.cw-pub-fee-item {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  overflow: hidden;
}
.cw-pub-fee-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}
.cw-pub-switches { margin: 0.65rem 0; }
.cw-pub-tier-row {
  display: grid;
  grid-template-columns: 3.25rem minmax(5rem, 7rem) auto auto 1.1rem minmax(5rem, 7rem);
  align-items: center;
  gap: 0.35rem 0.4rem;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 75%, var(--primary) 25%);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface2));
  font-size: 0.82rem;
}
.cw-pub-tier-row:last-child { margin-bottom: 0; }
.cw-pub-tier-label {
  font-weight: 650;
  color: var(--primary);
  white-space: nowrap;
}
.cw-pub-tier-text {
  color: var(--text-muted);
  white-space: nowrap;
  font-size: 0.8rem;
}
.cw-pub-tier-text--gap { margin-left: 0.15rem; }
.cw-pub-tier-yen {
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
}
.cw-pub-tier-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  height: var(--cw-pub-control-h, 2.2rem) !important;
  min-height: var(--cw-pub-control-h, 2.2rem) !important;
  max-height: var(--cw-pub-control-h, 2.2rem) !important;
}
.cw-pub-tier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 650;
}
.cw-pub-tier-head-title { display: inline-flex; align-items: center; gap: 0.4rem; }
.cw-pub-tier-head-note {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface2) 70%, transparent);
}
.cw-pub-tier-panel {
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--primary) 30%);
  background: color-mix(in srgb, var(--surface2) 40%, var(--surface));
}
.cw-pub-tier-list { margin-bottom: 0.55rem; }
.cw-pub-gbuy .cw-pub-row:last-of-type {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  margin-bottom: 0.55rem;
}
.cw-pub-note-block--tight { margin-top: 0.35rem; margin-bottom: 0; }
@media (max-width: 640px) {
  .cw-pub-tier-row {
    grid-template-columns: 3rem minmax(4rem, 1fr) auto auto 1rem minmax(4rem, 1fr);
    column-gap: 0.3rem;
  }
}
.cw-pub-mat-tabs { margin-bottom: 0.65rem; }
.cw-pub-mat-form { display: grid; gap: 0.4rem; margin-bottom: 0.65rem; }
.cw-pub-hint { font-size: 0.72rem; color: var(--text-muted); margin: 0; font-weight: 400; line-height: 1.4; }
.cw-pub-icon-btn {
  width: 2rem !important; min-width: 2rem !important; max-width: 2.5rem;
  padding: 0.2rem 0 !important; flex-shrink: 0;
}
.cw-pub-textarea { width: 100% !important; box-sizing: border-box; display: block; resize: vertical; }
.cw-pub-gather-group {
  display: grid;
  grid-template-columns: 1fr minmax(5.5rem, 6.5rem) auto auto;
  gap: 0.4rem;
  align-items: end;
  width: min(100%, 42rem);
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
  background: color-mix(in srgb, var(--surface2) 55%, var(--surface));
}
.cw-pub-gather-coord { display: flex; flex-direction: column; gap: 0.2rem; align-items: stretch; }
.cw-pub-gather-coord-txt { font-size: 0.68rem; color: var(--text-muted); font-family: ui-monospace, monospace; max-width: 7.5rem; word-break: break-all; }
.cw-pub-gather-group .input {
  width: 100% !important;
  max-width: none !important;
  height: var(--cw-pub-control-h, 2.2rem) !important;
  min-height: var(--cw-pub-control-h, 2.2rem) !important;
  max-height: var(--cw-pub-control-h, 2.2rem) !important;
  flex: none !important;
  aspect-ratio: auto !important;
}
.cw-pub-gather-lab { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.cw-pub-itin-add-bottom { margin-top: 0.35rem; }
.cw-pub-mat-layout {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(240px, 1.2fr); gap: 0.85rem; align-items: start;
}
.cw-pub-mat-table-wrap { overflow: auto; }
@media (max-width: 720px) {
  .cw-pub-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .cw-pub-label { padding-top: 0; }
  .cw-pub-ctrl-pair,
  .cw-pub-w-pair,
  .cw-pub-date-row {
    width: 100%;
  }
  .cw-pub-inline {
    flex: 1 1 0;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .cw-pub-short,
  .cw-pub-num {
    width: 50cqw !important;
    max-width: 100% !important;
  }
  .cw-pub-ctrl-unit {
    width: auto;
  }
  .cw-pub-ctrl-unit .input,
  .cw-pub-ctrl-unit .cw-pub-short,
  .cw-pub-ctrl-unit .cw-pub-num {
    width: 50cqw !important;
    max-width: none !important;
  }
  .cw-pub-gather-group {
    width: 50%;
    grid-template-columns: 1fr;
  }
  .cw-pub-mat-layout { grid-template-columns: 1fr; }
}

/* 发布页控件主题 */
.cw-publish-page {
  --cw-pub-control-h: 2.2rem;
  --cw-pub-control-radius: 10px;
  --cw-pub-field-w: 50%;
}
.cw-publish-page .input,
.cw-publish-page input[type="text"],
.cw-publish-page input[type="number"],
.cw-publish-page input[type="date"],
.cw-publish-page input[type="time"],
.cw-publish-page select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: color-mix(in srgb, var(--surface2) 82%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--primary) 12%);
  border-radius: var(--cw-pub-control-radius);
  padding: 0 0.72rem;
  height: var(--cw-pub-control-h);
  min-height: var(--cw-pub-control-h);
  max-height: var(--cw-pub-control-h);
  line-height: calc(var(--cw-pub-control-h) - 2px);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  aspect-ratio: auto;
  flex: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 45%, transparent);
}
.cw-publish-page textarea.input,
.cw-publish-page .cw-pub-textarea,
.cw-publish-page textarea {
  min-height: 5.5rem;
  max-height: none;
  height: auto;
  line-height: 1.55;
  padding: 0.65rem 0.75rem;
  resize: vertical;
}
.cw-publish-page .input:hover,
.cw-publish-page input[type="text"]:hover,
.cw-publish-page input[type="number"]:hover,
.cw-publish-page input[type="date"]:hover,
.cw-publish-page input[type="time"]:hover,
.cw-publish-page select:hover,
.cw-publish-page textarea:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}
.cw-publish-page .input:focus,
.cw-publish-page input[type="text"]:focus,
.cw-publish-page input[type="number"]:focus,
.cw-publish-page input[type="date"]:focus,
.cw-publish-page input[type="time"]:focus,
.cw-publish-page select:focus,
.cw-publish-page textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}
.cw-publish-page .input:disabled,
.cw-publish-page select:disabled,
.cw-publish-page textarea:disabled,
.cw-publish-page input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  background: color-mix(in srgb, var(--surface2) 70%, var(--border));
}
.cw-publish-page select.input,
.cw-publish-page select {
  padding-right: 2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--surface2) 88%, var(--surface)),
      color-mix(in srgb, var(--surface2) 88%, var(--surface))
    );
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px),
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
.cw-publish-page select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%),
    linear-gradient(to bottom, var(--surface), var(--surface));
}
.cw-publish-page input[type="date"],
.cw-publish-page input[type="time"] {
  color-scheme: inherit;
}
.cw-publish-page input[type="date"]::-webkit-calendar-picker-indicator,
.cw-publish-page input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.7;
  cursor: pointer;
}
.cw-publish-page .cw-pub-inline {
  width: auto;
  display: inline-block;
  min-width: 5.25rem;
  max-width: 9.5rem;
  vertical-align: middle;
}
.cw-publish-page .cw-pub-check,
.cw-publish-page .cw-pub-radio,
.cw-publish-page .cw-pub-fee-item {
  position: relative;
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0.15rem;
  border-radius: 8px;
  transition: background .15s ease;
}
.cw-publish-page .cw-pub-check:hover,
.cw-publish-page .cw-pub-radio:hover,
.cw-publish-page .cw-pub-fee-item:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.cw-publish-page .cw-pub-check input[type="checkbox"],
.cw-publish-page .cw-pub-radio input[type="radio"],
.cw-publish-page .cw-pub-fee-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  min-height: 1.05rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 1.5px solid color-mix(in srgb, var(--border) 70%, var(--primary) 30%);
  background: color-mix(in srgb, var(--surface2) 80%, var(--surface));
  box-shadow: none;
  display: inline-grid;
  place-content: center;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  accent-color: var(--primary);
}
.cw-publish-page .cw-pub-check input[type="checkbox"],
.cw-publish-page .cw-pub-fee-item input[type="checkbox"] {
  border-radius: 5px;
}
.cw-publish-page .cw-pub-radio input[type="radio"] {
  border-radius: 50%;
}
.cw-publish-page .cw-pub-check input[type="checkbox"]::before,
.cw-publish-page .cw-pub-fee-item input[type="checkbox"]::before {
  content: "";
  width: 0.55rem;
  height: 0.32rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .12s ease;
  margin-top: -0.1rem;
}
.cw-publish-page .cw-pub-radio input[type="radio"]::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .12s ease;
}
.cw-publish-page .cw-pub-check input[type="checkbox"]:checked,
.cw-publish-page .cw-pub-fee-item input[type="checkbox"]:checked,
.cw-publish-page .cw-pub-radio input[type="radio"]:checked {
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--accent, var(--primary))));
  border-color: transparent;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.cw-publish-page .cw-pub-check input[type="checkbox"]:checked::before,
.cw-publish-page .cw-pub-fee-item input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}
.cw-publish-page .cw-pub-radio input[type="radio"]:checked::before {
  transform: scale(1);
}
.cw-publish-page .cw-pub-check input[type="checkbox"]:disabled,
.cw-publish-page .cw-pub-radio input[type="radio"]:disabled,
.cw-publish-page .cw-pub-fee-item input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.cw-publish-page .cw-pub-fee-item {
  padding: 0.35rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 8px;
}
.cw-publish-page .cw-pub-fee-item:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}
.cw-publish-page .cw-pub-mat-form .field label {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

/* ??????? */
.activities-waterfall-page { min-height: 1px; }
.act-pub-tabs-wrap {
  margin: 0 0 0.85rem;
}
.act-pub-tabs-wrap .settings-tabs {
  margin-bottom: 0;
}
.act-waterfall {
  display: grid;
  /* 原 3 列满宽卡 → 单卡宽度保留约 2/3，一行可多排一张 */
  grid-template-columns: repeat(auto-fill, calc((100% - 1.7rem) * 2 / 9));
  gap: 0.85rem;
  align-items: start;
  justify-content: start;
}
.act-waterfall-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  height: auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-sizing: border-box;
}
.act-waterfall-card.is-published {
  min-height: 0;
}
.act-waterfall-cover {
  height: 160px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--border) 55%, transparent);
  overflow: hidden;
}
.act-waterfall-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: top;
}
.act-waterfall-cover--empty { min-height: 160px; }
.act-waterfall-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0.7rem 0.8rem 0.85rem;
  min-height: 0;
  box-sizing: border-box;
}
.act-waterfall-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.act-waterfall-goal {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.act-waterfall-goal-lab {
  color: var(--text);
  font-weight: 600;
}
.act-waterfall-meta {
  display: flex; flex-wrap: wrap; gap: 0.45rem; font-size: 0.75rem; color: var(--text-muted);
}
.act-waterfall-status { color: var(--primary); font-weight: 600; }
.act-waterfall-src {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
}
.act-waterfall-src--web {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
}
.act-waterfall-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.4rem;
}
.act-waterfall-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger, #dc2626);
}
.act-waterfall-enroll-stat {
  margin-top: 0.28rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.act-waterfall-dates { margin-top: 0.35rem; font-size: 0.72rem; color: var(--text-muted); }
.act-waterfall-actions {
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}
.act-waterfall-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
  margin-bottom: 0.15rem;
  /* 两列布局：行数随命令数变化，避免固定占位 */
  min-height: calc(var(--ops-rows, 1) * 2.1rem + max(0, calc(var(--ops-rows, 1) - 1)) * 0.4rem);
}
.act-waterfall-ops .btn-sm {
  flex: 1 1 calc(50% - 0.3rem);
  min-width: 4.8rem;
}
.act-waterfall-ops--n1 .btn-sm {
  flex: 1 1 100%;
}
.act-waterfall-main-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  flex-shrink: 0;
}
.act-waterfall-main-actions .btn-sm {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 5.5rem;
}
.act-waterfall-actions .btn-sm {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 5.5rem;
  width: auto;
}
.act-waterfall-actions .act-delete-btn {
  color: var(--danger, #c0392b);
}
.act-waterfall-main-actions .act-delete-btn.is-disabled,
.act-waterfall-main-actions .act-republish-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (max-width: 1100px) {
  /* 原 2 列 → 单卡宽度保留约 2/3 */
  .act-waterfall { grid-template-columns: repeat(auto-fill, calc((100% - 0.85rem) / 3)); }
}
@media (max-width: 640px) {
  .act-waterfall { grid-template-columns: 1fr; }
}

.cw-pub-wait-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg, #0b1220) 62%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.cw-pub-wait-panel {
  min-width: min(20rem, 88vw);
  padding: 1.35rem 1.5rem 1.45rem;
  border-radius: 16px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--bg) 45%, transparent);
}
.cw-pub-wait-panel .app-loading-spinner { margin: 0 auto 0.85rem; }
.cw-pub-wait-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}
.cw-pub-wait-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cw-pub-wait-hint #cw-pub-wait-sec {
  color: var(--primary);
  font-weight: 700;
}

.cw-pub-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; position: sticky; bottom: 0.5rem;
}
@media (max-width: 720px) {
  .cw-pub-row { grid-template-columns: 1fr; }
  .cw-pub-fee-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
}

@media (max-width: 1100px) {
  .cw-bggrid-layout { grid-template-columns: 1fr 1fr; }
  .cw-bggrid-col--types { grid-column: 1 / -1; }
  .cw-bggrid-types { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .cw-bggrid-type { width: calc(50% - 0.2rem); }
}
@media (max-width: 720px) {
  .cw-bggrid-layout { grid-template-columns: 1fr; }
}

/* 营销接口配置面板 */
.mkt-if-layout{display:grid;grid-template-columns:minmax(220px,280px) 1fr;gap:14px;min-height:420px}
.mkt-if-nav{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface2);padding:.5rem;overflow:auto;max-height:62vh}
.mkt-if-detail{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:14px 16px;min-height:280px}
.mkt-if-cat{margin:0 0 .45rem}
.mkt-if-cat > summary{cursor:pointer;font-weight:600;padding:.35rem .4rem;border-radius:8px}
.mkt-if-sub{padding:.2rem 0 .35rem .35rem}
.mkt-if-sub-title{font-size:.75rem;color:var(--text-muted);margin:.25rem 0}
.mkt-if-app{display:flex;align-items:center;gap:.35rem;width:100%;text-align:left;border:0;background:transparent;color:var(--text);padding:.35rem .45rem;border-radius:8px;cursor:pointer;font:inherit}
.mkt-if-app:hover,.mkt-if-app.is-on{background:color-mix(in srgb,var(--primary) 12%,transparent)}
.mkt-if-dot,.mkt-if-eng{font-size:.68rem;font-style:normal;padding:0 .35rem;border-radius:999px;background:color-mix(in srgb,var(--primary) 18%,transparent);color:var(--primary)}
.mkt-if-detail-hd{margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:center;gap:.35rem}
.mkt-if-howto{margin:14px 0 12px;padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius);background:color-mix(in srgb,var(--surface2) 88%,transparent)}
.mkt-if-howto-hd{font-weight:600;margin:0 0 10px;font-size:.92rem}
.mkt-if-howto-row{display:grid;grid-template-columns:7.5rem 1fr;gap:8px;align-items:start;margin:0 0 8px;font-size:.86rem}
.mkt-if-howto-k{color:var(--text-muted);line-height:1.5}
.mkt-if-howto-v{word-break:break-all;line-height:1.5}
.mkt-if-howto-v a{color:var(--primary)}
.mkt-if-howto-v .muted{color:var(--text-muted)}
.mkt-if-howto-steps{margin-top:10px;padding-top:10px;border-top:1px dashed var(--border)}
.mkt-if-howto-steps-hd{font-size:.82rem;font-weight:600;margin:0 0 6px;color:var(--text-muted)}
.mkt-if-howto-pre{margin:0;white-space:pre-wrap;word-break:break-word;font:inherit;font-size:.84rem;line-height:1.55;color:var(--text);background:transparent;border:0;padding:0}
.mkt-if-access{font-size:.72rem;font-style:normal;padding:.1rem .45rem;border-radius:999px;background:color-mix(in srgb,var(--text-muted) 16%,transparent);color:var(--text-muted);white-space:nowrap}
.mkt-if-access--open{background:color-mix(in srgb,#16a34a 18%,transparent);color:#15803d}
.mkt-if-access--oauth{background:color-mix(in srgb,var(--primary) 18%,transparent);color:var(--primary)}
.mkt-if-access--conditional{background:color-mix(in srgb,#d97706 18%,transparent);color:#b45309}
.mkt-if-access--token{background:color-mix(in srgb,#0284c7 18%,transparent);color:#0369a1}
.mkt-if-access--no_public{background:color-mix(in srgb,#64748b 18%,transparent);color:#475569}
@media (max-width:900px){.mkt-if-layout{grid-template-columns:1fr}.mkt-if-howto-row{grid-template-columns:1fr}}

/* 接口配置 → AI接口：分类分行 + 对接参数 */
.ai-llm-wrap{margin:0}
.ai-llm-cat{border:1px solid var(--border);border-radius:var(--radius,12px);padding:12px 14px;margin:0 0 14px;background:var(--surface)}
.ai-llm-cat-hd{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 10px}
.ai-llm-cat-title{margin:0;font-size:.95rem;font-weight:700}
.ai-llm-cat-arrow{font-weight:500;color:var(--text-muted);padding:0 .25rem}
.ai-llm-cat-count{font-size:.75rem;color:var(--text-muted)}
.ai-llm-rows{display:flex;flex-direction:column;gap:8px}
.ai-llm-row{display:grid;grid-template-columns:minmax(220px,260px) minmax(0,1fr);gap:10px 14px;align-items:start;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface2);opacity:.78}
.ai-llm-row.is-on{opacity:1;border-color:color-mix(in srgb,var(--primary) 45%,var(--border));background:color-mix(in srgb,var(--primary) 6%,var(--surface2))}
.ai-llm-row-id{display:flex;align-items:center;gap:8px;min-width:0;padding-top:4px}
.ai-llm-row-meta{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.ai-llm-row-name{font-size:.86rem;line-height:1.3}
.ai-llm-row-vendor{font-size:.72rem;color:var(--text-muted)}
.ai-llm-row-notice{font-size:.72rem;color:#b45309;line-height:1.35;margin-top:2px}
.ai-llm-enable{display:flex;align-items:center;gap:4px;font-size:.78rem;white-space:nowrap;margin-left:auto}
.ai-llm-row-body{display:flex;flex-direction:column;gap:8px;min-width:0}
.ai-llm-row-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}
.ai-llm-field{display:flex;flex-direction:column;gap:4px;margin:0}
.ai-llm-field--portal{grid-column:1/-1}
.ai-llm-field-label{font-size:.72rem;color:var(--text-muted);display:flex;align-items:center;gap:6px}
.ai-llm-portal-link{appearance:none;border:0;background:none;padding:0;margin:0;font:inherit;font-size:.72rem;color:var(--primary);cursor:pointer;text-decoration:none}
.ai-llm-portal-link:hover{text-decoration:underline}
.ai-llm-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.ai-llm-input{width:100%;min-width:0}
.ai-llm-icon{position:relative;display:grid;place-items:center;width:36px;height:36px;border-radius:8px;background:#fff;overflow:hidden;flex:0 0 36px}
.ai-llm-icon>*{grid-area:1/1;width:36px;height:36px;max-width:36px;max-height:36px}
.ai-llm-icon img{display:block;object-fit:contain;opacity:0}
.ai-llm-icon img.is-on{opacity:1}
.ai-llm-icon:has(img.is-on) .ai-llm-fallback{visibility:hidden}
.ai-llm-fallback{display:flex;align-items:center;justify-content:center;width:36px;height:36px;font-weight:700;font-size:.95rem;color:var(--primary)}
@media (max-width:900px){
  .ai-llm-row{grid-template-columns:1fr}
  .ai-llm-enable{margin-left:0}
}

/* ϵͳ��־ �� ������־ */
.sys-log-user{display:flex;align-items:center;gap:8px;min-width:0}
.sys-log-avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:0 0 28px;background:var(--surface2,#e2e8f0)}
.sys-log-avatar--empty{display:inline-block}
.sys-log-user-name{font-size:.86rem;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sys-log-events{max-width:360px}
.sys-log-events summary{cursor:pointer;list-style:none;color:var(--text);font-size:.84rem;line-height:1.4}
.sys-log-events summary::-webkit-details-marker{display:none}
.sys-log-events-list{margin:6px 0 0;padding:0 0 0 1.1em;font-size:.8rem;color:var(--text-muted);line-height:1.45}
.sys-log-ev-idx{color:var(--text-muted)}

/* document-convert PDF to DOCX */
.dc-page{display:flex;flex-direction:column;gap:1rem;max-width:720px}
.dc-page .page-head h2{margin:0 0 .35rem;font-size:1.25rem}
.dc-page .page-sub{margin:0;color:var(--text-muted);font-size:.875rem;line-height:1.5}
.dc-caps{display:flex;flex-wrap:wrap;gap:.4rem}
.dc-pill{
  display:inline-flex;align-items:center;padding:.2rem .55rem;border-radius:999px;
  font-size:.72rem;font-weight:600;border:1px solid var(--border);
  background:var(--surface2);color:var(--text-muted)
}
.dc-pill.is-on{
  color:color-mix(in srgb, var(--primary) 85%, #166534);
  border-color:color-mix(in srgb, var(--primary) 35%, var(--border));
  background:color-mix(in srgb, var(--primary) 10%, var(--surface))
}
.dc-hint{margin:0;font-size:.8125rem;color:var(--text-muted);line-height:1.45}
.dc-engine-row{
  display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem;
  padding:.65rem .85rem;border:1px solid var(--border);border-radius:10px;
  background:var(--surface2)
}
.dc-engine-row label{font-size:.8125rem;font-weight:600;color:var(--text)}
.dc-engine-row select{
  min-width:9rem;padding:.35rem .55rem;border-radius:8px;
  border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:.875rem
}
.dc-engine-hint{font-size:.75rem;color:var(--text-muted)}
.dc-drop{
  position:relative;border:1.5px dashed color-mix(in srgb, var(--border) 70%, var(--primary));
  border-radius:12px;padding:2rem 1.25rem;text-align:center;
  background:color-mix(in srgb, var(--surface2) 70%, transparent);cursor:pointer;
  transition:border-color .15s,background .15s,box-shadow .15s
}
.dc-drop:hover,.dc-drop.is-over{
  border-color:var(--primary);
  background:color-mix(in srgb, var(--primary) 6%, var(--surface));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent)
}
.dc-drop.is-busy{opacity:.72;pointer-events:none;cursor:wait}
.dc-drop-inner{pointer-events:none}
.dc-drop input[type=file]{
  position:absolute;inset:0;opacity:0;cursor:pointer;pointer-events:auto;font-size:0
}
.dc-drop-icon{font-size:2rem;margin-bottom:.35rem;line-height:1}
.dc-drop-title{margin:0;font-weight:600;font-size:.95rem}
.dc-drop-sub{margin:.35rem 0 0;font-size:.8125rem;color:var(--text-muted)}
.dc-denied{
  padding:1.25rem;border-radius:12px;border:1px solid var(--border);
  background:var(--surface2);color:var(--text-muted);text-align:center
}
.dc-result{
  padding:1rem 1.15rem;border-radius:12px;border:1px solid var(--border);
  background:var(--surface);display:flex;flex-direction:column;gap:.35rem
}
.dc-result h3{margin:0 0 .25rem;font-size:1rem}
.dc-result p{margin:0;font-size:.875rem;line-height:1.45}
.dc-warns{margin:.35rem 0 0;padding:0 0 0 1.1em;font-size:.8rem;color:var(--text-muted);line-height:1.45}
.dc-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.65rem}
.content.dc-wait-host,
.content.dc-wait-lock{position:relative!important}
.content.dc-wait-lock{overflow:hidden!important}
.dc-wait-overlay{
  position:absolute!important;inset:0!important;z-index:50!important;
  display:flex!important;align-items:flex-start;justify-content:center;
  padding:max(3.5rem,12vh) 1rem 1rem;box-sizing:border-box;
  background:color-mix(in srgb, var(--bg,#0b1220) 58%, transparent);
  backdrop-filter:blur(10px) saturate(140%);
  -webkit-backdrop-filter:blur(10px) saturate(140%);
  pointer-events:auto!important
}
.dc-wait-panel{
  display:flex;flex-direction:column;align-items:center;gap:.55rem;
  margin:0 auto;padding:1.15rem 1.4rem;max-width:min(92vw,26rem);text-align:center;
  border-radius:14px;
  background:color-mix(in srgb, var(--surface,#fff) 94%, transparent);
  border:1px solid color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
  box-shadow:0 16px 40px color-mix(in srgb, #000 14%, transparent)
}
.dc-wait-title{margin:0;font-size:.95rem;font-weight:600;color:var(--text);line-height:1.45}
.dc-wait-timer{margin:0;font-size:.88rem;font-weight:600;color:var(--primary);font-variant-numeric:tabular-nums}
.dc-wait-bar-wrap{width:100%;max-width:16rem;margin:.15rem 0 .1rem}
.dc-wait-bar-wrap[hidden]{display:none!important}
.dc-wait-bar{
  position:relative;height:1.35rem;border-radius:999px;overflow:hidden;
  background:color-mix(in srgb, var(--surface2,#e2e8f0) 85%, var(--border));
  border:1px solid color-mix(in srgb, var(--border) 70%, var(--primary) 30%)
}
.dc-wait-bar-fill{
  position:absolute;left:0;top:0;bottom:0;width:0%;
  background:linear-gradient(90deg,
    color-mix(in srgb, var(--primary) 75%, #22c55e),
    var(--primary, #3b82f6));
  transition:width .2s ease
}
.dc-wait-bar-pct{
  position:relative;z-index:1;display:flex;align-items:center;justify-content:center;
  height:100%;font-size:.75rem;font-weight:700;color:var(--text);
  text-shadow:0 0 4px color-mix(in srgb, var(--surface,#fff) 80%, transparent);
  font-variant-numeric:tabular-nums
}
.dc-wait-bytes{margin:0;font-size:.84rem;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;line-height:1.4}
.dc-wait-bytes[hidden]{display:none!important}
.dc-wait-hint{margin:0;font-size:.78rem;color:var(--text-muted)}
.dc-wait-stages{width:100%;display:flex;flex-direction:column;gap:.65rem;text-align:left}
.dc-wait-stage{
  padding:.55rem .65rem;border-radius:10px;
  border:1px solid color-mix(in srgb, var(--border) 75%, transparent);
  background:color-mix(in srgb, var(--surface2,#f1f5f9) 55%, transparent);
  opacity:.72;transition:opacity .2s ease,border-color .2s ease
}
.dc-wait-stage[data-state="active"]{
  opacity:1;
  border-color:color-mix(in srgb, var(--primary) 45%, var(--border));
  background:color-mix(in srgb, var(--primary) 8%, var(--surface,#fff))
}
.dc-wait-stage[data-state="done"]{opacity:1}
.dc-wait-stage[data-state="pending"] .dc-wait-stage-desc{color:var(--text-muted)}
.dc-wait-stage-head{display:flex;align-items:center;gap:.4rem;margin-bottom:.35rem}
.dc-wait-stage-num{
  flex:0 0 auto;width:1.25rem;height:1.25rem;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:.7rem;font-weight:700;color:#fff;background:var(--primary,#3b82f6)
}
.dc-wait-stage[data-state="done"] .dc-wait-stage-num{background:#16a34a}
.dc-wait-stage[data-state="pending"] .dc-wait-stage-num{
  background:color-mix(in srgb, var(--text-muted) 55%, var(--border))
}
.dc-wait-stage-label{flex:1;font-size:.86rem;font-weight:600;color:var(--text)}
.dc-wait-stage-badge{
  font-size:.68rem;font-weight:600;padding:.1rem .4rem;border-radius:999px;
  color:var(--text-muted);
  background:color-mix(in srgb, var(--surface,#fff) 70%, var(--border))
}
.dc-wait-stage[data-state="active"] .dc-wait-stage-badge{color:var(--primary);background:color-mix(in srgb, var(--primary) 12%, var(--surface,#fff))}
.dc-wait-stage[data-state="done"] .dc-wait-stage-badge{color:#16a34a}
.dc-wait-stage-desc{margin:0;font-size:.78rem;color:var(--text);line-height:1.4}
.dc-wait-panel .dc-wait-bar-wrap{max-width:none;margin:.1rem 0}
