/* 角色选择组件样式 */
.roles-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.role-card {
    background: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: var(--transition);
}

.role-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.role-card:hover::before {
    transform: scaleX(1);
}

.role-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.role-card.selected::before {
    transform: scaleX(1);
}

.role-card.selecting {
    animation: selectPulse 0.3s ease-out;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.role-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.role-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    transition: var(--transition);
}

.role-card:hover .role-avatar img {
    transform: scale(1.1);
}

.role-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.role-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* 卡牌选择组件样式 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.email-card {
    aspect-ratio: 1.4;
    perspective: 1000px;
    cursor: pointer;
}

.card-back,
.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--border-radius-large);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-medium);
}

.card-back {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.card-back::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.card-number {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.card-front {
    background: var(--card-background);
    transform: rotateY(180deg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.email-card.flipped .card-back {
    transform: rotateY(-180deg);
}

.email-card.flipped .card-front {
    transform: rotateY(0deg);
}

.email-card:hover:not(.flipped) {
    transform: translateY(-4px);
}

.email-card:hover:not(.flipped) .card-back,
.email-card:hover:not(.flipped) .card-front {
    box-shadow: var(--shadow-hover);
}

.email-preview {
    text-align: center;
}

.email-subject {
    font-size: 1.3rem; /* 增大字体大小 */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.email-sender {
    font-size: 1rem; /* 增大字体大小 */
    color: var(--text-secondary);
    margin: 0;
}

/* 邮件内容模态框样式 */
.email-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(24, 144, 255, 0.1);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.email-modal.active {
    opacity: 1;
    visibility: visible;
}

.email-modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius-xl);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(24, 144, 255, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: var(--transition);
}

.email-modal.active .email-modal-content {
    transform: scale(1) translateY(0);
}

.email-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.email-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--card-hover);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.email-modal-close:hover {
    background: var(--primary-color);
    color: white;
}

.email-modal-body {
    padding: 32px;
}

/* 邮件查看器样式 */
.email-viewer {
    margin-bottom: 32px;
}

.email-header {
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.email-meta {
    display: grid;
    gap: 12px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 60px;
    font-size: 0.9rem;
}

.meta-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
}

.email-body {
    background: var(--card-background);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 24px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.email-body p {
    margin-bottom: 16px;
}

.email-body p:last-child {
    margin-bottom: 0;
}

.email-body ul {
    margin: 16px 0;
    padding-left: 24px;
}

.email-body li {
    margin-bottom: 8px;
}

.email-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 钓鱼特征样式 */
.phishing-feature {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    transition: none;
    position: relative;
    color: inherit;
    background: none;
    border: none;
    font-weight: inherit;
    /* 彻底无高亮 */
}

.phishing-feature:hover {
    background: none;
    transform: none;
}

.phishing-feature.identified {
    background: rgba(82, 196, 26, 0.1);
    border: 1px dashed #52c41a;
    color: #52c41a;
}

.phishing-feature.just-identified {
    animation: identifyPulse 0.5s ease-out;
}

@keyframes identifyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: rgba(82, 196, 26, 0.3); }
    100% { transform: scale(1); }
}

/* 任务面板样式 */
.task-panel {
    background: var(--secondary-color);
    border-radius: var(--border-radius-large);
    padding: 24px;
}

.task-header {
    margin-bottom: 20px;
}

.task-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    width: var(--progress-width, 0%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 0.8s ease-out;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.task-content {
    margin-bottom: 24px;
}

.task-instruction {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    animation: featureSlideIn 0.3s ease-out;
}

@keyframes featureSlideIn {
    0% { 
        opacity: 0;
        transform: translateX(-20px);
    }
    100% { 
        opacity: 1;
        transform: translateX(0);
    }
}

.feature-icon {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
}

.feature-text {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.task-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.task-actions .btn {
    min-width: 100px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .roles-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .role-card {
        padding: 24px 20px;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
        gap: 16px;
        padding: 16px;
    }
    
    .email-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .email-modal-header,
    .email-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .role-avatar {
        width: 60px;
        height: 60px;
    }
    
    .role-avatar img {
        width: 45px;
        height: 45px;
    }
    
    .role-title {
        font-size: 1.1rem;
    }
    
    .role-description {
        font-size: 0.85rem;
    }
}