/*
 * 星门工厂 · 样式
 *
 * 配色跟随本站主题变量（--surface / --line / --text / --muted / --bg / --accent），
 * 明暗两种主题都要能用 —— 地图与图标是 canvas / svg，它们的颜色在 config.js 里。
 *
 * 版面是「页签 + 一块面板」：矿脉一屏、背包一屏，同一时刻只画一屏。
 * 整页只有一条滚动条（本站纪律），地图自己拖动平移，不做嵌套滚动。
 */

.gtnh-workspace {
  position: relative;      /* 浮窗按这块地方定位 */
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);

  /*
   * 语义色。**跟 /sim/shared.css 那一套同名同色** —— 同一个动作在两个游戏里
   * 应该是同一个颜色（进展黄绿、品质紫、耐久蓝、制作力金），不然从生产模拟器
   * 切过来还得重新认一遍。没有构建步骤，只能照抄这十行。
   */
  --game-gain: #a8cf6b;      /* 进展 */
  --game-quality: #c9a2e8;   /* 品质 */
  --game-budget: #7fb3e8;    /* 耐久 */
  --game-points: #e8c37f;    /* 制作力 */
  --game-ready: #86c9a0;     /* 能做 / 达标 */
  --game-risk: #e8a37f;      /* 快见底 */
  --game-fault: #f5aaa0;     /* 白做 / 缺料 */
  --game-gold: #f0c869;      /* 星级 */
  --game-track: color-mix(in srgb, var(--bg) 55%, var(--surface-2));
  --game-cap: color-mix(in srgb, var(--text) 46%, transparent);
}

.gtnh-error {
  margin-bottom: 16px;
  border: 1px solid #f5aaa0;
  border-radius: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, #f5aaa0 14%, var(--surface));
  color: #f5aaa0;
  font-size: 13px;
  line-height: 1.6;
}

/* Controls use the same typeface as the page, including Chinese text. */
.gtnh-workspace button, .gtnh-workspace input, .gtnh-workspace select { font-family:inherit; }

/* ---------- 页签 ---------- */

.gtnh-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-bottom: 1px solid var(--line);
}

.gtnh-tab {
  min-height: 46px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.gtnh-tab:last-child {
  border-right: 0;
}

.gtnh-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- 面板 ---------- */

.gtnh-panel[hidden] {
  display: none;
}

/* ---------- 顶上那条横幅：最近三次挖到 / 挖穿了什么 ---------- */

/*
 * 高度写死三行 —— 行数一变地图就上下跳，本站「形态稳定」那条规矩要的就是高度别动。
 * 空着的那行留白，不补「—」，免得像出错。
 */
.gtnh-banner {
  display: grid;
  gap: 1px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  min-height: 58px;
  align-content: center;
}

.gtnh-banner-line {
  display: block;
  height: 16px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gtnh-banner-line:first-child {
  color: var(--accent);
}

/* ---------- 顶上那一条 ---------- */

.gtnh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.gtnh-modes {
  display: flex;
  gap: 8px;
}

/* 左上角那两个开关：深度 = 在图上标层号；查看 = 点击改成问，不是挖 */
.gtnh-toggle {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.gtnh-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-2));
  color: var(--text);
}

/* 放弃那一炉：红框，跟「返回」分得开，免得手滑。退出是**保存**的，这个才是放弃。 */
.gtnh-toggle.is-drop {
  border-color: color-mix(in srgb, var(--game-fault) 55%, var(--line));
  background: color-mix(in srgb, var(--game-fault) 12%, var(--surface-2));
  color: var(--game-fault);
}

.gtnh-coord {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.gtnh-bag-title {
  font-size: 13px;
  font-weight: 700;
}

/* ---------- 地图 ---------- */

/* ---------- 冷却线 ---------- */

/* ---------- 地图下面 ---------- */

/* 读数**不许换行** —— 一行变两行就是 22px 的高度跳动，形态稳定优先于写得全 */

/* 现在手上那把工具：一整条横栏 —— 左边图标，右边两行（名字 / 伤害与硬度） */

/* ---------- 背包 ---------- */

.gtnh-bag {
  display: grid;
  grid-template-columns: repeat(var(--bag-cols, 6), 1fr);
  gap: 6px;
  padding: 12px;
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
}

/* 一格：**只画三样** —— 图标、稀有度边框、右下角的数量 */

/* 星级写左上角：三星镐和一星镐长得一模一样的话，玩家分不出来 */

/* ---------- 世界那一栏（种子 + 重开） ---------- */
.gtnh-worldbar,
.gtnh-reset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.gtnh-worldbar #gtnhSeed {
  font-variant-numeric: tabular-nums;
}

/* 确认那一行比上面那行高一点（两行字 + 两个按钮），但只在按了重开之后才出现 */
.gtnh-reset {
  display: grid;
  grid-template-columns: 1fr auto auto;
}

.gtnh-reset span {
  min-width: 0;
}

.gtnh-reset .gtnh-mini {
  min-width: 56px;
  min-height: 34px;
  padding: 0 10px;
}

/* 确认重开那一颗用「险」色 —— 这一页别的按钮都不该长这样 */
.gtnh-mini.is-drop {
  border-color: color-mix(in srgb, var(--game-fault) 55%, var(--line));
  color: var(--game-fault);
}

/* 制作页 / 机器页最下面那一行：左边状态、右边数 */
.gtnh-craftfoot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
}

.gtnh-craftfoot strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 配方笔记（制作页） ----------
 * 照 FF14 的手帐：**收起那一行只有名字和完成情况** —— 翻列表扫得动。
 * 点开才在下面摊出详情：材料（普通/优质）、这一件的数值、垫出来的初始品质。
 * **锁着的收进 <details>** —— 不然配方一多，这一屏就没底了。
 */

.gtnh-recipes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.gtnh-rc {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  overflow: hidden;
}

/* 摊开的那一条：边框亮起来，跟没摊开的一眼分得开 */
.gtnh-rc[data-open="true"] {
  border-color: color-mix(in srgb, var(--game-ready) 55%, var(--line));
}

/* 手上还有一件没做完 —— 别的这一会儿都动不了，灰着（不写一句解释） */
.gtnh-rc[data-blocked="true"] {
  opacity: 0.35;
}

.gtnh-rc[data-locked="true"] {
  border-style: dashed;
  opacity: 0.6;
}

/* 收起那一行：名字 + 完成情况 */

/* 出过优质：写「优质」两个字，用品质色 */

/* ---------- 摊开的那一块 ---------- */

.gtnh-rc-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.gtnh-rc-mats {
  display: grid;
  gap: 6px;
}

/* 材料那一行：点一下优质用量 +1，到头回到 0 */
.gtnh-rc-mat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gtnh-rc-mat:disabled {
  cursor: default;
  opacity: 0.5;
}

.gtnh-rc-mat[data-on="true"] {
  border-color: var(--game-quality);
  background: color-mix(in srgb, var(--game-quality) 14%, var(--surface));
}

.gtnh-rc-mat-hq {
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.gtnh-rc-mat[data-on="true"] .gtnh-rc-mat-hq {
  color: var(--game-quality);
}

/* 这一件的数值，跟打的时候那四条一个颜色 */
.gtnh-rc-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

/* 底下那行数：手法/时长 · 初始品质 · 优质率 —— 调优质用量时它就是反馈 */
.gtnh-rc-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.gtnh-rc-go {
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--game-ready) 60%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--game-ready) 12%, var(--surface));
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.gtnh-rc-go:disabled {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: default;
}

/* 锁着的那些收在 <details> 里 */

.gtnh-locked-group .gtnh-recipes {
  padding: 8px 0 0;
}

/* ---------- 工位那一排四个按钮（机器页每行都用） ---------- */
.gtnh-job-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.gtnh-mini {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.gtnh-mini:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---------- 机器 ---------- */

.gtnh-mach {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
}

.gtnh-mach-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

/* 卡住了（缺料）才让它变红 —— 平时那行是灰的，不抢眼 */

  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 60%, transparent);
  overflow: hidden;
}

  display: block;
  width: 0;
  height: 100%;
  background: var(--game-gain);
}

/* 这台闲着的时候进度条整条是灰的 */
.gtnh-mach[data-idle="true"] .gtnh-mach-bar i {
  background: var(--line);
}

/*
 * 这个工位能跑的配方。**一行一条**，不是小药丸 ——
 * 每条都得摆下「名字 / 吃什么 → 出什么 / 多久」这三样，
 * 药丸那么窄放不下消耗，玩家就只能看到一个名字。
 */

/* 名字最短，不许被挤掉 */

/* 吃什么 → 出什么。这一段是这一行里最要紧的，实在摆不下才让它省略 */

/* ---------- 人物（装备） ----------
 * 跟配方笔记一个路子：收起只有「槽名 + 装着什么 + 给了什么」，
 * 点开才摊出背包里对得上这一格的那几件。
 */

.gtnh-gear {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.gtnh-gear-row {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  overflow: hidden;
}

.gtnh-gear-row[data-open="true"] {
  border-color: color-mix(in srgb, var(--game-points) 55%, var(--line));
}

.gtnh-gear-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  padding: 0 12px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gtnh-gear-slot {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.gtnh-gear-now {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 700;
}

.gtnh-gear-stat {
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--game-points);
}

.gtnh-gear-body {
  display: grid;
  gap: 4px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
}

/* 摊出来的一件：名字 / 它给什么 / 手上有几个 */
.gtnh-gear-pick {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* 正装着的那一件：亮成耐久色 */
.gtnh-gear-pick[data-on="true"] {
  border-color: var(--game-budget);
  background: color-mix(in srgb, var(--game-budget) 14%, var(--surface));
}

.gtnh-gear-name {
  font-size: 12px;
  font-weight: 700;
}

.gtnh-gear-info {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.gtnh-gear-have {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.gtnh-gear-none {
  padding: 6px 2px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 制作中（复杂制作） ---------- */

.gtnh-gauges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
}

.gtnh-gauge {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: var(--surface-2);
}

.gtnh-gauge-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gtnh-gauge-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

/* 轨道底色用 --game-track，填充色**按是哪种资源**上色 —— 跟 /sim/ 一致：
   耐久蓝、制作力金、进展黄绿、品质紫。 */
.gtnh-gauge-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--game-track);
  overflow: hidden;
}

.gtnh-gauge-bar i {
  display: block;
  height: 100%;
  background: var(--muted);
}

.gtnh-gauge[data-id="durability"] .gtnh-gauge-bar i { background: var(--game-budget); }
.gtnh-gauge[data-id="cp"] .gtnh-gauge-bar i { background: var(--game-points); }
.gtnh-gauge[data-id="progress"] .gtnh-gauge-bar i { background: var(--game-gain); }
.gtnh-gauge[data-id="quality"] .gtnh-gauge-bar i { background: var(--game-quality); }

/* 耐久快见底：整条变橙，字也变橙 —— 那是「再推一下就白做」的预警 */
.gtnh-gauge.is-danger .gtnh-gauge-bar i {
  background: var(--game-risk);
}

.gtnh-gauge.is-danger .gtnh-gauge-head small {
  color: var(--game-risk);
}

/* 目标达标了：描边亮起来 */
.gtnh-gauge.is-done {
  border-color: color-mix(in srgb, var(--game-gain) 65%, var(--line));
}

.gtnh-gauge.is-done .gtnh-gauge-head small {
  color: var(--game-gain);
}

/* 技能格：一格一个 */
.gtnh-acts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: 12px;
}

.gtnh-act {
  display: grid;
  gap: 2px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.gtnh-act:disabled {
  opacity: 0.4;
  cursor: default;
}

.gtnh-act strong {
  font-size: 13px;
  font-weight: 700;
}

.gtnh-act small {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* 技能格上每个数按它动的是哪条资源上色，扫一眼就知道这一下花什么、涨什么 */
.gtnh-step[data-res="durability"] { color: var(--game-budget); }
.gtnh-step[data-res="cp"] { color: var(--game-points); }
.gtnh-step[data-res="progress"] { color: var(--game-gain); }
.gtnh-step[data-res="quality"] { color: var(--game-quality); }
/* 这一步要多少游戏分钟 —— 技能格上的第一个数，排产就靠它 */
.gtnh-step[data-res="time"] { color: var(--muted); }
/* 还没解锁：写清几级开 */
.gtnh-step[data-res="locked"] { color: var(--muted); opacity: 0.8; }

.gtnh-runfoot {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
}

/* ---------- 浮窗（点开一格才出现） ---------- */

.gtnh-pop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.gtnh-pop[hidden] {
  display: none;
}

.gtnh-pop-back {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.62);
}

.gtnh-pop-card {
  position: relative;
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.gtnh-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gtnh-pop-icon {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 2px solid var(--rarity, var(--line));
  border-radius: 10px;
  padding: 4px;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--bg));
}

.gtnh-pop-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.gtnh-pop-title {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.gtnh-pop-title strong {
  font-size: 15px;
}

.gtnh-pop-title small {
  color: var(--muted);
  font-size: 12px;
}

.gtnh-pop-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.gtnh-pop-desc {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

.gtnh-pop-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.gtnh-pop-count strong {
  color: var(--text);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.gtnh-notebook-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding: 12px 12px 0; }
.gtnh-notebook-controls label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); flex: 1 1 110px; }
.gtnh-notebook-controls .gtnh-recipe-search { flex: 2 1 230px; }
.gtnh-notebook-controls input, .gtnh-notebook-controls select { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); padding: 10px; font: inherit; }
.gtnh-notebook-controls input:focus-visible, .gtnh-notebook-controls select:focus-visible, .gtnh-note-row button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#gtnhRecipeList { display: grid; grid-template-columns: minmax(190px, 0.85fr) minmax(0, 1.5fr); gap: 18px; align-items: start; }
.gtnh-note-index { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gtnh-note-count { padding: 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.gtnh-note-index ul { list-style: none; margin: 0; padding: 0; max-height: 470px; overflow: auto; }
.gtnh-note-detail { padding: 18px; min-height: 320px; border: 1px solid var(--line); border-radius: 10px; }
.gtnh-note-detail h3 { margin: 0; font-size: 18px; }
.gtnh-note-meta, .gtnh-note-detail p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.gtnh-note-empty { padding: 18px; color: var(--muted); font-size: 13px; }
.gtnh-note-back { margin-bottom: 14px; }
.gtnh-mobile-back { display: none; }
.gtnh-source-link { border: 0; background: transparent; padding: 6px 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
@media (max-width: 620px) {
  #gtnhRecipeList { grid-template-columns: minmax(0, 1fr); }
  #gtnhRecipeList[data-detail="true"] .gtnh-note-index { display: none; }
  #gtnhRecipeList[data-detail="false"] .gtnh-note-detail { display: none; }
  .gtnh-mobile-back { display: inline-block; }
  .gtnh-note-detail { padding: 14px; }
}

/* Compact density: one workspace, lines rather than nested cards. */
.site-main:has(.gtnh-workspace) { padding-block: 20px; }
.gtnh-workspace { border-radius: 6px; box-shadow: none; }
.gtnh-tab { min-height: 36px; }
.gtnh-banner { min-height: 22px; height: 22px; padding: 3px 10px; box-sizing: content-box; display: flex; gap: 18px; align-items: center; background: transparent; }
.gtnh-banner-line { flex: 1; font-weight: 400; }
.gtnh-head { padding: 6px 10px; }
.gtnh-toggle { min-height: 30px; border-radius: 3px; padding: 5px 10px; }
.gtnh-notebook-controls { gap: 6px; padding: 8px 10px; margin: 0; border-bottom: 1px solid var(--line); }
.gtnh-notebook-controls label { gap: 0; flex: 1 1 96px; }
.gtnh-notebook-controls .gtnh-recipe-search { flex: 2 1 180px; }
.gtnh-notebook-controls input, .gtnh-notebook-controls select { padding: 6px 8px; height: 32px; border-radius: 3px; }
.gtnh-control-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#gtnhRecipeList { padding: 0; gap: 0; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.6fr); }
.gtnh-note-index { border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.gtnh-note-count { padding: 6px 10px; border: 0; }
.gtnh-note-index ul { max-height: 350px; }
.gtnh-note-detail { padding: 10px 14px; min-height: 0; border: 0; border-radius: 0; }
.gtnh-note-detail h3 { font-size: 15px; }
.gtnh-note-meta { margin: 4px 0 8px; }
.gtnh-rc-body { padding: 0; border: 0; gap: 8px; }
.gtnh-rc-mats { gap: 0; }
.gtnh-material-row { display: grid; grid-template-columns: minmax(60px, 1fr) auto auto; align-items: center; gap: 10px; min-height: 34px; border-bottom: 1px solid var(--line); }
.gtnh-material-name { padding: 4px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.gtnh-material-name:hover { color: var(--accent); }
.gtnh-material-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gtnh-material-row .gtnh-rc-mat { min-height: 28px; width: auto; padding: 2px 6px; border: 0; border-radius: 2px; background: transparent; }
.gtnh-material-row .gtnh-rc-mat:disabled { opacity: .65; }
.gtnh-rc-go { min-height: 32px; border-radius: 3px; }
.gtnh-gear { gap: 0; padding: 0 10px; }
.gtnh-gear-row, .gtnh-gear-row[data-open="true"] { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.gtnh-gear-head { min-height: 36px; padding: 4px 0; grid-template-columns: 42px 1fr auto; }
.gtnh-gear-body { padding: 4px 0 8px 42px; border: 0; gap: 0; }
.gtnh-gear-pick { min-height: 30px; padding: 4px 6px; border: 0; border-radius: 0; background: none; }
.gtnh-mach { border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: none; }
@media (max-width: 620px) {
  .site-main:has(.gtnh-workspace) { padding-block: 12px; }
  .gtnh-notebook-controls .gtnh-recipe-search { flex-basis: 100%; }
  .gtnh-notebook-controls label { flex-basis: 90px; }
  .gtnh-notebook-controls:not([data-expanded="true"]) label:nth-of-type(4), .gtnh-notebook-controls:not([data-expanded="true"]) label:nth-of-type(5) { display: none; }
  #gtnhMoreFilters { display: block; font-size: 11px; padding: 4px 6px; min-height: 36px; }
  .gtnh-notebook-controls input, .gtnh-notebook-controls select { height: 36px; }
  #gtnhRecipeList { grid-template-columns: minmax(0, 1fr); }
  .gtnh-note-index { border-right: 0; }
  .gtnh-note-detail { padding: 10px; }
  .gtnh-note-row button { min-height: 44px; }
  .gtnh-material-row { gap: 5px; grid-template-columns: minmax(55px, 1fr) auto; padding: 4px 0; }
  .gtnh-material-count { grid-column: 1; grid-row: 2; }
  .gtnh-material-row .gtnh-rc-mat { grid-column: 2; grid-row: 1 / 3; min-height: 40px; }
  .gtnh-gear-head { min-height: 44px; gap: 6px; }
  .gtnh-gear-stat { font-size: 11px; }
  .gtnh-gear-pick { min-height: 40px; }
  .gtnh-banner { gap: 8px; }
  .gtnh-banner-line:not(:first-child) { display: none; }
}

:root[data-theme="light"] .gtnh-workspace {
  --game-gain: #466f24;
  --game-quality: #70449a;
  --game-budget: #2e628e;
  --game-points: #785625;
  --game-ready: #356c48;
  --game-risk: #99562c;
  --game-fault: #a53d36;
  --game-gold: #80600c;
}
.gtnh-miner-buttons .gtnh-mini { min-height: 36px; }
@media (max-width: 620px) { .gtnh-miner-buttons .gtnh-mini { min-height: 40px; } }
.gtnh-mach { min-width: 0; }


.gtnh-tabs { grid-auto-flow:row;grid-template-columns:repeat(7,minmax(0,1fr)); }
.gtnh-machine-filter { display:flex;align-items:center;gap:8px;padding:6px 10px;border-bottom:1px solid var(--line);font-size:12px; }
.gtnh-machine-filter span { margin-left:auto;color:var(--muted); }
.gtnh-machine-filter select,.gtnh-generator-row select { background:var(--surface);color:var(--text);border:1px solid var(--line);min-height:32px; }
.gtnh-machine-layout { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr); }
.gtnh-machine-detail { min-width:0;border-left:1px solid var(--line);padding-top:6px; }.gtnh-machine-detail > button { margin:0 10px 6px; }
.gtnh-machine-recipes { display:grid;gap:4px;max-height:300px;overflow:auto; }
.gtnh-power-summary,.gtnh-power-note { margin:0;padding:10px;font-size:12px;line-height:1.6;color:var(--muted); }
@media(max-width:620px){.gtnh-machine-layout{display:block}.gtnh-machine-detail{border-left:0}.gtnh-panel[data-detail="true"] .gtnh-machine-list{display:none}.gtnh-tab{padding-left:3px;padding-right:3px}.gtnh-machine-detail[hidden]{display:none}}

.gtnh-panel[data-detail="false"] .gtnh-machine-layout { grid-template-columns:minmax(0,1fr); }
.gtnh-section-head { display:flex;align-items:center;gap:8px;min-height:40px;padding:6px 10px;border-bottom:1px solid var(--line);font-size:13px;box-sizing:border-box; }
.gtnh-section-head > strong { font-weight:600;white-space:nowrap; }
.gtnh-section-head > .gtnh-mini:last-child { margin-left:auto;white-space:nowrap; }
.gtnh-header-status { color:var(--muted);font-size:12px;white-space:nowrap; }
.gtnh-section-head label { margin-left:auto;font-size:12px;white-space:nowrap; }
.gtnh-section-head input { width:44px;min-height:28px;background:var(--surface);color:var(--text);border:1px solid var(--line); }
.gtnh-section-head label + .gtnh-mini:last-child { margin-left:0; }
.gtnh-home-space .gtnh-section-head { border-bottom:0; }
/* 家园那两串列表改成图标方格之后，这一组就只剩机器页的设施管理行在用了。 */
.gtnh-facility-management { display:flex;align-items:center;gap:8px;padding:9px 10px;border-bottom:1px solid var(--line);font-size:12px; }
.gtnh-facility-management > span { flex:1;min-width:0; }
.gtnh-machine-filter { flex-wrap:wrap; }
@media(max-width:620px) { .gtnh-home-spaces { grid-template-columns:1fr; }.gtnh-home-space { border-right:0;border-bottom:1px solid var(--line); }.gtnh-tabs { grid-template-columns:repeat(7,minmax(0,1fr)); }.gtnh-tab { min-width:0;font-size:12px;padding-inline:2px; } }
/* Compact material condition indicator; text remains readable without color. */
.gtnh-condition { display:inline-flex; align-items:center; gap:6px; font-size:12px; white-space:nowrap; color:var(--muted); }
.gtnh-condition::before { content:""; width:12px; height:12px; flex:none; border-radius:50%; background:#b8c0ca; box-shadow:inset -2px -2px 3px #0005; }
.gtnh-condition[data-condition="good"]::before { background:#df835d; }
.gtnh-condition[data-condition="excellent"]::before { background:linear-gradient(135deg,#ffd97c,#81d8b8,#ba99ee); }
.gtnh-condition[data-condition="poor"]::before { background:#a383ca; }

/* Recipe names and materials get separate rows so names cannot squeeze out controls. */
.gtnh-machine-recipes, .gtnh-recipe-search-label, .gtnh-mach-picks { min-width:0; width:100%; box-sizing:border-box; }
.gtnh-machine-recipes .gtnh-mach-pick { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:3px 8px; align-items:start; padding:6px 8px; min-height:44px; border-radius:3px; box-sizing:border-box; }
.gtnh-machine-recipes .gtnh-mach-pick strong { grid-column:1; min-width:0; white-space:normal; overflow-wrap:anywhere; line-height:1.35; }
.gtnh-machine-recipes .gtnh-mach-pick small { grid-column:2; grid-row:1; white-space:nowrap; font-size:11px; color:var(--muted); }
.gtnh-machine-recipes .gtnh-mach-pickio { grid-column:1 / -1; grid-row:2; white-space:normal; overflow-wrap:anywhere; line-height:1.4; font-size:11px; }
.gtnh-material-name, .gtnh-miner-info, #gtnhRunRecipe { min-width:0; overflow-wrap:anywhere; }
#gtnhCraftRun > .gtnh-head { flex-wrap:wrap; }
#gtnhRunRecipe { flex:1 1 90px; white-space:normal; }

#gtnhRunCondition[data-condition="steady"] { color: #e7a344; border-color: #bb7930; }
.gtnh-gauge[data-id="heat"] { grid-column: 1 / -1; }
.gtnh-gauge[data-id="heat"] .gtnh-gauge-bar i { background: #db8a35; }

/* Compact skill picker; unavailable skills remain inspectable. */
.gtnh-acts { display:block; padding:10px 12px; }
.gtnh-skill-grid { display:grid; grid-template-columns:repeat(auto-fill,48px); gap:6px; }
.gtnh-skill { width:48px; height:48px; padding:4px 2px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:1px solid var(--line); border-radius:4px; background:var(--surface-2); color:var(--muted); cursor:pointer; position:relative; }
.gtnh-skill-icon { display:block; width:24px; height:24px; background:currentColor; mask:var(--skill-icon) center/contain no-repeat; -webkit-mask:var(--skill-icon) center/contain no-repeat; opacity:.4; }
.gtnh-skill-name { font-size:10px; line-height:12px; white-space:nowrap; }
.gtnh-skill.is-ready { color:var(--text); }
.gtnh-skill.is-ready .gtnh-skill-icon { opacity:1; }
.gtnh-skill.is-condition { border-color:#d9b453; color:#d9b453; }
.gtnh-skill.is-thermal { border-color:#ed9954; color:#ed9954; }
.gtnh-skill[aria-pressed="true"] { background:var(--surface); }
.gtnh-skill[aria-pressed="true"]::after { content:""; position:absolute; bottom:0; left:10px; right:10px; height:3px; background:var(--text); }
.gtnh-skill:focus-visible,.gtnh-skill-use:focus-visible { outline:2px solid var(--text); outline-offset:2px; }
.gtnh-skill-detail { margin-top:10px; padding-top:8px; border-top:1px solid var(--line); min-height:108px; font-size:12px; }
.gtnh-skill-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.gtnh-skill-detail p { margin:5px 0; color:var(--muted); line-height:1.5; }
.gtnh-skill-effects { display:flex; flex-wrap:wrap; gap:4px 12px; font-variant-numeric:tabular-nums; }
.gtnh-skill-use { padding:5px 18px; border:1px solid var(--line); border-radius:4px; background:var(--surface-2); color:var(--text); cursor:pointer; }
.gtnh-skill-use:disabled { opacity:.4; cursor:default; }
.gtnh-skill-section + .gtnh-skill-section { margin-top:10px; }
.gtnh-skill-section h3 { margin:0 0 5px; font-size:11px; font-weight:500; color:var(--muted); }
.gtnh-skill-section[data-skill-group="thermal"] h3 { color:#ed9954; }
.gtnh-skill.is-combo { border-color:#72b6ee; color:#72b6ee; }

/* 种植与设施用「图标方格 + 选中看详情」，跟制作页的技能格同一形态：
   一个 48 方的格子 = 一样东西，一排能放六七个，比一行一个省得多。
   成熟/已放置亮着，生长中/已收纳暗着；选中靠底下那道色条。 */
.gtnh-unit { width:48px; height:48px; padding:4px 2px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border:1px solid var(--line); border-radius:4px; background:var(--surface-2); color:var(--muted); cursor:pointer; position:relative; }
.gtnh-unit.is-ready { color:var(--text); }
.gtnh-unit.is-ready .gtnh-unit-icon { opacity:1; }
.gtnh-unit.is-done { color:var(--game-ready); }
.gtnh-unit.is-done .gtnh-unit-icon { opacity:1; }
.gtnh-unit[aria-pressed="true"] { background:var(--surface); }
.gtnh-unit[aria-pressed="true"]::after { content:""; position:absolute; bottom:0; left:10px; right:10px; height:3px; background:var(--text); }
.gtnh-unit:focus-visible { outline:2px solid var(--text); outline-offset:2px; }
.gtnh-unit-actions { display:flex; gap:8px; flex-shrink:0; }

/* ---------------- 配方列表：图标格 ----------------
 * 一格一个配方（图标 + 名字），跟制作技能那边一个尺寸。
 * 收起时不写材料，点开才在下面摊详情。
 */
.gtnh-note-index ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; padding: 8px; margin: 0; list-style: none; }
.gtnh-rc-line { margin: 0 0 4px; font-size: 13px; line-height: 1.6; }


/* ---------------- 工位：跟制作页「技能」同一套排布 ---------------- */
  border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; background: var(--surface); color: inherit;
  font: inherit; cursor: pointer;

  text-align: center; border: 1px solid var(--line); border-radius: 11px; padding: 8px 6px; background: var(--surface);
  color: inherit; font: inherit; cursor: pointer; }

  border-radius: 10px; background: rgba(128,128,128,.10); color: inherit; cursor: pointer; overflow: hidden; }
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 机器页：工位图标格 ----------------
 * 照家园那套：48×48 圆角方块里只有图标，**名字在方块外面**（下面一行）。
 * 点一格 → 下面展开这台机器现在的状况。
 */
.gtnh-machine-layout { display: block; }
.gtnh-stage { position: relative; display: block; width: 48px; height: 48px; padding: 5px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(128,128,128,.10); color: inherit; cursor: pointer; }
.gtnh-stage-cell[data-idle="true"] .gtnh-stage { background: rgba(120,200,140,.22); border-color: rgba(120,200,140,.5); }
.gtnh-stage-cell[data-lack="true"] .gtnh-stage { background: rgba(208,139,91,.20); border-color: rgba(208,139,91,.5); }
.gtnh-stage:hover, .gtnh-stage-cell[data-open="true"] .gtnh-stage { border-color: var(--accent, #c2410c); }
.gtnh-stage-bar { position: absolute; left: 5px; right: 5px; bottom: 3px; height: 2px; border-radius: 1px; background: rgba(0,0,0,.16); overflow: hidden; }
.gtnh-stage-bar b { display: block; height: 100%; background: var(--accent, #c2410c); transition: width .3s linear; }
/* 名字在方块外面 */
.gtnh-machine-detail { margin: 4px 12px 12px; }

/* 工位沿用制作页技能按钮（.gtnh-skill / .gtnh-skill-grid），只补：内联 SVG + 格底进度条 */
#gtnhMachList .gtnh-skill-icon svg { width: 100%; height: 100%; display: block; }
#gtnhMachList { position: relative; }
#gtnhMachList .gtnh-skill { position: relative; }
#gtnhMachList .gtnh-stage-bar { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 2px; border-radius: 1px; background: rgba(0,0,0,.18); overflow: hidden; }
#gtnhMachList .gtnh-stage-bar b { display: block; height: 100%; background: var(--accent, #c2410c); transition: width .3s linear; }
.gtnh-machine-layout { display: block; }
.gtnh-machine-detail { margin: 4px 12px 12px; }

/* 机器格是 <ul>：清掉 ul 自带的内边距与圆点，否则第一格会缩进 */
#gtnhMachList { margin: 0; padding: 12px; list-style: none; grid-template-columns: repeat(auto-fill, 62px); gap: 10px; justify-content: center; }
#gtnhMachList > li { margin: 0; padding: 0; list-style: none; }
/* 配方详情：标题行照技能那一套（左标题、右动作） */
.gtnh-note-detail .gtnh-skill-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.gtnh-note-detail .gtnh-skill-heading > strong, .gtnh-note-detail .gtnh-skill-heading h3 { font-size: 15px; font-weight: 600; margin: 0; }

/* 种植页只放农田：设施与空间条已搬到机器页 */
#gtnhPanelHome [hidden] { display: none !important; }

/* 配方格跟机器页/制作技能一致：图标 + 名字，<ul> 不缩进 */
.gtnh-note-index .gtnh-skill-grid { margin: 0; padding: 12px; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, 56px); justify-content: start; gap: 10px; }
.gtnh-note-index .gtnh-skill-cell { margin: 0; padding: 0; list-style: none; }
.gtnh-note-index .gtnh-skill { width: 56px; height: 56px; }
.gtnh-note-index .gtnh-skill-icon svg { width: 100%; height: 100%; display: block; }

.gtnh-note-index .gtnh-skill-icon { width: 32px; height: 32px; }

/* 分类：FF14 那种"职业"按钮条，不用下拉 */
.gtnh-cat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
.gtnh-cat-chip { font: inherit; font-size: 12px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.gtnh-cat-chip[aria-selected="true"], .gtnh-cat-chip[aria-pressed="true"] { background: var(--accent, #c2410c); border-color: var(--accent, #c2410c); color: #fff; }
.gtnh-notebook-controls select, .gtnh-notebook-controls .gtnh-control-label { display: none; }
.gtnh-notebook-controls .gtnh-recipe-search, .gtnh-notebook-controls > label:first-child { display: block; }

/* 配方格：所在格子里居中，整行均分不留右侧空档 */
.gtnh-note-index .gtnh-skill-cell { justify-self: center; text-align: center; }
.gtnh-note-index .gtnh-skill { width: 48px; height: 48px; }
.gtnh-note-index .gtnh-skill-name { max-width: 100%; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 状态矩阵：一个 data-state 管两个列表 ----------------
   ！只用颜色不够，角标是兜底（色弱 / 小屏）
   覆盖顺序：不可用 > 缺料/缺电 > 忙 > 空闲
   描边只表达忙闲，不被别的状态抢 */
.gtnh-skill { position: relative; }
/* 不可用 / 已收纳：灰、图标压暗 */
.gtnh-skill[data-state="locked"], .gtnh-skill[data-state="stored"] { background: rgba(128,128,128,.10); }
.gtnh-skill[data-state="locked"] .gtnh-skill-icon, .gtnh-skill[data-state="stored"] .gtnh-skill-icon { opacity: .38; }
.gtnh-skill[data-state="locked"] .gtnh-skill-name, .gtnh-skill[data-state="stored"] .gtnh-skill-name { color: var(--muted); }
/* 缺料 / 缺电：暖橙底 + 角标 */
.gtnh-skill[data-state="short"] { background: rgba(208,139,91,.20); border-color: rgba(208,139,91,.5); }
/* 空闲：淡绿底 */
.gtnh-skill[data-state="idle"] { background: rgba(120,200,140,.20); border-color: rgba(120,200,140,.45); }
/* 暂停：虚线 */
.gtnh-skill[data-state="paused"] { border-style: dashed; border-color: rgba(128,128,128,.6); background: rgba(128,128,128,.10); }
/* 可用：白/正常 + ✓ */
/* 在忙：实线橙描边（其余状态不许抢描边） */
.gtnh-skill[data-state="busy"] { border: 2px solid var(--accent, #c2410c); }


/* 进度：回到原来那条细线（格子底部） */
.gtnh-skill { position: relative; }
.gtnh-stage-bar { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 2px; border-radius: 1px; background: rgba(0,0,0,.16); overflow: hidden; }
.gtnh-stage-bar b { display: block; height: 100%; background: var(--accent, #c2410c); transition: width .3s linear; }
/* 忙 = 实线橙描边（环去掉了，描边保留） */
.gtnh-skill[data-state="busy"] { border: 2px solid var(--accent, #c2410c); }

/* 能点开的来源 / 材料链接：加下划线，看出是可点的 */
/* 只有真能点的材料名才加下划线（优质那个是可调数量，不是链接） */
.gtnh-source-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.gtnh-note-detail .gtnh-rc-mat { text-decoration: none; }

/* 名字在方块外面（下面），字号够大、不省略成看不清 */
.gtnh-skill-cell { text-align: center; }
.gtnh-skill-cell .gtnh-skill-name { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.3;
  color: var(--text); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtnh-skill-cell .gtnh-skill { position: relative; margin: 0 auto; }
/* 方块里只剩图标，居中 */
.gtnh-skill-cell .gtnh-skill-icon { display: block; margin: 0 auto; }

/* 只有真能点的材料名才有下划线 */
.gtnh-material-name, .gtnh-source-link { text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.gtnh-rc-mat, .gtnh-note-detail .gtnh-rc-mat { text-decoration: none; }

#gtnhRecipeList .gtnh-material-name, #gtnhRecipeList .gtnh-source-link {
  text-decoration: underline !important; text-underline-offset: 2px; cursor: pointer;
}
#gtnhRecipeList .gtnh-rc-mat { text-decoration: none !important; }

/* ---------------- 状态底色要"能看出来" ----------------
   可用 = 明显的绿底 + 绿描边（不是半白）；缺料 = 暖橙；不可用 = 灰 */
.gtnh-skill[data-state="ready"] {
  background: rgba(86, 170, 110, .30);
  border-color: rgba(70, 150, 95, .70);
}
.gtnh-skill[data-state="ready"] .gtnh-skill-icon { opacity: 1; }
.gtnh-skill[data-state="ready"] .gtnh-skill-name { color: var(--text); font-weight: 600; }
.gtnh-skill[data-state="short"] {
  background: rgba(208, 139, 91, .30);
  border-color: rgba(196, 112, 58, .70);
}
.gtnh-skill[data-state="short"] .gtnh-skill-icon { opacity: .55; }
.gtnh-skill[data-state="locked"] {
  background: rgba(128, 128, 128, .12);
  border-color: rgba(128, 128, 128, .3);
}
.gtnh-skill[data-state="locked"] .gtnh-skill-icon { opacity: .32; }
.gtnh-skill[data-state="locked"] .gtnh-skill-name { color: var(--muted); }

/* 制作按钮分裂成三块：测试制作 / 制作 / 挂机制作 */
.gtnh-rc-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.gtnh-rc-btns .gtnh-rc-go { flex: 1 1 0; min-width: 96px; }



/* 次数分段控件 */
.gtnh-rc-times { display: flex; align-items: center; gap: 6px; padding: 8px 0 6px; flex-wrap: wrap; }
.gtnh-rc-times > span { font-size: 11px; color: var(--muted); margin-right: 2px; }
.gtnh-rc-count { font: inherit; font-size: 12px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.gtnh-rc-count[aria-pressed="true"] { background: var(--accent, #c2410c); border-color: var(--accent, #c2410c); color: #fff; }
.gtnh-rc-count:disabled { opacity: .35; cursor: default; }
.gtnh-rc-btns { display: flex; gap: 6px; }
.gtnh-rc-btns .gtnh-rc-go { flex: 1 1 0; }
.gtnh-rc-btns .gtnh-rc-go.is-test { flex: 0 0 33%; }

.gtnh-rc-doing { display: block; margin: 4px 0 0; font-size: 11px; color: var(--accent, #c2410c); font-weight: 600; }

.gtnh-rc-btns .gtnh-rc-go.is-hang { border-style: dashed; }

/* 三个按钮边框一致 */
.gtnh-rc-btns .gtnh-rc-go, .gtnh-rc-btns .gtnh-rc-go.is-hang, .gtnh-rc-btns .gtnh-rc-go.is-test { border-style: solid; opacity: 1; }

/* 材料行：不够的那一项标红，并写出缺几个 */
.gtnh-material-count.is-lack { color: #b4643a; font-weight: 600; }

/* 机器详情里的配方选择：跟制作页同一套 48px 图标格 */
.gtnh-mach-picker .gtnh-skill { width: 48px; height: 48px; }
.gtnh-mach-picker .gtnh-skill-icon svg { width: 100%; height: 100%; display: block; }

/* 地图经验：等级 + 进度条 + 三个加成 */

/* 机器格：稍微放大，长名字不至于溢出 */
#gtnhMachList .gtnh-skill { width: 62px; height: 62px; }
#gtnhMachList .gtnh-skill-icon { width: 34px; height: 34px; }
#gtnhMachList .gtnh-skill-name { max-width: 62px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 名字超长：缩字号，不省略号 */
#gtnhMachList .gtnh-skill-name,
.gtnh-note-index .gtnh-skill-name { overflow: hidden; text-overflow: clip; white-space: nowrap; }

/* 人物页：三个域的标题行（采集 / 生产 / 战斗） */
.gtnh-gear-domain { padding: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.gtnh-gear-domain:first-child { padding-top: 2px; }
/* 制作页：配方详情里的「可用设备」—— 与设备页同一套图标格，多一行状态 */
.gtnh-craft-equipment { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.gtnh-craft-equipment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
.gtnh-craft-equipment-head strong { font-size: 12px; color: var(--text); }
.gtnh-equip-grid { display: grid; grid-template-columns: repeat(auto-fill, 64px); gap: 6px; }
.gtnh-equip-tile { width: 64px; height: auto; min-height: 68px; padding: 5px 3px; gap: 2px; }
.gtnh-equip-tile .gtnh-skill-name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.gtnh-equip-state { font-size: 9px; line-height: 1.1; color: var(--muted); white-space: nowrap; }
.gtnh-equip-tile[data-state="idle"] .gtnh-equip-state { color: #8fd0a0; }
.gtnh-equip-tile[data-state="busy"] .gtnh-equip-state { color: var(--accent, #e6c48a); }
.gtnh-equip-tile:disabled { opacity: .55; cursor: default; }
.gtnh-equip-empty { margin: 0; padding: 6px 0; font-size: 11px; color: var(--muted); }
/* 选中用蓝色外圈；在忙用橙色实线边框，两者可同时出现，不互相顶掉 */
.gtnh-equip-tile[aria-pressed="true"] { outline: 2px solid #7fb3e8; outline-offset: 1px; background: color-mix(in srgb, #7fb3e8 12%, var(--surface-2)); }
.gtnh-equip-tile[aria-pressed="true"] .gtnh-skill-name { color: var(--text); }.gtnh-equip-rate { position: absolute; top: 2px; right: 4px; font-size: 8px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Inventory and generators use the same 62px icon grid as the machine overview. */
.gtnh-device-grid { margin:0;padding:12px;list-style:none;grid-template-columns:repeat(auto-fill,62px);gap:10px;justify-content:center; }
.gtnh-device-grid .gtnh-skill { width:62px;height:62px; }
.gtnh-device-grid .gtnh-skill-icon { width:34px;height:34px; }
.gtnh-device-grid .gtnh-skill-icon svg { width:100%;height:100%;display:block; }
.gtnh-device-grid .gtnh-skill-name { max-width:62px;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.gtnh-inventory-count { position:absolute;right:2px;top:1px;font-size:10px;line-height:1.2;font-style:normal;font-variant-numeric:tabular-nums;background:var(--surface);color:var(--text);padding:1px 2px;border-radius:2px;max-width:100%;overflow:hidden; }
#gtnhGeneratorDetail { margin:4px 12px 12px; }
.gtnh-generator-controls { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px; }
.gtnh-generator-controls label { display:flex;align-items:center;gap:6px;font-size:12px; }
.gtnh-generator-controls select { min-height:28px;background:var(--surface);color:var(--text);border:1px solid var(--line);font:inherit; }

#gtnhBagGrid .gtnh-item-quality { position:absolute;left:2px;top:1px;font-size:10px;line-height:1.2;font-style:normal;color:var(--game-gold);background:var(--surface);padding:1px 2px;border-radius:2px; }
#gtnhBagGrid .gtnh-inventory-count { max-width:calc(100% - 20px); }
#gtnhBattleDetail { margin:0 10px; }
#gtnhBattleDetail .gtnh-skill-heading { flex-wrap:wrap; }
.gtnh-battle-log { margin:0;padding:8px 28px;max-height:180px;overflow:auto;border-top:1px solid var(--line);font-size:12px;line-height:1.6; }

/* A fixed two-line, scrollable notification history. */
#gtnhBanner { display:block;height:44px;min-height:44px;max-height:44px;padding:1px 10px;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin; }
#gtnhBanner .gtnh-banner-line { display:block;flex:none;margin:0;height:20px;min-height:20px;line-height:20px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.gtnh-skill-section[data-skill-group^="profession-"] h3 { color:#ed9954; }

/* Current state first, followed by a vertical five-state preview; names only. */
#gtnhRunCondition { display:grid;grid-template-columns:repeat(3,auto);align-items:center;justify-content:start;gap:3px 6px;font-size:11px;line-height:1.2;min-width:108px;flex:0 0 auto; }
#gtnhRunCondition::before { display:none; }
#gtnhRunCondition > span { display:flex;align-items:center;gap:5px; }
#gtnhRunCondition > span::before { content:'';width:9px;height:9px;border-radius:50%;background:#b8c0ca;flex:none; }
#gtnhRunCondition[data-condition='good'] .gtnh-condition-current::before,
#gtnhRunCondition [data-condition='good']::before { background:#df835d; }
#gtnhRunCondition[data-condition='excellent'] .gtnh-condition-current::before,
#gtnhRunCondition [data-condition='excellent']::before { background:linear-gradient(135deg,#ffd97c,#81d8b8,#ba99ee); }
#gtnhRunCondition[data-condition='poor'] .gtnh-condition-current::before,
#gtnhRunCondition [data-condition='poor']::before { background:#a383ca; }
#gtnhRunCondition[data-condition='steady'] .gtnh-condition-current::before,
#gtnhRunCondition [data-condition='steady']::before { background:#e7a344; }
.gtnh-condition-current { font-weight:600; }
.gtnh-condition-next { color:var(--muted); }

/* Per-unit numbers live in the same corner as inventory quantities. */
.gtnh-corner-index { position:absolute;top:1px;right:2px;z-index:1;font-size:10px;line-height:1.2;font-style:normal;font-variant-numeric:tabular-nums;color:var(--text);background:var(--surface);border-radius:2px;padding:1px 2px; }
.gtnh-skill > .gtnh-item-quality { position:absolute;top:1px;left:2px;font-size:10px;line-height:1.2;font-style:normal;color:var(--game-gold);background:var(--surface);border-radius:2px;padding:1px 2px; }

.gtnh-device-grid > .gtnh-power-note { grid-column:1 / -1; }
.gtnh-equip-tile .gtnh-equip-rate { top:14px;right:2px; }

/* Profession gauges share the compact crafting resource column. */
.gtnh-artisan{grid-column:1/-1;min-width:0;padding:5px 0;border-top:1px solid var(--line)}
.gtnh-artisan .gtnh-gauge-head{display:flex;justify-content:space-between;gap:8px;font-weight:600}
.gtnh-artisan small{font-size:11px;font-weight:400}
.gtnh-artisan p{margin:5px 0 0;font-size:11px;line-height:1.5;color:var(--muted)}
.gtnh-artisan-track,.gtnh-concentration{height:8px;background:var(--game-track);margin:7px 2px;position:relative;border-radius:2px}
.gtnh-artisan-track>i{display:block;height:100%;background:#a78855;border-radius:2px}
.gtnh-concentration>i{position:absolute;top:0;height:100%;width:10%}
.gtnh-concentration .is-green{left:10%;background:#68a878}.gtnh-concentration .is-blue{left:80%;background:#639bc8}
.gtnh-concentration>b{position:absolute;top:-3px;height:14px;width:2px;background:var(--text);transform:translateX(-50%)}
.gtnh-artisan-slots{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin-top:5px}
.gtnh-artisan-slots>span{min-width:0;min-height:35px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--text);background:var(--surface-2);border-bottom:2px solid var(--line);font-size:13px}
.gtnh-artisan-slots.is-stitches{grid-template-columns:repeat(6,minmax(0,1fr))}
.gtnh-artisan-slots .is-match{border-color:#599365;background:color-mix(in srgb,#599365 20%,var(--surface))}.gtnh-artisan-slots .is-mismatch{border-color:#be7667;background:color-mix(in srgb,#be7667 20%,var(--surface))}
[data-effect="red"]{color:#a6493e!important;background:#f5e3df!important}[data-effect="blue"]{color:#356a9a!important;background:#e2edf7!important}
[data-effect="green"]{color:#407545!important;background:#e4efe1!important}[data-effect="yellow"]{color:#89631f!important;background:#f4ebd2!important}

/* Exploration: compact controls and ten discoveries, no terrain canvas. */
.gtnh-explore-controls,.gtnh-explore-actions,.gtnh-target-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 10px}.gtnh-explore-controls label,.gtnh-target-actions label{display:flex;align-items:center;gap:4px;font-size:12px}
.gtnh-explore-controls select,.gtnh-target-actions select{min-width:0;max-width:100%;font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--line);padding:4px;border-radius:3px}
.gtnh-explore-controls input{margin:0}.gtnh-explore-actions>span{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.gtnh-explore-track{height:3px;margin:0 10px;background:var(--line)}.gtnh-explore-track i{display:block;height:100%;background:var(--accent);transition:width .2s}
.gtnh-explore-journal{border-top:1px solid var(--line);padding:8px 10px;font-size:12px}.gtnh-explore-journal summary{cursor:pointer;color:var(--muted)}
.gtnh-explore-journal ol{margin:8px 0 0;padding-left:22px;line-height:1.8;color:var(--muted)}
.gtnh-target-stock{position:absolute;bottom:15px;right:2px;background:var(--surface);color:var(--text);font-size:9px;font-style:normal;padding:0 2px}
.gtnh-event-symbol{font-size:28px;color:var(--game-gold)}
#gtnhExploreFindings,#gtnhLumberFindings,#gtnhMineFindings{padding:10px;min-width:0;margin:0}
#gtnhExploreDetail,#gtnhLumberDetail,#gtnhMineDetail{border-top:1px solid var(--line);margin:0;padding:10px}
@media(max-width:480px){.gtnh-tabs .gtnh-tab{font-size:11px;padding:8px 3px}.gtnh-explore-controls{gap:6px}.gtnh-explore-controls select{max-width:110px}.gtnh-header-status{font-size:10px}.gtnh-target-actions select{max-width:180px}}

.gtnh-tabs{grid-template-columns:repeat(8,minmax(0,1fr))}

.gtnh-location-progress{padding:8px 10px;border-bottom:1px solid var(--line);font-size:12px}
.gtnh-location-progress>div:first-child{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}
.gtnh-location-progress .gtnh-explore-track{margin:6px 0}.gtnh-location-progress p{margin:0;color:var(--muted);font-size:11px}
.gtnh-finding-stars{position:absolute;left:2px;top:0;color:var(--game-gold);font-size:10px;font-style:normal;text-shadow:0 0 4px var(--surface)}
.gtnh-finding-size{position:absolute;left:2px;bottom:15px;color:var(--text);background:var(--surface);font-size:9px;font-style:normal;padding:0 2px}
/* Active discovery targets stay bright even when their detail is not selected. */
.gtnh-skill[data-find][data-state="busy"]{color:var(--text);background:color-mix(in srgb,var(--accent,#c2410c) 18%,var(--surface));border-color:var(--accent,#c2410c);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent,#c2410c) 35%,transparent)}
.gtnh-skill[data-find][data-state="busy"] .gtnh-skill-icon{opacity:1}
.gtnh-skill[data-find][data-state="busy"] .gtnh-skill-name{font-weight:600}
.gtnh-skill[data-find][data-state="idle"]{background:var(--surface-2);border-color:var(--line)}
.gtnh-gather-order{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}

/* Fixed-camera island, driven by the simulation's remaining time. */
@keyframes gtnh-drift{to{transform:translateX(9px)}}
@keyframes gtnh-spark{to{opacity:.25}}
@media(max-width:480px){#gtnhSceneArt svg{min-height:184px}.gtnh-scene-caption{inset:8px 9px auto;font-size:10px}.gtnh-scene-result{font-size:10px}}
@media(prefers-reduced-motion:reduce){.gtnh-explore-scene *{animation:none!important}}

/* Discovered resources occupy persistent tiles; each gatherer follows its own queue. */
@keyframes gtnh-resource-hit{0%,85%,100%{transform:translateX(0)}90%{transform:translateX(-1px)}95%{transform:translateX(1px)}}
@media(max-width:480px){#gtnhSceneArt svg{min-height:220px}}

/* Feedback follows actual gathering hits and combat turns. */
@keyframes gtnh-slime{50%{transform:scale(1.08,.88) translateY(1px)}}
@keyframes gtnh-snuffle{50%{transform:rotate(-3deg) translateY(-1px)}}
@keyframes gtnh-flutter{50%{transform:translateY(-3px) scaleX(.88)}}
@keyframes gtnh-breathe{50%{transform:translateY(1px)}}
@keyframes gtnh-impact{from{opacity:1;transform:scale(.35)}to{opacity:0;transform:scale(1.5)}}
@keyframes gtnh-float{0%{opacity:0;transform:translateY(4px) scale(.7)}15%{opacity:1;transform:translateY(0) scale(1.08)}70%{opacity:1}100%{opacity:0;transform:translateY(-19px) scale(1)}}
@keyframes gtnh-poof{0%{opacity:.8;transform:scale(.4)}100%{opacity:0;transform:scale(1.8) translateY(-6px)}}
@keyframes gtnh-slash-fx{0%{opacity:0;transform:rotate(-25deg) scale(.5)}25%{opacity:1}100%{opacity:0;transform:rotate(30deg) scale(1.2)}}
@keyframes gtnh-tap-a{25%{transform:translateX(-2px) rotate(-4deg)}65%{transform:translateX(2px) rotate(3deg)}}
@keyframes gtnh-tap-b{25%{transform:translateX(-2px) rotate(-4deg)}65%{transform:translateX(2px) rotate(3deg)}}
@keyframes gtnh-slash-a{30%{transform:rotate(-65deg)}70%{transform:rotate(35deg)}}
@keyframes gtnh-slash-b{30%{transform:rotate(-65deg)}70%{transform:rotate(35deg)}}
@keyframes gtnh-hurt-a{20%{transform:translateX(-3px) scale(.72);opacity:.35}60%{transform:translateX(2px) scale(.72);opacity:1}}
@keyframes gtnh-hurt-b{20%{transform:translateX(-3px) scale(.72);opacity:.35}60%{transform:translateX(2px) scale(.72);opacity:1}}
/* 背包分页：每页 12 格，按钮固定在格子下面 */
.gtnh-bag-pager { display:flex; align-items:center; justify-content:center; gap:10px; padding:8px 12px; border-top:1px solid var(--line); }
.gtnh-bag-pager .gtnh-header-status { min-width:54px; text-align:center; font-variant-numeric:tabular-nums; }
.gtnh-bag-pager button:disabled { opacity:.42; cursor:default; }/* 宏面板：一条一行，选中的高亮；配方与采集共用 */
.gtnh-macros { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.gtnh-macro-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.gtnh-macro-head strong { color: var(--text); font-size: 12px; font-weight: 600; }
.gtnh-macro { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }
.gtnh-macro.is-picked { border-color: var(--accent, #c2410c); background: color-mix(in srgb, var(--accent, #c2410c) 12%, var(--surface-2)); }
.gtnh-macro-pick { min-height: 26px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.gtnh-macro.is-picked .gtnh-macro-pick { border-color: var(--accent, #c2410c); color: var(--text); font-weight: 600; }
.gtnh-macro-info { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtnh-macro-drop { min-height: 26px; padding: 2px 7px; border: 0; border-radius: 3px; background: none;
  color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.gtnh-macro-drop:hover { color: #d08b5b; }/* 职业分类条上的配方数：跟重建月球的 jobs 表一个意思，一页 = 一个职业 */
.gtnh-cat-chip small { font-size: 10px; opacity: .72; margin-left: 2px; font-variant-numeric: tabular-nums; }/* 采集一次：完整度 / 采集力 / 成长度 三条读数 + 技能条 */
.gtnh-trip { display: flex; flex-direction: column; gap: 5px; padding: 6px 0; }/* 采集页：星级点单独一页，技能格跟制作页一样是图标格 */
.gtnh-tabs { grid-template-columns: repeat(8, minmax(0, 1fr)); }
#gtnhPanelGather .gtnh-skill[data-state="ready"] { color: var(--text); }
#gtnhPanelGather .gtnh-skill[data-state="locked"] { opacity: .55; }
#gtnhPanelGather .gtnh-skill-icon { display: block; width: 26px; height: 26px; background: currentColor;
  mask: var(--skill-icon) center/contain no-repeat; -webkit-mask: var(--skill-icon) center/contain no-repeat; }
#gtnhGatherTrip { padding: 8px 12px 0; }
#gtnhGatherMacros { padding: 0 12px 8px; }
@media (max-width: 620px) { .gtnh-tabs { grid-template-columns: repeat(8, minmax(0, 1fr)); } .gtnh-tab { min-width: 0; font-size: 11px; padding-inline: 1px; } }
/* 采集整页：读数条按重建月球的手采页摆（左列次数/获得率，右列完整度/提纯值/采集力/产出） */
.gtnh-grow { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px 0; }
.gtnh-grow-cols { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); gap: 16px; align-items: start; }
.gtnh-grow-lbl { font-size: 11.5px; color: var(--muted); }
.gtnh-grow-lbl.mt { margin-top: 8px; display: block; }
.gtnh-grow-num { font-size: 26px; line-height: 1.1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.gtnh-grow-num i { font-size: 12px; font-style: normal; font-weight: 400; color: var(--muted); margin-left: 3px; }
.gtnh-pips { display: flex; gap: 4px; margin-top: 4px; }
.gtnh-pips i { width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--line); background: var(--surface-2); }
.gtnh-pips i.on { background: var(--accent, #c2410c); border-color: var(--accent, #c2410c); }
.gtnh-grow-rate { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.gtnh-grow-rate small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.gtnh-grow-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gtnh-grow-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 72px; gap: 8px; align-items: center; }
.gtnh-grow-row b { font-size: 12px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.gtnh-grow-row b em { font-style: normal; font-weight: 700; }
.gtnh-grow-bar { position: relative; height: 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.gtnh-grow-bar i { display: block; height: 100%; background: var(--game-points, #c2410c); }
.gtnh-grow-out { display: flex; align-items: baseline; gap: 8px; padding-top: 2px; border-top: 1px solid var(--line); }
.gtnh-grow-out b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.gtnh-grow-out b i { font-size: 11px; font-style: normal; color: var(--muted); margin-left: 2px; }
.gtnh-grow-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 4px 12px;
  padding-top: 6px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.gtnh-grow-meta b { color: var(--text); font-weight: 600; margin-left: 4px; }
.gtnh-grow-logs { display: flex; flex-wrap: wrap; gap: 6px; }
.gtnh-grow-lg { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; }
.gtnh-grow-lg b { color: var(--text); font-weight: 600; }
.gtnh-grow-lg em { font-style: normal; color: var(--muted); }
@media (max-width: 480px) { .gtnh-grow-cols { grid-template-columns: minmax(0, 1fr); } }
/* 制作页按档分段：T1 石器 / T2 铜 / T3 青铜 */
/* 机器页顶部的基地重建行 */
.gtnh-rebuild { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.gtnh-rebuild-lv { font-weight: 700; color: var(--text); white-space: nowrap; }
.gtnh-rebuild-cost { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }/* 基建页：只放当前目标 */
.gtnh-base-goal { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--line); }
.gtnh-base-title { font-size: 14px; font-weight: 700; color: var(--text); }
.gtnh-base-cost { flex: 1 1 200px; min-width: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 人物页：槽位那一行放宽，采集套组不再被挤到换行 */
.gtnh-gear-head { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.gtnh-gear-slot { white-space: nowrap; }
.gtnh-gear-now { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtnh-gear-stat { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
/* 页签多了一个，宽度均分 9 栏 */
.gtnh-tabs, .gtnh-tabs { grid-template-columns: repeat(9, minmax(0, 1fr)); }/* 制作页：产出物的「用途」 */
.gtnh-uses { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 10px; }
.gtnh-uses-label { font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.gtnh-use-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text);
  font-size: 11.5px; line-height: 1.4; cursor: pointer; }
.gtnh-use-chip:hover { border-color: var(--accent); }
.gtnh-use-icon svg { width: 16px; height: 16px; display: block; }
.gtnh-use-none { font-style: normal; color: var(--muted); }
.gtnh-rc-produce { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline dotted; }/* 人物页：精制度与精制按钮 */
.gtnh-refine { display: flex; align-items: center; gap: 8px; padding: 6px 2px 2px; font-size: 11.5px; color: var(--muted); }
.gtnh-refine-lv { font-variant-numeric: tabular-nums; color: var(--text); }
.gtnh-refine-cost { font-variant-numeric: tabular-nums; }/* 人物页：一格一行，点开后在下面展开可选装备 */
.gtnh-gear-option { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) auto auto; align-items: center; gap: 8px;
  padding: 6px 4px; border-top: 1px solid var(--line); }
.gtnh-gear-option .gtnh-mini { justify-self: end; }
/* 精制页：每件装备一行 */
.gtnh-refine-row { display: grid; grid-template-columns: 34px minmax(0,1.2fr) minmax(0,1fr) minmax(0,.8fr) auto;
  align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); list-style: none; }
.gtnh-refine-icon svg { width: 28px; height: 28px; display: block; }
.gtnh-refine-name { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.gtnh-refine-name em { font-style: normal; font-size: 11px; color: var(--muted); }
.gtnh-refine-odds, .gtnh-refine-stock { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gtnh-refine-row .gtnh-mini { justify-self: end; }
/* 页签 10 栏 */
.gtnh-tabs { grid-template-columns: repeat(10, minmax(0, 1fr)); }/* 精制页：三个空位 + 投料 */
.gtnh-refine-slot { list-style: none; border-bottom: 1px solid var(--line); padding: 10px 4px; }
.gtnh-refine-slot.is-empty { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.gtnh-refine-open { width: 40px; height: 40px; border: 1px dashed var(--line); border-radius: 10px; background: transparent;
  color: var(--muted); font-size: 20px; cursor: pointer; }
.gtnh-refine-head { display: grid; grid-template-columns: 34px minmax(0,1.2fr) auto auto; align-items: center; gap: 10px; }
.gtnh-refine-invest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.gtnh-refine-picker { border-top: 1px solid var(--line); padding: 6px 4px; display: flex; flex-direction: column; gap: 4px; }
/* 精制页：单槽位，不要列表缩进 */
ul.gtnh-gear-list, #gtnhRefineList { margin: 0; padding: 0 12px; list-style: none; }
#gtnhRefinePicker { margin: 0; padding: 6px 12px; }
.gtnh-refine-bar { position: relative; height: 18px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; background: transparent; }
.gtnh-refine-bar i { display: block; height: 100%; background: var(--accent); opacity: .5; transition: width .15s ease; }
.gtnh-refine-bar b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--text); }
.gtnh-refine-slot { padding: 12px; }
/* 宏页 */
.gtnh-macro-group { list-style: none; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.gtnh-macro-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.gtnh-macro-line { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 4px 0; font-size: 11.5px; color: var(--muted); }
.gtnh-macro-line.is-picked .gtnh-macro-pick { color: var(--text); font-weight: 700; }
.gtnh-macro-steps { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 页签 11 栏 */
.gtnh-tabs { grid-template-columns: repeat(11, minmax(0, 1fr)); }/* 宏页：一行一组，点开看完整手法 */
.gtnh-macro-group { list-style: none; border-bottom: 1px solid var(--line); }
.gtnh-macro-head { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; background: transparent; border: 0; color: var(--text); text-align: left; cursor: pointer; }
.gtnh-macro-icon svg { width: 28px; height: 28px; display: block; }
.gtnh-macro-name { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.gtnh-macro-name em { font-style: normal; font-size: 11px; color: var(--muted); }
.gtnh-macro-line { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; padding: 6px 12px 10px; align-items: start; }
.gtnh-macro-steps { margin: 0; padding-left: 16px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }