/* ============================================================
   AI 应答策略 · 页面样式（依赖 shell.css 的令牌与外壳）
   ============================================================ */

.page-head { margin-bottom: 16px; }

.policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 16px;
  align-items: start;
}

/* ---------- 卡片 ---------- */
.pcard {
  background: #fff;
  border: 1px solid var(--shell-line, #E7E4DD);
  border-radius: 8px;
  padding: 16px 18px 18px;
  margin-bottom: 12px;
}

.pcard-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-2, #F4F2ED);
}

.pcard-hd h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #16161A);
}

.pcard-hd p {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--ink-3, #8A8780);
  line-height: 1.6;
}

.pcard-no {
  font-size: 10px;
  color: #9A9488;
  letter-spacing: .1em;
  flex: none;
}

/* ---------- 行 ---------- */
.prow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line-2, #F4F2ED);
  flex-wrap: wrap;
}

.prow:last-child { border-bottom: 0; padding-bottom: 0; }
.prow.pcol { align-items: flex-start; flex-direction: column; gap: 8px; }

.plabel {
  width: 78px;
  flex: none;
  font-size: 12px;
  color: var(--ink-2, #5A5852);
}

.phint {
  font-size: 10.5px;
  color: var(--ink-4, #75706A);
  line-height: 1.5;
}

.pinput {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--shell-line, #E7E4DD);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  color: var(--ink, #16161A);
  background: #fff;
  outline: none;
  width: 180px;
  transition: border-color .15s, box-shadow .15s;
}

.pinput:focus {
  border-color: var(--brand, #FF4C2B);
  box-shadow: 0 0 0 3px rgba(255, 76, 43, .1);
}

.pinput--sm { width: 96px; }

/* 分段 */
.pseg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #F4F2ED;
  border-radius: 6px;
}

.pseg button {
  border: 0;
  background: none;
  font-size: 11.5px;
  color: var(--ink-3, #8A8780);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: .15s;
}

.pseg button.is-on {
  background: #fff;
  color: var(--ink, #16161A);
  box-shadow: 0 1px 2px rgba(20, 18, 14, .1);
}

/* 开关 */
.pswitch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--ink-3, #8A8780);
}

.pswitch i {
  width: 30px;
  height: 17px;
  border-radius: 100px;
  background: #DAD6CD;
  position: relative;
  transition: background .18s;
  flex: none;
}

.pswitch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  transition: transform .18s;
}

.pswitch[aria-checked="true"] i { background: var(--brand, #FF4C2B); }
.pswitch[aria-checked="true"] i::after { transform: translateX(13px); }

/* 阈值 */
.prange {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 10px;
}

.prange input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 100px;
  background: linear-gradient(90deg, #F4C9BC, var(--brand, #FF4C2B));
  outline: none;
}

.prange input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand, #FF4C2B);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(20, 18, 14, .2);
}

.prange b {
  font-family: var(--mono, monospace);
  font-size: 16px;
  font-weight: 600;
  color: var(--brand, #FF4C2B);
  min-width: 46px;
  text-align: right;
}

.pscale {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.pscale li {
  border: 1px solid var(--line-2, #F4F2ED);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pscale b { font-family: var(--mono, monospace); font-size: 10.5px; color: var(--ink-2, #5A5852); }
.pscale span { font-size: 10.5px; color: var(--ink-4, #75706A); }
.pscale .is-rec { border-color: rgba(255, 76, 43, .28); background: #FFF9F7; }
.pscale .is-rec b { color: var(--brand, #FF4C2B); }

/* 规则表 */
.ptable { margin-top: 6px; }

.prule {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-2, #F4F2ED);
}

.prule:last-child { border-bottom: 0; }

.prule-name { width: 112px; flex: none; font-size: 12px; color: var(--ink, #16161A); }

.prule-note {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: var(--ink-4, #75706A);
  font-family: var(--mono, ui-monospace, monospace);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pselect {
  height: 30px;
  border: 1px solid var(--shell-line, #E7E4DD);
  border-radius: 6px;
  font: inherit;
  font-size: 11.5px;
  color: var(--ink, #16161A);
  padding: 0 8px;
  background: #fff;
  cursor: pointer;
  min-width: 116px;
}

.pselect.is-handoff { color: #B45309; }
.pselect.is-refuse { color: #B91C1C; }
.pselect.is-confirm { color: #1D4ED8; }

/* 标签 */
.ptags { display: flex; flex-wrap: wrap; gap: 6px; }

.ptag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: #F7F6F3;
  border: 1px solid var(--shell-line, #E7E4DD);
  color: var(--ink-2, #5A5852);
}

.ptag button {
  border: 0;
  background: none;
  color: #75706A;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.ptag button:hover { color: #B91C1C; }

.ptag--danger {
  background: #FEF2F2;
  border-color: #F3D3D3;
  color: #B91C1C;
}

.padd { display: flex; gap: 8px; margin-top: 10px; }

.btn-ghost-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--shell-line, #E7E4DD);
  background: #fff;
  font-size: 11.5px;
  color: var(--ink, #16161A);
  cursor: pointer;
}

.btn-ghost-sm:hover { background: #FBFAF8; }

.ptextarea {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--shell-line, #E7E4DD);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink, #16161A);
  resize: vertical;
  outline: none;
}

.ptextarea:focus {
  border-color: var(--brand, #FF4C2B);
  box-shadow: 0 0 0 3px rgba(255, 76, 43, .1);
}

.pfoot {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--ink-4, #75706A);
}

/* ---------- 试跑面板 ---------- */
.policy-test {
  position: sticky;
  top: 16px;
  background: #0E1319;
  border-radius: 8px;
  padding: 16px;
  color: #F2F0E9;
}

.ptest-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.ptest-hd h2 { margin: 0; font-size: 13px; font-weight: 600; }
.ptest-hd .mono { font-size: 9px; letter-spacing: .14em; color: rgba(255, 255, 255, .34); }

.ptest-sub {
  margin: 8px 0 12px;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(242, 240, 233, .55);
}

.ptest-input { display: flex; gap: 6px; }

.ptest-input input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #F2F0E9;
  font: inherit;
  font-size: 12px;
  padding: 0 10px;
  outline: none;
}

.ptest-input input::placeholder { color: rgba(242, 240, 233, .3); }
.ptest-input input:focus { border-color: rgba(255, 122, 79, .6); }

.ptest-input button {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 0;
  background: #EF4626;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  flex: none;
}

.ptest-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

.ptest-chips button {
  font-size: 10.5px;
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: none;
  color: rgba(242, 240, 233, .66);
  cursor: pointer;
}

.ptest-chips button:hover { border-color: rgba(255, 122, 79, .5); color: #F2F0E9; }

.ptest-out { margin-top: 14px; }

.ptest-empty {
  font-size: 11.5px;
  color: rgba(242, 240, 233, .3);
  padding: 20px 0;
  text-align: center;
}

/* 判定结果 */
.pr-verdict {
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .045);
}

.pr-verdict b { font-size: 13px; }
.pr-verdict span { font-size: 10.5px; color: rgba(242, 240, 233, .55); }

.pr-verdict.is-auto { border-color: rgba(59, 178, 115, .4); background: rgba(59, 178, 115, .1); }
.pr-verdict.is-auto b { color: #6FD79F; }
.pr-verdict.is-confirm { border-color: rgba(96, 149, 240, .4); background: rgba(96, 149, 240, .1); }
.pr-verdict.is-confirm b { color: #8FB6FF; }
.pr-verdict.is-handoff { border-color: rgba(224, 164, 92, .45); background: rgba(224, 164, 92, .1); }
.pr-verdict.is-handoff b { color: #EFC17E; }
.pr-verdict.is-refuse { border-color: rgba(239, 70, 38, .45); background: rgba(239, 70, 38, .12); }
.pr-verdict.is-refuse b { color: #FF8A6E; }

/* 路径 */
.pr-steps { margin-top: 12px; display: flex; flex-direction: column; gap: 0; }

.pr-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 0;
  font-size: 11px;
  color: rgba(242, 240, 233, .4);
  border-bottom: 1px dashed rgba(255, 255, 255, .07);
  line-height: 1.6;
}

.pr-step:last-child { border-bottom: 0; }

.pr-step i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
  flex: none;
  margin-top: 2px;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-style: normal;
}

.pr-step span { flex: 1; min-width: 0; }
.pr-step b { font-weight: 500; color: rgba(242, 240, 233, .62); margin-right: 5px; }
.pr-step em { font-style: normal; word-break: break-word; }

.pr-step.is-pass { color: rgba(242, 240, 233, .72); }
.pr-step.is-pass i { border-color: rgba(59, 178, 115, .65); color: #6FD79F; }
.pr-step.is-pass b { color: rgba(242, 240, 233, .82); }

.pr-step.is-hit { color: #F2F0E9; }
.pr-step.is-hit i { border-color: #EF4626; background: #EF4626; color: #fff; }
.pr-step.is-hit b { color: #fff; }
.pr-step.is-hit em { color: #FF9C82; }

.pr-step.is-skip i::after { content: "—"; color: rgba(255, 255, 255, .3); }

.pr-answer {
  margin-top: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 10px 12px;
}

.pr-answer span {
  display: block;
  font-size: 9px;
  letter-spacing: .12em;
  color: rgba(242, 240, 233, .38);
  margin-bottom: 5px;
}

.pr-answer p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: #F2F0E9;
}

/* 交接摘要预览：走到交人这一步才出现 */
.pr-brief {
  margin-top: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 10px 12px;
}

.pr-brief > span {
  display: block;
  font-size: 9px;
  letter-spacing: .12em;
  color: rgba(242, 240, 233, .38);
  margin-bottom: 6px;
}

.pb-card {
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pb-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.pb-row em {
  flex: none;
  width: 34px;
  font-style: normal;
  font-size: 9.5px;
  color: rgba(242, 240, 233, .42);
}

.pb-row b {
  flex: 1;
  min-width: 0;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.55;
  color: #F2F0E9;
}

.ptest-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  font-size: 10px;
  line-height: 1.7;
  color: rgba(242, 240, 233, .4);
}

/* 顶栏按钮与状态 */
.btn-save {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: var(--brand, #FF4C2B);
  color: #fff;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}

.btn-save:hover { filter: brightness(.95); }

.save-chip {
  font-size: 10.5px;
  color: var(--ink-4, #75706A);
  padding: 4px 8px;
  border-radius: 100px;
  background: #F7F6F3;
}

.save-chip.is-dirty { color: #B45309; background: #FFFBEB; }
.save-chip.is-saved { color: #166534; background: #ECFDF5; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .policy { grid-template-columns: minmax(0, 1fr); }
  .policy-test { position: static; }
}

@media (max-width: 767px) {
  .policy { gap: 12px; }
  .pcard { padding: 14px 14px 16px; }
  .plabel { width: 100%; }
  .prow { gap: 8px; }
  .pinput { width: 100%; }
  .prow .phint { width: 100%; }
  .pscale { grid-template-columns: 1fr; }
  .prule { flex-wrap: wrap; }
  .pselect { flex: 1; min-width: 0; }
  .prule-note { display: none; }
  .top-acts .save-chip { display: none; }
  .ptest-note { display: none; }
}
