/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --success: #10B981;
  --error: #EF4444;
  --bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* === Section / Group === */
.section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PingFang SC", serif;
  font-size: 20px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.section-num {
  color: #B45309;
  font-size: 22px;
  font-weight: 700;
}

.section-text {
  color: #1F2937;
}

.group {
  margin-bottom: 20px;
}

.group:last-child {
  margin-bottom: 0;
}

.group-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.member-card {
  border: 1.5px solid #F0D9A8;
  border-radius: 10px;
  background: #FFFCF5;
  padding: 12px 6px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  cursor: pointer;
  min-height: 140px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.member-card .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #D6C3A1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.member-card .avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.member-card .role {
  font-size: 12px;
  color: #B45309;
  font-weight: 500;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card .name {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card .phone {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: -0.5px;
  width: 100%;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.member-add {
  border: 1.5px dashed #D1A85E;
  border-radius: 10px;
  background: #FFFCF5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 130px;
  color: #B45309;
  transition: background 0.15s, border-color 0.15s;
}

.member-add:hover,
.member-add:active {
  background: #FFF3DC;
  border-color: #B45309;
}

.member-add .plus {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

/* === Member Panel === */
.member-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.member-panel {
  background: #FFF;
  border-radius: 14px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: memberPop 0.2s ease;
}

@keyframes memberPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.member-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.member-body {
  padding: 16px 18px 4px;
  overflow-y: auto;
}

.member-body .form-group {
  margin-bottom: 14px;
}

.member-body input {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #FAFAFA;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.member-body input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: #FFF;
}

.member-body textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #FAFAFA;
  color: var(--text);
  outline: none;
  resize: vertical;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.member-body textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: #FFF;
}

.member-body input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.member-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
}

.btn-member {
  flex: 1;
  padding: 11px 0;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-member-cancel {
  background: #F3F4F6;
  color: var(--text);
}

.btn-member-delete {
  background: #FEF2F2;
  color: var(--error);
  flex: 0 0 auto;
  padding: 11px 16px;
}

.btn-member-save {
  background: var(--primary);
  color: #FFF;
}

.btn-member:active { opacity: 0.85; }

/* === Header === */
.header {
  position: relative;
  background: linear-gradient(135deg, #FFF9F0 0%, #FFF5E8 40%, #FEF3E4 100%);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  align-items: stretch;
  min-height: 120px;
  position: relative;
  z-index: 1;
}

.header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px;
  min-width: 0;
}

.header-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PingFang SC", serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  color: #1F2937;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.header-subtitle {
  font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "PingFang SC", serif;
  font-size: 26px;
  font-weight: 600;
  color: #1F2937;
  line-height: 1.25;
  letter-spacing: 0.5px;
  margin-top: 4px;
  white-space: nowrap;
}

.header-poc {
  margin-top: 2px;
}

/* Decorative graphic */
.header-graphic {
  flex-shrink: 0;
  width: 130px;
  position: relative;
  overflow: hidden;
}

.graphic-shape {
  position: absolute;
  border-radius: 12px;
  opacity: 0.6;
}

.shape-1 {
  width: 100px;
  height: 80px;
  background: linear-gradient(135deg, #FCD34D 0%, #F59E0B 100%);
  top: -10px;
  right: -20px;
  transform: rotate(12deg);
  border-radius: 16px;
}

.shape-2 {
  width: 70px;
  height: 100px;
  background: linear-gradient(180deg, #FBBF24 0%, #D97706 100%);
  top: 20px;
  right: 40px;
  transform: rotate(-8deg);
  border-radius: 12px;
  opacity: 0.45;
}

.shape-3 {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #FDE68A 0%, #B45309 100%);
  bottom: -10px;
  right: 10px;
  transform: rotate(25deg);
  border-radius: 50%;
  opacity: 0.35;
}

.form-hint {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.required-star { color: var(--error); }

/* === Error Banner === */

/* ===== 07 Target Styles ===== */
.target-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.target-qty-label {
  font-size: 14px;
  color: #8B7355;
  flex-shrink: 0;
}
.target-qty-input {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid #D9C7A1;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  background: #fff;
}
.target-qty-input:focus {
  outline: none;
  border-color: #B45309;
}
.target-row .device-card {
  flex-shrink: 0;
  min-width: 140px;
  justify-content: center;
}
.target-card {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  min-width: 140px;
  width: 140px;
  border: 1px solid #D9C7A1;
  border-radius: 8px;
  font-size: 13px;
  color: #8B7355;
  background: #fff;
  transition: all .2s;
  user-select: none;
  white-space: nowrap;
}
.target-card:hover {
  border-color: #B45309;
}
.target-card.is-checked {
  background: #B45309;
  color: #fff;
  border-color: #B45309;
}
.target-card .device-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #D9C7A1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  transition: all .2s;
}
.target-card.is-checked .device-check {
  border-color: #fff;
  background: #fff;
}
.target-card .device-check svg {
  display: none;
  width: 12px;
  height: 12px;
}
.target-card.is-checked .device-check svg {
  display: block;
  color: #B45309;
  stroke: #B45309;
}
.target-upload-area {
  margin-top: 8px;
}
.upload-progress {
  margin-left: 10px;
  font-size: 13px;
  color: #B45309;
}
.target-card:only-child {
}
.error-banner {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--error);
  font-size: 16px;
}

/* === Form Card === */
.form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-of-type {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

/* === Field Wrap (history arrow) === */
.field-wrap {
  position: relative;
}
.field-wrap input,
.field-wrap textarea {
  width: 100%;
  padding: 12px 40px 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #FAFAFA;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  outline: none;
}
.field-wrap textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
  padding-right: 40px;
}
.field-wrap input:focus,
.field-wrap textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: #FFF;
}
.field-wrap input.error,
.field-wrap textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-msg {
  display: block;
  font-size: 13px;
  color: var(--error);
  margin-top: 6px;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.error-msg.visible { opacity: 1; }

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* === Submit Button === */
.btn-submit {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
  color: #FFF;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  -webkit-appearance: none;
}

.btn-submit:active { transform: scale(0.98); }

.btn-submit:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
  transform: none;
}

.btn-submit.loading .btn-text { visibility: hidden; }

.btn-submit.loading .btn-loading {
  display: inline !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* === History Overlay === */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.history-panel {
  background: #FFF;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.history-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.btn-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #F3F4F6;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

.history-item {
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1.5;
  word-break: break-all;
}

.history-item:hover,
.history-item:active {
  color: var(--primary);
}

.history-item:last-child {
  border-bottom: none;
}

.history-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 0;
  font-size: 15px;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #FFF;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  max-width: 90vw;
  text-align: center;
  line-height: 1.5;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--primary); }

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* === Responsive === */
/* === 测试目的 === */
.purpose-guide {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.purpose-role {
  color: var(--primary);
  font-weight: 500;
}
.purpose-content {
  margin-bottom: 0;
}
.purpose-display {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s;
}
.purpose-display:active { background: #F3F4F6; }
.purpose-display p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}
.purpose-display .hint-edit {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.6;
}
.purpose-edit-area {
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.purpose-edit-area textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.6;
  outline: none;
}
.purpose-edit-area textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.purpose-edit-actions {
  margin-top: 10px;
  text-align: right;
}

/* 通用空状态 + 按钮 */
.add-item-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.add-item-btn:hover { border-color: var(--primary); background: rgba(79,70,229,0.04); }
.add-icon {
  font-size: 28px;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1;
}

/* === 文档上传 === */
.group-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.doc-hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-secondary);
}
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-item {
  display: flex;
  align-items: center;
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  gap: 10px;
  cursor: pointer;
}
.doc-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.doc-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-size {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.doc-del {
  background: none;
  border: none;
  color: var(--error);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
}
.doc-upload-area {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.doc-upload-btn:hover { background: var(--primary-hover); }
.doc-upload-progress {
  font-size: 12px;
  color: var(--text-secondary);
}

/* === 历史值关联弹出 === */
.field-wrap {
  position: relative;
}
.history-trigger {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.history-trigger:hover { color: var(--primary); }
.history-popup {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 200px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 0;
}
.history-popup-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.1s;
}
.history-popup-item:last-child { border-bottom: none; }
.history-popup-item:hover { background: #F0F0FF; }

@media (max-width: 360px) {
  .container { padding: 12px 12px 32px; }
  .form { padding: 20px 16px; }
  .header-title { font-size: 20px; }
  .header-subtitle { font-size: 20px; }
  .header-text { padding: 16px 12px; }
  .header-graphic { width: 100px; }
}

/* === 网络示意图 === */
.diagram-guide {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.diagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.diagram-card {
  position: relative;
  border: 1.5px solid #F0D9A8;
  border-radius: 10px;
  overflow: hidden;
  background: #FFFCF5;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: border-color 0.15s;
}

.diagram-card:hover,
.diagram-card:active {
  border-color: #B45309;
}

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

.diagram-card-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 6px;
  color: #B45309;
  background: #FFF8EE;
}

.diagram-card-pdf .pdf-icon {
  font-size: 28px;
}

.diagram-card-pdf .pdf-name {
  font-size: 10px;
  color: var(--text-secondary);
  max-width: 90%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagram-card .diagram-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #FFF;
  border: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.diagram-card:hover .diagram-del,
.diagram-card:active .diagram-del {
  opacity: 1;
}

/* 上传区域 */
.diagram-upload-area {
  position: relative;
}

.diagram-dropzone {
  border: 2px dashed #D1A85E;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: #FFFCF5;
  transition: background 0.15s, border-color 0.15s;
}

.diagram-dropzone:hover,
.diagram-dropzone.drag-over {
  background: #FFF3DC;
  border-color: #B45309;
}

.diagram-upload-icon {
  margin-bottom: 10px;
  display: inline-block;
}

.diagram-upload-text {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.diagram-upload-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.diagram-upload-progress {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* 图片查看器 */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.image-viewer img {
  position: relative;
  z-index: 1;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 6px;
}

.image-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #FFF;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

@media (min-width: 768px) {
  .container { padding-top: 40px; }
}

/* ═══ 04 设备多选 ═══ */
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 1rem;
}
.device-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #FAF7F2;
  border: 1px solid #E8DCC0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: all .2s;
  font-size: 16px;
  color: #2C2C2C;
}
.device-card:hover {
  border-color: #B45309;
}
.device-card.is-checked {
  background: #B45309;
  color: #FFFFFF;
  border-color: #B45309;
}
.device-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #B45309;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: transparent;
  transition: all .2s;
}
.device-card.is-checked .device-check {
  background: #FFFFFF;
  border-color: #FFFFFF;
}
.device-check svg {
  display: none;
  width: 14px;
  height: 14px;
}
.device-card.is-checked .device-check svg {
  display: block;
  color: #B45309;
  stroke: #B45309;
}
.device-empty-hint {
  margin-top: 1.2rem;
  padding: 14px 16px;
  background: #FAF7F2;
  border: 1px dashed #D9C7A1;
  border-radius: 8px;
  color: #8B7355;
  font-size: 14px;
  text-align: center;
}
.device-other-hint {
  margin-top: 0.5rem;
  padding: 8px 12px;
  background: #FFF9E6;
  border-left: 3px solid #B45309;
  border-radius: 4px;
  color: #8B6914;
  font-size: 13px;
}

.device-other-display {
  margin-top: 1rem;
  padding: 12px 16px;
  background: #FAF7F2;
  border: 1px solid #E8DCC0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.device-other-label {
  font-weight: 600;
  color: #8B6914;
  font-size: 14px;
  flex-shrink: 0;
}
.device-other-text {
  flex: 1;
  color: #2C2C2C;
  font-size: 15px;
  word-break: break-all;
}
.device-other-edit {
  flex-shrink: 0;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid #B45309;
  color: #B45309;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}
.device-other-edit:hover {
  background: #B45309;
  color: #FFF;
}
/* === Scope (06) === */
.scope-group { margin-bottom: 20px; }
.scope-group:last-child { margin-bottom: 0; }
.scope-group-title {
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.scope-hint {
  font-size: 12px;
  color: #8B7355;
  font-weight: 400;
  background: #F5F0E8;
  padding: 2px 8px;
  border-radius: 4px;
}
.scope-subgroup { margin-bottom: 16px; }
.scope-subgroup:last-child { margin-bottom: 0; }
.scope-subtitle {
  font-size: 14px;
  color: #4B5563;
  margin-bottom: 8px;
  font-weight: 500;
}
.scope-note {
  font-size: 12px;
  color: #8B7355;
  margin-top: 8px;
  padding-left: 4px;
}
.scope-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 600px) {
  .device-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .target-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .target-qty-input {
    width: 100%;
  }
}

/* ===== 07 测试目标信息 ===== */
.target-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.target-qty-label {
  font-size: 14px;
  color: #4B5563;
  flex-shrink: 0;
}
.target-qty-input {
  width: 100px;
  padding: 8px 12px;
  border: 1px solid #E8DCC0;
  border-radius: 8px;
  font-size: 14px;
  background: #FAF7F2;
  color: #2C2C2C;
  outline: none;
  transition: border-color .2s;
}
.target-qty-input:focus {
  border-color: #B45309;
}
.target-upload-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.doc-dl-btn {
  margin-left: auto;
  padding: 4px 12px;
  background: #B45309;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.doc-dl-btn:hover {
  background: #92400E;
}
