/* === AsoRank Floating Contact Widget ===
   主色对齐本站 #6153ff
   ============================================ */
/* ===== Floating Contact Widget ===== */
.contact-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    --cw-theme: #7c3aed;
    /* 固定基准字号：站内两套模板根字号不同（16px / 62.5%），
       锚定后组件内文字不受页面模板影响 */
    font-size: 16px;
    /* 固定字体族：子页 layui 模板继承 Helvetica（600/700 会渲染成真粗体），
       首页 cropium 模板继承 PingFangSC-Regular（合成加粗，视觉更轻）。
       统一锚定为首页的字体栈，保证全站观感一致。 */
    font-family: PingFangSC-Regular, "微软雅黑", sans-serif, arial;
}

@keyframes widgetBreathe {
    0%, 100% {
        box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35), 0 0 0 0 rgba(124, 58, 237, 0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 12px 36px rgba(124, 58, 237, 0.5), 0 0 0 12px rgba(124, 58, 237, 0);
        transform: scale(1.06);
    }
}

.contact-widget-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--cw-theme);
    color: #fff;
    box-shadow: 0 8px 28px rgba(124, 58, 237, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: widgetBreathe 2.6s ease-in-out infinite;
}

.contact-widget.active .contact-widget-toggle {
    animation-play-state: paused;
}

.contact-widget-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 32px rgba(124, 58, 237, 0.45);
}

.contact-widget-toggle svg {
    width: 28px;
    height: 28px;
    position: absolute;
    transition: all 0.3s ease;
}

.contact-widget .contact-icon-open { opacity: 1; transform: rotate(0deg) scale(1); }
.contact-widget .contact-icon-close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.contact-widget.active .contact-icon-open { opacity: 0; transform: rotate(90deg) scale(0.6); }
.contact-widget.active .contact-icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

.contact-widget-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-widget.active .contact-widget-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.contact-widget-header {
    padding: 18px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contact-widget-title {
    font-size: 17.6px;
    font-weight: 700;
}

.contact-widget-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 22.4px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.contact-widget-close:hover { background: rgba(255,255,255,0.35); }

.contact-widget-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.contact-agent {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f5;
}

.contact-agent-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.contact-agent-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22.4px;
    font-weight: 700;
}

.contact-agent-name {
    font-weight: 700;
    font-size: 16.8px;
    color: #1e1b4b;
}

.contact-agent-subtitle {
    font-size: 13.6px;
    color: #64748b;
    margin-top: 2px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-method {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    border-radius: 14px;
    background: #f8f7fc;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.contact-method:hover {
    background: #f0edff;
    transform: translateX(-3px);
}

.contact-method.has-qr::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    background: var(--cw-theme);
    border-radius: 0 0 0 14px;
    transition: width 0.2s ease;
}

.contact-method.has-qr:hover::after {
    width: 40%;
}

.contact-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-method-icon svg {
    width: 22px;
    height: 22px;
}

.contact-method-content {
    flex: 1;
    min-width: 0;
}

.contact-method-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 1px;
}

.contact-method-value {
    font-size: 15.2px;
    font-weight: 600;
    color: #1e1b4b;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.contact-method-value .cm-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* 邮箱地址强制单行完整显示 */
.email-method .contact-method-value {
    overflow: visible;
}

.email-method .contact-method-value .cm-text {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-size: 14.1px;
}

.email-method .contact-method-copy {
    width: 20px;
    height: 20px;
}

.email-method .contact-method-action {
    padding: 4px 8px;
    font-size: 11.2px;
}

.contact-method-copy {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 3px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.contact-method-copy:hover {
    background: #f1f5f9;
    color: var(--cw-theme);
}

.contact-method-copy svg {
    width: 14px;
    height: 14px;
}

.contact-method-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-theme);
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.08);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.contact-method-action svg {
    width: 14px;
    height: 14px;
}

.contact-method:hover .contact-method-action {
    background: var(--cw-theme);
    color: #fff;
}

/* 旧的内联预览已弃用，改为由 JS 驱动的左侧浮动预览 */
.contact-method-qr-preview {
    display: none;
}

/* 左侧浮动二维码预览 */
.contact-widget-qr-float {
    position: absolute;
    top: 0;
    right: calc(100% + 14px);
    width: 170px;
    padding: 12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px) translateY(-50%) scale(0.95);
    transform-origin: right center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    text-align: center;
    cursor: pointer;
}

.contact-widget-qr-float:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.contact-widget-qr-float.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) translateY(-50%) scale(1);
}

.contact-widget-qr-float::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #fff;
}

.contact-widget-qr-float img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #f0f0f5;
    display: block;
}

.contact-widget-qr-float p {
    margin: 8px 0 0;
    font-size: 11.2px;
    color: #94a3b8;
}

/* QR Modal */
.contact-widget-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.contact-widget-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.contact-widget-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.contact-widget-modal-content {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-widget-modal.active .contact-widget-modal-content {
    transform: scale(1);
}

.contact-widget-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.contact-widget-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.contact-widget-modal-brand {
    margin-bottom: 14px;
}

.contact-widget-modal-brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.contact-widget-modal-brand-icon svg {
    width: 34px;
    height: 34px;
}

.contact-widget-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 6px;
}

.contact-widget-modal-subtitle {
    font-size: 14.4px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.contact-widget-modal-qr {
    width: 220px;
    height: 220px;
    margin: 0 auto 16px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #f0f0f5;
    background: #fff;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.contact-widget-modal-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.contact-widget-modal-hint {
    font-size: 13.6px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.contact-widget-modal-id {
    font-size: 18.4px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 20px;
    word-break: break-all;
}

.contact-widget-modal-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.contact-widget-copy-btn,
.contact-widget-open-btn {
    flex: 1;
    padding: 13px 16px;
    border: none;
    border-radius: 14px;
    font-size: 15.2px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-widget-copy-btn {
    background: #1e1b4b;
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 27, 75, 0.25);
}

.contact-widget-copy-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.contact-widget-copy-btn:hover {
    background: #2d2a5c;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30, 27, 75, 0.35);
}

.contact-widget-open-btn {
    background: #f3f4f6;
    color: #1e1b4b;
}

.contact-widget-open-btn:hover {
    background: #e5e7eb;
}

@media (max-width: 480px) {
    .contact-widget {
        right: 16px;
        bottom: 16px;
    }
    .contact-widget-panel {
        width: calc(100vw - 32px);
        max-width: none;
        bottom: 72px;
    }
    .contact-widget-toggle {
        width: 54px;
        height: 54px;
    }
    .contact-widget-toggle svg {
        width: 24px;
        height: 24px;
    }
    .contact-widget-qr-float {
        display: none;
    }
    .contact-widget-modal-content {
        padding: 24px 20px 20px;
        max-width: 320px;
    }
    .contact-widget-modal-qr {
        width: 190px;
        height: 190px;
    }
    .contact-widget-modal-actions {
        flex-direction: column;
    }
}


/* ===== 联系我们页面正文：联系方式卡片（与浮层组件同源数据） ===== */
.asocards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 14px;
    margin: 22px 0 4px;
    font-size: 16px;
    font-family: PingFangSC-Regular, "微软雅黑", sans-serif, arial;
}
.asocard {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #eceafb;
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: all .2s ease;
}
a.asocard:hover {
    border-color: #6153ff;
    box-shadow: 0 10px 26px rgba(97, 83, 255, .12);
    transform: translateY(-2px);
}
.asocard__ic {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.asocard__ic svg { width: 22px; height: 22px; }
.asocard__txt { min-width: 0; }
.asocard__lb { display: block; font-size: 12px; color: #64748b; margin-bottom: 2px; }
.asocard__val { display: block; font-size: 15.2px; font-weight: 600; color: #1e1b4b; word-break: break-all; }
@media (max-width: 600px) {
    .asocards { grid-template-columns: 1fr; }
}
.asocard.wechat-method { cursor: pointer; }
