/* ============================================================
   家政面试间 · H5
   ============================================================ */

:root {
  --brand: #0ea472;
  --brand-deep: #07835b;
  --brand-soft: #e6f7ef;
  --ink: #16202a;
  --ink-2: #44505d;
  --muted: #8b96a5;
  --line: #e8ecf1;
  --bg: #f4f6f8;
  --card: #ffffff;
  --bubble-mine: #c7f2dd;
  --danger: #ef4444;
  --agent: #f59e0b;
  --employer: #3b82f6;
  --helper: #10b981;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #dfe7ea;
  background-image: radial-gradient(1200px 600px at 50% -10%, #cfeee1 0%, #dfe7ea 55%, #e6ebee 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }

#app {
  position: relative;
  width: 100%;
  max-width: 520px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(15, 70, 50, .16);
  overflow: hidden;
}
@media (min-width: 521px) {
  #app { min-height: 100vh; height: 100vh; border-radius: 0; }
}

.view {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
}
.view.active { display: flex; animation: viewIn .18s ease; }
@keyframes viewIn { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 通用 ---------- */
.btn-main {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border: 0; border-radius: 13px;
  background: linear-gradient(135deg, #12b981, #0a9767);
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: .3px;
  box-shadow: 0 8px 18px rgba(14, 164, 114, .28);
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
}
.btn-main:active { transform: scale(.985); box-shadow: 0 4px 10px rgba(14, 164, 114, .22); }
.btn-main[disabled] { opacity: .55; box-shadow: none; }
.btn-main .ic { width: 20px; height: 20px; }
.btn-main.big { height: 54px; font-size: 17px; margin-top: 8px; }
.btn-ghost {
  width: 100%; height: 46px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink-2); font-size: 15px; cursor: pointer;
}
.btn-ghost:active { background: #f2f4f6; }
.wx-share {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border: 1px solid #b9e7d6; border-radius: 12px;
  background: #f2fbf7; color: #0a8a61; font-weight: 600;
}
.wx-share:active { background: #e6f8f0; }
.link-btn { border: 0; background: none; color: var(--brand); font-size: 13px; cursor: pointer; }

.text-input {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 0 13px; font-size: 15px; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.text-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 164, 114, .12); }
.text-input::placeholder { color: #b6bec9; }

.field-label {
  display: block; font-size: 13px; color: var(--ink-2); font-weight: 600;
  margin: 0 0 9px 2px;
}

.icon-btn {
  width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
  cursor: pointer; flex: none;
}
.icon-btn:active { background: #eef1f4; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.video { color: var(--brand); }

.back-btn {
  width: 38px; height: 38px; border: 0; background: transparent; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer;
}
.back-btn svg { width: 24px; height: 24px; }
.back-btn:active { background: #eef1f4; }

.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 600; flex: none;
  background: linear-gradient(135deg, #34d399, #0d9488);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================== 登录 ============================== */
#view-login {
  justify-content: center;
  padding: 0 26px calc(20px + var(--safe-b));
  background:
    radial-gradient(600px 340px at 50% 0%, #b9f0d6 0%, rgba(185,240,214,0) 70%),
    linear-gradient(180deg, #eefaf4 0%, #f5f7f8 46%, #ffffff 100%);
  position: relative;
}
#view-login.active { display: flex; }
.login-top { text-align: center; padding-top: 26px; }
.app-logo {
  width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 22px;
  background: linear-gradient(135deg, #16c08a, #067a55);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 14px 30px rgba(6, 122, 85, .3);
}
.app-logo svg { width: 38px; height: 38px; }
.login-top h1 { font-size: 27px; letter-spacing: 1px; margin: 0 0 8px; font-weight: 700; }
.login-slogan { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
.login-tags { display: flex; justify-content: center; gap: 8px; margin-bottom: 30px; }
.login-tags span {
  font-size: 12px; color: #0b7d59; background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .18); padding: 4px 10px; border-radius: 999px;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 22px 20px 18px;
  box-shadow: 0 16px 40px rgba(20, 60, 45, .1);
}
.login-card .field-label { margin-bottom: 8px; }
.login-card .text-input { margin-bottom: 16px; background: #f8fafb; }
.login-tip { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 12px 0 0; text-align: center; }
.login-foot { margin-top: 24px; font-size: 11px; color: #a3adb9; text-align: center; }

/* ============================== 首页 ============================== */
#view-home { padding: 0 18px calc(16px + var(--safe-b)); overflow-y: auto; }
.home-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 2px 16px; }
.home-hello .hi { font-size: 20px; font-weight: 700; }
.home-hello .hi-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.avatar-btn .avatar { width: 44px; height: 44px; border-radius: 14px; box-shadow: 0 6px 14px rgba(16, 185, 129, .25); }

.hero-card {
  position: relative; overflow: hidden; border-radius: 22px; padding: 22px 20px;
  background: linear-gradient(135deg, #0fae7a 0%, #077c57 100%);
  color: #fff; box-shadow: 0 16px 34px rgba(7, 124, 87, .28);
  margin-bottom: 18px;
}
.hero-card h2 { font-size: 21px; margin: 0 0 8px; letter-spacing: .5px; }
.hero-card p { font-size: 12.5px; line-height: 1.6; margin: 0; color: rgba(255, 255, 255, .82); max-width: 78%; }
.hero-art {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center;
}
.hero-art .art-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18);
}
.hero-art svg { width: 34px; height: 34px; color: #fff; }

.home-actions { display: flex; flex-direction: column; gap: 12px; }
.action-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: #fff; border: 1px solid #eef1f4; border-radius: 18px;
  padding: 16px 16px; text-align: left; cursor: pointer;
  box-shadow: 0 6px 16px rgba(22, 32, 42, .05);
  transition: transform .12s;
}
.action-card:active { transform: scale(.985); }
.action-card.primary { background: linear-gradient(180deg, #ffffff, #f2fbf7); border-color: #c9efdd; }
.ac-icon {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, #12b981, #0a8f66); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ac-icon.soft { background: #eef4ff; color: #3b82f6; }
.ac-icon svg { width: 24px; height: 24px; }
.ac-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ac-main b { font-size: 16.5px; }
.ac-main small { font-size: 12px; color: var(--muted); }
.ac-arrow { color: #c3cbd5; font-size: 22px; }

.join-panel {
  margin-top: 14px; background: #fff; border-radius: 18px; padding: 16px;
  border: 1px solid #eef1f4; box-shadow: 0 6px 16px rgba(22, 32, 42, .05);
  animation: viewIn .18s ease;
}
.join-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.join-panel-head b { font-size: 14px; }
.code-boxes { display: flex; gap: 9px; margin-bottom: 16px; }
.code-box {
  width: 100%; height: 54px; border: 1px solid var(--line); border-radius: 12px;
  text-align: center; font-size: 24px; font-weight: 700; color: var(--ink);
  background: #f8fafb; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.code-box:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(14, 164, 114, .12); }

.recent-wrap { margin-top: 24px; }
.section-title { font-size: 13px; color: var(--muted); margin: 0 2px 10px; }
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border-radius: 14px; padding: 13px 14px; border: 1px solid #f0f3f6; cursor: pointer;
}
.recent-item .ri-code {
  font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--brand-deep);
  background: var(--brand-soft); border-radius: 9px; padding: 6px 9px; font-size: 13px; letter-spacing: 1px;
}
.recent-item .ri-main { flex: 1; min-width: 0; }
.recent-item .ri-main b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .ri-main small { font-size: 11.5px; color: var(--muted); }
.recent-item .ri-arrow { color: #c3cbd5; }
.home-foot { text-align: center; font-size: 11px; color: #a9b3bf; margin: 20px 0 4px; }

/* ============================== 创建 ============================== */
.page-head {
  display: flex; align-items: center; gap: 6px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: #fff; border-bottom: 1px solid #f1f4f7;
}
.page-head h2 { font-size: 17px; margin: 0; font-weight: 600; }
.head-right { margin-left: auto; font-size: 12px; color: var(--muted); }

#view-create { background: var(--bg); height: 100dvh; }
.form-body { padding: 16px 18px calc(28px + var(--safe-b)); overflow-y: auto; flex: 1; min-height: 0; }
.form-block {
  background: #fff; border-radius: 18px; padding: 16px 16px 18px; margin-bottom: 14px;
  border: 1px solid #eef1f4;
}
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.role-card {
  border: 1.5px solid #e8edf2; border-radius: 14px; background: #fbfcfd;
  padding: 13px 8px 11px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; transition: all .15s;
}
.role-card .role-emoji { font-size: 24px; line-height: 1.1; }
.role-card b { font-size: 14px; }
.role-card small { font-size: 10.5px; color: var(--muted); }
.role-card.on { border-color: var(--brand); background: #f0fbf6; box-shadow: 0 0 0 3px rgba(14, 164, 114, .09); }
.role-note { font-size: 11.5px; color: var(--muted); margin: 11px 2px 0; line-height: 1.6; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid #e8edf2; background: #fbfcfd; color: var(--ink-2);
  font-size: 13px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
}
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch-row b { font-size: 14.5px; display: block; margin-bottom: 4px; }
.switch-row small { font-size: 11.5px; color: var(--muted); }
.switch {
  width: 48px; height: 29px; border-radius: 999px; border: 0; background: #dfe5ec;
  position: relative; flex: none; cursor: pointer; transition: background .18s;
}
.switch i {
  position: absolute; top: 2.5px; left: 3px; width: 24px; height: 24px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: left .18s;
}
.switch.on { background: var(--brand); }
.switch.on i { left: 21px; }

/* ============================== 房间 ============================== */
#view-room { height: 100dvh; min-height: 100dvh; background: #eff2f5; }
.room-head {
  display: flex; align-items: center; gap: 2px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px;
  background: #fff; border-bottom: 1px solid #edf0f3; flex: none; z-index: 5;
}
.room-title { flex: 1; min-width: 0; padding-left: 2px; }
.room-title b {
  display: block; font-size: 16px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-title small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.room-title small span { color: var(--brand-deep); font-weight: 600; }
.room-actions { display: flex; gap: 0; }
.badge-wrap { position: relative; }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; line-height: 16px;
  background: #ef4444; color: #fff; border-radius: 999px; font-size: 10px; font-style: normal;
  text-align: center; padding: 0 4px;
}
.room-status-bar {
  background: #fff4e5; color: #b45309; font-size: 12px; text-align: center; padding: 6px;
}

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 4px; scroll-behavior: smooth; }
.chat-list { display: flex; flex-direction: column; }
.chat-bottom-pad { height: 8px; }

.sys-msg { text-align: center; margin: 10px 0 14px; }
.sys-msg span {
  display: inline-block; font-size: 11.5px; color: #7d8794; background: rgba(255, 255, 255, .72);
  padding: 4px 10px; border-radius: 7px; max-width: 88%; line-height: 1.6;
}
.time-div { text-align: center; font-size: 11px; color: #9aa4b0; margin: 6px 0 12px; }

.avatar-col {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: none; width: 44px;
}
.avatar-role {
  max-width: 100%; padding: 2px 5px; border-radius: 4px;
  font-size: 9px; line-height: 1.1; font-weight: 500; white-space: nowrap;
  background: #eef2f6; color: #64748b;
}
.avatar-role.employer { background: #e8f1ff; color: #1d4ed8; }
.avatar-role.helper { background: #e7f8f1; color: #0b8058; }
.avatar-role.agent { background: #fff3df; color: #b45309; }

.msg-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.msg-row .avatar-col { width: 38px; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-row .avatar { width: 36px; height: 36px; border-radius: 9px; font-size: 14px; }
.msg-main { max-width: 76%; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.msg-row.mine .msg-main { align-items: flex-end; }
.msg-name { font-size: 10.5px; color: #97a1ad; padding: 0 2px; display: flex; align-items: center; gap: 5px; }
.msg-name .role-mini { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: #eef2f6; color: #64748b; }

.bubble {
  position: relative; background: #fff; border-radius: 4px 12px 12px 12px;
  padding: 9px 12px; font-size: 15px; line-height: 1.5; color: var(--ink);
  word-break: break-word; white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(22, 32, 42, .05);
  max-width: 100%;
}
.msg-row.mine .bubble { background: var(--bubble-mine); border-radius: 12px 4px 12px 12px; }
.bubble.emoji { background: transparent !important; box-shadow: none; padding: 0 2px; font-size: 38px; line-height: 1.2; }
.bubble.image { padding: 3px; background: #fff; border-radius: 12px; overflow: hidden; }
.bubble.image img { display: block; max-width: 200px; max-height: 240px; border-radius: 9px; object-fit: cover; }
.bubble.voice { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; }
.voice-icon { width: 20px; height: 20px; color: var(--brand-deep); flex: none; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.voice-wave i {
  display: block; width: 2px; border-radius: 2px; background: currentColor; opacity: .5;
}
.voice-dur { font-size: 12px; color: var(--ink-2); margin-left: 2px; }
.bubble.voice.playing .voice-wave i { opacity: .95; animation: wave .9s infinite ease-in-out; }
@keyframes wave { 0%,100% { transform: scaleY(.5) } 50% { transform: scaleY(1.25) } }

.bubble.file {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 180px; cursor: pointer;
}
.file-icon {
  width: 38px; height: 38px; border-radius: 9px; background: #eef4ff; color: #3b82f6;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.file-icon svg { width: 20px; height: 20px; }
.file-meta { min-width: 0; }
.file-meta b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.file-meta small { font-size: 10.5px; color: var(--muted); }

.msg-status { font-size: 10px; color: #a9b3bf; padding: 0 3px; }

.composer {
  flex: none; display: flex; align-items: flex-end; gap: 2px;
  padding: 8px 8px calc(8px + var(--safe-b));
  background: #fff; border-top: 1px solid #e9edf1;
}
.text-wrap {
  flex: 1; min-width: 0; background: #f4f6f8; border-radius: 9px; padding: 3px 10px;
  display: flex; align-items: center; min-height: 38px;
}
#msgInput {
  width: 100%; border: 0; outline: none; resize: none; background: transparent;
  font-size: 15px; line-height: 22px; max-height: 96px; padding: 7px 0; font-family: inherit;
  color: var(--ink);
}
.send-btn {
  border: 0; background: var(--brand); color: #fff; font-size: 14px; font-weight: 500;
  height: 36px; padding: 0 14px; border-radius: 8px; margin-left: 6px; flex: none; cursor: pointer;
}
.send-btn[disabled] { opacity: .45; }
.voice-bar {
  flex: none; background: #fff; border-top: 1px solid #e9edf1;
  padding: 9px 14px calc(9px + var(--safe-b)); display: flex; align-items: center; gap: 10px;
}
.voice-hold {
  flex: 1; height: 44px; border-radius: 9px; border: 1px solid #d9e0e7; background: #f7f9fa;
  font-size: 15px; color: var(--ink); cursor: pointer; user-select: none;
}
.voice-hold.recording { background: #e8f8f0; border-color: #9fe0c3; color: var(--brand-deep); }
.voice-bar small { font-size: 11px; color: var(--muted); }

.emoji-panel {
  flex: none; background: #fff; border-top: 1px solid #e9edf1;
  padding: 10px 10px calc(10px + var(--safe-b)); max-height: 262px; overflow-y: auto;
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-item {
  border: 0; background: none; font-size: 24px; padding: 6px 0; border-radius: 8px; cursor: pointer;
  line-height: 1.2;
}
.emoji-item:active { background: #f1f4f7; }

.record-mask {
  position: fixed; inset: 0; background: rgba(10, 20, 16, .42); z-index: 70;
  display: flex; align-items: center; justify-content: center;
}
.record-box {
  background: rgba(20, 30, 26, .9); color: #fff; border-radius: 18px;
  padding: 26px 34px; text-align: center; min-width: 180px;
}
.wave { display: flex; justify-content: center; align-items: center; gap: 4px; height: 40px; margin-bottom: 10px; }
.wave i { width: 4px; background: #34d399; border-radius: 3px; height: 10px; animation: rec 1s infinite ease-in-out; }
.wave i:nth-child(1) { animation-delay: 0s } .wave i:nth-child(2) { animation-delay: .12s }
.wave i:nth-child(3) { animation-delay: .24s } .wave i:nth-child(4) { animation-delay: .36s }
.wave i:nth-child(5) { animation-delay: .48s } .wave i:nth-child(6) { animation-delay: .6s }
.wave i:nth-child(7) { animation-delay: .72s }
@keyframes rec { 0%,100% { height: 8px; opacity: .5 } 50% { height: 34px; opacity: 1 } }
.record-time { font-size: 19px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.record-hint { font-size: 11px; color: rgba(255, 255, 255, .62); }

/* ============================== 等待审核 ============================== */
#view-wait { justify-content: center; align-items: center; padding: 30px; background: linear-gradient(180deg, #f0faf5, #f7f9fa); }
.wait-wrap { text-align: center; max-width: 330px; }
.wait-icon {
  width: 82px; height: 82px; margin: 0 auto 20px; border-radius: 24px;
  background: #e8f8f0; color: var(--brand-deep); display: flex; align-items: center; justify-content: center;
}
.wait-icon svg { width: 38px; height: 38px; }
.wait-wrap h2 { font-size: 20px; margin: 0 0 6px; }
.wait-room { color: var(--ink-2); font-size: 14px; margin: 0 0 16px; }
.wait-code {
  display: inline-block; background: #fff; border: 1px solid #e3efe9; border-radius: 12px;
  padding: 10px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 18px;
}
.wait-code b { font-family: ui-monospace, monospace; font-size: 20px; color: var(--brand-deep); letter-spacing: 2px; }
.wait-tip { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-bottom: 26px; }

/* ============================== 成员 ============================== */
#view-members { position: fixed; inset: 0; z-index: 40; max-width: 520px; margin: 0 auto; background: var(--bg); }
.members-body { flex: 1; overflow-y: auto; padding: 14px 16px calc(24px + var(--safe-b)); }
.pending-box { background: #fff8ec; border: 1px solid #fde9c8; border-radius: 16px; padding: 12px 12px 4px; margin-bottom: 16px; }
.pending-head { font-size: 13px; color: #a16207; font-weight: 600; padding: 0 2px 8px; }
.pending-head span { color: #b45309; }
.member-section-title { font-size: 12px; color: var(--muted); margin: 4px 2px 8px; }
.member-item {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px;
  padding: 12px 13px; margin-bottom: 9px; border: 1px solid #f0f3f6;
}
.member-item .avatar { width: 44px; height: 44px; border-radius: 12px; }
.member-item .mi-main { flex: 1; min-width: 0; }
.member-item .mi-name { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; }
.member-item .mi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.role-badge { font-size: 10px; padding: 2px 7px; border-radius: 5px; font-weight: 500; }
.role-badge.employer { background: #e8f1ff; color: #1d4ed8; }
.role-badge.helper { background: #e7f8f1; color: #0b8058; }
.role-badge.agent { background: #fff3df; color: #b45309; }
.owner-badge { font-size: 10px; padding: 2px 6px; border-radius: 5px; background: #f1f5f9; color: #64748b; }
.online-dot { display: inline-flex; align-items: center; gap: 4px; }
.online-dot i { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.online-dot.on i { background: #10b981; }
.danger-zone { margin: 26px 0 8px; text-align: center; }
.btn-danger {
  width: 100%; height: 44px; border: 1px solid #fecaca; border-radius: 12px;
  background: #fff; color: #dc2626; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-danger:active { background: #fef2f2; }
.danger-zone small { display: block; margin-top: 8px; font-size: 11px; color: #a3adb9; line-height: 1.6; }
.member-actions { display: flex; gap: 6px; flex: none; }
.mini-btn {
  border: 0; border-radius: 8px; font-size: 12px; padding: 7px 11px; cursor: pointer;
  background: #f1f5f9; color: #334155;
}
.mini-btn.ok { background: var(--brand-soft); color: var(--brand-deep); }
.mini-btn.warn { background: #fff3df; color: #b45309; }
.mini-btn.danger { background: #fef2f2; color: #b91c1c; }
.mini-btn.call { background: #eef4ff; color: #1d4ed8; }
.perm-note { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.7; margin: 18px 12px 0; }

/* ============================== 弹层 / 面板 ============================== */
.sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
}
.sheet-mask { position: absolute; inset: 0; background: rgba(12, 22, 18, .42); }
.sheet-body {
  position: relative; width: 100%; max-width: 520px; background: #fff;
  border-radius: 22px 22px 0 0; padding: 8px 20px calc(20px + var(--safe-b));
  animation: sheetUp .24s cubic-bezier(.2, .8, .3, 1); max-height: 86dvh; overflow-y: auto;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .7 } to { transform: none; opacity: 1 } }
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: #e5e9ee; margin: 0 auto 14px; }
.sheet-body h3 { font-size: 17px; margin: 0 0 6px; }
.sheet-desc { font-size: 12px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; }
.share-link-box { background: #f5f8fa; border: 1px solid #e9edf1; border-radius: 11px; padding: 4px 10px; margin-bottom: 14px; }
.share-link-box input { width: 100%; height: 38px; border: 0; background: none; font-size: 12px; color: var(--ink-2); outline: none; }
.share-tip { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin: 12px 0 0; }
.more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
.more-item { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.mi-icon { width: 54px; height: 54px; border-radius: 14px; background: #f4f7f9; display: flex; align-items: center; justify-content: center; color: #475569; }
.mi-icon svg { width: 24px; height: 24px; }
.more-item:active .mi-icon { background: #e9eff4; }
.call-target-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.call-target {
  display: flex; align-items: center; gap: 12px; background: #f8fafb; border-radius: 13px;
  padding: 10px 12px; border: 1px solid #eef2f6; cursor: pointer;
}
.call-target .avatar { width: 42px; height: 42px; }
.call-target .ct-main { flex: 1; }
.call-target b { font-size: 14px; display: block; }
.call-target small { font-size: 11px; color: var(--muted); }
.call-target .mini-btn { background: var(--brand); color: #fff; }

.join-room-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #f1fbf6, #ffffff);
  border: 1px solid #cdeee0; border-radius: 14px; padding: 13px 14px;
}
.jrc-code {
  font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: 2px;
  font-size: 18px; color: var(--brand-deep); background: #fff; border-radius: 10px;
  padding: 8px 10px; border: 1px solid #dcf3e8;
}
.jrc-main { min-width: 0; }
.jrc-main b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jrc-main small { font-size: 11.5px; color: var(--muted); }
.role-grid.small .role-card { padding: 10px 6px 9px; }
.role-grid.small .role-card b { font-size: 13px; }
.share-roles { margin-bottom: 14px; }
.share-roles .role-card { padding: 9px 4px; }
.share-roles .role-card small { display: none; }
.join-role-locked {
  display: flex; align-items: center; gap: 8px;
  background: #f0fbf6; border: 1px solid #c9eedd; border-radius: 12px;
  padding: 11px 12px; margin: 2px 0 14px;
}
.jrl-icon { font-size: 19px; }
.jrl-text { font-size: 13px; color: #0a7a57; }
.jrl-text b { color: #067a56; font-size: 14px; }
.jrl-badge {
  margin-left: auto; font-size: 10.5px; color: #0a8a61;
  background: #dff6eb; border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}

.profile-edit { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.profile-edit .avatar { width: 62px; height: 62px; border-radius: 17px; font-size: 22px; }
.profile-fields { flex: 1; }
.profile-fields .field-label { margin-bottom: 6px; }

/* ============================== 图片预览 ============================== */
.image-viewer { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; align-items: center; justify-content: center; }
.image-viewer img { max-width: 100%; max-height: 88%; object-fit: contain; }
.iv-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px;
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16);
  color: #fff; display: flex; align-items: center; justify-content: center;
}
.iv-close svg { width: 22px; height: 22px; }

/* ============================== 通话 ============================== */
.call-view { position: fixed; inset: 0; z-index: 90; background: #10141a; color: #fff; overflow: hidden; }
#app .call-view { max-width: 520px; margin: 0 auto; }
.remote-video { width: 100%; height: 100%; object-fit: cover; background: #10141a; }
.remote-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(500px 400px at 50% 32%, #1d2a33 0%, #10141a 70%); text-align: center;
}
.call-avatar {
  width: 92px; height: 92px; border-radius: 28px; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #2dd4bf, #0f766e);
  margin-bottom: 16px;
}
.call-name { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.call-status { font-size: 13px; color: rgba(255, 255, 255, .55); }
.local-video {
  position: absolute; top: calc(74px + env(safe-area-inset-top, 0px)); right: 14px;
  width: 96px; height: 132px; border-radius: 12px; object-fit: cover; background: #1b232b;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .4); z-index: 3;
}
.call-topbar {
  position: absolute; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
  display: flex; align-items: center; justify-content: space-between; z-index: 4;
  background: linear-gradient(180deg, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0));
}
.call-mini { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; }
.call-mini svg { width: 20px; height: 20px; }
#callTimer { font-size: 13px; color: rgba(255, 255, 255, .72); font-variant-numeric: tabular-nums; }
.call-actions {
  position: absolute; left: 0; right: 0; bottom: calc(34px + var(--safe-b));
  display: flex; align-items: center; justify-content: center; gap: 34px; z-index: 4;
}
.call-act { border: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11px; }
.call-act .ca-circle {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center;
}
.call-act .ca-circle svg { width: 24px; height: 24px; }
.call-act.hangup .ca-circle { background: #ef4444; width: 64px; height: 64px; }
.call-act.off .ca-circle { background: rgba(255, 255, 255, .38); }

/* 来电 */
.incoming { position: fixed; inset: 0; z-index: 95; background: rgba(8, 14, 12, .55); display: flex; align-items: center; justify-content: center; }
.incoming-card {
  width: 290px; background: #fff; border-radius: 22px; padding: 26px 22px 20px; text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: .6 } to { transform: none; opacity: 1 } }
.incoming-card .call-avatar { width: 76px; height: 76px; margin: 0 auto 14px; color: #fff; }
.incoming-name { font-size: 18px; font-weight: 600; }
.incoming-sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 22px; }
.incoming-actions { display: flex; gap: 12px; }
.in-btn { flex: 1; height: 46px; border: 0; border-radius: 12px; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.in-btn svg { width: 18px; height: 18px; }
.in-btn.reject { background: #f1f5f9; color: #475569; }
.in-btn.accept { background: var(--brand); color: #fff; }

/* ============================== 对话框 / Toast ============================== */
.dialog { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.dialog-mask { position: absolute; inset: 0; background: rgba(10, 18, 15, .45); }
.dialog-card {
  position: relative; width: 290px; background: #fff; border-radius: 18px; padding: 22px 20px 16px;
  text-align: center; animation: pop .2s ease;
}
.dialog-card h3 { font-size: 16px; margin: 0 0 8px; }
.dialog-card p { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin: 0 0 18px; white-space: pre-wrap; }
.dialog-actions { display: flex; gap: 10px; }
.dlg-btn { flex: 1; height: 42px; border: 0; border-radius: 10px; font-size: 14px; background: #f1f5f9; color: var(--ink-2); }
.dlg-btn.primary { background: var(--brand); color: #fff; }

.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(16, 24, 21, .88); color: #fff; font-size: 13.5px; padding: 11px 18px;
  border-radius: 10px; z-index: 110; max-width: 80%; text-align: center; line-height: 1.6;
  animation: toastIn .16s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -46%) } to { opacity: 1; transform: translate(-50%, -50%) } }
