/* 无限中控台：网站的色板（黑曜石 + 香槟金，app/src/style.css 开头），只有深色一套。金色只给主按钮、选中和「等你回复」；三级动作的按钮描金边 */
:root {
  --bg: #101114; --panel: #191b20; --panel2: #22252c; --line: #30343d; --line-2: #3d424d; --fg: #dedcd5; --muted: #9ba0aa;
  --gold: #c9aa71; --gold-l: #e0be7e; --gold-soft: #2b261c; --sky: #7fb3e0; --sky-soft: #1c2631; --ok: #6fcf97; --bad: #f28b82; --bad-soft: #3a1f1e;
  --body: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif; --mono: Consolas, "IBM Plex Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.6 var(--body); }
a { color: var(--sky); }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
.loader { padding: 40px 16px; color: var(--muted); }

/* ---- 登录 */
.login { max-width: 340px; margin: 12vh auto 0; padding-inline: 16px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.login h1 { margin: 0; font-size: 22px; color: var(--gold); letter-spacing: .04em; }
.login .row { display: flex; gap: 8px; width: 100%; }
.login .code { flex: 1; min-width: 0; font: 20px/1 var(--mono); letter-spacing: .3em; text-align: center; }
.login .code::placeholder { font: 15px var(--body); letter-spacing: .05em; }
.login .hint { margin: 0; color: var(--muted); font-size: 13px; min-height: 1.6em; }
.mark { width: 44px; height: 44px; border-radius: 10px; background: var(--panel) url("/favicon.svg") center / 100% no-repeat; flex: 0 0 auto; }

/* ---- 框架 */
.frame { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; gap: 10px; align-items: center; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; }
.brand b { display: block; color: var(--gold); font-size: 16px; letter-spacing: .03em; }
.brand small { color: var(--muted); font: 12px var(--mono); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 6px; color: var(--fg); text-decoration: none; }
.nav a:hover { background: var(--panel2); }
.nav a.on { background: var(--gold-soft); color: var(--gold); }
.cnt { font: 12px var(--mono); min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--panel2); color: var(--muted); text-align: center; }
.nav a.on .cnt { background: var(--gold); color: var(--bg); }
.side .out { margin-top: auto; }
.main { padding: 20px 28px 48px; min-width: 0; max-width: 1180px; }
.main > h1 { font-size: 20px; margin: 4px 0 16px; }
@media (max-width: 760px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .side .out { margin: 0 0 0 auto; }
  .main { padding: 16px 16px 40px; }
}

/* ---- 通用 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel2); cursor: pointer; text-decoration: none; color: var(--fg); white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-l); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1408; font-weight: 600; }
.btn.gold:hover:not(:disabled) { background: var(--gold-l); color: #1a1408; }
.btn.ghost { background: none; }
.btn.t3 { border-color: var(--gold); color: var(--gold); }
.in { width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; resize: vertical; }
.in:focus, .btn:focus-visible, .nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.meta { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.meta.ok { color: var(--ok); }
.warn { color: var(--bad); background: var(--bad-soft); border: 1px solid #5a2c2a; border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; }
p.warn { margin: 8px 0 0; }
.badtext { color: var(--bad); }
.empty { color: var(--muted); padding: 24px 0; }
.at { font: 12px var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.badge { font-size: 11.5px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chipb { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px; }
.chipb.on { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.sec { margin: 22px 0 0; }
.sec h2 { font-size: 13px; letter-spacing: .08em; color: var(--gold); margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
.sec h2 small { color: var(--muted); letter-spacing: 0; font-weight: 400; font-size: 12px; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border: 1px solid var(--gold); border-radius: 6px; background: var(--gold-soft); }
.confirm span { flex: 1 1 220px; min-width: 0; }
.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line-2); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); transition: opacity .5s; z-index: 10; }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast.out { opacity: 0; }

/* ---- 顶上一行：服务器上的中控台写电脑，电脑上的写执行器和服务器；三级动作在服务器上不能点的说明 */
.hub { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.hub b { color: var(--sky); font-weight: 600; }
.hub.off { color: var(--bad); }
.acts .note { align-self: center; color: var(--muted); font-size: 12.5px; }

/* ---- 正在跑的命令 */
.banner { border: 1px solid #2c4258; background: var(--sky-soft); border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; }
.banner.bad { border-color: #5a2c2a; background: var(--bad-soft); }
.banner .line, .result .line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card .line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.banner .line > span:nth-child(2) { flex: 1; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); animation: pulse 1.4s infinite; }
.banner.bad .dot { background: var(--bad); animation: none; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
pre { margin: 10px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

/* ---- 总览 */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1040px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tile small { color: var(--muted); font-size: 12px; }
.tile b { font: 600 18px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.gold { border-color: var(--gold); } .tile.gold b { color: var(--gold); }
.tile.sky b { color: var(--sky); } .tile.bad { border-color: #5a2c2a; } .tile.bad b { color: var(--bad); }
.rows { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.rw { display: grid; grid-template-columns: 76px minmax(150px, 220px) minmax(0, 1fr); gap: 4px 14px; padding: 8px 14px; border-top: 1px solid var(--line); align-items: start; }
.rw:first-child { border-top: 0; }
.rw.two { grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); }
.rw small { display: block; color: var(--muted); font: 11.5px var(--mono); margin-top: 1px; }
.rw .who { overflow-wrap: anywhere; }
.rw .why { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .rw { grid-template-columns: 76px minmax(0, 1fr); } .rw > .why { grid-column: 1 / -1; } .rw.two > .why, .rw.ev > .why { grid-column: auto; } }
.state { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; white-space: nowrap; border: 1px solid; }
.state.gold { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }
.state.sky { color: var(--sky); border-color: #2c4258; background: var(--sky-soft); }
.state.bad { color: var(--bad); border-color: #5a2c2a; background: var(--bad-soft); }
.state.mute { color: var(--muted); border-color: var(--line-2); }
.state.ok { color: var(--ok); border-color: #2f5a41; background: #17271e; }
.tiers { display: grid; gap: 12px; }
.tier h3 { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.tier .acts { margin-top: 6px; }
.result { margin-top: 14px; }

/* ---- 待批、待办 */
.cards { display: grid; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; min-width: 0; }
.card.info { border-style: dashed; }
.card h3 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card p { margin: 6px 0 0; overflow-wrap: anywhere; }
.card .ask { white-space: pre-wrap; color: #c9c7c0; }
.notes { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.notes li { display: flex; gap: 8px; } .notes li .at { flex: 0 0 auto; }
.new { margin-bottom: 14px; display: grid; gap: 8px; }
.new[open] { display: grid; }
.new summary { cursor: pointer; color: var(--gold); }
.new .in + .in { margin-top: 0; }
.rw.job .more { margin-top: 6px; padding: 2px 10px; font-size: 12.5px; }

/* ---- 动态 */
.rw.ev { grid-template-columns: 92px 64px minmax(0, 1fr); }
.ev .type { color: var(--gold); white-space: nowrap; }
.ev.bad .why { color: var(--bad); }

/* ---- 调用记录 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.filters .chips { margin: 0; }
.sel { width: auto; max-width: 100%; padding: 5px 8px; resize: none; }
.rw.cl { grid-template-columns: minmax(130px, 220px) 120px minmax(0, 1fr); }
.rw.call { grid-template-columns: 70px minmax(120px, 190px) minmax(0, 1fr); }
.rw .num { font-variant-numeric: tabular-nums; }
.args { font: 12.5px/1.5 var(--mono); color: #c9c7c0; overflow-wrap: anywhere; }
.gap h3 .args { font-weight: 400; margin-left: 4px; }
@media (max-width: 560px) {
  .rw.cl { grid-template-columns: minmax(0, 1fr) auto; } .rw.call { grid-template-columns: 70px minmax(0, 1fr); }
  .rw.cl > .why, .rw.call > .why { grid-column: 1 / -1; }
}

/* ---- 对话 */
.turns { display: grid; gap: 18px; margin: 14px 0; }
.turn { display: grid; gap: 8px; }
.turn .q { justify-self: end; max-width: min(640px, 92%); background: var(--gold-soft); border: 1px solid #4a3f2b; border-radius: 10px 10px 2px 10px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn .a { max-width: min(760px, 100%); display: grid; gap: 8px; }
.turn .text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.turn .tools { margin: 0; color: var(--muted); font-size: 12.5px; }
.turn .prop { border-color: var(--gold); }
.compose { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 4px; border-top: 1px solid var(--line); }
.compose .say { min-height: 72px; }
