:root {
  --bg: #f3f5f7; --card: #fff; --text: #1f1f1f; --sub: #8a8f97;
  --line: #e7eaed; --primary: #4f6079; --done: #4a7e51;
  --warn: #b6862a; --danger: #c0392b; --ink: #1f1f1f;
}
html { -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; }
input, textarea, select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
select {
  appearance: none;
  padding-right: 34px !important;
  background-image: linear-gradient(45deg, transparent 50%, #7c838c 50%), linear-gradient(135deg, #7c838c 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,96,121,.13);
  background-color: #fff;
}

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 60; background: var(--ink); color: #fff; padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
.topbar .brand { font-size: 17px; font-weight: 600; }
.topbar .ver { color: #ddd; font-size: 12px; padding: 3px 10px; background: var(--primary); border-radius: 4px; }
.topbar .who { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: 13px; }
.topbar .who .user-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .who .role { background: var(--primary); padding: 2px 10px; border-radius: 999px; font-size: 11px; }
.topbar .who button { background: none; border: 1px solid #555; color: #ccc; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.topbar .who .logout-btn { background: #fff; border-color: #fff; color: #111; font-weight: 600; }
.topbar .who .logout-btn:hover { opacity: .9; }
.topbar .ws-switch { color: #aaa; font-size: 12px; padding: 4px 10px; border: 1px solid #444; border-radius: 6px; }
.topbar .ws-switch:hover { color: #fff; border-color: #888; }
.top-menu-btn { display: none; }
.top-menu-panel { display: none; }

/* 发布按钮 */
.topbar .pub-btn { font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: all .15s; }
.topbar .pub-btn.pub-clean { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.3); }
.topbar .pub-btn.pub-clean:hover { background: rgba(34,197,94,.2); }
.topbar .pub-btn.pub-dirty { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.4); animation: pub-pulse 2s ease-in-out infinite; }
.topbar .pub-btn.pub-dirty:hover { background: rgba(245,158,11,.25); animation: none; }
@keyframes pub-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.4); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }
@keyframes pubspin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Layout */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 50px); }
.nav { background: #fff; border-right: 1px solid var(--line); padding: 14px 0; }
.nav-item { padding: 12px 22px; cursor: pointer; font-size: 14px; color: #555; display: flex; align-items: center; gap: 10px; }
.nav-item:hover { background: #f7f8f9; }
.nav-item.active { background: #eef2f7; color: var(--primary); border-left: 3px solid var(--primary); padding-left: 19px; font-weight: 600; }
.nav-section { padding: 14px 22px 6px; font-size: 11px; color: #b5b9c0; text-transform: uppercase; letter-spacing: 1px; }
.nav-action { width: 100%; border: 0; background: transparent; font-family: inherit; text-align: left; }
.nav-note { margin: 6px 18px 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; color: #7a828c; font-size: 12px; line-height: 1.6; }
.main { min-width: 0; padding: 28px 34px 42px; overflow-x: visible; }

/* Card */
.card { background: var(--card); border-radius: 8px; padding: 22px 26px; margin-bottom: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card h3 { margin: 0 0 10px; font-size: 14px; color: var(--sub); font-weight: 500; }
.row { display: flex; gap: 24px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 120px; }
.lab { font-size: 12px; color: var(--sub); }
.val { font-size: 14px; margin-top: 2px; }
.val.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.val.big { font-size: 26px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.card .table-card { margin-top: 10px; margin-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card table { min-width: 720px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { color: var(--sub); font-weight: 500; font-size: 12px; background: #fafbfc; }
tr:hover td { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td .mono, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; }
.b-prod  { background: #e5eaf2; color: var(--primary); }
.b-pay   { background: #fcf2dc; color: var(--warn); }
.b-done  { background: #ddedda; color: var(--done); }
.b-cancel{ background: #f6e0dd; color: var(--danger); }
.b-default{ background: #f2f3f5; color: #777; }
.b-info  { background: #def0f6; color: #2b6e8a; }

.progress { height: 4px; background: #eef0f3; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); }

.btn { min-height: 36px; background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-warn { background: #fff; color: var(--warn); border: 1px solid var(--warn); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn:hover { opacity: .85; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12px; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar.compact { margin-bottom: 0; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }

.package-page-head {
  align-items: center;
  margin-bottom: 14px;
}
.package-main-actions {
  justify-content: flex-end;
}
.package-tools {
  padding: 16px;
}
.package-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.package-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.package-chip-list .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.package-chip-list .btn span {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  font-size: 11px;
  line-height: 1.4;
}
.package-chip-list .btn small {
  margin-left: 6px;
  color: inherit;
  opacity: .72;
  font-size: 11px;
}
.package-chip-list .btn-ghost span {
  background: #eef1f4;
  color: #6f7680;
}
.package-chip-muted {
  opacity: .62;
}
.package-filter-row select {
  width: 220px;
  min-height: 36px;
  padding: 7px 12px;
  color: #4c535c;
}
.package-list-summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 12px;
}
.package-list-summary b {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}
.package-list-summary em {
  font-style: normal;
}
.package-inline-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 260px;
}
.package-inline-editor label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #6f7680;
  font-size: 12px;
  white-space: nowrap;
}
.package-inline-editor input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}
.package-inline-input {
  width: 112px;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}
.package-inline-input[type="number"] {
  width: 86px;
}
.package-inline-input.sort {
  width: 64px;
}
.package-inline-check span {
  color: var(--text);
  font-weight: 600;
}
.package-inline-meta {
  flex: 0 0 100%;
}
.package-state-editor {
  min-width: 132px;
}

/* Readable order detail */
.order-detail-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.order-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.order-detail-head h2 {
  margin: 3px 0 4px;
  font-size: 24px;
  line-height: 1.25;
}
.order-subline {
  color: var(--sub);
  font-size: 13px;
}
.order-action-bar {
  margin-bottom: 0;
}
.order-read-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 16px;
}
.order-read-grid section,
.order-section-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.order-read-grid h3,
.order-section-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.order-info-list,
.order-config-grid,
.order-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.order-info-list div,
.order-config-line,
.order-money-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fbfcfd;
}
.order-info-list span,
.order-config-line span,
.order-money-grid span {
  display: block;
  color: var(--sub);
  font-size: 12px;
}
.order-info-list b,
.order-config-line b,
.order-money-grid b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.order-money-grid div:first-child b {
  font-size: 20px;
}
.order-note-box {
  min-height: 62px;
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f7f8f9;
  color: #4b5563;
  line-height: 1.65;
}
.order-package-board {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.order-package-title {
  margin-bottom: 10px;
  color: var(--sub);
  font-size: 12px;
}
.order-package-group {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px dashed #e4e7eb;
}
.order-package-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.order-package-category {
  color: var(--text);
  font-weight: 700;
}
.order-package-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.order-package-list span {
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  line-height: 1.45;
}
.order-confirm-state,
.order-empty-line {
  margin-top: 12px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.7;
}
.order-stage-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.order-stage-list .stage-row {
  min-width: 0;
}

/* Modal */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 8px; padding: 28px 34px 38px; width: min(1040px, 94vw); max-height: 88vh; overflow-y: auto; }
.modal.modal-narrow { width: min(440px, 94vw); }
.modal h3 { margin: 0 0 20px; font-size: 18px; }
.modal label { display: block; font-size: 13px; color: #656b74; margin: 0 0 7px; }
.modal input, .modal textarea, .modal select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
/* 复选框走自身尺寸，不能被上面的 width:100% 撑爆（会把 label 文字挤成竖排单字） */
.modal input[type="checkbox"] { width: auto; padding: 0; margin: 0; flex: 0 0 auto; vertical-align: middle; }
.modal input:focus, .modal textarea:focus, .modal select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,96,121,.12); }
.modal textarea { resize: vertical; min-height: 80px; }
.modal-foot { margin: 30px -34px -38px; padding: 18px 34px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: -38px; background: #fff; box-shadow: 0 -1px 0 rgba(0,0,0,.02); }

/* Form grid (two columns, sections, cells) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-cell { min-width: 0; }
.form-cell.full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; padding: 12px 0 4px; margin-top: 10px; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.form-section .sec-title { font-size: 15px; color: #222; font-weight: 600; scroll-margin-top: 86px; }
.form-section .sec-hint  { font-size: 12px; color: #999; margin-top: 2px; }
.form-cell .field-hint { font-size: 12px; color: #888; margin-top: 4px; line-height: 1.4; }
.form-section-nav {
  position: sticky;
  top: -28px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px -34px 22px;
  padding: 12px 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 22px rgba(31,41,55,.08);
  backdrop-filter: blur(12px);
}
.form-section-nav button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #59616c;
  cursor: pointer;
  font-size: 12px;
}
.form-section-nav button:hover { border-color: var(--primary); color: var(--primary); }
.activity-intro-editor {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}
.activity-intro-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.activity-intro-tool {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  background: #fff;
  color: #4f5966;
  font-size: 12px;
  cursor: pointer;
}
.activity-intro-tool:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.activity-intro-tool.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.activity-intro-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr);
  gap: 0;
  min-height: 420px;
}
.modal .activity-intro-shell textarea {
  min-height: 420px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  resize: vertical;
  font-size: 15px;
  line-height: 1.8;
}
.activity-intro-preview-panel {
  border-left: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}
.activity-intro-preview-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
}
.activity-intro-preview {
  padding: 18px 18px 22px;
  max-height: 520px;
  overflow: auto;
}
.activity-intro-preview-empty {
  color: #9aa1aa;
  font-size: 13px;
  line-height: 1.7;
}
.activity-intro-pv-section {
  margin: 2px 0 12px;
  color: #1d2733;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
}
.activity-intro-pv-subheading {
  margin: 18px 0 8px;
  padding: 8px 0 8px 12px;
  border-left: 5px solid var(--primary);
  background: #f5f7fa;
  color: #1d2733;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 800;
}
.activity-intro-pv-paragraph {
  margin: 6px 0 12px;
  color: #343b45;
  font-size: 14px;
  line-height: 1.85;
}
.activity-intro-pv-bullet {
  display: flex;
  gap: 9px;
  margin: 8px 0;
  color: #343b45;
  font-size: 14px;
  line-height: 1.75;
}
.activity-intro-pv-bullet i {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin-top: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.activity-intro-pv-bullet p {
  margin: 0;
}
.activity-intro-pv-bullet b,
.activity-intro-preview strong {
  color: var(--primary);
  font-weight: 800;
}
.activity-intro-pv-timeslot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 12px 14px;
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #eef4ff;
}
.activity-intro-pv-timeslot span {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.activity-intro-pv-timeslot strong {
  color: #1d2733;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 800;
}
.activity-intro-pv-callout {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-left: 5px solid #d99a2b;
  border-radius: 8px;
  background: #fff7e8;
  color: #4a3720;
  font-size: 14px;
  line-height: 1.75;
  font-weight: 700;
}
.activity-intro-pv-divider {
  height: 1px;
  margin: 16px 0;
  background: #e3e7ec;
}
.activity-intro-help {
  padding: 9px 12px 11px;
  border-top: 1px solid var(--line);
  color: #7b838e;
  background: #fff;
  font-size: 12px;
  line-height: 1.6;
}
.date-range-field { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.date-range-field span { color: var(--sub); font-size: 13px; white-space: nowrap; }
.color-field { display: grid; grid-template-columns: minmax(0, 1fr) 58px 44px; gap: 10px; align-items: center; }
.modal .color-field input[type="color"] {
  width: 58px;
  height: 42px;
  padding: 4px;
  cursor: pointer;
}
.color-swatch-preview {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.section-head h3 { margin: 0 0 4px; }
.home-metric { cursor: pointer; min-width: 150px; }
.home-metric:hover { box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.workspace-guide { border: 1px solid #edf0f4; }
.workspace-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.workspace-card { min-height: 106px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; cursor: pointer; color: var(--text); }
.workspace-card:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(79,96,121,.1); }
.workspace-card b { display: block; margin-bottom: 8px; font-size: 14px; }
.workspace-card span { display: block; color: var(--sub); font-size: 12px; line-height: 1.55; }
.home-source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.home-source { min-height: 96px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; cursor: pointer; }
.home-source:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(79,96,121,.08); }
.home-source b { display: block; font-size: 14px; margin-bottom: 8px; color: var(--text); }
.home-source span { display: block; color: var(--sub); font-size: 12px; line-height: 1.6; }
.home-promo-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid #f4d58d;
  border-radius: 8px;
  background: #fff8e7;
  color: #8a6a1a;
  font-size: 14px;
  line-height: 1.6;
}
.home-promo-preview.muted {
  border-color: var(--line);
  background: #f7f8fa;
  color: var(--sub);
}
.home-promo-preview span { font-weight: 600; }
.home-promo-preview em {
  flex-shrink: 0;
  font-style: normal;
  font-size: 12px;
  color: #9a6b00;
}

/* Structured jump target picker */
.link-picker { position: relative; }
.link-picker-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.link-picker-summary { display: flex; align-items: center; gap: 12px; min-width: 0; }
.link-picker-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.link-picker-summary strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-picker-summary small {
  display: block;
  margin-top: 2px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
}
.link-picker-summary code {
  display: inline-block;
  max-width: min(680px, 62vw);
  margin-top: 5px;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #68707b;
  font-size: 11px;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}
.link-picker-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(24,32,45,.12);
  overflow: hidden;
}
.link-picker-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.link-picker-tools input { min-height: 38px; }
.link-picker-body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 360px;
}
.link-picker-tabs {
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}
.link-picker-tabs button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  text-align: left;
}
.link-picker-tabs button:hover { background: #fff; border-color: var(--line); }
.link-picker-tabs button.active {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(79,96,121,.08);
}
.link-picker-tabs b { font-size: 13px; }
.link-picker-tabs span {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef1f4;
  color: #7b838f;
  font-size: 11px;
  text-align: center;
}
.link-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  align-content: start;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}
.link-picker-item {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.link-picker-item:hover { border-color: var(--primary); box-shadow: 0 5px 16px rgba(79,96,121,.1); }
.link-picker-item.active { border-color: var(--primary); background: #f5f7fa; box-shadow: 0 0 0 3px rgba(79,96,121,.08); }
.link-picker-cover {
  width: 74px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f7;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
.link-picker-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-picker-copy { min-width: 0; }
.link-picker-copy b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-picker-copy small {
  display: -webkit-box;
  min-height: 34px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.link-picker-copy em {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 11px;
  font-style: normal;
}
.link-picker-empty {
  grid-column: 1 / -1;
  padding: 42px 16px;
  color: var(--sub);
  text-align: center;
}
.link-picker-manual {
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.link-picker-manual summary {
  padding: 11px 12px;
  color: #667085;
  cursor: pointer;
  font-size: 12px;
}
.link-picker-manual div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 12px 12px;
}

/* WeChat Pay admin */
.pay-summary-grid .pay-summary-card { flex: 1; min-width: 240px; }
.pay-guide-card .section-head { align-items: center; }
.pay-guide-body[hidden] { display: none; }
.pay-guide-alert { margin-top: 8px; padding: 12px 14px; border: 1px solid #efd8a8; border-radius: 8px; background: #fff8e8; color: #7a5315; font-size: 13px; line-height: 1.75; }
.pay-guide-alert.danger { border-color: #f2c7c2; background: #fff1ef; color: #9f2f24; }
.pay-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.pay-guide-step { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; padding: 14px; }
.pay-guide-step-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.pay-guide-step-head span { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600; }
.pay-guide-step-head b { min-width: 0; color: var(--text); font-size: 14px; line-height: 1.35; }
.pay-guide-step ul { margin: 0; padding-left: 18px; color: #555; font-size: 13px; line-height: 1.75; }
.pay-guide-step li + li { margin-top: 4px; }
.pay-config-card .section-head { align-items: center; }
.pay-mode-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 18px; }
.pay-mode-option { position: relative; display: block !important; min-height: 94px; margin: 0 !important; padding: 16px 18px 16px 46px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--text) !important; background: #fff; }
.pay-mode-option input { position: absolute; left: 18px; top: 18px; width: 16px !important; min-height: 16px !important; height: 16px; margin: 0; accent-color: var(--primary); }
.pay-mode-option span { display: block; font-weight: 600; font-size: 14px; }
.pay-mode-option small { display: block; margin-top: 6px; color: var(--sub); font-size: 12px; line-height: 1.55; }
.pay-mode-option.active { border-color: var(--primary); background: #f5f7fa; box-shadow: 0 0 0 3px rgba(79,96,121,.08); }
.pay-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pay-field { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.pay-field label { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 8px; color: #4c535c; }
.pay-field input:not([type="checkbox"]) { width: 100%; background: #fff; }
.pay-field-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; color: var(--sub); font-size: 12px; }
.inline-check { display: flex !important; align-items: center; gap: 8px; margin: 10px 0 0 !important; font-size: 12px !important; color: #666 !important; }
.inline-check input { width: auto !important; min-height: auto !important; }
.switch-field { display: flex !important; align-items: flex-start !important; gap: 10px !important; margin: 0 !important; cursor: pointer; }
.switch-field input { width: 18px !important; height: 18px; min-height: 18px !important; margin-top: 2px; accent-color: var(--primary); }
.switch-field b { display: block; color: var(--text); font-size: 14px; }
.switch-field small { display: block; margin-top: 4px; color: var(--sub); line-height: 1.55; }
.pay-actions { margin-top: 18px; justify-content: flex-end; }
.qr-wrap { text-align: center; }
.qr-wrap img { width: 240px; height: 240px; border: 1px solid var(--line); padding: 6px; background: #fff; }
.qr-wrap .token { font-family: ui-monospace, monospace; font-size: 10px; word-break: break-all; color: var(--sub); margin-top: 8px; max-width: 240px; margin-left: auto; margin-right: auto; }

/* Sales contact admin */
.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-title-row h2 { margin: 0 0 6px; }
.page-subtitle { color: var(--sub); font-size: 13px; }
.sales-contact-page { display: grid; gap: 16px; }
.sales-contact-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #eef3f8;
}
.sales-contact-hero h3 { margin: 4px 0 8px; font-size: 22px; color: var(--text); }
.sales-contact-hero p { max-width: 720px; margin: 0; color: #5d6673; line-height: 1.7; }
.sales-contact-hero .eyebrow {
  color: #65758a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
.sales-contact-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
  min-width: 270px;
}
.sales-contact-stats span {
  display: block;
  padding: 12px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  color: #6b7280;
  font-size: 12px;
  text-align: center;
}
.sales-contact-stats b { display: block; margin-bottom: 2px; color: var(--text); font-size: 22px; }
.sales-contact-section { margin-bottom: 0; }
.sales-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sales-contact-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sales-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
}
.sales-field.wide,
.sales-contact-grid .wide { grid-column: 1 / -1; }
.sales-field input,
.sales-field select,
.sales-field textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.sales-image-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.sales-image-preview {
  width: 86px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f8;
}
.sales-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sales-image-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.sales-image-inputs .field-hint { grid-column: 1 / -1; }
.sales-contact-list { display: grid; gap: 12px; }
.sales-person-card,
.sales-place-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.sales-place-card { background: #fff; }
.sales-person-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sales-person-index {
  flex: 1;
  color: #111827;
  font-weight: 700;
}
.sales-switch select {
  width: auto;
  min-height: 34px;
  padding: 6px 28px 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.sales-contact-empty {
  padding: 28px 16px;
  border: 1px dashed #cdd5df;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--sub);
  text-align: center;
}
.sales-contact-savebar {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 -8px 24px rgba(15,23,42,.06);
  backdrop-filter: blur(12px);
}

.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13px; z-index: 200; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.err { background: var(--danger); }

/* Stage timeline */
.stage-list { padding: 0; }
.stage-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stage-row:last-child { border: none; }
.stage-dot { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; }
.stage-dot.pending { background: #fff; border: 2px solid #d6d8db; color: transparent; }
.stage-dot.in_progress { background: var(--primary); box-shadow: 0 0 0 3px rgba(79,96,121,.15); }
.stage-dot.done { background: var(--done); }
.stage-body { flex: 1; }
.stage-head { display: flex; align-items: center; gap: 10px; }
.stage-seq { color: var(--sub); font-family: ui-monospace, monospace; font-size: 11px; }
.stage-name { font-weight: 600; }
.stage-ms { background: #fbf1da; color: var(--warn); font-size: 10px; padding: 1px 8px; border-radius: 4px; }
.stage-desc { font-size: 12px; color: var(--sub); margin-top: 4px; }
.stage-meta { font-size: 12px; color: var(--sub); margin-top: 4px; }
.stage-note { background: #f7f8f9; padding: 8px 12px; border-radius: 6px; font-size: 12px; margin-top: 6px; }
.stage-actions { display: flex; gap: 8px; margin-top: 6px; }
.stage-photos { display: flex; gap: 6px; margin-top: 6px; }
.stage-photos img { width: 50px; height: 50px; border-radius: 4px; object-fit: cover; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 42px 20px; background: #eef0f2; }
.login-shell { width: min(1040px, 100%); min-height: 620px; display: grid; grid-template-columns: 1.08fr .92fr; background: #fff; border: 1px solid rgba(17,17,17,.08); border-radius: 8px; overflow: hidden; box-shadow: 0 24px 64px rgba(17,24,39,.14); }
.login-visual { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 44px; color: #111; background: #f7f8f8; border-right: 1px solid #e3e6e8; overflow: hidden; }
.login-visual::before { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(255,255,255,.86), rgba(245,246,247,.18) 46%), repeating-linear-gradient(90deg, rgba(17,17,17,.055) 0 1px, transparent 1px 86px); opacity: .9; }
.login-visual::after { content: ""; position: absolute; right: -76px; bottom: -98px; width: 330px; height: 330px; border: 1px solid rgba(17,17,17,.12); border-radius: 50%; box-shadow: inset 0 0 0 48px rgba(17,17,17,.035); }
.login-logo { position: absolute; top: 42px; left: 44px; width: 210px; height: auto; z-index: 1; }
.login-kicker, .login-visual h1, .login-visual p, .login-metrics { position: relative; z-index: 1; }
.login-kicker { margin-bottom: 12px; color: #7b8088; font-size: 12px; letter-spacing: 2px; }
.login-visual h1 { max-width: 460px; margin: 0; font-size: 36px; line-height: 1.16; font-weight: 700; }
.login-visual p { max-width: 440px; margin: 16px 0 0; color: #6f747c; font-size: 15px; line-height: 1.8; }
.login-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 36px; }
.login-metrics div { padding: 16px 14px; border: 1px solid #dfe3e6; border-radius: 8px; background: rgba(255,255,255,.58); }
.login-metrics strong { display: block; font-size: 22px; line-height: 1; }
.login-metrics span { display: block; margin-top: 8px; color: #7d838b; font-size: 12px; }
.login-box { align-self: center; width: min(390px, calc(100% - 56px)); margin: 0 auto; padding: 0; background: #fff; }
.login-head { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.login-logo-sm { display: none; width: 82px; height: auto; flex: 0 0 auto; border-radius: 6px; }
.login-box h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; }
.login-box .tag { color: var(--sub); font-size: 13px; }
.login-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; padding: 4px; border: 1px solid #e1e5e9; border-radius: 8px; background: #f5f6f7; }
.login-tabs button { width: auto; min-height: 38px; margin: 0; padding: 8px 10px; border-radius: 6px; background: transparent; color: #5f6670; box-shadow: none; font-size: 13px; }
.login-tabs button:hover { transform: none; opacity: 1; }
.login-tabs button.active { background: #111; color: #fff; box-shadow: 0 8px 16px rgba(17,17,17,.14); }
.login-panel[hidden] { display: none; }
.login-box label { display: block; font-size: 12px; color: #6f757d; margin: 16px 0 7px; }
.login-box input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #dfe3e8; border-radius: 8px; background: #fbfcfd; font-size: 15px; transition: border-color .16s, box-shadow .16s, background .16s; }
.login-box input:focus { outline: none; border-color: #111; background: #fff; box-shadow: 0 0 0 4px rgba(17,17,17,.08); }
.login-box button { width: 100%; min-height: 48px; margin-top: 24px; padding: 12px; background: #111; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .16s, opacity .16s, box-shadow .16s; box-shadow: 0 12px 24px rgba(17,17,17,.18); }
.login-box button:hover { opacity: .92; transform: translateY(-1px); }
.login-box button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.wechat-login-box { margin-top: 8px; padding: 20px 18px; border: 1px solid #dfe3e8; border-radius: 8px; background: #fbfcfd; text-align: center; }
.wechat-login-icon { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 999px; background: #16a34a; color: #fff; font-weight: 700; }
.wechat-login-box b { display: block; font-size: 15px; }
.wechat-login-box p { margin: 8px 0 0; color: #6f747c; font-size: 12px; line-height: 1.75; text-align: left; }
.wechat-login-box button { margin-top: 16px; background: #8a919a; box-shadow: none; }
.legacy-login { margin-top: 18px; border-top: 1px solid #edf0f2; padding-top: 14px; }
.legacy-login summary { cursor: pointer; color: #626a73; font-size: 12px; }
.legacy-login button { min-height: 42px; margin-top: 16px; background: #fff; color: #111; border: 1px solid #d8dde2; box-shadow: none; }
.login-box .hint { color: #7d838b; font-size: 12px; margin-top: 18px; line-height: 1.8; background: #f5f6f7; padding: 12px 14px; border-radius: 8px; border: 1px solid #eceff2; }
.login-err { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* List / KV / Image fields */
.list-field, .kv-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.list-row, .kv-row { display: flex; gap: 8px; align-items: center; }
.list-row input, .kv-row input { flex: 1; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.kv-row .kv-k { flex: 0 0 35%; background: #fafbfc; }
.field-row-tools { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.list-x { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: #6b7280; font-size: 14px; line-height: 1; padding: 0; }
.list-x.danger { color: var(--danger); font-size: 16px; }
.list-x:hover { background: #fef0ee; }
.object-list-field, .config-groups-field { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.object-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.object-list-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.object-list-body label { min-width: 0; margin: 0; }
.object-list-body label:has(textarea), .object-list-body .object-list-image { grid-column: 1 / -1; }
.object-list-body input, .object-list-body textarea, .object-list-body select { background: #fff; }
.object-list-image-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 6px 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f5;
  overflow: hidden;
}
.object-list-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.object-list-image-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.config-group-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.config-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}
.config-group-head label { margin: 0; }
.config-items { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.config-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.config-groups-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.img-field { display: flex; flex-direction: column; gap: 8px; }
.img-preview { min-height: 0; }
.img-preview img { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); display: block; object-fit: cover; background: #fafbfc; }
.img-row { display: flex; gap: 10px; align-items: center; }
.img-row input { flex: 1; }
.video-field .img-row { flex-wrap: wrap; }
.video-field .img-row input { min-width: min(100%, 360px); }
.img-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 96px;
  min-height: 40px;
  padding: 9px 16px;
  background: #24384f;
  color: #fff !important;
  border: 1px solid #24384f;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  margin: 0 !important;
  box-shadow: 0 2px 8px rgba(36,56,79,.18);
}
.img-upload-btn:hover { background: #1d2f45; border-color: #1d2f45; color: #fff !important; opacity: 1; }
.img-upload-btn:active { transform: translateY(1px); }
.video-field .img-upload-btn { min-width: 116px; background: #184d3a; border-color: #184d3a; box-shadow: 0 2px 8px rgba(24,77,58,.18); }
.video-field .img-upload-btn:hover { background: #123d2d; border-color: #123d2d; }
.video-field .video-capture-btn {
  min-width: 128px;
  background: #4f6079;
  border-color: #4f6079;
  box-shadow: 0 2px 8px rgba(79,96,121,.18);
}
.video-field .video-capture-btn:hover {
  background: #3e4f68;
  border-color: #3e4f68;
}
.multi-upload { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; background: #fafbfc; }
.upload-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.upload-thumb { position: relative; width: 112px; height: 112px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb.is-uploading::after { content: ""; position: absolute; inset: 0; background: rgba(15,23,42,.16); pointer-events: none; }
.upload-thumb-placeholder { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--sub); font-size: 12px; background: #eef2f7; }
.upload-thumb-remove { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0,0,0,.64); color: #fff; cursor: pointer; line-height: 22px; padding: 0; z-index: 2; }
.upload-thumb-actions { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; z-index: 2; }
.upload-thumb-actions button { width: 26px; height: 24px; border: 0; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; cursor: pointer; line-height: 22px; padding: 0; font-size: 12px; }
.upload-thumb-remove:hover, .upload-thumb-actions button:hover { background: rgba(0,0,0,.82); }
.photo-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  background: #24384f;
  color: #fff !important;
  border: 1px solid #24384f;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  margin: 0 !important;
  box-shadow: 0 2px 8px rgba(36,56,79,.18);
}
.photo-add-btn:hover { background: #1d2f45; border-color: #1d2f45; color: #fff !important; opacity: 1; }
.upload-progress { position: relative; overflow: hidden; min-height: 28px; margin-top: 8px; border: 1px solid var(--line); border-radius: 999px; background: #f3f5f8; }
.upload-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #4f6079, #6e83a3); transition: width .16s ease; }
.upload-progress-meta { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; color: #24384f; font-size: 12px; font-weight: 700; }
.upload-progress-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress-mini { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; margin: 0; min-height: 24px; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.82); }
.upload-progress-mini .upload-progress-meta { padding: 4px 7px; font-size: 11px; }
.upload-hint { margin-top: 8px; font-size: 12px; color: var(--sub); }

/* 工作台选择卡 */
.ws-picker { display: flex; gap: 22px; margin-top: 22px; }
.ws-card { flex: 1; padding: 28px 24px; background: #fff; border-radius: 8px; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.06); transition: transform .15s; }
.ws-card:hover { transform: translateY(-3px); }
.ws-card .ico { font-size: 32px; }
.ws-card h3 { margin: 10px 0 6px; }
.ws-card p { color: var(--sub); font-size: 12px; margin: 0; }

@media (max-width: 760px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { background: #eef1f4; font-size: 14px; }
  h2 { font-size: 18px; line-height: 1.25; }

	  .topbar {
	    position: relative;
	    top: auto;
	    width: 100%;
	    max-width: 100vw;
	    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    flex-wrap: wrap;
    gap: 8px 10px;
    box-shadow: 0 1px 0 rgba(255,255,255,.08);
  }
  .topbar .brand { font-size: 16px; line-height: 1.2; }
  .topbar .ver { font-size: 11px; padding: 3px 8px; }
  .topbar > .ws-switch { display: none; }
  .top-menu-btn {
    margin-left: auto;
    width: 44px;
    height: 34px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    cursor: pointer;
  }
  .top-menu-btn span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: #fff;
  }
  .top-menu-panel {
    position: absolute;
    top: calc(100% - 4px);
    right: 14px;
    z-index: 80;
    width: min(220px, calc(100vw - 28px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 14px 34px rgba(0,0,0,.22);
  }
  .topbar.menu-open .top-menu-panel { display: block; }
  .top-menu-user { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
  .top-menu-user strong { display: block; font-size: 14px; line-height: 1.25; }
  .top-menu-user span { display: block; margin-top: 4px; color: var(--sub); font-size: 12px; }
  .top-menu-item {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  }
  .top-menu-item:hover { background: #f4f6f8; }
  .top-menu-item.danger { color: var(--danger); font-weight: 600; }
	  .topbar .who {
		    position: relative;
		    display: flex;
	    align-items: center;
	    gap: 8px;
	    width: 100%;
	    max-width: 100%;
	    margin-left: 0;
	    padding-right: 0;
	    overflow: visible;
	    -webkit-overflow-scrolling: touch;
	    scrollbar-width: none;
	  }
  .topbar .who::-webkit-scrollbar { display: none; }
	  .topbar .who .user-name {
		    display: flex;
		    flex: 1 1 auto;
		    align-items: center;
	    min-height: 34px;
	    line-height: 34px;
	    min-width: 0;
	    overflow: hidden;
	    text-overflow: ellipsis;
	    white-space: nowrap;
	  }
	  .topbar .who .role,
	  .topbar .who button,
	  .topbar .pub-btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
	  }
		  .topbar .who .user-name,
		  .topbar .who .role,
		  .topbar .who .logout-btn { display: none; }
		  .topbar .who button { padding: 6px 10px; }
	  .topbar .pub-btn {
		    order: -1;
		    flex: 0 0 100%;
	    width: 100%;
	    margin: 0;
	    padding: 6px 12px;
	  }
	  .topbar .who button:not(.pub-btn):not(.logout-btn) { flex: 0 0 auto; width: 54px; margin-left: 0; }

	  .layout { display: block; min-height: auto; }
  .nav {
    position: sticky;
	    top: 0;
    z-index: 50;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px;
    background: rgba(246,247,249,.96);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-section { display: none; }
  .nav-note { display: none; }
  .nav-item {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
  }
	  .nav-item.active {
	    padding-left: 12px;
	    border-left: 1px solid var(--primary);
	    border-color: var(--primary);
	    background: #eef2f7;
	    color: var(--primary);
	    box-shadow: 0 4px 12px rgba(79,96,121,.12);
	  }
  .nav-item:hover { background: #fff; }

  .main { padding: 14px 12px 26px; }
  .main > h2, .main h2:first-child { margin-top: 2px; margin-bottom: 12px; }
  .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .row > div { min-width: 0; }
  .card { padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
  .card h3 { font-size: 13px; }
  .val.big { font-size: 24px; line-height: 1.15; }

  .toolbar {
    position: sticky;
	    top: 61px;
    z-index: 30;
    margin: -2px -12px 12px;
    padding: 10px 12px;
    background: rgba(238,241,244,.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }
  .toolbar input, .toolbar select {
    min-height: 42px;
    flex: 1 1 160px;
    font-size: 14px;
  }
  .toolbar .btn { min-height: 42px; flex: 0 0 auto; }

  .package-page-head {
    display: block;
  }
  .package-page-head .toolbar {
    position: static;
    top: auto;
    z-index: auto;
    margin: 12px 0 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
  }
  .package-main-actions .btn {
    flex: 1 1 calc(50% - 6px);
  }
  .package-tools {
    padding: 12px;
  }
  .package-filter-row {
    display: block;
  }
  .package-chip-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .package-chip-list .btn {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
  }
  .package-filter-row select {
    width: 100%;
    margin-top: 10px;
  }
  .package-inline-editor {
    min-width: 0;
  }
  .package-promo-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .package-promo-editor .package-inline-check,
  .package-promo-editor .package-inline-meta {
    grid-column: 1 / -1;
  }
  .package-inline-editor label {
    align-items: flex-start;
    flex-direction: column;
    white-space: normal;
  }
  .package-inline-editor .package-inline-check {
    flex-direction: row;
    align-items: center;
  }
  .package-inline-input,
  .package-inline-input[type="number"],
  .package-inline-input.sort {
    width: 100%;
  }
  .order-detail-head,
  .order-read-grid,
  .order-info-list,
  .order-config-grid,
  .order-money-grid,
  .order-stage-list {
    display: block;
  }
  .order-detail-head > *,
  .order-read-grid section,
  .order-info-list div,
  .order-config-line,
  .order-money-grid div,
  .order-section-card,
  .order-stage-list .stage-row {
    margin-bottom: 10px;
  }
  .order-package-group {
    display: block;
  }
  .order-package-category {
    margin-bottom: 8px;
  }

  .btn {
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    touch-action: manipulation;
  }
  .btn-sm { min-height: 34px; padding: 7px 10px; font-size: 12px; }

  .table-card {
    border: 0;
    background: transparent;
    overflow: visible;
    margin-bottom: 12px;
  }
  .card .table-card { margin-top: 8px; }
  .table-scroll { overflow: visible; }
  .table-card table,
  .table-card thead,
  .table-card tbody,
  .table-card tr,
  .table-card td {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .table-card thead { display: none; }
  .table-card tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
  }
  .table-card tr:hover td { background: transparent; }
  .table-card td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 0;
    padding: 6px 0;
    font-size: 13px;
    word-break: break-word;
  }
  .table-card td::before {
    content: attr(data-label);
    color: var(--sub);
    font-size: 12px;
    line-height: 1.5;
  }
  .table-card td[data-label=""] {
    display: flex;
    justify-content: flex-start;
  }
  .table-card td[data-label=""]::before { display: none; }
  .table-card td[data-label="操作"] {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
  }
  .table-card td[data-label="操作"]::before {
    flex: 0 0 100%;
    margin-bottom: -2px;
  }
  .table-card tr.empty-row td {
    display: block;
    text-align: center;
    padding: 22px 0;
  }
  .table-card tr.empty-row td::before { display: none; }
  .table-card img { max-width: 96px; border-radius: 6px; }

  .modal-mask {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
    background: rgba(17,24,39,.42);
  }
  .modal, .modal.modal-narrow {
    width: 100%;
    max-height: min(88vh, 720px);
    border-radius: 14px 14px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 38px rgba(0,0,0,.18);
  }
  .modal > h3 {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -18px -16px 16px;
    padding: 18px 16px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
  }
  .modal .toolbar {
    position: static;
    top: auto;
    z-index: auto;
    margin: 12px 0;
    padding: 0;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
  }
  .modal input, .modal textarea, .modal select {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 16px;
  }
  .modal textarea { min-height: 104px; }
  .modal-foot {
    bottom: calc(-18px - env(safe-area-inset-bottom));
    margin: 18px -16px calc(-18px - env(safe-area-inset-bottom));
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    justify-content: stretch;
    box-shadow: 0 -1px 0 var(--line);
  }
  .modal-foot .btn, .modal-foot a.btn { flex: 1; text-align: center; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-cell.full { grid-column: auto; }
  .form-section { padding-top: 14px; }
  .form-section .sec-title { scroll-margin-top: 126px; }
  .form-section-nav {
    top: 52px;
    gap: 6px;
    margin: -2px -16px 14px;
    padding: 8px 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .form-section-nav button { flex: 0 0 auto; }
  .activity-intro-toolbar {
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .activity-intro-tool { flex: 0 0 auto; }
  .activity-intro-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .modal .activity-intro-shell textarea {
    min-height: 320px;
  }
  .activity-intro-preview-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .activity-intro-preview {
    max-height: none;
    padding: 14px;
  }
  .date-range-field { grid-template-columns: 1fr; gap: 8px; }
  .date-range-field span { text-align: center; }
  .link-picker-current { align-items: stretch; flex-direction: column; }
  .link-picker-summary code { max-width: 100%; white-space: normal; word-break: break-all; }
  .link-picker-tools { grid-template-columns: 1fr; }
  .link-picker-body { display: block; min-height: 0; }
  .link-picker-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .link-picker-tabs button {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    margin: 0;
    white-space: nowrap;
  }
  .link-picker-list {
    grid-template-columns: 1fr;
    max-height: min(380px, 52vh);
    padding: 10px;
  }
  .link-picker-item { grid-template-columns: 70px minmax(0, 1fr); }
  .link-picker-manual div { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .section-head .toolbar { margin-top: 12px; }
  .home-source-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .pay-mode-toggle { grid-template-columns: 1fr; }
  .pay-guide-grid { grid-template-columns: 1fr; }
  .pay-field-grid { grid-template-columns: 1fr; }
  .pay-guide-card .section-head,
  .pay-config-card .section-head { display: block; }
  .pay-guide-card .btn { width: 100%; margin-top: 12px; }
  .pay-actions { justify-content: stretch; }
  .pay-actions .btn { flex: 1; }
  .page-title-row { display: block; margin-bottom: 14px; }
  .sales-contact-hero { display: block; padding: 18px 16px; }
  .sales-contact-hero h3 { font-size: 18px; }
  .sales-contact-stats { grid-template-columns: repeat(3, 1fr); min-width: 0; margin-top: 14px; }
  .sales-contact-stats span { padding: 10px 8px; }
  .sales-contact-grid,
  .sales-contact-grid.compact { grid-template-columns: 1fr; }
  .sales-image-row { grid-template-columns: 74px minmax(0, 1fr); }
  .sales-image-preview { width: 74px; }
  .sales-image-inputs { grid-template-columns: 1fr; }
  .sales-contact-savebar {
    display: block;
    margin: 0 -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .sales-contact-savebar .toolbar { margin-top: 10px; justify-content: stretch; }
  .sales-contact-savebar .btn { flex: 1; }

  .stage-row { gap: 10px; padding: 12px 0; }
  .stage-head { flex-wrap: wrap; gap: 6px; }
  .stage-actions { flex-wrap: wrap; gap: 8px; }
  .stage-actions .btn { flex: 1 1 128px; }
  .stage-photos { flex-wrap: wrap; }
  .stage-photos img { width: 64px; height: 64px; }
  .qr-wrap img { width: min(240px, 72vw); height: min(240px, 72vw); }

  .list-row, .kv-row, .img-row { align-items: stretch; }
  .kv-row { flex-wrap: wrap; }
  .kv-row .kv-k, .kv-row .kv-v { flex: 1 1 100%; }
  .list-x { width: 42px; height: 42px; border-radius: 8px; }
  .field-row-tools { gap: 5px; }
  .object-list-row, .config-group-head, .config-item-row { grid-template-columns: 1fr; }
  .object-list-body { grid-template-columns: 1fr; }
  .object-list-row .field-row-tools, .config-group-head .field-row-tools, .config-item-row .field-row-tools { justify-content: flex-end; }
  .img-row { flex-wrap: wrap; }
  .img-row input { flex: 1 1 100%; }
  .img-upload-btn, .photo-add-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }
  .upload-thumb { width: 88px; height: 88px; }

  .login-page {
    display: block;
    width: auto;
    max-width: none;
    min-height: 100svh;
    padding: max(20px, env(safe-area-inset-top)) 14px 18px;
    background: #eef1f4;
    overflow-x: hidden;
  }
  .login-shell {
    min-height: auto;
    display: block;
    border-radius: 8px;
  }
  .login-visual {
    min-height: 270px;
    padding: 24px 20px;
    justify-content: flex-end;
  }
  .login-logo { width: 132px; top: 18px; left: 20px; }
  .login-kicker { margin-bottom: 8px; font-size: 10px; letter-spacing: 1.4px; }
  .login-visual h1 { font-size: 24px; }
  .login-visual p { margin-top: 10px; font-size: 13px; line-height: 1.6; }
  .login-metrics { display: none; }
  .login-box {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 24px 18px 18px;
    border: 0;
    box-shadow: none;
  }
  .login-head { margin-bottom: 20px; }
  .login-logo-sm { display: none; }
  .login-box h2 { font-size: 22px; }
  .login-box input { min-height: 46px; font-size: 16px; }
  .login-box button { min-height: 46px; }
  .login-box .hint { max-height: 120px; overflow: auto; }
  .ws-picker { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .ws-card { padding: 18px 16px; }
}

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