/* AutoMods 模组预览模式（工作台）样式表
 *
 * 与简洁模式、管理后台同属一套视觉：白底、细描边、系统字体。
 * 游戏感只保留在真正表现游戏内物件的地方——物品格子、合成九宫格、模型舞台，
 * 以及沿用简洁模式的厚边框按钮。其余外壳一律走通用组件。
 *
 * 类名与 index.html、app.js 生成的结构一一对应，改样式时不要重命名。
 * 组织顺序：设计令牌 → 基础元素 → 通用组件 → 顶栏 → 布局 → 各区域 → 弹窗 → 响应式。
 */

/* ==================================================================
   1. 设计令牌
   ================================================================== */



/* 深色不是把浅色反相：底色用带绿的深灰，强调色整体提亮降饱和，
   否则原来的深绿在暗底上会糊成一团。弱化文字 #8d968a 对 #161a15 为 6.8:1。 */
html[data-theme="dark"] {color-scheme: dark;}

/* ==================================================================
   2. 基础元素
   ================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 隐藏一律由 HTML 的 hidden 属性说了算，组件自己设定 display。 */
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page);
  /* 原来这里关掉了抗锯齿并全局 pixelated，中文因此糊成锯齿块。
     像素化只保留给真正的 16×16 贴图，见 .honghe-item 等。 */
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--accent); }

h1, h2, h3 { line-height: 1.35; font-weight: 600; }

::selection { background: var(--accent-soft); }

:where(button, a, input, textarea, select):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* 细滚动条，避免游戏化面板里出现突兀的系统滚动条。 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ==================================================================
   3. 通用组件
   ================================================================== */

/* ---------- 按钮：沿用简洁模式的厚边框像素质感，配色换成新的中性系 ---------- */

.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 0 var(--border);
  transition: background .12s, border-color .12s, color .12s, transform .08s;
}
.mc-btn:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-hover); }
.mc-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }

.mc-btn.primary,
.mc-btn.is-on {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent-active);
}
.mc-btn.primary:hover:not(:disabled),
.mc-btn.is-on:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

.mc-btn.tiny { min-height: 30px; padding: 5px 10px; font-size: 12.5px; }
.mc-btn.send { flex: 0 0 auto; }
.mc-btn:disabled { opacity: .5; cursor: not-allowed; }

.mode-switch-link { text-decoration: none; }

.text-button {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
}
.text-button:hover { color: var(--text); }

/* ---------- 标记 ---------- */

.mc-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
}
button.mc-chip:hover { background: var(--surface-hover); color: var(--text); }
.mc-chip.static { color: var(--text-muted); }

.balance-chip {
  text-decoration: none;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: 999px;
}
.balance-chip.low { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }

.xp-level {
  min-width: 32px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
}

/* ---------- 表单控件 ---------- */

textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}
textarea { resize: vertical; line-height: 1.6; }
textarea:hover, input:hover, select:hover { border-color: var(--border-hover); }
textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea:disabled, input:disabled {
  color: var(--text-muted);
  background: var(--surface-sunken);
  cursor: not-allowed;
}
::placeholder { color: var(--text-muted); }

/* ==================================================================
   4. 顶栏
   ================================================================== */

.titlebar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.site-logo { display: block; width: 62px; height: 22px; object-fit: contain; }
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.logo-text em {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* 当前模组名。居中且可收缩，长名字省略而不是把顶栏撑开。 */
.titlebar-mod {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}
.mod-diamond {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
}
.mod-diamond svg, .empty-cube svg, .account-button span svg { display: block; fill: currentColor; }
.mod-diamond svg { width: 15px; height: 15px; }
.empty-cube svg { width: 30px; height: 30px; }
.account-button span svg { width: 14px; height: 14px; }

.mod-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mod-name b {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-name small {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-right { flex: none; display: flex; align-items: center; gap: 8px; }

.account-button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px 0 4px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.account-button:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.account-button span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50%;
}
.account-button b {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.status-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.status-dot i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s infinite;
}
@keyframes pulse { 50% { opacity: .3; } }

.env-chips { display: flex; gap: 6px; }

/* ==================================================================
   5. 主布局
   ================================================================== */

/* 说明书在左、监视器在右。两栏都要 min-width:0，否则里面的九宫格和
   长模组名会把网格撑破——这正是改版前右侧背包被切掉的原因。 */
.hud {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 16px;
  max-width: 1720px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  align-items: start;
}

.chat-panel {
  order: 1;
  min-width: 0;
  position: sticky;
  top: calc(var(--titlebar-h) + 18px);
  max-height: calc(100vh - var(--titlebar-h) - 36px);
  display: flex;
}
.forge-panel {
  order: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- 面板外壳 ---------- */

.crafting-table, .inventory-gui, .chat-box {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: calc(100vh - var(--titlebar-h) - 36px);
  overflow-y: auto;
}

.gui-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 14.5px;
  font-weight: 600;
}
.gui-title small { font-size: 12.5px; font-weight: 400; color: var(--text-muted); }

.monitor-title-row {
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.monitor-title-copy { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.monitor-env { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.forge-top {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
  gap: 14px;
}
.forge-side { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ==================================================================
   6. 模型监视器（保留舞台质感）
   ================================================================== */

.item-frame {
  min-width: 0;
  padding: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
/* 舞台保留网格底纹与柔和聚光，让模型有"被放在展台上"的感觉，
   但底色跟随主题，不再是固定的深绿黑板。 */
.frame-inner {
  position: relative;
  height: 348px;
  overflow: hidden;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 40%, var(--accent-soft), transparent 58%),
    linear-gradient(var(--stage-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px),
    var(--stage);
  background-size: auto, 24px 24px, 24px 24px, auto;
}
.frame-tip {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 5;
  font-size: 12px;
  color: var(--text-muted);
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
  color: var(--stage-text);
}
.empty-preview b { font-size: 15px; font-weight: 600; }
.empty-preview small { max-width: 280px; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.empty-cube {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: var(--radius-sm);
}

.model-output { position: absolute; inset: 0; }
.voxel-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.voxel-scene:active { cursor: grabbing; }
.model-canvas { display: block; width: 100%; height: 100%; }

.model-sprite-preview { position: absolute; inset: 0; display: grid; place-items: center; perspective: 700px; }
.model-sprite-preview img {
  width: min(46%, 170px);
  aspect-ratio: 1;
  object-fit: contain;
  /* 模组贴图是 16×16 的，必须像素化放大，插值会糊成一团。 */
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .22));
  transform: rotateY(-18deg) rotateX(8deg);
  animation: model-float 3s ease-in-out infinite;
}
@keyframes model-float { 50% { transform: translateY(-8px) rotateY(18deg) rotateX(4deg); } }

.model-animation-controls {
  position: absolute;
  z-index: 7;
  left: 10px;
  right: 10px;
  bottom: 34px;
  display: grid;
  grid-template-columns: minmax(96px, 150px) auto auto minmax(70px, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}
.model-animation-controls select,
.model-animation-controls button {
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
}
.model-animation-controls button:hover { background: var(--surface-hover); }
.model-animation-controls input { width: 100%; accent-color: var(--accent); }
.model-animation-controls span {
  min-width: 74px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.model-building {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--stage-text);
}
.model-building-cubes { position: relative; width: 120px; height: 90px; margin-bottom: 12px; }
.model-building-cubes i {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 4px;
  opacity: .85;
  animation: assembling 1.8s ease-in-out infinite;
}
.model-building-cubes i:nth-child(1) { left: 12px; top: 40px; }
.model-building-cubes i:nth-child(2) { left: 46px; top: 18px; animation-delay: .3s; }
.model-building-cubes i:nth-child(3) { left: 80px; top: 45px; animation-delay: .6s; }
@keyframes assembling {
  0%, 100% { transform: translateY(10px) rotate(0); opacity: .4; }
  50% { transform: translateY(-8px) rotate(90deg); opacity: 1; }
}
.model-building small {
  display: block;
  max-width: 280px;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ==================================================================
   7. 模组背包（格子保留游戏质感）
   ================================================================== */

.inventory-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.recipe-book-button {
  min-width: 150px;
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  padding: 7px 10px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.recipe-book-button:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-hover); }
.recipe-book-button:disabled { opacity: .5; cursor: not-allowed; }
.recipe-book-button b { font-size: 13px; font-weight: 600; }
.recipe-book-button small { font-size: 12px; color: var(--text-muted); }
/* 配方书图标：一本摊开的书，用两块色区加书脊表示。 */
.recipe-book-icon {
  grid-row: 1 / 3;
  position: relative;
  width: 30px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--warn-soft) 0 46%, var(--warn) 46% 54%, var(--warn-soft) 54%);
  border: 1px solid var(--warn-border);
}
.recipe-book-icon i {
  position: absolute;
  left: 4px;
  width: 7px;
  height: 1px;
  background: var(--warn);
  opacity: .55;
}
.recipe-book-icon i:nth-child(1) { top: 6px; }
.recipe-book-icon i:nth-child(2) { top: 10px; }
.recipe-book-icon i:nth-child(3) { top: 6px; left: auto; right: 4px; }
.recipe-book-icon i:nth-child(4) { top: 10px; left: auto; right: 4px; }

.inv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.inventory-grid, .hotbar {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
}
.hotbar { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* 格子是这套界面里最该保留游戏感的东西：方形、内凹、能一眼看出可点。 */
.inventory-slot {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: 4px;
  box-shadow: inset 0 2px 3px var(--slot-inset);
  transition: background .1s, border-color .1s;
}
.inventory-slot:not(.empty):hover { background: var(--slot-hover); border-color: var(--accent-border); }
.inventory-slot.is-selected {
  background: var(--slot-selected);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.inventory-slot .honghe-item,
.slot-thumb {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}
.slot-thumb { display: block; width: 100%; height: 100%; }

.inventory-fallback {
  width: 72%;
  height: 72%;
  display: grid;
  place-items: center;
  border-radius: 3px;
  font-size: clamp(12px, 1.5vw, 18px);
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
}
.inventory-fallback.type-block { background: #8a6a42; }
.inventory-fallback.type-entity { background: #4a6f8c; }
.inventory-fallback.type-recipe { background: #96702f; }
.inventory-fallback.type-effect {
  color: #0c1c2c;
  background: radial-gradient(circle, #fff 0 10%, #6fd8f0 30%, #3a7fc4 70%);
  animation: effectSlotPulse 1.4s ease-in-out infinite alternate;
}
@keyframes effectSlotPulse { to { filter: brightness(1.25); transform: scale(.92); } }

.inventory-slot .quantity {
  position: absolute;
  right: 3px;
  bottom: 1px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface);
  pointer-events: none;
}
.inventory-slot .status-corner {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}
.inventory-slot[data-status="draft"] .status-corner { background: var(--warn); }

.inventory-empty {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}
.inventory-help { margin-top: 8px; font-size: 12px; color: var(--text-muted); text-align: right; }

/* 监视器右侧的背包是窄栏，格子改 4 列并允许纵向滚动。 */
.monitor-inventory {
  height: 100%;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.monitor-inventory .inventory-title-row { display: block; }
.monitor-inventory .recipe-book-button { width: 100%; min-width: 0; margin-bottom: 10px; }
.monitor-inventory .inv-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.monitor-inventory .inventory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: 250px;
  overflow-y: auto;
  padding-right: 3px;
}
.monitor-inventory .inventory-slot { min-height: 50px; }
.monitor-inventory .inventory-help { text-align: center; }

/* ==================================================================
   8. 继续修改模组（轻量输入框）
   ================================================================== */

.preview-command-box { padding: 16px; }
.preview-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
}
.preview-command-row textarea { min-height: 74px; }

.preview-command-status {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.preview-command-status b { flex: none; font-weight: 600; color: var(--accent); }

.preview-command-meter {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  background: var(--surface-active);
  border-radius: 999px;
}
.preview-command-meter i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s;
}

.preview-full-conversation {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  text-align: right;
  text-decoration: none;
}
.preview-full-conversation:hover { text-decoration: underline; }

.one-question-hint { margin-top: 4px; font-size: 12.5px; color: var(--text-muted); text-align: center; }

/* ==================================================================
   9. 模组说明书（左栏）
   ================================================================== */

.preview-book { gap: 12px; }

.preview-cover {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 13px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.preview-mod-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: var(--radius-sm);
}
.preview-mod-icon img { width: 86%; height: 86%; object-fit: contain; image-rendering: pixelated; }
.preview-mod-icon span { font-size: 28px; color: var(--text-muted); }
.preview-cover small { font-size: 12px; color: var(--text-muted); }
.preview-cover h2 { margin: 3px 0 6px; font-size: 17px; }
.preview-cover p { font-size: 13px; line-height: 1.65; color: var(--text-secondary); }

.preview-guide-section {
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.preview-guide-section h3 { margin-bottom: 9px; font-size: 13.5px; }

.preview-feature-list { display: flex; flex-direction: column; gap: 7px; }
.preview-feature-list article {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  padding: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
}
.preview-feature-list article i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 4px;
}
.preview-feature-list b, .preview-feature-list small { display: block; }
.preview-feature-list b { font-size: 13px; font-weight: 600; }
.preview-feature-list small,
.preview-feature-list p { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

.preview-play-list { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.preview-play-list li { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }

.preview-recipe-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 9px;
}
.preview-recipe-section > header h3 { margin-bottom: 0; }
.preview-recipe-name { margin-bottom: 10px; font-size: 12.5px; color: var(--text-muted); }

.preview-mini-craft {
  display: grid;
  grid-template-columns: 114px 30px 46px;
  gap: 9px;
  align-items: center;
  justify-content: center;
}
.preview-mini-grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 3px; }
.preview-mini-slot, .preview-mini-output {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  /* 材料图标来自外站，加载失败时 alt 文字会把格子撑破，一律裁掉。 */
  overflow: hidden;
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: 3px;
}
.preview-mini-output { width: 46px; height: 46px; }
.preview-mini-slot img, .preview-mini-output img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
}
.preview-mini-slot span, .preview-mini-output span {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-muted);
  text-align: center;
}
.preview-craft-arrow { font-size: 20px; color: var(--text-muted); text-align: center; }

/* ---------- 模组下载 ---------- */

.guide-artifacts {
  padding: 13px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.guide-section-title { margin-bottom: 9px; font-size: 13.5px; font-weight: 600; }
.artifact-list { display: flex; flex-direction: column; gap: 7px; }

.guide-artifact {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 9px 11px;
  text-align: left;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.guide-artifact:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--accent-border); }
.guide-artifact:disabled { opacity: .55; cursor: default; }
.guide-artifact i {
  grid-row: 1 / 3;
  height: 30px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 4px;
}
.guide-artifact small { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ==================================================================
   10. 合成配方书
   ================================================================== */

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
}

.recipe-book-card {
  width: min(940px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
}
.recipe-book-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.recipe-book-head small { font-size: 12.5px; color: var(--text-muted); }
.recipe-book-head h2 { margin-top: 2px; font-size: 19px; }

.recipe-book-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}
.recipe-index {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  background: var(--surface-sunken);
  border-right: 1px solid var(--border);
}
.recipe-index-title { margin-bottom: 10px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.recipe-index-list {
  max-height: 420px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.recipe-index-item {
  position: relative;
  aspect-ratio: 1;
  padding: 5px;
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: 4px;
}
.recipe-index-item:hover { background: var(--slot-hover); border-color: var(--accent-border); }
.recipe-index-item.is-selected {
  background: var(--slot-selected);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.recipe-index-item img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.crafting-recipe { min-width: 0; padding: 20px; overflow-y: auto; }
.crafting-recipe-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.crafting-recipe-title b { font-size: 15px; font-weight: 600; }
.crafting-recipe-title small { font-size: 12.5px; color: var(--text-muted); }

/* 九宫格是配方的核心表达，保持方正的工作台观感。 */
.crafting-workbench {
  min-height: 300px;
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 22px;
  align-items: center;
  justify-content: center;
  padding: 26px 12px;
}
.crafting-grid {
  display: grid;
  grid-template-columns: repeat(3, 66px);
  grid-template-rows: repeat(3, 66px);
  gap: 5px;
  padding: 7px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.recipe-slot, .recipe-output-slot {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: 4px;
  box-shadow: inset 0 2px 3px var(--slot-inset);
}
.recipe-output-slot { width: 80px; height: 80px; }
.recipe-slot img, .recipe-output-slot img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  image-rendering: pixelated;
}
.recipe-slot.empty { opacity: .55; }
.recipe-slot .recipe-tag {
  position: absolute;
  left: 3px;
  top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}
.recipe-quantity {
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface);
}
.recipe-fallback {
  display: grid;
  place-items: center;
  width: 76%;
  height: 76%;
  border-radius: 3px;
  font-size: 12px;
  text-align: center;
  color: var(--on-accent);
  background: var(--accent);
}
/* 合成箭头：一条横杠加一个三角，纯 CSS 画出来。 */
.crafting-arrow { position: relative; width: 62px; height: 34px; }
.crafting-arrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 40px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-strong);
}
.crafting-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 20px solid var(--border-strong);
}

.recipe-help {
  min-height: 34px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.recipe-source { margin-top: 10px; font-size: 12px; color: var(--text-muted); text-align: right; }

/* ==================================================================
   11. 其它弹窗
   ================================================================== */

/* ---------- 右键菜单 ---------- */

.ctx-menu {
  position: fixed;
  z-index: 480;
  min-width: 196px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.ctx-head {
  padding: 7px 10px;
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.ctx-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  border-radius: 4px;
}
.ctx-menu button:hover { background: var(--surface-hover); }

/* ---------- 修改物品（原告示牌） ---------- */

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 470;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
}
.sign-card {
  width: min(500px, 94vw);
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
}
.sign-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sign-head img {
  width: 44px;
  height: 44px;
  padding: 5px;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--slot);
  border: 1px solid var(--slot-border);
  border-radius: var(--radius-sm);
}
.sign-head > div { min-width: 0; }
.sign-head small {
  display: block;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sign-head b { font-size: 16px; font-weight: 600; }
.sign-head .mc-btn { margin-left: auto; flex: none; }
.sign-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--text-secondary); }
.sign-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }

/* ---------- 登录 ---------- */

.login-card {
  width: min(540px, 94vw);
  padding: 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
}
.login-cube { display: block; width: 88px; height: 31px; object-fit: contain; margin: 0 auto 14px; }
.login-card h2 { font-size: 20px; }
.login-card > p { margin: 8px 0 18px; font-size: 13px; line-height: 1.65; color: var(--text-muted); }
.login-card label {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
}
.login-card input { margin-top: 5px; }
.login-card > .mc-btn { width: 100%; margin-top: 18px; }
.login-hint {
  margin: 12px 0 0;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  text-align: left;
}

.beta-group-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}
.beta-group-entry > span { font-size: 12.5px; color: var(--text-muted); }
.beta-group-entry > .mc-btn { width: 100%; }
.beta-group-entry > small { font-size: 12px; line-height: 1.55; color: var(--text-muted); }

/* ---------- 模组资产库 ---------- */

.asset-library-card {
  width: min(1060px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
}
.asset-library-head {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.asset-library-head small { font-size: 12.5px; color: var(--text-muted); }
.asset-library-head h2 { margin-top: 2px; font-size: 20px; }
.asset-library-head p { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.asset-toolbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.asset-grid {
  min-height: 210px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 4px;
}
.asset-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 84px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asset-card:hover { border-color: var(--border-hover); }
.asset-icon {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 17px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-sm);
}
.asset-icon.has-image { background: var(--slot); border: 1px solid var(--slot-border); }
.asset-icon.has-image > span { visibility: hidden; }
.asset-icon > img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: contain;
  image-rendering: pixelated;
}
.asset-card-main { min-width: 0; }
.asset-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
}
.asset-card p {
  margin: 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.asset-status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.asset-status.status-running,
.asset-status.status-queued { color: var(--info); background: var(--info-soft); border-color: var(--info-border); }
.asset-status.status-complete { color: var(--success); background: var(--success-soft); border-color: var(--success-border); }
.asset-status.status-prototype,
.asset-status.status-needs_review { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.asset-status.status-failed,
.asset-status.status-cancelled { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.asset-warning { display: block; margin-top: 5px; font-size: 12px; line-height: 1.45; color: var(--warn); }
.asset-card-side { display: flex; flex-direction: column; align-items: stretch; text-align: center; gap: 4px; }
.asset-card-side > b { font-size: 17px; font-weight: 600; color: var(--accent); }
.asset-card-side > small { font-size: 12px; color: var(--text-muted); }
.asset-loading {
  grid-column: 1 / -1;
  min-height: 190px;
  display: grid;
  place-items: center;
  gap: 14px;
  align-content: center;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asset-loading.error { color: var(--danger); }

/* ---------- 失败分析 ---------- */

.failure-report-card {
  width: min(780px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
}
.failure-report-card > header {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.failure-report-card small { display: block; font-size: 12.5px; color: var(--text-muted); }
.failure-report-card h2 { margin-top: 2px; font-size: 19px; }
.failure-report-card pre {
  margin: 0;
  padding: 20px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.75;
  background: var(--surface-sunken);
}
.failure-action {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
}
.failure-action:hover { background: var(--surface-hover); }

/* ---------- 成就提示 ---------- */

.advancement {
  position: fixed;
  top: calc(var(--titlebar-h) + 16px);
  right: 18px;
  z-index: 490;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  animation: adv-in .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes adv-in { from { transform: translateX(120%); } }
.adv-icon { font-size: 24px; }
.advancement b { display: block; font-size: 14px; font-weight: 600; }
.advancement span { font-size: 12.5px; color: var(--text-muted); }

/* ---------- 物品浮层 ---------- */

.mc-tooltip {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  max-width: 300px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}
.mc-tooltip .t-name { font-size: 14px; font-weight: 600; }
.mc-tooltip .t-id { margin-top: 2px; font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); }
.mc-tooltip .t-trait, .mc-tooltip .t-ability {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.mc-tooltip .t-trait b, .mc-tooltip .t-ability b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--info);
}
.mc-tooltip .t-ability b { color: var(--warn); }
.mc-tooltip .t-rarity { margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.mc-tooltip .t-hint { margin-top: 8px; font-size: 12px; color: var(--accent); }
/* 稀有度沿用原版配色，但在浅底上重新取色以保证可读。 */
.rarity-普通 { color: var(--text-secondary); }
.rarity-稀有 { color: var(--info); }
.rarity-史诗 { color: #9a3fb5; }
.rarity-传说 { color: var(--warn); }
html[data-theme="dark"] .rarity-史诗 { color: #c98fe0; }

/* ==================================================================
   12. 隐藏的历史组件
   ================================================================== */

/* index.html 里 legacy-forge-status / legacy-guide-controls 两块整体 hidden，
   app.js 仍会往里写内容。这里只给最低限度的可用样式，不做视觉打磨；
   哪天重新启用也不会是一堆裸元素。 */
.legacy-forge-status[hidden], .legacy-guide-controls[hidden] { display: none !important; }

.chat-msg { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
  color: var(--on-accent);
  background: var(--accent);
}
.chat-avatar.user { background: var(--text-secondary); }
.chat-bubble {
  max-width: 86%;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.6;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.chat-bubble b { display: block; margin-bottom: 3px; font-size: 12.5px; font-weight: 600; }
.chat-bubble time { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); text-align: right; }
.message-text { display: block; }
.guide-status { display: block; min-height: 30px; line-height: 1.55; }
.guide-meter { height: 6px; margin-top: 8px; overflow: hidden; background: var(--surface-active); border-radius: 999px; }
.guide-meter i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .35s ease; }
.guide-progress small { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.guide-stage { min-width: 0; }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-row textarea { flex: 1; }
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chat-log { display: flex; flex-direction: column; gap: 9px; }

.furnace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.furnace-label { align-self: flex-start; font-size: 13px; font-weight: 600; }
.furnace-flame { display: flex; gap: 4px; height: 28px; align-items: flex-end; }
.furnace-flame i { width: 11px; border-radius: 2px; background: linear-gradient(#ffc24a, #e0641a); animation: flame 1s ease-in-out infinite; }
.furnace-flame i:nth-child(1) { height: 17px; }
.furnace-flame i:nth-child(2) { height: 25px; animation-delay: .2s; }
.furnace-flame i:nth-child(3) { height: 19px; animation-delay: .4s; }
.furnace-flame.is-idle { filter: grayscale(1); opacity: .35; }
@keyframes flame { 50% { transform: scaleY(.78); } }
.furnace-arrow { position: relative; width: 100%; height: 8px; overflow: hidden; background: var(--surface-active); border-radius: 999px; }
.furnace-arrow i { position: absolute; inset: 0; width: 0; background: var(--accent); transition: width .5s; }
.furnace-status { font-size: 12.5px; color: var(--text-secondary); }
.intake-meter {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}
.intake-meter b { color: var(--accent); }
.anim-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; padding-top: 12px; border-top: 1px solid var(--border); }
.anim-bar > span { font-size: 12.5px; color: var(--text-muted); }

.activity-window {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.activity-window > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.activity-window > header > div { display: flex; align-items: center; gap: 6px; }
.activity-window > header i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.activity-window > header i.active { background: var(--accent); animation: pulse 1.2s infinite; }
.activity-window > header span { font-size: 12px; color: var(--text-muted); }
.activity-note { padding: 6px 10px; font-size: 12px; line-height: 1.45; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.activity-log { height: 200px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.activity-entry {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: start;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
}
.activity-entry time { font-family: var(--font-mono); color: var(--text-muted); }
.activity-entry span { min-width: 0; overflow-wrap: anywhere; }
.activity-entry span b { display: block; margin-bottom: 1px; font-size: 12px; font-weight: 600; color: var(--text); }
.activity-entry em { font-style: normal; text-align: right; color: var(--text-muted); }
.activity-entry.terminal { border-left-color: var(--warn); }
.activity-entry.idle { display: flex; color: var(--text-muted); border-left-color: var(--border-strong); }
.activity-entry code {
  display: block;
  margin-top: 3px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-sunken);
  border-radius: 3px;
}
.activity-entry.kind-command { border-left-color: var(--info); }
.activity-entry.kind-gradle { border-left-color: var(--warn); }
.activity-entry.kind-note { border-left-color: #8f6fc4; }
.activity-entry.kind-heartbeat { border-left-color: var(--border-strong); color: var(--text-muted); }
.activity-entry.kind-repair { border-left-color: var(--danger); }
.activity-chip {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 6px;
  font-style: normal;
  font-size: 12px;
  border-radius: 3px;
  color: var(--info);
  background: var(--info-soft);
}
.activity-files { margin-top: 4px; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.activity-files li {
  position: relative;
  padding-left: 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.activity-files li::before { content: "+"; position: absolute; left: 0; color: var(--success); }
.activity-files li[data-kind="update"]::before { content: "~"; color: var(--warn); }
.activity-files li[data-kind="delete"]::before { content: "-"; color: var(--danger); }
.activity-files li[data-kind="error"] { color: var(--danger); }
.activity-files li[data-kind="error"]::before { content: "!"; color: var(--danger); }
.activity-plan { max-height: 120px; overflow-y: auto; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.activity-plan > b { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; }
.activity-plan ol { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.activity-plan li { position: relative; padding-left: 15px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); overflow-wrap: anywhere; }
.activity-plan li::before { content: "\25A2"; position: absolute; left: 0; color: var(--text-muted); }
.activity-plan li.done { color: var(--text-muted); text-decoration: line-through; }
.activity-plan li.done::before { content: "\25A3"; color: var(--accent); }

.upload-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.upload-row > span { font-size: 12px; color: var(--text-muted); }
.upload-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.upload-chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  overflow: hidden;
  font-size: 12px;
  text-decoration: none;
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}
.upload-chip > small { font-size: 12px; white-space: nowrap; color: var(--text-muted); }
.upload-chip.saved { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.upload-chip.pending { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }

.typing-nudge {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  animation: nudge 1.3s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translateY(2px); } }

.optimization-consent-workbench {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 430px;
  padding: 8px 10px;
  cursor: pointer;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.optimization-consent-workbench input { width: 36px; height: 20px; flex: none; accent-color: var(--accent); }
.optimization-consent-workbench span { display: grid; text-align: left; }
.optimization-consent-workbench b { font-size: 13px; font-weight: 600; }
.optimization-consent-workbench small { font-size: 12px; line-height: 1.35; color: var(--text-muted); }

.welcome-card {
  margin: auto 0;
  padding: 18px 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.welcome-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 9px;
  font-size: 12.5px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.welcome-card h2 { margin-bottom: 8px; font-size: 18px; }
.welcome-card > p { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.welcome-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 15px 0; counter-reset: welcome; }
.welcome-steps li {
  counter-increment: welcome;
  position: relative;
  padding: 9px 10px 9px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.welcome-steps li::before {
  content: counter(welcome);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  color: var(--on-accent);
  background: var(--accent);
}
.welcome-steps b, .welcome-steps span { display: block; }
.welcome-steps b { font-size: 13px; font-weight: 600; }
.welcome-steps span { margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.welcome-start { width: 100%; margin-top: 4px; }

/* ==================================================================
   13. 响应式
   ================================================================== */

@media (max-width: 1280px) {
  .hud { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 12px; padding: 14px; }
}

@media (max-width: 1024px) {
  .hud { grid-template-columns: minmax(0, 1fr); }
  .chat-panel { position: static; max-height: none; order: 1; }
  .chat-box { max-height: none; overflow: visible; }
  .forge-panel { order: 2; }
  .forge-top { grid-template-columns: minmax(0, 1fr); }
  .monitor-inventory { min-height: 0; }
  .monitor-inventory .inventory-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); max-height: none; }
  .monitor-title-row { flex-direction: column; align-items: flex-start; }
  .monitor-env { width: 100%; margin-left: 0; justify-content: flex-start; }
  .titlebar-right .status-dot { display: none; }
  /* 顶栏塞不下模组名了，压成一两个字反而更难认；说明书标题里本来就有完整名字。 */
  .titlebar-mod { display: none; }
  .recipe-book-layout { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .recipe-index { border-right: 0; border-bottom: 1px solid var(--border); }
  .recipe-index-list { max-height: 150px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hud { padding: 12px; }
  .app-modal, .edit-modal { padding: 8px; }
  .inventory-grid, .hotbar,
  .monitor-inventory .inventory-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .titlebar { gap: 10px; padding: 0 12px; }
  .titlebar-mod { display: none; }
  .logo-text em, .account-button b { display: none; }
  .titlebar-right { gap: 5px; }
  .asset-grid { grid-template-columns: minmax(0, 1fr); }
  .asset-card { grid-template-columns: 42px minmax(0, 1fr) 76px; }
  .preview-command-row { grid-template-columns: minmax(0, 1fr); }
  .crafting-grid { grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(3, 54px); }
  .crafting-workbench { gap: 12px; padding: 18px 8px; }
  .recipe-output-slot { width: 64px; height: 64px; }
  .preview-cover { grid-template-columns: 60px 1fr; }
  .preview-mod-icon { width: 60px; height: 60px; }
}

/* Particle effects use the supplied Minecraft-style sprite timeline inside
   the same monitor frame as the existing model viewer. */
.effect-scene { background: #9bb8b5; }
.particle-monitor-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.particle-monitor-overlay { position: absolute; inset: 0; z-index: 5; pointer-events: none; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.particle-monitor-meta { position: absolute; top: 14px; left: 16px; display: grid; gap: 3px; max-width: calc(100% - 32px); }
.particle-monitor-meta b { font-size: 14px; font-weight: 800; }
.particle-monitor-meta span { color: rgba(255,255,255,.78); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.particle-monitor-meta small { color: rgba(255,255,255,.64); font-size: 9px; }
.particle-monitor-notice { position: absolute; top: 14px; right: 16px; max-width: min(310px, calc(50% - 24px)); padding: 5px 8px; color: rgba(255,255,255,.82); background: rgba(17,23,20,.58); border: 1px solid rgba(255,255,255,.14); font-size: 10px; line-height: 1.45; text-align: right; }
.particle-monitor-transport { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; box-sizing: border-box; width: min(410px, calc(100% - 32px)); padding: 6px 9px; pointer-events: auto; background: rgba(17,23,20,.76); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.particle-monitor-transport button { width: 24px; height: 24px; padding: 0; background: transparent; color: #fff; font-size: 14px; line-height: 1; }
.particle-monitor-transport button:hover { color: var(--green); }
.particle-monitor-transport input { flex: 1; width: 0; min-width: 60px; margin: 0; }
.particle-monitor-transport output { min-width: 62px; color: rgba(255,255,255,.72); font: 9px ui-monospace, monospace; text-align: right; }
@media (max-width: 640px) {
  .particle-monitor-notice { top: 66px; right: 16px; max-width: calc(100% - 32px); font-size: 9px; }
}
.version-preflight{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.62)}
.version-preflight>section{width:min(660px,96vw);max-height:88vh;overflow:auto;padding:22px;background:var(--surface,#fff);border:1px solid var(--border,#d9ddd7);box-shadow:0 20px 60px rgba(0,0,0,.28)}
.version-preflight h2{margin:3px 0 8px}.version-preflight>section>small{color:#b56e16}.version-preflight-evidence{display:grid;gap:5px;margin:14px 0;padding:10px 12px;background:rgba(210,139,45,.1);border:1px solid rgba(210,139,45,.45)}
.version-preflight-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.version-preflight-options label{display:grid;grid-template-columns:auto 1fr;column-gap:8px;padding:12px;border:1px solid var(--border,#d9ddd7);cursor:pointer}.version-preflight-options label:has(input:checked){border-color:#51a934;box-shadow:inset 0 0 0 1px #51a934}.version-preflight-options input{grid-row:1/3;accent-color:#51a934}.version-preflight-options small{opacity:.7}.version-preflight footer{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.version-preflight footer button{padding:9px 14px}.version-preflight footer .primary{background:#51a934;color:#fff;border-color:#3d8527}
.payment-resume-panel{margin:8px 10px 14px 42px;padding:13px 14px;border:1px solid #c88b2c;border-left:4px solid #c88b2c;background:color-mix(in srgb,#c88b2c 9%,var(--surface));box-shadow:var(--shadow-sm)}
.payment-resume-panel>b,.payment-resume-panel>small{display:block}.payment-resume-panel>small{margin-top:4px;color:var(--text-muted)}.payment-resume-panel>div{display:flex;gap:8px;margin-top:12px}.payment-resume-panel a,.payment-resume-panel button{padding:8px 13px;border:1px solid #b77b20;text-decoration:none;cursor:pointer}.payment-resume-panel a{color:#8d5b12;background:transparent}.payment-resume-panel button{color:#fff;background:#b77b20}.payment-resume-panel button:disabled{opacity:.6;cursor:wait}
