/* ============================================================
   医录 AI · Nemotron 流式识别验证台
   布局：上半「录音控制」 / 下半「识别文字」
   ============================================================ */
:root {
  --bg:            #0b1016;
  --panel:         #131c27;
  --panel-2:       #17222f;
  --line:          #23303f;
  --line-soft:     #1b2634;
  --txt:           #e6edf5;
  --txt-dim:       #8ba0b6;
  --txt-faint:     #5b6d80;
  --accent:        #2dd4bf;
  --accent-soft:   rgba(45, 212, 191, .14);
  --accent-line:   rgba(45, 212, 191, .38);
  --green:         #34d399;
  --green-soft:    rgba(52, 211, 153, .14);
  --green-line:    rgba(52, 211, 153, .48);
  --amber:         #f5b544;
  --danger:        #f4635c;
  --violet:        #9d8df1;
  --radius:        14px;
  --radius-sm:     9px;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--txt);
  font-family: var(--sans); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100svh; max-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(45,212,191,.07), transparent 62%),
    radial-gradient(900px 520px at 92% 0%, rgba(157,141,241,.06), transparent 60%),
    var(--bg);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim  { color: var(--txt-dim); }
.hidden { display: none !important; }

/* ---------------- 访问验证遮罩 ---------------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(900px 520px at 50% 18%, rgba(45,212,191,.07), transparent 62%),
              rgba(8,12,17,.95);
  backdrop-filter: blur(12px);
  transition: opacity .26s ease, visibility .26s ease;
}
.auth-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.auth-card {
  width: min(340px, 100%);
  padding: 30px 26px 22px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), #111a24);
  border: 1px solid var(--line);
  box-shadow: 0 26px 70px rgba(0,0,0,.55);
  text-align: center;
}
.auth-title {
  margin: 0 0 6px; font-size: 15px; font-weight: 600;
  letter-spacing: 3px; color: var(--txt);
}
.auth-sub { margin: 0 0 20px; color: var(--txt-faint); font-size: 12.5px; }
.auth-input {
  width: 100%; height: 54px; padding: 0 12px;
  text-align: center; font-family: var(--mono);
  font-size: 22px; letter-spacing: 16px; text-indent: 16px;
  color: var(--txt); background: #0c131a;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-input::placeholder { color: #33445a; letter-spacing: 16px; }
.auth-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(45,212,191,.13);
}
.auth-btn {
  width: 100%; height: 44px; margin-top: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, rgba(45,212,191,.2), rgba(45,212,191,.07));
  color: var(--accent);
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 4px;
  cursor: pointer; transition: filter .16s ease, opacity .16s ease;
}
.auth-btn:hover:not(:disabled) { filter: brightness(1.12); }
.auth-btn:disabled { opacity: .5; cursor: wait; }
.auth-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.auth-msg { margin: 12px 0 0; min-height: 18px; font-size: 12.5px; color: var(--danger); }
.auth-msg.info { color: var(--txt-faint); }
.auth-msg.ok   { color: var(--green); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px max(26px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(11,16,22,.78); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--txt-dim); font-family: inherit; font-size: 12.5px; cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.topbar-btn:hover { border-color: var(--accent-line); color: var(--txt); background: var(--accent-soft); }
.topbar-btn:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.topbar-btn[aria-expanded="true"] { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.topbar-btn.live { border-color: rgba(244,99,92,.45); color: #ff9f9a; background: rgba(244,99,92,.1); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--txt-dim); white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--txt-faint); flex: none; }
.status-pill[data-state="live"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.status-pill[data-state="live"] .dot { background: var(--accent); animation: blink 1.1s ease-in-out infinite; }
.status-pill[data-state="ready"] { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.status-pill[data-state="ready"] .dot { background: var(--green); }
.status-pill[data-state="waiting"] { color: #ffd79a; border-color: rgba(245,181,68,.4); background: rgba(245,181,68,.1); }
.status-pill[data-state="waiting"] .dot { background: var(--amber); animation: blink 1.1s ease-in-out infinite; }
.status-pill[data-state="connecting"] { color: var(--amber); border-color: rgba(245,181,68,.35); }
.status-pill[data-state="connecting"] .dot { background: var(--amber); animation: blink .7s ease-in-out infinite; }
.status-pill[data-state="error"] { color: var(--danger); border-color: rgba(244,99,92,.35); background: rgba(244,99,92,.1); }
.status-pill[data-state="error"] .dot { background: var(--danger); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.banner {
  margin: 12px 26px 0; padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245,181,68,.35);
  background: rgba(245,181,68,.1); color: #ffd79a; font-size: 13px;
  white-space: pre-line;
}
.banner.err { border-color: rgba(244,99,92,.4); background: rgba(244,99,92,.1); color: #ffb3ae; }

/* ---------------- 布局：上下两段 ---------------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-rows: minmax(280px, .82fr) minmax(300px, 1.18fr);
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 0;
  min-height: 0;
}
.panel {
  background: linear-gradient(180deg, var(--panel), #111a24);
  border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 17px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.012); flex: none;
}
.panel-head h2 {
  margin: 0; font-size: 12px; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--txt-dim);
}
.chip-row { display: flex; gap: 7px; }
.chip {
  padding: 3px 9px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line); font-size: 11.5px;
}
.chip.subtle { background: var(--panel-2); color: var(--txt-faint); border-color: var(--line); }

/* ---------------- 上半：语音输入 ---------------- */
.control-body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  padding: 20px 28px 28px;      /* 留出声波环扩散空间，避免被面板裁切 */
  background: radial-gradient(320px 190px at 50% 42%, rgba(45,212,191,.045), transparent 72%);
}
/* 圆形开关按钮：开始 / 停止 */
.rec-btn {
  position: relative;
  width: 112px; height: 112px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 38%, #1d2934, #101922 72%);
  color: var(--txt-dim);
  font-family: inherit; font-size: 17px; font-weight: 600; letter-spacing: 3px;
  cursor: pointer;
  appearance: none; padding: 0;
  box-shadow: 0 0 0 1px rgba(45,212,191,.1), 0 0 30px rgba(0,0,0,.16),
              0 14px 34px rgba(0,0,0,.5);
  transition: border-color .25s ease, background .25s ease, color .25s ease,
              box-shadow .2s ease, transform .12s ease;
}
.rec-btn:hover { transform: translateY(-1px); }
.rec-btn:active { transform: translateY(0); }
.rec-btn:focus-visible { outline: 2px solid var(--green-line); outline-offset: 6px; }
.rec-btn-label {
  position: relative; z-index: 2;
  max-width: 82px; text-align: center; line-height: 1.35;
}

/* 服务可用：绿色开始 */
.rec-btn.ready {
  border-color: var(--green-line);
  background: radial-gradient(circle at 50% 38%, #173b32, #101922 72%);
  color: #7cf0c4;
  box-shadow: 0 0 0 1px rgba(52,211,153,.14), 0 0 34px rgba(52,211,153,.14),
              0 14px 34px rgba(0,0,0,.5);
}

/* 服务不可用：黄色等待，不允许误启动麦克风 */
.rec-btn.waiting {
  border-color: rgba(245,181,68,.5);
  background: radial-gradient(circle at 50% 38%, #3a301c, #14181e 72%);
  color: #ffd79a;
  font-size: 12.5px; letter-spacing: .8px;
  cursor: wait;
  box-shadow: 0 0 0 1px rgba(245,181,68,.12), 0 0 30px rgba(245,181,68,.12),
              0 14px 34px rgba(0,0,0,.5);
}

/* 录音中：变红 + 声波扩散环 */
.rec-btn.live {
  border-color: rgba(244,99,92,.62);
  background: radial-gradient(circle at 50% 38%, #3d2023, #14181e 72%);
  color: #ff9f9a;
  box-shadow: 0 0 0 calc(2px + var(--amp, 0) * 7px) rgba(244,99,92,.15),
              0 0 34px rgba(244,99,92,.22), 0 14px 34px rgba(0,0,0,.5);
}
.rec-btn.flushing {
  border-color: rgba(245,181,68,.58);
  background: radial-gradient(circle at 50% 38%, #382f1c, #14181e 72%);
  color: #ffd79a;
  cursor: wait;
  box-shadow: 0 0 0 3px rgba(245,181,68,.1), 0 0 30px rgba(245,181,68,.16),
              0 14px 34px rgba(0,0,0,.5);
}
.rec-btn:disabled { transform: none; }
.rec-btn i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(244,99,92,.45);
  opacity: 0;
  pointer-events: none;
}
.rec-btn.live i { animation: wave 2s cubic-bezier(.22,.61,.36,1) infinite; }
.rec-btn.live i:nth-child(2) { animation-delay: .66s; }
.rec-btn.live i:nth-child(3) { animation-delay: 1.33s; }
@keyframes wave {
  0%   { transform: scale(.95); opacity: 0; }
  14%  { opacity: .7; }
  100% { transform: scale(calc(1.5 + var(--amp, 0) * .22)); opacity: 0; }
}

.control-status {
  min-height: 49px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center;
}
.control-help { margin: 0; color: var(--txt-faint); font-size: 12px; }
.btn {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto;
  column-gap: 11px; align-items: center; text-align: left;
  padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt);
  cursor: pointer; font-family: inherit;
  transition: transform .12s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #2d3d4f; }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn-ico {
  grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: #0d151d; border: 1px solid var(--line); font-size: 14px;
}
.btn.no-ico { grid-template-columns: 1fr; grid-template-rows: auto auto; }
.btn-label { font-size: 13.5px; font-weight: 500; }
.btn-hint  { font-size: 11.5px; color: var(--txt-faint); margin-top: 1px; }

.btn-primary {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, rgba(45,212,191,.2), rgba(45,212,191,.08));
  color: var(--accent);
}
.btn-primary:hover:not(:disabled) { border-color: var(--accent); }
.btn-danger {
  border-color: rgba(244,99,92,.42);
  background: linear-gradient(180deg, rgba(244,99,92,.16), rgba(244,99,92,.05));
  color: #ff9f9a;
}
.btn-danger:hover:not(:disabled) { border-color: var(--danger); }
.btn-accent {
  border-color: rgba(157,141,241,.36);
  background: linear-gradient(180deg, rgba(157,141,241,.16), rgba(157,141,241,.06));
  color: #b9adf7;
}
.btn-accent:hover:not(:disabled) { border-color: var(--violet); }
.btn-ghost:hover:not(:disabled) { border-color: rgba(245,181,68,.4); }
.btn-probe { position: relative; overflow: hidden; }
.btn-probe.probing { border-color: rgba(45,212,191,.5); background: var(--accent-soft); }
.btn-probe.probing .probe-ico {
  color: var(--accent);
  animation: probe-pulse 1.15s ease-in-out infinite;
}
.btn-probe.probing::after {
  content: "";
  position: absolute; left: 31px; top: 50%;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(45,212,191,.55);
  transform: translate(-50%, -50%);
  animation: probe-ring 1.5s ease-out infinite;
  pointer-events: none;
}
@keyframes probe-pulse {
  0%, 100% { opacity: .55; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.06); }
}
@keyframes probe-ring {
  0% { opacity: .75; transform: translate(-50%, -50%) scale(.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
}

/* 录音接收提示 */
.rec-line {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 13px 5px 11px; border-radius: 999px;
  background: rgba(244,99,92,.1); border: 1px solid rgba(244,99,92,.38);
  color: #ffb3ae; font-size: 12px; letter-spacing: .4px;
  width: fit-content;
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 0 rgba(244,99,92,.6);
  animation: recpulse 1.15s ease-out infinite;
}
.rec-line.flushing {
  background: rgba(245,181,68,.09);
  border-color: rgba(245,181,68,.34);
  color: #ffd79a;
}
.rec-line.flushing .rec-dot {
  background: var(--amber);
  animation-name: flushpulse;
}
@keyframes recpulse {
  0%   { box-shadow: 0 0 0 0 rgba(244,99,92,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(244,99,92,0); }
  100% { box-shadow: 0 0 0 0 rgba(244,99,92,0); }
}
@keyframes flushpulse {
  0%   { box-shadow: 0 0 0 0 rgba(245,181,68,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(245,181,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,181,68,0); }
}
/* ---------------- 下半：识别文字 ---------------- */
.text-panel { min-height: 0; }
.transcript {
  flex: 1 1 auto; min-height: 72px; overflow-y: auto;
  padding: 20px 22px 22px; font-size: 16px; line-height: 1.95;
}
.transcript::-webkit-scrollbar { width: 8px; }
.transcript::-webkit-scrollbar-thumb { background: #22303f; border-radius: 4px; }
.placeholder { color: var(--txt-faint); font-size: 13px; }
.placeholder p { margin: 0 0 6px; }
.placeholder b { color: var(--txt-dim); font-weight: 500; }
.transcript-text { white-space: pre-wrap; word-break: break-word; }
.transcript-text .live-text { color: #b8d8d4; }

/* ---------------- 病历草稿面板 ---------------- */
.record-panel {
  flex: 0 1 auto;
  max-height: 58%;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-soft);
  background: rgba(255,255,255,.015);
  overflow: hidden;
}
.record-panel.hidden { display: none; }
.record-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.record-title {
  font-size: 11.5px; font-weight: 600; letter-spacing: 1.2px; color: var(--txt-dim);
}
.record-head .drawer-close { margin-left: auto; }
.record-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 12px;
}
.record-body::-webkit-scrollbar { width: 8px; }
.record-body::-webkit-scrollbar-thumb { background: #22303f; border-radius: 4px; }
.rrow {
  display: grid; grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px; padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
}
.rk { color: var(--txt-faint); font-size: 12px; padding-top: 1px; }
.rv { font-size: 13.5px; color: var(--txt); line-height: 1.6; word-break: break-word; }
.rv.empty { color: var(--txt-faint); }
.rsrc { margin-top: 2px; color: var(--txt-faint); font-size: 11px; line-height: 1.5; }
.rsec {
  margin: 12px 0 2px; font-size: 11px; letter-spacing: 1px; color: var(--txt-faint);
}
.rwarn {
  margin-bottom: 8px; padding: 7px 10px; border-radius: 7px;
  background: rgba(245,181,68,.1); border: 1px solid rgba(245,181,68,.32);
  color: #ffd79a; font-size: 12px;
}
.record-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 16px 10px; border-top: 1px solid var(--line-soft);
}
.record-foot .dim { font-size: 11.5px; }
.record-foot .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 104px; padding: 8px 18px;
  font-size: 13px; font-weight: 600; letter-spacing: 1px;
}

/* 文字区底部：清空 / 发送 */
.text-foot {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px 13px;
  border-top: 1px solid var(--line-soft);
  background: rgba(255,255,255,.012);
}
.text-foot .dim { font-size: 11.5px; }
.foot-actions { display: flex; align-items: center; gap: 10px; }
.text-foot .btn {
  display: inline-flex; align-items: center; justify-content: center;
  grid-template-columns: none; grid-template-rows: none;
  min-width: 96px; padding: 10px 22px;
  font-size: 14px; font-weight: 600; letter-spacing: 2px;
}
/* 清空：次要操作，低调显示，悬停时给出警示色 */
.text-foot .btn-clear {
  min-width: 78px; padding: 10px 16px; letter-spacing: 1px;
  color: var(--txt-dim); background: transparent; border-color: var(--line);
}
.text-foot .btn-clear:hover:not(:disabled) {
  border-color: rgba(244,99,92,.45); color: #ff9f9a;
}

/* ---------------- 抽屉 ---------------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(4,8,12,.62); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; z-index: 60;
}
.drawer-backdrop.show { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 92vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #16202c, #101821);
  border-left: 1px solid var(--line);
  box-shadow: -28px 0 70px rgba(0,0,0,.55);
  transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.2,1); z-index: 61;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft); flex: none;
}
.drawer-head h2 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--txt-dim); }
.drawer-close {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid var(--line); background: #0e161f; color: var(--txt-dim);
  font-size: 13px; cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.drawer-close:hover { border-color: var(--danger); color: var(--danger); }
.drawer-close:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.drawer-body { padding: 16px 18px 22px; overflow-y: auto; }
.drawer-body .btn { width: 100%; }
.drawer-sec {
  margin: 20px 0 8px; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--txt-faint);
}
.probe-result {
  margin: 14px 0 4px; padding: 13px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px;
}
.probe-result.ok   { border-color: var(--accent-line); background: var(--accent-soft); }
.probe-result.warn { border-color: rgba(245,181,68,.4); background: rgba(245,181,68,.09); }
.probe-result.bad  { border-color: rgba(244,99,92,.4); background: rgba(244,99,92,.09); }
.probe-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }

/* 探测中：明确提示需要人声 */
.probe-speak {
  display: flex; align-items: center; gap: 9px;
  margin: 2px 0 10px; padding: 9px 12px; border-radius: 8px;
  background: rgba(245,181,68,.12); border: 1px solid rgba(245,181,68,.4);
  color: #ffd79a; font-size: 13px; font-weight: 600;
}
.probe-speak.heard {
  background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.42);
  color: #7cf0c4;
}
.speak-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--amber); box-shadow: 0 0 0 0 rgba(245,181,68,.6);
  animation: recpulse 1.15s ease-out infinite;
}
.probe-speak.heard .speak-dot { background: var(--green); animation-name: flushpulse; }
.probe-title .badge { font-size: 10.5px; padding: 1px 7px; border-radius: 5px; background: rgba(0,0,0,.3); }
.probe-rows { display: grid; gap: 3px; font-family: var(--mono); font-size: 11.5px; color: var(--txt-dim); }
.probe-text {
  margin-top: 9px; padding: 8px 10px; border-radius: 7px;
  background: rgba(0,0,0,.32); font-size: 13px; line-height: 1.6;
  border-left: 2px solid var(--accent-line);
}
.push-result { font-size: 12.5px; }
.push-row { display: flex; gap: 10px; padding: 2px 0; }
.push-row .k { flex: none; width: 84px; color: var(--txt-faint); font-size: 11.5px; }
.push-row .v { font-family: var(--mono); font-size: 11.5px; word-break: break-all; color: var(--txt); }
.push-ok  { color: var(--accent); }
.push-bad { color: var(--danger); }
.payload-box {
  margin-top: 9px; padding: 10px; border-radius: 7px;
  background: #0c131a; border: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 11px; line-height: 1.55;
  color: var(--txt-dim); max-height: 170px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}

/* 可折叠区块 */
.panel-head.collapsible { cursor: pointer; user-select: none; transition: background .15s ease; }
.panel-head.collapsible:hover { background: rgba(255,255,255,.04); }
.panel-head.collapsible:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -2px; }
.head-right { display: inline-flex; align-items: center; gap: 9px; }
.chevron {
  display: inline-block; font-size: 11px; line-height: 1; color: var(--txt-faint);
  transform-origin: 50% 50%; transition: transform .28s cubic-bezier(.4,0,.2,1), color .15s ease;
}
.panel-head.collapsible:hover .chevron { color: var(--txt-dim); }
.panel-head.collapsible[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.rawlog {
  padding: 10px 12px 12px; font-family: var(--mono); font-size: 11px; line-height: 1.6;
  color: var(--txt-faint); max-height: 220px; overflow-y: auto; background: #0c131a;
  border-radius: var(--radius-sm); border: 1px solid var(--line-soft);
  transition: max-height .3s cubic-bezier(.4,0,.2,1);
}
.rawlog.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; border-width: 0; }
.rawlog div { padding: 1px 0; border-bottom: 1px solid rgba(255,255,255,.03); word-break: break-all; }
.rawlog .hl { color: var(--accent); }
.rawlog .warn { color: var(--amber); }
.rawlog .err { color: var(--danger); }

/* ---------------- 底部 ---------------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 20px;
  padding: 10px 26px 16px; border-top: 1px solid var(--line-soft);
  font-size: 11px; color: var(--txt-faint);
}

@media (max-height: 760px) {
  .layout {
    grid-template-rows: minmax(210px, .72fr) minmax(240px, 1.28fr);
    gap: 12px;
    padding: 12px 0;
  }
  .rec-btn { width: 92px; height: 92px; font-size: 15px; }
  .transcript { min-height: 56px; padding: 14px 18px 16px; }
  .record-panel { max-height: 52%; }
}

@media (max-width: 720px) {
  .topbar {
    padding: 10px 16px;
  }
  .layout {
    grid-template-rows: minmax(260px, .8fr) minmax(300px, 1.2fr);
    gap: 12px;
    padding: 12px;
  }
  .panel-head {
    padding: 10px 14px;
  }
  .control-body {
    padding: 18px 16px 24px;
  }
  .rec-btn {
    width: 96px; height: 96px;
    font-size: 16px;
  }
  .transcript {
    padding: 16px 16px 18px;
    font-size: 15px;
  }
  .text-foot {
    padding: 10px 14px 12px;
  }
  .text-foot .btn {
    min-width: 84px;
    padding: 9px 18px;
  }
}
