/* tiresize — tool-specific styles
   只放这个工具独有的东西。公共外观（toolbox / field / alert / chip / hint / output）
   已经在全局样式表里。

   ★ 不写任何裸色值：一律走主题变量（--surface / --line / --fg …）。
   ★ 类名前缀 .ts- 是本工具私有的 —— 借别的工具的类名 = 没有样式
     （工具样式按工具隔离加载）。 */

/* 分类横幅：`分类名 · 说明` 两段拼的（验收脚本会单独比对后半句） */
.ts-status {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--fg-muted);
}

/* ── 输入行 ──
   不用全局的 .toolbox__controls（那是 `1fr 240px` 的两列栅格，只适合两个字段），
   用 auto-fit 让它在窄屏自己折列。 */
.ts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.ts-row + .ts-row {
  margin-top: 14px;
}

/* 标签 + 单位符号。★ 单位符号**不能**放进 .field__label 里面：
   验收脚本读 .field__label 的 textContent 去比对语言包，
   "Speed km/h" 不等于语言包里的任何一条 ⇒ 必然假红。 */
.ts-lab {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 6px;
}

.ts-lab .field__label {
  margin-bottom: 0;
}

.ts-unit-sym {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-muted);
}

/* ── 主结果：直径差百分比，一个数占满一行 ── */
.ts-lead {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ts-lead__k {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

.ts-lead__v {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--fg);
}

.ts-lead__u {
  margin-left: 6px;
  font-size: 16px;
  font-weight: 400;
  color: var(--fg-muted);
}

.ts-lead__d {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--fg-muted);
}

/* ── 明细四格 ── */
.ts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.ts-cell {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ts-cell__k {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

.ts-cell__v {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg);
  word-break: break-word;
}

.ts-cell__u {
  margin-left: 5px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--fg-muted);
}

.ts-cell__x {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--fg-muted);
  word-break: break-word;
}

/* ── 速度表块：四行"标称 → 实际"，一眼看出方向 ── */
.ts-speed {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.ts-speed__k {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

.ts-srow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}

.ts-srow + .ts-srow {
  border-top: 1px solid var(--line);
}

.ts-srow__k {
  font-size: 12.5px;
  color: var(--fg-muted);
}

.ts-srow__v {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

.ts-speed__note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-muted);
}

/* ── 新旧并排表 ── */
.ts-table-wrap {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow-x: auto;
}

.ts-table__k {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}

.ts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ts-table th,
.ts-table td {
  padding: 5px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ts-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-faint);
}

.ts-table tbody th {
  font-weight: 400;
  color: var(--fg-muted);
}

.ts-table tbody tr:last-child th,
.ts-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── 提示清单 ── */
.ts-warn {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.ts-warn__item {
  margin-top: 8px;
  padding: 9px 12px 9px 14px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg);
}

.ts-warn__item--warn {
  border-left-color: var(--accent);
}

.ts-warn__item--info {
  border-left-color: var(--fg-faint);
  color: var(--fg-muted);
}

.ts-warn__ok {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-muted);
}
