/* 白玉兰前台工作台：浅灰底 + 深藏青标题 + 白色圆角卡片，移动端优先 */
:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --navy: #1b2a41;
  --navy-soft: #2c3e57;
  --blue: #2f6fed;
  --blue-dark: #1f57c3;
  --text: #1d2129;
  --muted: #86909c;
  --line: #e5e6eb;
  --warn-bg: #fff8e6;
  --warn-line: #f5d78e;
  --warn-text: #8a5b00;
  --ok: #0f9d58;
  --danger: #d93026;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 33, 41, 0.06), 0 8px 24px rgba(29, 33, 41, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--blue); text-decoration: none; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* 顶部标题条 */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 18px 16px;
}
.topbar .inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.5px;
}
.topbar .sub {
  margin-left: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.back {
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px 4px 0;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card > h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card > h2 .dot {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--navy);
  display: inline-block;
}
.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

/* 工作台统计 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 12px;
  text-align: center;
}
.stat .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* 主按钮 */
.actions { display: grid; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: filter 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}
.btn:active { filter: brightness(0.94); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-sm {
  width: auto;
  padding: 9px 14px;
  font-size: 14px;
  border-radius: 10px;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* 表单 */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field > label .req { color: var(--danger); margin-left: 2px; }
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2386909c' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat .num { font-size: 22px; }
}

/* 提示条 */
.notice {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  color: var(--muted);
}
.notice.error {
  background: #fff1f0;
  border-color: #ffccc7;
  color: var(--danger);
}
.notice.ok {
  background: #f0f9f4;
  border-color: #b7e4c9;
  color: #0b7a45;
}
.notice.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-text);
}
.notice:empty { display: none; }

/* 搜索结果行 */
.result {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.result.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}
.result .row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
.result .room {
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 13px;
}
.tag {
  font-size: 12px;
  border-radius: 999px;
  padding: 1px 8px;
  background: #eef1f6;
  color: var(--navy-soft);
  font-weight: 500;
}
.tag.hourly { background: #fff2e8; color: #a8541a; }
.tag.done { background: #f0f9f4; color: #0b7a45; }
.result .row2 {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.result .row3 { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 话术框 */
.speech {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 12px;
  padding: 14px;
  color: #5c3d00;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.speech .code {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.copy-bar {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}
.copy-bar .btn { width: auto; flex: 1; }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(29, 33, 41, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 0;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow-y: auto;
  animation: slide-up 0.2s ease;
}
@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 600px) {
  .modal-mask { align-items: center; }
  .modal { border-radius: 18px; }
}
.modal h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}
.modal .modal-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.kv {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px 12px;
  font-size: 14px;
  margin-bottom: 16px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.calc {
  background: #f7f8fa;
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}
.calc .line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 4px 0;
}
.calc .line.total {
  border-top: 1px dashed var(--line);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
}
.calc .line .deduct { color: var(--danger); }
.calc .placeholder { color: var(--muted); font-size: 13px; }

.mono { font-variant-numeric: tabular-nums; }

/* 底部说明 */
.footnote {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 18px;
  line-height: 1.7;
}
.mode-badge {
  display: inline-block;
  font-size: 11px;
  border-radius: 999px;
  padding: 1px 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* 未登录遮罩：live 模式没登录时挡住整页，避免看到空数据误判 */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 26, 46, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-gate-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}
.auth-gate-box h2 {
  font-size: 17px;
  color: var(--navy);
  margin: 0 0 10px;
}
.auth-gate-box .hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}
.auth-gate-box .btn {
  width: 100%;
}
