[hidden] { display: none !important; }

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  background: #f4f6f8;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
}

.login-card {
  width: min(960px, 100%);
  background: #ffffff;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.09);
  padding: 34px;
}

.login-brand,
.sidebar-brand,
.topbar,
.panel-head,
.modal-head,
.user-box {
  display: flex;
  align-items: center;
}

.login-brand {
  gap: 16px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #c93f7d;
  color: #ffffff;
  font-weight: 700;
  font-size: 22px;
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

.login-brand h1 {
  font-size: 24px;
  line-height: 1.25;
}

.login-brand p,
.topbar p,
.status-line {
  color: #697586;
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.login-panel {
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 24px;
  min-height: 394px;
}

.panel-head {
  justify-content: space-between;
  gap: 16px;
}

.login-panel h2 {
  font-size: 18px;
  line-height: 1.3;
}

.qr-box {
  width: 280px;
  height: 280px;
  margin: 24px auto 16px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffffff;
  overflow: hidden;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-placeholder {
  color: #9aa4b2;
  font-size: 14px;
}

.status-line {
  min-height: 22px;
  font-size: 14px;
  line-height: 1.5;
}

.password-form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.password-form label {
  display: grid;
  gap: 8px;
  color: #364152;
  font-size: 14px;
}

.password-form input {
  height: 42px;
  border: 1px solid #cdd5df;
  border-radius: 6px;
  padding: 0 12px;
  outline: none;
}

.password-form input:focus {
  border-color: #c93f7d;
  box-shadow: 0 0 0 3px rgba(201, 63, 125, 0.14);
}

.primary-button,
.danger-button,
.ghost-button,
.nav-item,
.status-tab,
.icon-button {
  border-radius: 6px;
  border: 0;
}

.primary-button {
  height: 42px;
  background: #c93f7d;
  color: #ffffff;
  font-weight: 600;
}

.danger-button {
  height: 34px;
  padding: 0 14px;
  background: #9f2f62;
  color: #ffffff;
  font-weight: 600;
}

.ghost-button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #cdd5df;
  background: #ffffff;
  color: #364152;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 76px 204px minmax(0, 1fr);
}

.primary-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #18212f;
  color: #ffffff;
  padding: 18px 8px;
  overflow-y: auto;
}

.primary-sidebar .sidebar-brand {
  justify-content: center;
  margin-bottom: 18px;
}

.primary-sidebar .brand-mark {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.primary-nav {
  display: grid;
  gap: 2px;
}

.primary-nav-item {
  width: 100%;
  min-height: 56px;
  padding: 7px 2px;
  border: 0;
  border-radius: 4px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  background: transparent;
  color: #aeb7c5;
  font-size: 13px;
  line-height: 1.2;
}

.primary-nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.primary-nav-item.active {
  color: #ffffff;
  background: #c93f7d;
}

.secondary-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e4e7eb;
  overflow-y: auto;
}

.secondary-heading {
  min-height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #edf0f3;
  font-size: 18px;
}

.secondary-nav {
  padding: 12px;
}

.secondary-group {
  padding: 8px 0 12px;
  border-bottom: 1px solid #edf0f3;
}

.secondary-group:last-child {
  border-bottom: 0;
}

/* 分組標題：照有贊＝灰色小字＋收合箭頭，明顯不同於可點的子項（子項再縮排一層）。
   （2026-07-28：原本標題與子項字級/顏色接近，同事看起來會擠成一團分不出層級） */
.secondary-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px 4px;
  padding: 6px 8px 4px;
  color: #8b95a5;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.secondary-group-title::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #b6bec9;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px 8px 26px;
  text-align: left;
  background: transparent;
  color: #52606d;
  font-size: 14px;
  border-radius: 6px;
}

/* 無分組標題的組（例：设置的「通用设置」、数据前四項）＝子項不縮排，與有贊一致 */
.secondary-group.no-title .nav-item {
  padding-left: 12px;
}

.nav-item:hover {
  color: #1f2933;
  background: #f7f8fa;
}

.nav-item.active {
  background: #f6edf2;
  color: #9f2f62;
  font-weight: 600;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.topbar h1 {
  font-size: 24px;
  line-height: 1.3;
}

.topbar p {
  margin-top: 4px;
  font-size: 14px;
}

.user-box {
  gap: 12px;
  white-space: nowrap;
}

.content-panel {
  background: #ffffff;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.placeholder-panel {
  min-height: 320px;
  padding: 28px 32px;
}

.placeholder-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.placeholder-status {
  margin-top: 8px;
  color: #9aa4b2;
  font-size: 14px;
}

.placeholder-preview {
  max-width: 760px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #edf0f3;
}

.placeholder-preview h3 {
  margin: 0 0 12px;
  color: #364152;
  font-size: 15px;
}

.placeholder-preview ul {
  margin: 0;
  padding-left: 20px;
  color: #52606d;
  font-size: 14px;
  line-height: 1.8;
}

.order-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid #e4e7eb;
  background: #fbfcfd;
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-tab {
  height: 32px;
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid #cdd5df;
  color: #4b5565;
}

.status-tab.active {
  border-color: #c93f7d;
  background: #fff1f7;
  color: #9f2f62;
  font-weight: 600;
}

.table-status {
  padding: 18px 20px;
  color: #697586;
  border-bottom: 1px solid #e4e7eb;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: #4b5565;
  background: #f8fafc;
  font-weight: 600;
}

td:first-child,
th:first-child {
  width: 48%;
}

.products-table td:first-child,
.products-table th:first-child {
  width: 34%;
}

.products-table th:last-child,
.products-table td:last-child {
  width: 12%;
}

.orders-table td:first-child,
.orders-table th:first-child {
  width: 25%;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2),
.orders-table th:nth-child(3),
.orders-table td:nth-child(3),
.orders-table th:nth-child(5),
.orders-table td:nth-child(5),
.orders-table th:nth-child(6),
.orders-table td:nth-child(6),
.orders-table th:nth-child(7),
.orders-table td:nth-child(7) {
  width: 11%;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
  width: 13%;
}

.orders-table th:nth-child(7),
.orders-table td:nth-child(7) {
  width: 18%;
}

.muted {
  color: #697586;
}

.small-text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.empty-cell {
  text-align: center;
}

.table-action {
  height: 30px;
  padding: 0 12px;
}

.danger-action {
  color: #9f2f62;
  border-color: #e6b8cc;
  margin-left: 6px;
}

.panel-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.image-block {
  margin-top: 14px;
}

.image-block-label {
  display: block;
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 4px;
}

.image-hint {
  display: block;
  font-size: 12px;
  color: #98a2b3;
  line-height: 1.5;
  margin-bottom: 6px;
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.image-empty {
  font-size: 12px;
  color: #98a2b3;
}

.image-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 12px;
  color: #98a2b3;
}

.image-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

.upload-button {
  display: inline-block;
  padding: 6px 14px;
  border: 1px dashed #cdd5df;
  border-radius: 6px;
  color: #364152;
  font-size: 13px;
  cursor: pointer;
}

.category-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 4px 0;
}

.category-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #364152;
  cursor: pointer;
}

.category-check input {
  margin: 0;
}

.preview-card {
  max-width: 420px;
}

.preview-phone {
  width: 320px;
  max-width: 100%;
  margin: 0 auto;
  background: #f5f6f8;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  max-height: 70vh;
  overflow-y: auto;
}

.pv-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
}

.pv-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pv-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #98a2b3;
  font-size: 13px;
}

.pv-block {
  background: #ffffff;
  margin-top: 8px;
  padding: 12px 14px;
}

.pv-price {
  color: #c93f7d;
  font-size: 24px;
  font-weight: 700;
}

.pv-strike {
  color: #98a2b3;
  text-decoration: line-through;
  font-size: 13px;
  margin-top: 2px;
}

.pv-name {
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
}

.pv-record {
  font-size: 12px;
  color: #555555;
  margin-top: 6px;
  word-break: break-all;
}

.pv-meta {
  font-size: 12px;
  color: #98a2b3;
  margin-top: 8px;
}

.pv-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pv-detail-img {
  width: 100%;
  display: block;
  margin-bottom: 4px;
}

.image-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

.media-thumb {
  width: 80px;
  height: 80px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.campaign-slot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 8px 8px 0;
  vertical-align: top;
}

/* 首页装修改版：左侧管理、右侧手机即时预览 */
#campaignsPanel {
  overflow: auto;
}

.campaign-workspace {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) 423px;
  min-width: 900px;
  min-height: 680px;
}

.campaign-manager {
  min-width: 0;
  border-right: 1px solid #e4e7eb;
}

.campaign-panel-head,
.campaign-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid #e4e7eb;
  background: #fbfcfd;
}

.campaign-panel-head h2,
.campaign-preview-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.campaign-panel-head p,
.campaign-preview-head p,
.campaign-editor-intro p,
.modal-subtitle {
  margin: 5px 0 0;
  color: #697586;
  font-size: 13px;
  line-height: 1.5;
}

.campaign-create-button {
  flex: 0 0 auto;
  padding: 0 16px;
}

.campaign-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.campaign-list-empty {
  padding: 42px 18px;
  color: #697586;
  text-align: center;
  line-height: 1.7;
}

.campaign-row {
  display: grid;
  grid-template-columns: 34px minmax(132px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.campaign-row:hover,
.campaign-row.is-editing {
  border-color: #d68aae;
  box-shadow: 0 3px 12px rgba(159, 47, 98, 0.08);
}

.campaign-row.is-dragging {
  opacity: 0.45;
}

.campaign-drag-handle,
.array-drag-handle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #f2f4f7;
  color: #697586;
  font-size: 19px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.campaign-drag-handle:active,
.array-drag-handle:active {
  cursor: grabbing;
}

.campaign-row-name {
  min-width: 0;
}

.campaign-row-title {
  color: #1f2933;
  font-size: 14px;
  font-weight: 700;
}

.campaign-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: #98a2b3;
  font-size: 12px;
}

.draft-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff3d6;
  color: #8a5700;
  font-size: 12px;
  font-weight: 600;
}

.campaign-row-actions {
  display: flex;
  gap: 6px;
}

.campaign-row-actions .danger-action {
  margin-left: 0;
}

.campaign-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b5565;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.campaign-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.campaign-switch-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cdd5df;
  transition: background 140ms ease;
}

.campaign-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 140ms ease;
}

.campaign-switch input:checked + .campaign-switch-track {
  background: #c93f7d;
}

.campaign-switch input:checked + .campaign-switch-track::after {
  transform: translateX(18px);
}

.campaign-switch input:focus-visible + .campaign-switch-track {
  outline: 3px solid rgba(201, 63, 125, 0.18);
}

.campaign-preview-panel {
  min-width: 0;
  background: #f7f8fa;
}

.campaign-phone-shell {
  width: 399px;
  margin: 20px auto;
  padding: 11px;
  border: 1px solid #cdd5df;
  border-radius: 30px;
  background: #202a37;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.campaign-phone-speaker {
  width: 54px;
  height: 5px;
  margin: 1px auto 10px;
  border-radius: 999px;
  background: #778292;
}

.campaign-phone-screen {
  width: 375px;
  height: 610px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 20px;
  background: #f5f6f8;
}

.campaign-preview-empty {
  display: grid;
  min-height: 610px;
  place-items: center;
  padding: 28px;
  color: #697586;
  text-align: center;
  line-height: 1.7;
}

.campaign-phone-screen .block-web.is-admin-draft {
  position: relative;
  opacity: 0.45;
  outline: 4px dashed #c47a18;
  outline-offset: -4px;
}

.campaign-phone-screen .block-web.is-admin-draft::before {
  content: "草稿 · 顾客暂时看不到";
  position: absolute;
  z-index: 10;
  top: 12px;
  right: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #8a5700;
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  pointer-events: none;
}

.campaign-editor-modal {
  width: min(820px, 100%);
}

.campaign-editor-intro {
  padding: 14px 16px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #fbfcfd;
}

.campaign-editor-fields {
  display: grid;
  gap: 16px;
}

.campaign-field-card,
.campaign-array-group {
  padding: 15px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.campaign-field-label,
.campaign-array-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #364152;
  font-size: 14px;
  font-weight: 600;
}

.required-mark {
  margin-left: 4px;
  color: #c93f7d;
}

.campaign-field-input,
.campaign-link-row input,
.campaign-link-row select,
.text-list-row input,
.product-picker-search input {
  width: 100%;
  height: 40px;
  border: 1px solid #cdd5df;
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: #1f2933;
  outline: none;
}

.campaign-field-input:focus,
.campaign-link-row input:focus,
.campaign-link-row select:focus,
.text-list-row input:focus,
.product-picker-search input:focus {
  border-color: #c93f7d;
  box-shadow: 0 0 0 3px rgba(201, 63, 125, 0.14);
}

.campaign-field-hint {
  margin-top: 7px;
  color: #98a2b3;
  font-size: 12px;
  line-height: 1.45;
}

.campaign-color-row,
.campaign-image-control,
.campaign-product-control,
.campaign-link-row,
.text-list-row,
.campaign-array-head,
.campaign-array-item-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.campaign-color-row input[type="color"] {
  width: 52px;
  height: 40px;
  padding: 4px;
  border: 1px solid #cdd5df;
  border-radius: 6px;
  background: #ffffff;
}

.campaign-color-value {
  color: #697586;
  font-size: 13px;
}

.campaign-image-control .image-thumb {
  flex: 0 0 auto;
}

.campaign-image-actions,
.campaign-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.campaign-link-row {
  align-items: stretch;
}

.campaign-link-row select {
  width: 170px;
  flex: 0 0 auto;
}

.campaign-link-product-button[hidden] {
  display: none;
}

.text-list-control,
.campaign-array-items {
  display: grid;
  gap: 8px;
}

.text-list-row input {
  flex: 1;
  min-width: 0;
}

.campaign-array-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.campaign-array-title {
  margin: 0;
}

.campaign-array-empty {
  padding: 22px;
  border: 1px dashed #cdd5df;
  border-radius: 7px;
  color: #98a2b3;
  text-align: center;
  font-size: 13px;
}

/* 绘制热区控件 */
.hotspot-editor-tip {
  margin: 4px 0 10px;
  font-size: 12px;
  color: #667085;
  line-height: 1.5;
}
.hotspot-stage {
  position: relative;
  width: 100%;
  max-width: 375px;
  margin: 0 auto 14px;
  user-select: none;
  cursor: crosshair;
  border: 1px solid #e4e7eb;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0;
}
.hotspot-stage-img {
  width: 100%;
  display: block;
  pointer-events: none;
}
.hotspot-box {
  position: absolute;
  border: 2px solid #2f6fed;
  background: rgba(47, 111, 237, 0.18);
  box-sizing: border-box;
  pointer-events: none;
}
.hotspot-box-ghost {
  border-style: dashed;
  background: rgba(47, 111, 237, 0.12);
}
.hotspot-box-badge {
  position: absolute;
  top: -1px;
  left: -1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #2f6fed;
  color: #ffffff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  border-radius: 0 0 6px 0;
}
.hotspot-area-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.campaign-array-item {
  padding: 12px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #fbfcfd;
}

.campaign-array-item.is-dragging {
  opacity: 0.45;
}

.campaign-array-item-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.campaign-array-item-title {
  flex: 1;
  color: #4b5565;
  font-size: 13px;
  font-weight: 700;
}

.campaign-array-item-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.campaign-array-item-fields .campaign-field-card {
  padding: 12px;
  background: #ffffff;
}

.campaign-field-wide {
  grid-column: 1 / -1;
}

.campaign-auto-id {
  color: #697586;
  font-size: 13px;
}

.campaign-selected-products {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.campaign-product-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #4b5565;
  font-size: 12px;
}

.campaign-product-chip button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d8dee6;
  color: #4b5565;
  line-height: 1;
}

.campaign-message {
  min-height: 24px;
  color: #9f2f62;
}

.campaign-type-modal {
  width: min(900px, 100%);
}

.campaign-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.campaign-type-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2933;
  text-align: left;
}

.campaign-type-card:hover,
.campaign-type-card:focus-visible {
  border-color: #c93f7d;
  box-shadow: 0 4px 14px rgba(159, 47, 98, 0.1);
  outline: none;
}

.campaign-type-card strong,
.campaign-type-card span {
  display: block;
}

.campaign-type-card strong {
  font-size: 15px;
}

.campaign-type-card span {
  margin-top: 7px;
  color: #697586;
  font-size: 13px;
  line-height: 1.5;
}

.campaign-product-modal {
  width: min(760px, 100%);
}

.product-picker-search {
  display: grid;
  gap: 7px;
  color: #4b5565;
  font-size: 13px;
}

.campaign-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  max-height: 50vh;
  overflow-y: auto;
}

.campaign-product-option {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #e4e7eb;
  border-radius: 7px;
  background: #ffffff;
  cursor: pointer;
}

.campaign-product-option:hover,
.campaign-product-option.is-selected {
  border-color: #d68aae;
  background: #fff8fb;
}

.campaign-product-thumb {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  background: #f2f4f7;
}

.campaign-product-name {
  min-width: 0;
  overflow: hidden;
  color: #364152;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-product-check {
  width: 18px;
  height: 18px;
  accent-color: #c93f7d;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-tag.on {
  background: #e7f6ec;
  color: #16794c;
}

.status-tag.off {
  background: #f2f4f7;
  color: #697586;
}

.status-tag.status-pending_pay {
  background: #fff7e6;
  color: #9a5b00;
}

.status-tag.status-pending_ship {
  background: #fff1f7;
  color: #9f2f62;
}

.status-tag.status-shipped {
  background: #e8f1ff;
  color: #235ea8;
}

.status-tag.status-completed {
  background: #e7f6ec;
  color: #16794c;
}

.status-tag.status-cancelled,
.status-tag.status-unknown {
  background: #f2f4f7;
  color: #697586;
}

.pending-panel {
  background: #fbfcfd;
}

.soon-badge {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #eef2f6;
  color: #4b5565;
  font-size: 12px;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(15, 23, 42, 0.44);
}

.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 64px);
  overflow: auto;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.modal-card-narrow {
  width: min(520px, 100%);
}

.modal-head {
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #e4e7eb;
}

.modal-head h2 {
  font-size: 20px;
  line-height: 1.3;
}

.icon-button {
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: #697586;
  border: 1px solid #cdd5df;
  font-size: 20px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
}

.ship-section {
  display: grid;
  gap: 12px;
}

.ship-section h3 {
  margin: 0;
  color: #364152;
  font-size: 15px;
  line-height: 1.4;
}

.ship-list {
  display: grid;
  gap: 8px;
}

.ship-line {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #fbfcfd;
}

.info-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
}

.info-list dt {
  color: #697586;
}

.info-list dd {
  margin: 0;
}

.form-field {
  display: grid;
  gap: 8px;
  color: #364152;
  font-size: 14px;
}

.form-field input,
.form-field select {
  height: 40px;
  border: 1px solid #cdd5df;
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: #1f2933;
  outline: none;
}

.form-field input:focus,
.form-field select:focus {
  border-color: #c93f7d;
  box-shadow: 0 0 0 3px rgba(201, 63, 125, 0.14);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid #e4e7eb;
}

.modal-actions .primary-button,
.modal-actions .ghost-button {
  min-width: 84px;
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .login-page {
    padding: 18px;
  }

  .login-card {
    padding: 22px;
  }

  .login-grid,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .primary-sidebar,
  .secondary-sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  .primary-sidebar {
    padding: 10px;
  }

  .primary-sidebar .sidebar-brand {
    display: none;
  }

  .primary-nav {
    grid-template-columns: repeat(9, minmax(64px, 1fr));
    overflow-x: auto;
  }

  .primary-nav-item {
    min-height: 48px;
  }

  .secondary-heading {
    min-height: 52px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .ship-line,
  .info-list div {
    grid-template-columns: 1fr;
  }

  .qr-box {
    width: min(280px, 100%);
    aspect-ratio: 1;
    height: auto;
  }

  .campaign-type-grid,
  .campaign-product-list,
  .campaign-array-item-fields {
    grid-template-columns: 1fr;
  }
}

/* 库存偏低/售完的庫存數字標紅，讓同事一眼看到要補貨 */
.stock-warning {
  color: #c0392b;
  font-weight: 600;
}

.inline-search input {
  min-width: 220px;
}

/* ===== 概况（dashboard）===== */
.dash-section {
  padding: 18px 20px;
  border-bottom: 1px solid #edf0f3;
}

.dash-section:last-child { border-bottom: 0; }

.dash-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-head h2 { font-size: 16px; }

.dash-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.dash-metric {
  padding: 16px;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  background: #fbfcfd;
}

.dash-metric-alert {
  border-color: #f0c6d8;
  background: #fdf5f8;
}

.dash-metric-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: #1f2933;
}

.dash-metric-label {
  margin-top: 6px;
  color: #697586;
  font-size: 13px;
}

.dash-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-shortcut {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #cdd5df;
  border-radius: 6px;
  background: #ffffff;
  color: #364152;
  font-size: 14px;
}

.dash-shortcut:hover {
  border-color: #c93f7d;
  color: #9f2f62;
}

.dash-todo {
  display: grid;
  gap: 8px;
}

.dash-todo-item {
  justify-self: start;
  padding: 10px 14px;
  border: 1px solid #f0c6d8;
  border-radius: 6px;
  background: #fdf5f8;
  color: #9f2f62;
  font-size: 14px;
  text-align: left;
}

/* ===== 素材中心 ===== */
.materials-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 16px;
}

.material-card {
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.material-thumb {
  height: 120px;
  border-radius: 6px;
  background: #f4f6f8;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.material-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.material-name {
  font-size: 12px;
  color: #52606d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-copy {
  width: 100%;
  font-size: 12px;
}

/* 链接大全的路徑用等寬字，同事比較好核對 */
#storeLinksBody code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: #364152;
  background: #f4f6f8;
  padding: 2px 6px;
  border-radius: 4px;
}
