/* 一键首飞样式 */
#viewOnetouch {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.ot-inputs,
.ot-stages,
.ot-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
  font-size: 13px;
}

.ot-inputs label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.ot-inputs input[type="number"] {
  width: 72px;
}

.ot-inline {
  color: var(--text-secondary);
}

.ot-stages {
  gap: 14px;
  background: var(--bg-primary);
}

.ot-stage {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.ot-stage input {
  accent-color: var(--accent);
}

.ot-actions {
  gap: 8px;
}

.ot-actions button {
  padding: 5px 12px;
}

.ot-aux-label {
  color: var(--text-muted);
  margin-left: 8px;
}

.ot-danger-btn {
  border-color: var(--warning);
  color: var(--warning);
}

.ot-status {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.ot-status.ok {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
  border: 1px solid var(--success);
}

.ot-status.bad {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* 表格 + 报告 */
.ot-body {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  min-height: 0;
}

.ot-table-wrap {
  overflow: auto;
  padding: 0 12px;
}

.ot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ot-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-color);
  z-index: 2;
}

.ot-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--bg-tertiary);
  vertical-align: middle;
}

.ot-col-chk { width: 46px; text-align: center; }
.ot-col-stage { width: 150px; color: var(--text-secondary); }
.ot-col-name { width: 170px; font-family: 'SF Mono', 'Fira Code', monospace; font-weight: 500; }
.ot-col-cur { width: 100px; text-align: right; color: var(--text-secondary); }
.ot-col-new { width: 110px; }
.ot-col-new input { width: 96px; }
.ot-col-unit { width: 62px; color: var(--text-muted); }
.ot-col-basis { color: var(--text-secondary); }

.ot-row-same { background: rgba(63, 185, 80, 0.10); }
.ot-row-diff { background: rgba(210, 153, 34, 0.12); }
.ot-row-missing { background: rgba(248, 81, 73, 0.08); }

.ot-report {
  margin: 0;
  height: 150px;
  overflow: auto;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: pre-wrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* 模态 */
.ot-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.ot-modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px 22px;
  width: 520px;
  max-width: 92vw;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.6;
}

.ot-modal-box h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent);
}

.ot-modal-box p {
  margin: 6px 0;
}

.ot-modal-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.ot-danger {
  color: var(--danger);
  font-weight: 600;
}

.ot-confirm-lab {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0;
  color: var(--warning);
}

.ot-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.ot-modal-close {
  margin-top: 12px;
}

.ot-help-box {
  width: 820px;
  max-width: 94vw;
}

.ot-help {
  max-height: 66vh;
  overflow: auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-secondary);
}

/* 进行中状态: 状态条闪烁 + 禁用按钮视觉提示 */
.ot-status.busy {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
  border: 1px solid var(--warning);
  animation: ot-busy-pulse 1s ease-in-out infinite;
}

@keyframes ot-busy-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ot-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 帮助弹窗 (分节 + 目录 + 搜索) ---------- */
.ot-help-box {
  width: 1040px;
  max-width: 96vw;
  height: 86vh;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.ot-help-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.ot-help-head h3 {
  margin: 0;
}

.ot-help-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ot-help-search {
  margin-left: auto;
  width: 260px;
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.ot-help-close {
  margin-top: 0;
}

.ot-help-main {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
}

.ot-help-toc {
  overflow: auto;
  padding: 10px 8px;
  border-right: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ot-help-toc-item {
  display: block;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-secondary);
  cursor: pointer;
}

.ot-help-toc-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ot-help-toc-item.active {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.ot-help-toc-item.hidden,
.ot-help-sec.hidden {
  display: none;
}

.ot-help-content {
  overflow: auto;
  padding: 8px 16px 20px;
  min-height: 0;
}

.ot-help-sec {
  margin-bottom: 18px;
}

.ot-help-sec h4 {
  margin: 0 0 8px;
  padding: 8px 0 6px;
  font-size: 14px;
  color: var(--accent);
  border-bottom: 1px solid var(--border-color);
}

.ot-help-sec pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ot-help-sec mark {
  background: rgba(210, 153, 34, 0.35);
  color: var(--text-primary);
  border-radius: 2px;
}

@media (max-width: 720px) {
  .ot-help-main { grid-template-columns: 1fr; }
  .ot-help-toc { display: none; }
}
