/* ============ 基础 ============ */
[hidden] { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font-size: .92em;
  font-weight: 500;
  line-height: 1.2;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-4); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunk); color: var(--ink); }
.btn.sm { padding: 6px 11px; font-size: .87em; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .45; pointer-events: none; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); }

.mark {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 15px/1 var(--font-serif);
  flex: 0 0 auto;
}
.mark.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }

.field { display: block; margin-bottom: 12px; }
.field .label {
  display: block;
  margin-bottom: 5px;
  font-size: .8em;
  color: var(--ink-3);
}
input[type="text"], input[type="password"], input[type="search"], textarea, .field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input:hover, textarea:hover { border-color: var(--ink-4); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; line-height: 1.65; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: .84em;
  transition: all var(--t) var(--ease);
}
.chip:hover { border-color: var(--ink-4); color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 500; }

.hint { font-size: .8em; line-height: 1.65; color: var(--ink-3); }
.hint code { background: var(--sunk); padding: 1px 5px; border-radius: 4px; }

/* ============ 骨架 ============ */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--panel);
}

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px 10px;
  border-right: 1px solid var(--line-soft);
  background: var(--panel-2);
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 12px;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand strong { font: 600 15px/1.2 var(--font-serif); letter-spacing: .01em; }

.new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: .89em;
  text-align: left;
  transition: all var(--t) var(--ease);
}
.new-chat:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.new-chat span { flex: 1; }
.new-chat kbd {
  font: 500 .74em/1 var(--font);
  color: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 5px;
}

.side-scroll { flex: 1; min-height: 0; overflow-y: auto; margin-top: 14px; }
.side-label {
  padding: 0 8px 7px;
  font-size: .72em;
  letter-spacing: .1em;
  color: var(--ink-4);
}
.sessions { display: flex; flex-direction: column; gap: 1px; }
.session {
  display: flex;
  align-items: center;
  border-radius: 9px;
  transition: background var(--t) var(--ease);
}
.session:hover { background: var(--sunk); }
.session.on { background: var(--accent-soft); }
.ses-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink-2);
  font-size: .88em;
}
.session.on .ses-main { color: var(--accent); font-weight: 500; }
.ses-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ses-time { font-size: .82em; color: var(--ink-4); flex: 0 0 auto; }
.ses-del {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  margin-right: 4px;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--ink-4);
  font-size: .95em;
  line-height: 1;
  opacity: 0;
  transition: opacity var(--t) var(--ease), color var(--t) var(--ease);
}
.session:hover .ses-del { opacity: 1; }
.ses-del:hover { color: var(--bad); background: var(--panel); }
.side-empty { padding: 8px 9px; font-size: .8em; line-height: 1.6; color: var(--ink-4); }

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: .87em;
  text-align: left;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.side-link svg { opacity: .7; }
.side-link:hover { background: var(--sunk); color: var(--ink); }
.side-link.on { color: var(--accent); background: var(--accent-soft); }
.side-link.on svg { opacity: 1; }
.side-link em {
  margin-left: auto;
  font-style: normal;
  font-size: .78em;
  color: var(--accent);
}

.conn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 9px 3px;
  font-size: .74em;
  color: var(--ink-4);
}
.conn .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 15%, transparent);
}
.conn .dot.off { background: var(--ink-4); box-shadow: none; }

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}
.main-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  flex: 0 0 auto;
  padding: 0 18px;
}
.main-head h1 {
  flex: 1;
  min-width: 0;
  font-size: .95em;
  font-weight: 500;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.head-right { display: flex; align-items: center; gap: 6px; }
.model-pill {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-3);
  font-size: .76em;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-pill:hover { color: var(--ink); border-color: var(--ink-4); }

.pane { flex: 1; min-height: 0; overflow-y: auto; }
.pane-chat { display: flex; flex-direction: column; overflow: hidden; }

/* ============ 对话 ============ */
.scroll { flex: 1; overflow-y: auto; padding: 10px 20px 4px; }
.thread {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 8px;
}

.empty {
  max-width: 640px;
  margin: 14vh auto 0;
  padding: 0 20px;
  text-align: center;
  animation: rise 420ms var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.empty h2 {
  font: 600 26px/1.35 var(--font-serif);
  letter-spacing: -.01em;
  margin-bottom: 10px;
}
.empty p { color: var(--ink-3); font-size: .92em; margin-bottom: 22px; }
.empty .chips { justify-content: center; }
.empty .chip { padding: 8px 14px; font-size: .85em; }

.msg { padding: 14px 0; }
.msg + .msg { border-top: 1px solid var(--line-soft); }
.msg .who-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: .73em;
  color: var(--ink-4);
}
.msg .content { overflow-wrap: anywhere; }
.msg .content > *:first-child { margin-top: 0; }
.msg .content > *:last-child { margin-bottom: 0; }
.msg.streaming .content { white-space: pre-wrap; }

.msg.user { display: flex; justify-content: flex-end; border-top: 0; padding-top: 18px; }
.msg.user + .msg { border-top: 0; }
.msg.user .body { max-width: 78%; }
.msg.user .content {
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--sunk);
  white-space: pre-wrap;
}
.msg.user .who-line { display: none; }

.msg .err {
  margin-top: 8px;
  padding: 8px 11px;
  border-left: 2px solid var(--bad);
  background: color-mix(in srgb, var(--bad) 6%, transparent);
  color: var(--bad);
  font-size: .84em;
  line-height: 1.6;
  border-radius: 0 8px 8px 0;
}

.dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-4);
  animation: blink 1.1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

.msg .reasoning {
  margin-bottom: 8px;
  padding: 6px 11px;
  border-left: 2px solid var(--line);
  color: var(--ink-3);
  font-size: .84em;
  white-space: pre-wrap;
}

.msg-tools { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity var(--t) var(--ease); }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button {
  border: 0; background: transparent; color: var(--ink-4);
  font-size: .75em; padding: 3px 7px; border-radius: 6px;
}
.msg-tools button:hover { background: var(--sunk); color: var(--ink); }

/* Markdown */
.md p { margin: .65em 0; }
.md h1, .md h2, .md h3 { margin: 1.05em 0 .45em; font-family: var(--font-serif); line-height: 1.4; }
.md h1 { font-size: 1.3em; }
.md h2 { font-size: 1.16em; }
.md h3 { font-size: 1.02em; }
.md ul, .md ol { margin: .55em 0; padding-left: 1.3em; }
.md li { margin: .24em 0; }
.md code { padding: 1px 5px; border-radius: 4px; background: var(--sunk); font-size: .88em; }
.md pre {
  margin: .7em 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunk);
  overflow-x: auto;
  line-height: 1.55;
}
.md pre code { background: none; padding: 0; font-size: .86em; }
.md blockquote {
  margin: .7em 0;
  padding: 2px 0 2px 13px;
  border-left: 2px solid var(--accent-line);
  color: var(--ink-2);
}
.md a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.1em 0; }

/* 输入区 */
.dock {
  flex: 0 0 auto;
  padding: 6px 20px 14px;
}
.composer {
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.composer:focus-within { border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.composer textarea {
  display: block;
  width: 100%;
  max-height: 200px;
  padding: 13px 16px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  outline: none;
  line-height: 1.65;
}
.composer textarea:hover, .composer textarea:focus { border: 0; box-shadow: none; }
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 10px 8px 16px;
}
.composer-hint { font-size: .73em; color: var(--ink-4); }
.composer-btns { display: flex; align-items: center; gap: 6px; }
.send {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  transition: filter var(--t) var(--ease), opacity var(--t) var(--ease);
}
.send:hover { filter: brightness(1.08); }
.send:disabled { opacity: .4; }
.disclaimer {
  max-width: 720px;
  margin: 8px auto 0;
  text-align: center;
  font-size: .72em;
  color: var(--ink-4);
}

/* 行内 Key 提示 */
.keybar {
  max-width: 720px;
  margin: 0 auto 10px;
  padding: 14px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-soft);
  animation: rise 260ms var(--ease) both;
}
.keybar-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.keybar-head strong { font-size: .92em; }
.keybar-head span { font-size: .78em; color: var(--ink-3); line-height: 1.55; }
.keybar-row { display: flex; gap: 8px; }
.keybar-row input { flex: 1; background: var(--panel); }
.keybar-adv { margin-top: 9px; }
.keybar-adv summary {
  font-size: .78em;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
}
.keybar-adv summary::-webkit-details-marker { display: none; }
.keybar-adv summary::before { content: "＋ "; }
.keybar-adv[open] summary::before { content: "－ "; }
.keybar-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 9px; margin-top: 8px; }
.keybar-grid label { display: block; font-size: .76em; color: var(--ink-3); }
.keybar-grid input { margin-top: 4px; background: var(--panel); font-size: .9em; }
.keybar-note { margin-top: 7px; font-size: .76em; color: var(--ink-3); }
.keybar-note code { background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.keybar-msg { margin-top: 8px; font-size: .8em; color: var(--bad); line-height: 1.5; min-height: 0; }
.keybar-msg.ok { color: var(--ok); }

/* ============ 卡片板 ============ */
.board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  min-width: 0;
}
.card.wide { grid-column: 1 / -1; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2 { font: 600 14.5px/1.3 var(--font-serif); }
.card-meta { font-size: .75em; color: var(--ink-4); white-space: nowrap; }
.card-tools { display: flex; align-items: center; gap: 7px; }
.card-note { margin-top: 12px; font-size: .75em; line-height: 1.6; color: var(--ink-4); }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }

.goal-list { display: flex; flex-direction: column; gap: 1px; }
.goal {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 8px;
  transition: background var(--t) var(--ease);
}
.goal:hover { background: var(--panel-2); }
.goal input { margin: 4px 0 0; width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; }
.goal span { flex: 1; font-size: .91em; line-height: 1.5; }
.goal.done span { color: var(--ink-4); text-decoration: line-through; }
.goal .del {
  border: 0; background: transparent; color: var(--ink-4);
  font-size: 1em; line-height: 1; padding: 2px 4px; border-radius: 4px; opacity: 0;
}
.goal:hover .del { opacity: 1; }
.goal .del:hover { color: var(--bad); background: var(--sunk); }
.goal-empty { padding: 10px 6px; font-size: .85em; color: var(--ink-4); }

.timer { display: flex; flex-direction: column; gap: 12px; }
.timer-num {
  font: 500 42px/1 var(--font-mono);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.timer-num.running { color: var(--accent); }
.timer-num.done { color: var(--ok); }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.timer-actions { display: flex; gap: 6px; }

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel-2);
}
.seg button {
  padding: 4px 11px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-3);
  font-size: .8em;
  transition: all var(--t) var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.search { width: 185px; padding: 6px 10px; font-size: .83em; }
.note-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.note {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.note:hover { border-color: var(--accent-line); background: var(--panel); }
.note h3 { font-size: .92em; margin-bottom: 4px; }
.note p {
  font-size: .81em;
  color: var(--ink-3);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: .71em; color: var(--ink-4); }
.note .tag { padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.note-empty { padding: 16px 2px; font-size: .85em; color: var(--ink-4); }

.note-form { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.note-form textarea { min-height: 110px; }
.note-form-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.note-form-row input { max-width: 170px; }

.fb-form { display: flex; flex-direction: column; gap: 10px; }
.fb-form textarea { min-height: 126px; }
.fb-row { display: flex; align-items: center; justify-content: space-between; }
.counter { font-size: .75em; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.fb-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.fb-item {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--panel-2);
}
.fb-item .top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .73em; color: var(--ink-4); }
.fb-item .type { padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.fb-item p { font-size: .86em; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item .contact { margin-top: 4px; font-size: .75em; color: var(--ink-3); }
.fb-empty { padding: 16px 2px; font-size: .85em; color: var(--ink-4); }

/* 架构 */
.nav-editor { display: flex; flex-direction: column; gap: 6px; }
.nav-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}
.nav-row .idx { font-size: .73em; color: var(--ink-4); text-align: center; }
.nav-row input[type="text"] { border: 0; background: transparent; padding: 3px 2px; }
.nav-row input[type="text"]:focus { outline: none; border-bottom: 1px solid var(--accent); box-shadow: none; }
.nav-row .moves { display: flex; gap: 2px; align-items: center; }
.nav-row .moves button {
  width: 24px; height: 24px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--ink-3);
  font-size: .78em; line-height: 1; display: grid; place-items: center;
}
.nav-row .moves button:hover { color: var(--accent); border-color: var(--accent-line); }
.nav-row.off { opacity: .5; }

.ctrl { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ctrl > label { width: 56px; flex: 0 0 auto; font-size: .83em; color: var(--ink-3); }
.ctrl input[type="range"] { flex: 1; accent-color: var(--accent); }
.ctrl output { width: 30px; text-align: right; font-size: .77em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ctrl.inline { flex: 0 0 auto; }
.ctrl.inline > label { width: auto; }

.swatches { display: flex; gap: 7px; align-items: center; }
.swatches button {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--c);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.swatches button:hover { transform: scale(1.1); }
.swatches button.on { box-shadow: 0 0 0 2px var(--accent); }
.swatches input[type="color"] {
  width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel); cursor: pointer;
}

textarea.prompt {
  min-height: 190px;
  font-size: .86em;
  line-height: 1.65;
  font-family: var(--font-mono);
}
.arch-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.arch-btns { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.admin-form .arch-btns { margin-top: 4px; }

.patch-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--accent-line);
  border-radius: 10px;
  background: var(--accent-soft);
}
.patch-preview h3 { font-size: .84em; margin-bottom: 8px; color: var(--accent); }
.patch-preview ul { margin: 0 0 8px; padding-left: 1.2em; font-size: .84em; line-height: 1.7; }
.patch-preview .note { font-size: .8em; color: var(--ink-2); }
.patch-preview .arch-btns { justify-content: flex-end; margin-top: 8px; }

.cfg-preview {
  max-height: 200px;
  overflow: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--sunk);
  font-size: .77em;
  line-height: 1.6;
  color: var(--ink-2);
}

.kv { display: flex; flex-direction: column; gap: 1px; }
.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .85em;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row span:first-child { color: var(--ink-3); }
.kv-row span:last-child { font-variant-numeric: tabular-nums; }
.about { font-size: .88em; line-height: 1.75; margin-bottom: 10px; max-width: 60em; }
.about.dim { color: var(--ink-3); font-size: .83em; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  padding: 9px 16px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  font-size: .83em;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  z-index: 40;
  max-width: min(90vw, 440px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, .32);
  z-index: 15;
  animation: fadein 160ms var(--ease);
}
@keyframes fadein { from { opacity: 0; } }

.only-mobile { display: none !important; }

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(284px, 84vw);
    z-index: 20;
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform 220ms var(--ease);
  }
  .app.side-open .side { transform: none; }
  .only-mobile { display: grid !important; }
  .main-head { padding: 0 12px; }
  .scroll { padding: 8px 14px 2px; }
  .dock { padding: 4px 14px 10px; }
  .board { grid-template-columns: 1fr; padding: 4px 14px 28px; }
  .card.wide { grid-column: auto; }
  .empty { margin-top: 10vh; }
  .empty h2 { font-size: 22px; }
  .msg.user .body { max-width: 88%; }
  .keybar-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .composer-hint { display: none; }
  .model-pill { max-width: 120px; }
  .search { width: 120px; }
  .timer-num { font-size: 36px; }
}

/* ============ 通用补充 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
  font-size: .84em;
  color: var(--ink-2);
  cursor: pointer;
}
.check input { width: 15px; height: 15px; accent-color: var(--accent); }
.dim { color: var(--ink-4); }

/* ============ 更新日志 ============ */
.cl-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: .86em;
  color: var(--ink-3);
}
.cl-range select {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: .95em;
}
.cl-arrow { color: var(--ink-4); }
.cl-sum { margin-left: auto; font-size: .82em; color: var(--accent); }
.cl-list { display: flex; flex-direction: column; gap: 12px; }
.cl-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.cl-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cl-head strong { font-family: var(--font-mono); font-size: .92em; color: var(--accent); }
.cl-title { font-weight: 600; }
.cl-date { margin-left: auto; font-size: .76em; color: var(--ink-4); }
.cl-sec { margin-top: 7px; }
.cl-sec h4 {
  font-size: .74em;
  letter-spacing: .06em;
  color: var(--ink-4);
  margin-bottom: 3px;
}
.cl-sec ul { margin: 0; padding-left: 1.1em; font-size: .87em; line-height: 1.7; }
.cl-note { margin-top: 8px; font-size: .79em; color: var(--ink-3); }

/* ============ 迭代 ============ */
.it-lead { font-size: .87em; color: var(--ink-3); line-height: 1.7; margin-bottom: 12px; max-width: 62em; }
.it-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.it-cycle { display: flex; align-items: center; gap: 5px; font-size: .82em; color: var(--ink-3); }
.it-cycle select {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  font-size: .95em;
}
.it-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.it-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: .76em;
  color: var(--ink-4);
}
.it-step i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.it-step.run {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.it-step.run i { background: var(--accent); animation: pulse 1s infinite; }
.it-step.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, var(--line)); }
.it-step.ok i { background: var(--ok); }
.it-step.fail { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, var(--line)); }
.it-step.fail i { background: var(--bad); }
.it-step.skip { opacity: .45; }
.it-step.skip i { background: var(--ink-4); }
@keyframes pulse { 50% { opacity: .3; } }

.it-queue { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.it-ticket {
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--panel-2);
}
.it-ticket.doing { border-color: var(--accent-line); background: var(--accent-soft); }
.it-ticket.done { opacity: .55; }
.it-ticket.failed { border-color: color-mix(in srgb, var(--bad) 32%, var(--line)); }
.it-ticket-top { display: flex; align-items: center; gap: 7px; }
.it-kind {
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--sunk);
  color: var(--ink-3);
  font-size: .7em;
}
.it-kind.bug { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.it-kind.feature { background: var(--accent-soft); color: var(--accent); }
.it-sev { margin-left: auto; font-size: .72em; color: var(--ink-4); }
.it-ticket p { margin-top: 4px; font-size: .8em; color: var(--ink-3); line-height: 1.55; }
.it-ticket-foot { display: flex; justify-content: space-between; margin-top: 5px; font-size: .72em; color: var(--ink-4); }

.it-empty { padding: 6px 0; font-size: .85em; color: var(--ink-4); line-height: 1.6; }
.it-res-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.it-res-head strong { font-family: var(--font-mono); color: var(--accent); }
.it-res-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.it-res-cols h4 { font-size: .76em; color: var(--ink-4); margin-bottom: 4px; }
.it-res-cols ul { margin: 0; padding-left: 1.1em; font-size: .86em; line-height: 1.65; }
.it-res-meta { display: grid; grid-template-columns: 72px 1fr; gap: 5px 10px; margin: 12px 0 0; font-size: .83em; }
.it-res-meta dt { color: var(--ink-4); }
.it-res-meta dd { margin: 0; }

.it-log {
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--sunk);
  font-size: .78em;
  line-height: 1.75;
}
.it-line { display: block; white-space: pre-wrap; }
.it-time { color: var(--ink-4); margin-right: 8px; }
.it-line.ok { color: var(--ok); }
.it-line.warn { color: var(--warn); }
.it-line.fail { color: var(--bad); }
.it-line.qa { color: var(--ink-2); font-style: italic; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .it-res-cols { grid-template-columns: 1fr; }
  .cl-sum { margin-left: 0; width: 100%; }
}

/* 设置页里的分组标题 */
.group-title {
  grid-column: 1 / -1;
  margin: 18px 0 2px;
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.group-title:first-child { margin-top: 0; }
