/**
 * 优惠码复制跳转插件 —— 前台样式
 *
 * 命名空间说明：
 *   所有选择器均以 .coupon-copy-link / .coupon-style-* / .cc-coupon-toast 开头，
 *   不包含任何裸 a、button、body 等全局选择器，不会影响网站原有链接与按钮样式。
 *
 * 三种样式彼此独立：
 *   .coupon-style-classic   经典文字链接（蓝色加粗下划线，默认）
 *   .coupon-style-emphasis  醒目文字链接（蓝色加粗 + 外链箭头）
 *   .coupon-style-button    优惠码按钮（蓝底白字圆角）
 */

/* ------------------------------------------------------------------
 * 基础（仅作用于本插件链接）
 * ------------------------------------------------------------------ */
a.coupon-copy-link {
    cursor: pointer;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    -webkit-tap-highlight-color: rgba(26, 115, 232, .15);
}

a.coupon-copy-link:focus {
    outline: 2px solid rgba(26, 115, 232, .45);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * 样式一：经典文字链接
 * ------------------------------------------------------------------ */
a.coupon-copy-link.coupon-style-classic {
    color: #1a73e8 !important;
    font-weight: bold !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

a.coupon-copy-link.coupon-style-classic:hover,
a.coupon-copy-link.coupon-style-classic:focus {
    color: #0f57c4 !important;
    text-decoration: underline !important;
}

/* ------------------------------------------------------------------
 * 样式二：醒目文字链接
 * ------------------------------------------------------------------ */
a.coupon-copy-link.coupon-style-emphasis {
    color: #1a73e8 !important;
    font-weight: bold !important;
    text-decoration: none !important;
    border-bottom: 2px solid rgba(26, 115, 232, .35);
    padding-bottom: 1px;
}

a.coupon-copy-link.coupon-style-emphasis::after {
    content: "\2197";           /* ↗ 外链箭头 */
    display: inline-block;
    margin-left: 3px;
    font-size: .92em;
    line-height: 1;
    transition: transform .15s ease;
}

a.coupon-copy-link.coupon-style-emphasis:hover {
    color: #0f57c4 !important;
    border-bottom-color: #0f57c4;
}

a.coupon-copy-link.coupon-style-emphasis:hover::after {
    transform: translate(1px, -1px);
}

/* ------------------------------------------------------------------
 * 样式三：优惠码按钮
 * ------------------------------------------------------------------ */
a.coupon-copy-link.coupon-style-button {
    display: inline-block;
    box-sizing: border-box;
    padding: 9px 18px;
    background-color: #1a73e8 !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none !important;
    border: 1px solid #1a73e8 !important;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(26, 115, 232, .25);
    vertical-align: middle;
}

a.coupon-copy-link.coupon-style-button:hover,
a.coupon-copy-link.coupon-style-button:focus {
    background-color: #0f57c4 !important;
    border-color: #0f57c4 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(15, 87, 196, .3);
    text-decoration: none !important;
}

a.coupon-copy-link.coupon-style-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(15, 87, 196, .3);
}

/* 按钮样式前后留出安全间距，避免与正文文字贴合 */
a.coupon-copy-link.coupon-style-button + a.coupon-copy-link.coupon-style-button {
    margin-left: 8px;
}

/* ------------------------------------------------------------------
 * 轻量 Toast 提示
 * ------------------------------------------------------------------ */
.cc-coupon-toast {
    position: fixed;
    left: 50%;
    bottom: 18%;
    z-index: 2147483000;
    max-width: 82vw;
    box-sizing: border-box;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(28, 28, 30, .92);
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.cc-coupon-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.cc-coupon-toast.is-error {
    background: rgba(176, 42, 42, .95);
}

/* ------------------------------------------------------------------
 * 移动端适配：放大点击区域，保证提示不遮挡正文
 * ------------------------------------------------------------------ */
@media screen and (max-width: 640px) {
    a.coupon-copy-link.coupon-style-classic,
    a.coupon-copy-link.coupon-style-emphasis {
        font-size: 16px;
        line-height: 1.8;
    }

    a.coupon-copy-link.coupon-style-button {
        display: block;
        width: 100%;
        max-width: 320px;
        padding: 13px 20px;
        font-size: 16px;
        text-align: center;
        margin: 6px auto;
    }

    a.coupon-copy-link.coupon-style-button + a.coupon-copy-link.coupon-style-button {
        margin-left: auto;
    }

    .cc-coupon-toast {
        bottom: 12%;
        font-size: 15px;
        padding: 12px 20px;
        border-radius: 10px;
    }
}
