/* ============================================================
   线上工具（自研 12 个实验计算器）—— v1.1.72 新增，v1.1.74 修样式一致性
   —— 仅 /calculator/ 与 /calculator/{key}.html 加载（CalculatorController 挂 head_extra）

   配色沿用站内 base.css 的变量（--c-line / --r-lg / --sh-1 / --c-deep /
   --c-ink-3 …），都带兜底值，即使变量未定义也不会掉样式。
   版式：索引页卡片网格；单工具页「左主体 + 右其他工具」两栏。

   v1.1.74：本文件对「会被整站 base.css 裸元素规则渗透」的属性一律显式声明，
   使线上与离线预览完全一致（详见文件中部「工具主体」段落注释）。
   ============================================================ */

/* ---------------- 页头 ---------------- */
.tl-hero {
  background: #fff;
  border: 1px solid var(--c-line, #e6edf3);
  border-radius: var(--r-lg, 12px);
  box-shadow: var(--sh-1, 0 1px 3px rgba(16, 42, 67, .06));
  padding: 24px 26px 20px;
  margin-bottom: 16px;
}
.tl-hero h1 {
  margin: 0 0 8px; font-size: 24px; line-height: 1.3; color: var(--c-deep, #0b3b56);
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.tl-hero h1 .tl-en {
  font-size: 12.5px; font-weight: 400; color: #8a99a6;
  letter-spacing: .05em; text-transform: uppercase;
}
.tl-hero p { margin: 0; color: #6b7c8d; font-size: 13.6px; line-height: 1.9; max-width: 900px; }
.tl-hero-sm { padding: 18px 22px 16px; }
.tl-hero-sm h1 { font-size: 21px; }
.tl-hero-sm .tl-h1-ico { font-size: 20px; }
.tl-back {
  display: inline-block; margin-bottom: 10px; font-size: 13px; color: #5f8399;
  text-decoration: none;
}
.tl-back:hover { color: #0f88c4; }

.tl-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 14px; }
.tl-stats span {
  font-size: 12.8px; color: #8a99a6; display: inline-flex; align-items: baseline; gap: 5px;
}
.tl-stats b { font-size: 19px; color: #0f88c4; font-weight: 700; }

/* 说明性胶囊（注意：本类只在此作用域生效，避免与 .tl-field .tl-tip 表单提示冲突） */
.tl-tips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tl-tips .tl-tip {
  display: inline-block; padding: 4px 11px; border-radius: 20px;
  background: #f1f8fd; border: 1px solid #dceaf5; color: #4a7c9b;
  font-size: 12.2px; text-decoration: none; line-height: 1.7;
}
.tl-tips .tl-tip.link { color: #0f88c4; border-color: #bcdcf5; background: #f4fbff; }
.tl-tips .tl-tip.link:hover { background: #e7f5ff; }

/* ---------------- 工具卡片网格（索引页） ---------------- */
.tl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(296px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tl-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 16px; background: #fff;
  border: 1px solid var(--c-line, #e6edf3); border-radius: 11px;
  text-decoration: none; position: relative;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.tl-card:hover {
  border-color: #bcdcf5; box-shadow: 0 4px 14px rgba(15, 136, 196, .1);
  transform: translateY(-1px);
}
.tl-ico {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: #f1f8fd; border: 1px solid #dceaf5;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.tl-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.tl-name { font-size: 15px; font-weight: 600; color: #25506d; line-height: 1.5; }
.tl-card:hover .tl-name { color: #0f88c4; }
.tl-desc {
  font-size: 12.6px; color: #8a99a6; line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tl-go {
  flex: none; align-self: center; color: #c3d3de; font-size: 20px; line-height: 1;
  transition: color .16s, transform .16s;
}
.tl-card:hover .tl-go { color: #0f88c4; transform: translateX(2px); }

/* ---------------- 单工具页两栏 ---------------- */
.tl-wrap { display: flex; gap: 16px; align-items: flex-start; }
.tl-main { flex: 1 1 auto; min-width: 0; }
.tl-panel {
  background: #fff; border: 1px solid var(--c-line, #e6edf3);
  border-radius: var(--r-lg, 12px); box-shadow: var(--sh-1, 0 1px 3px rgba(16, 42, 67, .06));
  padding: 22px 24px;
}

.tl-side {
  flex: none; width: 246px; background: #fff;
  border: 1px solid var(--c-line, #e6edf3); border-radius: var(--r-lg, 12px);
  box-shadow: var(--sh-1, 0 1px 3px rgba(16, 42, 67, .06));
  padding: 8px; position: sticky; top: 12px;
}
.tl-side-hd {
  font-size: 13px; font-weight: 600; color: #25506d;
  padding: 8px 10px 10px; border-bottom: 1px solid #eef4f8; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.tl-side-hd span {
  font-size: 11.5px; font-weight: 400; color: #9aabb8;
  background: #f2f7fb; border-radius: 10px; padding: 1px 8px;
}
.tl-side-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 8px; text-decoration: none; transition: background .14s;
}
.tl-side-item:hover { background: #f4fafe; }
.tl-side-ico { flex: none; font-size: 16px; width: 20px; text-align: center; }
.tl-side-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tl-side-txt b { font-size: 13.2px; font-weight: 500; color: #33475b; line-height: 1.5; }
.tl-side-item:hover .tl-side-txt b { color: #0f88c4; }
.tl-side-txt i {
  font-style: normal; font-size: 11.5px; color: #9aabb8; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-side-all {
  display: block; margin: 6px 4px 2px; padding: 8px 10px; text-align: center;
  font-size: 12.6px; color: #0f88c4; text-decoration: none;
  border-top: 1px solid #eef4f8;
}
.tl-side-all:hover { color: #0a6c9e; }

/* ---------------- 工具主体（calculator.js 生成的表单） ----------------
 * 注意：本站 base.css 有一批「裸元素」规则（label{font-size:13px;margin-bottom:5px}、
 * input:focus{box-shadow:…}、p{margin:0 0 1em} 等），它们会渗进工具面板内部，
 * 而离线预览页没有 base.css —— 于是同一个工具在两处长得不一样（v1.1.73 用户反馈）。
 * 下面凡是被渗透的属性都在工具类里**显式声明死**（类选择器优先级高于裸元素选择器），
 * 保证线上 / 预览 / 换主题后表现完全一致。
 */
.tl-app { font-size: 13.6px; color: #33475b; line-height: 1.6; }
.tl-loading { color: #9aabb8; font-size: 13px; margin: 6px 0; }

.tl-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 14px; margin-bottom: 12px;
}
.tl-field { display: flex; flex-direction: column; gap: 5px; min-width: 0;
  margin: 0; font-size: inherit; color: inherit; }
.tl-field.tl-full { grid-column: 1 / -1; }
.tl-lb { font-size: 12.6px; color: #6b7c8d; font-weight: 500; }
.tl-in {
  width: 100%; box-sizing: border-box;
  padding: 8px 11px; font-size: 13.6px; color: #25506d;
  background: #fbfdfe; border: 1px solid #dfe9f0; border-radius: 8px;
  outline: none; font-family: inherit; transition: border-color .15s, background .15s;
}
textarea.tl-in { line-height: 1.7; resize: vertical; min-height: 84px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
/* 聚焦样式自己声明：否则 base.css 的 input:focus{box-shadow:…} 会额外叠一圈蓝晕 */
.tl-in:focus { border-color: #7cc0e6; background: #fff; box-shadow: 0 0 0 3px rgba(15, 136, 196, .14); }
.tl-in:focus-visible { outline: none; }
/* 表单内的小提示（与页头 .tl-tips .tl-tip 胶囊区分开） */
.tl-field .tl-tip { font-size: 11.6px; color: #9aabb8; line-height: 1.6; }

.tl-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.tl-btn {
  padding: 8px 20px; font-size: 13.6px; font-family: inherit;
  border: 1px solid #0f88c4; background: #0f88c4; color: #fff;
  border-radius: 8px; cursor: pointer; transition: background .15s, border-color .15s;
}
.tl-btn:hover { background: #0a6c9e; border-color: #0a6c9e; }
.tl-btn.ghost { background: #fff; color: #4a7c9b; border-color: #d3e3ee; }
.tl-btn.ghost:hover { background: #f4fafe; border-color: #bcdcf5; color: #0f88c4; }

.tl-hr { border: 0; border-top: 1px dashed #e2ecf3; margin: 18px 0; }

.tl-result {
  margin-top: 14px; padding: 14px 16px;
  background: #f7fbfe; border: 1px solid #dceaf5; border-radius: 10px;
  font-size: 13.6px; line-height: 1.9; color: #33475b;
}
.tl-result [hidden] { display: none; }
.tl-big { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: #0b3b56; line-height: 1.4; }
.tl-big .tl-unit { font-size: 13px; font-weight: 400; color: #6b7c8d; margin-left: 2px; }
.tl-note { margin: 6px 0 0; font-size: 12.4px; color: #8a99a6; line-height: 1.8; }
.tl-err { margin: 0; color: #c2410c; font-size: 13px; }
.tl-mono {
  margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.8px; line-height: 1.9; word-break: break-all; color: #25506d;
}
/* 序列输出块（互补链 / 反向互补 / 翻译原序列）—— v1.1.74 补：此前无任何样式，
   靠浏览器默认 monospace + 不换行，手机上会横向溢出。 */
.tl-seqwrap { margin: 0 0 4px; }
pre.tl-seq {
  margin: 4px 0 8px; padding: 9px 11px;
  background: #f7fbfe; border: 1px solid #dceaf5; border-radius: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.6px; line-height: 1.75; color: #25506d;
  white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;
}
.tl-table { width: 100%; border-collapse: collapse; font-size: 12.8px; margin: 4px 0 8px; }
.tl-table th, .tl-table td {
  border: 1px solid #e2ecf3; padding: 6px 9px; text-align: left; vertical-align: top;
}
.tl-table th { background: #f4fafe; color: #4a7c9b; font-weight: 500; white-space: nowrap; }
.tl-table td { color: #33475b; }

/* ---------------- 页脚说明块 ---------------- */
.tl-note-box {
  background: #fff; border: 1px solid var(--c-line, #e6edf3); border-radius: var(--r-lg, 12px);
  padding: 14px 20px; margin-top: 14px;
}
.tl-note-box h2 { margin: 0 0 8px; font-size: 14.5px; color: #25506d; font-weight: 600; }
.tl-note-box ul { margin: 0; padding-left: 18px; }
.tl-note-box li { font-size: 12.8px; color: #8a99a6; line-height: 2; }

/* ---------------- 手机端 ---------------- */
@media (max-width: 820px) {
  .tl-hero { padding: 18px 16px 16px; border-radius: 11px; }
  .tl-hero h1 { font-size: 20px; }
  .tl-cards { grid-template-columns: 1fr; }
  .tl-wrap { display: block; }
  .tl-panel { padding: 16px 15px; }
  .tl-side { width: 100%; position: static; margin-top: 14px; }
  .tl-grid { grid-template-columns: 1fr 1fr; }
  .tl-big { font-size: 18px; }
}
