* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
  background: #f4f7fa; color: #23303a; font-size: 14px;
}
.topbar {
  background: linear-gradient(120deg, #155e8f, #2e8b8b);
  color: #fff; padding: 16px 28px 0;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 46px; height: 46px; border-radius: 10px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; letter-spacing: 1px;
}
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar p { font-size: 12px; opacity: .85; margin-top: 2px; }
.tabs { display: flex; gap: 6px; margin-top: 14px; }
.tab {
  background: rgba(255,255,255,.12); color: #eaf4f4; border: none;
  padding: 10px 20px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 14px;
}
.tab.active { background: #f4f7fa; color: #155e8f; font-weight: 700; }
main { padding: 22px 28px; }
.panel { display: none; background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 2px 10px rgba(20,60,90,.07); }
.panel.active { display: block; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h3 { margin-right: auto; }
.btn {
  display: inline-block; padding: 8px 16px; border: 1px solid #c5d4de; background: #fff;
  border-radius: 8px; cursor: pointer; text-decoration: none; color: #23506b; font-size: 13px;
}
.btn:hover { background: #eef4f8; }
.btn.primary { background: #1f7fb5; color: #fff; border-color: #1f7fb5; }
.btn.primary:hover { background: #176a99; }
.btn.big { width: 100%; padding: 12px; font-size: 15px; margin: 12px 0; }
.btn.ok { border-color: #3a9d6d; color: #2b7d54; }
.btn.warn { border-color: #d08a3e; color: #a5661f; }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td {
  border: 1px solid #e2e9ee; padding: 9px 10px; text-align: left;
  font-size: 13px; vertical-align: top;
}
.grid th { background: #eef4f8; color: #34546b; white-space: nowrap; }
.grid tr:nth-child(even) td { background: #fafcfe; }
.tag { padding: 2px 9px; border-radius: 11px; font-size: 12px; white-space: nowrap; }
.tag.normal { background: #e3f5ea; color: #2b7d54; }
.tag.abnormal { background: #fdeaea; color: #b8403c; }
.tag.pending { background: #fff4dd; color: #a5741f; }
.tag.connected { background: #e6f0fb; color: #2a63a0; }
.tag.ongoing { background: #efe7fb; color: #6d4aa5; }
.msg { color: #b8403c; font-size: 12px; }
.tip { color: #7a8a96; font-size: 12px; margin-top: 12px; }
.call-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.call-side { background: #f7fafc; border: 1px solid #e2e9ee; border-radius: 10px; padding: 16px; }
.call-side select, .call-side input { width: 100%; padding: 9px; margin-bottom: 8px;
  border: 1px solid #c9d7e0; border-radius: 8px; }
.call-side h4 { margin: 14px 0 8px; color: #34546b; }
.quick-actions { display: grid; gap: 8px; }
.quick-questions { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid #9ec3db; background: #fff; color: #2a638c; border-radius: 14px;
  padding: 6px 12px; cursor: pointer; font-size: 12px;
}
.chip:hover { background: #e8f3fa; }
.chat-box { border: 1px solid #e2e9ee; border-radius: 10px; display: flex;
  flex-direction: column; min-height: 520px; }
.chat-head { padding: 12px 16px; background: #eef4f8; border-radius: 10px 10px 0 0;
  font-weight: 700; color: #34546b; }
.chat-log { flex: 1; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  background: #fbfdfe; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 12px; line-height: 1.6; font-size: 13px; }
.bubble.ai { background: #e8f3fa; color: #23455c; align-self: flex-start; }
.bubble.patient { background: #e3f5ea; color: #23543f; align-self: flex-end; }
.bubble.system { background: #f0e9fb; color: #5a3f8c; align-self: center; font-size: 12px; }
.bubble.alert { background: #fdeaea; color: #9c342f; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e2e9ee; }
.chat-input input { flex: 1; padding: 10px; border: 1px solid #c9d7e0; border-radius: 8px; }
.call-tip {
  font-size: 12.5px; line-height: 1.55; color: #8a5a00;
  background: #fdf6e3; border: 1px solid #ecd9a0; border-radius: 8px; padding: 8px 10px;
}
.btn.mic { white-space: nowrap; }
.btn.mic.recording { background: #c0392b; color: #fff; border-color: #c0392b; }
.modal { position: fixed; inset: 0; background: rgba(20,40,55,.45);
  display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal.hidden { display: none; }
.modal-card { background: #fff; border-radius: 12px; padding: 22px; width: 480px;
  display: flex; flex-direction: column; gap: 10px; max-height: 86vh; overflow: auto; }
.modal-card.wide { width: 680px; }
.modal-card input, .modal-card textarea {
  padding: 9px; border: 1px solid #c9d7e0; border-radius: 8px; font-family: inherit; width: 100%;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.msg-detail { display: flex; flex-direction: column; gap: 8px; }

/* ===== LLM 设置页 ===== */
.llm-wrap { max-width: 760px; }
.llm-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; margin-bottom: 14px; }
.llm-row label { color: #34546b; font-size: 13px; }
.llm-row input[type=text], .llm-row input[type=password], .llm-row input[type=number] {
  padding: 9px 11px; border: 1px solid #c9d7e0; border-radius: 8px; font-size: 13px; width: 100%;
}
.llm-row.two-col { grid-template-columns: 150px 1fr 1fr; gap: 12px; }
.llm-row.two-col > div { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; }
.llm-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 16px 150px; font-size: 12px; color: #7a8a96; }
.llm-actions { display: flex; gap: 12px; align-items: center; margin: 8px 0 20px; }
.llm-boundary { background: #f7fafc; border: 1px solid #e2e9ee; border-radius: 10px; padding: 14px 18px; }
.llm-boundary h4 { color: #b8403c; margin-bottom: 8px; }
.llm-boundary ul { padding-left: 20px; color: #52636f; font-size: 12.5px; line-height: 1.9; }
.switch { position: relative; display: inline-block; width: 46px; height: 24px; justify-self: start; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #c3cfd8; border-radius: 24px; transition: .25s; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.switch input:checked + .slider { background: #1f7fb5; }
.switch input:checked + .slider::before { transform: translateX(22px); }
.login-page { min-height:100vh; display:grid; place-items:center; padding:20px; background:linear-gradient(145deg,#e7f3f3,#f4f7fa 65%); }
.login-card { width:min(100%,410px); padding:36px; background:white; border-top:5px solid #217e85; border-radius:14px; box-shadow:0 12px 45px #19435216; }
.login-brand { color:#29686d; margin-bottom:12px; }
.login-card h1 { font-size:25px; }
.account-form { display:grid; gap:16px; max-width:420px; margin-top:20px; }
.account-form label { display:grid; gap:6px; font-weight:600; }
.account-form input { width:100%; border:1px solid #b7c9d0; border-radius:6px; padding:10px; font:inherit; }
.challenge-line { display:flex; align-items:center; justify-content:space-between; background:#edf5f6; padding:8px 12px; border-radius:6px; }
.challenge-line strong { font-size:20px; }
#feedback:empty { display:none; }
#feedback { color:#a13526; }
.tabs { flex-wrap:wrap; }
/* AI 语音播报开关 */
.tts-bar { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.tts-toggle { font-size: 13px; padding: 4px 10px; }
.tts-toggle.muted { opacity: .6; }
