:root {
  --bg: #fafaf7;
  --surface: #fff;
  --fg: #252520;
  --muted: #898a81;
  --border: #e5e5de;
  --soft: #f1f1ed;
  --primary: #292a24;
  --urgent: #e5484d;
  --ok: #27815f;
  --wait: #b26b00;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.frame { max-width: 600px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.top { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.top h1 { margin: 0; font-size: 17px; }
.grow { flex: 1; }
.who { font-size: 13px; color: var(--muted); }
.out { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 5px 10px; font-size: 13px; color: var(--fg); }
.login { margin: 48px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login h2 { margin: 0 0 4px; font-size: 17px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #55564e; }
.login input { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-size: 15px; color: var(--fg); }
.login input:focus, textarea:focus { outline: 2px solid #c9cabf; outline-offset: 0; }
.error { margin: 0; min-height: 1.5em; color: var(--urgent); font-size: 14px; }
.body { padding: 22px 22px 48px; display: flex; flex-direction: column; gap: 22px; }
.conn { display: flex; align-items: center; gap: 8px; font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 18px; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn.off .dot { background: var(--urgent); }
.conn .muted { color: var(--muted); margin-left: auto; font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px 18px 20px; }
.cardHead { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cardHead h2 { margin: 0; font-size: 15px; }
.hint { font-size: 12px; color: var(--muted); }
.textBtn { background: transparent; border: 0; color: #55564e; font-size: 13px; text-decoration: underline; padding: 2px; }
.presets { display: flex; flex-direction: column; gap: 10px; }
.preset { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--soft); }
.preset .go { flex: 1; text-align: left; border: 0; background: transparent; padding: 14px 16px; font-size: 15px; line-height: 1.65; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; display: flex; gap: 12px; align-items: flex-start; }
.preset .go:hover { background: #e9e9e3; }
.preset .go:disabled { cursor: progress; opacity: .6; }
.preset.urgent { border-color: #f0b9bb; background: #fdf1f1; }
.preset.urgent .go:hover { background: #fbe3e3; }
.preset .edit { display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.preset .edit button { flex: 1; border: 0; background: var(--surface); font-size: 13px; padding: 0 14px; color: #55564e; }
.preset .edit button + button { border-top: 1px solid var(--border); }
.lvl { flex: none; display: inline-block; font-size: 12px; line-height: 1.5; border-radius: 3px; padding: 1px 7px; margin-top: 2px; margin-right: 8px; }
.lvl.normal { background: #fff; border: 1px solid var(--border); color: #55564e; }
.lvl.urgent { background: var(--urgent); color: #fff; }
.empty { font-size: 14px; color: var(--muted); padding: 6px 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.presetForm { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.form textarea { border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; font-size: 15px; line-height: 1.65; resize: none; min-height: 76px; overflow: hidden; background: #fff; color: var(--fg); }
.formRow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.count { font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 16px; font-size: 14px; color: var(--fg); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.seg button.urg[aria-pressed="true"] { background: var(--urgent); }
.btn { background: var(--primary); color: #fff; border: 0; border-radius: 6px; padding: 9px 18px; font-size: 14px; font-weight: 600; }
.btn.urg { background: var(--urgent); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--border); font-weight: 400; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.log .li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.log .li:last-child { border-bottom: 0; }
.tm { color: var(--muted); font-variant-numeric: tabular-nums; }
.txt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.st { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st .ok { color: var(--ok); }
.st .wait { color: var(--wait); }
.st .bad { color: var(--urgent); }
.toastSlot { position: sticky; bottom: 16px; }
.toast { margin: 0 auto; background: #252520; color: #fff; border-radius: 8px; padding: 10px 14px; font-size: 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); }
.toast.err { background: var(--urgent); }
.toast button { background: transparent; border: 1px solid #888; color: #fff; border-radius: 4px; padding: 4px 10px; font-size: 13px; }
