/**
 * 师傅端 · 子任务内页统一母版（与 `绑定师傅.html` 同款壳层）
 * 壳层约定：`.preview-wrap` > `.phone-shell.phone-shell--sub.phone-shell--bind-master` > `.bind-master-page-head`（内放 `.sub-nav`）> `.frame.frame--bind-master`（无底栏时加 `.frame--bind-master--no-footer`）> `.sub-page.sub-page--tight`；固定底栏用 `.bind-master-footer`（可与 `.bind-master-footer--default` 等组合）。
 * 引入顺序：organizer-common.css → organizer-tip-banner.css（可选）→ design-tokens.css → 本文件 → 页面局部 style
 */
/* 与 Tab 主页消息页同一主色（organizer-common 默认红橙；P16 消息为 #4086F5） */
body.organizer-app {
  --primary: #4086f5;
  --primary-dark: #2d6fd4;
  --primary-light: #6ea2f8;
  --primary-soft: #ecf4ff;
  --price: #4086f5;
  --cta-gradient: linear-gradient(90deg, var(--primary-light) 0%, var(--primary-dark) 100%);
}

/* 顶栏：白底 + 底部分割线（子页默认；绑定师傅页见下方「顶栏+Tab 一体」） */
body.organizer-app .phone-shell--sub > .sub-nav:not(.sub-nav--gradient) {
  background: var(--card);
  border-bottom: 1px solid var(--split);
}

/* 绑定类子页：顶栏 + 可选 Tab 同一白底 sticky；无 Tab 时随内容增高 */
.bind-master-page-head {
  background: var(--card);
  border-bottom: 1px solid var(--split);
  position: sticky;
  top: 0;
  z-index: 30;
  box-sizing: border-box;
  min-height: 64px;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
body.organizer-app[data-bind-pure-skip="1"] .bind-master-page-head {
  min-height: 0;
}
.phone-shell--bind-master .bind-master-page-head .sub-nav:not(.sub-nav--gradient) {
  background: transparent;
  border-bottom: none;
  position: relative;
  top: auto;
  z-index: auto;
  flex: 0 0 64px;
  height: 64px;
  box-sizing: border-box;
  padding: 12px 16px;
  align-items: center;
}
/* Tab 区：与消息页同款分段线视觉 */
.phone-shell--bind-master .bind-master-tab-hero.msg-page__hero {
  margin: 0;
  flex: 0 0 auto;
  min-height: 0;
  padding: 0 16px;
  border-bottom: none;
  position: relative;
  top: auto;
  z-index: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-sizing: border-box;
}
.phone-shell--bind-master .bind-master-tab-hero .msg-page__cats {
  flex-shrink: 0;
}
.phone-shell--bind-master .bind-master-tab-hero .msg-page__cat {
  padding: 6px 2px 8px;
}
body.organizer-app[data-bind-pure-skip="1"] .bind-master-tab-hero {
  display: none;
}

.bind-master-card {
  padding: 0 14px 14px;
}

.bind-master-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--split);
}

.bind-master-card__role {
  font-size: var(--fs-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}

.bind-master-card__head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.bind-master-card__head-chip {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  padding: 2px 7px;
  border-radius: 4px;
  background: #fff4d6;
  color: #7a6220;
  border: none;
}

.bind-master-card__pick {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-size: var(--fs-body-sm);
  font-weight: var(--font-weight-medium);
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}

.bind-master-card__pick:active {
  opacity: 0.85;
}

.bind-master-card__body {
  padding-top: 14px;
}

.bind-master-card__person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bind-master-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  background: var(--split);
}

.bind-master-card__meta {
  min-width: 0;
}

.bind-master-card__name {
  font-size: var(--fs-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  line-height: 1.35;
}

.bind-master-card__phone {
  margin-top: 4px;
  font-size: var(--fs-body-sm);
  color: var(--text-2);
  line-height: 1.4;
}

.bind-master-card__roster {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bind-master-card__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bind-master-card__name-row .bind-master-card__name {
  min-width: 0;
}

.bind-master-card__person-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.bind-master-card__person-tag--member {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-2);
}

.bind-master-footer,
.subtask-page-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--shell-max);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: var(--card);
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.08);
  z-index: 60;
  border-top: 1px solid var(--split);
  box-sizing: border-box;
}

.bind-master-footer .btn-primary,
.subtask-page-footer .btn-primary {
  border-radius: var(--radius-md);
  height: 48px;
  line-height: 48px;
  font-size: var(--fs-body);
  font-weight: var(--font-weight-semibold);
}

.frame--bind-master {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0));
}

/* 无底栏子页（内容区操作在卡片内，与旧 frame--subtask-inner 一致） */
.frame.frame--bind-master.frame--bind-master--no-footer {
  padding-bottom: 16px;
}

/* 纯收纳 · 自己带人：无需在系统绑定收纳师 */
body.organizer-app[data-bind-pure-skip="1"] .bind-master-default {
  display: none;
}
body.organizer-app[data-bind-pure-skip="1"] .bind-master-pure-skip {
  display: block;
}
body.organizer-app[data-bind-pure-skip="1"] .bind-master-footer--default {
  display: none;
}
body.organizer-app[data-bind-pure-skip="1"] .bind-master-footer--pure-skip {
  display: block;
}
.bind-master-pure-skip {
  display: none;
}
.bind-master-footer--pure-skip {
  display: none;
}
.bind-master-pure-skip__card {
  padding: var(--space-6);
}
.bind-master-pure-skip__title {
  margin: 0 0 10px;
  font-size: var(--fs-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}
.bind-master-pure-skip__list {
  margin: 0;
  padding-left: 1.15em;
  font-size: var(--fs-caption);
  color: var(--text-2);
  line-height: 1.65;
}
.bind-master-pure-skip__list li {
  margin-bottom: 8px;
}
.bind-master-footer--pure-skip .btn-primary {
  text-decoration: none;
  text-align: center;
  display: block;
  box-sizing: border-box;
}

.bind-master-tabpanel {
  display: none;
}
.bind-master-tabpanel.is-active {
  display: block;
}
/* 常用绑定：与「当前绑定」同套 detail 卡片 + 行式信息，整块可点（根节点可为 button 或 div[role=button]，内可嵌名称编辑） */
.bind-preset-tile {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.bind-preset-tile:last-of-type {
  margin-bottom: 0;
}
.bind-preset-tile:active .bind-preset-tile__inner {
  opacity: 0.96;
}
.bind-preset-tile:focus {
  outline: none;
}
.bind-preset-tile:focus-visible .bind-preset-tile__inner {
  box-shadow: 0 0 0 2px var(--primary-soft);
}
.bind-preset-tile__inner {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0 16px 14px;
  margin-bottom: 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}
.bind-preset-tile__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--split);
}
.bind-preset-tile__head-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bind-preset-tile__name {
  font-size: var(--fs-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  min-width: 0;
}
.bind-preset-tile__name-edit {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--primary);
  line-height: 1;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.bind-preset-tile__name-edit:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.bind-preset-tile__name-edit:active {
  opacity: 0.75;
}
.bind-preset-tile__name-edit svg {
  width: 18px;
  height: 18px;
  display: block;
  transform: scale(0.9);
  transform-origin: center;
}
.bind-preset-tile__chip {
  flex-shrink: 0;
  margin: 0;
}
.bind-preset-tile .detail-rows {
  margin: 0;
}
.bind-preset-tile .detail-row {
  padding: 12px 0;
}
.bind-preset-tile__org-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  font-size: var(--fs-body);
  color: var(--text);
  line-height: 1.4;
}
.bind-preset-tile__org-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.bind-preset-tile__org-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.bind-preset-tile__org-tag--member {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-2);
}
/* 常用绑定预设行：人名左侧小头像 */
.bind-preset-tile .detail-row__value--person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bind-preset-tile__person-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: var(--split);
}
.bind-preset-tile__foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 0 0;
  margin-top: 2px;
  border-top: 1px solid var(--split);
}
.bind-preset-tile__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--split);
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  pointer-events: none;
}

/* ========== 绑定收纳师页：提示条与列表间距（原页内联） ========== */
.bind-org-tip {
  margin-bottom: 12px;
}
.bind-org-tip ol {
  margin: 0;
  padding-left: 1.1em;
}
.bind-org-tip li {
  margin: 0 0 6px;
}
.bind-org-tip li:last-child {
  margin-bottom: 0;
}

/* ========== 任务进度 / 合同单：主卡与绑定师傅 .bind-master-card 同款内边距与区块头 ========== */
.detail-main-card.zone-card,
.detail-main-card.contract-card,
.detail-main-card.form-card {
  padding: 0 14px 14px;
}
.zone-card__head,
.contract-card__head,
.form-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--split);
  box-sizing: border-box;
}
.zone-card__title,
.contract-card__title,
.form-card__title {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
}
.zone-card__hint,
.contract-card__hint,
.form-card__hint {
  font-size: var(--fs-caption);
  color: var(--text-3);
}
.zone-actions,
.contract-actions,
.form-card .actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.zone-actions .btn-secondary,
.zone-actions .btn-primary,
.contract-actions .btn-secondary,
.contract-actions .btn-primary,
.form-card .actions .btn-secondary,
.form-card .actions .btn-primary {
  height: 40px;
  line-height: 40px;
  border-radius: var(--radius-md);
}

