/* 左侧优惠券浮动弹窗 + 文章页底部推荐 */

.coupon-float {
    --cf-orange: #ff5000;
    --cf-orange-dark: #e64500;
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
    width: 188px;
    font-family: "SimSun", "宋体", "STSong", "华文宋体", serif;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.coupon-float.is-collapsed {
    width: auto;
}

.coupon-float.is-hidden {
    display: none;
}

.coupon-float-panel {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.coupon-float.is-collapsed .coupon-float-panel {
    display: none;
}

.coupon-float-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: linear-gradient(135deg, #ff5000, #ff7a3d);
    color: #fff;
    font-size: 0.82rem;
}

.coupon-float-head span {
    font-weight: 600;
}

.coupon-float-toggle {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.coupon-float-toggle:hover {
    background: rgba(255, 255, 255, 0.35);
}

.coupon-float-body {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 10px;
}

.coupon-float-body:hover {
    color: inherit;
    text-decoration: none;
}

.coupon-float-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f3f3;
    margin-bottom: 8px;
}

.coupon-float-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.coupon-float-badge {
    position: absolute;
    left: 0;
    bottom: 0;
    background: var(--cf-orange);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-top-right-radius: 6px;
}

.coupon-float-title {
    font-size: 0.8rem;
    line-height: 1.35;
    height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
    color: var(--text-color, #212529);
}

.coupon-float-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.coupon-float-final {
    color: var(--cf-orange);
    font-size: 1rem;
    font-weight: 700;
}

.coupon-float-final small {
    font-size: 0.72rem;
    font-weight: 600;
}

.coupon-float-label {
    color: var(--cf-orange);
    font-size: 0.72rem;
    font-weight: 600;
}

.coupon-float-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 0 10px 8px;
}

.coupon-float-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.2;
    padding: 7px 4px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.coupon-float-btn:disabled,
.coupon-float-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.coupon-float-btn-primary {
    background: var(--cf-orange);
    color: #fff;
    border-color: var(--cf-orange);
}

.coupon-float-btn-primary:hover {
    background: var(--cf-orange-dark);
    color: #fff;
    border-color: var(--cf-orange-dark);
}

.coupon-float-btn-outline {
    background: transparent;
    color: var(--cf-orange);
    border-color: var(--cf-orange);
}

.coupon-float-btn-outline:hover {
    background: rgba(255, 80, 0, 0.08);
    color: var(--cf-orange-dark);
}

.coupon-float-foot {
    padding: 0 10px 10px;
}

.coupon-float-more {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    color: var(--cf-orange);
    text-decoration: none;
    padding: 6px 0;
    border-top: 1px dashed var(--border-color, #dee2e6);
}

.coupon-float-more:hover {
    color: var(--cf-orange-dark);
}

.coupon-float-toast {
    position: absolute;
    left: 50%;
    bottom: -36px;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(33, 37, 41, 0.92);
    color: #fff;
    font-size: 0.72rem;
    padding: 6px 10px;
    border-radius: 4px;
    z-index: 1;
    pointer-events: none;
}

.coupon-float-toast.is-error {
    background: rgba(180, 40, 40, 0.94);
}

.coupon-float-tab {
    display: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.15em;
    background: linear-gradient(180deg, #ff5000, #ff7a3d);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 14px 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 80, 0, 0.35);
    font-size: 0.85rem;
}

.coupon-float.is-collapsed .coupon-float-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.coupon-float-tab:hover {
    filter: brightness(1.05);
}

/* 文章页底部一行优惠券 */
.article-coupon-row {
    --cf-orange: #ff5000;
    margin: 28px 0 8px;
    padding: 18px 0 4px;
    border-top: 1px solid var(--border-color, #dee2e6);
}

.article-coupon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.article-coupon-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color, #212529);
}

.article-coupon-header h4 i {
    color: var(--cf-orange);
}

.article-coupon-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-size: 0.88rem;
    color: #fff;
    background: var(--cf-orange);
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    text-decoration: none;
}

.article-coupon-more-btn:hover {
    color: #fff;
    background: #e64500;
}

.article-coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

.article-coupon-card {
    display: flex;
    flex-direction: column;
    color: inherit;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.article-coupon-card:hover {
    border-color: var(--cf-orange);
    box-shadow: 0 4px 12px rgba(255, 80, 0, 0.12);
}

.article-coupon-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.article-coupon-card-link:hover {
    color: inherit;
    text-decoration: none;
}

.article-coupon-actions {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 0 6px 8px;
}

.article-coupon-actions .coupon-float-btn {
    flex: 1;
    min-width: 0;
    font-size: 0.7rem;
    padding: 6px 2px;
}

.article-coupon-card .cover {
    position: relative;
    aspect-ratio: 1;
    background: #f3f3f3;
    overflow: hidden;
}

.article-coupon-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-coupon-card .badge-coupon {
    position: absolute;
    left: 0;
    bottom: 0;
    background: var(--cf-orange);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-top-right-radius: 6px;
}

.article-coupon-card .body {
    padding: 8px;
}

.article-coupon-card .title {
    font-size: 0.8rem;
    line-height: 1.35;
    height: 2.7em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.article-coupon-card .price {
    color: var(--cf-orange);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.article-coupon-card .price small {
    font-size: 0.7rem;
}

.article-coupon-card .coupon-label {
    font-size: 0.72rem;
    font-weight: 600;
}

.article-coupon-empty {
    display: none;
    color: var(--text-muted, #6c757d);
    font-size: 0.9rem;
    padding: 8px 0;
}

[data-theme="dark"] .coupon-float-panel,
[data-theme="dark"] .article-coupon-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .coupon-float-cover,
[data-theme="dark"] .article-coupon-card .cover {
    background: #2a2a3a;
}

@media (max-width: 991.98px) {
    .coupon-float {
        left: 0;
        top: auto;
        bottom: 96px;
        transform: none;
        width: auto;
    }

    .coupon-float:not(.is-collapsed) {
        width: 168px;
        left: 8px;
    }

    .coupon-float.is-collapsed .coupon-float-tab {
        border-radius: 0 8px 8px 0;
        padding: 12px 7px;
        font-size: 0.78rem;
    }
}

@media (max-width: 575.98px) {
    .article-coupon-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        gap: 8px;
    }

    .article-coupon-header {
        flex-wrap: wrap;
    }

    .article-coupon-actions .coupon-float-btn {
        font-size: 0.65rem;
        padding: 5px 1px;
    }
}
