/* Eggs 机制原型：没有美术，只有方块。颜色只表达意思：品阶（铜银金晶）、好 / 警告 / 坏、上帝视角（紫色）。 */
:root {
  --bg: #f3f1ec;
  --panel: #ffffff;
  --panel2: #faf9f6;
  --ink: #23221f;
  --muted: #8a867e;
  --line: #d9d5cc;
  --line2: #c4beb2;
  --accent: #2f6fd0;
  --good: #2e8a4a;
  --warn: #b8740c;
  --bad: #c23a2b;
  --god: #7d4bd6;
  --g1: #c0703a;
  --g2: #8796ab;
  --g3: #c39a12;
  --g4: #8a63e6;
  --g1b: #fbf0e8;
  --g2b: #eef1f6;
  --g3b: #fbf5df;
  --g4b: #f2edfd;
  --side-w: 380px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--ink); }
#app { display: flex; flex-direction: column; height: 100vh; }
b { font-weight: 600; }
a { color: var(--accent); cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.god { color: var(--god); font-style: italic; }
.grow { flex: 1; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 3px 0; }
.lbl { color: var(--muted); min-width: 3em; }

/* ---------- 按钮 ---------- */
.btn { font: inherit; font-size: 12px; padding: 3px 9px; border: 1px solid var(--line2); background: #fff; color: var(--ink); border-radius: 3px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #000; }
.btn.ghost { background: transparent; border-style: dashed; }
.btn.sm { padding: 1px 7px; font-size: 12px; }
.btn.xs { padding: 0 5px; font-size: 11px; line-height: 16px; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.tgl { border-style: dashed; }
.btn.tgl.on { background: #e9e5ff; color: var(--god); border-color: var(--god); border-style: solid; }
label.btn { display: inline-block; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 3px 0 0 3px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 3px 3px 0; }
button.x { border: 0; background: none; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
button.x:hover { color: var(--bad); }

/* ---------- 进度条 ---------- */
.bar { position: relative; display: block; height: 15px; background: #ece9e2; border-radius: 2px; overflow: hidden; margin: 2px 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #b9c7d8; }
.bar b { position: relative; font-size: 11px; font-weight: 500; padding: 0 5px; line-height: 15px; white-space: nowrap; }
.bar.good i { background: #9fd3ae; }
.bar.warn i { background: #f0c98a; }
.bar.bad i { background: #f1a49a; }
.bar.vit i { background: #c9dfb0; }
.bar.hun i { background: #f3dcb8; }
.bar.prod i { background: #d6c8f0; }
.bar.day { width: 120px; height: 6px; display: inline-block; vertical-align: middle; }
.bar.day i { background: var(--warn); }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 6px 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5; }
.tb-group { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.tb-title b { font-size: 14px; }
.tb-time .big { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 8.5em; }
.tb-quest { cursor: pointer; max-width: 420px; }
.tb-toggles { margin-left: auto; }
.tag { display: inline-block; padding: 0 6px; border-radius: 2px; background: #ece9e2; font-size: 11px; margin: 1px 2px 1px 0; }
.tag.off { background: transparent; border: 1px dashed var(--line2); color: var(--muted); }
.coin { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3em; }
.coin i { font-style: normal; font-size: 11px; font-weight: 600; color: #fff; width: 17px; height: 17px; display: inline-grid; place-items: center; border-radius: 50%; }
.c-cu i { background: var(--g1); }
.c-ag i { background: var(--g2); }
.c-au i { background: var(--g3); }
.c-cr i { background: var(--g4); }

/* ---------- 主体 ---------- */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); }
.board-wrap { overflow: auto; padding: 16px 12px 40px 24px; min-width: 0; }
.board {
  position: relative;
  --arrows: 1;
  display: grid;
  grid-template-columns: 262px 58px repeat(4, minmax(140px, 1fr));
  column-gap: 14px;
  row-gap: 34px;
  align-items: start;
  grid-template-areas:
    'eyrie    .     storage storage incubator incubator'
    'market   .     home    home    home      home'
    'merchant .     home    home    home      home'
    'mail     .     ground  bag      stall     purse'
    'work     work     research research build   build'
    'tech     tech     tech     lab      lab     lab'
    'contract contract elders   codex    econ    econ'
    'quest    quest    log      log      econ    econ';
}
svg.arrows { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.edge { fill: none; stroke: #b4ad9f; stroke-width: 1.6; }
.edge.money { stroke: #d1a53c; stroke-dasharray: 6 4; }
.edge.back { stroke: #6f9bd0; stroke-dasharray: 3 3; }
.edge.hot { stroke: #e2572e; stroke-width: 3; stroke-dasharray: none; }
.ah { fill: #b4ad9f; }
.ah.money { fill: #d1a53c; }
.ah.back { fill: #6f9bd0; }
.ah.hot { fill: #e2572e; }
.elabel rect { fill: var(--bg); }
.elabel text { font-size: 11px; fill: #6d685f; }
.elabel.money text { fill: #a07a1c; }
.elabel.back text { fill: #4a78ae; }
.elabel.hot text { fill: #e2572e; font-weight: 600; }

/* ---------- 方块 ---------- */
.box, .bld { position: relative; z-index: 1; background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; min-width: 0; }
.box.sel, .lot.sel .bld { outline: 2px solid var(--accent); outline-offset: 1px; }
.box > header, .bld > header { display: flex; align-items: baseline; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--line); background: var(--panel2); cursor: pointer; user-select: none; }
.box > header:hover, .bld > header:hover { background: #f0ede6; }
.box > header b, .bld > header b { font-size: 13px; }
.lv { font-size: 11px; font-weight: 600; padding: 0 4px; background: var(--ink); color: #fff; border-radius: 2px; }
.sub { font-size: 11px; color: var(--muted); }
.more { margin-left: auto; color: var(--muted); }
.box > .body, .bld > .body { padding: 6px 8px 8px; }
.box.src { border-left: 4px solid #a9a294; }
.box.off { opacity: 0.75; }
.foot { margin-top: 5px; font-size: 12px; }

/* 地块：虚线 = 满级时的地；实心 = 现在的建筑；旁边是下一级的预告 */
.lot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; padding: 6px; border: 1.5px dashed var(--line2); border-radius: 4px; background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0, 0, 0, 0.018) 8px 16px); min-width: 0; }
.bld { flex: 0 1 auto; max-width: 100%; }
.next { flex: 1 1 110px; min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; padding: 6px 8px; border: 1px dashed var(--line2); border-radius: 3px; font-size: 12px; }
.next.max { align-items: center; }

/* ---------- 蛋格 ---------- */
.cells { display: grid; gap: 4px; }
.cells.cols3 { grid-template-columns: repeat(3, 52px); }
.cells.cols5 { grid-template-columns: repeat(5, 52px); }
.cells.cols6 { grid-template-columns: repeat(6, 52px); }
.egg { width: 52px; height: 52px; border: 2px solid var(--line2); border-radius: 3px; padding: 2px 3px; font-size: 11px; line-height: 1.25; cursor: pointer; overflow: hidden; background: #fff; }
.egg .en { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.egg .es { font-size: 9px; letter-spacing: -1px; color: #9a8f6c; }
.egg .ed { font-size: 10px; color: var(--muted); display: flex; justify-content: space-between; }
.egg .og { color: #aaa; }
.egg.empty { border-style: dashed; border-width: 1px; background: transparent; cursor: default; }
.egg.over { border-color: var(--bad); color: var(--bad); display: grid; place-items: center; }
.egg.wrapped { background: #2b2830; color: #ddd; border-color: #2b2830; }
.egg.exp { box-shadow: inset 0 0 0 2px #f1a49a; }
.egg.sel { outline: 2px solid var(--accent); }
.g1 { border-color: var(--g1); }
.g2 { border-color: var(--g2); }
.g3 { border-color: var(--g3); }
.g4 { border-color: var(--g4); }
.egg.g1, .offer.g1, .nest.g1 { background: var(--g1b); }
.egg.g2, .offer.g2, .nest.g2 { background: var(--g2b); }
.egg.g3, .offer.g3, .nest.g3 { background: var(--g3b); }
.egg.g4, .offer.g4, .nest.g4 { background: var(--g4b); }
.gt { display: inline-block; font-size: 10px; font-weight: 700; color: #fff; padding: 0 3px; border-radius: 2px; line-height: 15px; }
.gt.g0 { background: #2b2830; }
.gt.g1 { background: var(--g1); }
.gt.g2 { background: var(--g2); }
.gt.g3 { background: var(--g3); }
.gt.g4 { background: var(--g4); }

/* ---------- 野外 ---------- */
.nest-row { display: flex; align-items: stretch; gap: 3px; margin: 3px 0; }
.hab { width: 44px; flex: none; font-size: 12px; line-height: 1.2; padding-top: 2px; }
.hab i { display: block; font-style: normal; font-size: 10px; color: var(--muted); }
.nest { width: 58px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1.5px solid var(--line2); border-radius: 3px; padding: 1px 3px 2px; font-size: 11px; line-height: 1.25; cursor: pointer; background: #fff; }
.nest.taken { border-style: dashed; background: transparent; justify-content: center; }
.nest.sel { outline: 2px solid var(--accent); }
.nest .en { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.nest .god { font-size: 10px; }

/* ---------- 货架 ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.offer { border: 1.5px solid var(--line2); border-radius: 3px; padding: 3px; font-size: 11px; line-height: 1.3; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.offer .en { font-weight: 600; font-size: 12px; }
.offer.sold { opacity: 0.45; }
.offer .btn { align-self: flex-start; }

/* ---------- 信 ---------- */
.mail-list { list-style: none; margin: 0; padding: 0; max-height: 190px; overflow: auto; }
.mail-list.full { max-height: none; }
.mail-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; padding: 3px 2px; border-bottom: 1px dotted var(--line); font-size: 12px; cursor: pointer; }
.mail-list li > span:not(.kind) { flex: 1 1 100%; color: #555; }
.mail-list li.read { color: var(--muted); }
.mail-list li.sel { background: #eef3fb; }
.mail-list li .btn { margin-left: auto; }
.kind { font-size: 10px; padding: 0 4px; border-radius: 2px; color: #fff; background: #999; }
.k-card { background: #c07a3a; }
.k-request { background: #2f6fd0; }
.k-gift { background: #2e8a4a; }
.k-letter { background: #a09a8e; }

/* ---------- 孵化槽 ---------- */
.slots { display: grid; gap: 5px; }
.slots.cols2 { grid-template-columns: repeat(2, 104px); }
.slots.cols3, .slots.cols4 { grid-template-columns: repeat(3, 104px); }
.slot { border: 2px solid var(--line2); border-radius: 3px; padding: 3px 4px; font-size: 11px; cursor: pointer; background: #fff; display: flex; flex-direction: column; gap: 1px; min-height: 92px; }
.slot .row { margin: 0; }
.slot.empty { border-style: dashed; border-width: 1px; background: transparent; justify-content: center; }
.slot.ready { box-shadow: 0 0 0 3px #bfe6c9; }
.slot.sel { outline: 2px solid var(--accent); }
.slot .bar { height: 13px; }
.slot .bar b { line-height: 13px; font-size: 10px; }

/* ---------- 生物 ---------- */
.crs { display: grid; gap: 6px; }
.crs.cols2 { grid-template-columns: repeat(2, minmax(132px, 168px)); }
.crs.cols3 { grid-template-columns: repeat(3, minmax(132px, 168px)); }
.crs.cols4 { grid-template-columns: repeat(4, minmax(132px, 168px)); }
.cr { border: 2px solid var(--line2); border-radius: 3px; padding: 4px 5px; font-size: 12px; cursor: pointer; background: #fff; display: flex; flex-direction: column; gap: 1px; }
.cr .row { margin: 0; gap: 3px; flex-wrap: nowrap; }
.cr .row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr.empty { border-style: dashed; border-width: 1px; color: var(--muted); background: transparent; min-height: 60px; display: grid; place-items: center; cursor: default; }
.cr.sel { outline: 2px solid var(--accent); }
.cr.outside { opacity: 0.7; border-style: dashed; }
.need { border: 1px solid; border-radius: 3px; padding: 1px 4px; font-size: 11px; display: flex; align-items: center; gap: 4px; background: #fffdf6; }
.need .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.chip { font: inherit; font-size: 11px; border: 1px solid var(--line2); background: #fff; border-radius: 3px; padding: 0 4px; cursor: pointer; line-height: 18px; }
.chip i { font-style: normal; font-size: 9px; color: var(--muted); margin-left: 1px; }
.chip.cd { background: #f1efe9; color: var(--muted); }
.chip.want { border-color: #e46c8f; background: #ffeaf0; color: #b23a5c; font-weight: 600; }
.chip:hover { border-color: var(--ink); }
.chips.big .chip { font-size: 13px; padding: 2px 8px; }
.pending { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.pend { border: 1px solid #e0b25a; background: #fff8e8; border-radius: 3px; padding: 4px 6px; font-size: 12px; }
.pend.breed { border-color: #e46c8f; background: #fff0f4; }
.pend .opts { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.nestEggs { font-size: 12px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 3px 6px; background: #eef4fb; border-radius: 3px; }
.pairhint { font-size: 12px; background: #eef3fb; padding: 3px 6px; border-radius: 3px; margin-bottom: 5px; display: flex; gap: 6px; align-items: center; }
.outside-row { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line2); }
.aff { margin-top: 8px; overflow-x: auto; }
.affm { border-collapse: collapse; font-size: 11px; }
.affm th { font-weight: 500; color: var(--muted); padding: 1px 4px; text-align: right; white-space: nowrap; }
.affm td { width: 30px; text-align: center; padding: 1px 0; border: 1px solid #fff; cursor: pointer; font-variant-numeric: tabular-nums; }
.affm td.self { background: #eee; cursor: default; }
.al0 { background: #f4f2ee; color: #aaa; }
.al1 { background: #e8eef6; }
.al2 { background: #d6e6f6; }
.al3 { background: #f6dfe8; }
.al4 { background: #f2b4c8; font-weight: 700; }
.affm td.breed { box-shadow: inset 0 0 0 2px #c23a6a; }

/* ---------- 地上 / 背包 ---------- */
.drops { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; max-height: 150px; overflow: auto; }
.drop { font: inherit; font-size: 11px; border: 1.5px solid var(--line2); border-radius: 3px; background: #fff; padding: 0 4px; cursor: pointer; line-height: 18px; }
.drop.mat { border-style: dotted; color: #6d685f; }
.drop i { font-style: normal; color: var(--good); font-size: 10px; margin-left: 2px; }
.drop:hover { border-color: var(--ink); }
.bag { max-height: 200px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.bag-sec { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.bag-sec > i { font-style: normal; font-size: 11px; color: var(--muted); width: 2.4em; }
.it { font-size: 11px; border: 1px solid var(--line); border-radius: 2px; padding: 0 4px; background: #fff; white-space: nowrap; }
.it.rare { border-color: var(--warn); color: var(--warn); }
.it.dish { border-color: var(--good); }
.coins { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
.ledger { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.ledger li { display: flex; justify-content: space-between; gap: 6px; }
.ledger li.in b, tr.in td:nth-child(2), td.in { color: var(--good); }
.ledger li.out b, tr.out td:nth-child(2), td.out { color: var(--bad); }

/* ---------- 工坊 / 建筑 / 图鉴 ---------- */
.mods { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.mod { font-size: 11px; border: 1px solid var(--line2); border-radius: 2px; padding: 0 4px; }
.mod.locked { border-style: dashed; color: var(--muted); }
.builds { border-collapse: collapse; width: 100%; font-size: 12px; }
.builds th { text-align: left; font-weight: 600; white-space: nowrap; padding: 2px 6px 2px 0; }
.builds td { padding: 2px 4px; vertical-align: middle; }
.pips { white-space: nowrap; }
.pips i { display: inline-block; width: 9px; height: 9px; border: 1px solid var(--ink); margin-right: 2px; }
.pips i.on { background: var(--ink); }
.rings { margin-top: 8px; }
.ring { border: 1.5px solid var(--good); border-radius: 4px; padding: 3px 5px 5px; font-size: 11px; background: rgba(46, 138, 74, 0.04); }
.ring.fog { border-style: dashed; border-color: var(--line2); background: repeating-linear-gradient(45deg, #f4f2ee 0 6px, #ece9e2 6px 12px); color: var(--muted); }
.ring > .ring { margin-top: 3px; }
.ring-h { margin-bottom: 1px; }
.codex-grid { display: grid; grid-template-columns: repeat(10, 12px); gap: 2px; margin-bottom: 5px; }
.codex-grid i { width: 12px; height: 12px; border: 1px solid var(--line2); }
.codex-grid i.hy { border-style: dotted; }
.codex-grid i.on { background: var(--good); border-color: var(--good); }
.codex-grid i.hint { background: #f0e2b0; }
.quests { margin: 0; padding-left: 20px; font-size: 12px; }
.quests li.done { color: var(--muted); text-decoration: line-through; }
.quests li.cur { font-weight: 600; }
.log { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 210px; overflow: auto; }
.log.full { max-height: 420px; }
.log li { padding: 1px 0; border-bottom: 1px dotted #ebe8e1; }
.hist { border-collapse: collapse; font-size: 12px; width: 100%; font-variant-numeric: tabular-nums; }
.hist th { text-align: left; font-weight: 500; color: var(--muted); padding: 1px 4px; }
.hist td { padding: 1px 4px; border-top: 1px solid #ebe8e1; }
.spark { width: 100%; height: 40px; display: block; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; }

/* ---------- 侧栏 ---------- */
.side { overflow: auto; border-left: 1px solid var(--line); background: var(--panel2); display: flex; flex-direction: column; }
.side-h { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; cursor: pointer; }
.side-h b { margin-right: auto; }
.issues { border-bottom: 1px solid var(--line); }
.issue-list { list-style: none; margin: 0; padding: 4px 8px 6px; max-height: 210px; overflow: auto; font-size: 12px; }
.issue-list li { padding: 2px 6px 2px 8px; margin: 2px 0; border-left: 3px solid var(--line2); cursor: pointer; }
.issue-list li:hover { background: #f0ede6; }
.issue-list li.bad { border-color: var(--bad); }
.issue-list li.warn { border-color: var(--warn); }
.issue-list li.info { border-color: #9db5d6; color: #555; }
.insp { flex: 1; }
.panel { padding: 0 12px 16px; }
.panel-h { display: flex; align-items: baseline; gap: 8px; padding: 10px 0 6px; position: sticky; top: 0; background: var(--panel2); z-index: 1; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.panel-h b { font-size: 15px; }
.panel.intro h3 { margin: 12px 0 6px; }
.panel.intro p, .panel.intro li { font-size: 12px; color: #4a4741; }
.panel.intro ul { padding-left: 18px; }
.sec { margin: 10px 0; }
.sec h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.sec h5 { margin: 8px 0 2px; font-size: 12px; color: var(--muted); }
.rule { font-size: 11px; color: #6d685f; background: #f1eee7; border-left: 3px solid var(--line2); padding: 4px 6px; margin: 6px 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 4px 0; font-size: 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; }
.panel table { border-collapse: collapse; width: 100%; font-size: 12px; }
.panel table th { text-align: left; font-weight: 600; padding: 2px 6px 2px 0; vertical-align: top; }
.panel table td { padding: 2px 4px; border-top: 1px solid #ebe8e1; vertical-align: middle; }
.panel table tr.cur { background: #eef3fb; }
.panel table tr.muted td, .panel table tr.muted th { color: var(--muted); }
.panel table tr[onclick], .panel .eggs tr, .panel .nests tr, .panel .crs-t tr { cursor: pointer; }
.pick { display: flex; flex-wrap: wrap; gap: 3px; }
.letter { background: #fffdf7; border: 1px solid #efe6cf; padding: 6px 8px; font-size: 12px; white-space: pre-wrap; }
.mem { margin: 0; padding-left: 16px; font-size: 12px; }
.flows { display: flex; flex-wrap: wrap; }
.bank .row { margin: 2px 0; }
.notes { border-top: 1px solid var(--line); background: var(--panel); position: sticky; bottom: 0; }
.notes textarea { width: calc(100% - 16px); margin: 6px 8px 2px; font: inherit; font-size: 12px; resize: vertical; border: 1px solid var(--line2); border-radius: 3px; padding: 4px 6px; }
.note-list { list-style: none; margin: 0; padding: 0 8px 6px; max-height: 120px; overflow: auto; font-size: 12px; }
.note-list li { padding: 2px 0; border-bottom: 1px dotted var(--line); display: flex; gap: 4px; align-items: baseline; }
.note-list li button.x { margin-left: auto; font-size: 13px; }

/* ---------- 提示 ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(calc(-50% - var(--side-w) / 2)); bottom: 14px; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; z-index: 50; width: min(560px, 90vw); pointer-events: none; }
.toast { pointer-events: auto; background: rgba(43, 42, 39, 0.94); color: #fff; padding: 5px 12px; border-radius: 3px; font-size: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); cursor: pointer; border-left: 4px solid #777; max-width: 100%; }
.toast:nth-child(n + 3) { opacity: 0.7; }
@media (max-width: 1320px) { .toasts { transform: translateX(-50%); } }
.toast.good { border-left-color: #5bc47a; }
.toast.warn { border-left-color: #f0a830; }
.toast.bad { border-left-color: #f06050; }

/* ---------- 窄屏：侧栏改成抽屉，网格两列、一列；连线不画 ---------- */
@media (max-width: 1320px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--side-w), 100vw); z-index: 30; box-shadow: -4px 0 18px rgba(0, 0, 0, 0.15); transform: translateX(105%); transition: transform 0.15s; }
  .side.open { transform: none; }
}
@media (min-width: 1321px) {
  .tb-toggles .btn.ghost { display: none; }
}
@media (max-width: 1040px) {
  .board {
    --arrows: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 12px;
    grid-template-areas:
      'eyrie     market'
      'merchant  mail'
      'storage   storage'
      'incubator incubator'
      'home      home'
      'ground    bag'
      'stall     purse'
      'work      research'
      'build     codex'
      'contract  elders'
      'tech      tech'
      'lab       lab'
      'quest     log'
      'econ      econ';
  }
  .board-wrap { padding: 10px; }
  svg.arrows { display: none; }
  .crs.cols2, .crs.cols3, .crs.cols4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 640px) {
  .board { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'eyrie' 'market' 'merchant' 'mail' 'storage' 'incubator' 'home' 'ground' 'bag' 'stall' 'purse' 'work' 'research' 'build' 'contract' 'tech' 'lab' 'codex' 'elders' 'quest' 'log' 'econ'; }
  .board-wrap { padding: 8px 16px; }
  .topbar { padding: 6px 10px; gap: 4px 10px; }
  .cells.cols5, .cells.cols6 { grid-template-columns: repeat(auto-fill, 52px); }
  .slots.cols2, .slots.cols3, .slots.cols4 { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---------- 好几座生物之家（2026-11-22）---------- */
.homes { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.homes > .lot { width: 100%; }
.lot.newhome { border-color: var(--good); background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(46, 138, 74, 0.04) 8px 16px); }
.lot.newhome .next { border: 0; }
.next .btn { white-space: nowrap; }
table.research { border-collapse: collapse; width: 100%; font-size: 12px; }
table.research th { text-align: left; font-weight: 600; white-space: nowrap; padding: 1px 6px 1px 0; vertical-align: top; }
table.research td { padding: 1px 4px; border-top: 1px solid #ebe8e1; vertical-align: middle; }
.btn.danger { border-color: var(--bad); color: var(--bad); }

/* ---------- 照料重做 + 撮合 + 托管（2026-11-22）---------- */
.chip.done { background: #eef6ef; color: var(--good); border-color: #b9dcc2; }
.chip.done i { color: var(--good); }
.match { color: #b23a5c; }
.homebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.autos { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line2); }
.intel { margin: 4px 0; padding: 4px 8px; background: #f3f0fb; border-left: 3px solid var(--god); font-size: 12px; }
.intel li { margin: 1px 0; }
.codex-grid i.seen { border: 2px solid var(--g2); background: #eef1f6; }
.pity { font-size: 12px; color: #6d685f; }

/* ---------- 进账、下一步、升级清单、照料按类（2026-11-22）---------- */
.rate { font-size: 12px; font-variant-numeric: tabular-nums; }
.rate i { font-style: normal; color: var(--good); }
.flash { font-size: 12px; font-weight: 600; color: var(--good); opacity: 0; min-width: 3em; }
.flash.go { animation: flashUp 1.6s ease-out; }
@keyframes flashUp { 0% { opacity: 1; transform: translateY(4px); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.next-steps { border-bottom: 1px solid var(--line); background: #fffdf4; }
.steps { margin: 0; padding: 4px 10px 8px 28px; font-size: 12px; }
.steps li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.steps li > div { display: inline-block; max-width: 72%; vertical-align: middle; }
.steps li .btn { float: right; margin-top: 2px; }
.steps li::after { content: ''; display: block; clear: both; }
table.ups { border-collapse: collapse; width: 100%; font-size: 12px; }
table.ups td { padding: 2px 4px; border-top: 1px solid #ebe8e1; vertical-align: middle; }
table.ups tr.best td { background: #eef8f0; }
table.ups tr.cant td:first-child b { color: var(--muted); }
.tags { display: inline-flex; gap: 2px; margin-left: 4px; vertical-align: middle; }
.t { font-size: 10px; padding: 0 3px; border-radius: 2px; color: #fff; background: #999; font-weight: 500; }
.t-产量 { background: #2e8a4a; }
.t-品阶 { background: var(--g3); }
.t-图鉴 { background: #2f6fd0; }
.t-繁育 { background: #c23a6a; }
.t-容量 { background: #8a7a5a; }
.t-省事 { background: #7a7a8a; }
.t-感情 { background: #e07a9a; }
.t-研究 { background: #7d4bd6; }
.today { display: flex; gap: 2px; margin-top: 2px; }
.today span { font-size: 10px; padding: 0 3px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); }
.today span.on { background: #eef6ef; color: var(--good); border-color: #b9dcc2; }
.homebar .btn.ghost { color: var(--muted); }

/* ---------- 偏后期（2026-11-22）：科技树、改造研究所、订单板、长老堂、收购商 ---------- */
.techtree { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.tcol { display: flex; flex-wrap: wrap; gap: 4px; align-items: stretch; }
.tcol > .tier { writing-mode: vertical-rl; font-size: 10px; color: var(--muted); align-self: center; }
.tnode { flex: 1 1 150px; max-width: 230px; border: 1px solid var(--line2); background: var(--panel2); padding: 3px 5px; font-size: 11px; line-height: 1.3; }
.tnode b { font-size: 12px; }
.tnode .small { font-size: 10.5px; }
.tnode .btn { margin-top: 2px; font-size: 10.5px; padding: 0 4px; white-space: nowrap; }
.tnode.done { border-color: var(--good); background: #eef7f0; }
.tnode.can { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tnode.locked { opacity: 0.55; border-style: dashed; }
table.techs { border-collapse: collapse; width: 100%; font-size: 12px; }
table.techs th { text-align: left; vertical-align: top; padding: 3px 6px 3px 0; white-space: nowrap; }
table.techs td { border-top: 1px solid #ebe8e1; padding: 3px 4px; vertical-align: top; }
table.techs tr.cur th { color: var(--good); }
.box.locked { opacity: 0.8; border-style: dashed; }
.benchwrap { border: 1px solid var(--line); background: var(--panel2); padding: 6px; margin-bottom: 6px; }
.bench { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.mslot { width: 92px; min-height: 52px; border: 1px dashed var(--line2); background: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; padding: 2px 4px; font-size: 12px; line-height: 1.25; }
.mslot:hover { border-color: var(--accent); }
.mslot.filled { border-style: solid; border-color: var(--ink); }
.mslot.on { box-shadow: 0 0 0 2px var(--accent); }
.mslot.eggslot { width: 120px; border-color: var(--g3); border-width: 2px; }
.bench .plus { align-self: center; color: var(--muted); font-size: 16px; }
.picker { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin: 5px 0; padding: 4px; border: 1px solid var(--accent); background: #fff; }
table.recipes { border-collapse: collapse; width: 100%; font-size: 12px; }
table.recipes th { text-align: left; vertical-align: top; white-space: nowrap; padding: 2px 6px 2px 0; }
table.recipes td { border-top: 1px solid #ebe8e1; padding: 2px 4px; vertical-align: top; }
table.recipes tr.unknown th { color: var(--muted); font-weight: 400; }
.need { display: inline-block; margin-right: 6px; color: var(--bad); }
.need.ok { color: var(--good); }
table.contracts { border-collapse: collapse; width: 100%; font-size: 12px; }
table.contracts td { border-top: 1px solid #ebe8e1; padding: 2px 4px; vertical-align: middle; }
.buyer { border-top: 1px dashed var(--line2); margin-top: 6px; padding-top: 4px; }
.it.special, .drop.special { border-color: var(--god); color: var(--god); font-weight: 600; }
.modtag { color: var(--god); }
.egg.modded { box-shadow: inset 0 0 0 2px var(--god); }
.modmark { font-style: normal; font-size: 10px; background: var(--god); color: #fff; padding: 0 2px; margin-right: 2px; }
