/* === 计算器增强样式 === */

/* 次级标题：表单分区、规则说明、案例/FAQ 小节、结果框标题等（低于章节 H2：text-xl font-bold mb-3） */
.tool-subheading {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.35;
}
.tool-subheading--result {
  color: var(--primary-deep);
}

/* 工具页章节 H2（与「常见争议」同级）：覆盖父级 `.content-prose h2` 的 clamp 字号与外边距，否则「适用场景」等会显得更大 */
.content-prose h2.tool-section-h2 {
  font-family: inherit;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.35;
  margin: 0 0 0.75rem !important;
  padding-top: 0 !important;
  color: var(--gray-900);
}

/* 结果区域操作栏 */
.result-actions {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.result-actions .btn {
  font-size: .82rem;
  padding: .5rem 1rem;
  border-radius: .5rem;
}
.calc-primary-action {
  width: 100%;
  margin-top: 1rem;
  justify-content: center;
  font-size: 1rem;
}

/* 历史记录面板 */
.history-panel {
  display: none;
  margin-top: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}
.history-panel.active { display: block; }
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: .85rem;
  cursor: pointer;
  border-radius: .375rem;
  transition: background .15s;
}
.history-item:hover { background: var(--gray-100); }
.history-item:last-child { border-bottom: none; }
.history-item .time { color: var(--gray-500); font-size: .75rem; }
.history-item .summary { font-weight: 600; }
.history-empty { color: var(--gray-500); text-align: center; padding: 1.5rem; font-size: .9rem; }
.history-clear {
  float: right;
  font-size: .75rem;
  color: var(--gray-500);
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: underline;
}

/* 移动端计算器优化 */
@media (max-width: 680px) {
  .grid-2 {
    grid-template-columns: 1fr !important;
  }
  .calc-form .form-group input,
  .calc-form .form-group select {
    font-size: 16px; /* 防止 iOS 缩放 */
  }
  .result-box {
    font-size: .9rem;
  }
  .result-row {
    padding: .5rem 0;
  }
  .result-actions {
    flex-direction: column;
  }
  .result-actions .btn {
    width: 100%;
  }
  table {
    font-size: .8rem;
  }
  table input, table select {
    font-size: 16px;
    padding: .4rem;
  }
}

/* 截图模式 - 隐藏不需要的元素 */
.screenshot-mode .navbar,
.screenshot-mode .footer,
.screenshot-mode .breadcrumb,
.screenshot-mode .result-actions,
.screenshot-mode .cookie-consent { display: none !important; }
.screenshot-mode .section { padding: 1rem 0; }

/* 法律依据模块：与正文 `.container` 同最大宽度与水平内边距，避免贴齐视口左侧 */
.section .legal-basis {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem;
  box-sizing: border-box;
  background: var(--gray-50);
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 0.85rem;
}
.section .legal-basis-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0;
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.8;
}
@media (max-width: 900px) {
  .section .legal-basis {
    padding: 1.35rem 1rem;
  }
}
