
.uap-referral-poster-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.uap-referral-poster-btn:hover {
    background: var(--uap-action-bg, #0e7a6d);
    color: #fff;
    border-color: var(--uap-action-bg, #0e7a6d);
}
.uap-referral-poster-btn svg { flex-shrink: 0; }

.uap-ref-poster-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uap-ref-poster-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 400px;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.uap-ref-poster-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.uap-ref-poster-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1;
}
.uap-ref-poster-modal-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    outline: none;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.uap-ref-poster-modal-header button:hover,
.uap-ref-poster-modal-header button:focus {
    background: #f3f4f6;
    color: #374151;
    outline: none;
    box-shadow: none;
}
.uap-ref-poster-modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    min-height: 340px;
    background: #f9fafb;
}
.uap-ref-poster-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
}
.uap-ref-poster-preview { text-align: center; }
.uap-ref-poster-preview img {
    max-width: 100%;
    width: auto;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}
.uap-ref-poster-error {
    color: #dc2626;
    font-size: 14px;
    padding: 40px 20px;
    text-align: center;
}
.uap-ref-poster-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
}
.uap-ref-poster-tip {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    flex: 1;
    line-height: 1.4;
}
.uap-ref-poster-modal-footer button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    margin: 0;
    background: var(--uap-action-bg, #0e7a6d);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.uap-ref-poster-modal-footer button:hover { opacity: 0.9; }
.uap-ref-poster-modal-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.uap-ref-poster-canvas {
    width: 375px;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-top: 0;
    border-radius: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #ffffff;
    color: #111827;
}
.uap-rp-head {
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 20px 28px 16px;
    border-top: 5px solid #0e7a6d;
    border-top-color: var(--uap-action-bg, #0e7a6d);
    border-bottom: 1px solid #f0f1f3;
    background-color: #ffffff;
    background-image: none;
    text-align: center;
}
.uap-rp-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 32px;
}
.uap-rp-brand-mark {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: #0e7a6d;
    background-color: var(--uap-action-bg, #0e7a6d);
}
.uap-rp-brand.has-logo .uap-rp-brand-mark {
    width: auto;
    height: auto;
    border-radius: 0;
    background-color: transparent;
}
.uap-rp-brand.no-mark .uap-rp-brand-mark,
.uap-rp-brand.is-wide .uap-rp-site-name,
.uap-rp-brand.has-logo .uap-rp-monogram { display: none; }
.uap-rp-logo { display: none; }
.uap-rp-brand.has-logo .uap-rp-logo { display: block; }
.uap-rp-monogram {
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}
.uap-rp-site-name {
    color: #111827;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uap-rp-intro {
    margin: 8px auto 0;
    padding: 0;
    max-width: 300px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}
.uap-rp-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    padding: 0 20px 20px;
}
.uap-rp-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 16px;
}
.uap-rp-avatar-wrap {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    padding: 3px;
    box-sizing: border-box;
    background-color: #ffffff;
    background-image: none;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.14);
}
.uap-rp-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    box-sizing: border-box;
}
.uap-rp-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.uap-rp-name {
    margin-top: 10px;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uap-rp-kicker {
    margin-top: 3px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}
.uap-rp-headline {
    margin: 14px 0 12px;
    padding: 0;
    color: #111827;
    font-size: 19px;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
    max-width: 92%;
    letter-spacing: 0.01em;
}
.uap-rp-benefits {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 14px;
    padding: 0;
    border-radius: 12px;
    background-color: rgba(14, 122, 109, 0.1);
    background-color: var(--uap-primary-alpha, rgba(14, 122, 109, 0.1));
    background-image: none;
    overflow: hidden;
}
.uap-rp-benefits.has-reward {
    display: flex;
    flex-direction: column;
}
.uap-rp-perk {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    text-align: center;
}
.uap-rp-perk-kicker {
    display: block;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}
.uap-rp-perk-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}
.uap-rp-perk-value {
    color: #0e7a6d;
    color: var(--uap-action-bg, #0e7a6d);
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.uap-rp-perk-unit {
    color: #0e7a6d;
    color: var(--uap-action-bg, #0e7a6d);
    font-size: 15px;
    font-weight: 700;
}
.uap-rp-perk-hint {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.4;
}
.uap-rp-note {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 14px;
    text-align: center;
}
.uap-rp-note-title {
    display: block;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.uap-rp-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    box-sizing: border-box;
    flex-shrink: 0;
    padding: 12px 12px 12px 16px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
}
.uap-rp-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.uap-rp-card-title {
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}
.uap-rp-card-code {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
    min-width: 0;
}
.uap-rp-card-label {
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.3;
}
.uap-rp-code {
    min-width: 0;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.3;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uap-rp-card-site {
    margin-top: 4px;
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.uap-rp-qrcode {
    width: 86px;
    height: 86px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    background-color: #ffffff;
}
.uap-rp-qrcode canvas { display: none !important; }
.uap-rp-qrcode img {
    display: block !important;
    width: 80px !important;
    height: 80px !important;
    margin: 0 !important;
}

.uap-ref-poster-mobile-save {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 16px;
}
.uap-ref-poster-mobile-tip {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}
.uap-ref-poster-mobile-save img {
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
}
.uap-ref-poster-mobile-close {
    padding: 10px 32px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .uap-ref-poster-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
    }
    .uap-ref-poster-modal-body { padding: 16px; }
}

