/* ============================================================
   PorcelainCharm 询盘系统 —— 前台样式
   复用主题 pc-skin.css 的设计令牌（宣纸米 / 钴蓝 / 印章红 / Fraunces）。
   所有类名 pci- 前缀，和主题的 pc- / qcn- 不冲突。
   z-index 约定：悬浮球 890（低于公告栏 901），抽屉 1500，
   主题的纸纹噪点在 2000 且 pointer-events:none，压在上面不影响交互。
   ============================================================ */

.pci-sec [hidden],
.pci-drawer [hidden],
.pci-standalone [hidden] { display: none !important; }

/* ---------- 1. 首页板块 ---------- */
.pci-sec {
  background: var(--pc-paper-2, #EFE8D8);
  border-top: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  padding: 76px 0 84px;
}

/* 桌面：左边一列摞「标题 / 佐证」，右边表单跨两行。
   窄屏（见文末媒体查询）解开定位，回到 DOM 顺序：标题 → 表单 → 佐证。 */
.pci-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 56px;
  row-gap: 0;
  align-items: start;
}
.pci-head     { grid-column: 1; grid-row: 1; }
.pci-proof    { grid-column: 1; grid-row: 2; }
.pci-formwrap { grid-column: 2; grid-row: 1 / span 2; }

.pci-head h2 {
  font-family: var(--pc-serif, Georgia, serif);
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.08;
  color: var(--pc-cobalt, #1C3D77);
  margin: 12px 0 0;
  font-weight: 600;
}
.pci-head h2 em { font-style: italic; color: var(--pc-seal, #A63B2A); }

.pci-lede {
  margin: 18px 0 0;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--pc-ink, #232838);
  max-width: 52ch;
}

.pci-points {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.pci-points li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.62;
  color: #4A4F5E;
}
.pci-points li::before {
  content: "";
  position: absolute;
  left: 0; top: .58em;
  width: 9px; height: 9px;
  background: var(--pc-seal, #A63B2A);
  transform: rotate(45deg);
}
.pci-points b { color: var(--pc-cobalt, #1C3D77); font-weight: 650; }

.pci-terms {
  list-style: none;
  margin: 22px 0 0;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .55);
  border-left: 3px solid var(--pc-gold, #D9A05B);
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #4A4F5E;
}

/* 下单流程三步。计数器手写而不是用 list-style，才能给序号上钴蓝衬线体 */
.pci-steps {
  list-style: none;
  counter-reset: pci-step;
  margin: 30px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  display: grid;
  gap: 16px;
}
.pci-steps li {
  counter-increment: pci-step;
  position: relative;
  padding-left: 40px;
  min-height: 26px;
}
.pci-steps li::before {
  content: counter(pci-step);
  position: absolute;
  left: 0; top: -2px;
  width: 27px; height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--pc-cobalt, #1C3D77);
  border-radius: 50%;
  font-family: var(--pc-serif, Georgia, serif);
  font-size: 13px;
  color: var(--pc-cobalt, #1C3D77);
}
.pci-steps b {
  display: block;
  font-size: 14.5px;
  color: var(--pc-cobalt, #1C3D77);
  font-weight: 650;
  margin-bottom: 2px;
}
.pci-steps span {
  display: block;
  font-size: 13.5px;
  line-height: 1.6;
  color: #4A4F5E;
}

.pci-alt {
  margin: 24px 0 0;
  font-size: 13.5px;
  color: #7E8494;
}

.pci-alt a { color: var(--pc-cobalt, #1C3D77); }

/* ---------- 2. 表单外壳 ---------- */
.pci-formwrap {
  background: #fff;
  border: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  border-top: 3px solid var(--pc-cobalt, #1C3D77);
  padding: 30px 32px 34px;
  box-shadow: 0 24px 60px -40px rgba(15, 35, 80, .5);
}
.pci-form-title {
  font-family: var(--pc-serif, Georgia, serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--pc-cobalt, #1C3D77);
  margin: 0 0 16px;
}

/* ---------- 3. 意图选择 ---------- */
.pci-intents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pci-chip {
  appearance: none;
  border: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  background: transparent;
  color: #4A4F5E;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 9px 13px;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.pci-chip:hover { border-color: var(--pc-cobalt, #1C3D77); color: var(--pc-cobalt, #1C3D77); }
.pci-chip.is-on {
  background: var(--pc-cobalt, #1C3D77);
  border-color: var(--pc-cobalt, #1C3D77);
  color: #F6F1E6;
}
.pci-chip:focus-visible { outline: 2px solid var(--pc-seal, #A63B2A); outline-offset: 2px; }

.pci-blurb {
  margin: 10px 0 18px;
  font-size: 13px;
  color: #7E8494;
  min-height: 1.2em;
}

/* ---------- 4. 商品上下文卡 ---------- */
.pci-piece {
  display: block;
  background: var(--pc-paper, #F6F1E6);
  border-left: 3px solid var(--pc-seal, #A63B2A);
  padding: 10px 12px;
  margin: 0 0 16px;
}
.pci-piece-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #7E8494;
  margin-bottom: 3px;
}
.pci-piece-name { font-size: 14px; color: var(--pc-cobalt, #1C3D77); font-weight: 600; }

/* ---------- 5. 字段 ---------- */
.pci-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.pci-field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pci-field.pci-full { grid-column: 1 / -1; }

.pci-field label {
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7E8494;
  font-weight: 600;
}
.pci-req { color: var(--pc-seal, #A63B2A); }
.pci-opt { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .7; }

.pci-field input,
.pci-field select,
.pci-field textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--pc-ink, #232838);
  background: var(--pc-paper, #F6F1E6);
  border: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  border-radius: 0;
  padding: 10px 12px;
  transition: border-color .18s, background .18s;
}
.pci-field textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.pci-field input:focus,
.pci-field select:focus,
.pci-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--pc-cobalt, #1C3D77);
  box-shadow: inset 0 0 0 1px var(--pc-cobalt, #1C3D77);
}
.pci-field.has-error input,
.pci-field.has-error textarea { border-color: var(--pc-seal, #A63B2A); }
.pci-err { font-size: 12px; color: var(--pc-seal, #A63B2A); }

/* 蜜罐：真人看不见也 tab 不到，机器人会填 */
.pci-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- 6. 提交 ---------- */
.pci-actions {
  margin: 20px 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pci-submit {
  appearance: none;
  border: 0;
  background: var(--pc-cobalt, #1C3D77);
  color: #F6F1E6;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 14px 26px;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.pci-submit .arr { display: inline-block; transition: transform .2s; }
.pci-submit:hover { background: var(--pc-cobalt-deep, #0F2350); }
.pci-submit:hover .arr { transform: translateX(4px); }
.pci-submit:disabled { opacity: .6; cursor: progress; }
.pci-promise { font-size: 12.5px; color: #7E8494; }

.pci-privacy { margin: 14px 0 0; font-size: 12px; color: #7E8494; line-height: 1.6; }
.pci-privacy a { color: var(--pc-cobalt, #1C3D77); }

.pci-result { margin: 14px 0 0; padding: 11px 13px; font-size: 14px; line-height: 1.5; }
.pci-result.is-bad { background: rgba(166, 59, 42, .08); border-left: 3px solid var(--pc-seal, #A63B2A); color: #8a3122; }
.pci-result.is-ok { background: rgba(28, 61, 119, .07); border-left: 3px solid var(--pc-cobalt, #1C3D77); }

/* ---------- 7. 成功态 ---------- */
.pci-done { text-align: center; padding: 34px 10px 26px; }
.pci-done-mark {
  width: 50px; height: 50px;
  margin: 0 auto 16px;
  border: 1px solid var(--pc-cobalt, #1C3D77);
  color: var(--pc-cobalt, #1C3D77);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.pci-done h4 {
  font-family: var(--pc-serif, Georgia, serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--pc-cobalt, #1C3D77);
  margin: 0 0 8px;
}
.pci-done p { margin: 0; color: #4A4F5E; font-size: 15px; line-height: 1.65; max-width: 40ch; margin-inline: auto; }

/* ---------- 8. 商品页入口 ---------- */
.pci-pdp { margin: 16px 0 4px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pci-pdp-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--pc-cobalt, #1C3D77);
  color: var(--pc-cobalt, #1C3D77);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  cursor: pointer;
  text-align: left;
  transition: background .2s, color .2s;
}
.pci-pdp-btn:hover { background: var(--pc-cobalt, #1C3D77); color: #F6F1E6; }
.pci-pdp-note { font-size: 12.5px; color: #7E8494; }

/* ---------- 9. 悬浮入口 ---------- */
.pci-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 890;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  appearance: none;
  border: 0;
  background: var(--pc-cobalt, #1C3D77);
  color: #F6F1E6;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 14px 34px -14px rgba(15, 35, 80, .8);
  transition: background .2s, transform .28s, opacity .28s;
}
.pci-launcher:hover { background: var(--pc-cobalt-deep, #0F2350); transform: translateY(-2px); }

/* 首页询盘板块自己在视野里时，悬浮球没必要再喊一遍 */
.pci-launcher.is-tucked {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}
.pci-launcher-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pc-gold, #D9A05B);
  box-shadow: 0 0 0 0 rgba(217, 160, 91, .7);
  animation: pci-pulse 2.6s infinite;
}
@keyframes pci-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 160, 91, .7); }
  70%  { box-shadow: 0 0 0 9px rgba(217, 160, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 160, 91, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .pci-launcher-dot { animation: none; }
}

/* ---------- 10. 抽屉 ---------- */
.pci-drawer { position: fixed; inset: 0; z-index: 1500; }
.pci-drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(15, 35, 80, .42);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .24s ease;
}
.pci-drawer.is-open .pci-drawer-scrim { opacity: 1; }

.pci-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--pc-paper, #F6F1E6);
  border-left: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  padding: 30px 34px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.19, 1, .22, 1);
  -webkit-overflow-scrolling: touch;
}
.pci-drawer.is-open .pci-drawer-panel { transform: none; }

.pci-drawer-x {
  position: absolute;
  top: 14px; right: 16px;
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  color: #7E8494;
  cursor: pointer;
  padding: 4px 8px;
}
.pci-drawer-x:hover { color: var(--pc-seal, #A63B2A); }

.pci-drawer-panel h3 {
  font-family: var(--pc-serif, Georgia, serif);
  font-size: 27px;
  font-weight: 600;
  color: var(--pc-cobalt, #1C3D77);
  margin: 10px 0 0;
}
.pci-drawer-lede { margin: 10px 0 20px; font-size: 14.5px; line-height: 1.65; color: #4A4F5E; }

body.pci-locked { overflow: hidden; }

/* 抽屉里没有白卡片外壳，字段直接排在纸底上 */
.pci-drawer .pci-field input,
.pci-drawer .pci-field select,
.pci-drawer .pci-field textarea { background: #fff; }

/* ---------- 11. 短代码独立表单 ---------- */
.pci-standalone {
  background: #fff;
  border: 1px solid var(--pc-hairline, rgba(28, 61, 119, .22));
  border-top: 3px solid var(--pc-cobalt, #1C3D77);
  padding: 26px 28px 30px;
  margin: 24px 0;
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1080px) {
  /* 单列：解开桌面的行列定位，让三块回到 DOM 顺序（标题 → 表单 → 佐证），
     表单就在第一屏文案之后，不用滚过全部卖点才够得着。 */
  .pci-shell { grid-template-columns: 1fr; row-gap: 34px; }
  .pci-head, .pci-formwrap, .pci-proof { grid-column: 1; grid-row: auto; }
  .pci-lede { max-width: none; }
  .pci-points { margin-top: 0; }
}

@media (max-width: 760px) {
  .pci-sec { padding: 56px 0 64px; }
  .pci-formwrap { padding: 24px 20px 28px; }
  .pci-grid { grid-template-columns: 1fr; }
  .pci-drawer-panel { padding: 26px 20px 36px; }
  .pci-launcher {
    right: 14px;
    bottom: 14px;
    padding: 12px 17px;
    font-size: 13.5px;
  }
  .pci-actions { gap: 10px; }
  .pci-submit { width: 100%; text-align: center; }
  .pci-promise { text-align: center; width: 100%; }
}

/* 表单里的 select 在 iOS 上默认字号会触发缩放，锁到 16px 以上 */
@media (max-width: 480px) {
  .pci-field input,
  .pci-field select,
  .pci-field textarea { font-size: 16px; }
}
