:root {
  --bg: #15181c;
  --panel: #1c2026;
  --panel-2: #232830;
  --glass: rgba(24, 28, 34, 0.82);
  --line: #2e343d;
  --line-2: #3a414c;
  --text: #e8ebef;
  --muted: #98a1ad;
  --accent: #6dbb45;
  --accent-2: #5aa53a;
  --accent-ink: #0d1409;
  --warn: #f0b04a;
  --danger: #ff8277;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}
button, select, input, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

button {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
.top-actions button, .lib-actions button, .done-actions button, .format-list button, .page-head button { white-space: nowrap; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
button.primary:hover:not(:disabled) { background: var(--accent-2); }
button.ghost { background: transparent; }
button.wide { width: 100%; }
button.icon { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; background: transparent; border-color: transparent; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 6px 4px 0; }

input[type="text"], input:not([type]), select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 9px;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 48px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.logo { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(#72b84a 0 38%, #8b5a2b 38% 100%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.title-wrap { display: flex; align-items: baseline; gap: 10px; justify-content: center; min-width: 0; }
.work-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; font-size: 12.5px; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* ---------- 主体 ---------- */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; position: relative; }

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
}
.rail-sep { width: 32px; height: 1px; background: var(--line-2); margin: 6px 0; }
.tool {
  width: 52px;
  padding: 7px 0 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
}
.tool:hover:not(:disabled) { color: var(--text); background: var(--panel-2); border-color: transparent; }
.tool[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }

.stage { position: relative; min-width: 0; background: #9fc9f5; overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; }

.status {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 8px;
  background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.06); border-radius: 999px; padding: 4px 6px;
}
/* 进度条 */
.steps {
  display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; width: clamp(220px, 28vw, 380px); height: 22px;
  border-radius: 999px; overflow: hidden; background: rgba(0, 0, 0, .5); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7), 0 0 0 1px rgba(0, 0, 0, .55);
}
.steps li { position: relative; flex: 1; min-width: 0; display: grid; place-items: center; overflow: hidden; background: rgba(255, 255, 255, .07); font-size: 11.5px; color: #aab3be; }
.steps li::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 100%);
  background: linear-gradient(#b6f07a, #6dbb45 55%, #4a8f2a); transition: width .3s;
}
.steps li span { position: relative; z-index: 1; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, .7); }
.steps li.done::before { width: 100%; }
.steps li.done span, .steps li.active span { color: #fff; font-weight: 700; }
.steps li.active:not(.measured)::before {
  width: 100%; opacity: .85; animation: steps-stripe .8s linear infinite;
  background: repeating-linear-gradient(-45deg, #6dbb45 0 8px, #4f9a2f 8px 16px); background-size: 22.63px 22.63px;
}
.steps li[data-step="done"].active::before { width: 100%; animation: none; opacity: 1; background: linear-gradient(#b6f07a, #6dbb45 55%, #4a8f2a); }
.steps li.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
/* 有实际进度的段：填满的部分是实色，没填的部分走淡淡的条纹，表示还在进行 */
.steps li.active.measured::after {
  content: ""; position: absolute; inset: 0 0 0 calc(var(--p, 0) * 100%); opacity: .4; animation: steps-stripe .8s linear infinite;
  background: repeating-linear-gradient(-45deg, #6dbb45 0 8px, #4f9a2f 8px 16px); background-size: 22.63px 22.63px;
}
@keyframes steps-stripe { to { background-position: 22.63px 0; } }
.steps-pct { min-width: 34px; font-size: 12px; font-variant-numeric: tabular-nums; color: #b6f07a; text-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.steps-pct:empty { display: none; }
@media (max-width: 640px) { .steps { width: 190px; } .status .crew { display: none; } }
.crew { font-size: 12px; color: var(--text); padding-right: 6px; }
.crew:empty { display: none; }
.chip-btn { padding: 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; flex: none; }

.section-pop {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--glass); backdrop-filter: blur(8px); border-radius: 10px; padding: 7px 12px;
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
}
.section-pop input { width: 180px; accent-color: var(--accent); }

.tool-hint {
  position: absolute; top: 56px; left: 12px;
  background: var(--glass); backdrop-filter: blur(8px); border-radius: 8px; padding: 6px 10px; font-size: 12.5px;
}

/* 选中区域的操作条 */
.selbar {
  position: absolute; top: 12px; right: 12px; width: min(560px, calc(100% - 24px));
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 210, 63, .45); border-radius: 12px; padding: 8px 10px;
  display: grid; gap: 6px;
}
.sel-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sel-row .muted { font-size: 12px; margin-right: auto; }
.sel-row input { flex: 1; min-width: 0; }
.sel-row #selFit { padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.dim-label {
  position: absolute; z-index: 4; pointer-events: none;
  background: rgba(20, 22, 26, .9); color: #ffe680; border: 1px solid rgba(255, 210, 63, .6);
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.sel-row input.narrow { flex: 0 1 130px; }

/* 底部输入卡片（照 AutoMods 的输入框：文字在上，功能按钮嵌在卡片底部一行） */
.composer {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5;
  width: min(800px, calc(100% - 24px));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
/* 收起：整张卡片滑到下面，只露出顶上的箭头 */
.composer.folded { transform: translate(-50%, calc(100% + 14px)); }
.fold {
  position: absolute; left: 50%; top: -24px; transform: translateX(-50%);
  width: 58px; height: 24px; padding: 0; display: grid; place-items: center;
  background: rgba(28, 32, 38, .92); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .1); border-bottom: 0; border-radius: 12px 12px 0 0; color: var(--muted);
}
.fold:hover:not(:disabled) { color: var(--text); border-color: rgba(255, 255, 255, .1); }
.fold svg { width: 18px; height: 18px; transition: transform .25s; }
.composer.folded .fold { top: -24px; color: var(--accent); }
.composer.folded .fold svg { transform: rotate(180deg); }
.composer-box {
  display: block; padding: 12px 12px 10px;
  background: rgba(28, 32, 38, .92); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
}
.composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.composer-box.over { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 187, 69, .25), 0 12px 34px rgba(0, 0, 0, .4); }
.composer textarea {
  display: block; width: 100%; resize: none; border: 0; outline: none; background: transparent;
  padding: 2px 4px 8px; font-size: 15px; line-height: 1.5; min-height: 48px; max-height: 150px;
}
.composer-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0 0 8px; border-bottom: 1px dashed var(--line-2); }
.file-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 3px 3px 3px; font-size: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line-2)); border-radius: 8px; background: var(--panel-2);
}
.file-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; display: block; }
.file-chip b { font-weight: 600; }
.file-chip button { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.file-chip button:hover { color: var(--danger); }
.composer-bottom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.composer-bottom .grow { flex: 1; }
.composer-bottom .send { margin-left: auto; } /* 换行时发送按钮也留在右边 */
.pop-wrap { position: relative; flex: none; }
/* 圆形的 ＋：MC 按钮的质感 */
.add-trigger {
  width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  border: 3px solid #111; border-radius: 50%; color: #263026; font: 500 22px/1 sans-serif;
  background: linear-gradient(#e9ebe6 0 68%, #b9beb5 68% 100%);
  box-shadow: inset 0 3px rgba(255, 255, 255, .55), 0 3px rgba(0, 0, 0, .35);
}
.add-trigger:hover:not(:disabled), .add-trigger[aria-expanded="true"] {
  color: #fff; border-color: #1e3e18; background: linear-gradient(#78c957 0 68%, #4a8a34 68% 100%);
}
.chip-trigger {
  height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; min-width: 0; max-width: 240px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line-2)); border-radius: 10px; background: var(--panel-2);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.chip-trigger:hover:not(:disabled), .chip-trigger[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.chip-trigger i { font-style: normal; font-weight: 800; color: var(--accent); }
.chip-trigger span { font-size: 12.5px; white-space: nowrap; }
.chip-trigger small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* 方形拨动开关（AutoMods 的「AI 规划构建」那种） */
.switch { position: relative; display: flex; align-items: center; gap: 7px; padding: 2px 4px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { position: relative; flex: none; width: 36px; height: 20px; border: 2px solid #5d646d; background: #2a2f36; box-shadow: inset 0 2px rgba(0, 0, 0, .25); transition: .16s; }
.switch .sw i { position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; background: #8b929b; box-shadow: 1px 1px 0 rgba(0, 0, 0, .3); transition: .16s; }
.switch input:checked + .sw { border-color: #2d6d20; background: var(--accent); }
.switch input:checked + .sw i { left: 18px; background: #fff; }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-copy { display: grid; line-height: 1.2; }
.sw-copy b { font-size: 12px; }
.sw-copy small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.switch input:checked ~ .sw-copy b { color: var(--accent); }
/* 发送：方形绿色 MC 按钮；制作中变成红色的停止 */
.send {
  width: 40px; height: 38px; padding: 0; display: grid; place-items: center; flex: none;
  border: 3px solid #172711; border-radius: 3px; color: #fff; font-size: 20px; font-weight: 800; text-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
  background: linear-gradient(#70bd4c 0 68%, #47852f 68% 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .2), 0 3px 0 rgba(0, 0, 0, .3);
}
.send:hover:not(:disabled) { border-color: #172711; background: linear-gradient(#83d55e 0 68%, #559d3a 68% 100%); transform: translateY(-1px); }
.send:active { transform: translateY(2px); box-shadow: inset 0 3px rgba(0, 0, 0, .22); }
.send.stop { border-color: #3b1210; background: linear-gradient(#e0665b 0 68%, #a8443b 68% 100%); font-size: 15px; }
/* 弹出菜单（＋ 和各个选项共用） */
.pop {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 12; min-width: 250px; max-width: min(360px, calc(100vw - 32px)); max-height: 380px; overflow-y: auto;
  display: grid; gap: 2px; padding: 6px; background: #22272f; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.pop > small { padding: 5px 8px 2px; font-size: 11px; color: var(--muted); }
.add-menu > button { display: flex; gap: 10px; align-items: center; text-align: left; background: transparent; border: 0; padding: 7px 8px; border-radius: 8px; }
.add-menu > button:hover:not(:disabled) { background: var(--panel-2); }
.add-menu i { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--panel-2); font-style: normal; font-weight: 800; color: var(--accent); }
.add-menu span { display: grid; }
.add-menu b { font-size: 13px; }
.add-menu span small { font-size: 11px; color: var(--muted); }
.add-examples { display: grid; gap: 1px; }
.add-examples button { text-align: left; background: transparent; border: 0; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; }
.add-examples button:hover:not(:disabled) { background: var(--panel-2); }
.chip-menu button { text-align: left; background: transparent; border: 0; padding: 6px 10px; border-radius: 7px; font-size: 13px; }
.chip-menu button:hover:not(:disabled) { background: var(--panel-2); }
.chip-menu button.on { color: var(--accent); font-weight: 700; }
.chip-menu button.on::before { content: "✓  "; }
.chip-menu small.group { margin-top: 4px; }

.loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); color: var(--muted); }

/* ---------- 右侧面板 ---------- */
.drawer {
  width: 340px; background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
.drawer.closed { display: none; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 6px; }
.tabs button {
  flex: 1; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 11px 4px 9px; color: var(--muted); font-weight: 600;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { flex: 1; overflow-y: auto; padding: 14px; }
.empty { color: var(--muted); padding: 18px 4px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.card-title { font-weight: 700; font-size: 12.5px; margin-bottom: 4px; color: var(--muted); }
details.card summary { cursor: pointer; }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.log .name { font-weight: 600; }
.log .sum { color: var(--muted); word-break: break-all; }
.log .res { color: var(--muted); font-size: 12px; }

h2 { font-size: 16px; margin: 0 0 4px; }
h3 { font-size: 12.5px; margin: 18px 0 8px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.stats div { background: var(--panel-2); border-radius: 8px; padding: 6px 8px; }
.stats dt { font-size: 11.5px; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.field-label { display: block; font-size: 12.5px; margin-bottom: 5px; }
#seed { width: 100%; margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
details summary { cursor: pointer; color: var(--muted); margin-top: 14px; }
.materials { list-style: none; padding: 0; margin: 8px 0 0; }
.materials li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.materials .sw { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }
.materials .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 作品与交付 */
.title-input {
  width: 100%; font-size: 16px; font-weight: 700; background: transparent; border: 1px solid transparent;
  padding: 3px 6px; margin: 0 -6px 2px; border-radius: 7px;
}
.title-input:hover { border-color: var(--line-2); }
.save-state { font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.save-state.dirty { color: var(--warn); }
.small { font-size: 12px; margin: 6px 0 10px; }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.versions button {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; text-align: left;
  padding: 6px 10px; background: var(--panel-2); border-color: var(--line); font-size: 12.5px;
}
.versions button.current { border-color: var(--accent); background: rgba(109, 187, 69, .12); }
.versions .muted { font-size: 11.5px; }
.howto p { font-size: 12px; margin: 8px 0 0; }
.deliver { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.deliver #seed { margin-bottom: 0; }
.formats summary { margin-top: 10px; font-size: 12.5px; }
.format-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.format-list li { display: flex; align-items: center; gap: 8px; }
.format-list li div { flex: 1; display: grid; min-width: 0; }
.format-list b { font-size: 12.5px; }
.format-list span { font-size: 11.5px; color: var(--muted); }
.format-list button { padding: 3px 10px; font-size: 12px; flex-shrink: 0; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--muted); }
.badge.ok { background: rgba(109, 187, 69, .18); color: var(--accent); }
h3 .badge { vertical-align: 1px; margin-left: 4px; }
h3 .muted { font-weight: 400; font-size: 11.5px; margin-left: 4px; }

/* 顶栏按钮 */
#libBtn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; }
#libBtn svg { width: 16px; height: 16px; }

/* 完成提示卡 */
.done-card {
  position: absolute; top: 54px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: min(560px, calc(100% - 24px));
  display: flex; gap: 12px; align-items: center;
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid rgba(109, 187, 69, .55); border-radius: 14px; padding: 10px 10px 10px 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.done-card img { width: 120px; height: 80px; object-fit: cover; border-radius: 9px; flex-shrink: 0; background: #9fc9f5; }
.done-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.done-head { font-size: 12.5px; }
.ok-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.done-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.done-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.done-actions button { padding: 4px 11px; font-size: 12.5px; }
.done-card > .icon { align-self: flex-start; color: var(--muted); font-size: 18px; }

/* 作品库页面 */
.page {
  position: fixed; top: 48px; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--bg); overflow-y: auto;
}
.page-inner { max-width: 1240px; margin: 0 auto; padding: 18px 24px 40px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head #libSearch { margin-left: auto; width: 220px; }
.page-tip { font-size: 12.5px; margin: 8px 0 18px; }
.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.lib-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .15s, transform .15s;
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lib-open { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: left; width: 100%; }
.lib-thumb { position: relative; aspect-ratio: 3 / 2; background: #9fc9f5; display: grid; place-items: center; overflow: hidden; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-thumb .ph { color: #2a4a6a; font-size: 12.5px; }
.lib-thumb .badge.cur { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--accent-ink); }
.lib-info { display: grid; gap: 3px; padding: 10px 12px 4px; }
.lib-title { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-info .muted { font-size: 12px; }
.lib-tags { display: flex; gap: 5px; margin-top: 3px; }
.lib-actions { display: flex; gap: 6px; padding: 8px 12px 12px; margin-top: auto; }
.lib-actions button { padding: 3px 10px; font-size: 12px; }
.lib-actions .danger { margin-left: auto; color: var(--danger); }
.lib-actions .danger:hover { border-color: var(--danger); }
.lib-empty { grid-column: 1 / -1; color: var(--muted); padding: 60px 0; text-align: center; }

/* ---------- 第一人称 / 物品栏 ---------- */
body.fps .composer, body.fps .status, body.fps .selbar, body.fps .done-card, body.fps .tool-hint, body.fps .section-pop { display: none !important; }
body.editing .composer { display: none; }
.fps-hud { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); mix-blend-mode: difference; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: #fff; }
.crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
.crosshair::after { left: 0; top: 10px; width: 22px; height: 2px; }
.fps-help {
  position: absolute; top: 10px; left: 10px; right: 10px; text-align: center; font-size: 12px; color: #fff;
  text-shadow: 0 1px 2px #000; opacity: .9;
}
.fps-fly { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #ffe680; text-shadow: 0 1px 2px #000; }
.item-name {
  position: absolute; left: 50%; bottom: 86px; transform: translateX(-50%); color: #fff; font-weight: 700;
  text-shadow: 0 2px 3px #000; opacity: 0; white-space: nowrap;
}
.item-name.fade { animation: itemfade 2.2s ease forwards; }
@keyframes itemfade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.fps-pause { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; pointer-events: auto; }
.pause-card { width: min(320px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px; display: grid; gap: 9px; text-align: center; }
.pause-card h2 { margin: 0; }
.pause-card p { margin: 0 0 4px; font-size: 12.5px; }
.pause-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.hotbar-wrap { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 8px; }
.hotbar { display: flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .25); border-radius: 4px; }
.slot {
  position: relative; width: 46px; height: 46px; padding: 0; display: grid; place-items: center;
  background: rgba(139, 139, 139, .35); border: 2px solid rgba(0, 0, 0, .5); border-radius: 2px; color: #eee;
}
.slot.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.slot svg { width: 28px; height: 28px; stroke-width: 2.2; }
.slot i { position: absolute; left: 3px; top: 1px; font-style: normal; font-size: 10px; color: rgba(255,255,255,.75); text-shadow: 0 1px 1px #000; }
.bicon { display: block; image-rendering: pixelated; background-repeat: no-repeat; border-radius: 1px; }
.inv-btn { padding: 6px 10px; font-size: 12px; background: rgba(0, 0, 0, .55); border-color: rgba(255,255,255,.25); white-space: nowrap; }
body.fps .inv-btn { display: none; }
.inventory { position: absolute; inset: 0; z-index: 7; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px 16px 90px; }
.inv-card { width: min(760px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; min-height: 0; }
.inv-head { display: flex; align-items: center; gap: 8px; }
.inv-head input { flex: 1; min-width: 0; }
.inv-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.inv-cats button { padding: 2px 9px; font-size: 12px; border-radius: 999px; }
.inv-cats button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 4px; overflow-y: auto; min-height: 120px; padding: 2px; }
.inv-grid button { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: rgba(139, 139, 139, .25); border-color: var(--line); }
.inv-tip { font-size: 12px; margin: 0; }

/* ---------- 视图条 ---------- */
.viewbar {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 3;
  display: grid; gap: 2px; padding: 5px; background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .06); border-radius: 12px;
}
.viewbar button { width: 34px; height: 27px; padding: 0; font-size: 12px; background: transparent; border-color: transparent; color: var(--muted); }
.viewbar button:hover:not(:disabled) { color: var(--text); border-color: transparent; background: var(--panel-2); }
.viewbar button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
#projBtn { font-size: 11px; margin-top: 3px; border-top: 1px solid var(--line-2); border-radius: 0 0 7px 7px; }
.compass { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 2px; }
.compass span { position: relative; display: block; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); }
.compass span::before { content: "N"; position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; color: #ff6b5e; line-height: 1; }
.compass span::after { content: ""; position: absolute; left: 50%; top: 10px; transform: translateX(-50%); border: 4px solid transparent; border-bottom: 8px solid #ff6b5e; border-top: 0; }
body.fps .viewbar { display: none; }

.viewbar-sep { display: block; height: 1px; margin: 3px 3px; background: var(--line-2); }
.viewbar [data-cam] { font-size: 11px; }
.free-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; max-width: min(720px, calc(100% - 360px));
  padding: 5px 14px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--glass); backdrop-filter: blur(8px); border: 1px solid rgba(79, 210, 255, .5); border-radius: 999px;
}
.free-hint b { color: #4fd2ff; }
body.fps .free-hint { display: none; }

/* 建筑大小：带图的卡片 */
.size-menu { grid-template-columns: repeat(3, 120px); min-width: 0; max-width: none; gap: 6px; padding: 8px; }
.size-menu > small { grid-column: 1 / -1; }
.size-card {
  display: grid; justify-items: center; gap: 1px; padding: 8px 6px 7px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px;
}
.size-card svg { width: 100px; height: 62px; display: block; stroke: none; margin-bottom: 3px; }
.size-card b { font-size: 13.5px; }
.size-card small { font-size: 11px; color: var(--muted); }
.size-card em { font-style: normal; font-size: 10.5px; line-height: 1.3; color: var(--muted); }
.size-card:hover:not(:disabled) { border-color: var(--accent); }
.size-card.on { border-color: var(--accent); background: rgba(109, 187, 69, .13); }
.size-card.on b { color: var(--accent); }
@media (max-width: 520px) { .size-menu { grid-template-columns: repeat(2, 120px); } }

/* ---------- 右键菜单 ---------- */
.ctx-menu {
  position: absolute; z-index: 10; min-width: 200px; padding: 4px;
  background: #22272f; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.ctx-menu button {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 18px;
  background: transparent; border: 0; border-radius: 6px; padding: 6px 10px; text-align: left; font-size: 13px;
}
.ctx-menu button:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover:not(:disabled) { background: #c9554b; color: #fff; }
.ctx-menu kbd { font: 11px ui-monospace, Consolas, monospace; color: var(--muted); }
.ctx-menu button:hover kbd { color: inherit; }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 6px; }

/* ---------- 移动 / 粘贴工具条 ---------- */
.place-bar {
  position: absolute; top: 54px; left: 50%; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 24px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; font-size: 12.5px;
  background: var(--glass); backdrop-filter: blur(10px); border: 1px solid rgba(79, 210, 255, .6); border-radius: 12px;
}
.place-bar b { color: #4fd2ff; }
.place-bar button { padding: 3px 9px; font-size: 12px; white-space: nowrap; }
body.placing .selbar, body.placing .done-card { display: none; }

/* ---------- 创世神命令行 ---------- */
.we-console {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9; width: min(760px, calc(100% - 24px));
  display: grid; gap: 6px; padding: 8px; font-size: 12.5px;
  background: rgba(16, 18, 22, .94); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}
body.console .composer, body.console .hotbar-wrap { display: none !important; }
.we-log { max-height: 150px; overflow-y: auto; white-space: pre-wrap; font-family: ui-monospace, Consolas, "Microsoft YaHei", monospace; line-height: 1.55; }
.we-log .cmd { color: #9fd2ff; }
.we-log .ok { color: var(--accent); }
.we-log .err { color: var(--danger); }
.we-suggest { display: grid; gap: 1px; max-height: 190px; overflow-y: auto; }
.we-suggest:empty { display: none; }
.we-suggest button { display: flex; gap: 10px; align-items: baseline; text-align: left; background: transparent; border: 0; padding: 3px 6px; border-radius: 6px; }
.we-suggest button:hover { background: var(--panel-2); }
.we-suggest code { color: #ffe680; white-space: nowrap; font-size: 12px; }
.we-suggest span { color: var(--muted); font-size: 12px; }
.we-row { display: flex; align-items: center; gap: 6px; }
.we-prompt { font: 700 14px ui-monospace, Consolas, monospace; color: #ffe680; }
.we-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, "Microsoft YaHei", monospace; }

/* ---------- 对话框：建在什么世界里 ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.modal-card { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.modal-card h2 { font-size: 18px; margin: 0 0 4px; }
.modal-card > p { margin: 0 0 14px; font-size: 13px; }
.world-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.world-opt { display: grid; justify-items: center; gap: 4px; padding: 12px 10px; text-align: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; }
.world-opt svg { width: 100%; max-width: 150px; height: auto; aspect-ratio: 64 / 40; stroke: none; border-radius: 8px; margin-bottom: 4px; }
.world-opt b { font-size: 14.5px; }
.world-opt span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.world-opt em { font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--muted); margin-top: 2px; }
.world-opt em.ok { background: rgba(109, 187, 69, .18); color: var(--accent); }
.world-opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 560px) { .world-options { grid-template-columns: 1fr; } }

/* 种子创作 / 导入存档 */
.modal-card.wide { width: min(760px, 100%); }
.terrain-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 10px 0; }
.terrain-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.terrain-form label.grow { flex: 1; min-width: 180px; }
.terrain-form input[type="number"] { width: 110px; }
.terrain-form .small, .modal-card .small { font-size: 11.5px; }
.seed-map-wrap { display: flex; gap: 14px; align-items: flex-start; }
#seedMap { width: 320px; height: 320px; border-radius: 10px; background: #1b2f45; image-rendering: pixelated; cursor: crosshair; flex: none; touch-action: none; }
.seed-side { flex: 1; min-width: 0; font-size: 12.5px; }
.seed-side p { margin: 0 0 8px; }
.seed-legend { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; font-size: 12px; }
.seed-legend li { display: flex; align-items: center; gap: 6px; }
.seed-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.modal-actions .grow { flex: 1; text-align: left; align-self: center; }
.save-info { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.7; }
.save-info b { color: var(--accent); }
.progress-line { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress-line i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
@media (max-width: 640px) { .seed-map-wrap { flex-direction: column; } #seedMap { width: 100%; height: auto; aspect-ratio: 1; } }

/* 自由模式锁住鼠标时屏幕中间的准星 */
.free-cross { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: difference; z-index: 3; }
.free-cross::before, .free-cross::after { content: ""; position: absolute; background: #fff; }
.free-cross::before { left: 8px; top: 0; width: 2px; height: 18px; }
.free-cross::after { left: 0; top: 8px; width: 18px; height: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px);
  background: #2b313a; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13px;
}
.toast button { padding: 3px 10px; font-size: 12.5px; border-color: var(--accent); }

@media (max-width: 900px) {
  .main { grid-template-columns: 52px minmax(0, 1fr); }
  .tool { width: 44px; font-size: 10px; }
  .drawer { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; width: min(340px, 92vw); box-shadow: -10px 0 30px rgba(0,0,0,.4); }
  .title-wrap { display: none; }
  #newBtn { display: none; }
  .sw-copy small, .chip-trigger span { display: none; }
  .chip-trigger { padding: 0 8px; max-width: 150px; }
  .composer-bottom { gap: 5px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .brand span:last-child { display: none; }
  .top-actions { gap: 6px; }
  .seg button { padding: 4px 8px; }
  #libBtn { padding: 5px 8px; }
  .lib-actions { gap: 4px; padding: 6px 8px 10px; }
  .lib-actions button { padding: 3px 7px; }
  .lib-info { padding: 8px 10px 2px; }
  .page-inner { padding: 14px 16px 32px; }
  .page-head #libSearch { width: 100%; margin-left: 0; order: 5; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .done-card img { width: 72px; height: 48px; }
}

/* ---------- 制作过程：游戏风格的聊天栏 ---------- */
.tab-panel[data-panel="process"] { display: flex; flex-direction: column; }
.tab-panel[data-panel="process"][hidden] { display: none; }

/* 顶上的 HUD：计时、方块数、经验条、用到的方块 */
.hud {
  position: sticky; top: -14px; z-index: 3;
  margin: -14px -14px 10px; padding: 10px 12px 8px;
  background: linear-gradient(#1f242b, #1b1f25);
  border-bottom: 2px solid #0b0d10;
  box-shadow: inset 0 -1px #343b46, 0 6px 14px rgba(0, 0, 0, .25);
}
.hud-row { display: flex; gap: 6px; flex-wrap: wrap; }
.hud-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; font-size: 12px;
  background: #2a2f37; box-shadow: inset 1px 1px #3b424e, inset -1px -1px #15181c; border: 1px solid #0d0f12;
}
.hud-chip b { font-variant-numeric: tabular-nums; color: #fff; text-shadow: 1px 1px 0 #000; }
.hud-chip small { color: var(--muted); font-size: 11px; }
.hud-chip i { width: 12px; height: 12px; flex: none; image-rendering: pixelated; }
.hud-chip i.clock { border-radius: 50%; background: radial-gradient(circle at 50% 50%, #ffe680 0 2px, transparent 2.5px), conic-gradient(#f0c040 0 25%, #c8901c 0 100%); box-shadow: 0 0 0 1px #5a3d06; }
.hud-chip i.cube { background: linear-gradient(#72b84a 0 40%, #8b5a2b 40%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35); }
.hud-chip i.pick { background: linear-gradient(135deg, transparent 0 40%, #9a6b3a 40% 55%, transparent 55%), linear-gradient(45deg, #6fd6d0 0 30%, transparent 30%); }
.xp { position: relative; height: 9px; margin: 9px 1px 4px; background: #101214; border: 1px solid #000; box-shadow: inset 0 1px #000; }
.xp i {
  position: absolute; inset: 0 auto 0 0; width: 0; transition: width .3s;
  background: linear-gradient(#c8ff6a, #80d52a 50%, #4e9a16);
}
.xp::after { /* 经验条的格子 */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(5.555% - 1px), rgba(0, 0, 0, .55) calc(5.555% - 1px) 5.555%);
}
.xp span {
  position: absolute; left: 50%; top: -9px; transform: translateX(-50%); z-index: 1; white-space: nowrap;
  font-size: 11px; font-weight: 700; color: #80ff20; text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000;
}
.used { display: flex; justify-content: space-between; gap: 2px; margin-top: 8px; }

/* 物品栏格子 */
.slot {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; background: #2b3038;
  box-shadow: inset 2px 2px #14171b, inset -2px -2px #444c58;
}
.slot .bicon { image-rendering: pixelated; }
.slot .cnt {
  position: absolute; right: 1px; bottom: -1px; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1;
  color: #fff; text-shadow: 1px 1px 0 #3f3f3f; pointer-events: none;
}

/* 聊天栏 */
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.log > li { animation: ev-in .26s ease-out; }
@keyframes ev-in { from { opacity: 0; transform: translateY(8px); } }
.log .name { font-weight: 600; }
.log .sum { color: var(--muted); word-break: break-all; }
.log .res { color: var(--muted); font-size: 12px; }

.ev.act, .ev.draft { display: flex; align-items: center; gap: 8px; padding: 3px 4px; }
.ev.act .tb, .ev.draft .tb { flex: 1; min-width: 0; line-height: 1.35; }
.ev.act.bad .name { color: var(--danger); }
.ev.act + .ev.act { margin-top: -4px; }

/* 进度达成：成就弹窗的样子 */
.ev.adv {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; margin-top: 4px;
  background: #212121; border: 2px solid #000; box-shadow: inset 2px 2px #555, inset -2px -2px #2c2c2c;
  animation: adv-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.ev.adv b { color: #ffff55; text-shadow: 1px 1px #3f3f15; font-size: 13px; }
.ev.adv .slot { background: transparent; box-shadow: none; }
@keyframes adv-in { from { opacity: 0; transform: translateX(24px); } }

/* 聊天行：<AI> … / <你> … */
.ev.say { padding: 4px 8px; background: rgba(0, 0, 0, .32); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.ev.say .who { color: #55ffff; font-weight: 700; margin-right: 6px; }
.ev.say.me { align-self: flex-end; max-width: 88%; background: rgba(109, 187, 69, .14); }
.ev.say.me .who { color: #ffd257; }
.ev.say.typing .txt::after, .ev.book.typing .book-body::after { content: "▌"; color: var(--accent); animation: caret .9s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.ev.note { padding: 2px 8px; color: #ffe08a; font-size: 12.5px; }
.ev.note .tag { color: #ffaa00; font-weight: 700; }
.ev.err { display: flex; gap: 6px; padding: 6px 8px; color: #ff7b72; background: rgba(255, 60, 60, .1); border-left: 3px solid #ff5555; }
.ev.err .x { font-weight: 700; }

/* AI 思考：附魔书提示框的紫色边框，实时滚动显示最新的几行 */
.ev.think {
  padding: 7px 10px; cursor: pointer;
  background: rgba(16, 0, 16, .92); border: 2px solid #2a0e5a;
  box-shadow: inset 0 0 0 1px #5000ff55, 0 0 0 1px #0a0312;
}
.think-top { display: flex; align-items: center; gap: 7px; }
.think-top b { color: #d6c6ff; font-size: 12.5px; }
.think-top .meta { margin-left: auto; color: #8f84ad; font-size: 11px; font-variant-numeric: tabular-nums; }
.orb { width: 9px; height: 9px; flex: none; background: #a371ff; box-shadow: 0 0 6px #a371ff; }
.ev.think.typing .orb { animation: orb 1.1s ease-in-out infinite; }
@keyframes orb { 50% { background: #e0ccff; box-shadow: 0 0 12px #c9a8ff; transform: rotate(45deg); } }
.think-body {
  display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  max-height: 4.6em; margin-top: 5px; color: #b3a8cf; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  -webkit-mask-image: linear-gradient(transparent, #000 1.6em); mask-image: linear-gradient(transparent, #000 1.6em);
}
.ev.think.closed .think-body { max-height: 1.5em; -webkit-mask-image: none; mask-image: none; opacity: .75; }
.ev.think.closed .think-body span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.think.open .think-body { display: block; max-height: 320px; overflow-y: auto; -webkit-mask-image: none; mask-image: none; opacity: 1; cursor: text; }
.ev.think.open .think-body span { white-space: pre-wrap; }

/* 设计说明：书与笔 */
.ev.book { position: relative; padding: 8px 11px 9px; background: #2b2417; border: 2px solid #120d05; box-shadow: inset 2px 2px #4d3f26, inset -2px -2px #1c160c; color: #eadcbc; }
.book-top { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.book-top b { color: #e8b964; font-size: 12.5px; }
.book-body { white-space: pre-wrap; font-size: 12.8px; line-height: 1.6; word-break: break-word; }
.ev.book.folded .book-body { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.fold-btn { margin-top: 4px; padding: 2px 10px; font-size: 12px; background: transparent; border-color: #5c4626; color: #e8b964; }

/* 写蓝图：熔炉的进度箭头 */
.draft-top { display: flex; align-items: baseline; gap: 8px; }
.draft-top b { font-size: 13px; }
.draft-top .meta { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.draft-parts { display: flex; flex-wrap: wrap; gap: 3px; margin: 3px 0 2px; }
.draft-parts span { padding: 0 6px; font-size: 11px; color: #cfe8bf; background: rgba(109, 187, 69, .13); border: 1px solid rgba(109, 187, 69, .3); animation: ev-in .3s ease-out; }
.furnace { position: relative; height: 6px; margin-top: 4px; background: #101214; border: 1px solid #000; overflow: hidden; }
.furnace i { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #f6a234 0 6px, #e0641c 6px 12px); width: 100%; }
.ev.draft.typing .furnace i { width: 40%; animation: smelt 1.3s linear infinite; }
@keyframes smelt { from { left: -40%; } to { left: 100%; } }
.ev.draft:not(.typing) .furnace i { background: linear-gradient(#c8ff6a, #4e9a16); }

/* 最底下常驻：工作中 */
.log .pulse { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line-2); animation: none; }
.pix { width: 10px; height: 10px; flex: none; background: var(--accent); animation: pix 1s steps(4) infinite; }
@keyframes pix { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
.dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.to-latest {
  position: sticky; bottom: 6px; align-self: center; z-index: 3; margin-top: 8px; padding: 4px 14px; font-size: 12px;
  background: var(--accent); color: var(--accent-ink); border: 0; font-weight: 700; border-radius: 999px; box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}

/* AI 规划构建：选择题卡片 */
.ev.ask { padding: 10px; background: #23272e; border: 2px solid #000; box-shadow: inset 2px 2px #3a404b, inset -2px -2px #121418; }
.ask-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ask-head b { font-size: 13.5px; }
.ask-n { padding: 0 6px; font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); box-shadow: inset -1px -1px #2d6d20; }
.ask-multi { font-style: normal; font-size: 11px; color: #55ffff; }
.ask-why { display: block; margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.ask-opts { display: grid; gap: 5px; margin-top: 8px; }
.ask-opt {
  position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 8px; text-align: left; border-radius: 0;
  background: #1b1e24; border: 2px solid #343a44;
}
.ask-opt:hover:not(:disabled) { border-color: #8a8f97; background: #20242b; }
.ask-opt.on { border-color: var(--accent); background: rgba(109, 187, 69, .13); box-shadow: 0 0 0 1px #2d6d20; }
.ask-opt.on::after { content: "✓"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 700; }
.ask-txt { display: grid; min-width: 0; flex: 1; line-height: 1.35; padding-right: 30px; }
.ask-txt b { font-size: 13px; }
.ask-txt small { color: var(--muted); font-size: 11.5px; }
.ask-opt .rec { position: absolute; right: 6px; top: 4px; font-style: normal; font-size: 10px; color: #ffd257; }
.ask-opt.on .rec { display: none; }
.ask-foot { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.ask-foot input { flex: 1; min-width: 120px; padding: 5px 8px; background: #111317; border: 1px solid #3a414c; border-radius: 0; font-size: 12.5px; }
.ask-foot button { padding: 4px 10px; font-size: 12px; border-radius: 0; }
button.ghost { background: transparent; }
.ask-change { display: none; margin-left: auto; padding: 1px 8px; font-size: 11.5px; background: transparent; border-radius: 0; color: var(--muted); }
.ev.ask.answered { padding: 6px 10px; opacity: .8; }
.ev.ask.answered .ask-opts, .ev.ask.answered .ask-foot, .ev.ask.answered .ask-why { display: none; }
.ev.ask.answered .ask-change { display: inline-block; }
.ev.ask.locked .ask-change, .ev.checklist.locked .ask-change { display: none; }

/* 游戏里的绿色按钮 */
.mc-btn {
  padding: 8px 18px; border-radius: 0; font-weight: 700; color: #fff; text-shadow: 1px 1px #1d4d13;
  background: #3c8527; border: 2px solid #000; box-shadow: inset 0 -4px #1d4d13, inset 2px 2px #5fb043;
}
.mc-btn:hover:not(:disabled) { background: #46992e; border-color: #000; }
.mc-btn:active:not(:disabled) { box-shadow: inset 0 -1px #1d4d13, inset 2px 2px #5fb043; transform: translateY(2px); }
.mc-btn.small { padding: 4px 12px; box-shadow: inset 0 -3px #1d4d13, inset 1px 1px #5fb043; }

/* 建造清单 */
.ev.checklist { padding: 10px 11px; background: #2b2417; border: 2px solid #120d05; box-shadow: inset 2px 2px #4d3f26, inset -2px -2px #1c160c; color: #eadcbc; }
.check-top { display: flex; align-items: center; gap: 8px; }
.check-top b { color: #e8b964; font-size: 14px; }
.check-top small { color: #bba887; }
.ev.checklist textarea { width: 100%; margin-top: 8px; padding: 6px 8px; resize: vertical; background: #1d180f; border: 1px solid #5c4626; color: #eadcbc; font-size: 12.5px; }
.check-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; }
.check-list li { display: flex; align-items: baseline; gap: 8px; font-size: 12.8px; }
.check-list li span { flex: none; width: 3.6em; color: #bba887; }
.check-list li b { font-weight: 600; }
.check-list li b.muted { color: #8d7f66; font-weight: 400; }
.check-list .ask-change { display: inline-block; color: #bba887; border-color: #5c4626; }
.check-meta { margin-top: 8px; font-size: 11.5px; color: #a8987a; }
.check-actions { display: flex; gap: 8px; margin-top: 10px; }
.check-actions .ghost { border-radius: 0; border-color: #5c4626; color: #e8b964; }
.ev.checklist.locked .check-actions, .ev.checklist.locked textarea { display: none; }

/* AI 正在修改的区域上方的标签 */
.job-label {
  position: absolute; z-index: 4; transform: translate(-50%, calc(-100% - 6px)); pointer-events: none;
  display: flex; align-items: center; gap: 7px; max-width: 280px; padding: 5px 10px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; color: #e8ebef;
  background: rgba(30, 34, 40, .92); border: 2px solid #000; box-shadow: inset 2px 2px #4a515c, inset -2px -2px #1a1d22;
}
.job-label span { overflow: hidden; text-overflow: ellipsis; }
.job-label .spin { width: 10px; height: 10px; flex: none; background: #c9ced6; animation: pix 1s steps(4) infinite; }
.job-label.ok { color: #c8f5a8; }
.job-label.ok .spin { background: var(--accent); animation: none; }
.job-label.fail { color: #ffb4ab; }
.job-label.fail .spin { background: var(--danger); animation: none; }

/* 盖法选择：AI 蓝图 / 自由建造 */
.ev.mode-pick { padding: 0; background: none; }
.mode-opts { display: grid; gap: 8px; }
.mode-opt {
  display: block; width: 100%; padding: 10px 11px; text-align: left; border-radius: 0; line-height: 1.45;
  background: #23272e; border: 2px solid #000; box-shadow: inset 2px 2px #3a404b, inset -2px -2px #121418;
}
.mode-opt:hover:not(:disabled) { border-color: var(--accent); }
.mode-head { display: flex; align-items: center; gap: 8px; }
.mode-head b { font-size: 14px; }
.mode-head .rec { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: #ffd257; }
.mode-what { margin: 6px 0 4px; font-size: 12.5px; color: #cfd5dc; }
.mode-pros { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.mode-pros li { position: relative; padding-left: 16px; }
.mode-pros li::before { position: absolute; left: 0; font-weight: 700; }
.mode-pros .good::before { content: "+"; color: var(--accent); }
.mode-pros .good { color: #d6ecc9; }
.mode-pros .bad::before { content: "−"; color: #ff8a7a; }
.mode-pros .bad { color: #f2c9c2; }
.mode-go { display: inline-block; margin-top: 8px; }
.mode-cancel { margin-top: 6px; padding: 3px 12px; font-size: 12px; border-radius: 0; }
.ev.mode-pick.locked .mode-opt:not(.on), .ev.mode-pick.locked .mode-cancel { display: none; }
.ev.mode-pick.locked .mode-opt.on { padding: 6px 10px; border-color: #2d6d20; pointer-events: none; }
.ev.mode-pick.locked .mode-opt.on > :not(.mode-head) { display: none; }

/* 模型菜单里的智商 */
.iq-pick { display: grid; gap: 4px; margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.iq-pick small.group { padding: 0 8px; font-size: 11px; color: var(--muted); }
.iq-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 4px; }
.chip-menu .iq-row button { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; text-align: center; border: 1px solid var(--line-2); border-radius: 8px; }
.chip-menu .iq-row button b { font-size: 14px; }
.chip-menu .iq-row button small { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.chip-menu .iq-row button.on { border-color: var(--accent); background: rgba(109, 187, 69, .14); }
.chip-menu .iq-row button.on::before { content: none; }
.iq-row.two { grid-template-columns: repeat(2, 1fr); }
.iq-hint { margin: 2px 8px 4px; font-size: 11px; line-height: 1.5; color: var(--muted); }

/* 右边面板：阶段分组，做完的折叠 */
.ev.grp { display: block; }
.grp-head {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 9px; text-align: left; border-radius: 0;
  background: #212121; border: 2px solid #000; box-shadow: inset 2px 2px #4a4a4a, inset -2px -2px #2c2c2c;
}
.grp-head:hover:not(:disabled) { border-color: #000; background: #262626; }
.grp-head .slot { width: 24px; height: 24px; background: transparent; box-shadow: none; }
.grp-head b { color: #ffff55; font-size: 13px; text-shadow: 1px 1px #3f3f15; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-sum { margin-left: auto; flex: none; color: var(--muted); font-size: 11px; white-space: nowrap; }
.ev.grp.live .grp-sum { color: #b6f07a; }
.ev.grp.live .grp-sum::after { content: ""; animation: dots 1.2s steps(4) infinite; }
.grp-arrow { flex: none; font-style: normal; color: var(--muted); transition: transform .2s; }
.ev.grp:not(.open) .grp-arrow { transform: rotate(-90deg); }
.ev.grp.empty .grp-arrow { visibility: hidden; }
.ev.grp.done .grp-head b { color: #d8d8a0; }
.grp-body { list-style: none; margin: 6px 0 0 12px; padding: 0 0 0 10px; display: flex; flex-direction: column; gap: 6px; border-left: 2px solid #2a2f37; }
.ev.grp:not(.open) .grp-body { display: none; }
.grp-body > li { animation: ev-in .26s ease-out; }

/* 开工前的弹窗 */
.build-card { width: min(600px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 18px 20px 16px; }
.bd-top { display: flex; align-items: flex-start; gap: 10px; }
.bd-top h2 { flex: 1; min-width: 0; margin: 1px 0 0; font-size: 17px; line-height: 1.4; }
.bd-step { flex: none; margin-top: 3px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent); box-shadow: inset -1px -1px #2d6d20; }
.bd-close { flex: none; padding: 2px 9px; background: transparent; border-color: transparent; font-size: 18px; color: var(--muted); }
.bd-dots { display: flex; gap: 4px; margin: 10px 0 12px; }
.bd-dots i { flex: 1; height: 4px; background: var(--line-2); }
.bd-dots i.done { background: var(--accent-2); }
.bd-dots i.on { background: var(--accent); box-shadow: 0 0 6px rgba(109, 187, 69, .6); }
.bd-dots[hidden] + .bd-body { margin-top: 12px; }
.bd-body { overflow-y: auto; min-height: 0; display: grid; gap: 10px; align-content: start; padding: 1px; }
.bd-why { margin: 0; color: var(--muted); font-size: 13px; }
.bd-multi { color: #55ffff; font-size: 12px; }
.bd-opts { display: grid; gap: 8px; }
.bd-opt {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 11px; text-align: left; border-radius: 0;
  background: #1b1e24; border: 2px solid #343a44;
}
.bd-opt:hover:not(:disabled) { border-color: #8a8f97; background: #20242b; }
.bd-opt.on { border-color: var(--accent); background: rgba(109, 187, 69, .13); box-shadow: 0 0 0 1px #2d6d20; }
.bd-opt.on::after { content: "✓"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 700; }
.bd-opt .rec { position: absolute; right: 8px; top: 5px; font-style: normal; font-size: 10.5px; color: #ffd257; }
.bd-opt.on .rec { display: none; }
.bd-opt .ask-txt b { font-size: 13.5px; }
.bd-custom { width: 100%; padding: 8px 10px; background: #111317; border: 1px solid #3a414c; border-radius: 0; font-size: 13px; }
.bd-label { font-size: 12.5px; color: var(--muted); }
.bd-check { display: grid; gap: 6px; padding: 10px 12px; background: #2b2417; border: 2px solid #120d05; box-shadow: inset 2px 2px #4d3f26, inset -2px -2px #1c160c; color: #eadcbc; }
.bd-check .bd-label { color: #e8b964; font-size: 13.5px; }
.bd-check textarea { width: 100%; padding: 6px 8px; resize: vertical; background: #1d180f; border: 1px solid #5c4626; color: #eadcbc; font-size: 12.5px; }
.bd-check .check-list { margin: 2px 0 0; }
.bd-modes { display: grid; gap: 8px; }
.bd-mode { display: block; width: 100%; text-align: left; border-radius: 0; line-height: 1.45; background: #23272e; border: 2px solid #000; box-shadow: inset 2px 2px #3a404b, inset -2px -2px #121418; }
.bd-mode.plan { padding: 14px 14px 12px; }
.bd-mode.plan .mode-head b { font-size: 16px; }
.bd-mode.plan .mode-pros { gap: 3px; font-size: 12.8px; }
.bd-mode.free { padding: 7px 12px; opacity: .85; }
.bd-mode.free .mode-head .slot { width: 22px; height: 22px; }
.bd-mode.free .mode-what { margin: 2px 0 0; font-size: 12px; }
.bd-mode:hover:not(:disabled) { border-color: #6d7480; opacity: 1; }
.bd-mode.on { border-color: var(--accent); background: rgba(109, 187, 69, .1); box-shadow: 0 0 0 1px #2d6d20, inset 2px 2px #3a404b; opacity: 1; }
.bd-mode.on .mode-head b::after { content: "  ✓ 已选"; font-size: 12px; color: var(--accent); }
.bd-meta { margin: 0; font-size: 11.5px; color: var(--muted); }
.bd-actions { align-items: center; margin-top: 12px; }
.bd-actions .grow { flex: 1; }
.bd-actions .ghost { border-radius: 0; }
@media (max-width: 560px) { .build-card { padding: 14px; } .bd-top h2 { font-size: 15.5px; } }
.ev.done-note { color: #b6f07a; }
.ev.done-note .tag { color: var(--accent); }
.grp-txt { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.grp-txt .grp-sum { margin-left: 0; white-space: normal; }

/* 像素还原 */
.px-card { width: min(820px, 100%); }
.px-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 4px; }
.px-wrap figure { margin: 0; display: grid; gap: 4px; min-width: 0; }
.px-wrap figcaption { font-size: 12px; color: var(--muted); }
.px-wrap img, .px-wrap canvas {
  width: 100%; aspect-ratio: 1; object-fit: contain; background: repeating-conic-gradient(#2a2f37 0 25%, #20242b 0 50%) 0 0 / 16px 16px;
  border: 1px solid var(--line-2); border-radius: 8px;
}
.px-wrap canvas { image-rendering: pixelated; }
.px-form { align-items: center; }
.px-range { display: flex; align-items: center; gap: 8px; }
.px-range input { flex: 1; }
.px-check { display: flex !important; flex-direction: row; align-items: center; gap: 5px; font-size: 12.5px !important; color: var(--text) !important; }
@media (max-width: 600px) { .px-wrap { grid-template-columns: 1fr; } }

/* 三视图 */
.tv-img { display: block; width: 100%; max-height: 52vh; object-fit: contain; margin: 6px 0; border-radius: 8px; border: 1px solid var(--line-2);
  background: repeating-conic-gradient(#2a2f37 0 25%, #20242b 0 50%) 0 0 / 16px 16px; }
.ev.tv-sheet img { display: block; width: 100%; border-radius: 6px; border: 1px solid var(--line-2); background: repeating-conic-gradient(#2a2f37 0 25%, #20242b 0 50%) 0 0 / 12px 12px; }
.ev.tv-sheet { display: grid; gap: 4px; }
.ev.tv-sheet small { font-size: 11.5px; color: var(--muted); }
.ev.tv-sheet button { justify-self: start; padding: 3px 10px; font-size: 12px; border-radius: 0; }

/* ================= 外壳：左侧板块、右上角账户 ================= */
.app { flex: 1; min-height: 0; display: flex; position: relative; }
.app > .main { flex: 1; min-width: 0; }
.sections {
  width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0;
  background: #121519; border-right: 1px solid var(--line); z-index: 21;
}
.sections > button, .sections > a {
  width: 60px; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 11.5px; text-decoration: none;
}
.sections > button:hover, .sections > a:hover { color: var(--text); background: var(--panel-2); border-color: transparent; }
.sections > [aria-current] { color: var(--text); background: rgba(109, 187, 69, .16); box-shadow: inset 3px 0 var(--accent); }
.sections > [aria-current] svg { stroke: var(--accent); }
.sections svg { width: 22px; height: 22px; }
.sections-sep { width: 36px; height: 1px; background: var(--line-2); margin: 6px 0; }
.sections .grow { flex: 1; }
.app > .page { position: absolute; top: 0; left: 72px; right: 0; bottom: 0; }
.topbar { grid-template-columns: auto 1fr auto auto; }
.account { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.credit-chip { display: flex; align-items: baseline; gap: 5px; padding: 4px 11px; border-radius: 999px; background: rgba(0, 0, 0, .25); }
.credit-chip b { font-variant-numeric: tabular-nums; color: #8fe3ff; }
.credit-chip small { color: var(--muted); font-size: 11px; }
.credit-chip.low b { color: var(--warn); }
.gem { width: 11px; height: 11px; display: inline-block; align-self: center; background: linear-gradient(135deg, #b5f3ff, #3fb8e8 60%, #1b6f9c); transform: rotate(45deg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.recharge-btn { padding: 4px 12px; }
.me-btn { display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border-radius: 999px; }
.me-btn canvas { width: 24px; height: 24px; image-rendering: pixelated; border-radius: 4px; background: #333; }
.me-btn span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .sections { width: 56px; }
  .sections > button, .sections > a { width: 48px; font-size: 10px; }
  .app > .page { left: 56px; }
  .me-btn span, .credit-chip small { display: none; }
}

/* 资产页的标签 */
.asset-tabs { margin-left: 8px; }
.btn-link { display: inline-block; padding: 3px 10px; font-size: 12px; border: 1px solid var(--line-2); border-radius: 8px; color: inherit; text-decoration: none; background: var(--panel-2); }
.btn-link:hover { border-color: var(--accent); }
.city-thumb { background: #2e4a26; }
.city-thumb img { image-rendering: pixelated; object-fit: cover; }

/* 灵感 */
.ins-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ins-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.ins-card:hover { border-color: var(--accent); }
.ins-card b { font-size: 15px; }
.ins-card p { margin: 0; font-size: 12.5px; flex: 1; }
.ins-card button { align-self: flex-start; padding: 4px 14px; }
.badge.city { background: rgba(80, 160, 230, .18); color: #8fc8ff; }

/* 市场 */
.mk-card .lib-thumb .badge.kind { position: absolute; top: 8px; left: 8px; }
.mk-desc { margin: 2px 0 0; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-actions .like.on { color: #ff7a8a; border-color: #ff7a8a; }
.lib-actions .small { font-size: 11.5px; align-self: center; margin-left: auto; }
#marketSearch { margin-left: auto; width: 220px; }

/* 充值 */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.rc-opt { display: grid; gap: 2px; padding: 12px; text-align: left; border-radius: 10px; }
.rc-opt b { font-size: 15px; color: #8fe3ff; }
.rc-opt em { font-style: normal; font-size: 11.5px; color: var(--warn); }
.rc-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(109, 187, 69, .1); }
.rc-pay { display: grid; gap: 8px; }
.rc-methods { display: flex; gap: 8px; }
.rc-methods button { flex: 1; }
.rc-costs { margin-top: 12px; font-size: 12.5px; }
.rc-costs ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); columns: 2; }
.small { font-size: 12px; }

/* 投稿 */
.post-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 240px; overflow: auto; margin: 6px 0 12px; }
.post-opt { display: grid; gap: 4px; padding: 6px; text-align: left; font-size: 12px; }
.post-opt img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; background: #9fc9f5; }
.post-opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#postDialog input, #postDialog textarea { width: 100%; margin-bottom: 10px; }

/* 个人空间 */
.me-inner { max-width: 980px; }
.me-head { display: flex; align-items: center; gap: 16px; margin: 14px 0 18px; }
.me-avatar { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 10px; background: #333; box-shadow: 0 0 0 2px var(--line-2); }
.me-who { flex: 1; display: grid; gap: 2px; }
.me-who .title-input { font-size: 18px; font-weight: 700; max-width: 320px; }
.me-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.me-card { display: grid; gap: 4px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.me-card small { color: var(--muted); }
.me-card b { font-size: 24px; font-variant-numeric: tabular-nums; }
.me-card button { justify-self: start; margin-top: 4px; }
.me-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ledger li { display: flex; gap: 12px; align-items: baseline; padding: 7px 10px; background: var(--panel); border-radius: 8px; font-size: 13px; }
.ledger li .grow { flex: 1; }
.ledger li b { font-variant-numeric: tabular-nums; }
.ledger li.in b { color: var(--accent); }
.ledger li.out b { color: #ffb3a8; }

/* ================= 大城市板块 ================= */
.city-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.cy-stage .status { z-index: 3; }
.cy-viewbar { z-index: 3; }
.cy-map { position: absolute; right: 12px; bottom: 12px; z-index: 3; padding: 4px; background: var(--glass); border: 1px solid rgba(255, 255, 255, .08); border-radius: 10px; }
.cy-map canvas { display: block; width: 180px; height: 180px; image-rendering: pixelated; cursor: crosshair; border-radius: 6px; }
.cy-preview { position: absolute; inset: 60px 0 150px; display: grid; place-items: center; align-content: center; gap: 8px; z-index: 2; pointer-events: none; }
.cy-preview img { max-width: min(70%, 640px); max-height: 100%; image-rendering: pixelated; border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.cy-preview span { font-size: 12px; color: #1d2a38; background: rgba(255, 255, 255, .6); padding: 2px 10px; border-radius: 999px; }
.cy-empty { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); z-index: 2; text-align: center; padding: 22px 24px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; }
.cy-empty h2 { margin: 0 0 8px; font-size: 22px; }
.cy-empty p { margin: 0 0 14px; font-size: 13px; line-height: 1.7; }
.cy-ideas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cy-ideas button { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; }
.cy-composer { z-index: 4; }
.cy-cost { font-size: 11.5px; margin-right: 4px; }
.chip-opt { display: grid; gap: 1px; width: 100%; text-align: left; padding: 6px 10px; background: transparent; border-color: transparent; }
.chip-opt small { color: var(--muted); font-size: 11.5px; }
.chip-opt.on { background: rgba(109, 187, 69, .16); border-color: var(--accent); }
.chip-opt.mini { display: inline-block; width: auto; margin: 2px; }
.iq-row { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.cy-tip { position: absolute; z-index: 5; width: 240px; display: grid; gap: 4px; padding: 10px 12px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; font-size: 13px; }
.cy-tip-acts { display: flex; gap: 6px; margin-top: 4px; }
.cy-tip-acts button { padding: 3px 9px; font-size: 12px; }
.cy-log .ev { padding: 5px 8px; font-size: 13px; }
.cy-log .ev.me { background: rgba(109, 187, 69, .12); border-radius: 8px; }
.cy-log .ev.phase { font-weight: 700; margin-top: 8px; color: var(--text); }
.cy-log .ev.phase.done { color: var(--accent); }
.cy-log .ev.note { color: var(--muted); font-size: 12.5px; }
.cy-log .ev.note.err { color: var(--danger); }
.cy-log .ev.note.change { color: #cfe6b8; }
.cy-log .ev.live { color: var(--muted); font-style: italic; }
.cy-log .ev.book pre { white-space: pre-wrap; margin: 4px 0 0; font: inherit; font-size: 12.5px; line-height: 1.65; }
.cy-log .ev.book small, .cy-report small { color: var(--accent); font-weight: 700; }
.cy-report { background: rgba(0, 0, 0, .18); border-radius: 8px; }
.cy-checks { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.cy-checks .ok { color: #bfe6a3; }
.cy-checks .warn { color: var(--warn); }
.cy-report details p { margin: 4px 0; font-size: 12px; }
.cy-stats { grid-template-columns: repeat(3, 1fr); }
.cy-share { font-size: 12px; margin: 4px 0 10px; }
.cy-section { margin-top: 14px; display: grid; gap: 6px; }
.cy-section h3 { margin: 6px 0 2px; font-size: 13.5px; }
.cy-section textarea { width: 100%; resize: vertical; }
.cy-find { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.cy-find span { flex: 1; }
.cy-find button { padding: 1px 8px; font-size: 11.5px; flex: none; }
.cy-row { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 6px 10px; }
.cy-row.on { border-color: var(--accent); }
.cy-row span { font-size: 12px; }
.primary-link { text-align: center; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 7px 10px; }
.primary-link:hover { background: var(--accent-2); }
.btn-link.wide { display: block; }
.topbar > .brand { grid-column: 1; }
.topbar > .title-wrap { grid-column: 2; }
.topbar > .top-actions { grid-column: 3; }
.topbar > .account { grid-column: 4; }

/* ================= 红石机关板块（/redstone/app.js） ================= */
.rs-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.rs-stage .status { z-index: 3; }
.rs-viewbar { z-index: 3; }
.rs-composer { z-index: 4; }
.rs-empty { border-color: rgba(229, 64, 52, .45); }
.rs-current { display: grid; gap: 2px; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid rgba(229, 64, 52, .45); }
.rs-current small { color: var(--muted); font-size: 12px; }
.rs-activity { margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 12.5px; }
.rs-activity::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 2px; background: #e5463a; animation: rs-blink 1s steps(2) infinite; }
@keyframes rs-blink { 50% { opacity: .25; } }

.rs-log-list > li { padding: 5px 8px; border-radius: 8px; background: var(--panel-2); line-height: 1.45; }
.rs-log-list > li.group { background: transparent; padding: 8px 2px 2px; color: var(--muted); font-weight: 700; font-size: 12px; }
.rs-log-list > li.bad .name { color: var(--danger); }
.rs-log-list > li.ok .name::before { content: "✔ "; color: var(--accent); }
.rs-log-list > li.bad .name::before { content: "✘ "; }
.rs-log-list > li.note { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); font-size: 12.5px; }
.rs-log-list > li.say { background: rgba(229, 64, 52, .1); border: 1px solid rgba(229, 64, 52, .3); white-space: pre-wrap; }
.rs-log-list > li.say b { display: block; color: #ff8f85; font-size: 12px; margin-bottom: 2px; }
.rs-log-list > li.say.me { background: rgba(109, 187, 69, .12); border-color: transparent; }
.rs-log-list > li.error { background: rgba(255, 130, 119, .12); color: var(--danger); }
.rs-log-list > li.phase { background: transparent; color: var(--accent); font-size: 12.5px; }
.rs-log-list .res { display: block; }

.rs-circuit-meta { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
.rs-circuit-meta b.ok { color: var(--accent); }
.rs-circuit-meta b.bad { color: var(--danger); }
.rs-circuit {
  margin: 0; padding: 10px 12px; border-radius: 10px; background: #0f1215; border: 1px solid var(--line);
  font: 12px/1.55 ui-monospace, Consolas, "Microsoft YaHei", monospace; white-space: pre; overflow: auto; max-height: calc(100vh - 220px);
}
.rs-tests-sum { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.rs-tests-sum:empty { display: none; }
.rs-tests-sum .ok { color: var(--accent); }
.rs-tests-sum .bad { color: var(--danger); }

.rs-works { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.rs-works li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.rs-works li:hover { border-color: #e5463a; }
.rs-works li.current { border-color: #e5463a; box-shadow: inset 3px 0 0 #e5463a; }
.rs-works .grow { flex: 1; min-width: 0; }
.rs-works .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-works small { color: var(--muted); }
.rs-works button { padding: 0 8px; height: 26px; color: var(--muted); background: transparent; border-color: transparent; }
.rs-works button:hover { color: var(--danger); }

/* 红石试玩面板（/redstone.js）：场景左上角，可收起 */
.rs-panel {
  position: absolute; top: 56px; left: 12px; z-index: 3; width: 300px; max-height: calc(100% - 230px); overflow-y: auto;
  display: grid; gap: 7px; padding: 9px 10px; font-size: 12.5px;
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid rgba(229, 64, 52, .55); border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.rs-panel[hidden] { display: none; }
.rs-panel.folded > :not(.rs-head) { display: none; }
.rs-head { display: flex; align-items: center; gap: 8px; }
.rs-head b { color: #ff6b5e; }
.rs-head .rs-time { color: var(--muted); font: 12px ui-monospace, Consolas, monospace; margin-left: auto; }
.rs-head .icon { padding: 0 6px; color: var(--muted); }
.rs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.rs-row button, .rs-row select { padding: 3px 8px; font-size: 12px; }
.rs-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rs-io { display: flex; flex-wrap: wrap; gap: 5px; }
.rs-io button { padding: 3px 9px; font-size: 12px; }
.rs-io button.on { border-color: #e54034; color: #ffb3ab; }
.rs-io.out span { padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 12px; }
.rs-io.out span.on { background: rgba(255, 200, 90, .18); color: #ffd98a; }
.rs-info { margin: 0; max-height: 180px; overflow-y: auto; white-space: pre-wrap; font: 11.5px/1.5 ui-monospace, Consolas, "Microsoft YaHei", monospace; background: rgba(0, 0, 0, .25); border-radius: 8px; padding: 6px 8px; }
.rs-tests { display: grid; gap: 4px; }
.rs-test { display: flex; align-items: center; gap: 6px; }
.rs-test .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-test .ok { color: var(--accent); }
.rs-test .bad { color: var(--danger); }
.rs-test button { padding: 2px 8px; font-size: 12px; }
.rs-replay { display: grid; gap: 4px; }
.rs-replay[hidden] { display: none; }
.rs-track { position: relative; padding-bottom: 8px; }
.rs-track input { width: 100%; }
.rs-marks { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; pointer-events: none; }
.rs-marks i { position: absolute; bottom: 0; width: 2px; height: 8px; background: var(--accent); }
.rs-marks i.bad { background: var(--danger); width: 3px; }
.rs-replay-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.rs-log { margin: 0; padding-left: 16px; max-height: 110px; overflow-y: auto; color: var(--muted); font-size: 12px; }
.rs-log:empty { display: none; }
@media (max-width: 720px) {
  .rs-panel { width: calc(100% - 24px); max-height: 40%; }
}
