/**
 * 激活码系统样式 - v1.6 完全优化版
 * 与首页风格完美融合
 * 路径: /css/activation.css
 */

/* ========================================
   使用次数徽章 - 完全优化版（符合首页风格）
   ======================================== */
.usage-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
    cursor: default;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.usage-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.28);
}

.usage-badge strong {
    font-size: 14px;
    font-weight: 600;
    margin: 0 1px;
}

.usage-badge i {
    font-size: 15px;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.88;
        transform: scale(1.05);
    }
}

/* 已激活状态 */
.usage-badge.activated {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: shimmer 2.5s infinite;
}

.usage-badge.activated i {
    animation: rotate 4s linear infinite;
}

@keyframes shimmer {
    0%, 100% { 
        box-shadow: 0 2px 6px rgba(240, 147, 251, 0.22); 
    }
    50% { 
        box-shadow: 0 3px 12px rgba(240, 147, 251, 0.38); 
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 次数用完状态 */
.usage-badge.exhausted {
    background: linear-gradient(135deg, #f5576c 0%, #c94b4b 100%);
    animation: warning 1.5s ease-in-out infinite;
}

@keyframes warning {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(245, 87, 108, 0.28);
    }
    50% {
        box-shadow: 0 2px 6px rgba(245, 87, 108, 0.5);
    }
}

/* ========================================
   激活码弹窗
   ======================================== */
.activation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: activationFadeIn 0.25s ease;
}

@keyframes activationFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 遮罩层 */
.activation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* 弹窗内容 */
.activation-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: activationSlideUp 0.3s ease;
    z-index: 10001;
}

@keyframes activationSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 关闭按钮 */
.activation-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.activation-close:hover {
    color: #333;
    background: #f5f5f5;
}

/* 弹窗标题区 */
.activation-header {
    text-align: center;
    margin-bottom: 24px;
}

.activation-header i {
    font-size: 46px;
    color: #667eea;
    margin-bottom: 12px;
    display: block;
}

.activation-header h3 {
    font-size: 19px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.activation-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 二维码区域 */
.activation-qrcode {
    text-align: center;
    margin-bottom: 24px;
}

.activation-qrcode img {
    width: 170px;
    height: 170px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    display: inline-block;
}

.activation-qrcode p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* 输入框组 */
.activation-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.activation-input-group input {
    flex: 1;
    height: 42px;
    padding: 0 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.25s;
    font-family: inherit;
    outline: none;
}

.activation-input-group input::placeholder {
    font-weight: 500;
    letter-spacing: normal;
}

.activation-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

/* 输入错误状态 */
.activation-input-group input.error {
    border-color: #f5576c;
    animation: activationShake 0.4s;
}

@keyframes activationShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* 输入成功状态 */
.activation-input-group input.success {
    border-color: #00b42a;
    color: #00b42a;
}

/* 激活按钮 */
.activation-input-group button {
    height: 42px;
    padding: 0 22px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    white-space: nowrap;
}

.activation-input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(102, 126, 234, 0.35);
}

.activation-input-group button:active {
    transform: translateY(0);
}

.activation-input-group button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 提示信息 */
.activation-tips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
}

.activation-tips i {
    font-size: 15px;
    color: #667eea;
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 768px) {
    /* 徽章适配 */
    .usage-badge {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .usage-badge strong {
        font-size: 13px;
    }
    
    /* 弹窗适配 */
    .activation-content {
        padding: 24px;
        width: 95%;
        max-width: 95%;
    }
    
    .activation-header h3 {
        font-size: 18px;
    }
    
    .activation-qrcode img {
        width: 145px;
        height: 145px;
    }
    
    /* 输入框纵向排列 */
    .activation-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .activation-input-group input,
    .activation-input-group button {
        width: 100%;
    }
}

/* ========================================
   打印时隐藏
   ======================================== */
@media print {
    .usage-badge,
    .activation-modal {
        display: none !important;
    }
}
