/**
 * 卡片消息样式 — 复刻李太白源码卡片功能
 * 包含：换绑确认卡、交易信息卡、订单已支付卡、订单咨询卡、账号密码卡、文字图片卡
 */

/* ========== 通用卡片容器 ========== */
.card-msg-row { display: flex; margin-bottom: 16px; align-items: flex-start; }
.card-msg-row.msg-user { justify-content: flex-end; }
.card-msg-row.msg-kefu { justify-content: flex-start; }
.card-msg-row.msg-system { justify-content: center; }

.card-avatar {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; margin-right: 8px; background: #f0f0f0;
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-wrap { display: flex; flex-direction: column; max-width: 85%; }
.card-msg-row.msg-user .card-wrap { align-items: flex-end; }
.card-msg-row.msg-kefu .card-wrap { align-items: flex-start; }

.card-sender-name {
  font-size: 11px; color: #999; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.card-msg-time { font-size: 11px; color: #bbb; margin-top: 4px; }

/* ========== 换绑确认卡片 (bind-confirm-card) ========== */
.custom-html-card.bind-confirm-card {
  box-sizing: border-box; width: 100%; max-width: 300px;
  background: #fff; border-radius: 10px; padding: 18px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333; border: 1px solid rgba(15,23,42,.06);
}
.bind-card-title { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: #333; line-height: 1.3; }
.bind-card-title .at-user { color: #1a73e8; }
.bind-info-row { display: flex; align-items: baseline; margin-bottom: 8px; }
.bind-info-label { color: #666; font-size: 13px; min-width: 130px; }
.bind-info-value { color: #c41e3a; font-size: 14px; font-weight: 500; margin-left: 6px; }
.bind-steps { color: #888; font-size: 13px; line-height: 1.6; margin: 12px 0; }
.bind-steps p { margin: 0 0 8px; }
.bind-tips { background: #f5f5f5; border-radius: 6px; padding: 10px 12px; margin-bottom: 16px; }
.bind-tips p { margin: 0; color: #888; font-size: 12px; line-height: 1.5; }
.bind-tips span { color: #888; }
.custom-bind-btn-group { display: flex; gap: 10px; }
.custom-bind-btn-group button {
  flex: 1; padding: 10px 0; border-radius: 20px; font-size: 14px;
  font-weight: 500; cursor: pointer; text-align: center; border: 1px solid; background: #fff;
  transition: opacity .2s;
}
.custom-bind-btn-group button:active { opacity: .7; }
.custom-bind-btn-group button:disabled { opacity: .4; cursor: not-allowed; }
.custom-bind-fail { border-color: #1a73e8 !important; color: #1a73e8; }
.custom-bind-success { border-color: #c41e3a !important; color: #c41e3a; }

/* ========== 交易信息卡片 (tradecard) ========== */
.tradecard {
  width: clamp(248px, 82vw, 320px); min-width: 0; max-width: 100%;
  padding: 12px; border-radius: 10px; background: #fff;
  border: 1px solid rgba(15,23,42,.06); color: #222;
}
.tradecard-title { text-align: center; font-size: 17px; font-weight: 600; line-height: 1.25; margin-bottom: 12px; color: #111827; }
.tradecard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.tradecard-tags { display: flex; gap: 5px; min-width: 0; flex-wrap: wrap; }
.tradecard-tag { padding: 2px 5px; border-radius: 3px; font-size: 11px; line-height: 1.2; white-space: nowrap; }
.tradecard-tag.game { background: #fff3e0; color: #f59e0b; }
.tradecard-tag.type { background: #e8f4ff; color: #3b82f6; }
.tradecard-status { font-size: 14px; font-weight: 600; color: #f59e0b; white-space: nowrap; }
.tradecard-goods { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.tradecard-img { width: 106px; height: 106px; border-radius: 6px; object-fit: cover; flex: 0 0 106px; background: #f3f4f6; }
.tradecard-main { min-width: 0; flex: 1 1 auto; }
.tradecard-name { font-size: 14px; line-height: 1.35; margin-bottom: 5px; color: #111827; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tradecard-price { font-size: 16px; font-weight: 600; text-align: right; color: #e01b28; }
.tradecard-tip { font-size: 11px; color: #666; margin-top: 3px; line-height: 1.35; }
.tradecard-info { border-top: 1px solid #eee; padding-top: 8px; }
.tradecard-item { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; line-height: 1.35; }
.tradecard-label { color: #666; flex: 0 0 auto; }
.tradecard-value { color: #222; font-weight: 500; min-width: 0; text-align: right; word-break: break-all; }

/* ========== 订单已支付卡片 (paycard) ========== */
.paycard {
  width: clamp(204px, 72vw, 248px); min-width: 0; max-width: 100%;
  padding: 11px 12px; border-radius: 16px; background: #fff;
  border: 1px solid rgba(15,23,42,.06); color: #2f2f2f;
}
.paycard-title { font-size: 15px; font-weight: 900; line-height: 1.2; color: #2f2f2f; }
.paycard-line { margin-top: 9px; font-size: 12.5px; line-height: 1.3; color: #7b7b7b; display: flex; align-items: center; gap: 0; white-space: nowrap; overflow: hidden; }
.paycard-line.paycard-fit { font-size: 12.5px; }
.paycard-label { font-weight: 400; color: #7b7b7b; flex: 0 0 auto; }
.paycard-value { display: inline-block; min-width: 0; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: #7b7b7b; }
.paycard-line.amount-line { margin-top: 10px; padding-top: 7px; border-top: 1px solid rgba(15,23,42,.06); }
.paycard-value.amount { color: #ff8a1f; font-weight: 700; }

/* ========== 订单咨询卡片 (message-goods) ========== */
.message-goods { background: #fff; border-radius: 12px; overflow: hidden; max-width: 260px; padding: 12px; cursor: pointer; }
.message-goods .goods-content .top { align-items: center; display: flex; }
.message-goods .goods-content .top span { color: #333; font-size: 14px; font-weight: 500; line-height: 18px; }
.message-goods .goods-content .content-box { display: flex; margin-top: 8px; }
.message-goods .goods-content .content-box .pz-image { border-radius: 8px; flex-shrink: 0; height: 56px; margin-right: 8px; object-fit: cover; object-position: left top; width: 56px; background: #f2f2f2; overflow: hidden; }
.message-goods .goods-content .content-box .pz-image img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.message-goods .goods-content .content-box .info { display: flex; flex-direction: column; overflow: hidden; }
.message-goods .goods-content .content-box .info .desc { color: #333; font-size: 14px; font-weight: 400; line-height: 18px; }
.message-goods .goods-content .content-box .info .singles { color: #666; font-size: 12px; font-weight: 400; line-height: 16px; margin-top: 2px; }
.message-goods .goods-content .content-box .info .price { color: #e60f0f; font-size: 14px; font-weight: 500; line-height: 18px; margin-top: 2px; }

/* ========== 账号密码卡片 (account-password-card) ========== */
.custom-html-card.account-password-card {
  box-sizing: border-box; width: 100%; max-width: 300px;
  background: #fff; border-radius: 10px; padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333; border: 1px solid rgba(15,23,42,.06);
}
.account-password-card h3 { margin: 0 0 8px; color: #333; font-size: 16px; line-height: 1.35; }
.account-card-desc { margin: 0 0 12px; color: #888; font-size: 13px; line-height: 1.6; }
.account-card-input {
  box-sizing: border-box; width: 100%; height: 38px; margin-bottom: 9px;
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 0 12px;
  background: #f8fafc; color: #111827; font-size: 14px; outline: none;
}
.account-card-input:focus { border-color: #3b82f6; }
.account-card-submit {
  width: 100%; height: 40px; border: 0; border-radius: 999px;
  background: #1a73e8; color: #fff; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: opacity .2s;
}
.account-card-submit:active { opacity: .7; }
.account-card-submit:disabled { opacity: .4; cursor: not-allowed; }

/* ========== 文字图片卡片 (text-image-card) ========== */
.custom-html-card.text-image-card {
  box-sizing: border-box; width: 100%; max-width: 300px;
  background: #fff; border-radius: 10px; padding: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333; border: 1px solid rgba(15,23,42,.06);
}
.text-image-card h3 { margin: 0 0 10px; color: #333; font-size: 16px; line-height: 1.35; }
.text-image-card h3 span { color: #1a73e8; }
.text-image-card-text { margin: 0 0 10px; color: #888; font-size: 13px; line-height: 1.65; }
.text-image-card-img { display: block; width: 100%; border-radius: 10px; background: #f3f4f6; object-fit: cover; }

/* ========== 交易开始/实名确认/换绑步骤 — 纯文本卡片 ========== */
.agent-text-card {
  box-sizing: border-box; width: 100%; max-width: 300px;
  background: #fff; border-radius: 10px; padding: 14px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333; border: 1px solid rgba(15,23,42,.06);
}
.agent-text-card .card-heading { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 8px; }
.agent-text-card .card-body { font-size: 13px; color: #666; line-height: 1.6; }
.agent-text-card .card-body p { margin: 0 0 6px; }
.agent-text-card .card-body p:last-child { margin-bottom: 0; }

/* ========== 管理后台卡片选择器 ========== */
.card-type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 15px; }
.card-type-item {
  border: 2px solid #e5e7eb; border-radius: 8px; padding: 12px; cursor: pointer;
  transition: all .2s; text-align: center; background: #fff;
}
.card-type-item:hover { border-color: #3b82f6; background: #f8faff; }
.card-type-item.selected { border-color: #3b82f6; background: #e8f4ff; }
.card-type-item .card-type-icon { font-size: 24px; margin-bottom: 6px; }
.card-type-item .card-type-name { font-size: 13px; font-weight: 500; color: #333; }
.card-type-item .card-type-desc { font-size: 11px; color: #999; margin-top: 2px; }
