/* rsa 专用，依赖 /home.css 变量与 /tool.css */
/* 参数：标签在上、下拉框在下，宽屏一行 4 个，窄屏一行 2 个 */
.params {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--rule);
}
.param { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.param[hidden] { display: none; }
.param > span { font: 500 12px/1 var(--mono); color: var(--ink-2); }
.param .field { width: 100%; min-width: 0; text-overflow: ellipsis; }
.panes + .panes { margin-top: 16px; }
#key { font-size: 12px; }

/* 历史记录：每条三行——时间 · 方向 · 参数 / 输入 / 结果；操作在右侧，窄屏移到第一行 */
.hist-wrap { margin-top: 28px; }
.hist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); font: 13px/1.5 var(--mono); }
.hist li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head ops" "body body";
  align-items: center;
  gap: 4px 18px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
}
.hist li:hover { background: var(--hover); }
.hist .head { grid-area: head; display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; align-items: baseline; }
.hist .when { color: var(--ink-2); white-space: nowrap; }
.hist .op { font-weight: 600; white-space: nowrap; }
.hist .sum { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.hist .body { grid-area: body; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist .in, .hist .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hist .res { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hist .val { color: var(--result); font-weight: 600; }
.hist .res .cbtn { flex: none; }
.hist .ops { grid-area: ops; display: flex; justify-content: flex-end; gap: 14px; }
.hint { margin: 8px 0 0; font: 12px/1.6 var(--sans); color: var(--ink-2); }

/* 使用说明 */
.guide { max-width: 76ch; margin-top: clamp(48px, 8vh, 72px); padding-top: 8px; border-top: 2px solid var(--ink); }
.guide h2 { margin: 28px 0 10px; font: 600 15px/1.4 var(--mono); }
.guide p { margin: 0 0 10px; font: 14px/1.75 var(--sans); color: var(--ink); overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
