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

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

/* 分类横幅：`分类名 · 说明` 两段拼的 */
.rs-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);
}

/* ── 份数：两个输入夹一个箭头 ── */
.rs-servings {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.rs-field {
  width: 132px;
}

.rs-arrow {
  padding-bottom: 9px;
  color: var(--fg-faint);
  font-size: 15px;
}

/* ── 配方输入：等宽字体 + 可纵向拉伸 ──
   配方是一行一条，等宽才能让"数量 / 单位 / 名称"三列自己对齐。 */
.rs-recipe-field {
  display: block;
  margin-bottom: 12px;
}

.rs-recipe {
  width: 100%;
  min-height: 160px;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}

/* ── 结果头：倍数 + 一句汇总 ── */
.rs-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.rs-factor {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rs-factor__k {
  font-size: 12px;
  color: var(--fg-muted);
}

.rs-factor__v {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-fg);
}

.rs-summary {
  font-size: 12px;
  color: var(--fg-muted);
}

/* ── 表格 ──
   ★ 用 <table> 而不是 grid：屏幕阅读器与"复制到剪贴板"都对表格更友好。 */
.rs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rs-th {
  padding: 6px 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.rs-row {
  border-bottom: 1px solid var(--line);
}

.rs-row:hover {
  background: var(--bg-soft);
}

.rs-td {
  padding: 7px 8px;
  vertical-align: top;
}

.rs-name {
  color: var(--fg);
}

.rs-orig {
  color: var(--fg-muted);
  white-space: nowrap;
}

.rs-row .rs-arrow {
  padding: 7px 2px;
  color: var(--fg-faint);
}

.rs-main {
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

.rs-note {
  font-size: 12px;
  color: var(--fg-muted);
}

/* 副值（单位提升后的等值）：跟主值同一行，但明显是补充 */
.rs-extra {
  display: inline-block;
  margin-right: 6px;
  color: var(--fg-muted);
}

/* 标签：不缩放 / 需要自己取整 */
.rs-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* 不缩放的行：整行弱化，并让「原量 = 新量」这件事看起来是有意的 */
.rs-row--fixed .rs-orig {
  color: var(--fg-faint);
}

.rs-row--fixed .rs-main {
  font-weight: 500;
}

/* 需要自己取整的行：主值用 accent，提醒这是要人决断的数 */
.rs-row--frac .rs-main {
  color: var(--accent-fg);
}

/* ── 坏行清单 ── */
.rs-errors {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.rs-errors__h {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}

.rs-errors__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rs-err {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 3px 0;
  font-size: 12px;
  color: var(--fg-muted);
}

.rs-err__n {
  color: var(--fg-faint);
  white-space: nowrap;
}

.rs-err__t {
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--fg);
}

.rs-foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--fg-faint);
  line-height: 1.6;
}
