/* 调优工作台 */
.tune-form-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  margin-bottom: 12px;
}
.tune-form-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.tune-form-head h2 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 600; }
.tune-form-head span { font-family: var(--mono); font-size: 9px; color: var(--faint); }
.tune-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tune-field { display: block; min-width: 0; }
.tune-field-wide { grid-column: 1 / -1; }
.tune-field span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.tune-field input, .tune-field select {
  width: 100%;
  height: 37px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fbfcf8;
  color: var(--ink);
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 14px;
}
.tune-field input:focus, .tune-field select:focus { border-color: var(--ink); }
.tune-field small { display: block; margin-top: 2px; color: var(--faint); font-size: 8.5px; line-height: 1.4; }
.tune-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tune-primary, .tune-save, .tune-reset {
  height: 37px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-size: 12px;
  padding: 0 13px;
}
.tune-primary { background: var(--ink); color: #fff; }
.tune-primary:hover { background: var(--pine); border-color: var(--pine); }
.tune-save { background: var(--pine); border-color: var(--pine); color: #fff; }
.tune-save:disabled { opacity: .35; cursor: not-allowed; }
.tune-reset { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.tune-note { margin: 9px 0 0; color: var(--faint); font-size: 9.5px; line-height: 1.5; }
.tune-result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 12px 0 8px; }
.tune-result-head h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; }
.tune-result-head span { font-family: var(--mono); font-size: 9px; color: var(--faint); }
.tune-placeholder { border: 1px dashed var(--line-strong); padding: 24px 12px; text-align: center; color: var(--faint); font-size: 11px; }
.tune-placeholder p { margin: 0; }
@media (min-width: 700px) {
  .tune-form-card { padding: 16px; }
  .tune-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tune-field-wide { grid-column: span 2; }
}

.dir-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.dir-chips button {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fbfcf8;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.dir-chips button:hover { border-color: var(--ink); color: var(--ink); }
.dir-chips button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.custom-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}
.custom-trigger button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--brass);
  background: #f6efdd;
  color: #765b1d;
  font-size: 11px;
}
.custom-trigger span { color: var(--faint); font-size: 9px; }
.custom-editor {
  margin-top: 9px;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--brass);
  background: #fbfcf8;
  overflow: hidden;
}
.custom-editor-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 7px; }
.custom-editor-head strong { font-size: 12px; }
.custom-editor-head span { color: var(--faint); font-size: 9px; flex: 1 1 200px; }
.custom-editor-head button { border: 0; background: transparent; color: var(--oxide); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.custom-table-wrap { overflow-x: auto; }
.custom-table { border-collapse: collapse; min-width: 100%; font-family: var(--mono); font-size: 9.5px; }
.custom-table th, .custom-table td { padding: 4px 3px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.custom-table th { color: var(--faint); font-size: 8.5px; font-weight: 500; }
.custom-table td:first-child, .custom-table th:first-child { text-align: left; padding-left: 5px; color: var(--ink); font-weight: 600; }
.custom-table select {
  height: 26px;
  min-width: 40px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  border-radius: 0;
  padding: 0 2px;
}
.custom-table select:focus { border-color: var(--ink); }
@media (min-width: 700px) {
  .custom-editor { margin-left: 0; }
}

.custom-trigger[hidden], .custom-editor[hidden] { display: none !important; }
.custom-editor { grid-column: 1 / -1; }
