/* ============================================================
   法智引擎 · 法律工具页样式
   仅作用于 .tool-* 与 .tool-content，不影响全站其他页面
   ============================================================ */

/* ---------- 计算器表单 ---------- */
#tool-app { font-size: 15px; }

.tool-intro {
  margin: 0 0 20px;
  color: #4b5563;
  line-height: 1.7;
  font-size: 14px;
}

.tool-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 768px) {
  .tool-form { grid-template-columns: 1fr 1fr; }
  .tool-field-check { grid-column: 1 / -1; }
}

.tool-field { display: flex; flex-direction: column; }

.tool-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  line-height: 1.5;
}

.tool-input,
.tool-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.tool-input:focus,
.tool-select:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .12);
}

.tool-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
}

.tool-field-check { margin-top: 2px; }
.tool-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #374151;
  line-height: 1.6;
  cursor: pointer;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.tool-check input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #1e3a5f;
  flex: 0 0 auto;
  cursor: pointer;
}

/* ---------- 按钮 ---------- */
.tool-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.tool-btn {
  flex: 1 1 200px;
  padding: 13px 24px;
  background: #1e3a5f;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.tool-btn:hover { background: #0f1f33; }
.tool-btn:active { transform: translateY(1px); }

.tool-reset {
  padding: 13px 22px;
  background: #fff;
  color: #6b7280;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.tool-reset:hover { color: #1e3a5f; border-color: #1e3a5f; }

/* ---------- 结果区（固定最小高度，避免抖动） ---------- */
.tool-result {
  margin-top: 24px;
  min-height: 132px;
  padding: 20px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  box-sizing: border-box;
  transition: background .2s, border-color .2s;
}

.tool-result-done {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #f59e0b;
}

.tool-result-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.tool-placeholder {
  margin: 0;
  padding-top: 40px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

.tool-result-head {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: .05em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.tool-rows { margin: 0; }
.tool-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed #f3f4f6;
}
.tool-row:last-child { border-bottom: none; }
.tool-row dt {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  flex: 1 1 auto;
}
.tool-row dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #1e3a5f;
  text-align: right;
  flex: 0 0 auto;
}
/* 结论卡（大号主结论，替代「第一行放大」避免误导） */
.tool-verdict {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #fffbeb 100%);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 8px;
  font-size: 19px;
  font-weight: 700;
  color: #92400e;
  line-height: 1.5;
  word-break: break-word;
}
@media (max-width: 640px) {
  .tool-verdict { font-size: 16.5px; padding: 14px; }
}

/* 提示块（需人工核实、时效将届满、超司法保护上限等） */
.tool-warn {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  font-size: 13.5px;
  color: #9a3412;
  line-height: 1.75;
}
.tool-warn::before {
  content: '需注意　';
  font-weight: 700;
}

/* 分段明细 */
.tool-detail {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}
.tool-detail-head {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.tool-detail .tool-row dd { font-size: 15px; font-weight: 600; color: #4b5563; }

.tool-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.75;
}

.tool-err {
  margin: 0;
  padding: 12px 0;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 正文分节（计算依据 / 适用条件 / 使用说明 / FAQ / 风险提示） ---------- */
.tool-content { font-size: 15.5px; line-height: 1.85; color: #374151; }

.tool-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1e3a5f;
  margin: 34px 0 14px;
  padding-left: 12px;
  border-left: 4px solid #f59e0b;
  line-height: 1.4;
}
.tool-content h2:first-child { margin-top: 0; }

.tool-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 22px 0 10px;
}

.tool-content p { margin: 0 0 14px; }
.tool-content ul,
.tool-content ol { margin: 0 0 16px; padding-left: 22px; }
.tool-content li { margin-bottom: 8px; }

.tool-content strong { color: #111827; font-weight: 600; }

.tool-content blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
  color: #475569;
  font-size: 14.5px;
  line-height: 1.8;
  border-radius: 0 6px 6px 0;
}

.tool-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 22px;
  font-size: 14px;
  table-layout: fixed;
}
.tool-content th,
.tool-content td { word-break: break-word; overflow-wrap: anywhere; }
.tool-content th {
  background: #f8fafc;
  color: #1e3a5f;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8f0;
}
.tool-content td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}
.tool-content tr:last-child td { border-bottom: none; }

/* FAQ 折叠区（内容中用 details/summary） */
.tool-content details {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
}
.tool-content summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14.5px;
  color: #1f2937;
  list-style: none;
  position: relative;
  padding-right: 42px;
}
.tool-content summary::-webkit-details-marker { display: none; }
.tool-content summary::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #9ca3af;
  font-weight: 400;
  line-height: 1;
}
.tool-content details[open] summary::after { content: '−'; }
.tool-content details > p {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 14.5px;
  color: #4b5563;
  line-height: 1.8;
}

/* 风险提示块（内容中最后 section，class="tool-risk"） */
.tool-content .tool-risk {
  margin: 32px 0 0;
  padding: 18px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}
.tool-content .tool-risk h2 {
  margin: 0 0 10px;
  padding: 0;
  border: none;
  font-size: 16px;
  color: #92400e;
}
.tool-content .tool-risk p,
.tool-content .tool-risk li {
  font-size: 13.5px;
  color: #78350f;
  line-height: 1.8;
}
.tool-content .tool-risk ul { margin-bottom: 0; }

/* 移动端微调 */
@media (max-width: 640px) {
  .tool-row { flex-direction: column; gap: 2px; }
  .tool-row dd { text-align: left; }
  .tool-content table { font-size: 13px; }
  .tool-content th, .tool-content td { padding: 8px 6px; }
}

/* 面包屑：用 CSS 生成分隔符，避免模板里写循环判断 */
.crumbs > * + *::before {
  content: "/";
  margin: 0 .5rem;
  opacity: .5;
}
.crumbs a:hover { text-decoration: underline; }
