/* 宇霖AI·数字名片 —— 名片页样式
   两层视觉：① 名片本体跟随商家模板配色（商家自有品牌）；② 客服对话框与外壳用宇霖统一的深空语言。
   这样任何模板下，客服都既不突兀也不刺眼——与宇霖科技官网同一套质感。 */
body.card-page {
  background:
    radial-gradient(900px 520px at 78% -6%, rgba(139, 124, 246, .16), transparent 60%),
    radial-gradient(760px 460px at 12% 6%, rgba(34, 211, 238, .12), transparent 58%),
    linear-gradient(180deg, #05070f, #0a0f1e 72%, #05070f);
  margin: 0;
  padding: 0 0 96px;
  min-height: 100vh;
}
.phone {
  max-width: 440px; margin: 0 auto; min-height: 100vh; background: var(--c-bg);
  color: var(--c-text); position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 24px 70px rgba(0, 0, 0, .55);
}
@media (max-width: 460px) { .phone { max-width: 100%; box-shadow: none; } }

/* ---------- 头部 ---------- */
.c-header {
  position: relative; padding: 26px 20px 52px;
  background: linear-gradient(140deg, var(--c-headerFrom), var(--c-headerTo));
  color: var(--c-headerText);
}
.c-header::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.06));
  pointer-events: none;
}
.c-brandrow { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .92; }
.c-brandrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.c-top { display: flex; gap: 14px; align-items: center; margin-top: 20px; }
.c-avatar {
  width: 66px; height: 66px; border-radius: 20px; flex: 0 0 66px; display: grid; place-items: center;
  font-size: 26px; font-weight: 700; background: rgba(255,255,255,.9); color: var(--c-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,.14); overflow: hidden;
}
.c-avatar img { width: 100%; height: 100%; object-fit: cover; }
.c-name { font-size: 22px; font-weight: 700; letter-spacing: .3px; line-height: 1.3; }
.c-title { font-size: 13px; opacity: .92; margin-top: 3px; }
.c-verified { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 7px; border-radius: 20px; background: rgba(255,255,255,.22); margin-left: 6px; vertical-align: 3px; }
.c-tagline {
  margin-top: 18px; display: inline-block; padding: 6px 13px; border-radius: 20px;
  background: rgba(255,255,255,.18); font-size: 13px; font-weight: 600; backdrop-filter: blur(4px);
}

/* ---------- 主体卡片 ---------- */
.c-body { padding: 0 14px 20px; margin-top: -38px; position: relative; z-index: 2; }
.c-block {
  background: var(--c-card); border-radius: 16px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.c-block h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.c-block h3::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--c-accent); }
.c-intro { font-size: 14px; line-height: 1.75; color: var(--c-text); white-space: pre-wrap; }
.c-services { display: flex; flex-wrap: wrap; gap: 7px; }
.c-services span {
  font-size: 12.5px; padding: 5px 11px; border-radius: 8px;
  background: color-mix(in srgb, var(--c-primary) 9%, transparent); color: var(--c-primary); font-weight: 600;
}
.c-info-row { display: flex; gap: 10px; padding: 9px 0; font-size: 13.5px; border-bottom: 1px dashed var(--c-line); align-items: flex-start; }
.c-info-row:last-child { border-bottom: 0; }
.c-info-row .k { color: var(--c-sub); flex: 0 0 58px; }
.c-info-row .v { flex: 1; word-break: break-all; }

/* ---------- 产品 ---------- */
.c-products { display: grid; gap: 10px; }
.c-prod {
  display: flex; gap: 12px; padding: 11px; border-radius: 12px;
  background: color-mix(in srgb, var(--c-primary) 4%, var(--c-card));
  border: 1px solid var(--c-line); cursor: pointer; transition: .16s;
}
.c-prod:active { transform: scale(.99); }
.c-prod .pic {
  width: 52px; height: 52px; border-radius: 11px; flex: 0 0 52px; display: grid; place-items: center;
  font-size: 24px; background: color-mix(in srgb, var(--c-primary) 10%, transparent);
}
.c-prod .meta { flex: 1; min-width: 0; }
.c-prod .nm { font-size: 14.5px; font-weight: 600; }
.c-prod .ds { font-size: 12.5px; color: var(--c-sub); margin-top: 2px; }
.c-prod .pr { font-size: 15px; font-weight: 700; color: var(--c-primary); white-space: nowrap; }
.c-prod .pr small { font-size: 11px; font-weight: 500; color: var(--c-sub); }
.c-prod .pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; }
.c-prod.has-img .pic { width: 68px; height: 68px; flex: 0 0 68px; font-size: 0; overflow: hidden; }
.bigpic { position: fixed; inset: 0; background: rgba(0,0,0,.86); display: none; place-items: center; z-index: 999; padding: 18px; }
.bigpic.on { display: grid; }
.bigpic img { max-width: 92vw; max-height: 80vh; border-radius: 14px; display: block; }
.bigpic .cap { color: #fff; font-size: 15px; margin-top: 14px; text-align: center; font-weight: 600; }
.bigpic .close { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 6px; text-align: center; }

/* ---------- 二维码 ---------- */
.c-qrbox { text-align: center; }
.c-qrbox .qr { width: 156px; height: 156px; margin: 0 auto 8px; background: #fff; border-radius: 12px; padding: 6px; }
.c-qrbox p { margin: 0; font-size: 12.5px; color: var(--c-sub); }

/* ---------- 功能模块广场（客户自选添加） ---------- */
.c-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c-mod {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.35; text-align: left; font-family: inherit;
  border: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-primary) 4%, var(--c-card));
  color: var(--c-sub); min-width: 0;
}
.c-mod i { font-style: normal; margin-left: auto; white-space: nowrap; }
.c-mod .ok, .c-mod .tag { font-size: 10px; padding: 2px 6px; border-radius: 20px; }
.c-mod.on { color: var(--c-primary); font-weight: 600; border-color: color-mix(in srgb, var(--c-primary) 32%, transparent); background: color-mix(in srgb, var(--c-primary) 10%, transparent); }
.c-mod.on .ok { background: color-mix(in srgb, var(--c-primary) 18%, transparent); }
.c-mod .ph { font-size: 10px; opacity: .78; }
.c-mod.add { cursor: pointer; border-style: dashed; color: var(--c-primary); transition: .16s; }
.c-mod.add .tag { background: color-mix(in srgb, var(--c-primary) 16%, transparent); }
.c-mod.add:hover { border-style: solid; background: color-mix(in srgb, var(--c-primary) 12%, transparent); }
.c-mod.add:active { transform: scale(.97); }
.c-modnote { margin: 9px 0 0; font-size: 11px; line-height: 1.6; color: var(--c-sub); opacity: .85; }

/* ---------- 底部固定操作 ---------- */
.c-actions {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 440px;
  display: flex; gap: 8px; padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  background: rgba(8, 12, 22, .9); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(64,156,255,.16); z-index: 40;
}
@media (max-width: 460px) { .c-actions { max-width: 100%; } }
.c-actions .btn { flex: 1; }
.c-actions .btn.icon-only { flex: 0 0 52px; padding: 0; }

/* ================= 悬浮智能客服标识 ================= */
.svc-dock { position: fixed; right: 16px; bottom: 84px; z-index: 45; display: flex; align-items: flex-end; gap: 10px; }
@media (max-width: 460px) { .svc-dock { right: 14px; } }
.svc-fab {
  position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; flex: 0 0 56px;
  background: linear-gradient(140deg, var(--c-primary), var(--c-primaryDark));
  color: #fff; display: grid; place-items: center; transition: .22s;
  box-shadow: 0 10px 26px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.12) inset;
  animation: svc-breathe 3.2s ease-in-out infinite;
}
.svc-fab:active { transform: scale(.94); }
.svc-fab .svc-av { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.svc-fab .svc-online {
  position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%;
  background: #34d399; border: 2px solid #0a0f1e; box-shadow: 0 0 8px rgba(52,211,153,.9);
}
.svc-fab.is-off .svc-online { background: #94a3b8; box-shadow: none; }
.svc-fab .svc-dot {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 20px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #0a0f1e;
}
@keyframes svc-breathe {
  0%, 100% { box-shadow: 0 10px 26px rgba(0,0,0,.42), 0 0 0 0 rgba(255,255,255,.0); }
  50% { box-shadow: 0 10px 26px rgba(0,0,0,.42), 0 0 0 9px rgba(255,255,255,.06); }
}
.svc-hint {
  max-width: 200px; padding: 10px 13px; border-radius: 14px 14px 4px 14px;
  background: rgba(13, 20, 38, .95); border: 1px solid rgba(64,156,255,.28);
  color: #e6f0ff; font-size: 12.5px; line-height: 1.5; cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: svc-pop .3s ease;
}
.svc-hint b { display: block; font-size: 12px; color: #22d3ee; margin-bottom: 2px; }
.svc-hint span { color: #b9c9e2; }
@keyframes svc-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= 对话框 ================= */
.svc-mask { position: fixed; inset: 0; z-index: 55; background: rgba(3,6,14,.5); backdrop-filter: blur(2px); display: none; }
.svc-mask.show { display: block; }
.svc-panel {
  position: fixed; z-index: 60; display: none; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #0d1426, #080d19);
  border: 1px solid rgba(64,156,255,.26);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  /* 移动端：底部抽屉 */
  left: 0; right: 0; bottom: 0; height: 78vh; border-radius: 20px 20px 0 0; border-bottom: 0;
}
.svc-panel.show { display: flex; animation: svc-up .3s cubic-bezier(.2,.9,.3,1); }
@keyframes svc-up { from { transform: translateY(100%); } to { transform: none; } }
.svc-head {
  padding: 14px 16px; display: flex; align-items: center; gap: 11px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primaryDark)); color: #fff;
}
.svc-head .av {
  width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.2);
  display: grid; place-items: center; font-size: 15px; font-weight: 800; flex: 0 0 36px; position: relative;
}
.svc-head .av::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: #34d399; border: 2px solid rgba(0,0,0,.35);
}
.svc-head .hmeta { flex: 1; min-width: 0; }
.svc-head b { font-size: 15px; display: block; }
.svc-head small { display: block; font-size: 11.5px; opacity: .92; }
.svc-head .x { background: rgba(255,255,255,.14); border: 0; color: #fff; font-size: 16px; cursor: pointer; width: 30px; height: 30px; border-radius: 9px; line-height: 1; }
.svc-head .x:hover { background: rgba(255,255,255,.26); }
.svc-list {
  flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 11px;
  background: radial-gradient(600px 300px at 80% 0%, rgba(34,211,238,.06), transparent 60%);
}
.svc-list::-webkit-scrollbar { width: 5px; }
.svc-list::-webkit-scrollbar-thumb { background: rgba(64,156,255,.3); border-radius: 5px; }
.svc-quick { padding: 9px 12px 10px; display: flex; gap: 7px; overflow-x: auto; border-top: 1px solid rgba(64,156,255,.14); }
.svc-quick:empty { display: none; }
.svc-quick button {
  white-space: nowrap; padding: 6px 12px; border-radius: 20px; border: 1px solid rgba(64,156,255,.28);
  background: rgba(34,211,238,.08); font-size: 12.5px; color: #b9e9f5; cursor: pointer; transition: .18s;
}
.svc-quick button:hover { border-color: #22d3ee; color: #22d3ee; }
.svc-input { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(64,156,255,.14); }
.svc-input input {
  flex: 1; padding: 11px 14px; border-radius: 22px; border: 1px solid rgba(64,156,255,.22);
  background: rgba(4,8,18,.7); color: #e6f0ff; outline: none;
}
.svc-input input:focus { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.12); }
.svc-input input::placeholder { color: #64789a; }
.svc-input button {
  width: 44px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(120deg, #22d3ee, #55e6ff); color: #04121a; font-size: 16px; font-weight: 700;
  box-shadow: 0 0 20px rgba(34,211,238,.3);
}
.svc-footnote { padding: 0 14px 9px; }
.svc-footnote .tiny { color: #64789a; font-size: 11px; }
.bubble { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.62; white-space: pre-wrap; word-break: break-word; }
.bubble.bot { align-self: flex-start; background: rgba(255,255,255,.06); border: 1px solid rgba(64,156,255,.16); color: #e6f0ff; border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: linear-gradient(120deg, #22d3ee, #4dd8f0); color: #04121a; font-weight: 500; border-bottom-right-radius: 5px; }
.bubble .src { display: block; margin-top: 7px; font-size: 11px; color: #7f93b3; border-top: 1px dashed rgba(64,156,255,.2); padding-top: 6px; }
.bubble .handoff-btns { display: flex; gap: 7px; margin-top: 9px; }
.bubble .handoff-btns button {
  flex: 1; padding: 9px; border-radius: 10px; border: 0; font-size: 13px; font-weight: 700; cursor: pointer;
  background: linear-gradient(120deg, #22d3ee, #55e6ff); color: #04121a;
}
.bubble .handoff-btns button.ghostb { background: rgba(255,255,255,.08); color: #e6f0ff; border: 1px solid rgba(64,156,255,.24); }

/* 桌面端：右下角对话框（贴着名片右侧，不铺满屏） */
@media (min-width: 561px) {
  .svc-panel {
    left: auto; right: calc(50% - 236px); bottom: 96px; width: 384px; height: 70vh; max-height: 640px;
    border-radius: 18px; border-bottom: 1px solid rgba(64,156,255,.26);
  }
  .svc-panel.show { animation: svc-in .26s cubic-bezier(.2,.9,.3,1); }
  @keyframes svc-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
  .svc-mask { display: none !important; }
}

/* ---------- 弹层（留言） ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(3,6,14,.62); backdrop-filter: blur(3px); display: none; align-items: flex-end; justify-content: center; }
.sheet.show { display: flex; }
.sheet .inner {
  background: linear-gradient(180deg, #0d1426, #080d19); color: #e6f0ff;
  width: 100%; max-width: 440px; border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  border: 1px solid rgba(64,156,255,.24); border-bottom: 0;
  animation: svc-up .28s cubic-bezier(.2,.9,.3,1);
}
.sheet h3 { margin: 0 0 14px; font-size: 17px; }
.sheet .close { float: right; background: transparent; border: 0; font-size: 22px; color: #7f93b3; cursor: pointer; line-height: 1; }
.sheet .field label { color: #b9c9e2; }
.sheet .btn.ghost { background: rgba(255,255,255,.05); color: #e6f0ff; border-color: rgba(64,156,255,.3); }

/* ---------- 角标（免费档带宇霖） ---------- */
.c-credit { text-align: center; padding: 14px 0 6px; font-size: 11.5px; color: var(--c-sub); }
.c-credit b { color: var(--c-primary); }

/* ---------- 布局微调 ---------- */
.phone[data-layout="poster"] .c-header { padding: 44px 20px 64px; }
.phone[data-layout="poster"] .c-name { font-size: 25px; }
.phone[data-layout="poster"] .c-avatar { width: 78px; height: 78px; flex-basis: 78px; border-radius: 26px; font-size: 30px; }
.phone[data-layout="business"] .c-block { border-radius: 8px; box-shadow: none; border: 1px solid var(--c-line); }
.phone[data-layout="business"] .c-header { padding-bottom: 44px; }
.phone[data-layout="business"] .c-name { font-weight: 600; letter-spacing: 1px; }
.phone[data-layout="warm"] .c-block { border-radius: 22px; }
.phone[data-layout="warm"] .c-avatar { border-radius: 50%; }
.phone[data-layout="warm"] .c-tagline { border-radius: 14px; }
.phone[data-layout="dark"] .c-body { margin-top: -34px; }
.phone[data-layout="dark"] .c-block { border: 1px solid rgba(255,255,255,.08); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.phone[data-layout="dark"] .c-info-row { border-color: rgba(255,255,255,.1); }
.phone[data-layout="dark"] .c-actions { background: rgba(10, 8, 7, .92); border-top-color: rgba(255,255,255,.1); }

/* 加载骨架 */
.skeleton { padding: 40px 20px; text-align: center; color: #7f93b3; }
.skeleton .sp { width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid rgba(255,255,255,.14); border-top-color: #22d3ee; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
