/* ========== 内联样式分离 - 快捷撤销按钮样式 ========== */
.quick-undo-button {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 10200;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.quick-undo-button.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 当批量操作面板激活时，快捷撤销按钮上移 */
.batch-panel.active ~ .quick-undo-button,
.quick-undo-button.batch-mode {
    bottom: 130px;
}

@media (max-width: 768px) {
    .quick-undo-button {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        padding: 8px 16px;
        z-index: 10200 !important;
    }
    .batch-panel.active ~ .quick-undo-button,
    .quick-undo-button.batch-mode {
        bottom: calc(180px + env(safe-area-inset-bottom, 0px));
    }
}

.quick-undo-button:hover {
    background: rgba(51, 65, 85, 0.95);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.quick-undo-button:active {
    transform: translateX(-50%) translateY(0) scale(0.98);
}

.quick-undo-icon {
    font-size: 18px;
    animation: undoIconPulse 2s ease-in-out infinite;
}

@keyframes undoIconPulse {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.quick-undo-text {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-undo-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    margin: 0 4px;
}

.quick-undo-action {
    color: #fbbf24;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.quick-undo-button:hover .quick-undo-action {
    color: #fcd34d;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* 倒计时进度条 */
.quick-undo-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    width: auto;
    height: 3px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 0 0 50px 50px;
    animation: progressCountdown 10s linear forwards;
    transform-origin: left;
}

@keyframes progressCountdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .quick-undo-button {
        bottom: 12px;
        padding: 8px 14px;
        max-width: 95vw;
        gap: 6px;
    }

    .quick-undo-text {
        max-width: 150px;
        font-size: 12px;
    }

    .quick-undo-action {
        font-size: 12px;
        letter-spacing: 0;
    }

    .quick-undo-icon {
        font-size: 16px;
    }

    .quick-undo-divider {
        margin: 0 2px;
    }
}

/* PK对象选择按钮样式 */
.pk-target-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.pk-target-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.pk-target-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* PK模式按钮样式 */
.pk-mode-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.pk-mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.pk-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* PK记录样式 */
.pk-record-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.pk-record-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.pk-record-item.undone {
    opacity: 0.6;
    background: #f1f5f9;
}

.pk-record-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pk-record-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pk-record-target {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.pk-record-time {
    color: #64748b;
    font-size: 12px;
    margin-left: auto;
}

.undone-badge {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pk-record-content {
    margin-bottom: 12px;
}

.pk-record-fighters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    padding: 12px;
    background: white;
    border-radius: 10px;
}

.fighter-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.vs-text {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.pk-record-winner {
    text-align: center;
    color: #059669;
    font-weight: 600;
    font-size: 14px;
    padding: 8px;
    background: #d1fae5;
    border-radius: 8px;
}

.pk-record-actions {
    display: flex;
    justify-content: flex-end;
}

.undo-pk-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.undo-pk-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.undo-pk-btn .btn-icon {
    font-size: 14px;
}

/* 灯泡闪烁特效 - 收到协作邀请时显示 */
.notification-bulb {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
    animation: bulbBlink 1s ease-in-out infinite;
    z-index: 10;
}

.notification-bulb::before {
    content: '💡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    filter: brightness(1.5);
}

@keyframes bulbBlink {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
    50% { opacity: 0.6; transform: scale(0.9); box-shadow: 0 0 4px rgba(251, 191, 36, 0.4); }
}

/* 导航栏按钮的灯泡容器 */
.nav-btn {
    position: relative;
}

/* 工作台标签页的灯泡容器 */
.workbench-tab {
    position: relative;
}

.workbench-tab .notification-bulb {
    width: 12px;
    height: 12px;
    top: 2px;
    right: 2px;
}

.workbench-tab .notification-bulb::before {
    font-size: 8px;
}

/* 移动端协作管理响应式样式 */
@media (max-width: 768px) {
    .collab-class-card {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    .collab-class-card > div:last-child {
        width: 100%;
        justify-content: flex-end;
    }
    .collab-class-card .collaboration-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    #myCollaboratedClassesSection,
    #ownedClassesSection,
    #inviteCollaboratorSection,
    #myCollaboratorsSection,
    #pendingInvitesManagement,
    #pendingInvitationsSection {
        padding: 16px !important;
    }
    #myCollaboratedClassesSection h4,
    #ownedClassesSection h4,
    #inviteCollaboratorSection h4,
    #myCollaboratorsSection h4,
    #pendingInvitesManagement h4,
    #pendingInvitationsSection h4 {
        font-size: 15px !important;
    }
    .realtime-sync-status-indicator {
        font-size: 11px !important;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .collab-class-card .collaboration-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    .collab-class-card {
        padding: 12px !important;
    }
}

.collaboration-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.collaboration-user-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.collaboration-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collaboration-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.collaboration-user-details {
    display: flex;
    flex-direction: column;
}

.collaboration-user-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.collaboration-user-email {
    font-size: 13px;
    color: #64748b;
}

.collaboration-user-actions {
    display: flex;
    gap: 8px;
}

.collaboration-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.collaboration-btn-invite {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.collaboration-btn-invite:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.collaboration-btn-remove {
    background: #fee2e2;
    color: #dc2626;
}

.collaboration-btn-remove:hover {
    background: #fecaca;
}

.online-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #dcfce7;
    border-radius: 20px;
    border: 2px solid #86efac;
}

.online-indicator {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.upload-dropzone.dragover {
    border-color: #667eea;
    background: #f0f9ff;
    transform: scale(1.02);
}

/* 班级共享开关样式 */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #10b981;
}

.switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* 共享班级列表样式 */
.shared-class-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shared-class-item:hover {
    border-color: #667eea;
    background: #f0f9ff;
}

.shared-class-item.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.shared-class-item.active .shared-class-owner {
    color: rgba(255,255,255,0.8);
}

.shared-class-owner {
    font-size: 12px;
    color: #64748b;
}
