/* 微信风格：配色、间距、字号、气泡与底栏都按其设计语言复刻。 */
:root {
  /* 观感来自 codex-remote-ui：柔和灰底 + 绿色主色 + 16px 圆角卡片 */
  --wx-green: #10b981;
  --wx-green-dark: #059669;
  --wx-green-soft: #e7f8f1;
  --wx-bubble: #10b981;
  --wx-bg: #f1f3f5;
  --wx-surface: #ffffff;
  --wx-surface-2: #f8fafc;
  --wx-tabbar: #ffffff;
  --wx-text: #16181d;
  --wx-sub: #565d6b;
  --wx-faint: #9aa1af;
  --wx-line: #ebedf1;
  --wx-line-strong: #dfe2e8;
  --wx-red: #f04b48;
  --wx-amber: #e8a33d;
  --wx-blue: #3b82f6;
  --wx-radius: 16px;
  --wx-radius-sm: 10px;
  --wx-shadow: 0 1px 2px rgba(20,23,30,.05);
  --wx-shadow-float: 0 6px 24px rgba(20,23,30,.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; width: 100%; max-width: 100%; overflow: hidden; position: relative;
  background: var(--wx-bg); color: var(--wx-text); touch-action: pan-y;
  font: 17px/1.4 -apple-system, "PingFang SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
.link { color: var(--wx-blue); padding: 6px 2px; }

#app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.wx-view { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }

/* ---------- 顶部导航 ---------- */
.wx-nav {
  flex: none; display: flex; align-items: center; height: calc(var(--nav-h) + var(--safe-top));
  padding-top: var(--safe-top); background: var(--wx-bg); position: relative; z-index: 30;
}
  .wx-nav-transparent { background: var(--wx-bg); }
  .native-shell { --safe-top: 0px; --safe-bottom: 0px; }
.wx-nav-side { width: 96px; display: flex; align-items: center; gap: 2px; padding: 0 8px; }
.wx-nav-right { justify-content: flex-end; }
.wx-nav-title {
  flex: 1; min-width: 0; margin: 0; text-align: center; font-size: 17px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; justify-content: center; gap: 2px;
}
.wx-nav-title i { font-style: normal; font-weight: 600; }
.wx-nav.collapsed { border-bottom: 1px solid var(--wx-line); }
.wx-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--wx-text);
  font-size: 17px; letter-spacing: 1px; border-radius: 6px; }
.wx-icon:active { background: rgba(0, 0, 0, .05); }
.wx-back { display: flex; align-items: center; gap: 2px; height: 36px; color: var(--wx-text); }
.wx-back-count { font-size: 17px; font-weight: 500; margin-left: -2px; }

/* ---------- 列表 ---------- */
  .wx-search { flex: none; padding: 2px 12px 6px; background: var(--wx-bg); }
.wx-search input {
  width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 6px;
  background: var(--wx-surface); outline: none;
}
  .wx-banner {
    flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px;
  background: var(--wx-surface); color: var(--wx-sub); font-size: 15px;
  border-bottom: 1px solid var(--wx-line);
}
.wx-banner-icon { color: #7d7d7d; font-size: 18px; }
.wx-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.wx-list { background: var(--wx-surface); }
.wx-pin-group {
  margin: 6px 8px 0; border: 1px solid var(--wx-pin-border, #ffd591); border-radius: 8px;
  background: var(--wx-pin-bg, #fffaf0); overflow: hidden;
}
.wx-pin-divider { height: 1px; background: var(--wx-pin-border, #ffd591); margin: 8px 16px 0; opacity: .55; }
.wx-pin-badge {
  flex: none; font-size: 11px; line-height: 1; padding: 2px 5px; border-radius: 4px;
  color: var(--wx-pin-text, #d46b08); border: 1px solid var(--wx-pin-border, #ffd591);
  background: var(--wx-pin-chip, #fff7e6);
}
.wx-row-pinned:active { background: rgba(0,0,0,.05); }
.wx-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 64px;
  background: var(--wx-surface); position: relative; text-align: left; width: 100%;
}
.wx-row:active { background: #e5e5e5; }
.wx-row + .wx-row::before {
  content: ""; position: absolute; left: 76px; right: 0; top: 0; height: 1px; background: var(--wx-line);
}
.wx-avatar {
  width: 48px; height: 48px; flex: none; border-radius: 4px; display: grid; place-items: center;
  background: var(--wx-bg); color: #fff; font-size: 20px; overflow: hidden;
  position: relative;
}
.wx-avatar .wx-dot {
  position: absolute; top: -3px; right: -3px; width: 10px; height: 10px;
  border: 1.5px solid var(--wx-surface);
}
.wx-row-main { min-width: 0; flex: 1; }
.wx-row-top { display: flex; align-items: center; gap: 6px; }
.wx-row-name {
  flex: 1; min-width: 0; font-size: 17px; color: var(--wx-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wx-row-time { flex: none; font-size: 12px; color: var(--wx-faint); }
.wx-row-preview {
  margin-top: 3px; font-size: 14px; color: var(--wx-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px;
}
.wx-mute { color: var(--wx-faint); font-size: 13px; flex: none; }
.wx-spinner {
  width: 40px; height: 40px; flex: none; align-self: center; margin-left: auto;
  border-radius: 50%; border: 3.5px solid rgba(7, 193, 96, .25);
  border-top-color: var(--wx-green); animation: wxspin .8s linear infinite;
}
@keyframes wxspin { to { transform: rotate(360deg); } }
.wx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wx-red); flex: none; }
.wx-fold {
  text-align: center; color: var(--wx-sub); font-size: 14px; padding: 16px 0 calc(16px + var(--safe-bottom));
  background: var(--wx-bg);
}
.wx-empty { text-align: center; color: var(--wx-faint); font-size: 14px; padding: 60px 20px; }

/* ---------- 底部四个 tab ---------- */
.wx-tabbar {
  flex: none; display: flex; height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom); background: var(--wx-tabbar);
  border-top: 1px solid var(--wx-line);
}
.wx-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: #7f7f7f;
}
.wx-tab.active { color: var(--wx-green); }
.wx-tab-icon { position: relative; display: grid; place-items: center; height: 28px; }
.wx-tab-label { font-size: 10px; }
.wx-tab-badge {
  position: absolute; top: -4px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--wx-red); color: #fff; font-size: 11px; font-style: normal;
  line-height: 18px; text-align: center; border: 1px solid var(--wx-tabbar);
}

/* ---------- 对话 ---------- */
  .wx-chat-status {
    flex: none; text-align: center; font-size: 12px; color: var(--wx-sub);
    padding: 1px 12px 4px; background: var(--wx-bg);
}
.wx-chat-status.live { color: var(--wx-green); }
  .wx-chat {
    flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--wx-bg);
    padding: 5px 0 4px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.wx-time { text-align: center; font-size: 12px; color: var(--wx-faint); margin: 10px 0; }
  .wx-msg { display: flex; align-items: flex-start; gap: 10px; padding: 0 12px; margin-bottom: 12px; }
.wx-msg.mine { flex-direction: row-reverse; }
.wx-msg-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 4px; display: grid; place-items: center;
  color: #fff; font-size: 16px;
}
.wx-msg-body { max-width: calc(100% - 116px); min-width: 0; }
.wx-msg-sender { font-size: 12px; color: var(--wx-sub); margin: 0 2px 4px; }
.wx-bubble {
  position: relative; display: inline-block; max-width: 100%; padding: 9px 12px; border-radius: 4px;
  background: var(--wx-surface); font-size: 17px; line-height: 1.45; color: var(--wx-text);
  overflow-wrap: anywhere; word-break: break-word;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}
.wx-msg.mine .wx-bubble { background: var(--wx-bubble); }
.wx-bubble::after {
  content: ""; position: absolute; top: 12px; width: 0; height: 0;
  border: 5px solid transparent;
}
.wx-msg:not(.mine) .wx-bubble::after { left: -10px; border-right-color: var(--wx-surface); }
.wx-msg.mine .wx-bubble::after { right: -10px; border-left-color: var(--wx-bubble); }
.wx-bubble.plain { background: transparent; box-shadow: none; padding: 0; }
.wx-bubble.plain::after { display: none; }
.wx-receipt { font-size: 12px; color: var(--wx-faint); margin-top: 5px; display: flex; gap: 8px; align-items: center; }
.wx-msg.mine .wx-receipt { justify-content: flex-end; }
.wx-receipt.bad { color: var(--wx-red); }
.wx-queue-cancel { color: var(--wx-blue); font-size: 12px; text-decoration: underline; }
.wx-receipt-detail { font-size: 12px; color: var(--wx-red); margin-top: 3px; }
.wx-sys { text-align: center; font-size: 12px; color: var(--wx-faint); margin: 10px 24px; }
.wx-sys.bad { color: var(--wx-red); }
.wx-tool { text-align: center; margin: 10px 24px; }
.wx-tool summary { font-size: 12px; color: var(--wx-faint); list-style: none; }
.wx-tool summary::-webkit-details-marker { display: none; }
.wx-legacy { margin: 10px 20px; font-size: 12px; color: var(--wx-faint); }
.wx-history {
  display: block; margin: 8px auto 12px; padding: 6px 14px; border-radius: 4px;
  background: rgba(0, 0, 0, .05); color: var(--wx-sub); font-size: 13px;
}
.wx-history[disabled] { opacity: .6; }
.wx-body-text > * + * { margin-top: 6px; }
.wx-line, .wx-list-item { white-space: pre-wrap; }
.wx-gap { height: 5px; }
.wx-bubble h4 { font-size: 17px; font-weight: 600; margin: 2px 0; }
.wx-bubble blockquote {
  margin: 0; padding: 1px 0 1px 8px; border-left: 2px solid rgba(0, 0, 0, .12); color: #555;
}
.wx-inline-code {
  background: rgba(0, 0, 0, .06); border-radius: 3px; padding: 1px 4px; font-size: 15px;
}
.wx-code { margin: 4px 0; border-radius: 4px; overflow: hidden; background: #f7f7f7; border: 1px solid var(--wx-line); }
.wx-code-head { display: flex; justify-content: space-between; padding: 5px 8px; font-size: 12px; color: var(--wx-sub); }
.wx-code pre { margin: 0; padding: 8px 10px; overflow-x: auto; font-size: 13px; line-height: 1.45; }
.wx-table-card {
  margin: 8px 0; border: 1px solid var(--wx-line); border-radius: 6px; overflow: hidden;
  background: #fff;
}
.wx-table-head {
  display: flex; align-items: center; justify-content: space-between; padding: 7px 9px;
  background: #f7f7f7; color: var(--wx-sub); font-size: 12px;
}
.wx-table {
  display: grid; overflow-x: auto; background: #fff;
  border-top: 1px solid var(--wx-line); overscroll-behavior-x: contain;
}
.wx-table-th {
  padding: 8px 9px; background: #fafafa; color: var(--wx-text); font-weight: 600;
  border-right: 1px solid var(--wx-line); border-bottom: 1px solid var(--wx-line); font-size: 14px;
}
.wx-table-td {
  padding: 8px 9px; color: #333; border-right: 1px solid var(--wx-line);
  border-bottom: 1px solid var(--wx-line); font-size: 14px; min-width: 86px;
}
.wx-table-th.key,.wx-table-td.key { background: #fff; font-weight: 600; color: var(--wx-text); }
.wx-table-td:nth-last-child(-n+1){border-right:0}
.wx-table .wx-cell-text{white-space:pre-wrap;overflow-wrap:anywhere}
.wx-copy { color: var(--wx-blue); font-size: 12px; }
.wx-link { color: var(--wx-blue); text-decoration: none; }
.wx-file-link { display: block; margin-top: 4px; font-size: 13px; color: var(--wx-blue); }
.wx-file-path { display: block; font-size: 12px; color: var(--wx-sub); word-break: break-all; margin-top: 4px; }

/* 图片与文件消息 */
.wx-image { display: block; max-width: 100%; width: auto; max-height: 320px; border-radius: 4px; }
.wx-image-wrap { display: inline-flex; flex-direction: column; align-items: flex-start;
  max-width: 100%; position: relative; }
.wx-image-hint {
  margin-top: 4px; color: var(--wx-sub); font-size: 11px; white-space: nowrap;
}
.wx-lightbox-loading { color: rgba(255,255,255,.78); font-size: 13px; }
.wx-image-placeholder {
  width: 180px; height: 130px; border-radius: 4px; background: #e3e3e3; color: var(--wx-sub);
  font-size: 12px; display: grid; place-items: center;
}
.wx-file {
  display: flex; align-items: center; gap: 12px; background: var(--wx-surface); border-radius: 4px;
  padding: 14px; min-width: 220px; max-width: 100%;
}
.wx-msg.mine .wx-file { background: var(--wx-surface); }
.wx-file-main { min-width: 0; flex: 1; }
.wx-file-name { font-size: 16px; color: var(--wx-text); overflow-wrap: anywhere; }
.wx-file-meta { font-size: 12px; color: var(--wx-sub); margin-top: 6px; }
.wx-file-icon {
  width: 46px; height: 46px; flex: none; border-radius: 6px; background: #eef1f5; color: #6b7a90;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}

/* 运行条 + 快捷指令 + 两个主按钮 */
.wx-runbar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 3px 12px;
  background: #fffbe6; color: #8a6d3b; font-size: 12px; border-top: 1px solid var(--wx-line);
  min-height: 26px;
}
.wx-runbar #runbar-text { flex: 1; min-width: 0; }
.wx-runbar-button {
  padding: 2px 10px; border-radius: 11px; border: 1px solid rgba(250, 81, 81, .45);
  background: var(--wx-surface); color: var(--wx-red); font-size: 12px;
  min-height: 21px;
}
.wx-command-row {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 10px 0;
  background: var(--wx-tabbar); border-top: 1px solid var(--wx-line);
  min-height: 28px;
}
.wx-model-chip {
  display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 46%;
  font-size: 12px; color: var(--wx-sub); text-align: left;
}
.wx-model-chip span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-commands { display: flex; gap: 6px; flex: none; overflow-x: auto; scrollbar-width: none; }
.wx-commands::-webkit-scrollbar { display: none; }
.wx-command {
  flex: none; min-width: 40px; padding: 3px 8px; border-radius: 11px; background: var(--wx-surface);
  color: var(--wx-green); border: 1px solid rgba(7, 193, 96, .35);
  font-size: 12px; text-align: center; line-height: 1.5;
}
.wx-command:active { background: #e8f7ee; }
/* 只留「插入本轮」和「排队发送」两个主按钮 */
.wx-main-actions {
  flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px 12px 0; background: var(--wx-tabbar);
}
.wx-main-button { height: 44px; border-radius: 4px; font-size: 16px; font-weight: 500; }
.wx-main-button:active { opacity: .85; }
.wx-main-button[disabled] { opacity: .45; }
.wx-main-button.insert { background: var(--wx-green); color: #fff; }
.wx-main-button.queue { background: var(--wx-surface); color: var(--wx-green); border: 1px solid var(--wx-green); }
.wx-composer {
  flex: none; display: flex; align-items: flex-end; gap: 6px; background: var(--wx-tabbar);
  padding: 6px 8px calc(6px + var(--safe-bottom));
}
.wx-composer-form { display: none; }
.wx-composer-row { display: flex; align-items: flex-end; gap: 10px; }
.wx-compose-icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  color: #4a4a4a; border-radius: 50%;
}
.wx-compose-icon:active { background: rgba(0, 0, 0, .06); }
.wx-compose-insert, .wx-compose-send {
  flex: none; height: 34px; padding: 0 13px; border-radius: 5px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.wx-compose-insert { background: var(--wx-surface); color: var(--wx-green);
  border: 1px solid var(--wx-green); }
.wx-compose-send { background: var(--wx-green); color: #fff; border: 1px solid var(--wx-green); }
.wx-compose-insert[disabled], .wx-compose-send[disabled] { opacity: .4; }
.wx-input-pill {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; padding: 0 10px;
  background: var(--wx-surface); border-radius: 5px; min-height: 34px;
}
.wx-input-pill textarea {
  flex: 1; min-width: 0; min-height: 34px; max-height: 110px; padding: 7px 0; border: 0;
  background: transparent; outline: none; resize: none; font-size: 16px; line-height: 1.3;
}
.wx-plus { width: 40px; height: 40px; flex: none; display: grid; place-items: center; color: #4a4a4a; }
.wx-action { width: 100%; height: 44px; border-radius: 4px; font-size: 16px; font-weight: 500; }
.wx-action:active { opacity: .85; }
.wx-action[disabled] { opacity: .45; }
.wx-action-insert { background: var(--wx-green); color: #fff; }
.wx-action-queue { background: var(--wx-surface); color: var(--wx-green); border: 1px solid var(--wx-green); }
.wx-action-model { background: var(--wx-surface); color: #3f3f3f; border: 1px solid var(--wx-line-strong);
  font-size: 14px; height: 40px; }

/* 微信的「＋」面板 */
.wx-plus-panel { flex: none; background: var(--wx-bg); padding: 18px 12px 4px; border-top: 1px solid var(--wx-line); }
.wx-plus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; }
.wx-plus-item { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.wx-plus-tile {
  width: 60px; height: 60px; border-radius: 14px; background: var(--wx-surface);
  display: grid; place-items: center; color: #2f2f2f;
}
.wx-plus-item:active .wx-plus-tile { background: #e6e6e6; }
.wx-plus-label { font-size: 12px; color: #666666; }

/* ---------- 电脑页 / 我 ---------- */
.wx-group { background: var(--wx-surface); margin-bottom: 8px; }
.wx-group-title { font-size: 14px; color: var(--wx-sub); padding: 12px 16px 8px; }
.wx-cell {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px;
  position: relative; width: 100%; text-align: left;
}
.wx-cell + .wx-cell::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--wx-line);
}
.wx-cell-icon { width: 24px; text-align: center; font-size: 18px; }
.wx-icon-blue { color: #576b95; }
.wx-icon-green { color: var(--wx-green); }
.wx-icon-gray { color: #7f7f7f; }
.wx-cell-title { flex: 1; font-size: 17px; }
.wx-cell-value { font-size: 15px; color: var(--wx-sub); max-width: 52%; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-chevron { color: #c8c8c8; font-size: 18px; }
.wx-cell-center { justify-content: center; }
.wx-danger { color: var(--wx-red); }
.wx-note { font-size: 13px; color: var(--wx-sub); padding: 4px 16px 14px; margin: 0; }
  .wx-profile {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px 18px; background: var(--wx-surface);
  margin-bottom: 8px;
}
.wx-profile-avatar {
  width: 60px; height: 60px; border-radius: 6px; background: var(--wx-green); color: #fff;
  display: grid; place-items: center; font-size: 26px;
}
.wx-profile-main { min-width: 0; flex: 1; }
.wx-profile-name { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-profile-id { font-size: 14px; color: var(--wx-sub); margin-top: 8px; }
.wx-devices { padding: 0; }
.wx-device {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; position: relative;
}
.wx-device + .wx-device::before {
  content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--wx-line);
}
.wx-device-main { min-width: 0; flex: 1; }
.wx-device-name { font-size: 16px; }
.wx-device-sub { font-size: 12px; color: var(--wx-sub); margin-top: 3px; }
.wx-device-now { font-size: 12px; color: var(--wx-green); }
.wx-device-actions { display: flex; gap: 8px; flex: none; }
.wx-mini {
  padding: 5px 10px; border-radius: 4px; border: 1px solid var(--wx-line-strong);
  background: var(--wx-surface); color: #3f3f3f; font-size: 13px;
}
.wx-mini.danger { color: var(--wx-red); border-color: rgba(250, 81, 81, .45); }
.wx-mini-input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--wx-line-strong);
  border-radius: 4px; outline: none; font-size: 15px;
}

/* ---------- 模型面板 / 提示 / 图片预览 ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end;
  background: rgba(0, 0, 0, .4); }
.wx-sheet-panel {
  width: 100%; max-height: 84vh; display: flex; flex-direction: column; background: var(--wx-surface);
  border-radius: 12px 12px 0 0; padding: 12px 16px calc(14px + var(--safe-bottom));
}
.wx-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.wx-sheet-head strong { font-size: 16px; }
.wx-model-search {
  width: 100%; height: 38px; margin: 12px 0; padding: 0 12px; border: 0; border-radius: 6px;
  background: var(--wx-bg); outline: none; font-size: 15px;
}
.wx-model-list { display: grid; gap: 6px; max-height: 40vh; overflow-y: auto; }
.wx-model {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 6px;
  background: var(--wx-bg); text-align: left; width: 100%;
}
.wx-model.active { background: rgba(7, 193, 96, .12); }
.wx-model-main { min-width: 0; flex: 1; }
.wx-model-name { font-size: 16px; }
.wx-model-sub { display: block; font-size: 12px; color: var(--wx-sub); margin-top: 2px; }
.wx-model-check { color: var(--wx-green); }
.wx-effort-list { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.wx-effort {
  padding: 6px 12px; border-radius: 4px; background: var(--wx-bg); color: #3f3f3f; font-size: 14px;
}
.wx-effort.active { background: rgba(7, 193, 96, .14); color: var(--wx-green); }
.wx-info { display: grid; gap: 6px; padding: 12px; border-radius: 6px; background: var(--wx-bg); margin: 4px 0 12px; }
.wx-info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.wx-info-row span:first-child { color: var(--wx-sub); }
.wx-info-row span:last-child { text-align: right; }
.wx-model-save {
  width: 100%; height: 46px; border-radius: 6px; background: var(--wx-green); color: #fff;
  font-size: 16px; font-weight: 500;
}
.wx-toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 90;
  max-width: 76vw; padding: 12px 18px; border-radius: 8px; background: rgba(0, 0, 0, .75);
  color: #fff; font-size: 14px; text-align: center; line-height: 1.4;
}
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.lightbox img { max-width: 100vw; max-height: 76vh; touch-action: none; transform-origin: center; }
.lightbox-bar { display: flex; gap: 12px; position: relative; z-index: 1; }
.lightbox-button {
  padding: 9px 18px; border-radius: 4px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 15px;
}

/* ---------- 首次连接 ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 32px 22px; background: var(--wx-bg); }
.gate-inner { width: 100%; max-width: 380px; }
.gate-logo {
  width: 56px; height: 56px; border-radius: 12px; background: var(--wx-green); color: #fff;
  display: grid; place-items: center; font-size: 24px; font-weight: 600; margin-bottom: 20px;
}
.gate h1 { font-size: 22px; margin: 0 0 8px; }
.gate p { color: var(--wx-sub); font-size: 14px; margin: 0 0 22px; }
.gate input {
  width: 100%; height: 46px; padding: 0 14px; margin-bottom: 10px; border: 0; border-radius: 6px;
  background: var(--wx-surface); outline: none; font-size: 16px;
}
.gate button[type=submit] {
  width: 100%; height: 46px; border-radius: 6px; background: var(--wx-green); color: #fff;
  font-size: 17px; font-weight: 500; margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
[hidden] { display:none !important; }
.wx-action-hub{display:flex;gap:8px;padding:6px 12px;background:#fff7db;flex-shrink:0}
.wx-action-hub button{border:0;background:transparent;color:#8b6400;font-size:13px;padding:5px 10px}
.wx-upload-tray{display:flex;gap:8px;overflow:auto;max-height:120px;padding:8px 12px;background:#f7f7f7;flex-shrink:0}
.wx-upload-item{display:flex;flex-direction:column;position:relative;flex:0 0 115px;font-size:11px;gap:3px;overflow:hidden;border:1px solid #ddd;border-radius:7px;padding:6px;background:#fff}
.wx-upload-item img{height:42px;object-fit:contain}
.wx-upload-item span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.wx-upload-item button{padding:3px 5px;font-size:11px;min-height:22px}
.wx-extras-body{overflow:auto;max-height:65dvh;padding:4px 0 12px;overscroll-behavior:contain}
.wx-extra-button{display:block;width:100%;background:#fff;border:0;border-bottom:1px solid #eee;padding:13px 10px;text-align:left;font-size:15px;color:#333}
.wx-field-label{display:block;font-size:13px;color:#666;margin:12px 0 5px}
.wx-field{display:block;box-sizing:border-box;width:100%;max-width:100%;border:1px solid #ddd;border-radius:6px;padding:11px;background:white;font-size:15px;color:#222}
textarea.wx-field{min-height:110px;resize:vertical}
.wx-request{padding:12px;margin:10px 0;border:1px solid #ddd;border-radius:8px;background:white;overflow-wrap:anywhere}
.wx-request-detail{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:230px;overflow:auto}
.wx-question{font-size:15px;line-height:1.6}
.wx-option.wx-selected{background:#eaf7ef;border-color:#07a64f;color:#056b34}
.wx-attachment-group{display:flex;flex-direction:column;gap:8px;min-width:0}
.wx-cell[type=button]{width:100%;border:0;text-align:left;background:#fff;color:inherit;font:inherit}
.wx-upload-item small{color:#07a64f}
.wx-sheet-panel{max-width:100%;overflow:hidden}
#sheet .wx-sheet-panel{padding-bottom:12px}
.wx-sheet-head{flex:none}
.wx-model-search{flex:none;margin:10px 0}
.wx-model-list{flex:1;min-height:180px;max-height:none;overflow-y:auto;overscroll-behavior:contain;padding-right:2px}
.wx-effort-list{flex:none;margin:10px 0 8px}
.wx-model-save{flex:none;margin-top:4px}

.wx-mark-read{flex:none;margin:6px 12px;padding:7px 10px;border:0;border-radius:4px;background:#fff;color:var(--wx-blue);font-size:14px;text-align:center}

:root[data-theme="dark"]{color-scheme:dark;--wx-bg:#191919;--wx-surface:#242424;--wx-tabbar:#202020;--wx-text:#ededed;--wx-sub:#aaa;--wx-line:rgba(255,255,255,.12);--wx-bubble:#326d30;--wx-pin-bg:rgba(255,183,77,.10);--wx-pin-border:rgba(255,183,77,.42);--wx-pin-chip:rgba(255,183,77,.16);--wx-pin-text:#ffd591}
[data-theme="dark"] .wx-row-pinned:active{background:rgba(255,255,255,.08)}
[data-theme="dark"] .wx-bubble,[data-theme="dark"] input,[data-theme="dark"] textarea,[data-theme="dark"] .wx-mark-read{background:var(--wx-surface);color:var(--wx-text)}
.wx-bubble{font-size:var(--reader-size,16px)}
#input{max-height:110px;overflow-y:hidden}
.wx-new-messages{align-self:center;flex:none;border:0;border-radius:14px;padding:8px 14px;background:var(--wx-surface);color:var(--wx-blue);min-height:40px}
.wx-table-cards{padding:8px}
.wx-table-card-line{padding:6px;overflow-wrap:anywhere}
.wx-suggest{margin:4px 12px 0}
.wx-speak{flex:none;width:34px;height:34px;display:grid;place-items:center;align-self:flex-start;
  margin-top:2px;border:0;border-radius:50%;background:var(--wx-surface);color:var(--wx-blue);
  box-shadow:0 1px 2px rgba(0,0,0,.06)}
.wx-speak:active{background:rgba(0,0,0,.06)}
.wx-speak.reading{color:#fff;background:var(--wx-green)}
.wx-msg-actions{display:flex;align-items:center;justify-content:flex-end;
  gap:6px;margin:5px 2px 0}
.wx-copy-message{flex:none;width:34px;height:34px;display:grid;place-items:center;
  border:0;border-radius:50%;background:var(--wx-surface);color:var(--wx-blue);
  box-shadow:0 1px 2px rgba(0,0,0,.06)}
.wx-copy-message:active{background:rgba(0,0,0,.06)}
.wx-msg.mine .wx-copy-message,.wx-msg.mine .wx-speak{background:rgba(255,255,255,.22);color:#fff}
.wx-capture-overlay{position:fixed;inset:0;z-index:2100;background:rgba(0,0,0,.45);
  display:flex;align-items:flex-end;justify-content:center;padding:12px 8px 0;box-sizing:border-box}
.wx-capture-panel{display:flex;flex-direction:column;width:min(100%,760px);height:90vh;
  height:90dvh;max-height:100%;background:var(--wx-surface);color:var(--wx-text);
  border-radius:16px 16px 0 0;padding:14px 14px max(12px,env(safe-area-inset-bottom));box-sizing:border-box}
.wx-capture-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}
.wx-capture-header strong{font-size:18px}
.wx-capture-action{border:1px solid var(--wx-line);border-radius:8px;padding:9px 14px;
  min-height:40px;background:var(--wx-surface);color:var(--wx-blue);font-size:15px}
.wx-capture-action:disabled{opacity:.45}
.wx-capture-toolbar{display:flex;gap:10px;flex-wrap:wrap;flex:none}
.wx-capture-toolbar .wx-capture-action{flex:1}
.wx-capture-toolbar .wx-capture-action:first-child{background:var(--wx-green);border-color:var(--wx-green);color:white}
.wx-capture-info{font-size:14px;color:var(--wx-sub);margin:10px 0;flex:none;overflow-wrap:anywhere}
.wx-capture-note{font-size:12px;line-height:1.6;color:var(--wx-sub);margin:9px 0;flex:none}
.wx-capture-preview{flex:1;min-height:40px;overflow:auto;overscroll-behavior:contain;
  background:var(--wx-bg);border:1px solid var(--wx-line);border-radius:8px;padding:8px}
.wx-capture-preview img{display:block;width:auto;max-width:none;height:auto;max-height:none;margin:0}
.wx-capture-preview img[hidden]{display:none}
.wx-suggest-toggle{border:0;background:none;color:var(--wx-blue);font-size:13px;padding:4px 0;min-height:32px}
.wx-suggest-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
.wx-suggest-button{border:1px solid var(--wx-green);color:var(--wx-green);background:var(--wx-surface);
  border-radius:14px;padding:6px 12px;font-size:14px;min-height:36px;max-width:100%;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* ---------- 英语大对战后台（内置） ---------- */
.admin-status-card{margin:8px 8px 0;padding:12px}
.admin-status-row{display:flex;align-items:center;gap:8px}
.admin-status-row strong{flex:1;font-size:16px;color:var(--wx-text)}
.admin-note{margin:6px 0 8px;font-size:12px;color:var(--wx-sub)}
.admin-actions{display:flex;gap:8px}
.wx-mini-btn{flex:1;min-height:36px;border:1px solid var(--wx-line);border-radius:8px;
  background:var(--wx-surface);color:var(--wx-text);font-size:14px}
.admin-status-dot{width:10px;height:10px;border-radius:50%;background:var(--wx-faint);flex:none}
.admin-status-dot.ok{background:var(--wx-green)}
.admin-status-dot.login{background:var(--wx-blue)}
.admin-status-dot.err{background:#e64340}
.admin-status-dot.wait{background:var(--wx-faint)}
.admin-frame-wrap{display:none;margin:8px;border:1px solid var(--wx-line);border-radius:8px;overflow:hidden;background:var(--wx-surface)}
.admin-frame-wrap.active{display:block}
.admin-frame-wrap p.admin-note{margin:8px 12px}
.admin-scroll{padding:0}
.admin-login-row{display:flex;gap:8px;align-items:center}
.admin-login-row .wx-field{flex:1;min-width:0}
.admin-login-row .wx-mini-btn{flex:none;min-width:88px}
.admin-frame{display:block;width:100%;border:0;background:#f4f5f1;height:calc(100vh - 108px)}
.admin-open-wide{display:block;width:100%;margin:10px 0 0}

/* ================= 观感升级：参考 codex-remote-ui 的卡片与圆角 ================= */
.wx-banner {
  margin: 10px 12px 0; padding: 9px 12px; border-radius: var(--wx-radius-sm);
  background: var(--wx-green-soft); color: var(--wx-green-dark);
  font-size: 12.5px; display: flex; align-items: center; gap: 7px;
  box-shadow: var(--wx-shadow);
}
.wx-banner.warn { background: #fdf3e3; color: #a9701c; }
.wx-banner-icon { color: inherit; opacity: .8; }

.wx-list { background: transparent; }
.wx-pin-group {
  margin: 12px 12px 0; border: 1px solid #f6e3bd; border-radius: var(--wx-radius);
  background: #fffaf0; overflow: hidden; box-shadow: var(--wx-shadow);
}
.wx-pin-divider { height: 0; margin: 12px 12px 0; border-top: 1px dashed #f0d9ae; opacity: .8; }
.wx-pin-badge {
  font-size: 11px; padding: 1px 7px; border-radius: 6px;
  color: #b06d16; border: 1px solid #f3d9a7; background: #fff6e5; font-weight: 600;
}
.wx-row {
  padding: 13px 14px; background: var(--wx-surface);
  border-radius: 0; box-shadow: none; border: 0;
}
.wx-list > .wx-row {
  /* width:100% plus a side margin pushed the time off the right edge. */
  width: auto; margin: 8px 12px 0; border-radius: var(--wx-radius); box-shadow: var(--wx-shadow);
}
.wx-pin-group .wx-row { margin: 0; background: transparent; box-shadow: none; }
.wx-row:active { background: var(--wx-surface-2); }
.wx-row + .wx-row::before { background: var(--wx-line); }
.wx-list > .wx-row + .wx-row::before { background: transparent; }
.wx-row-name { font-size: 15.5px; font-weight: 600; }
.wx-row-time { font-size: 12px; color: var(--wx-faint); }
.wx-row-preview { font-size: 13.5px; color: var(--wx-sub); margin-top: 3px; }
.wx-empty { color: var(--wx-faint); }

.wx-tabbar {
  background: var(--wx-surface); border-top: 1px solid var(--wx-line);
  box-shadow: 0 -1px 2px rgba(20,23,30,.04);
}
.wx-tab { color: var(--wx-faint); }
.wx-tab.active { color: var(--wx-green); }
.wx-tab-label { font-size: 11px; }

.wx-nav { background: var(--wx-bg); }
.wx-nav.collapsed { background: var(--wx-surface); border-bottom: 1px solid var(--wx-line); }
.wx-nav-title { font-weight: 600; }

.wx-bubble { border-radius: 15px; box-shadow: var(--wx-shadow); }
.wx-composer { background: var(--wx-surface); border-top: 1px solid var(--wx-line); }

.wx-empty, .wx-note, .wx-pin-group p { line-height: 1.6; }
.admin-status-card {
  margin: 12px; padding: 15px; border-radius: var(--wx-radius);
  border: 1px solid var(--wx-line); background: var(--wx-surface); box-shadow: var(--wx-shadow);
}
.wx-mini-btn {
  min-height: 38px; border-radius: var(--wx-radius-sm); border: 1px solid var(--wx-line);
  background: var(--wx-surface); font-weight: 500;
}
/* ================= 细节完善：分组卡片、图标底色、对齐 ================= */
.wx-scroll { padding-bottom: 18px; }
.wx-group {
  margin: 10px 12px 0; background: var(--wx-surface);
  border-radius: var(--wx-radius); box-shadow: var(--wx-shadow); overflow: hidden;
}
.wx-cell { padding: 14px 14px; display: flex; align-items: center; gap: 11px; min-height: 56px; }
.wx-cell + .wx-cell { border-top: 1px solid var(--wx-line); }
.wx-cell-title { font-size: 15.5px; color: var(--wx-text); flex: 1; font-weight: 500; }
.wx-cell-value { font-size: 13.5px; color: var(--wx-faint); }
.wx-chevron { color: var(--wx-faint); font-size: 18px; margin-left: 2px; }
.wx-cell-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 17px;
  background: var(--wx-surface-2); color: var(--wx-sub);
}
.wx-cell-icon svg { width: 20px; height: 20px; }
.ic-slate { background: #eef2f7; color: #5b6b85; }
.ic-green { background: var(--wx-green-soft); color: var(--wx-green-dark); }
.ic-amber { background: #fdf3e3; color: var(--wx-amber); }
.ic-red   { background: #fdecec; color: var(--wx-red); }
.wx-icon-blue  { background: #eaf1fe; color: var(--wx-blue); }
.wx-icon-gray  { background: #eef2f7; color: var(--wx-sub); }
.wx-icon-green { background: var(--wx-green-soft); color: var(--wx-green-dark); }
.wx-danger { color: var(--wx-red); font-weight: 500; }

/* 个人资料头：白底通栏，圆角头像 */
.wx-profile {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px; background: var(--wx-surface); margin-bottom: 0;
}
.wx-profile-avatar {
  width: 62px; height: 62px; border-radius: 16px; flex: none;
  background: linear-gradient(145deg, #17c288, #0a9e72); color: #fff;
  display: grid; place-items: center; font-size: 30px; font-weight: 700;
}
.wx-profile-name { font-size: 20px; font-weight: 700; color: var(--wx-text); }
.wx-profile-id { font-size: 13.5px; color: var(--wx-faint); margin-top: 5px; }

/* 顶部栏：透明态不再重复显示页面名 */
.wx-nav-transparent { background: var(--wx-bg); border-bottom: 0; }
.wx-nav-transparent .wx-nav-title { font-size: 0; }
.wx-nav-title { font-size: 17px; }
.wx-view > .wx-nav:not(.wx-chat-nav):not(.collapsed) { border-bottom: 1px solid var(--wx-line); }

/* 运行中 / 后台：卡片列表 */
#running-list { padding: 12px 12px 4px; }
#running-list .wx-row { margin: 0 0 10px; border-radius: var(--wx-radius); box-shadow: var(--wx-shadow); }
/* ================= 对话页与气泡：贴近参考界面 ================= */
.wx-bubble {
  border-radius: 15px; padding: 11px 13px; font-size: 15px; line-height: 1.62;
  box-shadow: var(--wx-shadow); background: var(--wx-surface);
}
.wx-msg.mine .wx-bubble { background: var(--wx-green); color: #fff; }
.wx-msg.mine .wx-bubble::after { border-left-color: var(--wx-green); }
.wx-chat-status {
  font-size: 12.5px; color: var(--wx-sub); background: var(--wx-bg);
  padding: 7px 12px; text-align: center; border-bottom: 1px solid var(--wx-line);
}
.wx-new-messages { border-radius: 999px; box-shadow: var(--wx-shadow-float); }
.wx-command {
  border-radius: var(--wx-radius-sm); border: 1px solid var(--wx-line);
  background: var(--wx-surface); font-weight: 500; color: var(--wx-sub);
}
.wx-composer {
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--wx-surface); border-top: 1px solid var(--wx-line);
}
.wx-group-title { margin: 14px 16px 0; font-size: 12.5px; color: var(--wx-faint); }

/* 底部标签栏：白底、选中绿色、图标居中 */
.wx-tabbar {
  height: var(--tab-h, 60px); display: flex; align-items: stretch;
  background: var(--wx-surface); border-top: 1px solid var(--wx-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.wx-tab { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; color: var(--wx-faint); position: relative; }
.wx-tab.active { color: var(--wx-green); }
.wx-tab-icon svg { width: 24px; height: 24px; }
.wx-tab-label { font-size: 11px; }
.wx-tab-badge {
  position: absolute; top: 4px; margin-left: 14px;
  min-width: 16px; height: 16px; border-radius: 999px; background: var(--wx-red);
  color: #fff; font-size: 10.5px; font-style: normal; line-height: 16px;
  text-align: center; padding: 0 4px;
}
/* ================= 聊天页最终对齐（参考 codex-remote-ui） ================= */
.wx-chat { padding: 12px 0; }
.wx-time { font-size: 12px; color: var(--wx-faint); margin: 6px 0 14px; text-align: center; }
.wx-msg { padding: 0 13px; margin-bottom: 16px; gap: 9px; }
.wx-msg-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 16px; font-weight: 600; }
.wx-msg-body { max-width: 76%; }
.wx-bubble { border-radius: 15px; padding: 11px 13px; font-size: 15px; line-height: 1.62; }
.wx-msg:not(.mine) .wx-bubble::after,
.wx-msg.mine .wx-bubble::after { display: none; }
/* 指令标签：浅绿小胶囊，与参考图一致 */
.wx-cmd-tag,
.wx-bubble .wx-cmd-tag {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,.26); color: #fff;
  padding: 1px 8px; border-radius: 6px; margin-bottom: 7px;
}
.wx-msg:not(.mine) .wx-cmd-tag { background: var(--wx-green-soft); color: var(--wx-green-dark); }
/* 系统提示：灰底药丸 */
.wx-sys {
  width: fit-content; margin: 0 auto 15px; padding: 3px 12px; border-radius: 8px;
  background: #e7e9ee; color: var(--wx-sub); font-size: 12px; text-align: center;
}
.wx-tool { margin: 8px 24px 14px; }
/* 底部操作区：模型条 + 快捷指令 + 输入行 */
.wx-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.wx-command-row { margin-bottom: 8px; gap: 7px; }
.wx-command { height: 31px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
.wx-composer-input, .wx-composer textarea, .wx-composer input[type="text"] {
  background: var(--wx-bg); border-radius: 10px; min-height: 38px; padding: 9px 12px; font-size: 15px;
}
/* ================= 运行中：任务卡片（参考 codex-remote-ui） ================= */
#running-scroll { padding: 4px 0 16px; }
#running-list { padding: 0; }
.wx-run-card {
  background: var(--wx-surface); margin: 10px 12px 0;
  border-radius: var(--wx-radius); box-shadow: var(--wx-shadow); padding: 14px 15px;
}
.wx-run-top { display: flex; align-items: flex-start; gap: 11px; }
.wx-run-main { min-width: 0; flex: 1; }
.wx-run-name { font-size: 15.5px; font-weight: 600; color: var(--wx-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-run-status {
  margin-top: 6px; font-size: 13px; color: var(--wx-green-dark);
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.wx-run-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--wx-green);
  flex: none; animation: wx-pulse 1.6s ease-in-out infinite;
}
@keyframes wx-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.45); }
  50%     { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
.wx-run-foot {
  display: flex; gap: 9px; margin-top: 13px;
  padding-top: 12px; border-top: 1px solid var(--wx-line);
}
.wx-run-open, .wx-run-stop {
  flex: 1; min-height: 40px; border-radius: var(--wx-radius-sm);
  font-size: 14px; font-weight: 600; border: 1px solid var(--wx-line);
  background: var(--wx-surface); color: var(--wx-text);
}
.wx-run-open { color: var(--wx-green-dark); border-color: #cfe9dd; background: var(--wx-green-soft); }
.wx-run-stop { color: var(--wx-red); border-color: #f8d7d6; background: #fdecec; }
.wx-run-open:active, .wx-run-stop:active { filter: brightness(.97); }
/* ================= 头像立体感 / 转圈位置 / 置顶标记 ================= */
/* 圆角矩形 + 顶部高光，做出轻微凸起的立体感（参考图那种观感）。 */
.wx-avatar {
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255,255,255,.42), rgba(255,255,255,0) 46%), var(--wx-av-color, #4f8f7b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45),
              inset 0 -2px 4px rgba(0,0,0,.16),
              0 2px 5px rgba(20,23,30,.18);
  text-shadow: 0 1px 1px rgba(0,0,0,.22);
}
/* 右侧尾列：置顶标记紧挨时间左边，转圈在时间正下方 */
.wx-row-trailing {
  flex: none; margin-left: 8px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.wx-row-trailing .wx-row-time { flex: none; }
.wx-row-trailing .wx-pin-badge { margin: 0; }
.wx-row-trailing .wx-spinner {
  width: 18px; height: 18px; border-width: 2px;
  margin: 3px 0 0; align-self: flex-end;
}
.wx-pin-group .wx-row-trailing { margin-left: 6px; }
/* “全部已读”：从页面中间移进顶部栏，做成标题右侧的小按钮。 */
.wx-nav-text {
  flex: none; height: 30px; padding: 0 11px; margin-right: 2px;
  border-radius: 8px; border: 1px solid var(--wx-line);
  background: var(--wx-surface); color: var(--wx-sub);
  font-size: 12.5px; font-weight: 500;
}
.wx-nav-text:active { background: var(--wx-surface-2); }
.wx-mark-read { display: none; }
/* “全部已读”：放在“已连接电脑”那一行的最右边。 */
.wx-banner-action {
  margin-left: auto; flex: none; height: 26px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #bfe3d3; background: #fff;
  color: var(--wx-green-dark); font-size: 12px; font-weight: 500;
}
.wx-banner-action:active { filter: brightness(.97); }
.wx-banner.warn .wx-banner-action { border-color: #eed9ad; color: #a9701c; }
/* 聊天页运行条：显示电脑当前动作 + 转圈，手机能看出它在动 */
/* 聊天页运行条：显示电脑当前动作 + 小转圈 */
.wx-runbar { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.wx-runbar-spinner { width: 15px; height: 15px; flex: 0 0 15px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid rgba(7,193,96,.28); border-top-color: var(--wx-green);
  animation: wxspin .8s linear infinite;
}
.wx-runbar #runbar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 运行中列表里“已结束但还没看”的卡片：不再显示成正在跑 */
.wx-run-card.wx-run-done { background: var(--wx-surface-2); box-shadow: none; border: 1px solid var(--wx-line); }
.wx-run-status.done { color: var(--wx-faint); }
.wx-run-card.wx-run-done .wx-run-name { color: var(--wx-sub); }
/* Computer selection: text truncates rather than hiding the nav actions. */
.computer-tabs{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%}
.computer-tab{border:0;background:transparent;color:var(--wx-sub);font:inherit;font-size:14px;font-weight:600;
  min-width:0;max-width:30vw;min-height:32px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:5px 10px;border-radius:999px;cursor:pointer}
.computer-tab:active{background:var(--wx-surface-2)}
.computer-tab:focus-visible{outline:2px solid var(--wx-text);outline-offset:-2px}
.computer-tab.active{background:var(--wx-surface);color:var(--wx-text);box-shadow:0 1px 2px rgba(0,0,0,.10)}
/* A DSH computer is a different engine: mark the tab and hide the GPT quota
   card, which only describes the Codex account. */
.computer-tab[data-engine="dsh"]::after{content:"DSH";font-size:9px;font-weight:700;letter-spacing:.4px;
  margin-left:3px;padding:1px 3px;border-radius:4px;vertical-align:2px;background:var(--wx-surface-2);color:var(--wx-sub)}
html[data-engine="dsh"] #account-quotas{display:none!important}
html[data-engine="dsh"] #computer-download{display:none!important}
.computer-option{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line,#ddd);padding:8px 0}
.computer-option>.wx-extra-button{flex:1;min-width:0;text-align:left;overflow-wrap:anywhere}
.computer-option .wx-mini-btn{flex-shrink:0;padding:7px}
.wx-artifact-list{display:grid;gap:12px;margin-top:12px}
.wx-artifact-frame{width:100%;height:65vh;border:1px solid #ddd;background:white;margin-top:12px}
.wx-artifact-text{white-space:pre-wrap;overflow-wrap:anywhere;max-height:65vh;overflow:auto;font-size:13px}
.wx-artifact-media{width:100%;max-height:65vh;margin-top:12px}
.wx-file{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;min-width:min(260px,65vw)}
.wx-file-actions{grid-column:1/-1;display:flex;gap:18px;justify-content:flex-end}

/* ================= 手感与状态：只用位移/透明度，滚动不增加负担 ================= */
:root{
  --wx-ease:cubic-bezier(.22,.61,.36,1);
  --wx-press:rgba(17,24,39,.055);
  --wx-run:#0f9d6a;
  --wx-run-soft:#e8f7f1;
  --wx-wait:#a86a12;
  --wx-wait-soft:#fdf4e3;
}
.wx-row{transition:background-color .14s var(--wx-ease),transform .14s var(--wx-ease)}
.wx-row:active{background:var(--wx-press);transform:scale(.994)}
.wx-row[data-unread="1"] .wx-row-name{font-weight:700}
.wx-row-status{
  flex:none;display:inline-flex;align-items:center;height:18px;padding:0 6px;border-radius:6px;
  font-size:11px;font-weight:600;letter-spacing:.1px;line-height:18px;
}
.wx-row-status.run{color:var(--wx-run);background:var(--wx-run-soft)}
.wx-row-status.wait{color:var(--wx-wait);background:var(--wx-wait-soft)}
.wx-row-status.bad{color:var(--wx-red);background:#fdecec}
.wx-row-status.muted{color:var(--wx-sub);background:var(--wx-surface-2)}
.wx-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.wx-icon,.wx-back,.wx-tab,.wx-compose-icon{transition:background-color .14s var(--wx-ease),opacity .14s var(--wx-ease)}
.wx-icon:active,.wx-back:active{background:var(--wx-press)}
.wx-tab-icon{transition:transform .18s var(--wx-ease)}
.wx-tab:active .wx-tab-icon{transform:scale(.92)}
.wx-tab.active .wx-tab-label{font-weight:600}
.wx-tab-badge{box-shadow:0 0 0 2px var(--wx-surface)}

.wx-input-pill{transition:box-shadow .16s var(--wx-ease),background-color .16s var(--wx-ease)}
.wx-composer:focus-within .wx-input-pill{
  background:var(--wx-surface);
  box-shadow:0 0 0 2px rgba(16,185,129,.16);
}
.wx-compose-send,.wx-compose-insert{transition:opacity .14s var(--wx-ease),transform .14s var(--wx-ease)}
.wx-compose-send:active,.wx-compose-insert:active{transform:scale(.96)}
.wx-compose-send.busy{opacity:.62}
.wx-compose-send:disabled{opacity:.5}

.wx-image{opacity:0;transition:opacity .22s var(--wx-ease)}
.wx-image.loaded,.wx-image-wrap:has(.wx-image[src]) .wx-image{opacity:1}
.wx-image-wrap{max-width:100%}

.wx-bubble{overflow-wrap:anywhere}
.wx-msg:not(.mine) .wx-bubble{background:var(--wx-surface)}
.wx-new-messages{animation:wx-rise .18s var(--wx-ease)}
@keyframes wx-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.wx-link-badge{
  flex:none;align-self:center;margin:6px 12px 0;padding:2px 9px;border-radius:999px;
  font-size:11px;line-height:17px;background:var(--wx-surface);color:var(--wx-faint);
  border:1px solid var(--wx-line);
}
.wx-link-badge[data-state="ok"]{color:var(--wx-green-dark);background:var(--wx-green-soft);border-color:transparent}
.wx-link-badge[data-state="slow"]{color:var(--wx-wait);background:var(--wx-wait-soft);border-color:transparent}
.wx-link-badge[data-state="off"]{color:var(--wx-red);background:#fdecec;border-color:transparent}
@media (prefers-reduced-motion:no-preference){
  .wx-link-badge{transition:background-color .2s var(--wx-ease),color .2s var(--wx-ease)}
}

.wx-sheet-panel{box-shadow:0 -12px 40px rgba(15,23,42,.16)}
.wx-extra-button{transition:background-color .14s var(--wx-ease)}
.wx-extra-button:active{background:var(--wx-surface-2)}
.wx-file{border-radius:12px;padding:10px 12px;border:1px solid var(--wx-line);background:var(--wx-surface-2)}
.wx-file-actions button{min-height:32px;padding:0 10px;border-radius:8px;color:var(--wx-green-dark);font-weight:600}
.wx-file-actions button:active{background:var(--wx-green-soft)}
:root[data-theme="dark"] .wx-file-actions button{color:#7fe3bb}

@media (prefers-reduced-motion: reduce){
  .wx-row,.wx-icon,.wx-back,.wx-tab,.wx-tab-icon,.wx-input-pill,.wx-compose-send,.wx-compose-insert,.wx-image,.wx-extra-button{transition:none}
  .wx-new-messages{animation:none}
  .wx-row:active,.wx-compose-send:active,.wx-compose-insert:active{transform:none}
}

/* Three clear device tabs; reserve the whole left side for actual navigation. */
.wx-home-nav{gap:8px;padding-inline:12px}
.wx-home-nav>.wx-nav-side:first-child{display:none}
.wx-home-nav .wx-nav-title{flex:1;min-width:0;overflow:visible;text-align:left}
.wx-home-nav .wx-nav-right{width:auto;flex:0 0 auto;padding:0;gap:0}
.wx-home-nav .computer-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:4px;background:var(--wx-surface-2,#e5e7eb);border-radius:12px;width:100%}
.wx-home-nav .computer-tab{min-width:0;max-width:none;width:100%;padding:8px 2px;font-size:14px;border-radius:9px;white-space:nowrap;transition:background .15s,color .15s,box-shadow .15s}
.wx-home-nav .computer-tab[data-engine="dsh"]::after{display:none}
.wx-home-nav #wx-title-badge{display:none}
.wx-run-source{display:inline-flex;margin:5px 0 2px;padding:2px 8px;border-radius:6px;background:rgba(34,125,110,.10);color:#23776c;font-size:11px;font-weight:600;line-height:1.6}
.wx-run-source[data-engine="dsh"]{background:rgba(98,89,217,.12);color:#7668d7}
.wx-fleet-note{padding:10px 16px;color:var(--wx-sub);font-size:12px}
.wx-run-stop:disabled{opacity:.4}
.switching-computer #app{opacity:.7;pointer-events:none;transition:opacity .12s}
@media(prefers-reduced-motion:reduce){.switching-computer #app,.computer-tab{transition:none}}

/* DSH cannot insert into a running turn. That is a capability limit, not a
   connection warning, so the running bar stays neutral instead of yellow. */
.wx-runbar.no-insert { background: var(--wx-surface-2); color: var(--wx-sub); border-top-color: var(--wx-line); }
.wx-runbar.no-insert .wx-runbar-spinner { border-color: rgba(86,93,107,.20); border-top-color: var(--wx-sub); }

.lp-launch{margin:8px 16px;padding:9px 14px}.lp-entry{display:block;margin:6px 0}.lp-box{box-sizing:border-box;width:min(96vw,470px);max-height:93dvh;overflow:auto;padding:14px;border:0;border-radius:14px;color:#202521;background:#fafbf9}.lp-box::backdrop{background:#101813bb}.lp-head,.lp-form,.lp-tools{display:flex;align-items:center;gap:8px}.lp-head{justify-content:space-between;margin-bottom:12px}.lp-form input{min-width:0;flex:1;padding:8px;border:1px solid #a7afa8;border-radius:6px;font:inherit}.lp-box button{min-height:38px}.lp-status{font-size:13px;line-height:1.45;color:#425547;margin:8px 0}.lp-image{display:block;width:auto;height:auto;max-width:100%;max-height:64dvh;margin:8px auto;touch-action:none;cursor:pointer}.lp-image[hidden],.lp-tools[hidden]{display:none}.lp-tools{justify-content:center}
/* The image element is exactly the interactive viewport. Rotate the whole plane only when the OS stays portrait. */
dialog.lp-box{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;padding:0;overflow:hidden;background:#141817;color:#fff}.lp-box .lp-head{padding:12px 64px 0 14px}.lp-box .lp-form,.lp-box .lp-status{margin:12px 64px 12px 14px}.lp-box .lp-status{color:#d5ded8}.lp-box .lp-exit{position:absolute;z-index:3;top:max(6px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));width:48px;height:48px;border-radius:50%;background:#202828cf;color:white;font:30px/1 sans-serif;border:0}.lp-showing .lp-head strong,.lp-showing .lp-form,.lp-showing .lp-status{display:none}.lp-showing .lp-head{margin:0;padding:0}.lp-box .lp-image:not([hidden]){position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;object-fit:fill}.lp-upgrade{max-width:min(86vw,420px);border:0;border-radius:12px;padding:16px}.lp-upgrade button{margin:4px;min-height:40px}@media(orientation:portrait){dialog.lp-box{inset:auto;left:100vw;top:0;width:100dvh;height:100vw;transform-origin:top left;transform:rotate(90deg)}}

