/* ============================================================
   电商客服模拟器 · 千牛工作台风格（深浅双主题）
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html[data-theme="light"] {
  --bg: #eef0f3;
  --panel: #ffffff;
  --panel2: #f5f6f8;
  --line: #e4e7ec;
  --line2: #eef0f4;
  --ink: #1f2430;
  --ink2: #4a5261;
  --sub: #8a93a3;
  --feed: #f4f6f8;
  --bubble: #ffffff;
  --bubble-line: #e6e9ee;
  --opt: #ffffff;
  --opt-hover: #fbfcfe;
  --title: #232a36;
  --title-ink: #e8ecf3;
  --title-sub: #98a2b3;
  --start-a: #2f3a4d;
  --start-b: #14181f;
  --shadow: 0 3px 12px rgba(30, 50, 90, .08);
  --tag-bg: #f1f3f7;
  --tag-line: #e8ecf2;
  --tag-ink: #6b7688;
}
html[data-theme="dark"] {
  --bg: #101319;
  --panel: #1a1e26;
  --panel2: #212630;
  --line: #2a303a;
  --line2: #232833;
  --ink: #e7ebf3;
  --ink2: #b6bfcd;
  --sub: #79839a;
  --feed: #14181f;
  --bubble: #232935;
  --bubble-line: #2d3441;
  --opt: #1e242e;
  --opt-hover: #262d38;
  --title: #0d1014;
  --title-ink: #e7ebf3;
  --title-sub: #8b95a6;
  --start-a: #1b2432;
  --start-b: #0a0d12;
  --shadow: 0 3px 14px rgba(0, 0, 0, .35);
  --tag-bg: #242a34;
  --tag-line: #2e3542;
  --tag-ink: #9aa4b6;
}

:root {
  --brand: #ff6a00;
  --blue: #2b7fff;
  --red: #f5483b;
  --green: #17b26a;
  --purple: #8b5cf6;
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:disabled { cursor: not-allowed; }

/* ---------------- 布局 ---------------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------------- 顶栏 ---------------- */
.titlebar {
  height: 56px; flex: 0 0 56px;
  background: var(--title);
  display: flex; align-items: center; gap: 14px;
  padding: 0 12px;
  color: var(--title-ink);
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #ff8a3d, #ff5f00);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 106, 0, .35);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 13.5px; }
.brand-txt i { font-size: 10.5px; color: #8d97a8; font-style: normal; }
.lv-badge {
  font-size: 10px; padding: 2px 7px; border-radius: 20px;
  background: rgba(255, 138, 61, .14); color: #ffa25c;
  border: 1px solid rgba(255, 138, 61, .35);
  white-space: nowrap;
}
.lv-badge.big { font-size: 13px; padding: 5px 14px; }

.stats { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.stat {
  display: flex; align-items: baseline; gap: 4px;
  padding: 3px 9px; border-radius: 6px; background: rgba(255, 255, 255, .05);
  font-size: 11px; color: var(--title-sub); white-space: nowrap;
}
.stat b { color: #fff; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; color: #7b8494; font-size: 10px; }
.stat.good b { color: #58d69b; }
.stat.bad b { color: #ff7a70; }

.rage {
  display: flex; align-items: center; gap: 9px; flex: 0 0 auto;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  position: relative; transition: background .2s;
}
.rage.hit { background: rgba(245, 72, 59, .18); }
.rage-label { display: flex; align-items: baseline; gap: 3px; font-size: 11px; color: var(--title-sub); }
.rage-label b { font-size: 15px; color: #ffb547; font-variant-numeric: tabular-nums; }
.rage-label em { font-style: normal; font-size: 9.5px; color: #6b7484; }
.rage-track { width: 128px; height: 7px; border-radius: 6px; background: #3a4250; overflow: hidden; }
.rage-fill {
  height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, #ffc857, #ff8a3d);
  transition: width .3s cubic-bezier(.4, 0, .2, 1), background .3s;
}
.rage-fill.r1 { background: linear-gradient(90deg, #ffb547, #ff7a45); }
.rage-fill.r2 { background: linear-gradient(90deg, #ff8a3d, #f5483b); }
.rage-fill.r3 { background: linear-gradient(90deg, #f5483b, #d81f1f); animation: ragePulse .9s infinite; }
@keyframes ragePulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.rage-float {
  position: absolute; right: 6px; top: -2px;
  font-size: 14px; font-weight: 700; color: #ff6b5e; pointer-events: none;
  animation: floatUp .9s ease-out forwards; text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.rage-float.minus { color: #58d69b; }
@keyframes floatUp {
  0% { transform: translateY(6px) scale(.8); opacity: 0; }
  25% { transform: translateY(-4px) scale(1.15); opacity: 1; }
  100% { transform: translateY(-22px) scale(1); opacity: 0; }
}

.actions { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; }
.btn-icon {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 3px 6px; border-radius: 7px; color: var(--title-sub);
  transition: background .15s, color .15s; min-width: 42px;
}
.btn-icon i { font-style: normal; font-size: 9.5px; line-height: 1; }
.btn-icon em { font-style: normal; color: #ffb547; }
.btn-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.btn-icon:disabled { opacity: .35; }
.btn-icon.online-on { color: #58d69b; }
.btn-icon.online-off { color: #ffb547; }

/* 图标 */
.ico-water, .ico-power, .ico-trophy, .ico-rank, .ico-cloud, .ico-help,
.ico-chat, .ico-set, .ico-hist, .ico-data, .ico-pen, .ico-more {
  width: 17px; height: 17px; display: block; background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.ico-water { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linejoin='round'%3E%3Cpath d='M12 3.2s6.2 6.6 6.2 10.6a6.2 6.2 0 1 1-12.4 0C5.8 9.8 12 3.2 12 3.2z'/%3E%3C/svg%3E"); }
.ico-power { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M12 3.5v8'/%3E%3Cpath d='M6.6 6.8a8 8 0 1 0 10.8 0'/%3E%3C/svg%3E"); }
.ico-trophy { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 4h8v5a4 4 0 0 1-8 0z'/%3E%3Cpath d='M8 5.5H5.5v1.8A3 3 0 0 0 8 10.2M16 5.5h2.5v1.8a3 3 0 0 1-2.5 2.9'/%3E%3Cpath d='M12 13v4M8.5 20h7l-.8-3h-5.4z'/%3E%3C/svg%3E"); }
.ico-rank { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M7 20V13M12 20V5M17 20v-8'/%3E%3C/svg%3E"); }
.ico-cloud { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18h9.5a3.5 3.5 0 0 0 .3-7A5 5 0 0 0 7.3 10 4 4 0 0 0 7 18z'/%3E%3Cpath d='M12 11.5v5M10 14.5l2 2 2-2'/%3E%3C/svg%3E"); }
.ico-help { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cpath d='M9.6 9.4a2.5 2.5 0 1 1 3.6 2.3c-.8.5-1.2 1-1.2 2'/%3E%3Cpath d='M12 17.2h.01'/%3E%3C/svg%3E"); }
.ico-chat { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 6.5h16v10H9l-4 3.2v-3.2H4z'/%3E%3C/svg%3E"); }
.ico-hist { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.4'/%3E%3Cpath d='M12 7.2V12l3.2 2'/%3E%3C/svg%3E"); }
.ico-data { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 19h16M7 19v-5M12 19V8M17 19v-8'/%3E%3C/svg%3E"); }
.ico-pen { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 20l4.2-1L19 8.2 15.8 5 5 15.8z'/%3E%3Cpath d='M14.5 6.3l3.2 3.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ico-more { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='5' cy='12' r='1.8'/%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Ccircle cx='19' cy='12' r='1.8'/%3E%3C/svg%3E"); }
.ico-set { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 3.5v2.2M12 18.3v2.2M3.5 12h2.2M18.3 12h2.2M6 6l1.6 1.6M16.4 16.4L18 18M18 6l-1.6 1.6M7.6 16.4L6 18'/%3E%3C/svg%3E"); }

/* ---------------- 主体 ---------------- */
.body { flex: 1 1 auto; display: flex; min-height: 0; background: var(--bg); }

.rail { flex: 0 0 58px; width: 58px; background: var(--panel2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px; }
.rail-item { width: 46px; height: 50px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--sub); cursor: pointer; transition: .15s; }
.rail-item i { font-style: normal; font-size: 10px; }
.rail-item:hover { color: var(--ink); background: rgba(127, 140, 160, .12); }
.rail-item.on { color: #ff8a3d; background: rgba(255, 106, 0, .12); }
.rail-sp { flex: 1; }

/* 会话列表 */
.convlist { flex: 0 0 232px; width: 232px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.conv-head { padding: 10px 13px 8px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line2); }
.conv-head span { font-size: 13px; font-weight: 600; }
.conv-head em { font-style: normal; font-size: 10.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.online-chip {
  margin-left: auto; display: flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 20px;
  border: 1px solid rgba(23, 178, 106, .45);
  background: rgba(23, 178, 106, .1); color: #17b26a;
  font-size: 10px; line-height: 1.6;
}
.online-chip b { font-weight: 500; }
.online-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: #17b26a; box-shadow: 0 0 0 2px rgba(23, 178, 106, .18); }
.online-chip.off { border-color: rgba(224, 138, 0, .45); background: rgba(224, 138, 0, .12); color: #e08a00; }
.online-chip.off .dot { background: #e08a00; box-shadow: none; }
.conv-list { flex: 1; overflow-y: auto; padding: 6px; }
.conv-empty { color: var(--sub); font-size: 12px; text-align: center; padding: 30px 10px; line-height: 1.8; }

.conv {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 3px;
  transition: background .15s; position: relative;
}
.conv:hover { background: var(--panel2); }
.conv.active { background: rgba(43, 127, 255, .1); border-color: rgba(43, 127, 255, .35); }
.conv.pending::before {
  content: ''; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 2px; background: #ff6a00;
}
.conv-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.conv-main { flex: 1; min-width: 0; }
.conv-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-last { font-size: 10.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv-side { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.conv-wait { font-size: 9.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.conv-wait.warn { color: #ff8a3d; }
.conv-wait.danger { color: #f5483b; }
.conv-st { font-size: 9.5px; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.conv-st.wait { color: var(--sub); background: var(--panel2); }
.conv-st.live { color: #2b7fff; background: rgba(43, 127, 255, .13); }
.conv-st.reply { color: #ff6a00; background: rgba(255, 106, 0, .14); }
.conv-st.good { color: #17b26a; background: rgba(23, 178, 106, .13); }
.conv-st.bad { color: #f5483b; background: rgba(245, 72, 59, .13); }
.conv-st.mid { color: #b58200; background: rgba(224, 138, 0, .14); }
.unread {
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: #f5483b; color: #fff; font-size: 9px; line-height: 15px; text-align: center;
}

.conv-foot { border-top: 1px solid var(--line2); padding: 9px 12px 11px; }
.cf-row { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--sub); line-height: 1.9; }
.cf-row b { color: var(--ink2); font-weight: 500; }
.off-duty {
  width: 100%; margin-top: 8px; padding: 8px; border-radius: 7px;
  background: var(--panel2); color: var(--ink2); font-size: 12px; border: 1px solid var(--line);
}
.off-duty:hover { background: var(--opt-hover); color: var(--ink); }

/* ---------------- 会话区 ---------------- */
.chat { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; background: var(--panel); }
.chat-head { flex: 0 0 auto; padding: 9px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; background: var(--panel); }
.ch-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ch-name { font-size: 15px; font-weight: 600; }
.ch-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; color: var(--tag-ink); background: var(--tag-bg); padding: 1.5px 6px; border-radius: 4px; border: 1px solid var(--tag-line); }
.ch-sat { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; position: relative; }
.ch-sat > span { font-size: 10.5px; color: var(--sub); }
.sat-track { width: 86px; height: 6px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.sat-fill { height: 100%; width: 50%; border-radius: 4px; background: #e08a00; transition: width .3s, background .3s; }
.sat-fill.s3 { background: #17b26a; }
.sat-fill.s2 { background: #e08a00; }
.sat-fill.s1 { background: #f5483b; }
.ch-sat b { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 20px; }
.ch-order { flex: 0 0 auto; font-size: 10.5px; color: var(--sub); }
.sat-float { position: absolute; right: -4px; top: -14px; font-size: 13px; font-weight: 700; color: #17b26a; pointer-events: none; animation: floatUp .95s ease-out forwards; }
.sat-float.minus { color: #f5483b; }

.chat-body { flex: 1 1 auto; position: relative; min-height: 0; background: var(--feed); }
.feed { position: absolute; inset: 0; overflow-y: auto; padding: 16px 18px 46px; display: flex; flex-direction: column; gap: 12px; }
.feed::before { content: ''; margin-top: auto; }
.feed::-webkit-scrollbar, .conv-list::-webkit-scrollbar, .side-body::-webkit-scrollbar, .modal-card::-webkit-scrollbar, .opt-area::-webkit-scrollbar { width: 6px; }
.feed::-webkit-scrollbar-thumb, .conv-list::-webkit-scrollbar-thumb, .side-body::-webkit-scrollbar-thumb, .modal-card::-webkit-scrollbar-thumb, .opt-area::-webkit-scrollbar-thumb { background: rgba(140, 150, 165, .35); border-radius: 4px; }

.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; animation: msgIn .22s ease-out; }
.msg.c + .msg.c, .msg.a + .msg.a { margin-top: -6px; }
.msg.c + .msg.c .msg-av { visibility: hidden; }
.msg.a + .msg.a .msg-av { visibility: hidden; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.c { justify-content: flex-start; }
.msg.a { flex-direction: row-reverse; }
.msg-av { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.msg-av.self { background: #2b7fff; }
.bubble {
  position: relative; max-width: min(520px, 74%);
  padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.62; word-break: break-word;
  background: var(--bubble); border: 1px solid var(--bubble-line);
  color: var(--ink); box-shadow: 0 1px 2px rgba(20, 30, 50, .04);
}
.msg.a .bubble { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.msg-rage { display: inline-block; margin-left: 8px; font-size: 10px; color: #f5483b; background: rgba(245, 72, 59, .12); padding: 0 5px; border-radius: 4px; vertical-align: 1px; }
.msg.a .msg-rage { display: none; }

.sys-line { align-self: center; font-size: 10.5px; color: var(--sub); background: var(--panel); padding: 3px 10px; border-radius: 20px; border: 1px solid var(--bubble-line); }

.typing {
  position: absolute; left: 18px; bottom: 10px; display: none; align-items: center; gap: 3px;
  background: var(--bubble); border: 1px solid var(--bubble-line);
  padding: 6px 10px; border-radius: 20px; box-shadow: var(--shadow);
  font-size: 10.5px; color: var(--sub);
}
.typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--sub); opacity: .6; animation: tdot 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
.typing span { margin-left: 4px; }
@keyframes tdot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }

.result-card { align-self: center; margin: 6px 0; background: var(--bubble); border: 1px dashed var(--bubble-line); border-radius: 10px; padding: 12px 18px; min-width: 240px; animation: msgIn .3s ease-out; }
.rc-title { font-size: 12px; color: var(--sub); text-align: center; margin-bottom: 8px; letter-spacing: 2px; }
.rc-row { display: flex; justify-content: space-between; gap: 18px; font-size: 12px; color: var(--ink2); line-height: 1.9; }
.rc-row b { font-weight: 600; }

/* 底部 */
.chat-foot { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--panel); }

.patience { display: none; padding: 7px 16px 0; align-items: center; gap: 8px; }
.patience > span { font-size: 10px; color: var(--sub); flex: 0 0 auto; }
.patience-track { flex: 1; height: 3px; background: var(--line2); border-radius: 3px; overflow: hidden; }
.patience-fill { height: 100%; width: 100%; background: #2b7fff; transition: width .1s linear; }
.patience-fill.low { background: #f5483b; }
.patience b { font-size: 10.5px; color: var(--sub); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.patience.low b { color: #f5483b; }

.opt-area { padding: 9px 16px 4px; min-height: 54px; max-height: 236px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.opt-hint { font-size: 11.5px; color: var(--sub); text-align: center; padding: 12px 0; line-height: 1.7; }

.opt {
  display: flex; align-items: flex-start; gap: 9px; text-align: left; width: 100%;
  padding: 10px 12px; background: var(--opt); border: 1px solid var(--line);
  border-radius: 8px; transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
  position: relative;
}
.opt:hover { background: var(--opt-hover); box-shadow: var(--shadow); transform: translateY(-1px); border-color: rgba(43, 127, 255, .45); }
.opt:active { transform: scale(.995); }
.opt-t { flex: 1; font-size: 13px; line-height: 1.58; color: var(--ink); }
.opt-send { flex: 0 0 auto; font-size: 10.5px; color: var(--sub); align-self: center; opacity: 0; transition: opacity .15s; }
.opt:hover .opt-send { opacity: 1; color: #2b7fff; }

.next-btn {
  width: 100%; padding: 11px; border-radius: 8px;
  background: linear-gradient(135deg, #ff8a3d, #ff5f00);
  color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(255, 106, 0, .28);
}
.next-btn:hover { filter: brightness(1.05); }

.input-bar { display: flex; gap: 8px; padding: 4px 16px 12px; align-items: center; }
.input-bar input {
  flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel2); color: var(--ink); font-size: 12.5px; padding: 0 12px;
  outline: none; font-family: inherit; transition: border .15s;
}
.input-bar input::placeholder { color: var(--sub); }
.input-bar input:focus { border-color: rgba(43, 127, 255, .6); background: var(--panel); }
.input-bar button { height: 38px; padding: 0 18px; border-radius: 8px; background: #2b7fff; color: #fff; font-size: 12.5px; font-weight: 500; }
.input-bar button:disabled { background: var(--line2); color: var(--sub); }

/* 移动端会话切换条 */
.chat-tabs { display: none; gap: 6px; overflow-x: auto; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.chat-tabs::-webkit-scrollbar { display: none; }
.ctab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 20px; border: 1px solid var(--line);
  font-size: 11px; color: var(--ink2); background: var(--panel); max-width: 132px;
}
.ctab .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.ctab.on { border-color: #2b7fff; background: rgba(43, 127, 255, .1); color: var(--ink); }
.ctab .dot { display: block; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; background: #8a93a3; }
.ctab .dot.live { background: #2b7fff; }
.ctab .dot.reply { background: #ff6a00; animation: ragePulse 1s infinite; }
.ctab .dot.good { background: #17b26a; }
.ctab .dot.bad { background: #f5483b; }
.ctab .uc { font-size: 9px; color: #fff; background: #f5483b; border-radius: 8px; padding: 0 4px; }

/* ---------------- 右侧 ---------------- */
.side { flex: 0 0 252px; width: 252px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-body { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.side-empty { color: var(--sub); font-size: 12px; text-align: center; padding: 40px 0; }
.side-card { border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: var(--panel); }
.side-head { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; }
.side-av { width: 36px; height: 36px; border-radius: 9px; color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.side-name { font-size: 13px; font-weight: 600; }
.side-lv { font-size: 10px; color: var(--sub); margin-top: 2px; }
.side-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.side-rows { border-top: 1px solid var(--line2); padding-top: 7px; }
.side-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; line-height: 2; }
.side-row span { color: var(--sub); flex: 0 0 auto; }
.side-row b { font-weight: 500; text-align: right; word-break: break-all; }
.side-note { margin-top: 8px; font-size: 10.5px; color: #b58200; background: rgba(224, 138, 0, .12); border-radius: 6px; padding: 6px 8px; line-height: 1.6; }
.side-title { font-size: 12px; font-weight: 600; margin-bottom: 7px; display: flex; justify-content: space-between; align-items: center; }
.order-item { font-size: 12px; line-height: 1.55; color: var(--ink2); padding-bottom: 7px; }
.progress-line { height: 5px; border-radius: 4px; background: var(--line2); overflow: hidden; margin: 6px 0 4px; }
.progress-line > i { display: block; height: 100%; background: #2b7fff; border-radius: 4px; }

/* ---------------- 开始界面 ---------------- */
.start {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background-color: #0b0e13;
  background-image:
    radial-gradient(ellipse 74% 64% at 50% 46%, rgba(6, 9, 14, .93) 0%, rgba(6, 9, 14, .86) 38%, rgba(6, 9, 14, .52) 72%, rgba(6, 9, 14, .26) 100%),
    url("../assets/hero.jpg");
  background-size: cover, cover;
  background-position: center, 50% bottom;
  background-repeat: no-repeat;
  transition: opacity .4s, visibility .4s;
  padding: 20px;
  overflow: hidden;
}
.start.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.start-card { text-align: center; max-width: 430px; width: 100%; }

.start-links { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.start-links button {
  font-size: 11px; color: rgba(255, 255, 255, .42);
  border-bottom: 1px solid rgba(255, 255, 255, .16); padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.start-links button:hover { color: #ffb27a; border-color: rgba(255, 178, 122, .6); }
.start-logo {
  width: 62px; height: 62px; margin: 0 auto 16px; border-radius: 18px;
  background: linear-gradient(135deg, #ff8a3d, #ff5f00);
  color: #fff; font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 40px rgba(255, 106, 0, .4);
}
.start h1 { font-size: 25px; color: #fff; letter-spacing: 1px; font-weight: 600; }
.start-sub { font-size: 12.5px; color: #8b95a6; margin-top: 10px; line-height: 1.7; }
.start-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255, 255, 255, .09); border-radius: 12px; overflow: hidden; margin: 22px 0 16px; }
.start-stats > div { background: rgba(255, 255, 255, .03); padding: 12px 4px; }
.start-stats span { display: block; font-size: 10px; color: #7b8494; margin-bottom: 5px; }
.start-stats b { font-size: 18px; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.start-lv { margin-bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.start-lv em { font-style: normal; font-size: 11px; color: #8b95a6; }
.start-btn {
  width: 100%; padding: 15px; border-radius: 12px;
  background: linear-gradient(135deg, #ff8a3d, #ff5f00);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(255, 106, 0, .35);
  transition: transform .15s, box-shadow .15s;
}
.start-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(255, 106, 0, .45); }
.start-rank { margin-top: 14px; font-size: 12.5px; color: #9aa4b6; border-bottom: 1px solid rgba(255, 255, 255, .2); padding-bottom: 2px; }
.start-rank:hover { color: #fff; }
.start-env { margin-top: 20px; font-size: 10.5px; color: #5f6877; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 140;
  background: rgba(10, 14, 20, .58);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: .22s; padding: 18px;
  backdrop-filter: blur(3px);
}
.modal.show { opacity: 1; visibility: visible; }
.modal-card {
  position: relative; width: 100%; max-width: 470px;
  max-height: 88vh; overflow-y: auto;
  background: var(--panel); border-radius: 16px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 60px rgba(5, 10, 20, .45);
  animation: modalIn .28s cubic-bezier(.2, .9, .3, 1.1);
}
@keyframes modalIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  width: 30px; height: 30px; border-radius: 9px;
  font-size: 19px; line-height: 1; font-weight: 500;
  color: var(--ink2); background: var(--panel2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 15, 25, .12);
}
.modal-close:hover { background: var(--line2); color: var(--ink); }

/* 日结算 */
.day-report { text-align: center; }
.dr-title { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.dr-sub { font-size: 11.5px; color: var(--sub); margin-top: 4px; }
.dr-warn { font-size: 11.5px; color: #f5483b; background: rgba(245, 72, 59, .12); border-radius: 6px; padding: 6px 10px; margin: 10px 0 0; }
.dr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.dr-cell { background: var(--panel2); border-radius: 9px; padding: 11px; }
.dr-cell span { display: block; font-size: 10.5px; color: var(--sub); margin-bottom: 5px; }
.dr-cell b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dr-rank { font-size: 14px; font-weight: 600; letter-spacing: .5px; margin: 4px 0 8px; }
.dr-total { font-size: 11.5px; color: var(--sub); line-height: 1.9; }
.dr-total b { color: var(--ink); }
.dr-promo { margin: 12px 0 0; padding: 10px; border-radius: 9px; font-size: 12px; line-height: 1.7; }
.dr-promo.up { background: rgba(23, 178, 106, .12); color: #17b26a; }
.dr-promo.down { background: rgba(245, 72, 59, .1); color: #f5483b; }
.dr-promo.keep { background: var(--panel2); color: var(--sub); }
.dr-btns { display: flex; gap: 8px; margin-top: 16px; }
.btn-primary {
  flex: 1; padding: 12px; border-radius: 9px;
  background: linear-gradient(135deg, #ff8a3d, #ff5f00); color: #fff;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 18px rgba(255, 106, 0, .3);
}
.btn-ghost { flex: 0 0 auto; padding: 12px 16px; border-radius: 9px; background: var(--panel2); color: var(--ink2); font-size: 12.5px; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--opt-hover); }
.dr-cloud { margin-top: 12px; font-size: 10.5px; color: var(--sub); }

/* 排行榜 */
.board-tabs { display: flex; gap: 8px; margin-bottom: 14px; padding-right: 34px; }
.bt { flex: 1; padding: 9px; border-radius: 8px; background: var(--panel2); font-size: 12.5px; color: var(--ink2); border: 1px solid transparent; }
.bt.active { background: #2b7fff; color: #fff; font-weight: 600; }
.board-list { min-height: 170px; }
.board-loading { text-align: center; color: var(--sub); font-size: 12px; padding: 46px 20px; line-height: 1.9; }
.brow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13px; }
.brow:nth-child(odd) { background: var(--panel2); }
.brow.top1 { background: linear-gradient(90deg, rgba(255, 205, 100, .18), transparent); }
.brow.top2 { background: linear-gradient(90deg, rgba(150, 165, 185, .16), transparent); }
.brow.top3 { background: linear-gradient(90deg, rgba(220, 150, 90, .16), transparent); }
.brank { flex: 0 0 22px; text-align: center; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums; }
.brow.top1 .brank { color: #e0a020; }
.brow.top2 .brank { color: #8a95a5; }
.brow.top3 .brank { color: #c08050; }
.bname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bscore { font-weight: 600; color: #ff6a00; font-variant-numeric: tabular-nums; }
.board-me { margin-top: 12px; padding: 10px; background: rgba(43, 127, 255, .1); border-radius: 8px; font-size: 12px; color: var(--ink2); text-align: center; }
.board-me b { color: #2b7fff; }
.board-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.board-foot span { font-size: 10px; color: var(--sub); flex: 1; line-height: 1.6; }

/* 成就 */
.ach-head { text-align: center; margin-bottom: 16px; }
.ach-head h3 { font-size: 16px; }
.ach-head p { font-size: 11.5px; color: var(--sub); margin-top: 6px; }
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ach-card { border: 1px solid var(--line); border-radius: 11px; padding: 11px; display: flex; gap: 9px; align-items: flex-start; background: var(--panel); }
.ach-card.locked { opacity: .55; }
.ach-card.got { border-color: rgba(255, 138, 61, .5); background: linear-gradient(135deg, rgba(255, 138, 61, .08), transparent); }
.ach-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--panel2); color: var(--sub); }
.ach-card.got .ach-ico { background: linear-gradient(135deg, #ff8a3d, #ff5f00); color: #fff; box-shadow: 0 4px 12px rgba(255, 106, 0, .3); }
.ach-ico svg { width: 19px; height: 19px; }
.ach-info { flex: 1; min-width: 0; }
.ach-name { font-size: 12.5px; font-weight: 600; }
.ach-desc { font-size: 10.5px; color: var(--sub); margin-top: 3px; line-height: 1.55; }
.ach-cond { font-size: 10px; color: var(--sub); margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--line); }
.ach-card.got .ach-cond { color: #ff8a3d; }

/* 设置 */
.set-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.set-sub { font-size: 11px; color: var(--sub); margin-bottom: 16px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.set-row:last-of-type { border-bottom: none; }
.set-label { font-size: 13px; }
.set-label em { display: block; font-style: normal; font-size: 10.5px; color: var(--sub); margin-top: 3px; line-height: 1.5; }
.seg { display: flex; background: var(--panel2); border-radius: 8px; padding: 2px; border: 1px solid var(--line); }
.seg button { padding: 6px 10px; border-radius: 6px; font-size: 11.5px; color: var(--sub); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); font-weight: 500; }
.switch { width: 42px; height: 24px; border-radius: 20px; background: var(--line2); position: relative; transition: background .2s; flex: 0 0 auto; border: 1px solid var(--line); }
.switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch.on { background: #2b7fff; border-color: #2b7fff; }
.switch.on::after { transform: translateX(18px); }
.set-danger { margin-top: 16px; width: 100%; padding: 11px; border-radius: 9px; border: 1px solid rgba(245, 72, 59, .4); color: #f5483b; font-size: 12.5px; }
.set-danger:hover { background: rgba(245, 72, 59, .08); }

/* 取名 */
.name-box { text-align: center; }
.name-box h3 { font-size: 17px; }
.name-box p { font-size: 11.5px; color: var(--sub); margin: 8px 0 18px; line-height: 1.7; }
.name-input {
  width: 100%; height: 46px; text-align: center; font-size: 18px; letter-spacing: 2px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
  color: var(--ink); outline: none; font-family: inherit;
}
.name-input:focus { border-color: #ff8a3d; }
.name-tip { font-size: 10.5px; color: var(--sub); margin-top: 8px; }
.name-tip.err { color: #f5483b; }

/* 说明 */
.help h3 { font-size: 14px; margin: 14px 0 8px; }
.help h3:first-child { margin-top: 0; }
.help p { font-size: 12.5px; line-height: 1.85; color: var(--ink2); }
.help ul { margin: 8px 0 0 18px; }
.help li { font-size: 12.5px; line-height: 1.9; color: var(--ink2); }
.help b { color: var(--ink); }
.help .ach-list { list-style: none; margin-left: 0; }
.help .ach-list li { color: var(--sub); }
.help .ach-list li.got { color: #17b26a; }
.help table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11.5px; }
.help th, .help td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; color: var(--ink2); }
.help th { background: var(--panel2); font-weight: 500; }

/* ---------------- 历史 ---------------- */
.hist-wrap { max-height: 64vh; overflow-y: auto; margin: 0 -6px; }
.hist-item { display: flex; gap: 9px; padding: 10px 8px; border-bottom: 1px solid var(--line2); cursor: pointer; align-items: center; border-radius: 8px; }
.hist-item:hover { background: var(--panel2); }
.hist-av { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.hist-main { flex: 1; min-width: 0; }
.hist-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-sub { font-size: 10px; color: var(--sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-right { flex: 0 0 auto; text-align: right; }
.hist-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.hist-tag.good { color: #17b26a; background: rgba(23, 178, 106, .13); }
.hist-tag.bad { color: #f5483b; background: rgba(245, 72, 59, .13); }
.hist-tag.mid { color: #b58200; background: rgba(224, 138, 0, .14); }
.hist-time { font-size: 9.5px; color: var(--sub); margin-top: 3px; }

.replay { display: flex; flex-direction: column; gap: 7px; max-height: 58vh; overflow-y: auto; padding: 4px 2px; }
.rp-row { display: flex; gap: 7px; align-items: flex-start; }
.rp-row.a { flex-direction: row-reverse; }
.rp-av { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.rp-av.self { background: #2b7fff; }
.rp-b { max-width: 78%; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; line-height: 1.6; background: var(--bubble); border: 1px solid var(--bubble-line); }
.rp-row.a .rp-b { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.rp-sys { align-self: center; font-size: 10px; color: var(--sub); }

/* ---------------- 数据 ---------------- */
.data-sec { margin-bottom: 18px; }
.data-sec h4 { font-size: 12.5px; margin-bottom: 8px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.data-sec h4 em { font-style: normal; font-size: 10px; color: var(--sub); font-weight: 400; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.data-cell { position: relative; background: var(--panel2); border-radius: 9px; padding: 10px; border: 1px solid transparent; transition: .15s; }
.data-cell span { font-size: 10.5px; color: var(--sub); display: block; margin-bottom: 5px; }
.data-cell b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.data-cell b i { font-style: normal; font-size: 10px; color: var(--sub); font-weight: 400; margin-left: 2px; }
.data-cell.clickable { cursor: pointer; }
.data-cell.clickable:hover { border-color: rgba(43, 127, 255, .45); background: var(--opt-hover); }
.data-cell.clickable::after { content: '查看'; position: absolute; right: 9px; top: 8px; font-size: 9px; color: #2b7fff; opacity: .85; }

/* ---------------- 共创工坊 ---------------- */
.ws-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding-right: 30px; }
.ws-tabs button { flex: 1; padding: 8px; border-radius: 8px; background: var(--panel2); font-size: 11.5px; color: var(--ink2); }
.ws-tabs button.on { background: #2b7fff; color: #fff; font-weight: 600; }
.ws-tip { font-size: 10.5px; color: var(--sub); line-height: 1.8; margin-bottom: 10px; }
.ws-field { margin-bottom: 10px; }
.ws-field label { display: block; font-size: 11px; color: var(--sub); margin-bottom: 4px; }
.ws-input, .ws-select, .ws-area {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel2); color: var(--ink); font-size: 12px; font-family: inherit;
  padding: 8px 10px; outline: none;
}
.ws-input:focus, .ws-area:focus, .ws-select:focus { border-color: #ff8a3d; }
.ws-area { min-height: 60px; resize: vertical; line-height: 1.6; }
.ws-select { height: 34px; }
.ws-btn { width: 100%; padding: 10px; border-radius: 8px; background: #2b7fff; color: #fff; font-size: 12.5px; font-weight: 500; }
.ws-btn.orange { background: linear-gradient(135deg, #ff8a3d, #ff5f00); }
.ws-btn.ghost { background: var(--panel2); color: var(--ink2); border: 1px solid var(--line); }
.ws-list { margin-top: 12px; }
.ws-item { border: 1px solid var(--line); border-radius: 9px; padding: 9px; margin-bottom: 7px; font-size: 11.5px; line-height: 1.6; background: var(--panel); }
.ws-item .ws-q { color: var(--sub); font-size: 10px; margin-bottom: 4px; }
.ws-item .ws-del { float: right; font-size: 10px; color: #f5483b; }
.ws-empty { font-size: 11px; color: var(--sub); text-align: center; padding: 18px 0; }
.ws-code { font-family: Consolas, monospace; font-size: 10px; word-break: break-all; background: var(--panel2); border-radius: 8px; padding: 9px; line-height: 1.6; color: var(--ink2); max-height: 110px; overflow-y: auto; }

/* AI 设置 */
.ai-box { border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-top: 10px; background: var(--panel2); }
.ai-hint { font-size: 10px; color: var(--sub); line-height: 1.7; margin-top: 8px; }
.ai-row { display: flex; gap: 8px; }
.ai-row > * { flex: 1; }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(28, 34, 44, .95); color: #fff; font-size: 12px;
  padding: 8px 16px; border-radius: 20px;
  box-shadow: 0 6px 20px rgba(10, 15, 25, .3);
  animation: toastIn .24s ease-out; max-width: 82vw; text-align: center; line-height: 1.5;
}
.toast.out { opacity: 0; transform: translateY(-8px); transition: .4s; }
.toast.save { background: rgba(23, 178, 106, .96); }
.toast.warn { background: rgba(245, 72, 59, .96); }
.toast.ach { background: linear-gradient(135deg, #ff8a3d, #ff5f00); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 爆缸 */
.collapse-ov {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(120, 10, 10, .84);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.collapse-txt { font-size: 42px; font-weight: 700; color: #fff; letter-spacing: 8px; text-shadow: 0 6px 30px rgba(0, 0, 0, .4); }
.collapse-sub { font-size: 13px; color: rgba(255, 255, 255, .82); }
.shake { animation: shakeAnim .45s; }
@keyframes shakeAnim {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 2px); }
}
.app.danger .titlebar { box-shadow: inset 0 -2px 0 #f5483b; }

.mob-only { display: none !important; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) { .side { display: none; } }
@media (max-width: 980px) {
  .rail { display: none; }
  .mob-only { display: flex !important; }
  .stats .stat:nth-child(5) { display: none; }
}
@media (max-width: 860px) {
  .start {
    justify-content: center;
    padding: 20px 18px;
    background-image:
      linear-gradient(180deg, rgba(7, 10, 15, .55) 0%, rgba(7, 10, 15, .8) 44%, rgba(7, 10, 15, .95) 100%),
      url("../assets/hero_s.jpg");
    background-position: center, center bottom;
  }
  .titlebar { gap: 8px; padding: 0 8px; }
  .brand-txt, .lv-badge { display: none; }
  .stat { padding: 3px 6px; }
  .rage-track { width: 76px; }
  .convlist { flex: 0 0 186px; width: 186px; }
  .btn-icon i { display: none; }
  .btn-icon { min-width: 34px; padding: 6px; }
  .ch-order { display: none; }
  .opt-area { max-height: 196px; }
  .bubble { max-width: 82%; }
}
@media (max-width: 660px) {
  .convlist { display: none; }
  .chat-tabs { display: flex; }
  .brand { display: none; }
  .stats { gap: 2px; flex: 0 0 auto; }
  .stat span { display: none; }
  .stat b { font-size: 12px; }
  .stat em { display: none; }
  .stat:nth-child(1) span { display: inline; font-size: 10px; }
  .stat:nth-child(2) em { display: inline; font-size: 9px; }
  .stat:nth-child(3), .stat:nth-child(4), .stat:nth-child(5) { display: none; }
  .titlebar { gap: 5px; }
  .actions { gap: 0; }
  #saveBtn, #helpBtn { display: none; }
  .rage { padding: 3px 7px; gap: 6px; }
  .rage-label span, .rage-label em { display: none; }
  .rage-float { top: -14px; right: 0; font-size: 12px; }
  .rage-track { width: 46px; }
  .chat-head { padding: 8px 12px; gap: 8px; }
  .ch-sat > span { display: none; }
  .sat-track { width: 56px; }
  .feed { padding: 12px 12px 42px; }
  .opt-area { padding: 8px 12px 4px; max-height: 40vh; }
  .input-bar { padding: 4px 12px 10px; }
  .input-bar button { padding: 0 13px; }
  .msg-av { width: 26px; height: 26px; flex-basis: 26px; font-size: 11px; }
  .start h1 { font-size: 22px; }
  .ach-grid { grid-template-columns: 1fr; }
}

/* 移动端在线开关 */
.online-tab { border-color: rgba(23, 178, 106, .45); background: rgba(23, 178, 106, .1); }
.online-tab .nm { color: #17b26a; font-weight: 500; }
.online-tab.off { border-color: rgba(224, 138, 0, .45); background: rgba(224, 138, 0, .1); }
.online-tab.off .nm { color: #e08a00; }
.online-tab.off .dot { background: #e08a00; }

/* 更新日志 */
.log-item { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.log-item:last-child { border-bottom: none; }
.log-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.log-head b { font-size: 13px; color: var(--ink); }
.log-head span { font-size: 10px; color: var(--sub); }
.log-item ul { margin-left: 16px; }
.log-item li { font-size: 11.5px; color: var(--ink2); line-height: 1.85; }

/* 四宫格 tab */
.ws-tabs.four { gap: 5px; padding-right: 30px; }
.ws-tabs.four button { padding: 8px 2px; font-size: 11px; }

/* 已读标记 */
.msg-read {
  display: inline-block; margin-left: 6px; font-size: 9px;
  color: var(--sub); vertical-align: 1px; opacity: .85;
}
.msg.a .msg-read { color: rgba(255, 255, 255, .62); }
