:root {
  color-scheme: light;
  --ink: #18212c;
  --muted: #788292;
  --line: #e4e8ef;
  --paper: #ffffff;
  --soft: #f5f7fa;
  --night: #171a20;
  --night-2: #20242d;
  --night-3: #2a303b;
  --blue: #2d8cff;
  --violet: #2d8cff;
  --pink: #ff4f77;
  --green: #2aa979;
  --orange: #ff9d3c;
  --danger: #e65162;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* Compact full-width timeline rules stay near the top so legacy appended rules cannot restore scroll bars. */
.admin-template-editor-page-form .template-timeline-ruler,
.admin-template-editor-page-form .template-timeline-track {
  width: 100% !important;
  min-width: 0 !important;
}

.admin-template-editor-page-form .template-timeline-scroll {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 142px !important;
  height: 142px !important;
  overflow: hidden !important;
  padding-bottom: 0 !important;
}

.admin-template-editor-page-form .template-timeline-track {
  min-height: 142px !important;
  height: 142px !important;
}

.admin-template-editor-page-form .template-base-track {
  top: 16px !important;
  height: 106px !important;
}

.admin-template-editor-page-form .template-range-slot {
  top: 36px !important;
  min-width: 28px !important;
  height: 72px !important;
  border-width: 1px !important;
  border-radius: 5px !important;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body {
  gap: 3px !important;
  padding: 4px 6px !important;
}

.admin-template-editor-page-form .template-slot-handle {
  width: 8px !important;
}

.admin-template-editor-page-form .template-slot-handle.is-start {
  left: -4px !important;
}

.admin-template-editor-page-form .template-slot-handle.is-end {
  right: -4px !important;
}

.admin-template-editor-page-form .template-timeline-transition {
  top: 7px !important;
  width: 22px !important;
  min-width: 22px !important;
  height: 124px !important;
}

.admin-template-editor-page-form .template-timeline-playhead {
  top: 2px !important;
  bottom: 2px !important;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-workspace {
  align-items: start !important;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-visual-column {
  align-self: start !important;
  grid-template-rows: auto auto !important;
  height: auto !important;
  overflow: visible !important;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-panel {
  height: auto !important;
  grid-template-rows: auto auto auto 142px !important;
  overflow: hidden !important;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage {
  height: clamp(190px, 24vh, 240px) !important;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage video {
  height: min(21vh, 215px) !important;
  max-height: 215px !important;
}

.admin-template-editor-page-form .template-fixed-slot {
  position: absolute;
  top: 36px;
  z-index: 3;
  display: flex;
  align-items: stretch;
  min-width: 28px;
  height: 72px;
  border: 1px solid #8d9baa;
  border-radius: 5px;
  color: #e7eef5;
  background: #435260;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .14);
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.admin-template-editor-page-form .template-fixed-slot:hover,
.admin-template-editor-page-form .template-fixed-slot.is-selected {
  border-color: #d8e9f6;
  background: #526474;
}

.admin-template-editor-page-form .template-fixed-slot.is-current {
  box-shadow: 0 0 0 2px #8ed5ff, 0 5px 14px rgba(0, 0, 0, .2);
}

.template-fixed-slot-body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  cursor: pointer;
  outline: 0;
}

.template-fixed-slot-body strong,
.template-fixed-slot-body small {
  overflow: hidden;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.template-fixed-slot-body strong {
  font-size: 10px;
}

.template-fixed-slot-body small {
  color: #c9d8e5;
  font-size: 9px;
}

.template-segment-number.is-fixed {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #1d2a35;
  background: #d6e3ee;
  font-size: 10px;
  font-weight: 800;
}

.admin-template-editor-page-form .template-timeline-track.is-picking-fixed .template-base-track {
  cursor: crosshair;
  border-color: #b8c9d8;
  box-shadow: inset 0 0 0 1px rgba(216, 233, 246, .2);
}

.admin-template-editor-page-form .template-fixed-pick-marker {
  position: absolute;
  top: 7px;
  bottom: 7px;
  z-index: 10;
  width: 3px;
  border-radius: 999px;
  background: #d8e9f6;
  box-shadow: 0 0 0 2px rgba(216, 233, 246, .18), 0 0 14px rgba(216, 233, 246, .6);
  pointer-events: none;
  transform: translateX(-50%);
}

.admin-template-editor-page-form .template-fixed-pick-marker::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #8298aa;
  content: "";
  transform: translateX(-50%);
}

.admin-template-editor-page-form .template-fixed-pick-preview {
  position: absolute;
  top: 36px;
  z-index: 2;
  height: 72px;
  border: 2px dashed #d8e9f6;
  border-radius: 5px;
  background: rgba(216, 233, 246, .16);
  pointer-events: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--soft);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--soft);
}

body.page-home,
body.page-share {
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 140, 255, 0.2), transparent 32%),
    radial-gradient(circle at 90% 18%, rgba(255, 79, 119, 0.16), transparent 30%),
    #14171d;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  background: #222832;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.xhs-publish-dialog-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.xhs-publish-dialog {
  width: min(520px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid #e2e8f0;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  color: #172033;
  background: #fff;
  box-shadow: 0 -18px 56px rgba(15, 23, 42, 0.22);
  animation: xhs-sheet-in 180ms ease-out both;
}

@keyframes xhs-sheet-in {
  from { transform: translateY(24px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

.xhs-publish-dialog-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.xhs-publish-dialog-head > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.xhs-publish-dialog-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.xhs-publish-dialog-icon .platform-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.xhs-publish-dialog h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.xhs-publish-dialog p {
  margin: 10px 0 0;
  color: #62748a;
  font-size: 14px;
  line-height: 1.6;
}

.xhs-publish-dialog-head p {
  margin-top: 4px;
}

.xhs-publish-media {
  overflow: hidden;
  position: relative;
  min-height: 156px;
  margin-top: 16px;
  border-radius: 16px;
  background: #f1f4f8;
}

.xhs-publish-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.xhs-publish-media-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e1e8ef;
  border-radius: 10px;
  background: #fff;
}

.xhs-publish-media-preview {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e9eef4;
}

.xhs-publish-media-preview img,
.xhs-publish-media-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xhs-publish-media-item > small {
  display: block;
  overflow: hidden;
  padding: 5px 7px 6px;
  color: #718196;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xhs-publish-media-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 34, 52, 0.72);
  font-size: 11px;
}

.xhs-publish-empty-media {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 32px 16px;
  color: #7b8797;
  font-size: 13px;
}

.xhs-publish-copy {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e3e9f0;
  border-radius: 14px;
  background: #fbfcfe;
}

.xhs-publish-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.xhs-publish-copy-head strong {
  color: #1b2b3f;
  font-size: 14px;
}

.xhs-publish-copy small {
  display: block;
  margin-bottom: 3px;
  color: #7a8999;
  font-size: 11px;
}

.xhs-publish-copy > div > strong,
.xhs-publish-copy > div > p {
  display: block;
  margin: 0;
  color: #27394d;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.xhs-publish-copy-empty {
  margin: 0 !important;
  color: #a35e23 !important;
  font-size: 12px !important;
}

.xhs-publish-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.xhs-publish-dialog-actions .btn {
  min-height: 48px;
}

.xhs-publish-dialog-actions.is-single {
  grid-template-columns: 1fr;
  justify-items: center;
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 700;
  transition: 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 8px 20px rgba(45, 140, 255, 0.22);
}

.btn-wechat {
  width: 100%;
  color: #fff;
  background: #07c160;
  box-shadow: 0 8px 20px rgba(7, 193, 96, 0.18);
}

.btn-wechat:hover {
  background: #06ad56;
}

.btn-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper);
}

.btn-quiet {
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  border-color: rgba(230, 81, 98, 0.18);
  color: var(--danger);
  background: rgba(230, 81, 98, 0.06);
}

.btn-sm {
  min-height: 34px;
  padding: 0 11px;
  font-size: 12px;
}

.btn[hidden] {
  display: none;
}

.pill {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.pill-success {
  border-color: rgba(42, 169, 121, 0.2);
  color: #238d67;
  background: rgba(42, 169, 121, 0.1);
}

.pill-warning {
  border-color: rgba(255, 157, 60, 0.22);
  color: #c67620;
  background: rgba(255, 157, 60, 0.12);
}

.pill-dark {
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
}

.empty-state,
.loading-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

/* User side */

.mobile-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 15px 92px;
}

.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(45, 140, 255, 0.25);
}

.brand-lockup strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0;
}

.brand-lockup small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.mobile-top-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
}

.gradient-band {
  min-height: 54px;
  margin: 16px 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(100deg, #178eff, #6549ed 54%, #c34ce6);
  box-shadow: 0 14px 26px rgba(51, 103, 227, 0.2);
  font-size: 18px;
  font-weight: 800;
}

.platform-panel,
.campaign-panel {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(30, 34, 42, 0.86);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
}

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

.platform-card {
  min-height: 148px;
  width: 100%;
  border: 1px solid #343b48;
  border-radius: 11px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 14px 8px;
  color: #fff;
  background: #13161b;
  font: inherit;
  text-align: center;
  text-decoration: none;
  transition: 170ms ease;
}

.platform-card:hover {
  border-color: #6b78a0;
  transform: translateY(-2px);
  background: #191d24;
}

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

.platform-card small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.platform-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.platform-logo.dy { background: #111; box-shadow: 4px 0 #26f5f5, -3px 0 #ff356c; }
.platform-logo.ks { background: #ff6f35; }
.platform-logo.xhs { background: #ed4055; }
.platform-logo.sp { background: #16bb66; }
.platform-logo.pyq { background: #ffbf1c; color: #16191e; }
.platform-logo.bd { background: #2d86ef; }

.campaign-panel {
  margin-top: 16px;
}

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

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.section-head p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.campaign-list {
  display: grid;
  gap: 12px;
}

.campaign-card {
  overflow: hidden;
  border: 1px solid #353c48;
  border-radius: 11px;
  background: #15181e;
}

.campaign-media {
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.48);
  background: linear-gradient(130deg, #252b34, #15181e);
}

.campaign-media img,
.campaign-media video {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.campaign-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.campaign-placeholder strong {
  color: rgba(255, 255, 255, 0.78);
}

.campaign-body {
  padding: 14px;
}

.campaign-body h3 {
  margin: 0;
  font-size: 16px;
}

.campaign-body p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.55;
}

.campaign-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.dark-tag {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 8px;
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
}

.campaign-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.campaign-metrics {
  display: flex;
  gap: 10px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.mobile-bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 520px);
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 9px 8px 11px;
  background: rgba(22, 25, 31, 0.94);
  backdrop-filter: blur(18px);
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
  border: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 3px 4px;
  color: rgba(255, 255, 255, 0.46);
  background: transparent;
  font-size: 11px;
}

.mobile-bottom-nav a.is-active,
.mobile-bottom-nav button.is-active {
  color: #ff5479;
}

/* Shared portal */

.portal-page {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(45, 140, 255, 0.06), transparent 34%),
    #f3f5f8;
}

.portal-shell {
  width: min(1320px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.portal-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.portal-brand strong {
  display: block;
  font-size: 18px;
}

.portal-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--paper);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.portal-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.08;
}

.portal-subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-card {
  min-height: 120px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 26px rgba(29, 42, 58, 0.06);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.stat-card small {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-size: 11px;
}

.credit-recharge-card {
  cursor: pointer;
  text-align: left;
}

.credit-recharge-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.credit-recharge-card:hover {
  border-color: #2f70ff;
  box-shadow: 0 16px 34px rgba(47, 112, 255, 0.12);
}

.credit-order-balance,
.credit-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #e2e9f1;
  border-radius: 8px;
  background: #f7faff;
}

.credit-order-summary {
  margin: 16px 0 0;
  background: #fff8ed;
}

.credit-order-balance span,
.credit-order-summary span {
  color: var(--muted);
  font-size: 13px;
}

.credit-order-balance strong,
.credit-order-summary strong {
  color: var(--ink);
  font-size: 22px;
}

.credit-order-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.credit-order-price strong {
  color: var(--ink);
  font-size: 20px;
}

.credit-package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
}

.credit-package-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 132px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.credit-package-card:hover,
.credit-package-card.is-selected {
  border-color: #2f70ff;
  background: #f7faff;
  box-shadow: 0 8px 20px rgba(47, 112, 255, .1);
}

.credit-package-card.is-disabled {
  cursor: not-allowed;
  opacity: .55;
  background: #f5f7fa;
}

.credit-package-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.credit-package-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.credit-package-card-top strong {
  color: var(--ink);
  font-size: 15px;
}

.credit-package-card-top b {
  color: #1f5fce;
  font-size: 17px;
  white-space: nowrap;
}

.credit-package-card-meta {
  color: var(--ink);
  font-size: 13px;
}

.credit-package-card-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
}

.easy-pay-package-manager {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.easy-pay-package-manager h3 {
  margin: 0;
  font-size: 17px;
}

.easy-pay-package-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.easy-pay-package-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.easy-pay-package-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.easy-pay-package-row-head strong {
  color: var(--ink);
  font-size: 14px;
}

.easy-pay-package-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) repeat(5, minmax(100px, 1fr));
  gap: 10px;
}

.easy-pay-package-enabled .check-chip {
  min-height: 38px;
}

@media (max-width: 760px) {
  .credit-package-grid {
    grid-template-columns: 1fr;
  }

  .easy-pay-package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.easy-pay-package-grid .field:first-child {
    grid-column: 1 / -1;
  }
}

/* Template editor workspace: keep the preview visible while the controls scroll independently. */
.admin-template-modal {
  width: min(1360px, calc(100vw - 36px));
  height: min(92vh, 920px);
  max-height: min(92vh, 920px);
}

.admin-template-editor-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  padding: 16px 18px 14px;
}

.template-editor-meta {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcfe;
}

.template-editor-meta-grid {
  gap: 12px;
}

.template-editor-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-editor-section-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-editor-section-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.template-editor-section-heading span {
  color: var(--muted);
  font-size: 11px;
}

.template-editor-section-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #d8e4f1;
  border-radius: 999px;
  color: #3373bb !important;
  background: #f2f7fd;
  font-size: 11px !important;
  font-weight: 700;
  white-space: nowrap;
}

.template-editor-workspace {
  display: grid;
  grid-template-columns: minmax(390px, .94fr) minmax(560px, 1.06fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.template-editor-visual-column,
.template-editor-control-column {
  min-width: 0;
  min-height: 0;
}

.template-editor-visual-column {
  display: grid;
  align-content: start;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding-right: 2px;
}

.template-editor-control-column {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding-right: 3px;
}

.template-editor-panel {
  margin: 0;
  height: auto;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
}

.template-editor-stage {
  height: 216px;
  min-height: 0;
}

.template-editor-stage video {
  height: 190px;
  max-height: 190px;
}

.template-editor-stage-bar {
  min-height: 32px;
  padding: 3px 7px;
}

.template-editor-timeline-head {
  min-height: 24px;
}

.template-editor-seek {
  min-height: 24px;
}

.template-timeline-scroll {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.template-timeline-ruler,
.template-timeline-track {
  min-width: 0;
}

.template-timeline-ruler {
  padding-bottom: 4px;
}

.template-timeline-track {
  flex-wrap: wrap;
  align-content: start;
  gap: 3px;
  min-height: 0;
  padding: 5px 0 0;
  overflow: visible;
}

.template-intro-segment,
.template-timeline-image,
.template-timeline-outro {
  flex: 1 1 104px;
  min-width: 86px;
  min-height: 62px;
  padding: 7px;
}

.template-timeline-transition {
  flex: 0 0 34px;
  min-width: 34px;
  min-height: 62px;
  padding: 3px;
}

.template-editor-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dce8f4;
  border-radius: 7px;
  color: #5f7082;
  background: #f6faff;
  font-size: 11px;
  line-height: 1.5;
}

.template-editor-tip .icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #2588ea;
}

.template-editor-tip p {
  margin: 0;
}

.template-editor-control-column .template-slot-settings,
.template-editor-control-column .template-effect-settings,
.template-editor-control-column .template-existing-preview {
  margin-top: 0;
}

.template-editor-control-column .template-slot-settings,
.template-editor-control-column .template-effect-settings {
  gap: 8px;
  padding: 10px;
}

.template-editor-control-column .template-slot-list {
  gap: 6px;
}

.template-editor-control-column .template-slot-row.template-timeline-segment {
  grid-template-columns: minmax(128px, .82fr) minmax(132px, 1fr) minmax(190px, 1.3fr);
  gap: 7px;
  min-height: 58px;
  padding: 7px;
}

.template-editor-control-column .template-segment-preview {
  min-height: 36px;
  padding: 5px 7px;
  font-size: 11px;
}

.template-editor-control-column .template-duration-control {
  grid-template-columns: auto minmax(48px, 1fr) 48px;
  gap: 6px;
  font-size: 10px;
}

.template-editor-control-column .form-grid {
  gap: 10px;
}

.template-editor-control-column .template-existing-preview video {
  width: min(260px, 100%);
  max-height: 180px;
}

.template-editor-actions {
  position: relative;
  z-index: 2;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #e4eaf1;
  background: #fff;
}

@media (max-width: 1080px) {
  .template-editor-workspace {
    grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr);
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr 1fr;
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment .template-duration-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .admin-template-modal {
    width: min(100vw - 20px, 720px);
    height: min(94vh, 900px);
  }

  .admin-template-editor-form {
    overflow-y: auto;
  }

  .template-editor-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .template-editor-visual-column,
  .template-editor-control-column {
    overflow: visible;
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) minmax(200px, 1.3fr);
  }
}

@media (max-width: 620px) {
  .admin-template-editor-form {
    padding: 12px;
  }

  .template-editor-meta-grid,
  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr;
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment .template-duration-control {
    grid-column: auto;
  }

  .template-editor-section-heading {
    align-items: flex-start;
  }
}

/* Final compact timeline override: fit the whole video track without drag bars. */
.admin-template-editor-page-form .template-timeline-ruler,
.admin-template-editor-page-form .template-timeline-track {
  width: 100% !important;
  min-width: 0 !important;
}

.admin-template-editor-page-form .template-timeline-scroll {
  width: 100%;
  min-width: 0;
  min-height: 142px;
  height: 142px;
  overflow: hidden !important;
  padding-bottom: 0;
}

.admin-template-editor-page-form .template-timeline-track {
  min-height: 142px;
  height: 142px;
}

.admin-template-editor-page-form .template-base-track {
  top: 16px;
  height: 106px;
}

.admin-template-editor-page-form .template-range-slot {
  top: 36px;
  min-width: 28px;
  height: 72px;
  border-width: 1px;
  border-radius: 5px;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body {
  gap: 3px;
  padding: 4px 6px;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body strong {
  font-size: 10px;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body small {
  font-size: 9px;
}

.admin-template-editor-page-form .template-slot-handle {
  width: 8px;
}

.admin-template-editor-page-form .template-slot-handle.is-start {
  left: -4px;
}

.admin-template-editor-page-form .template-slot-handle.is-end {
  right: -4px;
}

.admin-template-editor-page-form .template-slot-handle::after {
  width: 2px;
  height: 24px;
}

.admin-template-editor-page-form .template-range-slot .template-slot-remove {
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
}

.admin-template-editor-page-form .template-timeline-transition {
  top: 7px;
  width: 22px;
  min-width: 22px;
  height: 124px;
}

.admin-template-editor-page-form .template-timeline-transition span {
  width: 22px;
  height: 22px;
}

.admin-template-editor-page-form .template-timeline-transition .icon {
  width: 11px;
  height: 11px;
}

.admin-template-editor-page-form .template-timeline-playhead {
  top: 2px;
  bottom: 2px;
}

.admin-template-editor-page-form .template-slot-pick-marker {
  top: 7px;
  bottom: 7px;
}

.admin-template-editor-page-form .template-slot-pick-preview {
  top: 36px;
  height: 72px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-workspace {
  align-items: start;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-visual-column {
  align-self: start;
  grid-template-rows: auto auto;
  height: auto;
  overflow: visible;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-panel {
  height: auto;
  grid-template-rows: auto auto auto 142px;
  overflow: hidden;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage {
  height: clamp(190px, 24vh, 240px);
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage video {
  height: min(21vh, 215px);
  max-height: 215px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-scroll {
  height: 142px;
  min-height: 142px;
  overflow: hidden !important;
}

@media (max-width: 820px) {
  body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-scroll,
  .admin-template-editor-page-form .template-timeline-scroll {
    height: 132px;
    min-height: 132px;
  }

  body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-track,
  .admin-template-editor-page-form .template-timeline-track {
    height: 132px;
    min-height: 132px;
  }
}

/* Final compact timeline override: fit the whole video track without drag bars. */
.admin-template-editor-page-form .template-timeline-ruler,
.admin-template-editor-page-form .template-timeline-track {
  width: 100% !important;
  min-width: 0 !important;
}

.admin-template-editor-page-form .template-timeline-scroll {
  width: 100%;
  min-width: 0;
  min-height: 142px;
  height: 142px;
  overflow: hidden !important;
  padding-bottom: 0;
}

.admin-template-editor-page-form .template-timeline-track {
  min-height: 142px;
  height: 142px;
}

.admin-template-editor-page-form .template-base-track {
  top: 16px;
  height: 106px;
}

.admin-template-editor-page-form .template-range-slot {
  top: 36px;
  min-width: 28px;
  height: 72px;
  border-width: 1px;
  border-radius: 5px;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body {
  gap: 3px;
  padding: 4px 6px;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body strong {
  font-size: 10px;
}

.admin-template-editor-page-form .template-range-slot .template-range-slot-body small {
  font-size: 9px;
}

.admin-template-editor-page-form .template-slot-handle {
  width: 8px;
}

.admin-template-editor-page-form .template-slot-handle.is-start {
  left: -4px;
}

.admin-template-editor-page-form .template-slot-handle.is-end {
  right: -4px;
}

.admin-template-editor-page-form .template-slot-handle::after {
  width: 2px;
  height: 24px;
}

.admin-template-editor-page-form .template-range-slot .template-slot-remove {
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
}

.admin-template-editor-page-form .template-timeline-transition {
  top: 7px;
  width: 22px;
  min-width: 22px;
  height: 124px;
}

.admin-template-editor-page-form .template-timeline-transition span {
  width: 22px;
  height: 22px;
}

.admin-template-editor-page-form .template-timeline-transition .icon {
  width: 11px;
  height: 11px;
}

.admin-template-editor-page-form .template-timeline-playhead {
  top: 2px;
  bottom: 2px;
}

.admin-template-editor-page-form .template-slot-pick-marker {
  top: 7px;
  bottom: 7px;
}

.admin-template-editor-page-form .template-slot-pick-preview {
  top: 36px;
  height: 72px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-workspace {
  align-items: start;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-visual-column {
  align-self: start;
  grid-template-rows: auto auto;
  height: auto;
  overflow: visible;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-panel {
  height: auto;
  grid-template-rows: auto auto auto 142px;
  overflow: hidden;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage {
  height: clamp(190px, 24vh, 240px);
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage video {
  height: min(21vh, 215px);
  max-height: 215px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-scroll {
  height: 142px;
  min-height: 142px;
  overflow: hidden !important;
}

@media (max-width: 820px) {
  body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-scroll,
  .admin-template-editor-page-form .template-timeline-scroll {
    height: 132px;
    min-height: 132px;
  }

  body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-track,
  .admin-template-editor-page-form .template-timeline-track {
    height: 132px;
    min-height: 132px;
  }
}

/* Timeline workstation: widths are driven by real playback seconds. */
.admin-template-editor-page-form .template-timeline-track {
  position: relative;
  --timeline-px-per-sec: 160px;
  gap: 0;
  align-items: stretch;
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
  min-height: 232px;
  padding: 18px 0 22px;
  overflow: visible;
}

.admin-template-editor-page-form .template-timeline-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-color: #66798c #202730;
}

.admin-template-editor-page-form .template-timeline-ruler {
  width: max-content;
  min-width: 100%;
  justify-content: flex-start;
  gap: 20px;
  padding: 0 0 8px;
  border-bottom-color: #424b57;
}

.admin-template-editor-page-form .template-timeline-ruler span:last-child {
  margin-left: auto;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-track-segment] {
  box-sizing: border-box;
  flex: 0 0 calc(var(--segment-duration, 1) * var(--timeline-px-per-sec)) !important;
  width: calc(var(--segment-duration, 1) * var(--timeline-px-per-sec)) !important;
  min-width: 0 !important;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  transition: filter .16s ease, box-shadow .16s ease, background .16s ease;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-segment-kind="intro"] {
  border-radius: 8px 0 0 8px;
  background: #303d4a;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-segment-kind="image"] {
  background: #244858;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-segment-kind="outro"] {
  border-radius: 0 8px 8px 0;
  background: #44392c;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-segment-kind="transition"] {
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  min-height: 176px;
  border-radius: 0;
  border-right: 0;
  border-left: 0;
  background: #1f2832;
  cursor: pointer;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-track-segment]:hover,
.admin-template-editor-page-form .template-timeline-track > [data-template-track-segment]:focus-visible {
  filter: brightness(1.14);
  outline: 0;
}

.admin-template-editor-page-form .template-timeline-track > [data-template-track-segment].is-current {
  z-index: 2;
  box-shadow: inset 0 0 0 2px #35c9d4, 0 0 0 1px rgba(53, 201, 212, .45);
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row.template-timeline-segment {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(52px, 1fr) auto;
  align-content: stretch;
  gap: 10px;
  min-height: 176px;
  padding: 12px;
  overflow: hidden;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row.template-timeline-segment .template-duration-control {
  grid-template-columns: auto minmax(24px, 1fr) 56px;
  gap: 8px;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row.template-timeline-segment .template-segment-preview {
  min-width: 0;
}

.template-timeline-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 8;
  width: 2px;
  border-radius: 999px;
  background: #ff5f61;
  box-shadow: 0 0 0 1px rgba(255, 95, 97, .18), 0 0 12px rgba(255, 95, 97, .68);
  pointer-events: none;
  transition: left .08s linear;
}

.template-timeline-playhead span {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f61;
  box-shadow: 0 0 0 3px rgba(255, 95, 97, .2);
  transform: translateX(-50%);
}

.template-editor-seek input {
  accent-color: #ff5f61;
}

/* Full-screen editing mode keeps only the workbench and its controls. */
body.template-workspace-is-fullscreen {
  overflow: hidden;
  background: #14181e;
}

body.template-workspace-is-fullscreen .admin-sidebar,
body.template-workspace-is-fullscreen .admin-topbar {
  display: none !important;
}

body.template-workspace-is-fullscreen .admin-main {
  width: 100%;
  margin-left: 0 !important;
}

body.template-workspace-is-fullscreen .admin-content {
  max-width: none !important;
  padding: 0 !important;
}

body.template-workspace-is-fullscreen .admin-template-editor-page {
  box-sizing: border-box;
  height: 100vh;
  min-height: 100vh;
  gap: 10px;
  overflow-y: auto;
  padding: 12px 16px 24px;
  background: #14181e;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head {
  position: sticky;
  top: 0;
  z-index: 20;
  border-color: #313b47;
  background: rgba(27, 32, 39, .96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head h1,
body.template-workspace-is-fullscreen .admin-template-editor-page-title,
body.template-workspace-is-fullscreen .admin-template-editor-page-actions {
  color: #f3f7fb;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head p,
body.template-workspace-is-fullscreen .admin-template-editor-kicker {
  color: #9ba8b7;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form {
  min-height: 0;
}

body.template-workspace-is-fullscreen .template-editor-meta {
  border-color: #313b47;
  background: #1b2027;
}

body.template-workspace-is-fullscreen .template-editor-meta .template-editor-section-heading strong,
body.template-workspace-is-fullscreen .template-editor-meta .template-editor-section-heading span {
  color: #f0f5fa;
}

body.template-workspace-is-fullscreen .template-editor-meta .field > span {
  color: #b7c3cf;
}

body.template-workspace-is-fullscreen .template-editor-meta input,
body.template-workspace-is-fullscreen .template-editor-meta select {
  border-color: #44515e;
  color: #eef5fb;
  background: #252d36;
}

body.template-workspace-is-fullscreen .template-editor-tip {
  border-color: #354554;
  color: #b4c1ce;
  background: #1b2530;
}

body.template-workspace-is-fullscreen .template-editor-control-column > section {
  border-color: #313b47;
  background: #f8fafc;
}

@media (max-width: 820px) {
  .admin-template-editor-page-form .template-timeline-track {
    --timeline-px-per-sec: 108px;
  }

  body.template-workspace-is-fullscreen .admin-template-editor-page {
    padding: 8px 10px 18px;
  }
}

@media (max-width: 620px) {
  .admin-template-editor-page-form .template-timeline-track {
    --timeline-px-per-sec: 84px;
  }

  .admin-template-editor-page-form .template-timeline-track > [data-template-segment-kind="transition"] {
    flex-basis: 36px !important;
    width: 36px !important;
    min-width: 36px !important;
  }
}

/* Template marker workstation: one real video track with replaceable image ranges. */
.admin-template-editor-page-form .template-timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.admin-template-editor-page-form .template-timeline-track {
  position: relative;
  display: block !important;
  box-sizing: border-box;
  width: 760px;
  min-width: 760px;
  min-height: 220px;
  padding: 0;
  overflow: visible;
  background: #1a2028;
}

.admin-template-editor-page-form .template-base-track {
  position: absolute;
  top: 22px;
  right: 0;
  left: 0;
  height: 164px;
  border: 1px solid #516273;
  border-radius: 8px;
  background: #2b3946;
  color: #eef5fb;
  cursor: crosshair;
}

.template-base-track::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #42c7d1;
  content: "";
}

.template-base-track-label {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-base-track-label strong {
  font-size: 13px;
}

.template-base-track-label small {
  color: #b4c2cf;
  font-size: 11px;
}

.admin-template-editor-page-form .template-range-slot {
  position: absolute;
  top: 54px;
  z-index: 4;
  display: flex;
  align-items: stretch;
  min-width: 42px;
  height: 106px;
  border: 2px solid #f1c85b;
  border-radius: 7px;
  background: #325b63;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
  color: #fff;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.admin-template-editor-page-form .template-range-slot:hover,
.admin-template-editor-page-form .template-range-slot.is-selected {
  border-color: #fff4a5;
  background: #3a737b;
}

.admin-template-editor-page-form .template-range-slot.is-current {
  box-shadow: 0 0 0 2px #ff5f61, 0 8px 20px rgba(0, 0, 0, .22);
}

.template-range-slot-body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 8px 15px;
  cursor: pointer;
  outline: 0;
}

.template-range-slot-body strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.template-range-slot-body small {
  color: #d6f4f2;
  font-size: 10px;
  white-space: nowrap;
}

.template-slot-handle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  z-index: 3;
  width: 12px;
  cursor: ew-resize;
}

.template-slot-handle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 32px;
  border-radius: 3px;
  background: #fff4a5;
  content: "";
  transform: translate(-50%, -50%);
}

.template-slot-handle.is-start {
  left: -6px;
}

.template-slot-handle.is-end {
  right: -6px;
}

.template-range-slot .template-slot-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 5;
  width: 24px;
  height: 24px;
  color: #fff;
  opacity: .8;
}

.template-range-slot .template-slot-remove:hover {
  opacity: 1;
}

.admin-template-editor-page-form .template-timeline-transition {
  position: absolute;
  top: 15px;
  z-index: 6;
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 190px;
  padding: 0;
  border: 0;
  border-left: 2px dashed #f1c85b;
  border-radius: 0;
  background: transparent;
  color: #f9df7d;
  cursor: pointer;
  transform: translateX(-50%);
}

.admin-template-editor-page-form .template-timeline-transition span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid #f1c85b;
  border-radius: 50%;
  background: #29343e;
}

.admin-template-editor-page-form .template-timeline-transition .icon {
  width: 14px;
  height: 14px;
}

.admin-template-editor-page-form .template-timeline-transition strong,
.admin-template-editor-page-form .template-timeline-transition small {
  display: none;
}

.admin-template-editor-page-form .template-timeline-transition.is-current span,
.admin-template-editor-page-form .template-timeline-transition:hover span {
  border-color: #fff4a5;
  background: #5c4f2c;
  box-shadow: 0 0 0 3px rgba(241, 200, 91, .18);
}

.template-timeline-playhead {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  z-index: 9;
  width: 2px;
  border-radius: 999px;
  background: #ff5f61;
  box-shadow: 0 0 0 1px rgba(255, 95, 97, .18), 0 0 12px rgba(255, 95, 97, .68);
  pointer-events: none;
  transition: left .08s linear;
}

.template-timeline-playhead span {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f61;
  box-shadow: 0 0 0 3px rgba(255, 95, 97, .2);
  transform: translateX(-50%);
}

.template-range-draft {
  position: absolute;
  top: 54px;
  z-index: 8;
  height: 106px;
  border: 2px dashed #fff4a5;
  border-radius: 7px;
  background: rgba(241, 200, 91, .2);
  pointer-events: none;
}

.template-slot-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.template-slot-tools .btn.is-active {
  border-color: #2588ea;
  color: #176bc4;
  background: #eef6ff;
}

.template-slot-inspector {
  display: grid;
  gap: 12px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #fff;
}

.template-slot-inspector-empty {
  display: grid;
  min-height: 58px;
  place-items: center;
  color: #8796a6;
  font-size: 12px;
}

.template-slot-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-slot-inspector-head strong {
  color: var(--ink);
  font-size: 14px;
}

.template-slot-inspector-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-slot-inspector-grid .field {
  gap: 5px;
}

.template-slot-inspector-grid .field > span {
  color: #657486;
  font-size: 11px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head {
  position: relative !important;
  top: auto !important;
}

@media (max-width: 620px) {
  .template-slot-inspector-grid {
    grid-template-columns: 1fr;
  }

  .admin-template-editor-page-form .template-base-track {
    height: 174px;
  }

  .admin-template-editor-page-form .template-range-slot {
    top: 58px;
    height: 108px;
  }
}

/* Keep the template editor as one complete workspace instead of clipping the lower controls. */
.admin-template-modal {
  width: min(1480px, calc(100vw - 24px));
  height: min(940px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
}

.admin-template-modal .admin-modal-head {
  flex: 0 0 auto;
  padding: 12px 18px;
}

.admin-template-modal .admin-modal-head h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

.admin-template-modal .admin-modal-head p {
  font-size: 11px;
}

.admin-template-editor-form {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 10px;
}

.template-editor-meta {
  gap: 6px;
  padding: 8px 10px;
}

.template-editor-meta .template-editor-section-heading {
  min-height: 22px;
}

.template-editor-meta-grid {
  grid-template-columns: minmax(170px, 1.05fr) minmax(105px, .55fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 7px;
}

.template-editor-meta-grid .field-full {
  grid-column: auto;
}

.template-editor-meta-grid .field {
  min-width: 0;
  gap: 4px;
}

.template-editor-meta-grid .field > span {
  font-size: 11px;
}

.template-editor-meta-grid .field input,
.template-editor-meta-grid .field select {
  min-width: 0;
  height: 34px;
  padding: 7px 9px;
}

.template-editor-meta-grid .field-help {
  display: none;
}

.template-editor-workspace {
  grid-template-columns: minmax(390px, .94fr) minmax(560px, 1.06fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.template-editor-visual-column,
.template-editor-control-column {
  min-height: 0;
}

.template-editor-visual-column {
  overflow: hidden;
  padding-right: 2px;
}

.template-editor-control-column {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.template-editor-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
}

.template-editor-stage {
  height: 216px;
  min-height: 0;
}

.template-editor-stage video {
  height: 190px;
  max-height: 190px;
}

.template-editor-stage-bar {
  min-height: 32px;
  padding: 3px 7px;
}

.template-editor-timeline-head {
  min-height: 24px;
}

.template-editor-seek {
  min-height: 24px;
}

.template-timeline-scroll {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.template-timeline-ruler,
.template-timeline-track {
  min-width: 0;
}

.template-timeline-ruler {
  padding-bottom: 4px;
}

.template-timeline-track {
  flex-wrap: wrap;
  align-content: start;
  gap: 3px;
  min-height: 0;
  padding: 5px 0 0;
  overflow: visible;
}

.template-intro-segment,
.template-timeline-image,
.template-timeline-outro {
  flex: 1 1 104px;
  min-width: 86px;
  min-height: 62px;
  padding: 7px;
}

.template-timeline-transition {
  flex: 0 0 34px;
  min-width: 34px;
  min-height: 62px;
  padding: 3px;
}

.template-segment-title {
  gap: 5px;
}

.template-segment-title strong {
  font-size: 10px;
}

.template-intro-segment small,
.template-timeline-image small,
.template-timeline-outro small {
  font-size: 9px;
}

.template-editor-tip {
  padding: 7px 9px;
  font-size: 10px;
}

.template-editor-control-column .template-slot-settings,
.template-editor-control-column .template-effect-settings,
.template-editor-control-column .template-existing-preview {
  gap: 8px;
  padding: 10px;
}

.template-editor-control-column .template-slot-list {
  gap: 6px;
}

.template-editor-control-column .template-slot-row.template-timeline-segment {
  grid-template-columns: minmax(128px, .82fr) minmax(132px, 1fr) minmax(190px, 1.3fr);
  gap: 7px;
  min-height: 58px;
  padding: 7px;
}

.template-editor-control-column .template-segment-preview {
  min-height: 36px;
  padding: 5px 7px;
  font-size: 11px;
}

.template-editor-control-column .template-duration-control {
  grid-template-columns: auto minmax(48px, 1fr) 48px;
  gap: 6px;
  font-size: 10px;
}

.template-editor-control-column .template-duration-number {
  height: 32px;
  padding: 5px 7px;
}

.template-editor-control-column .template-existing-preview video {
  width: min(220px, 100%);
  max-height: 140px;
}

.template-editor-actions {
  flex: 0 0 auto;
  min-height: 42px;
  padding-top: 8px;
}

@media (max-width: 1180px) and (min-width: 901px) {
  .template-editor-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .template-editor-workspace {
    grid-template-columns: minmax(350px, .84fr) minmax(480px, 1.16fr);
  }
}

@media (max-width: 900px) {
  .admin-template-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .admin-template-editor-form {
    overflow-y: auto;
  }

  .template-editor-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-editor-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .template-editor-visual-column,
  .template-editor-control-column {
    overflow: visible;
  }

  .template-editor-panel {
    height: auto;
  }
}

@media (max-width: 620px) {
  .admin-template-modal .admin-modal-head {
    padding: 10px 12px;
  }

  .admin-template-editor-form {
    padding: 8px;
  }

  .template-editor-meta-grid,
  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr;
  }

  .template-editor-stage {
    height: min(58vw, 216px);
  }

  .template-editor-stage video {
    height: min(50vw, 190px);
    max-height: none;
  }
}

/* Fit the complete editing workspace into the modal before enabling any inner scroll. */
.admin-template-modal {
  width: min(1480px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: calc(100vh - 24px);
}

.admin-template-editor-form {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 14px 12px;
}

.template-editor-meta {
  gap: 8px;
  padding: 10px 12px;
}

.template-editor-meta .template-editor-section-heading {
  min-height: 24px;
}

.template-editor-meta-grid {
  grid-template-columns: minmax(150px, 1.05fr) minmax(110px, .55fr) minmax(180px, 1.25fr) minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 8px;
}

.template-editor-meta-grid .field-full {
  grid-column: auto;
}

.template-editor-meta-grid .field {
  min-width: 0;
}

.template-editor-meta-grid .field-help {
  display: none;
}

.template-editor-workspace {
  grid-template-columns: minmax(430px, .95fr) minmax(570px, 1.05fr);
  gap: 10px;
}

.template-editor-visual-column,
.template-editor-control-column {
  overflow: hidden;
  padding-right: 0;
}

.template-editor-panel {
  gap: 8px;
  padding: 9px;
}

.template-editor-stage {
  min-height: 0;
  height: 250px;
}

.template-editor-stage video {
  height: 220px;
  max-height: 220px;
}

.template-editor-empty {
  min-height: 180px;
}

.template-editor-stage-bar {
  min-height: 36px;
  padding: 4px 8px;
}

.template-editor-stage-tip {
  font-size: 10px;
}

.template-editor-timeline-head {
  min-height: 25px;
}

.template-timeline-scroll {
  overflow: visible;
  padding-bottom: 0;
}

.template-timeline-ruler,
.template-timeline-track {
  min-width: 0;
}

.template-timeline-track {
  flex-wrap: wrap;
  gap: 3px;
  min-height: 0;
  padding: 6px 0 0;
}

.template-intro-segment,
.template-timeline-image,
.template-timeline-outro {
  flex: 1 1 105px;
  min-width: 92px;
  min-height: 68px;
  padding: 8px;
}

.template-timeline-transition {
  flex: 0 0 40px;
  min-width: 40px;
  min-height: 68px;
  padding: 4px;
}

.template-segment-title strong {
  font-size: 10px;
}

.template-intro-segment small,
.template-timeline-image small,
.template-timeline-outro small {
  font-size: 9px;
}

.template-editor-control-column {
  overflow-y: auto;
}

.template-editor-control-column .template-slot-settings,
.template-editor-control-column .template-effect-settings,
.template-editor-control-column .template-existing-preview {
  padding: 10px;
}

.template-editor-control-column .template-slot-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.template-editor-control-column .template-slot-row.template-timeline-segment {
  grid-template-columns: minmax(95px, .8fr) minmax(110px, 1.2fr);
  gap: 6px;
  min-height: 0;
  padding: 7px;
}

.template-editor-control-column .template-slot-row.template-timeline-segment .template-duration-control {
  grid-column: 1 / -1;
}

.template-editor-control-column .template-slot-row-head {
  min-height: 30px;
}

.template-editor-control-column .template-segment-number {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.template-editor-control-column .template-segment-preview {
  min-height: 30px;
  padding: 5px 6px;
  font-size: 10px;
}

.template-editor-control-column .template-duration-control {
  grid-template-columns: auto minmax(30px, 1fr) 46px;
  gap: 5px;
  font-size: 10px;
}

.template-editor-control-column .template-duration-number {
  min-height: 30px;
  padding: 5px;
}

.template-editor-control-column .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-editor-control-column .template-existing-preview video {
  width: min(220px, 100%);
  max-height: 120px;
}

.template-editor-tip {
  padding: 8px 10px;
}

@media (max-width: 1180px) {
  .template-editor-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .template-editor-workspace {
    grid-template-columns: minmax(350px, .85fr) minmax(480px, 1.15fr);
  }
}

@media (max-width: 900px) {
  .admin-template-modal {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
  }

  .admin-template-editor-form {
    overflow-y: auto;
  }

  .template-editor-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-editor-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .template-editor-visual-column,
  .template-editor-control-column {
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .template-editor-meta-grid,
  .template-editor-control-column .form-grid {
    grid-template-columns: 1fr;
  }

  .template-editor-control-column .template-slot-list {
    grid-template-columns: 1fr;
  }

  .template-editor-stage {
    height: 220px;
  }

  .template-editor-stage video {
    height: 190px;
    max-height: 190px;
  }
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
  margin-top: 18px;
}

.form-card,
.table-card,
.qr-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(29, 42, 58, 0.05);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 0;
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 18px;
}

.card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-body {
  display: grid;
  gap: 15px;
  padding: 20px 22px 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field-full {
  grid-column: 1 / -1;
}

.field label,
.field > span {
  color: #4d5967;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fbfcfd;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(45, 140, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.12);
}

.dropzone {
  min-height: 110px;
  border: 1px dashed #b8c3d0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 18px;
  color: var(--muted);
  background: #fafbfd;
  text-align: center;
}

.dropzone strong {
  color: #3b4654;
  font-size: 13px;
}

.dropzone small {
  font-size: 11px;
}

.dropzone input {
  display: none;
}

.platform-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.check-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-chip span {
  position: relative;
  min-height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: #718096;
  background: #eef1f5;
  font-size: 12px;
  cursor: pointer;
  pointer-events: none;
  transition: 160ms ease;
}

.check-chip input:checked + span {
  border-color: #9bc7ff;
  color: #3177d8;
  background: #eaf4ff;
}

.check-chip input:focus-visible + span {
  outline: 2px solid rgba(45, 140, 255, 0.55);
  outline-offset: 2px;
}

.visibility-toggle {
  min-height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  padding: 0 13px;
  color: #718096;
  background: #eef1f5;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 160ms ease;
}

.visibility-toggle.is-on {
  border-color: #9bc7ff;
  color: #3177d8;
  background: #eaf4ff;
}

.visibility-toggle.is-off {
  border-color: #d7dee8;
  color: #718096;
  background: #eef1f5;
}

.visibility-toggle:focus-visible {
  outline: 2px solid rgba(45, 140, 255, 0.55);
  outline-offset: 2px;
}

.visibility-toggle[aria-disabled="true"] {
  cursor: default;
}

.wifi-panel {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.wifi-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.wifi-panel-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #247dff, #1ad2b3);
}

.wifi-panel-icon .icon {
  width: 22px;
  height: 22px;
}

.wifi-kicker {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.wifi-panel h2 {
  margin: 0;
  font-size: 18px;
}

.wifi-panel-head p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.wifi-panel-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.wifi-panel-meta span {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
}

.wifi-panel-meta small,
.wifi-panel-meta strong {
  display: block;
}

.wifi-panel-meta small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

.wifi-panel-meta strong {
  margin-top: 3px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wifi-panel-help {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.5;
}

.wifi-panel-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.wifi-panel-actions .btn {
  min-height: 44px;
}

.review-checkin-panel {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.review-checkin-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.review-checkin-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.review-checkin-eyebrow {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 800;
}

.review-checkin-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.review-checkin-icon .platform-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.review-checkin-panel h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.review-checkin-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.6;
}

.review-checkin-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
}

.review-checkin-note strong {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 800;
}

.review-checkin-button {
  width: 100%;
  margin-top: 12px;
  min-height: 48px;
}

.review-checkin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.review-checkin-card {
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 14px;
  border: 0;
  border-radius: 16px;
  color: #13243a;
  background: #eef7ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.review-checkin-card strong {
  display: block;
  color: inherit;
  font-size: 16px;
  line-height: 1.25;
  word-break: keep-all;
}

.review-checkin-card small {
  display: block;
  margin-top: 4px;
  color: #65778b;
  font-size: 12px;
  line-height: 1.35;
}

.review-checkin-card:active {
  transform: translateY(1px);
}

.review-config-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid #dbe7f5;
  border-radius: 10px;
  color: #5f7186;
  background: #f7fbff;
}

.review-config-note-mark {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  color: #198d76;
}

.review-config-note-mark .icon {
  width: 16px;
  height: 16px;
}

.review-config-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.platform-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-copy-editor,
.douyin-publish-editor,
.xhs-publish-editor,
.review-links-panel {
  padding: 18px;
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  background: #f8fbff;
}

.platform-copy-editor .settings-group-title,
.douyin-publish-editor .settings-group-title,
.xhs-publish-editor .settings-group-title,
.review-links-panel .settings-group-title {
  margin-top: 0;
  margin-bottom: 12px;
  color: #172033;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.douyin-publish-editor {
  border-color: #cfe3ff;
  background: #f4f9ff;
}

.xhs-publish-editor {
  border-color: #ffd3dc;
  background: #fff7f9;
}

.douyin-publish-fields,
.xhs-publish-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.douyin-publish-fields .field,
.xhs-publish-fields .field {
  margin: 0;
}

.douyin-publish-fields textarea,
.xhs-publish-fields textarea {
  min-height: 108px;
  resize: vertical;
}

.platform-copy-group + .platform-copy-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2eaf4;
}

.platform-copy-group-title {
  margin-bottom: 9px;
  color: #42556c;
  font-size: 12px;
  font-weight: 900;
}

.platform-copy-list,
.review-links-list {
  display: grid;
  gap: 12px;
}

.platform-copy-item,
.review-link-item {
  display: grid;
  grid-template-columns: 42px minmax(128px, 0.8fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e1e9f3;
  border-radius: 12px;
  background: #fff;
}

.platform-copy-logo,
.review-link-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
}

.platform-copy-meta,
.review-link-meta {
  min-width: 0;
  display: grid;
  gap: 0;
}

.platform-copy-meta strong,
.review-link-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-copy-meta small,
.review-link-meta small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.platform-copy-item textarea {
  min-height: 88px;
  resize: vertical;
}

.review-link-item input,
.platform-copy-item textarea {
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 4px;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.admin-settings-actions {
  padding: 0 20px 20px;
}

.mini-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.mini-preview > * {
  width: 100%;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
  background: #e8edf2;
}

.table-card {
  margin-top: 18px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
  padding: 0 22px 22px;
}

.campaign-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.campaign-table th,
.campaign-table td,
.admin-table th,
.admin-table td {
  padding: 14px 9px;
  border-bottom: 1px solid var(--line);
  color: #4a5664;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.campaign-table th,
.admin-table th {
  color: #8a94a1;
  background: #fafbfd;
  font-weight: 700;
}

.campaign-table td strong,
.admin-table td strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.table-actions {
  display: flex;
  gap: 7px;
  white-space: nowrap;
}

.qr-card {
  padding: 22px;
}

.qr-card h3 {
  margin: 0;
  font-size: 18px;
}

.qr-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.qr-box {
  width: 220px;
  height: 220px;
  margin: 18px auto;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: #fff;
}

.qr-box img {
  width: 200px;
  height: 200px;
}

.qr-box canvas {
  width: 200px;
  height: 200px;
}

.share-url {
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: 6px;
  color: #526071;
  background: var(--soft);
  font-size: 11px;
  line-height: 1.5;
}

/* Admin */

.admin-page {
  background: #f4f5f7;
}

.admin-shell {
  min-height: 100vh;
  display: block;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 244px;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.8);
  background: #1b1f24;
}

.sidebar-brand {
  min-height: 74px;
  padding: 18px 19px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 16px;
}

.sidebar-brand small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.sidebar-menu {
  display: grid;
  gap: 3px;
  padding: 16px 10px;
}

.sidebar-item {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
  text-align: left;
}

.sidebar-item:hover,
.sidebar-item.is-active {
  color: #fff;
  background: #465cf0;
}

.admin-main {
  grid-column: 2;
  margin-left: 244px;
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 74px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
}

.admin-topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #546071;
}

.admin-topbar-title strong {
  color: var(--ink);
  font-size: 16px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #596576;
  font-size: 13px;
}

.admin-content {
  padding: 24px 28px 48px;
}

.admin-tabs {
  min-height: 45px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  margin: -24px -28px 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.admin-modal {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5e9f0;
}

.admin-modal-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.admin-modal-head p {
  margin: 0;
  color: #728096;
}

.admin-modal-body {
  overflow-y: auto;
  padding: 22px;
}

.merchant-campaign-modal {
  width: min(980px, 100%);
  max-height: min(840px, calc(100vh - 48px));
}

.merchant-campaign-modal .admin-modal-body {
  display: grid;
  gap: 16px;
  padding: 20px 22px 22px;
}

.merchant-campaign-modal .form-grid {
  gap: 16px;
}

.merchant-campaign-modal .field-help {
  margin-top: 5px;
}

.merchant-campaign-page {
  display: grid;
  gap: 16px;
}

.merchant-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.merchant-content-main {
  min-width: 0;
}

.merchant-content-side {
  display: grid;
  gap: 14px;
}

.merchant-content-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.merchant-content-form {
  display: grid;
}

.merchant-content-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.merchant-content-editor-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.merchant-content-editor-head > div > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.merchant-content-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.copy-mode-badge,
.copy-stock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dbe7f5;
  border-radius: 999px;
  background: #f7fbff;
  color: #526071;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.copy-mode-badge.is-auto,
.copy-stock-badge.is-auto {
  border-color: #b9d8ff;
  background: #eef6ff;
  color: #1f63b7;
}

.copy-mode-badge.is-manual,
.copy-stock-badge.is-manual {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.merchant-content-sections {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.merchant-content-section {
  overflow: hidden;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #f8fbff;
}

.merchant-content-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
  background: #fff;
  border-bottom: 1px solid #edf1f6;
}

.merchant-content-section summary::-webkit-details-marker {
  display: none;
}

.merchant-content-section summary strong {
  color: var(--ink);
  font-size: 16px;
}

.merchant-content-section summary span {
  color: var(--muted);
  font-size: 12px;
}

.merchant-content-section-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.merchant-basic-grid,
.merchant-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.merchant-basic-grid .field,
.merchant-profile-grid .field {
  margin: 0;
}

.merchant-platform-copy-block {
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
}

.merchant-platform-copy-block + .merchant-platform-copy-block {
  margin-top: 8px;
}

.merchant-platform-copy-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.merchant-platform-copy-title strong {
  color: var(--ink);
  font-size: 15px;
}

.merchant-platform-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.merchant-platform-copy-grid .field {
  margin: 0;
}

.merchant-content-copy-row {
  align-items: start;
}

.merchant-content-copy-row textarea {
  min-height: 84px;
}

.merchant-content-page .merchant-content-empty {
  padding: 18px;
}

.merchant-share-side-card {
  padding: 18px;
}

.merchant-share-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.merchant-share-side-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.merchant-back-workbench {
  width: 100%;
  justify-content: center;
}

.withdrawal-modal {
  width: min(620px, 100%);
}

.withdrawal-modal-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #dbe7f4;
  border-radius: 8px;
  background: #f5f9ff;
  color: #5d718a;
}

.withdrawal-modal-summary strong {
  color: #0b4f91;
  font-size: 24px;
}

.merchant-qr-modal {
  width: min(560px, 100%);
}

.merchant-qr-modal .admin-modal-body {
  display: grid;
  gap: 14px;
}

.merchant-qr-modal-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e9f1;
  border-radius: 8px;
  background: #f7faff;
}

.merchant-qr-modal-summary strong {
  overflow: hidden;
  color: #20334a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-qr-modal-summary span {
  flex: 0 0 auto;
  color: #718096;
  font-size: 12px;
}

.merchant-admin-shell .merchant-content {
  padding-top: 32px;
}

.merchant-admin-shell .admin-heading {
  margin-bottom: 20px;
}

.merchant-admin-shell .metric-grid {
  margin-bottom: 18px;
}

.merchant-admin-shell .portal-grid {
  align-items: start;
}

.merchant-admin-shell .form-card,
.merchant-admin-shell .qr-card,
.merchant-admin-shell .table-card {
  scroll-margin-top: 96px;
}

.merchant-page-card {
  margin-top: 0;
}

.merchant-overview-card {
  overflow: hidden;
}

.merchant-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
}

.merchant-quick-action {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: 160ms ease;
}

.merchant-quick-action:hover {
  border-color: #b7c3f8;
  background: #f8f9ff;
  transform: translateY(-1px);
}

.merchant-quick-action > .icon:first-child {
  color: #5261e7;
}

.merchant-quick-action > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.merchant-quick-action strong {
  font-size: 13px;
}

.merchant-quick-action small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.merchant-quick-action > .icon:last-child {
  margin-left: auto;
  color: #8a94a1;
}

.merchant-campaign-picker {
  padding: 0 22px 20px;
}

.merchant-campaign-picker .field-label {
  display: block;
  margin-bottom: 8px;
  color: #536071;
  font-size: 12px;
  font-weight: 700;
}

.merchant-campaign-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.merchant-campaign-picker-item {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.merchant-campaign-picker-item:hover,
.merchant-campaign-picker-item.is-active {
  border-color: #6171ed;
  background: #f5f6ff;
}

.merchant-campaign-picker-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-campaign-picker-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-qr-page #qrPanel {
  max-width: 520px;
  margin: 0 auto 20px;
}

.admin-tab {
  min-height: 45px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 18px;
  color: #7b8592;
  background: transparent;
}

.admin-tab.is-active {
  border-bottom-color: #4d61ee;
  color: #4d61ee;
  background: #f5f6ff;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
}

.admin-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(29, 42, 58, 0.04);
}

.admin-card-body {
  padding: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-grid-single {
  grid-template-columns: minmax(0, 420px);
}

.metric-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card {
  min-height: 122px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.metric-card span {
  color: #8a94a1;
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 28px;
}

.metric-card small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: #3a9c76;
  font-size: 11px;
}

.data-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.data-toolbar h2 {
  margin: 0;
  font-size: 16px;
}

.data-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.data-toolbar-actions {
  display: flex;
  gap: 8px;
}

.admin-table {
  min-width: 820px;
}

.status-tag {
  min-height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #5261e7;
  background: #eef0ff;
  font-size: 11px;
}

.status-tag.is-draft {
  color: #c27523;
  background: #fff4e7;
}

.status-tag.is-disabled,
.status-tag.is-archived {
  color: #8c96a3;
  background: #f0f2f5;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #f4f6f9;
}

.login-card {
  width: min(460px, 100%);
  min-height: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(30, 42, 58, 0.12);
}

.login-form {
  align-self: center;
  padding: 42px;
}

.login-form h2 {
  margin: 0;
  font-size: 25px;
}

.login-form form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.login-wechat-binding-hint {
  margin-top: 18px;
  border-left-color: #07c160;
  background: #f1fbf5;
}

.login-form .btn {
  margin-top: 7px;
}

.login-hint {
  margin-top: 18px;
  padding: 12px;
  border-left: 3px solid #cad2ff;
  color: #6b7584;
  background: #f6f7ff;
  font-size: 11px;
  line-height: 1.7;
}

/* Share page */

.share-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 15px 36px;
}

.share-hero {
  padding: 4px 0 18px;
}

.share-hero h1 {
  margin: 20px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.share-hero p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.65;
}

.share-media-frame {
  overflow: hidden;
  min-height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #1c2028;
}

.share-media-frame img,
.share-media-frame video {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.share-meta .dark-tag {
  font-size: 12px;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.share-actions .btn {
  min-height: 48px;
}

.publish-stepper {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.publish-stepper h2 {
  margin: 0;
  font-size: 16px;
}

.step-list {
  display: grid;
  gap: 13px;
  margin-top: 15px;
}

.step-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, var(--blue), var(--violet));
  font-size: 11px;
  font-weight: 800;
}

.step-item strong {
  display: block;
  font-size: 13px;
}

.step-item p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  line-height: 1.5;
}

.not-found-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
}

.not-found-card {
  color: #111827;
  text-align: center;
}

.not-found-card .brand-mark {
  display: none;
}

.not-found-code {
  margin: 0;
  color: #111827;
  font-size: clamp(72px, 18vw, 132px);
  line-height: 1;
  letter-spacing: 0;
}

.not-found-card h1 {
  display: none;
}

.not-found-card p {
  display: none;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .admin-sidebar {
    width: 80px;
  }

  .admin-main {
    margin-left: 80px;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 16px 8px;
  }

  .sidebar-brand > div:last-child,
  .sidebar-item span:last-child {
    display: none;
  }

  .sidebar-item {
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 840px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .portal-shell {
    width: min(100% - 26px, 520px);
    padding-top: 15px;
  }

  .portal-header {
    align-items: flex-start;
  }

  .portal-header-actions .user-chip {
    display: none;
  }

  .form-grid,
  .stats-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .admin-heading,
  .data-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .btn,
  .data-toolbar-actions .btn {
    width: 100%;
  }

  .admin-topbar {
    padding: 0 16px;
  }

  .admin-content {
    padding: 20px 16px 36px;
  }

  .admin-tabs {
    margin: -20px -16px 20px;
    padding: 0 16px;
    overflow-x: auto;
  }

  .admin-tab {
    flex: 0 0 auto;
    padding: 0 12px;
  }

  .admin-heading h1 {
    font-size: 24px;
  }

  .login-form {
    padding: 28px 22px;
  }
}

@media (max-width: 390px) {
  .mobile-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .platform-grid {
    gap: 8px;
  }

  .platform-card {
    min-height: 132px;
  }
}

/* COS material library */

.merchant-quick-actions {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.materials-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(29, 42, 58, 0.05);
}

.xiaohongshu-groups-panel {
  padding: 4px 0 18px;
  border-bottom: 1px solid var(--line);
}

.xiaohongshu-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 0 22px;
}

.xiaohongshu-group-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #e1e8ef;
  border-radius: 8px;
  background: #fff;
}

.xiaohongshu-group-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 112px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
  background: #edf2f6;
}

.xiaohongshu-group-thumb {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: #e8eef3;
}

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

.xiaohongshu-group-thumb.is-empty {
  display: grid;
  place-items: center;
  color: #94a2b1;
}

.xiaohongshu-group-info {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.xiaohongshu-group-info strong,
.xiaohongshu-group-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xiaohongshu-group-info strong {
  color: var(--ink);
  font-size: 13px;
}

.xiaohongshu-group-info small {
  color: var(--muted);
  font-size: 11px;
}

.xiaohongshu-group-delete {
  justify-self: end;
  white-space: nowrap;
}

.merchant-xhs-group-modal {
  width: min(760px, calc(100vw - 28px));
}

.xiaohongshu-image-picker {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e4eaf0;
  border-radius: 8px;
  background: #fbfcfe;
}

.xiaohongshu-image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.xiaohongshu-image-option {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.xiaohongshu-image-option input {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  accent-color: #2f78e6;
}

.xiaohongshu-image-option > span {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 7px;
  background: #e9eff4;
}

.xiaohongshu-image-option input:checked + span {
  border-color: #2f78e6;
  box-shadow: 0 0 0 2px rgba(47, 120, 230, 0.15);
}

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

.xiaohongshu-image-option strong {
  overflow: hidden;
  color: #40556b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-upload-form {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.material-storage-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.material-storage-option {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.material-storage-option:has(input:checked) {
  border-color: #2f86f6;
  background: #f2f8ff;
  box-shadow: 0 0 0 3px rgba(47, 134, 246, 0.1);
}

.material-storage-option input {
  width: 16px;
  height: 16px;
  accent-color: #2f86f6;
}

.material-storage-option span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.material-storage-option strong {
  color: #20334a;
  font-size: 13px;
}

.material-storage-option small {
  color: #7d8da1;
  font-size: 11px;
  line-height: 1.35;
}

.material-upload-zone {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px dashed #9db8d5;
  border-radius: 8px;
  color: #2877d4;
  background: #f2f8ff;
  cursor: pointer;
}

.material-upload-zone.is-dragging {
  border-color: #2f86f6;
  background: #e8f3ff;
  box-shadow: inset 0 0 0 1px rgba(47, 134, 246, 0.25);
}

.material-upload-zone > .icon {
  width: 28px;
  height: 28px;
}

.material-upload-zone > span {
  display: grid;
  gap: 5px;
}

.material-upload-zone strong {
  color: #253c58;
  font-size: 14px;
}

.material-upload-zone small {
  color: #7890aa;
  font-size: 11px;
}

.material-upload-zone input {
  display: none;
}

.material-upload-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.material-upload-meta code {
  padding: 5px 8px;
  border-radius: 5px;
  color: #315a7c;
  background: #edf5fc;
  font-size: 11px;
}

.material-upload-meta > span:nth-of-type(2) {
  flex: 1 1 180px;
  overflow: hidden;
  color: #8a94a1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #5c6f87;
  font-size: 12px;
}

.material-upload-progress[hidden] {
  display: none;
}

.material-upload-progress > span {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef7;
}

.material-upload-progress i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #2f86f6;
  transition: width 0.18s ease;
}

.material-upload-progress strong {
  color: #315a7c;
  font-size: 11px;
  white-space: nowrap;
}

.materials-list-head {
  padding: 20px 22px 0;
}

.materials-list-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.materials-list-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.merchant-material-platform-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 22px 0;
  scrollbar-width: none;
}

.merchant-material-platform-tabs::-webkit-scrollbar {
  display: none;
}

.merchant-material-platform-tab {
  min-width: 188px;
  border: 1px solid #dbe7f2;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: #324152;
  background: #fbfdff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.merchant-material-platform-tab:hover {
  border-color: #bfd3ef;
  box-shadow: 0 10px 24px rgba(47, 67, 104, 0.08);
  transform: translateY(-1px);
}

.merchant-material-platform-tab.is-active {
  border-color: #2f78e6;
  color: #1d3d67;
  background: linear-gradient(180deg, #f6fbff 0%, #eef5ff 100%);
}

.merchant-material-platform-tab .platform-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.merchant-material-platform-tab span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.merchant-material-platform-tab strong,
.merchant-material-platform-tab small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-material-platform-tab strong {
  font-size: 13px;
}

.merchant-material-platform-tab small {
  color: #7e8b99;
  font-size: 11px;
}

.merchant-material-platform-panel {
  margin: 14px 22px 18px;
  border: 1px solid #dbe7f2;
  border-radius: 8px;
  background: #fff;
}

.material-platform-panel-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid #e7edf3;
}

.material-platform-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.material-platform-title .platform-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.material-platform-title > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.material-platform-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.material-platform-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.merchant-material-subsection {
  padding: 0 18px 18px;
}

.merchant-material-subsection-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #172538;
}

.merchant-material-subsection-head strong {
  font-size: 14px;
}

.merchant-material-subsection-head span {
  color: #7a8797;
  font-size: 11px;
}

.merchant-platform-upload-form {
  margin: 0;
  padding: 14px 18px 16px;
  border-bottom: 1px solid #edf2f7;
  background: #fafcff;
}

.merchant-platform-upload-form .material-upload-zone {
  min-height: 88px;
}

.merchant-platform-upload-form .material-upload-meta {
  min-height: 30px;
}

.merchant-platform-tasks {
  margin: 0 22px 18px;
}

.merchant-material-no-platform {
  margin: 18px 22px;
}

.material-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.material-card-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #edf3f8;
}

.material-card-preview img,
.material-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-kind {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(18, 32, 51, 0.72);
  font-size: 10px;
}

.material-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.material-card-body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-card-body small {
  color: var(--muted);
  font-size: 11px;
}

.material-platform-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.material-platform-field span {
  color: #7e8b99;
  font-size: 10px;
  font-weight: 700;
}

.material-platform-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d7e2ee;
  border-radius: 6px;
  padding: 7px 10px;
  color: #243447;
  background: #f9fbfd;
  font-size: 12px;
}

.material-card-body .btn {
  justify-self: start;
}

.material-card-actions {
  min-height: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.material-card-delete,
.material-card-vod {
  min-width: 0;
  display: flex;
  align-items: center;
}

.material-card-vod {
  justify-content: flex-end;
  margin-left: auto;
  text-align: right;
}

.material-card-actions .btn {
  justify-self: auto;
}

.material-vod-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-radius: 6px;
  color: #0f7b55;
  background: #e5f8ef;
  font-size: 11px;
  font-weight: 700;
}

.material-vod-status .icon {
  width: 13px;
  height: 13px;
}

.material-quality {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}

.material-quality.is-ok {
  color: #087a4d;
  background: #e5f8ef;
}

.material-quality.is-warning {
  color: #8a5c00;
  background: #fff1d6;
}

.material-quality.is-error {
  color: #9b2c2c;
  background: #fde8e8;
}

.material-vod-error {
  overflow: hidden;
  color: #b24a4a !important;
  line-height: 1.4;
  text-overflow: ellipsis;
}

.materials-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.edit-tasks-panel {
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.edit-tasks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
}

.edit-task-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce6f1;
  border-radius: 8px;
  background: #fbfdff;
}

.edit-task-card-head,
.edit-task-meta,
.edit-task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.edit-task-card-head > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.edit-task-card-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-task-card-head small,
.edit-task-message {
  color: var(--muted);
  font-size: 11px;
}

.edit-task-status {
  flex: 0 0 auto;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.edit-task-status.is-success {
  color: #0f7b55;
  background: #ddf8ec;
}

.edit-task-status.is-processing {
  color: #8b5c11;
  background: #fff2cf;
}

.edit-task-status.is-error {
  color: #a33e48;
  background: #ffe6e8;
}

.edit-task-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.edit-task-meta span {
  padding: 5px 7px;
  border-radius: 5px;
  color: #5b6e83;
  background: #eef4fa;
  font-size: 11px;
}

.edit-task-message {
  margin: 0;
  line-height: 1.5;
}

.edit-task-actions {
  justify-content: flex-start;
}

.merchant-edit-modal {
  width: min(860px, 100%);
}

.edit-rule-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line, #d9e1ea);
  border-radius: 8px;
  background: #f8fafc;
}

.edit-rule-panel .settings-group-title {
  margin: 0;
}

.edit-rule-fields {
  margin-top: 0;
}

.edit-material-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.edit-material-picker .settings-group-title {
  margin: 0 0 2px;
}

.edit-material-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 78px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #dbe6f1;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.edit-material-row:has(input:checked) {
  border-color: #2f86f6;
  background: #f2f8ff;
  box-shadow: 0 0 0 3px rgba(47, 134, 246, 0.1);
}

.edit-material-row.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.edit-material-row input {
  width: 16px;
  height: 16px;
  accent-color: #2f86f6;
}

.edit-material-thumb {
  width: 78px;
  height: 48px;
  overflow: hidden;
  border-radius: 5px;
  background: #eaf1f7;
}

.edit-material-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edit-material-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.edit-material-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-material-info small {
  color: var(--muted);
  font-size: 11px;
}

/* Share-page material picker */

body.page-share .share-material-section {
  margin: 8px 0 28px;
}

body.page-share .share-material-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 48px rgba(28, 53, 84, 0.11);
}

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

.share-material-head h2 {
  margin: 0;
  color: #162334;
  font-size: 17px;
}

.share-material-head p {
  margin: 5px 0 0;
  color: #6f8196;
  font-size: 12px;
  line-height: 1.5;
}

.share-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.share-material-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e4ee;
  border-radius: 16px;
  padding: 0;
  color: #122235;
  background: #f5faff;
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.share-material-card:hover,
.share-material-card.is-selected {
  border-color: #2588ea;
  box-shadow: 0 0 0 3px rgba(37, 136, 234, 0.15);
  transform: translateY(-1px);
}

.share-material-preview {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e9f3fa;
}

.share-material-preview img,
.share-material-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-material-card > strong,
.share-material-card > small {
  display: block;
  overflow: hidden;
  padding-right: 12px;
  padding-left: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-material-card > strong {
  margin-top: 10px;
  font-size: 13px;
}

.share-material-card > small {
  margin: 5px 0 12px;
  color: #7890a4;
  font-size: 11px;
}

.share-material-card.is-selected::after {
  position: absolute;
  top: 9px;
  left: 9px;
  content: "已选";
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: #1cae98;
  font-size: 10px;
  font-weight: 800;
}

.share-material-empty {
  padding: 22px 12px;
  color: #71829a;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 620px) {
  .material-storage-switch {
    grid-template-columns: 1fr;
  }

  .material-upload-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .material-upload-progress {
    grid-template-columns: 1fr;
  }

  .material-upload-meta .btn {
    width: 100%;
  }

  .materials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-right: 14px;
    padding-left: 14px;
  }

  .materials-list-head {
    padding-right: 14px;
    padding-left: 14px;
  }
}

/* Mall guide style for user and share H5 */

body.page-home,
body.page-share {
  color: #162334;
  background:
    linear-gradient(180deg, #bfeeff 0%, #f8fbff 16%, #fff8ed 100%),
    #f8fbff;
}

body.page-share.template-two-active {
  color: #fff;
  background:
    radial-gradient(circle at 10% 0%, rgba(45, 140, 255, 0.2), transparent 32%),
    radial-gradient(circle at 90% 18%, rgba(66, 133, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #061b3d 0%, #082b58 100%);
}

body.page-home .mobile-shell,
body.page-share .mobile-shell,
body.page-share .share-shell {
  width: min(100%, 430px);
  padding: 12px 12px 96px;
  color: #162334;
  background:
    linear-gradient(180deg, rgba(206, 244, 255, 0.9), rgba(255, 255, 255, 0.92) 20%, rgba(255, 248, 238, 0.92)),
    #f7fbff;
}

body.page-home .mobile-topbar,
body.page-share .mobile-topbar {
  min-height: 42px;
  margin-bottom: 10px;
}

body.page-home .brand-lockup strong,
body.page-share .brand-lockup strong {
  color: #132033;
  font-size: 16px;
  font-weight: 900;
}

body.page-home .brand-lockup small,
body.page-share .brand-lockup small {
  color: #61718a;
}

body.page-home .brand-mark,
body.page-share .brand-mark {
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #337dff 0%, #28d6b1 48%, #ff8b43 100%);
  box-shadow: 0 10px 24px rgba(37, 137, 232, 0.24);
}

body.page-home .icon-btn,
body.page-share .icon-btn {
  border-color: rgba(55, 110, 170, 0.16);
  color: #37536e;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 20px rgba(50, 82, 120, 0.08);
}

body.page-home .pill-dark,
body.page-share .pill-dark {
  border-color: rgba(37, 95, 150, 0.16);
  color: #456077;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.hero-stage {
  position: relative;
  min-height: 246px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 46px rgba(54, 93, 133, 0.2);
}

.hero-photo {
  height: 246px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(44, 142, 255, 0.16), rgba(255, 151, 73, 0.14)),
    #eef8ff;
}

.hero-photo img,
.hero-photo video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-photo .campaign-placeholder,
.hero-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  color: #44657f;
  text-align: center;
}

.hero-photo .campaign-placeholder strong,
.hero-placeholder strong {
  color: #15283a;
}

.hero-overlay {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding: 14px 15px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  color: #152335;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 32px rgba(53, 85, 124, 0.16);
  backdrop-filter: blur(14px);
}

.hero-kicker {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #0e7d74;
  background: rgba(88, 224, 189, 0.18);
  font-size: 11px;
  font-weight: 900;
}

.hero-overlay h1 {
  margin: 8px 0 0;
  color: #102033;
  font-size: 24px;
  line-height: 1.16;
}

.hero-overlay p {
  margin: 6px 0 0;
  color: #52677f;
  font-size: 12px;
  line-height: 1.55;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 2px 12px;
}

.hero-chip {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(43, 110, 180, 0.13);
  border-radius: 999px;
  color: #475d73;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 18px rgba(65, 91, 125, 0.07);
  font-size: 11px;
}

.promo-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 10px 0 18px;
}

.promo-card {
  min-height: 54px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  display: grid;
  align-content: center;
  padding: 8px 12px;
  color: #fff;
  box-shadow: 0 12px 24px rgba(211, 81, 55, 0.16);
}

.promo-card::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: -5px;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  transform: rotate(-8deg);
}

.promo-card strong {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 900;
}

.promo-card span {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.88;
}

.promo-red {
  background: linear-gradient(110deg, #ff4f64 0%, #ff7f47 100%);
}

.promo-orange {
  background: linear-gradient(110deg, #ff9a35 0%, #ffcf4b 100%);
}

body.page-home .gradient-band,
body.page-share .gradient-band {
  min-height: 32px;
  justify-content: flex-start;
  margin: 18px 4px 9px;
  padding: 0;
  color: #132033;
  background: transparent;
  box-shadow: none;
  font-size: 21px;
  font-weight: 900;
}

body.page-home .gradient-band::before,
body.page-share .gradient-band::before {
  content: "";
  width: 7px;
  height: 24px;
  margin-right: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1d9bff, #4ee4c2);
}

body.page-home .platform-panel,
body.page-share .platform-panel,
body.page-home .campaign-panel,
body.page-share .campaign-panel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  color: #162334;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px rgba(72, 103, 138, 0.13);
  backdrop-filter: blur(14px);
}

body.page-home .platform-panel::before,
body.page-share .platform-panel::before {
  content: "";
  position: absolute;
  top: 24px;
  left: -13px;
  width: 18px;
  border-top: 1px solid rgba(52, 111, 170, 0.72);
}

body.page-home .platform-panel::after,
body.page-share .platform-panel::after {
  content: "";
  position: absolute;
  top: 20px;
  left: -17px;
  width: 7px;
  height: 7px;
  border: 2px solid #2a74b7;
  border-radius: 50%;
  background: #fff;
}

body.page-home .platform-grid,
body.page-share .platform-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

body.page-home .platform-card,
body.page-share .platform-card {
  min-height: 112px;
  align-content: start;
  justify-items: start;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(80, 112, 150, 0.08);
  border-radius: 17px;
  color: #162334;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.9));
  box-shadow: 0 10px 20px rgba(57, 91, 127, 0.08);
}

body.page-home .platform-card:hover,
body.page-share .platform-card:hover {
  border-color: rgba(35, 121, 205, 0.26);
  background: linear-gradient(135deg, #fff, #eef8ff);
  transform: translateY(-2px);
}

body.page-home .platform-card strong,
body.page-share .platform-card strong {
  color: #122235;
  font-size: 14px;
}

body.page-home .platform-card small,
body.page-share .platform-card small {
  color: #6d7d8f;
  font-size: 11px;
}

body.page-home .platform-logo,
body.page-share .platform-logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 8px 16px rgba(50, 82, 120, 0.12);
}

body.page-home .platform-card.tone-blue,
body.page-share .platform-card.tone-blue {
  background: linear-gradient(135deg, #eff8ff, #dff1ff);
}

body.page-home .platform-card.tone-orange,
body.page-share .platform-card.tone-orange {
  background: linear-gradient(135deg, #fff6e6, #ffe6cf);
}

body.page-home .platform-card.tone-rose,
body.page-share .platform-card.tone-rose {
  background: linear-gradient(135deg, #fff0f5, #ffe1ea);
}

body.page-home .platform-card.tone-mint,
body.page-share .platform-card.tone-mint {
  background: linear-gradient(135deg, #edfff7, #d9f8eb);
}

body.page-home .platform-card.tone-lime,
body.page-share .platform-card.tone-lime {
  background: linear-gradient(135deg, #fbffe9, #ecf8cc);
}

body.page-home .platform-card.tone-sky,
body.page-share .platform-card.tone-sky,
body.page-home .platform-card.tone-amber,
body.page-share .platform-card.tone-amber {
  background: linear-gradient(135deg, #eef7ff, #e7edff);
}

body.page-home .campaign-card,
body.page-share .campaign-card {
  border-color: rgba(63, 103, 140, 0.1);
  border-radius: 18px;
  color: #162334;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px rgba(63, 91, 122, 0.09);
}

body.page-home .campaign-media,
body.page-share .campaign-media {
  min-height: 150px;
  color: #586f86;
  background: linear-gradient(135deg, #eaf6ff, #fff4e9);
}

body.page-home .campaign-media img,
body.page-share .campaign-media img,
body.page-home .campaign-media video,
body.page-share .campaign-media video {
  height: 178px;
}

body.page-home .campaign-body h3,
body.page-share .campaign-body h3,
body.page-home .section-head h2,
body.page-share .section-head h2 {
  color: #122235;
}

body.page-home .campaign-body p,
body.page-share .campaign-body p,
body.page-home .section-head p,
body.page-share .section-head p,
body.page-home .campaign-metrics,
body.page-share .campaign-metrics {
  color: #67798d;
}

body.page-home .dark-tag,
body.page-share .dark-tag {
  border-color: rgba(35, 112, 185, 0.14);
  color: #44637e;
  background: rgba(236, 247, 255, 0.9);
}

body.page-home .btn-quiet,
body.page-share .btn-quiet {
  border-color: rgba(35, 112, 185, 0.16);
  color: #315a7c;
  background: rgba(255, 255, 255, 0.8);
}

body.page-home .btn-primary,
body.page-share .btn-primary {
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(25, 129, 216, 0.2);
}

body.page-home .mobile-bottom-nav,
body.page-share .mobile-bottom-nav {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 -12px 26px rgba(57, 83, 112, 0.12);
}

body.page-home .mobile-bottom-nav a,
body.page-home .mobile-bottom-nav button,
body.page-share .mobile-bottom-nav a,
body.page-share .mobile-bottom-nav button {
  color: #6d7c8f;
}

body.page-home .mobile-bottom-nav a.is-active,
body.page-home .mobile-bottom-nav button.is-active,
body.page-share .mobile-bottom-nav a.is-active,
body.page-share .mobile-bottom-nav button.is-active {
  color: #f04466;
}

body.page-share .share-hero {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px rgba(72, 103, 138, 0.13);
}

body.page-share .share-hero h1,
body.page-share .publish-stepper h2,
body.page-share .step-item strong {
  color: #122235;
}

body.page-share .share-hero p,
body.page-share .step-item p {
  color: #67798d;
}

body.page-share .share-media-frame,
body.page-share .publish-stepper {
  border-color: rgba(255, 255, 255, 0.86);
  color: #162334;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 34px rgba(72, 103, 138, 0.13);
}

.platform-logo.has-image {
  padding: 0;
  overflow: hidden;
  color: transparent;
  background: #fff;
}

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

body.page-share .share-directory-shell {
  padding-top: 22px;
  padding-bottom: 34px;
  min-height: 100vh;
}

body.page-share .share-hub-section {
  margin: 8px 0 28px;
}

body.page-share .share-hub-section-head {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 8px 16px;
}

body.page-share .share-hub-section-head > div {
  min-width: 0;
}

body.page-share .share-hub-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: #17283e;
  font-size: 12px;
  font-weight: 900;
}

body.page-share .share-hub-section-head small {
  display: block;
  margin-bottom: 4px;
  color: #698097;
  font-size: 12px;
}

body.page-share .share-hub-section-head h2 {
  margin: 0;
  color: #122235;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0;
  overflow-wrap: normal;
  white-space: normal;
  word-break: keep-all;
}

body.page-share .share-hub-section-note {
  color: #188d86;
  font-size: 12px;
  font-weight: 800;
}

body.page-share .share-directory-shell .platform-panel {
  padding: 30px 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 48px rgba(28, 53, 84, 0.11);
}

body.page-share .share-directory-shell .platform-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.page-share .share-directory-shell .platform-card {
  min-height: 166px;
  padding: 18px 16px;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

body.page-share .share-directory-shell .platform-card:only-child {
  min-height: 166px;
  padding: 18px 16px;
  border-radius: 20px;
}

body.page-share .share-directory-shell .platform-card strong {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.2;
}

body.page-share .share-directory-shell .platform-card:only-child strong {
  margin-top: 10px;
  font-size: 18px;
}

body.page-share .share-directory-shell .platform-card small {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.3;
}

body.page-share .share-directory-shell .platform-card:only-child small {
  margin-top: 5px;
  font-size: 13px;
}

body.page-share .share-directory-shell .platform-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 16px;
}

body.page-share .share-directory-shell .platform-card:only-child .platform-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 16px;
}

body.page-share .share-directory-shell .review-checkin-panel {
  margin: 0 4px 28px;
  padding: 22px;
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  color: #162334;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 44px rgba(72, 103, 138, 0.12);
}

body.page-share .share-directory-shell .review-checkin-head .review-checkin-icon .platform-logo {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  box-shadow: 0 8px 16px rgba(25, 129, 216, 0.18);
}

body.page-share .share-directory-shell .review-checkin-panel h2 {
  color: #122235;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
}

body.page-share .share-directory-shell .review-checkin-panel p {
  color: #67798d;
  font-size: 14px;
  line-height: 1.6;
}

body.page-share .share-directory-shell .review-checkin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.page-share .share-directory-shell .review-checkin-card {
  min-height: 132px;
  padding: 16px 14px;
  border-radius: 18px;
  background: #eef7ff;
}

body.page-share .share-directory-shell .review-checkin-eyebrow {
  color: #71829a;
  font-size: 12px;
}

body.page-share .share-directory-shell .review-checkin-card .review-checkin-eyebrow {
  font-size: 11px;
}

body.page-share .share-directory-shell .review-checkin-card strong {
  color: #13243a;
  font-size: 16px;
  line-height: 1.25;
}

body.page-share .share-directory-shell .review-checkin-card small {
  color: #67798d;
  font-size: 12px;
}

body.page-share .share-directory-shell .review-checkin-note {
  margin-top: 17px;
  padding: 11px 13px;
  color: #71829a;
  background: #f3f7fb;
  font-size: 12px;
}

body.page-share .share-directory-shell .review-checkin-note strong {
  color: #263f59;
  font-size: 13px;
}

body.page-share .share-directory-shell .review-checkin-button {
  min-height: 50px;
  margin-top: 13px;
  border-radius: 14px;
  font-size: 15px;
}

body.page-share .share-directory-shell .wifi-panel {
  margin: 0 4px 28px;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  color: #162334;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 44px rgba(72, 103, 138, 0.12);
}

body.page-share .share-directory-shell .wifi-panel-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  box-shadow: 0 8px 16px rgba(25, 129, 216, 0.18);
}

body.page-share .share-directory-shell .wifi-kicker {
  color: #71829a;
}

body.page-share .share-directory-shell .wifi-panel h2 {
  color: #122235;
  font-size: 28px;
}

body.page-share .share-directory-shell .wifi-panel-head p {
  color: #67798d;
  font-size: 14px;
}

body.page-share .share-directory-shell .wifi-panel-meta span {
  padding: 14px 15px;
  border-radius: 14px;
  background: #f1f7fb;
}

body.page-share .share-directory-shell .wifi-panel-meta small {
  color: #7890a4;
  font-size: 11px;
}

body.page-share .share-directory-shell .wifi-panel-meta strong {
  color: #233b53;
  font-size: 16px;
}

body.page-share .share-directory-shell .wifi-panel-help {
  color: #67798d;
}

.share-template-2 {
  width: min(100%, 430px);
  min-height: 0;
  margin: 0 auto;
  padding: 14px 9px 34px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 8%, rgba(66, 133, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #061b3d 0%, #082b58 100%);
}

.share-company-home-link {
  margin-top: 14px;
  text-align: center;
}

.share-company-home-link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: #6f7f92;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.share-company-home-link a:active {
  opacity: 0.75;
}

body.page-share.template-two-active .share-template-2 {
  background: transparent;
}

.template-two-head {
  display: grid;
  gap: 4px;
  margin: 0 1px 12px;
  padding: 4px 0 2px;
}

.template-two-head span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
}

.template-two-head strong {
  overflow: hidden;
  color: #fff;
  font-size: 20px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-two-section {
  margin: 0 0 18px;
}

.template-two-section h2 {
  margin: 0 1px 9px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.template-two-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.template-two-card {
  min-width: 0;
  min-height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 9px 6px 8px;
  border: 0;
  border-radius: 11px;
  color: #202633;
  background: linear-gradient(145deg, #e4f7ff 0%, #fff 54%, #f8d9e4 100%);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  text-align: center;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.template-two-card:active {
  transform: translateY(1px) scale(0.985);
}

.template-two-card:hover {
  filter: brightness(1.04);
}

.template-two-card .platform-logo,
.template-two-wifi-card > .icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.template-two-wifi-card > .icon {
  padding: 8px;
  color: #fff;
  background: #2dbbd0;
}

.template-two-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-two-card small {
  max-width: 100%;
  overflow: hidden;
  color: #657180;
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-two-empty {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.74);
}

.platform-settings-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.settings-group-title {
  margin: 18px 0 12px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.platform-settings-card {
  min-height: 228px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.platform-settings-card:hover,
.platform-settings-card:focus-visible {
  border-color: #bccaf3;
  box-shadow: 0 12px 30px rgba(47, 67, 104, 0.1);
  outline: 0;
  transform: translateY(-1px);
}

.platform-settings-card.is-disabled {
  opacity: 0.68;
}

.platform-settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.platform-settings-card-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-settings-card-title .platform-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.platform-settings-card-title > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.platform-settings-card-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-settings-card-title span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-settings-status {
  min-height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.platform-settings-status.is-on {
  color: #0f7b55;
  background: #ddf8ec;
}

.platform-settings-status.is-off {
  color: #8b5d18;
  background: #fff0c7;
}

.platform-settings-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.platform-settings-card-meta span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 5px 8px;
  color: #54657a;
  background: #eef4fb;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.platform-card-actions .btn {
  flex: 1 1 116px;
  justify-content: center;
}

.admin-table tr.is-editing {
  background: #f0f7ff;
}

.muted-text {
  color: #8a97aa;
}

.poi-config-panel {
  padding: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 12px;
  background: #f8fbff;
}

.poi-config-panel .settings-group-title {
  margin-top: 0;
}

.poi-config-panel .form-grid {
  margin-top: 12px;
}

.settings-tabs {
  min-height: 46px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: -4px 0 18px;
  border-bottom: 1px solid var(--line);
}

.settings-tab {
  min-height: 46px;
  border: 0;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: #7b8592;
  background: transparent;
  font-weight: 700;
}

.settings-tab:hover,
.settings-tab.is-active {
  border-bottom-color: #5261e7;
  color: #5261e7;
  background: #f5f6ff;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-card {
  margin: 0;
}

.settings-flow {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid #cfdafb;
  border-left: 4px solid #5261e7;
  border-radius: 8px;
  background: #f8f9ff;
}

.settings-flow-kicker {
  color: #5261e7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-flow-copy h2 {
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.35;
}

.settings-flow-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.settings-flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.settings-flow-step {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dce3fb;
  border-radius: 7px;
  background: #fff;
}

.settings-flow-step > span {
  color: #5261e7;
  font-size: 11px;
  font-weight: 900;
}

.settings-flow-step strong {
  color: var(--ink);
  font-size: 12px;
}

.settings-flow-step small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.platform-config-card .admin-card-body {
  padding-bottom: 6px;
}

.platform-settings-modal {
  width: min(920px, 100%);
}

.platform-dev-modal {
  width: min(620px, 100%);
}

.platform-modal-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e9f1;
  border-radius: 8px;
  background: #f7faff;
}

.platform-modal-summary .platform-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.platform-modal-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.platform-modal-summary strong {
  overflow: hidden;
  color: #20334a;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-modal-summary span {
  overflow: hidden;
  color: #6b7c90;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-dev-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 12px 12px;
  text-align: center;
}

.runtime-error-state {
  width: min(420px, calc(100% - 32px));
  min-height: 180px;
  margin: 48px auto;
  padding: 28px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(29, 42, 58, 0.06);
  text-align: center;
}

.runtime-error-state strong {
  font-size: 18px;
}

.runtime-error-state p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.platform-dev-state .platform-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.platform-dev-state strong {
  color: var(--ink);
  font-size: 18px;
}

.platform-dev-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.platform-settings-title-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.platform-settings-title-row > div {
  display: grid;
  gap: 4px;
}

.platform-settings-title-row strong {
  color: var(--ink);
  font-size: 15px;
}

.platform-settings-title-row span:not(.platform-integration-badge) {
  color: var(--muted);
  font-size: 11px;
}

.platform-integration-copy {
  grid-column: 1 / -1;
  margin: -2px 0 2px;
  color: #66758a;
  font-size: 11px;
  line-height: 1.5;
}

.platform-integration-badge {
  min-height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.platform-integration-badge.is-ready {
  color: #21855f;
  background: #e8f8f0;
}

.platform-integration-badge.is-manual {
  color: #a36b17;
  background: #fff4df;
}

@media (max-width: 840px) {
  .settings-flow {
    grid-template-columns: 1fr;
  }

  .settings-flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .settings-tabs {
    overflow-x: auto;
  }

  .settings-tab {
    flex: 0 0 auto;
  }

  .settings-flow {
    padding: 18px;
  }

  .settings-flow-steps {
    grid-template-columns: 1fr;
  }

  .platform-settings-list {
    grid-template-columns: 1fr;
  }

  .platform-settings-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .xhs-publish-media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-home .mobile-shell,
  body.page-share .mobile-shell,
  body.page-share .share-shell {
    padding-right: 9px;
    padding-left: 9px;
  }

  .hero-stage,
  .hero-photo {
    min-height: 228px;
    height: 228px;
  }

  body.page-home .platform-card,
  body.page-share .platform-card {
    min-height: 104px;
  }

  body.page-share .share-directory-shell .platform-card {
    min-height: 144px;
  }

  body.page-share .share-directory-shell .platform-card strong {
    font-size: 21px;
  }

  body.page-share .share-hub-section-head {
    align-items: flex-start;
  }

  body.page-share .share-hub-section-note {
    margin-top: 4px;
  }

  body.page-share .share-directory-shell .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.page-share .share-directory-shell .platform-card:only-child {
    min-height: 144px;
  }

  body.page-share .share-directory-shell .platform-card:only-child strong {
    font-size: 21px;
  }

  .platform-settings-row,
  .platform-settings-fields {
    grid-template-columns: 1fr;
  }

  .platform-copy-item,
  .review-link-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .douyin-publish-fields {
    grid-template-columns: 1fr;
  }

  .xhs-publish-fields {
    grid-template-columns: 1fr;
  }

  .platform-copy-item textarea,
  .douyin-publish-fields .field,
  .xhs-publish-fields .field,
  .review-link-item input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1200px) {
  .platform-settings-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .platform-settings-list {
    grid-template-columns: 1fr;
  }

  .agent-batch-form {
    grid-template-columns: 1fr;
  }
}

.agent-center-metrics .metric-card strong {
  letter-spacing: 0;
}

.agent-assignment-table select {
  min-width: 150px;
  max-width: 220px;
}

.agent-batch-form {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e7ebf0;
  background: #fafbfd;
}

.agent-batch-form .field {
  margin: 0;
}

.agent-batch-form .btn {
  min-height: 40px;
  white-space: nowrap;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 12px;
}

.table-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.table-pagination input {
  width: 62px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}

.promoter-detail-modal {
  width: min(980px, 100%);
}

.promoter-detail-modal .admin-modal-body {
  max-height: min(76vh, 720px);
  overflow: auto;
}

.promoter-detail-metrics {
  margin-bottom: 20px;
}

.promoter-detail-modal .data-toolbar h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.promoter-detail-modal .data-toolbar p {
  margin: 5px 0 0;
}

.agent-workbench-metrics .metric-card {
  min-width: 0;
}

.table-check {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  vertical-align: middle;
}

@media (max-width: 620px) {
  .agent-batch-form {
    grid-template-columns: 1fr;
  }
}

.agent-account-modal {
  width: min(680px, calc(100vw - 28px));
}

.agent-account-modal .review-config-note {
  margin-top: 18px;
}

/* Backoffice reference style: compact Bootstrap-like utility workspace. */
body.admin-page {
  --ink: #27313f;
  --muted: #7c8796;
  --line: #e6e9ee;
  --soft: #f4f6f8;
  --paper: #ffffff;
  --blue: #3478e5;
  color: var(--ink);
  background: #f4f6f8;
}

body.admin-page .admin-shell {
  min-height: 100vh;
  background: #f4f6f8;
}

body.admin-page .admin-sidebar {
  width: 220px;
  color: #5c6674;
  background: #fff;
  border-right: 1px solid #e5e8ed;
  box-shadow: none;
}

body.admin-page .sidebar-brand {
  min-height: 68px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf0f3;
}

body.admin-page .sidebar-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  color: #fff;
  background: #3478e5;
}

body.admin-page .sidebar-brand .brand-mark-image {
  overflow: hidden;
}

body.admin-page .sidebar-brand .brand-mark-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body.admin-page .sidebar-brand strong {
  color: #2b3440;
  font-size: 15px;
  font-weight: 700;
}

body.admin-page .sidebar-brand small {
  color: #9aa3af;
  font-size: 10px;
}

body.admin-page .sidebar-menu {
  gap: 0;
  padding: 10px 0;
}

body.admin-page .sidebar-item {
  min-height: 44px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 0 17px;
  color: #697483;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}

body.admin-page .sidebar-item .icon {
  width: 17px;
  height: 17px;
  color: #9aa4b1;
}

body.admin-page .sidebar-item:hover {
  color: #3478e5;
  background: #f7f9fc;
}

body.admin-page .sidebar-item.is-active {
  border-left-color: #3478e5;
  color: #3478e5;
  background: #eef4ff;
}

body.admin-page .sidebar-item.is-active .icon {
  color: #3478e5;
}

body.admin-page .admin-main {
  margin-left: 220px;
}

body.admin-page .admin-topbar {
  min-height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid #e5e8ed;
  background: #fff;
  box-shadow: none;
}

body.admin-page .admin-topbar-title {
  gap: 10px;
  color: #8993a1;
}

body.admin-page .admin-topbar-title strong {
  color: #2b3440;
  font-size: 15px;
}

body.admin-page .admin-topbar-title .pill {
  min-height: 24px;
  border-radius: 3px;
  color: #6b7890;
  background: #f5f7fa;
}

body.admin-page .admin-user {
  color: #667180;
  font-size: 12px;
}

body.admin-page .admin-content {
  padding: 22px 24px 42px;
}

body.admin-page .admin-heading {
  align-items: center;
  margin-bottom: 16px;
}

body.admin-page .admin-heading h1 {
  color: #27313f;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

body.admin-page .admin-heading p {
  margin-top: 5px;
  color: #8993a1;
  font-size: 12px;
}

body.admin-page .admin-card,
body.admin-page .form-card,
body.admin-page .table-card,
body.admin-page .materials-card {
  border: 1px solid #e4e8ed;
  border-radius: 4px;
  box-shadow: none;
  background: #fff;
}

body.admin-page .metric-grid {
  gap: 12px;
  margin-bottom: 16px;
}

body.admin-page .metric-card,
body.admin-page .stat-card {
  min-height: 112px;
  border: 1px solid #e4e8ed;
  border-radius: 4px;
  padding: 16px;
  background: #fff;
  box-shadow: none;
}

body.admin-page .metric-card span,
body.admin-page .stat-card span {
  color: #8993a1;
  font-size: 12px;
  font-weight: 500;
}

body.admin-page .metric-card strong,
body.admin-page .stat-card strong {
  margin-top: 10px;
  color: #27313f;
  font-size: 25px;
  font-weight: 700;
}

body.admin-page .metric-card small,
body.admin-page .stat-card small {
  margin-top: 5px;
  color: #8b96a4;
  font-size: 11px;
}

body.admin-page .data-toolbar,
body.admin-page .card-head,
body.admin-page .materials-list-head {
  padding: 15px 18px;
  border-bottom: 1px solid #e8ebef;
}

body.admin-page .data-toolbar h2,
body.admin-page .card-head h2,
body.admin-page .materials-list-head h3 {
  color: #2d3745;
  font-size: 15px;
  font-weight: 700;
}

body.admin-page .data-toolbar p,
body.admin-page .card-head p,
body.admin-page .materials-list-head p {
  color: #8b95a2;
  font-size: 11px;
}

body.admin-page .admin-card-body,
body.admin-page .form-body {
  padding: 18px;
}

body.admin-page .admin-table,
body.admin-page .campaign-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

body.admin-page .admin-table th,
body.admin-page .admin-table td,
body.admin-page .campaign-table th,
body.admin-page .campaign-table td {
  border-bottom: 1px solid #edf0f3;
  padding: 12px 14px;
  color: #5f6b7a;
  font-size: 12px;
  vertical-align: middle;
}

body.admin-page .admin-table th,
body.admin-page .campaign-table th {
  color: #8893a1;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

body.admin-page .admin-table tbody tr:hover,
body.admin-page .campaign-table tbody tr:hover {
  background: #fbfcfe;
}

body.admin-page .admin-table td strong,
body.admin-page .campaign-table td strong {
  color: #35404e;
  font-weight: 600;
}

body.admin-page .status-tag,
body.admin-page .pill {
  min-height: 23px;
  border-radius: 3px;
  padding: 0 7px;
  font-size: 11px;
}

body.admin-page .btn {
  min-height: 36px;
  border-radius: 4px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

body.admin-page .btn:hover {
  transform: none;
}

body.admin-page .btn-primary {
  border-color: #3478e5;
  color: #fff;
  background: #3478e5;
  box-shadow: none;
}

body.admin-page .btn-primary:hover {
  border-color: #2868cc;
  background: #2868cc;
}

body.admin-page .btn-secondary {
  border-color: #dce2e9;
  color: #566373;
  background: #fff;
}

body.admin-page .btn-secondary:hover {
  border-color: #bfc9d5;
  background: #f8fafc;
}

body.admin-page .btn-sm {
  min-height: 31px;
  padding: 0 10px;
  font-size: 11px;
}

body.admin-page .field input,
body.admin-page .field textarea,
body.admin-page .field select,
body.admin-page input,
body.admin-page textarea,
body.admin-page select {
  min-height: 38px;
  border: 1px solid #dce2e9;
  border-radius: 4px;
  color: #394553;
  background: #fff;
  font-size: 12px;
}

body.admin-page .field input:focus,
body.admin-page .field textarea:focus,
body.admin-page .field select:focus {
  border-color: #74a3eb;
  box-shadow: 0 0 0 2px rgba(52, 120, 229, 0.1);
}

body.admin-page .field label,
body.admin-page .field > span {
  color: #647080;
  font-size: 12px;
  font-weight: 600;
}

body.admin-page .field-help {
  color: #9aa3af;
  font-size: 11px;
}

body.admin-page .form-actions {
  padding-top: 14px;
}

body.admin-page .admin-modal-backdrop {
  background: rgba(28, 38, 51, 0.36);
  backdrop-filter: none;
}

body.admin-page .admin-modal {
  border: 1px solid #e0e5eb;
  border-radius: 6px;
  box-shadow: 0 16px 42px rgba(30, 42, 58, 0.18);
}

body.admin-page .admin-modal-head {
  padding: 17px 20px;
  background: #fff;
}

body.admin-page .admin-modal-head h2 {
  color: #2d3745;
  font-size: 18px;
}

body.admin-page .admin-modal-head p {
  color: #8b95a2;
  font-size: 12px;
}

body.admin-page .admin-modal-body {
  padding: 20px;
}

body.admin-page .toast {
  top: 18px;
  right: auto;
  bottom: auto;
  left: 50%;
  border: 1px solid #dce3ec;
  border-radius: 4px;
  color: #435062;
  background: #fff;
  box-shadow: 0 8px 24px rgba(30, 42, 58, 0.14);
  transform: translate(-50%, -10px);
}

body.admin-page .toast.is-visible {
  transform: translate(-50%, 0);
}

body.admin-page .merchant-quick-action,
body.admin-page .merchant-campaign-picker-item {
  border: 1px solid #e4e8ed;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}

body.admin-page .merchant-quick-action:hover,
body.admin-page .merchant-campaign-picker-item:hover,
body.admin-page .merchant-campaign-picker-item.is-active {
  border-color: #a9c4ee;
  background: #f7faff;
  transform: none;
}

body.admin-page .platform-settings-card,
body.admin-page .edit-task-card,
body.admin-page .material-card {
  border-radius: 4px;
  box-shadow: none;
}

body.admin-page .login-shell {
  background: #f4f6f8;
}

body.admin-page .login-card {
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(32, 44, 59, 0.08);
}

@media (max-width: 980px) {
  body.admin-page .admin-sidebar {
    width: 76px;
  }

  body.admin-page .admin-main {
    margin-left: 76px;
  }

  body.admin-page .sidebar-brand {
    justify-content: center;
    padding: 16px 8px;
  }

  body.admin-page .sidebar-brand > div:last-child,
  body.admin-page .sidebar-item span:last-child {
    display: none;
  }

  body.admin-page .sidebar-item {
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 620px) {
  body.admin-page .admin-topbar {
    min-height: 60px;
    padding: 0 14px;
  }

  body.admin-page .admin-content {
    padding: 18px 12px 32px;
  }

  body.admin-page .admin-heading {
    align-items: flex-start;
  }

  body.admin-page .admin-heading h1 {
    font-size: 22px;
  }

  body.admin-page .admin-user {
    display: none;
  }

  body.admin-page .data-toolbar,
  body.admin-page .card-head,
  body.admin-page .materials-list-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body.admin-page .data-toolbar-actions {
    width: 100%;
  }

  body.admin-page .data-toolbar-actions .btn {
    flex: 1;
  }

  body.admin-page .admin-modal-backdrop {
    padding: 12px;
  }

  body.admin-page .admin-modal {
    max-height: calc(100vh - 24px);
  }
}

/* Mobile backoffice: turn the desktop sidebar into a reachable bottom tab bar. */
@media (max-width: 760px) {
  body.admin-page {
    overflow-x: hidden;
  }

  body.admin-page .admin-shell {
    min-height: 100svh;
  }

  body.admin-page .admin-sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-top: 1px solid #e1e6ec;
    box-shadow: 0 -5px 18px rgba(31, 45, 62, 0.08);
    background: rgba(255, 255, 255, 0.98);
  }

  body.admin-page .sidebar-brand {
    display: none;
  }

  body.admin-page .sidebar-menu {
    width: 100%;
    height: 68px;
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.admin-page .sidebar-menu::-webkit-scrollbar {
    display: none;
  }

  body.admin-page .sidebar-item {
    flex: 1 0 76px;
    min-width: 76px;
    min-height: 68px;
    height: 68px;
    box-sizing: border-box;
    justify-content: center;
    gap: 3px;
    padding: 7px 6px 5px;
    border: 0;
    border-top: 2px solid transparent;
    border-radius: 0;
    color: #87919e;
    background: transparent;
    font-size: 10px;
    text-align: center;
  }

  body.admin-page .sidebar-item .icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
  }

  body.admin-page .sidebar-item span:last-child {
    display: block !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 16px;
  }

  body.admin-page .sidebar-item:hover {
    color: #3478e5;
    background: #f7faff;
  }

  body.admin-page .sidebar-item.is-active {
    border-left-color: transparent;
    border-top-color: #3478e5;
    color: #3478e5;
    background: #f7faff;
  }

  body.admin-page .sidebar-item.is-active .icon {
    color: #3478e5;
  }

  body.admin-page .admin-main {
    margin-left: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.admin-page .admin-content {
    padding: 16px 12px calc(92px + env(safe-area-inset-bottom));
  }

  body.admin-page .admin-topbar {
    min-height: 58px;
    padding: 0 12px;
  }

  body.admin-page .admin-topbar-title {
    min-width: 0;
    gap: 7px;
  }

  body.admin-page .admin-topbar-title strong {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  body.admin-page .admin-topbar-actions {
    gap: 6px;
  }

  body.admin-page .admin-topbar-actions .btn {
    min-height: 32px;
    padding: 0 8px;
  }

  body.admin-page .admin-heading h1 {
    font-size: 20px;
    line-height: 1.35;
  }

  body.admin-page .admin-heading p {
    max-width: 90vw;
    line-height: 1.55;
  }

  body.admin-page .metric-grid,
  body.admin-page .platform-grid,
  body.admin-page .quick-actions-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.admin-page .admin-table-wrap,
  body.admin-page .table-scroll,
  body.admin-page .campaign-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.admin-page .admin-card,
  body.admin-page .form-card,
  body.admin-page .table-card,
  body.admin-page .materials-card {
    max-width: 100%;
  }

  body.admin-page .admin-modal-backdrop {
    z-index: 60;
    padding: 10px;
    align-items: flex-end;
  }

  body.admin-page .admin-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100svh - 20px);
    margin-bottom: 0;
    border-radius: 8px;
  }

  body.admin-page .admin-modal-body {
    padding: 16px;
    overflow-y: auto;
  }
}

.template-admin-grid,
.template-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.template-admin-card,
.video-template-choice {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.template-admin-preview,
.video-template-choice-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef3f7;
}

.template-admin-preview video,
.video-template-choice-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-no-preview {
  display: grid;
  place-items: center;
  height: 100%;
  gap: 6px;
  color: #8b98a7;
  font-size: 12px;
}

.template-admin-body,
.video-template-choice-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.template-admin-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-admin-title strong,
.video-template-choice-body strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.template-admin-title small,
.video-template-choice-body small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.template-admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #7a8796;
  font-size: 11px;
}

.template-admin-card .table-actions {
  justify-content: flex-start;
}

.video-template-choice {
  position: relative;
  cursor: pointer;
}

.video-template-choice > input {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  width: 18px;
  height: 18px;
}

.video-template-choice:has(input:checked) {
  border-color: #2588ea;
  box-shadow: 0 0 0 3px rgba(37, 136, 234, 0.12);
}

.video-template-choice-body span {
  color: #2588ea;
  font-size: 11px;
}

.merchant-template-modal,
.admin-template-modal {
  width: min(980px, 100%);
}

.admin-template-modal {
  width: min(1180px, 100%);
  max-height: min(92vh, 920px);
}

.admin-template-editor-form {
  gap: 18px;
}

.template-editor-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #1d2025;
  color: #f4f7fb;
}

.template-editor-stage {
  position: relative;
  display: grid;
  min-height: 290px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #333942;
  border-radius: 6px;
  background: #111318;
}

.template-editor-stage video {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(52vh, 420px);
  max-height: 420px;
  background: #090b0f;
  object-fit: contain;
}

.template-editor-empty {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 230px;
  color: #9da8b6;
  font-size: 13px;
}

.template-editor-empty .icon {
  width: 28px;
  height: 28px;
}

.template-editor-stage-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 10px;
  background: rgba(15, 18, 23, 0.92);
  color: #dfe6ef;
  font-size: 12px;
}

.template-editor-stage-bar .icon-btn {
  color: #fff;
}

.template-editor-stage-tip {
  overflow: hidden;
  margin-left: 6px;
  color: #8f9baa;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.template-editor-timeline-head,
.template-editor-seek,
.template-timeline-ruler,
.template-timeline-track {
  display: flex;
  align-items: center;
}

.template-editor-timeline-head {
  justify-content: space-between;
  gap: 12px;
}

.template-editor-timeline-head > div {
  display: grid;
  gap: 3px;
}

.template-editor-timeline-head strong {
  font-size: 14px;
}

.template-editor-timeline-head span,
.template-timeline-ruler,
.template-editor-seek {
  color: #8f9baa;
  font-size: 11px;
}

.template-editor-seek {
  gap: 10px;
}

.template-editor-seek input {
  flex: 1;
  min-width: 100px;
  accent-color: #28b9c8;
}

.template-timeline-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.template-timeline-ruler {
  justify-content: space-between;
  min-width: 760px;
  padding: 0 6px 7px;
  border-bottom: 1px solid #353b44;
}

.template-timeline-track {
  align-items: stretch;
  min-width: 760px;
  min-height: 126px;
  padding: 12px 4px 4px;
}

.template-intro-segment,
.template-timeline-image,
.template-timeline-outro,
.template-timeline-transition {
  flex: 0 0 var(--segment-width, 190px);
  min-height: 102px;
  border: 1px solid #3e4651;
  border-radius: 5px;
}

.template-intro-segment,
.template-timeline-image,
.template-timeline-outro {
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 12px;
}

.template-intro-segment {
  --segment-width: 220px;
  background: #303741;
}

.template-timeline-image {
  background: #253d4a;
}

.template-timeline-outro {
  --segment-width: 130px;
  background: #44392c;
}

.template-segment-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.template-segment-title strong {
  overflow: hidden;
  color: #f4f7fb;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.template-segment-number {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #37a9bb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.template-segment-number.is-video {
  background: #6e7785;
}

.template-intro-segment small,
.template-timeline-image small,
.template-timeline-outro small {
  color: #aeb8c5;
  font-size: 11px;
}

.template-timeline-transition {
  display: grid;
  flex-basis: 78px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 6px;
  border-style: dashed;
  background: #252a31;
  color: #aeb8c5;
  cursor: pointer;
}

.template-timeline-transition:hover,
.template-timeline-transition:focus-visible {
  border-color: #28b9c8;
  color: #fff;
}

.template-timeline-transition.is-configured {
  border-color: #28b9c8;
  background: #17424a;
  color: #b8f2f4;
}

.template-timeline-transition strong {
  font-size: 11px;
}

.template-timeline-transition small {
  width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-upload-box,
.template-slot-settings,
.template-effect-settings,
.template-existing-preview {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfd;
}

.template-slot-list {
  display: grid;
  gap: 12px;
}

.template-slot-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #fff;
}

.template-slot-row.template-timeline-segment {
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.1fr) minmax(260px, 1.6fr);
  align-items: center;
  min-height: 82px;
  padding: 12px;
}

.template-slot-row.template-timeline-segment .template-slot-row-head {
  min-width: 0;
}

.template-segment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px dashed #b7c5d4;
  border-radius: 6px;
  background: #f3f7fa;
  color: #5d7183;
  font-size: 12px;
}

.template-segment-preview span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.template-segment-preview .icon {
  width: 15px;
  height: 15px;
}

.template-segment-preview small {
  color: #2588ea;
  font-size: 11px;
  white-space: nowrap;
}

.template-duration-control {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) 68px;
  align-items: center;
  gap: 10px;
  color: #66798b;
  font-size: 12px;
}

.template-duration-range {
  min-width: 80px;
  accent-color: #2588ea;
}

.template-duration-number {
  width: 100%;
}

.template-slot-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-slot-row-head strong {
  color: var(--ink);
  font-size: 13px;
}

.template-slot-remove {
  color: #d94a4a;
}

.template-slot-add {
  justify-self: start;
}

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

.template-image-field {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #fff;
}

.template-image-field input[type="file"] {
  width: 100%;
}

.template-selected-file {
  color: #6d7b8b;
  font-size: 12px;
}

.template-existing-preview video {
  width: min(360px, 100%);
  max-height: 220px;
  background: #101820;
}

.template-output-panel {
  border-top-color: #dce9f5;
}

@media (max-width: 920px) {
  .template-admin-grid,
  .template-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .template-admin-grid,
  .template-picker-grid {
    grid-template-columns: 1fr;
  }

  .merchant-template-modal,
  .admin-template-modal {
    width: 100%;
  }

  .template-image-fields {
    grid-template-columns: 1fr;
  }

  .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr;
  }

  .template-duration-control {
    grid-template-columns: auto minmax(80px, 1fr) 64px;
  }

  .template-editor-stage {
    min-height: 240px;
  }

  .template-editor-stage video {
    height: min(48vh, 320px);
  }
}

@media (max-width: 390px) {
  body.admin-page .sidebar-item {
    flex-basis: 72px;
    min-width: 72px;
    padding-left: 4px;
    padding-right: 4px;
  }

  body.admin-page .admin-user {
    display: none;
  }

  body.admin-page .admin-topbar-actions .btn {
    font-size: 11px;
  }
}

/* Formal backoffice surface: keep operational content and remove tutorial copy. */
body.admin-page .admin-heading > div > p,
body.admin-page .card-head > div > p,
body.admin-page .data-toolbar > div > p,
body.admin-page .materials-list-head > div > p,
body.admin-page .admin-modal-head p,
body.admin-page .field-help,
body.admin-page .platform-integration-copy,
body.admin-page .platform-copy-meta small,
body.admin-page .platform-dev-state p,
body.admin-page .review-config-note,
body.admin-page .settings-flow,
body.admin-page .merchant-quick-action small {
  display: none !important;
}

/* Operational layout refinement: keep the page calm, with one clear primary task per section. */
body.admin-page .admin-content {
  max-width: 1600px;
  padding-top: 28px;
}

body.admin-page .admin-heading {
  margin-bottom: 22px;
}

body.admin-page .admin-heading h1 {
  font-size: 26px;
  letter-spacing: 0;
}

body.admin-page .admin-card {
  border-color: #e1e6ed;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(29, 42, 58, 0.035);
}

@media (max-width: 1180px) {
  .merchant-content-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .merchant-profile-grid,
  .merchant-basic-grid,
  .merchant-platform-copy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .merchant-content-editor-head,
  .merchant-share-side-head {
    flex-direction: column;
    align-items: stretch;
  }

  .merchant-content-editor-head .btn,
  .merchant-back-workbench {
    width: 100%;
  }

  .merchant-content-editor-actions {
    justify-content: stretch;
  }

  .merchant-content-editor-actions .copy-mode-badge,
  .merchant-content-editor-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

body.admin-page #adminView > .admin-card + .admin-card,
body.admin-page #adminView > .settings-form + .admin-card {
  margin-top: 16px;
}

body.admin-page .metric-grid {
  gap: 12px;
  margin-bottom: 22px;
}

body.admin-page .metric-card {
  min-height: 112px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #fff;
}

body.admin-page .metric-card strong {
  margin-top: 10px;
  font-size: 25px;
}

body.admin-page .data-toolbar {
  min-height: 68px;
  padding: 15px 20px;
}

body.admin-page .data-toolbar h2 {
  font-size: 15px;
}

body.admin-page .data-toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.admin-page .table-wrap {
  padding: 0 20px 18px;
}

body.admin-page .admin-table th,
body.admin-page .admin-table td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.admin-settings-summary-card {
  margin-bottom: 22px;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0 20px 20px;
  background: #e7ebf1;
}

.settings-summary-grid > div {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 14px 16px;
  background: #fff;
}

.settings-summary-grid span {
  color: #85909f;
  font-size: 11px;
}

.settings-summary-grid strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-summary-wide {
  grid-column: span 2;
}

.admin-defaults-modal {
  width: min(720px, 100%);
}

.commission-ledger-card {
  overflow: hidden;
}

.commission-tabs .btn {
  min-width: 116px;
}

.commission-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0 20px 20px;
  background: #e7ebf1;
}

.commission-summary-panel {
  min-width: 0;
  overflow: hidden;
  background: #fff;
}

.commission-summary-head {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf0f4;
}

.commission-summary-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.commission-summary-head span {
  display: block;
  margin-top: 5px;
  color: #8993a0;
  font-size: 11px;
}

.commission-summary-head > strong {
  flex: 0 0 auto;
  color: #172538;
  font-size: 18px;
}

.commission-summary-panel .table-wrap {
  padding: 0 18px 12px;
}

@media (max-width: 1080px) {
  .settings-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-summary-wide {
    grid-column: span 1;
  }

  .commission-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.admin-page .admin-content {
    padding-top: 18px;
  }

  .settings-summary-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .settings-summary-wide {
    grid-column: auto;
  }

  .commission-summary-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .commission-tabs {
    width: 100%;
  }

  .commission-tabs .btn {
    flex: 1;
    min-width: 0;
  }
}

/* Merchant material workflow */

.materials-card > .card-head {
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.materials-workflow {
  padding: 16px 22px 20px;
  border-bottom: 1px solid var(--line);
  background: #f7fafc;
}

.materials-stepbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #71839a;
}

.materials-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

.materials-step b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #71839a;
  background: #e8eef5;
  font-size: 10px;
}

.materials-step strong {
  font-size: 12px;
  font-weight: 700;
}

.materials-step.is-active b {
  color: #fff;
  background: #2f78e6;
}

.materials-step.is-active strong {
  color: #243b56;
}

.materials-step-line {
  width: 32px;
  height: 1px;
  flex: 0 0 auto;
  background: #d7e0ea;
}

.materials-workflow-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.material-workflow-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce6f0;
  border-radius: 8px;
  background: #fff;
}

.material-panel-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e7edf3;
}

.material-panel-head > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.material-panel-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #2f78e6;
  background: #eaf3ff;
  font-size: 11px;
  font-weight: 800;
}

.material-panel-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.material-panel-head p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-workflow-panel .material-upload-form {
  padding: 14px 16px;
  border-bottom: 0;
  background: #fff;
}

.material-workflow-panel .material-upload-zone {
  min-height: 82px;
  padding: 14px;
}

.material-workflow-panel .material-upload-meta {
  min-height: 30px;
}

.material-workflow-panel-xhs .xiaohongshu-groups-grid {
  min-height: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid #edf1f5;
}

.material-workflow-panel-xhs .xiaohongshu-groups-grid .empty-state {
  min-height: 52px;
  padding: 12px;
  border: 1px dashed #d9e3ed;
  border-radius: 6px;
  background: #fbfdff;
  font-size: 12px;
}

.material-library-section {
  border-bottom: 1px solid var(--line);
}

.material-library-section .materials-list-head,
.edit-tasks-panel .materials-list-head {
  padding-top: 18px;
}

.material-library-section .materials-grid .empty-state {
  min-height: 72px;
  padding: 18px;
  border: 1px dashed #d9e3ed;
  border-radius: 6px;
  background: #fbfdff;
}

@media (max-width: 900px) {
  .materials-workflow-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .materials-workflow {
    padding: 14px;
  }

  .merchant-material-platform-tabs {
    padding: 12px 14px 0;
  }

  .merchant-material-platform-tab {
    min-width: 164px;
  }

  .merchant-material-platform-panel,
  .merchant-platform-tasks,
  .merchant-material-no-platform {
    margin-right: 14px;
    margin-left: 14px;
  }

  .material-platform-panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px;
  }

  .merchant-material-subsection {
    padding: 0 14px 14px;
  }

  .materials-stepbar {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .materials-step-line {
    width: 20px;
  }

  .materials-card > .card-head {
    padding: 16px;
  }

  .material-library-section .materials-list-head,
  .edit-tasks-panel .materials-list-head {
    padding-right: 16px;
    padding-left: 16px;
  }

  .material-library-section .materials-grid,
  .edit-tasks-list {
    padding-right: 16px;
    padding-left: 16px;
  }

  .merchant-material-platform-tabs {
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .materials-step strong {
    font-size: 11px;
  }

  .material-panel-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .material-panel-head .btn {
    margin-left: 38px;
  }

  .merchant-material-platform-tab {
    min-width: 152px;
  }

  .material-platform-title {
    align-items: flex-start;
  }
}

/* Template timeline navigation and focused control feedback. */
.template-timeline-image {
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.template-timeline-image:hover,
.template-timeline-image:focus-visible {
  border-color: #42c7d1;
  background: #2b5363;
  outline: 0;
  transform: translateY(-1px);
}

.template-editor-control-column .template-slot-row.is-focus {
  border-color: #2588ea;
  box-shadow: 0 0 0 3px rgba(37, 136, 234, .12);
}

/* Final template editor layout overrides. Keep the whole editing workspace visible. */

/* Full-page template editor surface. */
.admin-template-editor-page {
  min-height: calc(100vh - 152px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-template-editor-page-head {
  position: sticky;
  top: 74px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(39, 63, 89, .08);
  backdrop-filter: blur(8px);
}

.admin-template-editor-page-title,
.admin-template-editor-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-template-editor-page-title > div {
  min-width: 0;
}

.admin-template-editor-kicker {
  display: block;
  margin-bottom: 3px;
  color: #6d7f92;
  font-size: 11px;
  font-weight: 700;
}

.admin-template-editor-page-head h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
}

.admin-template-editor-page-head p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-template-editor-page-form {
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  overflow: visible;
  padding: 0;
}

.admin-template-editor-page-form .template-editor-meta {
  gap: 7px;
  padding: 10px 12px;
}

.admin-template-editor-page-form .template-editor-meta-grid {
  grid-template-columns: minmax(180px, 1.05fr) minmax(120px, .55fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 8px;
}

.admin-template-editor-page-form .template-editor-meta-grid .field-full {
  grid-column: auto;
}

.admin-template-editor-page-form .template-editor-meta-grid .field-help {
  display: none;
}

.admin-template-editor-page-form .template-editor-workspace {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: visible;
}

.admin-template-editor-page-form .template-editor-visual-column {
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: visible;
}

.admin-template-editor-page-form .template-editor-control-column {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
}

.admin-template-editor-page-form .template-editor-panel {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.admin-template-editor-page-form .template-editor-stage {
  height: clamp(300px, 38vh, 500px);
}

.admin-template-editor-page-form .template-editor-stage video {
  height: min(34vh, 440px);
  max-height: 440px;
}

.admin-template-editor-page-form .template-timeline-scroll {
  min-height: 0;
  overflow: hidden;
}

.admin-template-editor-page-form .template-timeline-ruler,
.admin-template-editor-page-form .template-timeline-track {
  min-width: 0;
}

.admin-template-editor-page-form .template-timeline-track {
  flex-wrap: wrap;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow: visible;
}

.admin-template-editor-page-form .template-intro-segment,
.admin-template-editor-page-form .template-timeline-image,
.admin-template-editor-page-form .template-timeline-outro {
  flex: 1 1 122px;
  min-width: 96px;
  min-height: 72px;
  padding: 9px;
}

.admin-template-editor-page-form .template-timeline-transition {
  flex: 0 0 38px;
  min-width: 38px;
  min-height: 72px;
}

.admin-template-editor-page-form .template-slot-settings,
.admin-template-editor-page-form .template-effect-settings,
.admin-template-editor-page-form .template-existing-preview {
  margin-top: 0;
  padding: 12px;
}

.admin-template-editor-page-form .template-slot-list {
  gap: 8px;
}

.admin-template-editor-page-form .template-slot-row.template-timeline-segment {
  grid-template-columns: minmax(145px, .82fr) minmax(170px, 1fr) minmax(260px, 1.35fr);
  gap: 8px;
  min-height: 66px;
  padding: 8px;
}

.admin-template-editor-page-form .template-editor-actions {
  display: none;
}

.admin-template-editor-page-form .template-editor-panel {
  height: auto;
  overflow: visible;
}

.admin-template-editor-page-form .template-editor-stage {
  height: clamp(300px, 42vh, 520px);
}

.admin-template-editor-page-form .template-editor-stage video {
  height: min(38vh, 480px);
  max-height: 480px;
}

.admin-template-editor-page-form .template-timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-color: #63778c #202730;
}

.admin-template-editor-page-form .template-timeline-ruler,
.admin-template-editor-page-form .template-timeline-track {
  width: max-content;
  min-width: 100%;
}

.admin-template-editor-page-form .template-timeline-track {
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  min-height: 190px;
  padding: 8px 2px 4px;
}

.admin-template-editor-page-form .template-intro-segment,
.admin-template-editor-page-form .template-timeline-image,
.admin-template-editor-page-form .template-timeline-outro,
.admin-template-editor-page-form .template-timeline-track > .template-slot-row {
  flex: 0 0 300px;
  width: 300px;
  min-width: 300px;
  min-height: 176px;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row {
  display: grid;
  align-content: stretch;
  grid-template-rows: auto minmax(54px, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid #46586b;
  border-radius: 7px;
  background: #2a3541;
  color: #eef5fb;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-slot-row-head {
  min-width: 0;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-slot-row-head strong {
  color: #f3f8fc;
  font-size: 14px;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-slot-remove {
  color: #ff9b9b;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-segment-preview {
  min-height: 58px;
  padding: 10px;
  border-color: #5d7388;
  background: #364553;
  color: #dce8f2;
  font-size: 13px;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-segment-preview small {
  color: #6bc3ff;
  font-size: 12px;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-duration-control {
  grid-template-columns: auto minmax(100px, 1fr) 70px;
  gap: 9px;
  color: #cad7e3;
  font-size: 12px;
}

.admin-template-editor-page-form .template-timeline-track > .template-slot-row .template-duration-number {
  height: 36px;
  border-color: #6a7e91;
  color: #1e2b38;
  background: #fff;
}

.admin-template-editor-page-form .template-timeline-transition {
  flex: 0 0 78px;
  width: 78px;
  min-width: 78px;
  min-height: 176px;
  border-color: #667789;
  background: #222b34;
}

.admin-template-editor-page-form .template-timeline-transition strong {
  font-size: 13px;
}

.admin-template-editor-page-form .template-timeline-transition small {
  font-size: 10px;
}

.admin-template-editor-page-form .template-editor-control-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  overflow: visible;
  padding-right: 0;
}

.admin-template-editor-page-form .template-slot-settings,
.admin-template-editor-page-form .template-effect-settings,
.admin-template-editor-page-form .template-existing-preview {
  margin-top: 0;
}

.admin-template-editor-page-form .template-existing-preview {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) and (min-width: 821px) {
  .admin-template-editor-page-form .template-editor-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-template-editor-page-form .template-editor-workspace {
    grid-template-columns: minmax(350px, .88fr) minmax(480px, 1.12fr);
  }
}

@media (max-width: 820px) {
  .admin-template-editor-page {
    min-height: auto;
  }

  .admin-template-editor-page-head {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-template-editor-page-title,
  .admin-template-editor-page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-template-editor-page-actions {
    justify-content: flex-end;
  }

  .admin-template-editor-page-form {
    grid-template-rows: auto auto;
  }

  .admin-template-editor-page-form .template-editor-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-template-editor-page-form .template-editor-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .admin-template-editor-page-form .template-editor-control-column {
    grid-template-columns: 1fr;
  }

  .admin-template-editor-page-form .template-editor-visual-column,
  .admin-template-editor-page-form .template-editor-control-column {
    overflow: visible;
  }

  .admin-template-editor-page-form .template-editor-panel {
    height: auto;
  }

  .admin-template-editor-page-form .template-editor-stage {
    height: min(64vw, 360px);
  }
}

@media (max-width: 620px) {
  .admin-template-editor-page-head {
    padding: 10px;
  }

  .admin-template-editor-page-head h1 {
    font-size: 19px;
  }

  .admin-template-editor-page-head p {
    white-space: normal;
  }

  .admin-template-editor-page-form .template-editor-meta-grid,
  .admin-template-editor-page-form .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr;
  }
}

/* Fullscreen template workstation: keep preview/timeline and controls visible together. */
body.template-workspace-is-fullscreen .admin-template-editor-page {
  position: fixed;
  inset: 0;
  z-index: 1200;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  padding: 10px 14px 12px;
  background: #14181e;
  isolation: isolate;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  min-height: 0;
  padding: 9px 12px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head h1 {
  font-size: 20px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-head p {
  max-width: 52vw;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form {
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  gap: 10px;
}

body.template-workspace-is-fullscreen .template-editor-meta {
  flex: 0 0 auto;
  min-height: 0;
  padding: 8px 10px;
}

body.template-workspace-is-fullscreen .template-editor-meta-grid {
  gap: 7px;
}

body.template-workspace-is-fullscreen .template-editor-workspace {
  grid-template-columns: minmax(0, 1.24fr) minmax(380px, .76fr);
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

body.template-workspace-is-fullscreen .template-editor-visual-column {
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
}

body.template-workspace-is-fullscreen .template-editor-control-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 4px 2px 0;
}

body.template-workspace-is-fullscreen .template-editor-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.template-workspace-is-fullscreen .template-editor-stage {
  height: clamp(260px, 39vh, 430px);
  min-height: 0;
}

body.template-workspace-is-fullscreen .template-editor-stage video {
  height: min(35vh, 390px);
  max-height: 390px;
}

body.template-workspace-is-fullscreen .template-timeline-scroll {
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

body.template-workspace-is-fullscreen .template-editor-tip {
  flex: 0 0 auto;
  margin-top: 0;
}

body.template-workspace-is-fullscreen .template-editor-control-column > section {
  min-width: 0;
}

@media (max-width: 1120px) and (min-width: 821px) {
  body.template-workspace-is-fullscreen .template-editor-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(340px, .72fr);
  }
}

@media (max-width: 820px) {
  body.template-workspace-is-fullscreen .admin-template-editor-page {
    position: fixed;
    overflow-y: auto;
    padding: 8px 10px 14px;
  }

  body.template-workspace-is-fullscreen .admin-template-editor-page-head {
    align-items: flex-start;
  }

  body.template-workspace-is-fullscreen .admin-template-editor-page-head p {
    max-width: none;
  }

  body.template-workspace-is-fullscreen .admin-template-editor-page-form {
    overflow: visible;
    grid-template-rows: auto auto;
  }

  body.template-workspace-is-fullscreen .template-editor-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  body.template-workspace-is-fullscreen .template-editor-visual-column,
  body.template-workspace-is-fullscreen .template-editor-control-column {
    overflow: visible;
  }

  body.template-workspace-is-fullscreen .template-editor-control-column {
    grid-template-columns: 1fr;
    padding-right: 0;
  }
}

/* Two-click range marking and visible cut-point feedback. */
.admin-template-editor-page-form .template-timeline-track.is-picking-slot .template-base-track {
  cursor: crosshair;
  border-color: #78d8df;
  box-shadow: inset 0 0 0 1px rgba(120, 216, 223, .16);
}

.admin-template-editor-page-form .template-slot-pick-marker {
  position: absolute;
  top: 12px;
  bottom: 10px;
  z-index: 10;
  width: 3px;
  border-radius: 999px;
  background: #60e0e7;
  box-shadow: 0 0 0 2px rgba(96, 224, 231, .18), 0 0 16px rgba(96, 224, 231, .65);
  pointer-events: none;
  transform: translateX(-50%);
}

.admin-template-editor-page-form .template-slot-pick-marker::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #b9ffff;
  border-radius: 50%;
  background: #1e8f9a;
  content: "";
  transform: translateX(-50%);
}

.admin-template-editor-page-form .template-slot-pick-preview {
  position: absolute;
  top: 54px;
  z-index: 5;
  height: 106px;
  border: 2px dashed #60e0e7;
  border-radius: 7px;
  background: rgba(96, 224, 231, .18);
  pointer-events: none;
}

.admin-template-editor-page-form .template-timeline-track.is-cut-paused .template-timeline-playhead {
  background: #ffd166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, .24), 0 0 18px rgba(255, 209, 102, .8);
}

.admin-template-editor-page-form .template-timeline-track.is-cut-paused::after {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 12;
  padding: 4px 8px;
  border: 1px solid rgba(255, 209, 102, .55);
  border-radius: 999px;
  color: #ffe6a2;
  background: rgba(58, 48, 24, .88);
  content: "切入点";
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

/* Keep all timeline actions together and reserve enough height for the real track. */
.admin-template-editor-page-form .template-editor-timeline-head {
  align-items: flex-start;
  gap: 10px;
}

.admin-template-editor-page-form .template-timeline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.admin-template-editor-page-form .template-timeline-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-template-editor-page-form .template-timeline-action-status {
  flex: 1 1 180px;
  min-width: 150px;
  color: #aebdca;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-panel {
  grid-template-rows: auto auto auto minmax(190px, 1fr);
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage {
  height: clamp(220px, 29vh, 300px);
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-editor-stage video {
  height: min(26vh, 270px);
  max-height: 270px;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-scroll {
  min-height: 190px;
  overflow: auto;
}

body.template-workspace-is-fullscreen .admin-template-editor-page-form .template-timeline-track {
  min-height: 190px;
}

@media (max-width: 900px) {
  .admin-template-editor-page-form .template-editor-timeline-head {
    flex-direction: column;
  }

  .admin-template-editor-page-form .template-timeline-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-template-editor-page-form .template-timeline-action-status {
    flex-basis: 100%;
    text-align: left;
  }
}
.admin-template-modal {
  width: min(1480px, calc(100vw - 24px));
  height: min(940px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
}

.admin-template-modal .admin-modal-head {
  flex: 0 0 auto;
  padding: 12px 18px;
}

.admin-template-modal .admin-modal-head h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

.admin-template-modal .admin-modal-head p {
  font-size: 11px;
}

.admin-template-editor-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  flex: 1 1 auto;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 8px 12px 10px;
}

.template-editor-meta {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcfe;
}

.template-editor-meta .template-editor-section-heading {
  min-height: 22px;
}

.template-editor-meta-grid {
  grid-template-columns: minmax(170px, 1.05fr) minmax(105px, .55fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 7px;
}

.template-editor-meta-grid .field-full {
  grid-column: auto;
}

.template-editor-meta-grid .field {
  min-width: 0;
  gap: 4px;
}

.template-editor-meta-grid .field > span {
  font-size: 11px;
}

.template-editor-meta-grid .field input,
.template-editor-meta-grid .field select {
  min-width: 0;
  height: 34px;
  padding: 7px 9px;
}

.template-editor-meta-grid .field-help {
  display: none;
}

.template-editor-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-editor-section-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.template-editor-section-heading strong {
  color: var(--ink);
  font-size: 15px;
}

.template-editor-section-heading span {
  color: var(--muted);
  font-size: 11px;
}

.template-editor-section-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #d8e4f1;
  border-radius: 999px;
  color: #3373bb !important;
  background: #f2f7fd;
  font-size: 11px !important;
  font-weight: 700;
  white-space: nowrap;
}

.template-editor-workspace {
  display: grid;
  grid-template-columns: minmax(390px, .94fr) minmax(560px, 1.06fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

.template-editor-visual-column,
.template-editor-control-column {
  min-width: 0;
  min-height: 0;
}

.template-editor-visual-column {
  display: grid;
  align-content: start;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding-right: 2px;
}

.template-editor-control-column {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  padding-right: 3px;
}

.template-editor-panel {
  margin: 0;
  height: auto;
  min-height: 0;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
}

.template-editor-stage {
  height: 216px;
  min-height: 0;
}

.template-editor-stage video {
  height: 190px;
  max-height: 190px;
}

.template-editor-stage-bar {
  min-height: 32px;
  padding: 3px 7px;
}

.template-editor-timeline-head {
  min-height: 24px;
}

.template-editor-seek {
  min-height: 24px;
}

.template-timeline-scroll {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.template-timeline-ruler,
.template-timeline-track {
  min-width: 0;
}

.template-timeline-ruler {
  padding-bottom: 4px;
}

.template-timeline-track {
  flex-wrap: wrap;
  align-content: start;
  gap: 3px;
  min-height: 0;
  padding: 5px 0 0;
  overflow: visible;
}

.template-intro-segment,
.template-timeline-image,
.template-timeline-outro {
  flex: 1 1 104px;
  min-width: 86px;
  min-height: 62px;
  padding: 7px;
}

.template-timeline-transition {
  flex: 0 0 34px;
  min-width: 34px;
  min-height: 62px;
  padding: 3px;
}

.template-editor-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dce8f4;
  border-radius: 7px;
  color: #5f7082;
  background: #f6faff;
  font-size: 11px;
  line-height: 1.5;
}

.template-editor-tip .icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #2588ea;
}

.template-editor-tip p {
  margin: 0;
}

.template-editor-control-column .template-slot-settings,
.template-editor-control-column .template-effect-settings,
.template-editor-control-column .template-existing-preview {
  margin-top: 0;
}

.template-editor-control-column .template-slot-settings,
.template-editor-control-column .template-effect-settings {
  gap: 8px;
  padding: 10px;
}

.template-editor-control-column .template-slot-list {
  gap: 6px;
}

.template-editor-control-column .template-slot-row.template-timeline-segment {
  grid-template-columns: minmax(128px, .82fr) minmax(132px, 1fr) minmax(190px, 1.3fr);
  gap: 7px;
  min-height: 58px;
  padding: 7px;
}

.template-editor-control-column .template-segment-preview {
  min-height: 36px;
  padding: 5px 7px;
  font-size: 11px;
}

.template-editor-control-column .template-duration-control {
  grid-template-columns: auto minmax(48px, 1fr) 48px;
  gap: 6px;
  font-size: 10px;
}

.template-editor-control-column .form-grid {
  gap: 10px;
}

.template-editor-control-column .template-existing-preview video {
  width: min(260px, 100%);
  max-height: 180px;
}

.template-editor-actions {
  position: relative;
  z-index: 2;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #e4eaf1;
  background: #fff;
}

@media (max-width: 1080px) {
  .template-editor-workspace {
    grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr);
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr 1fr;
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment .template-duration-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .admin-template-modal {
    width: min(calc(100vw - 20px), 720px);
    height: min(94vh, 900px);
  }

  .admin-template-editor-form {
    overflow-y: auto;
  }

  .template-editor-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .template-editor-visual-column,
  .template-editor-control-column {
    overflow: visible;
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) minmax(200px, 1.3fr);
  }
}

@media (max-width: 620px) {
  .admin-template-editor-form {
    padding: 12px;
  }

  .template-editor-meta-grid,
  .template-editor-control-column .template-slot-row.template-timeline-segment {
    grid-template-columns: 1fr;
  }

  .template-editor-control-column .template-slot-row.template-timeline-segment .template-duration-control {
    grid-column: auto;
  }

  .template-editor-section-heading {
    align-items: flex-start;
  }
}
