/* ============================================================
   AI 学习小助理 · VALORANT 上海大师赛「战意觉醒」
   ============================================================ */

:root {
  --bg-0: #070b10;
  --bg-1: #0d1420;
  --bg-2: #111a26;
  --panel: #0f1822;
  --panel-2: #131f2c;

  --red: #ff4655;
  --red-dim: #b8303c;
  --teal: #00e0b0;
  --teal-dim: #0b8f77;

  --fire: #ff7a1a;
  --fire-2: #ffc23d;

  --text: #ece8e1;
  --text-dim: #8b98a8;
  --text-mute: #5b6878;

  --line: rgba(236, 232, 225, .14);
  --line-strong: rgba(236, 232, 225, .28);

  --f-display: 'Anton', 'Oswald', 'Noto Sans SC', system-ui, sans-serif;
  --f-cond: 'Oswald', 'Noto Sans SC', system-ui, sans-serif;
  --f-tech: 'Rajdhani', 'Noto Sans SC', system-ui, sans-serif;
  --f-cn: 'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;

  --clip: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--f-cn);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------------- 背景 ---------------- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 224, 176, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 224, 176, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(680px 520px at 18% 68%, rgba(255, 70, 85, .14), transparent 70%),
    radial-gradient(620px 480px at 82% 20%, rgba(0, 224, 176, .10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------------- 布局 ---------------- */
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 20, 32, .92), rgba(13, 20, 32, .55));
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--red);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  padding-top: 4px;
}
.brand-mark svg { width: 16px; height: 16px; fill: #fff; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-cn { font-family: var(--f-cn); font-weight: 900; font-size: 16px; letter-spacing: .06em; }
.brand-en { font-family: var(--f-tech); font-size: 10px; font-weight: 600; letter-spacing: .34em; color: var(--text-mute); }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.sys-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-tech); font-size: 12px; font-weight: 600;
  letter-spacing: .18em; color: var(--teal);
  padding: 6px 14px;
  border: 1px solid rgba(0, 224, 176, .3);
  background: rgba(0, 224, 176, .06);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  cursor: pointer;
  transition: .18s;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: #fff; border-color: var(--red); background: rgba(255, 70, 85, .12); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small svg { width: 16px; height: 16px; }

/* ---------------- 主舞台 ---------------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 42fr) 58fr;
  gap: 20px;
  padding: 20px 26px 24px;
}

/* ================= 左侧：角色 ================= */
.agent-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 70, 85, .07), transparent 42%),
    linear-gradient(160deg, var(--bg-2), var(--bg-0) 78%);
  border: 1px solid var(--line);
  clip-path: var(--clip);
  animation: panelIn .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes panelIn { from { opacity: 0; transform: translateX(-16px); } }

.agent-frame { position: absolute; inset: 0; pointer-events: none; }
.corner {
  position: absolute; width: 20px; height: 20px;
  border: 2px solid var(--red);
}
.corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.agent-side-label {
  position: absolute;
  top: 34px; right: 22px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-tech); font-size: 11px; font-weight: 700;
  letter-spacing: .3em; color: var(--text-mute);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  z-index: 3;
}
.agent-side-label .sep { width: 1px; height: 26px; background: var(--line-strong); }

.agent-figure {
  position: absolute;
  inset: 0 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.figure-glow {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 92%; height: 62%;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 70, 85, .34), transparent 66%),
    radial-gradient(ellipse at 50% 72%, rgba(255, 194, 61, .22), transparent 62%);
  filter: blur(30px);
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .75; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.05); } }

.figure-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.05) drop-shadow(0 0 34px rgba(255, 70, 85, .28));
  animation: figureIn .9s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes figureIn { from { opacity: 0; transform: scale(1.06); } }

.figure-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(180deg, transparent, rgba(7, 11, 16, .72) 62%, var(--bg-0) 100%);
  pointer-events: none;
}

/* 名牌 */
.agent-plate {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 22px 22px;
  z-index: 3;
}
.plate-role { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.role-tag {
  font-family: var(--f-cn); font-size: 11px; font-weight: 700; letter-spacing: .1em;
  padding: 3px 10px;
  color: #07090d;
  background: var(--fire-2);
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
}
.role-en { font-family: var(--f-tech); font-size: 11px; font-weight: 700; letter-spacing: .3em; color: var(--text-mute); }

.plate-name {
  margin: 0;
  font-family: var(--f-display);
  font-size: clamp(38px, 4.4vw, 64px);
  line-height: .92;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 0 34px rgba(255, 122, 26, .45), 0 6px 26px rgba(0, 0, 0, .6);
}
.plate-cn {
  font-family: var(--f-cn); font-weight: 900;
  font-size: 13.5px; letter-spacing: .52em;
  color: var(--fire-2);
  margin-top: 5px;
  text-shadow: 0 0 18px rgba(255, 194, 61, .6);
}
.plate-quote {
  margin: 9px 0 0;
  font-size: 12.5px;
  color: #c6d0da;
  letter-spacing: .04em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .85);
}

/* ---------- 真实赛事战报（可交互） ---------- */
.report {
  margin-top: 13px;
  background: rgba(7, 11, 16, .78);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  overflow: hidden;
}

.report-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 70, 85, .10), transparent);
}
.report-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--f-tech); font-size: 11px; font-weight: 700;
  letter-spacing: .12em; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-dot {
  flex: 0 0 auto;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 7px var(--red);
  animation: pulse 1.8s ease-in-out infinite;
}
.report-tabs { display: flex; gap: 4px; flex: 0 0 auto; }
.report-tab {
  font-family: var(--f-cn); font-size: 11px; font-weight: 700;
  padding: 3px 11px;
  color: var(--text-mute);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .16s;
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px);
}
.report-tab:hover { color: #fff; border-color: var(--text-dim); }
.report-tab.active { color: #fff; border-color: var(--red); background: rgba(255, 70, 85, .2); }

.report-body {
  max-height: 172px;
  overflow-y: auto;
  padding: 5px 6px 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--red-dim) transparent;
}
.report-body::-webkit-scrollbar { width: 5px; }
.report-body::-webkit-scrollbar-thumb { background: var(--red-dim); }
.report-body::-webkit-scrollbar-track { background: transparent; }

/* 排名行 */
.row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center; gap: 8px;
  padding: 6px 7px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: .15s;
}
.row:hover { background: rgba(255, 70, 85, .13); border-left-color: var(--red); }
.team-item.open .row { background: rgba(0, 224, 176, .10); border-left-color: var(--teal); }

.rk {
  font-family: var(--f-display); font-size: 13px; line-height: 1;
  color: var(--text-mute); text-align: center;
}
.row.gold .rk { color: var(--fire-2); text-shadow: 0 0 10px rgba(255, 194, 61, .65); }
.row.silver .rk { color: #d5dbe2; }
.row.bronze .rk { color: #cd7f32; }

.tm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tn { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg {
  flex: 0 0 auto;
  font-family: var(--f-tech); font-style: normal; font-size: 9px; font-weight: 700;
  letter-spacing: .1em; color: var(--text-mute);
  border: 1px solid var(--line); padding: 0 4px;
}
.row.is-cn .reg { color: var(--red); border-color: rgba(255, 70, 85, .5); }

.lb { font-family: var(--f-cn); font-size: 10px; color: var(--text-mute); white-space: nowrap; }
.row.gold .lb { color: var(--fire-2); }
.row.silver .lb { color: #d5dbe2; }
.row.bronze .lb { color: #cd7f32; }

.pz { font-family: var(--f-tech); font-size: 11px; font-weight: 600; color: var(--teal); white-space: nowrap; }

/* 展开详情 */
.detail {
  padding: 7px 9px 8px 31px;
  margin: 0 0 4px;
  font-size: 11px; line-height: 1.75; color: var(--text-dim);
  background: rgba(0, 224, 176, .055);
  border-left: 2px solid var(--teal);
  animation: msgIn .22s both;
}
.detail p { margin: 0 0 6px; }
.detail .mini {
  font-family: var(--f-cn); font-size: 10.5px; font-weight: 700;
  color: var(--teal); background: transparent;
  border: 1px solid rgba(0, 224, 176, .35);
  padding: 2px 9px; cursor: pointer; transition: .16s;
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px);
}
.detail .mini:hover { background: rgba(0, 224, 176, .16); color: #fff; }

/* 对阵行 */
.match {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 38px minmax(0, 1fr);
  align-items: center; gap: 6px;
  padding: 5px 7px;
  border-left: 2px solid transparent;
  transition: .15s;
}
.match:hover { background: rgba(255, 70, 85, .10); }
.match.hl { background: rgba(0, 224, 176, .14); border-left-color: var(--teal); }
.match.gf { background: rgba(255, 194, 61, .10); border-left-color: var(--fire-2); }
.stg {
  font-family: var(--f-tech); font-size: 9.5px; font-weight: 700;
  letter-spacing: .04em; color: var(--text-mute); white-space: nowrap;
}
.match.gf .stg { color: var(--fire-2); }
.ta, .tb { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ta { text-align: right; color: var(--text-mute); }
.tb { text-align: left; color: var(--text-mute); }
.ta.win, .tb.win { color: #fff; font-weight: 700; }
.sc {
  font-family: var(--f-tech); font-size: 12px; font-weight: 700;
  color: var(--text); text-align: center; letter-spacing: .03em;
}
.match.gf .sc { color: var(--fire-2); }

.report-foot {
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  font-family: var(--f-tech); font-size: 10.5px; font-weight: 600;
  letter-spacing: .06em; color: var(--text-mute);
  background: rgba(255, 194, 61, .05);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.report-foot b { color: var(--fire-2); }

/* ================= 右侧：对话 ================= */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, rgba(19, 31, 44, .9), rgba(9, 14, 21, .94));
  border: 1px solid var(--line);
  clip-path: var(--clip);
  animation: panelIn2 .6s .08s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes panelIn2 { from { opacity: 0; transform: translateX(16px); } }

.chat-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 70, 85, .10), transparent);
}
.chat-avatar { position: relative; width: 42px; height: 42px; flex: 0 0 auto; }
.chat-avatar img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 2px;
  border: 0;
  filter: drop-shadow(0 0 9px rgba(255, 70, 85, .55));
}
.avatar-ring {
  position: absolute; inset: -4px;
  border: 1px solid var(--teal);
  border-radius: 50%;
  opacity: .55;
  animation: spin 9s linear infinite;
  border-style: dashed;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chat-head-text { flex: 1; min-width: 0; }
.chat-name {
  font-family: var(--f-cond); font-weight: 700; font-size: 15px;
  letter-spacing: .16em; color: #fff;
}
.chat-name span { color: var(--text-mute); font-family: var(--f-cn); font-weight: 500; letter-spacing: .1em; font-size: 12px; }
.chat-sub {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-tech); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; color: var(--teal); margin-top: 2px;
}
.chat-head-actions { display: flex; gap: 8px; }

/* 消息区 */
.chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--red-dim) transparent;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--red-dim); }
.chat-body::-webkit-scrollbar-track { background: transparent; }

.msg { display: flex; gap: 10px; max-width: 88%; animation: msgIn .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }

.msg .who {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-family: var(--f-cond); font-weight: 700; font-size: 12px;
  border: 1px solid var(--line-strong);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  overflow: hidden;
}
.msg .who img { width: 100%; height: 100%; object-fit: contain; }

/* 气泡列：徽章 / 图片 / 气泡 / 操作条 都竖排在它里面 */
.msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 5px; }
.msg.user .msg-col { align-items: flex-end; }

/* 来源徽章 */
.badge {
  display: inline-block;
  font-family: var(--f-cond); font-weight: 600;
  font-size: 10px; letter-spacing: .12em;
  padding: 2px 8px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
.badge.ai { color: var(--fire-2); border-color: rgba(255, 194, 61, .38); background: rgba(255, 194, 61, .09); }
.badge.local { color: var(--teal); border-color: rgba(0, 224, 176, .38); background: rgba(0, 224, 176, .09); }
.badge.dim { color: var(--text-mute); }

.bubble-img {
  max-width: 220px; max-height: 180px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

/* 气泡下方操作条：常驻可见（触屏没有 hover，不能只靠悬停） */
.msg-actions { display: flex; gap: 6px; margin-top: 4px; }
.act-btn {
  font-family: var(--f-cn); font-size: 11px;
  padding: 3px 10px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: .18s;
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}
.act-btn:hover { color: #fff; background: rgba(255, 70, 85, .22); border-color: var(--red); }
.act-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, .05); }

.bubble {
  position: relative;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.72;
  letter-spacing: .02em;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  word-break: break-word;
}
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 20px; }
.bubble li { margin: 3px 0; }
.bubble strong { color: var(--fire-2); font-weight: 700; }
.bubble code {
  font-family: 'Consolas', monospace;
  background: rgba(0, 224, 176, .12);
  color: var(--teal);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
}
.bubble h4 { margin: 10px 0 4px; font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .04em; }
/* 表格 */
.bubble table {
  width: 100%;
  margin: 8px 0 10px;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}
.bubble th, .bubble td {
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
.bubble th { background: rgba(255, 70, 85, .16); color: #fff; font-weight: 700; white-space: nowrap; }
.bubble td { color: var(--text); }
.bubble tr:nth-child(even) td { background: rgba(255, 255, 255, .025); }
.bubble blockquote {
  margin: 8px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--teal);
  background: rgba(0, 224, 176, .07);
  color: var(--text-dim);
  font-size: 13px;
}

/* AI 气泡 */
.msg.ai .bubble {
  background: linear-gradient(160deg, rgba(255, 70, 85, .14), rgba(28, 18, 22, .55));
  border: 1px solid rgba(255, 70, 85, .3);
  border-left: 3px solid var(--red);
  color: var(--text);
}
.msg.ai .who { border-color: rgba(255, 70, 85, .55); }

/* 用户气泡 */
.msg.user { flex-direction: row-reverse; margin-left: auto; }
.msg.user .bubble {
  background: linear-gradient(160deg, rgba(0, 224, 176, .12), rgba(16, 32, 34, .55));
  border: 1px solid rgba(0, 224, 176, .3);
  border-right: 3px solid var(--teal);
  color: #e6fff9;
}
.msg.user .who {
  border-color: rgba(0, 224, 176, .5);
  color: var(--teal);
  background: rgba(0, 224, 176, .08);
}

.msg-time {
  font-family: var(--f-tech); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; color: var(--text-mute);
  align-self: flex-end; margin-bottom: 2px;
}

/* 打字指示 */
.typing { display: flex; gap: 4px; padding: 4px 2px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fire);
  animation: bounce 1.3s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.typing-label {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: .06em;
}

/* 快捷问题 */
.chips {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 18px 12px;
}
.chip {
  font-family: var(--f-cn); font-size: 12px;
  padding: 6px 12px;
  color: var(--text-dim);
  background: rgba(19, 31, 44, .7);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .18s;
  clip-path: polygon(7px 0, 100% 0, 100% 100%, 0 100%, 0 7px);
}
.chip:hover {
  color: #fff;
  border-color: var(--teal);
  background: rgba(0, 224, 176, .12);
  transform: translateY(-2px);
}

/* 输入区 */
.composer {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 18px;
  padding: 12px 12px 12px 16px;
  background: rgba(10, 16, 24, .9);
  border: 1px solid var(--line-strong);
  transition: .2s;
}
.composer:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 70, 85, .10); }
.composer-corner { position: absolute; width: 9px; height: 9px; border: 1.5px solid var(--red); }
.composer-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.composer-corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.composer-corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.composer-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.composer textarea {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--text);
  font-family: var(--f-cn);
  font-size: 14px;
  line-height: 1.6;
  max-height: 120px;
  padding: 6px 0;
}
.composer textarea::placeholder { color: var(--text-mute); }

/* 上传图片按钮 */
.img-btn {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  margin-bottom: 5px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  cursor: pointer;
  transition: .18s;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.img-btn svg { width: 17px; height: 17px; }
.img-btn:hover { color: var(--teal); border-color: rgba(0, 224, 176, .5); background: rgba(0, 224, 176, .1); }

/* 待发送图片预览 */
.img-preview {
  flex: 0 0 auto;
  position: relative;
  margin: 0 18px 8px;
  width: fit-content;
  animation: msgIn .24s both;
}
.img-preview img {
  display: block;
  max-height: 96px; max-width: 180px;
  object-fit: cover;
  border: 1px solid var(--teal-dim);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
}
.img-del {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  color: #fff;
  background: var(--red);
  border: 0; border-radius: 50%;
  cursor: pointer;
}
.img-del:hover { background: #ff6371; }

.send-btn .ico-stop { display: none; }
.send-btn.stop { background: var(--red-dim); }
.send-btn.stop .ico-send { display: none; }
.send-btn.stop .ico-stop { display: block; }
.send-btn.stop:hover { background: #ff6371; }
.send-btn.stop:hover svg { transform: none; }

.send-btn {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--red);
  border: 0;
  cursor: pointer;
  transition: .18s;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.send-btn svg { width: 18px; height: 18px; fill: #fff; transition: .18s; }
.send-btn:hover { background: #ff6371; transform: translateY(-2px); }
.send-btn:hover svg { transform: translateX(2px); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.composer-hint {
  flex: 0 0 auto;
  padding: 8px 20px 14px;
  font-family: var(--f-tech); font-size: 11px; font-weight: 600;
  letter-spacing: .1em;
  color: var(--text-mute);
}
.composer-hint.ok { color: var(--teal); }

/* ================= 设置弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(4, 7, 11, .78);
  backdrop-filter: blur(4px);
  animation: fadeIn .2s both;
}
.modal-mask[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  width: min(460px, 92vw);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  animation: modalIn .3s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--f-cond); font-weight: 700;
  font-size: 16px; letter-spacing: .18em; color: #fff;
}
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--f-tech); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; color: var(--text-dim);
}
.field input {
  background: rgba(7, 11, 16, .8);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--f-tech); font-size: 13px;
  padding: 10px 12px;
  outline: 0;
  transition: .18s;
}
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 224, 176, .1); }

/* 复选框行（极速模式） */
.field.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(7, 11, 16, .6);
  border: 1px solid var(--line);
  cursor: pointer;
}
.field.check input {
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin-top: 2px;
  padding: 0;
  accent-color: var(--teal);
  cursor: pointer;
}
.field.check b {
  display: block;
  font-family: var(--f-cn); font-size: 12.5px; font-weight: 700;
  color: var(--text); letter-spacing: .04em;
}
.field.check em {
  display: block;
  margin-top: 3px;
  font-style: normal; font-size: 11px; line-height: 1.6;
  color: var(--text-mute);
}

.modal-note { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--text-mute); }
.modal-note b { color: var(--fire-2); }
.modal-note .warn { display: inline-block; margin-top: 6px; color: var(--red); font-weight: 700; }

.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 0 18px 18px;
}
.btn {
  font-family: var(--f-cn); font-weight: 700; font-size: 13px;
  letter-spacing: .1em;
  padding: 10px 22px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: .18s;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.btn:hover { color: #fff; border-color: var(--text-dim); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #ff6371; }

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: 38vh 1fr;
    gap: 14px;
    padding: 14px;
  }
  .agent-plate { padding: 0 16px 16px; }
  .plate-name { font-size: clamp(34px, 10vw, 54px); }
  .report { display: none; }
  .plate-quote { margin: 8px 0 0; font-size: 12px; }
  .agent-side-label { display: none; }
  .figure-img { height: 96%; }
  .brand-en { display: none; }
  .sys-status span:last-child { display: none; }
  .sys-status { padding: 6px 10px; }
}
