/* 选型向导 selector.css */
.sw-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 18px 60px; }
.sw-hero { text-align: center; padding: 22px 0 8px; }
.sw-hero h1 { font-size: 30px; font-weight: 700; color: #12203a; margin: 0 0 8px; }
.sw-hero p { color: #7a8496; font-size: 14px; margin: 0; }

/* AI 区 */
.sw-ai { margin: 22px 0 10px; }
.sw-ai-box {
  display: flex; gap: 10px; align-items: stretch;
  background: linear-gradient(135deg, #eef5ff, #f7fbff);
  border: 1px solid #dbe7fb; border-radius: 14px; padding: 12px;
}
.sw-ai-box textarea {
  flex: 1; resize: none; border: 1px solid #d5e0f2; border-radius: 10px;
  padding: 11px 13px; font-size: 14px; line-height: 1.5; outline: none; font-family: inherit;
}
.sw-ai-box textarea:focus { border-color: #2b7cff; box-shadow: 0 0 0 3px rgba(43,124,255,.12); }
.sw-ai-box button {
  flex: 0 0 auto; align-self: stretch; min-width: 132px; cursor: pointer;
  border: 0; border-radius: 10px; color: #fff; font-size: 15px; font-weight: 600;
  background: linear-gradient(135deg, #2b7cff, #17b0ff);
}
.sw-ai-box button:hover { filter: brightness(1.05); }
.sw-ai-box button:disabled { opacity: .6; cursor: default; }
.sw-ai-reply {
  margin-top: 12px; padding: 14px 16px; background: #f6faff;
  border: 1px solid #e2ecfb; border-left: 4px solid #2b7cff; border-radius: 10px;
  font-size: 14px; line-height: 1.8; color: #26374f;
}
.sw-loading { padding: 16px; color: #8a94a6; text-align: center; }

/* 向导 */
.sw-wizard { margin: 26px 0 8px; }
.sw-step { margin-bottom: 18px; }
.sw-step h3 { font-size: 15px; font-weight: 600; color: #12203a; margin: 0 0 10px; display: flex; align-items: center; }
.sw-step h3 i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-right: 8px; border-radius: 50%;
  background: #2b7cff; color: #fff; font-size: 12px; font-style: normal;
}
.sw-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sw-chip {
  padding: 8px 18px; border-radius: 999px; border: 1px solid #d9e2f0;
  background: #fff; color: #3a4a63; font-size: 14px; cursor: pointer; transition: .15s;
}
.sw-chip:hover { border-color: #9dc2ff; color: #2b7cff; }
.sw-chip.active { background: #2b7cff; border-color: #2b7cff; color: #fff; }

/* 结果 */
.sw-result-wrap { margin-top: 30px; }
.sw-result-title { font-size: 18px; font-weight: 700; color: #12203a; margin: 0 0 16px; }
.sw-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sw-card {
  border: 1px solid #e6ecf5; border-radius: 14px; padding: 18px; background: #fff;
  display: flex; flex-direction: column; transition: .2s;
}
.sw-card:hover { box-shadow: 0 12px 30px rgba(20,60,130,.1); transform: translateY(-2px); }
.sw-card-h { margin-bottom: 8px; }
.sw-region { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eaf2ff; color: #2b7cff; font-size: 12px; }
.sw-name { font-size: 16px; font-weight: 600; color: #16233c; margin-bottom: 6px; }
.sw-group { font-size: 12px; color: #93a0b5; margin-bottom: 10px; min-height: 16px; }
.sw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sw-tags span { font-size: 12px; color: #64748b; background: #f2f5f9; border-radius: 6px; padding: 2px 8px; }
.sw-card-f { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.sw-price { color: #ff5a1f; font-size: 22px; font-weight: 700; }
.sw-price em { font-size: 13px; font-style: normal; font-weight: 400; color: #ff8a5c; }
.sw-buy {
  display: inline-block; padding: 9px 20px; border-radius: 9px; color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 600; background: linear-gradient(135deg, #2b7cff, #17b0ff);
}
.sw-buy:hover { filter: brightness(1.06); color: #fff; }
.sw-empty { grid-column: 1 / -1; padding: 26px; text-align: center; color: #93a0b5; background: #f8fafd; border-radius: 12px; }

/* 站内购买弹窗（与活动页同款样式） */
.actp-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.actp-modal[hidden] { display: none; }
.actp-modal-mask { position: absolute; inset: 0; background: rgba(10, 18, 38, .58); backdrop-filter: blur(2px); }
.actp-modal-box { position: relative; display: flex; flex-direction: column; width: 1100px; max-width: 100%; height: 88vh; background: #fff; border-radius: 14px; box-shadow: 0 30px 80px rgba(8, 20, 50, .35); overflow: hidden; }
.actp-modal-head { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; padding: 14px 20px; border-bottom: 1px solid #e6ecf5; background: #f8fafd; }
.actp-modal-title { flex: 1; font-size: 16px; font-weight: 600; color: #12203a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actp-modal-newwin { flex: 0 0 auto; color: #2b7cff; font-size: 13px; text-decoration: none; }
.actp-modal-newwin:hover { text-decoration: underline; }
.actp-modal-close { flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #8a94a6; font-size: 22px; line-height: 1; cursor: pointer; }
.actp-modal-close:hover { background: #eef2f9; color: #333; }
.actp-modal-body { position: relative; flex: 1; min-height: 0; }
.actp-modal-frame { width: 100%; height: 100%; border: 0; display: block; }
.actp-modal-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa4b5; font-size: 14px; background: #fff; }

@media screen and (max-width: 992px) {
  .sw-results { grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 768px) {
  .sw-hero h1 { font-size: 24px; }
  .sw-ai-box { flex-direction: column; }
  .sw-ai-box button { min-height: 44px; }
  .sw-results { grid-template-columns: 1fr; }
  .actp-modal { padding: 0; }
  .actp-modal-box { width: 100%; height: 100%; border-radius: 0; }
}

/* ===== AI 多轮对话 ===== */
#swAIResult { display: flex; flex-direction: column; }
.sw-msg { margin: 0 0 10px; padding: 12px 16px; border-radius: 12px; line-height: 1.7; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.sw-msg-u { align-self: flex-end; max-width: 82%; background: linear-gradient(135deg,#2b7cff,#17b0ff); color: #fff; border-bottom-right-radius: 4px; }
.sw-msg-a { align-self: flex-start; max-width: 94%; background: #fff; border: 1px solid #e6edf7; color: #26344a; border-bottom-left-radius: 4px; box-shadow: 0 2px 10px rgba(30,60,120,.06); }
.sw-chat { display: flex; gap: 10px; margin-top: 6px; }
.sw-chat input { flex: 1; height: 46px; border: 1px solid #dbe4f0; border-radius: 10px; padding: 0 14px; font-size: 14px; outline: none; box-sizing: border-box; }
.sw-chat input:focus { border-color: #2b7cff; box-shadow: 0 0 0 3px rgba(43,124,255,.12); }
.sw-chat button { height: 46px; padding: 0 24px; border: 0; border-radius: 10px; background: linear-gradient(135deg,#2b7cff,#17b0ff); color: #fff; font-size: 15px; cursor: pointer; }
.sw-chat button:hover { filter: brightness(1.05); }
.sw-chat button:disabled { opacity: .6; cursor: default; }
.sw-ai-reply { padding: 14px 16px; background: #fff; border: 1px solid #e6edf7; border-radius: 12px; line-height: 1.8; }
@media screen and (max-width: 768px) {
  .sw-msg-u { max-width: 92%; }
  .sw-chat button { padding: 0 16px; }
}

/* 机型卡整卡可点，打开购买弹窗 */
.sw-card { cursor: pointer; }

/* 购买弹窗 · 手机端适配 */
@media screen and (max-width: 768px) {
  .actp-modal-head { padding: 10px 12px; }
  .actp-modal-title { font-size: 15px; }
  .actp-modal-newwin { display: none; }
  .actp-modal-close { width: 42px; height: 42px; font-size: 26px; }
}

/* 卡片刻度：IP 类型 */
.sw-tags .sw-tag-ip { background: #eaf3ff !important; color: #2b7cff !important; border-color: #cfe2ff !important; font-weight: 600; }
.sw-tags .sw-tag-ip-nat { background: #fff4e5 !important; color: #d97a00 !important; border-color: #ffe0b8 !important; }

/* 弹窗加载 spinner */
.actp-modal-loading::before { content: ''; width: 34px; height: 34px; margin-right: 12px; border: 3px solid #dbe7ff; border-top-color: #2b7cff; border-radius: 50%; animation: actpRot .8s linear infinite; }
@keyframes actpRot { to { transform: rotate(360deg); } }

/* ── AI 对话流：头像 + 气泡 + 打字动画 + 发送转圈 ── */
#swAIResult { display: flex; flex-direction: column; }
.sw-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; }
.sw-row-u { justify-content: flex-end; }
.sw-col { display: flex; flex-direction: column; min-width: 0; max-width: 94%; }
.sw-ava { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.sw-ava-a { background: linear-gradient(135deg,#2b7cff,#17b0ff); box-shadow: 0 2px 8px rgba(43,124,255,.35); }
.sw-ava-u { background: #64748b; }
.sw-row .sw-msg { margin: 0; max-width: 100%; }
.sw-dots { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 6px; }
.sw-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9fb4d6; animation: swBounce 1.2s infinite; }
.sw-dots i:nth-child(2) { animation-delay: .15s; }
.sw-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes swBounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.sw-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: swRot .7s linear infinite; vertical-align: middle; }
@keyframes swRot { to { transform: rotate(360deg); } }
@media screen and (max-width: 768px) {
  .sw-col { max-width: calc(100% - 44px); }
  .sw-ava { width: 30px; height: 30px; font-size: 12px; }
}

/* ── AI 选型面板（卡片 + 标题栏 + 快捷提问 + 可滚动对话流） ── */
.sw-ai { background: #fff; border: 1px solid #e8eef7; border-radius: 16px; padding: 16px; box-shadow: 0 8px 30px rgba(30,60,120,.07); }
.sw-ai-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sw-ai-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #1e293b; font-size: 15px; }
.sw-ai-brand b { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg,#2b7cff,#17b0ff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.sw-ai-reset { border: 1px solid #dbe4f0; background: #fff; color: #64748b; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: .15s; }
.sw-ai-reset:hover { border-color: #2b7cff; color: #2b7cff; background: #f0f6ff; }
.sw-ai-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sw-ai-quick button { border: 1px solid #dbe4f0; background: #f8fbff; color: #334155; font-size: 13px; padding: 7px 13px; border-radius: 20px; cursor: pointer; transition: .15s; }
.sw-ai-quick button:hover { border-color: #2b7cff; color: #2b7cff; background: #f0f6ff; }
.sw-ai-stream { max-height: 60vh; overflow-y: auto; margin-top: 14px; }
.sw-ai-stream:empty { display: none; margin: 0; }
.sw-ai-stream::-webkit-scrollbar { width: 6px; }
.sw-ai-stream::-webkit-scrollbar-thumb { background: #dbe4f0; border-radius: 3px; }
@media screen and (max-width: 768px) {
  .sw-ai { padding: 12px; border-radius: 12px; }
  .sw-ai-quick button { font-size: 12px; padding: 6px 11px; }
  .sw-ai-stream { max-height: 56vh; }
}
