/**
 * 通用卡片样式文件 - Base Card Styles
 * 提供所有卡片组件的通用样式，减少代码重复，提高维护性
 */

/* ==================== 基础卡片样式 ==================== */
.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 40px;
    box-shadow: 0 8px 20px var(--shadow);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: visible;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 卡片头部样式 ==================== */
.card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

.card-icon {
    width: 50px;
    height: 50px;
    background: var(--speed-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 6px 12px var(--shadow);
    align-self: center;
}

.card-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 2px;
    line-height: 1.2;
    margin-top: 0;
}

.card-title h2 .highlight-blue {
    display: inline-block;
    padding: 0 2px;
}

.card-title p {
    color: var(--secondary-accent);
    font-size: 0.9rem;
    line-height: 1.2;
    margin: 0;
}

/* ==================== 通用按钮样式 ==================== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--speed-gradient);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 15px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow);
    color: white;
    text-decoration: none;
}

.button i {
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    font-size: 1.1rem;
}

/* 微信绿色按钮 */
.wechat-btn {
    background: linear-gradient(135deg, #07C160 0%, #10B981 100%);
    cursor: pointer;
}

.wechat-btn:hover {
    background: linear-gradient(135deg, #06A44A 0%, #0F9D68 100%);
}

/* 按钮组样式 */
.button-group {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin-top: 5px;
    width: 100%;
    gap: 12px;
}

.button-group .button {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 180px;
    min-height: 54px;
}

/* 确保按钮容器完全一致 */
.button-group .button-with-tooltip {
    flex: 1;
    max-width: 180px;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-group .button-with-tooltip .button {
    width: 100%;
    max-width: none;
    flex: none;
}

/* ==================== 工具提示样式 ==================== */
.tooltip {
    position: absolute;
    top: -40px;
    left: 20px;
    transform: translateX(0);
    background-color: var(--warning-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    white-space: nowrap;
    z-index: 1000;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    margin-left: 0;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--warning-color);
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
}

/* 带工具提示的按钮容器 */
.button-with-tooltip {
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

/* ==================== 分割线样式 ==================== */
.reward-divider {
    position: relative;
    text-align: center;
    margin: 0px 0;
    height: 24px;
}

.reward-divider:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border) 15%, var(--card-border) 85%, transparent);
    z-index: 1;
}

.divider-icon {
    position: relative;
    z-index: 2;
    background-color: var(--card-bg);
    color: var(--warning-color);
    padding: 0 15px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 6px var(--shadow);
}

/* ==================== 二维码样式 ==================== */
.qrcode-img {
    width: 200px;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: transform 0.3s ease;
    border: 6px solid white;
    cursor: pointer;
    margin: 0 auto;
    display: block;
}

[data-theme="dark"] .qrcode-img {
    border-color: var(--card-bg);
}

.qrcode-img:hover {
    transform: scale(1.05);
}

/* ==================== 高亮文字样式 ==================== */
.highlight {
    color: var(--speed-green);
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 5px;
    background-color: rgba(16, 185, 129, 0.2);
    border-radius: 2px;
    z-index: -1;
}

.highlight-blue {
    color: var(--accent-color);
    font-weight: 700;
}

.highlight-special {
    color: var(--warning-color);
    position: relative;
    font-weight: 700;
}

.highlight-special::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(245, 158, 11, 0.2);
    border-radius: 2px;
    z-index: -1;
}

/* ==================== 彩带装饰样式 ==================== */
.ribbon-wrapper {
    width: 120px;
    height: 120px;
    overflow: hidden;
    position: absolute;
    top: -3px;
    right: -3px;
    z-index: 1;
}

.ribbon {
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    text-align: center;
    transform: rotate(45deg);
    position: relative;
    padding: 7px 0;
    left: -10px;
    top: 25px;
    width: 170px;
    background-color: var(--warning-color);
    box-shadow: 0px 2px 6px rgba(0,0,0,0.15);
    z-index: 5;
}

/* 彩带颜色变体 */
.ribbon.ribbon-success {
    background-color: var(--speed-green);
}

.ribbon.ribbon-info {
    background-color: var(--accent-color);
}

.ribbon.ribbon-warning {
    background-color: var(--warning-color);
}

.ribbon.ribbon-danger {
    background-color: #ef4444;
}

/* ==================== 动画效果 ==================== */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 5px 15px var(--shadow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 20px var(--shadow);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 5px 15px var(--shadow);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes button-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.button-shake {
    animation: button-shake 0.8s ease-in-out;
}

/* ==================== 按钮特效 ==================== */
.button-sheen {
    position: relative;
    overflow: hidden;
}

.button-sheen::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.button-sheen:hover::before {
    left: 100%;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    .card {
        padding: 25px;
        margin-bottom: 30px;
        border-radius: 15px;
        min-height: 350px;
    }
    
    .card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        margin-right: 12px;
    }
    
    .card-title h2 {
        font-size: 1.3rem;
    }
    
    .card-title p {
        font-size: 0.85rem;
    }
    
    .button {
        padding: 12px 25px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    
    .button-group {
        flex-direction: row;
        gap: 8px;
    }
    
    .button-group .button {
        padding: 12px 15px;
        font-size: 0.85rem;
        white-space: nowrap;
        min-width: 0;
    }
    
    .button-group .button-with-tooltip {
        flex: 1;
        max-width: none;
    }
    
    .button-group .button-with-tooltip .button {
        width: 100%;
        padding: 12px 15px;
        font-size: 0.85rem;
        white-space: nowrap;
        min-width: 0;
    }
    
    .qrcode-img {
        width: 160px;
        border-width: 4px;
    }
    
    .ribbon-wrapper {
        width: 100px;
        height: 100px;
        top: -2px;
        right: -2px;
    }
    
    .ribbon {
        font-size: 0.7rem;
        padding: 5px 0;
        left: -15px;
        top: 20px;
        width: 150px;
        box-shadow: 0px 1px 3px rgba(0,0,0,0.1);
    }
    
    .tooltip {
        font-size: 0.8rem;
        padding: 6px 12px;
        top: -35px;
    }
}

/* ==================== 超小屏幕适配 ==================== */
@media (max-width: 480px) {
    .card {
        padding: 20px;
        border-radius: 12px;
        min-height: 320px;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-right: 10px;
    }
    
    .card-title h2 {
        font-size: 1.2rem;
    }
    
    .button-group .button {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .button-group .button-with-tooltip .button {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .qrcode-img {
        width: 140px;
    }
}

/* ==================== 无障碍访问优化 ==================== */
.button:focus,
.qrcode-img:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* 智能客服按钮移除focus边框，保持视觉协调 */
.renewal-customer-service:focus {
    outline: none;
    box-shadow: none;
}

/* 减少动画敏感用户的动效 */
@media (prefers-reduced-motion: reduce) {
    .card,
    .button,
    .qrcode-img,
    .tooltip,
    .pulse-animation,
    .button-shake {
        animation: none;
        transition: none;
    }
    
    .button:hover {
        transform: none;
    }
    
    .qrcode-img:hover {
        transform: none;
    }
}