/**
 * 三端统一弹框壳层（管理 / 服务商 / 客户后台）
 * 与入驻审核弹框同一视觉语言
 */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 20, 0.48);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px 16px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
  max-height: 90vh;
  overflow: auto;
  box-sizing: border-box;
}

.modal h3 {
  margin: 0 0 14px;
  color: #141c26;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.modal .form-grid {
  box-shadow: none;
  max-width: none;
  padding: 0;
  background: transparent;
}

.modal .form-grid > label {
  display: block;
  font-size: 12px;
  color: #727272;
  margin: 10px 0 6px;
  font-weight: 500;
}

.modal .form-grid > label:first-child {
  margin-top: 0;
}

.modal .form-grid > input,
.modal .form-grid > select,
.modal .form-grid > textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  padding: 0 12px;
  min-height: 36px;
  font-size: 13px;
  color: #2e2e2e;
  background: #fff;
}

.modal .form-grid > textarea {
  padding: 10px 12px;
  min-height: 88px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid #f0f2f3;
}

.modal-actions .btn {
  width: auto;
  margin: 0;
  min-width: 88px;
  border-radius: 8px;
}

.modal.modal-wide {
  width: min(920px, 96vw);
}

.modal.modal-cert,
.modal.modal-user {
  width: min(920px, 96vw);
}

.modal.modal-timeline {
  width: min(860px, 96vw);
  max-height: min(92vh, 920px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 时间线弹窗壳层：头/摘要固定，列表可滚 */
.otl-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  max-height: min(92vh, 920px);
}

.otl-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
  border-bottom: 1px solid #eef0f2;
  flex-shrink: 0;
}

.otl-head-text {
  min-width: 0;
  flex: 1;
}

.otl-modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #141c26;
  line-height: 1.35;
  word-break: break-word;
}

.otl-head-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8b8b8b;
}

.otl-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.otl-modal-head .btn {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  height: auto;
  white-space: nowrap;
}

.otl-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: #666;
  margin: 12px 22px 0;
  padding: 10px 12px;
  background: #f7f8f9;
  border-radius: 8px;
  border: 1px solid #eef0f2;
  flex-shrink: 0;
}

.otl-summary b {
  color: #2e2e2e;
  font-weight: 600;
}

/* 流程进度轴 */
.otl-progress {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 12px 22px 0;
  padding: 10px 8px 4px;
  background: #fafbfc;
  border: 1px solid #eef0f2;
  border-radius: 8px;
  flex-shrink: 0;
}

.otl-pstep {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.otl-pdot-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  margin-bottom: 6px;
}

.otl-pdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0d5db;
  z-index: 1;
  box-sizing: border-box;
}

.otl-pbar {
  position: absolute;
  left: calc(50% + 7px);
  right: calc(-50% + 7px);
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: #e8ebf0;
}

.otl-pstep.done .otl-pdot {
  background: #39b54a;
}

.otl-pstep.current .otl-pdot {
  background: #ff434f;
  box-shadow: 0 0 0 3px rgba(255, 67, 79, 0.2);
}

.otl-pstep.done .otl-pbar,
.otl-pstep.current .otl-pbar {
  background: rgba(255, 67, 79, 0.35);
}

.otl-pstep.done .otl-pbar {
  background: #39b54a;
}

.otl-ptitle {
  display: block;
  font-size: 12px;
  color: #8b8b8b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.otl-pstep.done .otl-ptitle {
  color: #2e2e2e;
}

.otl-pstep.current .otl-ptitle {
  color: #ff434f;
  font-weight: 600;
}

.otl-pstep.muted .otl-ptitle {
  color: #b0b0b0;
}

.otl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 22px 0;
  flex-shrink: 0;
}

.otl-toolbar-hint {
  font-size: 12px;
  color: #8b8b8b;
}

.otl-tools {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.otl-tool {
  font-size: 12px;
  color: #8b8b8b;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f3f5f7;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.4;
}

.otl-tool:hover {
  color: #494949;
}

.otl-tool.on {
  color: #ff434f;
  background: rgba(255, 67, 79, 0.06);
  border-color: rgba(255, 67, 79, 0.25);
  font-weight: 600;
}

.otl-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin-top: 8px;
  padding: 0 22px 20px;
  -webkit-overflow-scrolling: touch;
}

.otl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.otl-group {
  margin-top: 4px;
}

.otl-group-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 4px 8px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid #eef0f2;
  background: transparent;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.otl-group-hd:disabled {
  cursor: default;
}

.otl-group-hd.ongoing {
  border-bottom-color: rgba(255, 67, 79, 0.22);
}

.otl-group-hd:not(:disabled):hover .otl-group-toggle {
  text-decoration: underline;
}

.otl-group-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.otl-group-date {
  font-size: 14px;
  font-weight: 700;
  color: #2e2e2e;
}

.otl-group-count {
  font-size: 12px;
  color: #a0a4ab;
  flex-shrink: 0;
}

.otl-group-toggle {
  font-size: 12px;
  color: #ff434f;
  flex-shrink: 0;
}

.otl-group-body {
  padding-top: 8px;
}

.otl-group-body[hidden] {
  display: none !important;
}

.otl-item {
  display: flex;
  gap: 12px;
  min-height: 48px;
}

.otl-rail {
  width: 28px;
  flex: 0 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.otl-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ff434f;
  color: #fff;
  font-size: 11px;
  line-height: 24px;
  text-align: center;
  flex: 0 0 auto;
}

.otl-item.is-current .otl-dot {
  background: #fff;
  color: #ff434f;
  border: 2px solid #ff434f;
  line-height: 20px;
}

.otl-line {
  width: 2px;
  flex: 1;
  background: #e8e8e8;
  margin: 4px 0;
  min-height: 12px;
}

.otl-body {
  flex: 1;
  padding-bottom: 14px;
  min-width: 0;
}

.otl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.otl-head strong {
  color: #2e2e2e;
  font-size: 14px;
}

.otl-time {
  font-size: 12px;
  color: #8b8b8b;
}

.otl-meta {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.otl-content {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: #3a3a3a;
  max-height: 220px;
  overflow: auto;
}

.otl-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.otl-img {
  display: block;
  width: 72px;
  height: 72px;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #eee;
  background: #f5f5f5;
  cursor: zoom-in;
}

.otl-img:hover {
  border-color: #ff434f;
}

.otl-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.otl-img-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #8b8b8b;
}

.tl-empty {
  padding: 32px 0;
  text-align: center;
}

@media (max-width: 640px) {
  .modal.modal-timeline {
    width: 100%;
    max-height: 96vh;
    border-radius: 12px 12px 0 0;
  }
  .otl-modal-head {
    flex-direction: column;
    align-items: stretch;
  }
  .otl-head-actions {
    justify-content: flex-end;
  }
  .otl-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 通用分区（与入驻审核一致） */
.ms-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ms-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f7f8fa;
  border-radius: 8px;
  border: 1px solid #eef0f2;
}

.ms-title {
  font-size: 17px;
  font-weight: 700;
  color: #141c26;
  margin: 0 0 6px;
}

.ms-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: #8b8b8b;
}

.ms-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.ms-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef1f4;
  color: #494949;
  font-weight: 600;
}

.ms-badge.accent {
  background: rgba(255, 67, 79, 0.12);
  color: #ff434f;
}

.ms-badge.warn {
  background: rgba(245, 166, 35, 0.16);
  color: #c47d00;
}

.ms-badge.ok {
  background: rgba(57, 181, 74, 0.14);
  color: #2d8a3a;
}

.ms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.ms-sec {
  border: 1px solid #eef0f2;
  border-radius: 8px;
  padding: 12px 14px 14px;
  background: #fff;
}

.ms-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #2e2e2e;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f2f3;
}

.ms-sec-title .muted {
  font-weight: 400;
  margin-left: 6px;
}

.ms-kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 10px;
  align-items: start;
}

.ms-k {
  font-size: 12px;
  color: #8b8b8b;
  line-height: 1.45;
}

.ms-v {
  font-size: 13px;
  color: #2e2e2e;
  line-height: 1.45;
  word-break: break-word;
}

.ms-tip {
  margin: 0;
  font-size: 12px;
  color: #8b8b8b;
  line-height: 1.5;
}

/* 入驻审核材料缩略图 */
.cr-docs,
.ms-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.cr-doc,
.ms-doc {
  border: 1px solid #eef0f2;
  border-radius: 8px;
  padding: 10px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}

.cr-doc-name,
.ms-doc-name {
  font-size: 12px;
  font-weight: 600;
  color: #2e2e2e;
  line-height: 1.35;
}

.cr-thumb,
.ms-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  background: #eef1f4;
}

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

.cr-thumb:hover,
.ms-thumb:hover {
  outline: 2px solid rgba(255, 67, 79, 0.45);
  outline-offset: 1px;
}

.cr-doc-hint,
.ms-doc-hint {
  font-size: 11px;
  color: #8b8b8b;
}

.cr-file,
.ms-file {
  display: inline-block;
  margin-top: auto;
  font-size: 12px;
  color: #ff434f;
  text-decoration: none;
}

/* 本页大图预览 */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(10, 14, 20, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
  box-sizing: border-box;
}

.img-lightbox[hidden] {
  display: none !important;
}

.img-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}

.img-lb-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.img-lb-pic {
  max-width: min(920px, 92vw);
  max-height: min(78vh, 860px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  background: #111;
}

.img-lb-cap {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  text-align: center;
}

.img-lb-tip {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  text-align: center;
}
