/* ===== 动画关键帧（顶层定义，兼容所有浏览器） ===== */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@keyframes stockPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ===== 优惠券卡片 — 实物撕边风格 × 现代渐变美学 ===== */
.coupon-card {
    position: relative;
    display: flex;
    border-radius: 1rem;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
    overflow: hidden;
    animation: slideInUp 0.4s ease-out forwards;
    padding: 0;
}
.coupon-card:hover {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    transform: translateY(-0.25rem);
}
/* 已领取状态 */
.coupon-card.claimed {
    opacity: 0.9;
}
.coupon-card.claimed .coupon-left-panel {
    background: linear-gradient(160deg, #22c55e 0%, #16a34a 100%) !important;
}
/* 过期状态 */
.coupon-card.expired {
    opacity: 0.55;
    filter: grayscale(0.6);
    pointer-events: none;
}
.coupon-card.expired .coupon-left-panel {
    filter: grayscale(0.8);
}

/* ===== 左侧面板 — 金额/折扣色块展示区 ===== */
.coupon-left-panel {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    overflow: hidden;
    width: 130px;
    min-height: 170px;
    padding: 20px 14px;
}
/* 撕边圆孔视觉 */
.coupon-left-panel::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background-color: #ffffff;
    transform: translateY(-50%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
/* 光泽扫过效果 */
.coupon-left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}
/* 类型颜色 */
.coupon-left-panel.type-fixed {
    background: linear-gradient(160deg, #f59e0b 0%, #d97706 100%);
}
.coupon-left-panel.type-percentage {
    background: linear-gradient(160deg, #3b82f6 0%, #2563eb 100%);
}
.coupon-left-panel.type-threshold {
    background: linear-gradient(160deg, #ef4444 0%, #dc2626 100%);
}
.coupon-left-panel .value-main {
    font-size: 1.875rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.coupon-left-panel .value-sub {
    font-size: 0.75rem;
    line-height: 1rem;
    margin-top: 0.375rem;
    opacity: 0.9;
    font-weight: 500;
}
.coupon-left-panel .type-label {
    font-size: 10px;
    margin-top: 0.5rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(4px);
}

/* ===== 锯齿分隔线 ===== */
.coupon-divider {
    position: relative;
    flex-shrink: 0;
    width: 1px;
    margin: 14px 0;
    background: repeating-linear-gradient(
        to bottom,
        #e5e7eb 0px,
        #e5e7eb 6px,
        transparent 6px,
        transparent 12px
    );
}
/* 分隔线上下的圆孔装饰 */
.coupon-divider::before,
.coupon-divider::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    background-color: #f3f4f6;
    transform: translateX(-50%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}
.coupon-divider::before { top: -5px; }
.coupon-divider::after  { bottom: -5px; }

/* ===== 右侧面板 — 详细信息区 ===== */
.coupon-right-panel {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem 1rem 1rem 1rem;
    min-width: 0;
}
.coupon-right-panel .name-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-width: 0;
}
.coupon-right-panel .coupon-name {
    flex: 1 1 0%;
    font-size: 0.875rem;
    line-height: 1.25;
    font-weight: 700;
    color: #1f2937;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.coupon-right-panel .desc-text {
    font-size: 0.75rem;
    line-height: 1.625;
    color: #9ca3af;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 适用范围标签 */
.scope-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1;
}
.scope-badge.newbie {
    background-color: #dcfce7;
    color: #15803d;
}
.scope-badge.renewal {
    background-color: #dbeafe;
    color: #1d4ed8;
}

/* 底部信息行 */
.coupon-bottom-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}
.coupon-meta {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    flex: 1 1 0%;
}
.coupon-validity {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
}
.coupon-validity i {
    margin-right: 0.25rem;
    color: #d1d5db;
}

/* ===== 库存进度条 — 增强版 ===== */
.coupon-stock-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.coupon-stock-label {
    font-size: 11px;
    white-space: nowrap;
}
.coupon-stock-bar {
    flex: 1 1 0%;
    height: 0.375rem;
    border-radius: 9999px;
    overflow: hidden;
    background: #e5e7eb;
}
.coupon-stock-fill {
    height: 100%;
    border-radius: 9999px;
    transition-property: all;
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
    transition-duration: 500ms;
}
/* 库存紧张状态 */
.coupon-stock-bar.urgent .coupon-stock-fill {
    animation: stockPulse 1.5s ease-in-out infinite;
}

/* ===== 优惠券类型微型徽章（右侧使用） ===== */
.coupon-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.025em;
    flex-shrink: 0;
    line-height: 1;
}
.coupon-type-badge.type-fixed {
    background-color: #fef3c7;
    color: #b45309;
}
.coupon-type-badge.type-percentage {
    background-color: #dbeafe;
    color: #1d4ed8;
}
.coupon-type-badge.type-threshold {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* ===== 领取按钮 — 主题色渐变 ===== */
.claim-btn {
    border-style: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--theme-color), var(--theme-color-deep));
    color: white;
    box-shadow: 0 2px 8px var(--theme-color-3);
}
.claim-btn:hover:not(:disabled) {
    transform: translateY(-0.125rem);
    box-shadow: 0 4px 16px var(--theme-color-5);
}
.claim-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
}
.claim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}
.claim-btn.claimed-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 2px 8px rgba(34,197,94,0.3);
}
/* 按钮光泽扫描 */
.claim-btn::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
}

/* 新人专享券 — 未登录引导按钮，更具吸引力 */
.claim-btn-newbie {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.35);
    animation: newbiePulse 2s ease-in-out infinite;
}
.claim-btn-newbie:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.5);
}
@keyframes newbiePulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(249, 115, 22, 0.35); }
    50%      { box-shadow: 0 4px 24px rgba(249, 115, 22, 0.6); }
}

/* ===== 我的优惠券条目 ===== */
.user-coupon-item {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}
.user-coupon-item:hover {
    background-color: rgba(250, 245, 255, 0.5);
    border-color: var(--theme-color-2);
}

/* ===== Banner 区域 ===== */
.banner-section {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: 3rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--theme-color-deep) 100%);
}
.banner-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
}
.banner-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.03);
}

/* ===== 每日领取进度条 ===== */
.daily-progress {
    height: 0.25rem;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
}
.daily-progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition-property: all;
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
    transition-duration: 500ms;
    background: rgba(255, 255, 255, 0.8);
}

/* ===== 脉冲点动画工具类 ===== */
.pulse-dot {
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ===== 交错入场延迟 ===== */
.coupon-card:nth-child(2) { animation-delay: 0.05s; }
.coupon-card:nth-child(3) { animation-delay: 0.1s; }
.coupon-card:nth-child(4) { animation-delay: 0.15s; }
.coupon-card:nth-child(5) { animation-delay: 0.2s; }
.coupon-card:nth-child(6) { animation-delay: 0.25s; }