/* 望舒大模型 — rs-platform 工作台布局 */
.ws-page { max-width: 1320px; margin: 0 auto; padding: 0 0 2rem; }
.ws-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ws-header-brand { display: flex; align-items: center; gap: 0.75rem; }
.ws-header-brand h1 { margin: 0; font-size: 1.5rem; }
.ws-mark { display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; background: #eff6ff; border-radius: 10px; }
.ws-header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ws-alert { padding: 1.25rem; }

.ws-layout { display: flex; flex-direction: column; gap: 0.75rem; }
.ws-main-row { display: grid; grid-template-columns: 7fr 4fr; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .ws-main-row { grid-template-columns: 1fr; } }

.ws-left { display: flex; flex-direction: column; gap: 0.45rem; }
.ws-image-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.frame-wrap { position: relative; }
.frame-label-main::before,
.frame-label-second::before,
.frame-label-output::before {
  position: absolute; top: 10px; left: 10px; z-index: 12;
  font-size: 1rem; font-weight: 700; line-height: 1.35;
  padding: 6px 12px; background: rgba(255,255,255,0.94); color: #1f2937;
  border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); pointer-events: none;
}
.frame-label-main::before { content: "主影像"; }
.frame-label-second::before { content: "第二时相（变化检测时上传）"; }
.frame-label-output::before { content: "分析结果"; }

.ws-dropzone {
  display: block; aspect-ratio: 1/1; background: #f3f4f6; border-radius: 4px;
  overflow: hidden; cursor: pointer; border: 1px dashed #d1d5db;
}
.ws-dropzone--secondary { opacity: 0.95; }
.ws-drop-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.ws-drop-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-drop-hint { font-size: 0.9rem; color: #9ca3af; padding: 1rem; text-align: center; pointer-events: none; }

.ws-img-clear {
  position: absolute; top: 8px; right: 8px; z-index: 15;
  width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%;
  background: rgba(15, 23, 42, 0.62); color: #fff; font-size: 1.35rem; font-weight: 400;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: background 0.15s ease;
}
.ws-img-clear[hidden] { display: none !important; }
.ws-img-clear:hover { background: rgba(220, 38, 38, 0.88); }

.ws-task-chips { border: none; margin: 0; padding: 0; }
.ws-task-chips legend { font-weight: 600; margin-bottom: 0.5rem; }
.ws-chip {
  display: inline-flex; align-items: center; padding: 0.4rem 0.95rem; margin: 0 8px 8px 0;
  border: 1px solid #d1d5db; border-radius: 999px; background: #fff; color: #374151;
  font-size: 0.9rem; cursor: pointer; transition: all 0.15s ease;
}
.ws-chip input { display: none; }
.ws-chip.is-selected, .ws-chip:has(input:checked) {
  background: #2563eb; border-color: #2563eb; color: #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,0.35);
}

.ws-instr-label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; }
.ws-instr-label textarea {
  min-height: 110px; line-height: 1.6; padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db; border-radius: 8px; font-weight: 400; resize: vertical;
}
.ws-run-btn { width: 100%; padding: 0.85rem; font-size: 1.05rem; margin-top: 0.25rem; }

.ws-result-frame { aspect-ratio: 1/1; background: #f3f4f6; border-radius: 4px; overflow: hidden; position: relative; }
.ws-result-body { position: relative; width: 100%; height: 100%; min-height: 200px; overflow: hidden; }
.ws-result-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #f3f4f6; }
.ws-result-text {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 2.75rem 1rem 1rem; background: #f3f4f6; line-height: 1.75;
  font-size: 15px; word-break: break-word;
}
.ws-result-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }

.status-panel-wrap {
  position: relative; margin-top: 0.75rem; padding: 2.6rem 1rem 0.85rem;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ws-download-btn {
  position: absolute; top: 0.75rem; right: 0.85rem; z-index: 10;
  font-size: 1.08rem; font-weight: 700; padding: 0.5rem 1.35rem; border-radius: 999px;
  background: rgba(255,255,255,0.94); color: #dc2626; border: 1.5px solid #dc2626;
  text-decoration: none; box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}
.ws-download-btn[hidden] { display: none !important; }
.ws-download-btn.is-disabled { opacity: 0.45; pointer-events: none; }

.status-block { margin-bottom: 0.75rem; }
.status-block:last-child { margin-bottom: 0; }
.status-heading { font-size: 1.05rem; font-weight: 700; color: #374151; margin-bottom: 0.5rem; }
.status-count { font-weight: 600; color: #6b7280; font-size: 0.95rem; }
.step-text { font-size: 1rem; color: #4b5563; margin-bottom: 0.5rem; min-height: 1.35rem; }
.progress-track { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 999px; transition: width 0.35s ease; }
.progress-fill-done { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-fill-error { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-pct { font-size: 0.95rem; color: #6b7280; text-align: right; margin-top: 0.3rem; }
.cap-list { display: flex; flex-direction: column; gap: 0.45rem; }
.cap-row { display: grid; grid-template-columns: 10px 6rem 1fr; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.cap-dot { width: 8px; height: 8px; border-radius: 50%; }
.cap-ready { background: #22c55e; box-shadow: 0 0 0 2px #dcfce7; }
.cap-failed { background: #ef4444; box-shadow: 0 0 0 2px #fee2e2; }
.cap-idle { background: #d1d5db; }
.cap-name { color: #374151; font-weight: 500; }
.cap-detail { color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.history-panel-wrap {
  width: 100%; padding: 0.85rem 1rem; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.history-heading { font-size: 1.05rem; font-weight: 700; color: #374151; margin: 0 0 0.65rem; }
.ws-history-list {
  display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0.75rem;
  overflow-x: auto; padding-bottom: 0.35rem;
}
.ws-history-card {
  flex: 0 0 auto; width: 220px; min-width: 200px; padding: 0.65rem 0.75rem;
  border: 1px solid #e5e7eb; border-radius: 8px; background: #fafafa; cursor: pointer;
  font-size: 0.88rem; line-height: 1.45; color: #4b5563; text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.ws-history-card:hover { border-color: #93c5fd; background: #eff6ff; }
.ws-history-card.is-active { border-color: #2563eb; background: #eff6ff; }
.ws-history-empty { margin: 0; padding: 0.35rem 0; }
