/* ============================================================
   PorcelainCharm 售前顾问 —— 欧美主流电商客服视觉（Intercom / Gorgias 一路）
   白卡 + 大圆角 + 柔和投影 + 系统无衬线；强调色沿用主题钴蓝
   ============================================================ */
:root {
  --pcc-accent: var(--pc-cobalt, #1C3D77);
  --pcc-accent-deep: var(--pc-cobalt-deep, #0F2350);
  --pcc-ink: #1a1d26;
  --pcc-body: #3f4453;
  --pcc-dim: #7b8090;
  --pcc-line: #e6e8ee;
  --pcc-bot: #f3f4f7;
  --pcc-bg: #ffffff;
  --pcc-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pcc-shadow: 0 24px 64px rgba(15, 35, 80, .18), 0 2px 8px rgba(15, 35, 80, .08);
  --pcc-radius: 20px;
}

/* ---------- 首页板块 ---------- */
.pcc-sec { padding: 72px 0 88px; background: var(--pc-paper-2, #EFE8D8); }
.pcc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 56px; align-items: center; }
.pcc-copy h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; margin: 10px 0 18px; }
.pcc-copy h2 em { font-style: italic; color: var(--pcc-accent); }
.pcc-lede { font-size: 17px; line-height: 1.6; color: var(--pcc-body); max-width: 520px; margin: 0 0 28px; }
.pcc-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pcc-points li { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: baseline; padding-left: 26px; position: relative; font-family: var(--pcc-sans); }
.pcc-points li::before { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--pcc-accent); box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px var(--pcc-accent); }
.pcc-points b { font-weight: 600; color: var(--pcc-ink); }
.pcc-points span { color: var(--pcc-body); font-size: 15px; grid-column: 1 / -1; }
@media (min-width: 900px) { .pcc-points li { grid-template-columns: 200px 1fr; } .pcc-points span { grid-column: auto; } }
.pcc-inline-wrap { min-width: 0; }
.pcc-inline { height: 600px; max-height: 82vh; }

/* ---------- 悬浮入口 ---------- */
.pcc-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 9990;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 20px 0 16px; height: 52px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pcc-accent); color: #fff; font: 600 15px/1 var(--pcc-sans);
  box-shadow: 0 10px 30px rgba(15, 35, 80, .28);
  transition: transform .2s ease, box-shadow .2s ease, opacity .25s ease, background .2s ease;
}
.pcc-launcher svg { width: 22px; height: 22px; }
.pcc-launcher:hover { transform: translateY(-2px); background: var(--pcc-accent-deep); box-shadow: 0 14px 34px rgba(15, 35, 80, .32); }
.pcc-launcher.is-tucked { opacity: 0; pointer-events: none; transform: translateY(12px); }
.pcc-launcher.is-open span { display: none; }
.pcc-launcher.is-open { padding: 0; width: 52px; justify-content: center; }
@media (max-width: 640px) { .pcc-launcher { right: 16px; bottom: 16px; height: 48px; } }

/* ---------- 悬浮面板 ---------- */
.pcc-panel { position: fixed; right: 22px; bottom: 86px; z-index: 9991; width: 400px; max-width: calc(100vw - 32px); }
.pcc-panel[hidden] { display: none; }
.pcc-panel-box { height: min(640px, calc(100vh - 120px)); border-radius: var(--pcc-radius); overflow: hidden; box-shadow: var(--pcc-shadow); animation: pcc-pop .22s ease-out; }
@keyframes pcc-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .pcc-panel { right: 0; bottom: 0; left: 0; width: auto; max-width: none; }
  .pcc-panel-box { height: 100dvh; border-radius: 0; }
}

/* ---------- 对话卡（内嵌与悬浮共用） ---------- */
.pcc-chat { display: flex; flex-direction: column; height: 100%; background: var(--pcc-bg); font-family: var(--pcc-sans); color: var(--pcc-ink); border-radius: inherit; }
.pcc-inline .pcc-chat { border-radius: var(--pcc-radius); box-shadow: var(--pcc-shadow); border: 1px solid rgba(255,255,255,.7); }
.pcc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--pcc-line); background: #fff; }
.pcc-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--pcc-accent), #3C67B8); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; position: relative; flex: none; }
.pcc-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.pcc-head-txt { min-width: 0; flex: 1; }
.pcc-head-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.pcc-head-status { font-size: 12px; color: var(--pcc-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcc-x { display: none; border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--pcc-dim); font-size: 22px; line-height: 1; }
.pcc-x:hover { background: var(--pcc-bot); color: var(--pcc-ink); }
.pcc-panel .pcc-x { display: inline-grid; place-items: center; }

.pcc-body { flex: 1; overflow-y: auto; padding: 18px 16px 6px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.pcc-msg { display: flex; margin: 0 0 12px; animation: pcc-in .18s ease-out; }
@keyframes pcc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pcc-msg.u { justify-content: flex-end; }
.pcc-bubble { max-width: 84%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; white-space: pre-wrap; }
.pcc-msg.a .pcc-bubble { background: var(--pcc-bot); color: var(--pcc-ink); border-bottom-left-radius: 6px; }
.pcc-msg.u .pcc-bubble { background: var(--pcc-accent); color: #fff; border-bottom-right-radius: 6px; }
.pcc-msg.sys .pcc-bubble { background: #ecfdf3; color: #166534; font-size: 13px; border-radius: 12px; max-width: 100%; }
.pcc-msg.err .pcc-bubble { background: #fef2f2; color: #991b1b; font-size: 13px; border-radius: 12px; max-width: 100%; }
.pcc-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pcc-msg.a .pcc-bubble a { color: var(--pcc-accent); font-weight: 500; }
.pcc-bubble ul { margin: 6px 0 0; padding-left: 18px; }
.pcc-bubble li { margin: 2px 0; }
.pcc-typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.pcc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa0ae; animation: pcc-dot 1.2s infinite ease-in-out; }
.pcc-typing i:nth-child(2) { animation-delay: .15s; } .pcc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pcc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

.pcc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 16px 10px; }
.pcc-chip { border: 1px solid var(--pcc-accent); background: #fff; color: var(--pcc-accent); border-radius: 999px; padding: 7px 13px; font: 500 13px/1.2 var(--pcc-sans); cursor: pointer; transition: background .15s, color .15s; text-align: left; }
.pcc-chip:hover { background: var(--pcc-accent); color: #fff; }

.pcc-lead { margin: 4px 16px 12px; padding: 14px; border: 1px solid var(--pcc-line); border-radius: 14px; background: #fff; box-shadow: 0 4px 14px rgba(15,35,80,.06); }
.pcc-lead-title { font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.pcc-lead-why { font-size: 13px; color: var(--pcc-body); margin: 0 0 10px; line-height: 1.45; }
.pcc-lead input { width: 100%; box-sizing: border-box; border: 1px solid #d5d8e0; border-radius: 10px; padding: 10px 12px; font: 14px var(--pcc-sans); margin-bottom: 8px; background: #fff; color: var(--pcc-ink); }
.pcc-lead input:focus { outline: 2px solid var(--pcc-accent); outline-offset: -1px; border-color: transparent; }
.pcc-lead-actions { display: flex; align-items: center; gap: 10px; }
.pcc-lead button { border: 0; border-radius: 10px; background: var(--pcc-accent); color: #fff; padding: 10px 16px; font: 600 14px var(--pcc-sans); cursor: pointer; }
.pcc-lead button:hover { background: var(--pcc-accent-deep); }
.pcc-lead button:disabled { opacity: .6; cursor: default; }
.pcc-lead .pcc-skip { border: 0; background: transparent; color: var(--pcc-dim); font: 13px var(--pcc-sans); cursor: pointer; padding: 6px; }
.pcc-lead-err { color: #b42318; font-size: 12.5px; margin: -4px 0 8px; }

.pcc-foot { border-top: 1px solid var(--pcc-line); padding: 10px 12px 10px; background: #fff; }
.pcc-form { display: flex; align-items: flex-end; gap: 8px; }
.pcc-input { flex: 1; resize: none; border: 1px solid #d5d8e0; border-radius: 14px; padding: 11px 14px; font: 14.5px/1.4 var(--pcc-sans); color: var(--pcc-ink); background: #fff; max-height: 120px; min-height: 44px; box-sizing: border-box; }
.pcc-input:focus { outline: 2px solid var(--pcc-accent); outline-offset: -1px; border-color: transparent; }
.pcc-send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--pcc-accent); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.pcc-send:hover { background: var(--pcc-accent-deep); transform: translateY(-1px); }
.pcc-send:disabled { background: #c3c8d4; cursor: default; transform: none; }
.pcc-send svg { width: 20px; height: 20px; }
.pcc-disclaimer { font-size: 11.5px; color: var(--pcc-dim); margin: 8px 4px 0; line-height: 1.4; }
.pcc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 1080px) {
  .pcc-grid { grid-template-columns: 1fr; gap: 32px; }
  .pcc-inline { height: 520px; }
  .pcc-sec { padding: 56px 0 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .pcc-msg, .pcc-panel-box { animation: none; }
  .pcc-typing i { animation: none; opacity: .7; }
}

/* v1.1 —— 回答下方的 👍/👎 */
.pcc-rate{display:flex;gap:4px;margin:2px 0 0 6px;opacity:0;transition:opacity .15s}
.pcc-msg.a:hover .pcc-rate,.pcc-msg.a:last-child .pcc-rate,.pcc-rate.is-rated{opacity:1}
.pcc-rate-btn{border:0;background:transparent;padding:3px;border-radius:6px;color:#9a9a9a;cursor:pointer;line-height:0}
.pcc-rate-btn:hover{background:rgba(0,0,0,.06);color:#333}
.pcc-rate-btn svg{width:15px;height:15px}
.pcc-rate span{font-size:11px;color:#8a8a8a}
.pcc-disclaimer a{color:inherit;text-decoration:underline}
.pcc-msg.a{flex-wrap:wrap}
.pcc-rate{flex-basis:100%}
